:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --ink: #1a2332;
  --muted: #5b6b7c;
  --line: #d5dee8;
  --brand: #0b4f6c;
  --brand-2: #1c7c9c;
  --accent: #d97706;
  --ok: #157347;
  --bad: #b42318;
  --warn: #9a6700;
  --shadow: 0 10px 30px rgba(15, 40, 60, 0.08);
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #cde8f3 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #f8e7c9 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0b4f6c 0%, #08384d 100%);
  color: #e8f4fa;
  padding: 24px 16px;
}
.sidebar .brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
.sidebar .brand small {
  display: block;
  font-weight: 400;
  opacity: 0.75;
  font-size: 0.78rem;
  margin-top: 4px;
}
.sidebar nav { margin-top: 28px; display: grid; gap: 6px; }
.sidebar a {
  color: #d7ebf4;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
}
.sidebar a:hover, .sidebar a.active {
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}
.sidebar .who {
  margin-top: 32px;
  font-size: 0.85rem;
  opacity: 0.85;
  padding: 0 8px;
}

.main { padding: 28px 32px 48px; }
.page-title { margin: 0 0 6px; font-size: 1.6rem; }
.page-sub { margin: 0 0 22px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 1.1rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.stat .n { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; }

label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(28, 124, 156, 0.25);
  border-color: var(--brand-2);
}
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}
.btn:hover { background: var(--brand-2); }
.btn.secondary { background: #e8eef3; color: var(--ink); }
.btn.secondary:hover { background: #d7e2ea; }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert.ok { background: #e8f6ee; border-color: #b7e0c5; color: var(--ok); }
.alert.bad { background: #fdeceb; border-color: #f2c2be; color: var(--bad); }
.alert.warn { background: #fff7e6; border-color: #f0d9a8; color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.ok { background: #d9f0e2; color: var(--ok); }
.badge.bad { background: #f8d7d4; color: var(--bad); }
.badge.warn { background: #ffe8b8; color: var(--warn); }
.badge.muted { background: #e8eef3; color: var(--muted); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.35rem; }
.auth-card p { margin: 0 0 18px; color: var(--muted); }

.preview-box {
  background: #f7fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}
.cred-box {
  background: #102a38;
  color: #e8f4fa;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}
.cred-box strong { color: #f8e7c9; }

.bulk-table input, .bulk-table select { min-width: 120px; }
.row-tools { display: flex; gap: 8px; align-items: end; margin-bottom: 12px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { padding-bottom: 8px; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .stats, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 18px; }
}
