:root {
  --brand-navy: #0a2540;
  --brand-blue: #3a86ff;
  --brand-aqua: #38bdf8;
  --brand-soft: #f7fafc;
  --brand-text: #1f2937;
  --brand-muted: #6b7280;
  --brand-border: #e5e7eb;
  --brand-bg-grad: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif; color: var(--brand-text); }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.bg { background: var(--brand-bg-grad); min-height: 100vh; display: flex; flex-direction: column; }

/* Nav */
.nav {
  background: white;
  border-bottom: 1px solid var(--brand-border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-blue) 100%);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--brand-muted); }
.nav-actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--brand-border); background: white;
  color: var(--brand-text); font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: all .15s ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.btn.primary { background: var(--brand-blue); color: white; border-color: var(--brand-blue); }
.btn.primary:hover { background: #2563eb; }
.btn.ghost { background: transparent; border: 1px solid transparent; color: var(--brand-muted); }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.lg { padding: 12px 28px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Hero */
.hero { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.hero-inner { max-width: 900px; text-align: center; }
.hero h1 { font-size: 44px; margin: 0 0 16px; color: var(--brand-navy); line-height: 1.15; letter-spacing: -.02em; }
.lead { font-size: 18px; color: var(--brand-muted); margin-bottom: 32px; }
.cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 56px; flex-wrap: wrap; }
.features {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.features li {
  background: white; border: 1px solid var(--brand-border);
  padding: 20px; border-radius: var(--radius); text-align: left;
  box-shadow: var(--shadow-sm); font-size: 14px; color: var(--brand-muted);
}
.features li strong { color: var(--brand-navy); display: block; margin-bottom: 4px; font-size: 15px; }

/* Login */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card {
  background: white; border: 1px solid var(--brand-border);
  padding: 36px; border-radius: 14px; box-shadow: var(--shadow-md);
  width: 100%; max-width: 420px;
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.muted { color: var(--brand-muted); }
.login-card form { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--brand-border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
.login-card input:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.error { padding: 10px 12px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 8px; font-size: 13px; }
.hidden { display: none; }
.hint { font-size: 12px; margin-top: 14px; }
.small { font-size: 12px; }

/* Dashboard */
.dash-wrap { flex: 1; max-width: 980px; width: 100%; margin: 0 auto; padding: 24px; }
.dash-wrap h1 { margin: 0 0 4px; font-size: 28px; color: var(--brand-navy); }
.status-bar {
  font-size: 13px; color: var(--brand-muted);
  background: white; border: 1px dashed var(--brand-border);
  padding: 8px 12px; border-radius: 8px; margin: 18px 0 24px;
}
.card {
  background: white; border: 1px solid var(--brand-border);
  border-radius: var(--radius); margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--brand-border);
}
.card-head h2 { margin: 0; font-size: 16px; color: var(--brand-navy); }
.badge {
  background: var(--brand-blue); color: white; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.list { padding: 6px 0; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--brand-border);
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; margin-bottom: 2px; }
.row-sub { font-size: 13px; color: var(--brand-muted); }
.empty { padding: 24px 20px; color: var(--brand-muted); font-size: 14px; text-align: center; }
.pill {
  display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
  background: #f3f4f6; color: #4b5563;
}
.pill.ok { background: #dcfce7; color: #15803d; }
.pill.err { background: #fee2e2; color: #b91c1c; }
.pill.wait { background: #fef3c7; color: #a16207; }
.debug { background: #f8fafc; }
.debug summary { padding: 14px 20px; cursor: pointer; font-size: 13px; color: var(--brand-muted); }
.debug pre {
  margin: 0; padding: 12px 20px; font-size: 11px;
  max-height: 320px; overflow: auto; background: #0f172a; color: #e2e8f0;
}

/* Footer */
.foot {
  text-align: center; padding: 24px; font-size: 12px;
  color: var(--brand-muted); border-top: 1px solid var(--brand-border); background: white;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 30px; }
  .lead { font-size: 16px; }
  .nav { padding: 12px 16px; }
  .row { flex-direction: column; align-items: flex-start; }
  .row .btn { width: 100%; }
  .dash-wrap { padding: 16px; }
}
