:root {
  --navy: #102a43;
  --blue: #146fac;
  --blue-dark: #0d5689;
  --blue-soft: #e8f4fb;
  --green: #087f5b;
  --green-soft: #e5f7f0;
  --amber: #9b6500;
  --amber-soft: #fff4d6;
  --red: #c92a2a;
  --red-soft: #fff0f0;
  --ink: #17324d;
  --muted: #61758a;
  --line: #d7e2eb;
  --surface: #ffffff;
  --background: #f3f7fa;
  --shadow: 0 14px 40px rgba(31, 63, 89, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input { font: inherit; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 36px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand, .login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), var(--navy));
  border-radius: 12px;
  font-size: 23px;
  font-weight: 800;
}

.brand strong, .login-brand strong { display: block; font-size: 20px; line-height: 1; }
.brand small, .login-brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions form { margin: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: .18s ease;
}

.button:disabled { cursor: wait; opacity: .65; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(20, 111, 172, .2); }
.button-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button-quiet { color: var(--blue-dark); background: #fff; border-color: #bfd0dd; }
.button-quiet:hover { border-color: var(--blue); background: var(--blue-soft); }
.button-full { width: 100%; margin-top: 10px; }

.page-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 30px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.hero h1 { margin: 5px 0 4px; color: var(--navy); font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.035em; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.message { margin-bottom: 20px; padding: 13px 16px; border-radius: 9px; }
.message-error { color: #8f1d1d; background: var(--red-soft); border: 1px solid #ffc9c9; }
.message-warning { color: #765000; background: var(--amber-soft); border: 1px solid #efd17b; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary-card { display: flex; min-height: 126px; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(31, 63, 89, .045); }
.summary-icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.summary-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.summary-card .label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; overflow-wrap: anywhere; color: var(--navy); font-size: 17px; }
.summary-card small { display: block; margin-top: 4px; color: var(--muted); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(330px, .72fr); gap: 20px; margin-bottom: 20px; }
.panel { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.panel-heading h2 { margin: 4px 0 0; color: var(--navy); font-size: 22px; letter-spacing: -.02em; }
.status-badge { display: inline-flex; padding: 6px 10px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status-badge-warning { color: var(--amber); background: var(--amber-soft); }
.status-badge-danger { color: var(--red); background: var(--red-soft); }
.text-link { color: var(--blue-dark); font-size: 13px; font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.usage-block { padding: 17px; background: #f7fafc; border: 1px solid var(--line); border-radius: 11px; }
.usage-copy { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 11px; color: var(--muted); font-size: 13px; }
.usage-copy strong { color: var(--navy); }
.progress-track { overflow: hidden; height: 8px; background: #dfeaf1; border-radius: 999px; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), #26a6d1); border-radius: inherit; transition: width .35s ease; }
.period-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 22px; }
.period-details div { padding-right: 12px; border-right: 1px solid var(--line); }
.period-details div:last-child { border: 0; }
.period-details dt { color: var(--muted); font-size: 11px; }
.period-details dd { margin: 4px 0 0; color: var(--navy); font-weight: 700; }
.entitlements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.entitlement-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; }
.entitlement-marker { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; font-weight: 900; }
.entitlement-marker.is-off { color: #8795a3; background: #edf1f4; }
.entitlement-item strong { display: block; font-size: 13px; }
.entitlement-item small { display: block; color: var(--muted); }

.audit-list { min-height: 240px; }
.audit-item { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.audit-item:first-child { padding-top: 0; border-top: 0; }
.audit-dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px var(--green-soft); }
.audit-dot.is-error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.audit-item strong { display: block; font-size: 13px; }
.audit-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.empty-state { margin: 0; padding: 28px 12px; color: var(--muted); text-align: center; }

.plans-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.plan-card { padding: 18px; background: #f9fbfc; border: 1px solid var(--line); border-radius: 11px; }
.plan-card.is-current { background: var(--blue-soft); border-color: #75b7dc; box-shadow: inset 0 3px 0 var(--blue); }
.plan-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card h3 { margin: 0; color: var(--navy); font-size: 17px; }
.plan-card-heading span { padding: 4px 7px; color: var(--blue-dark); background: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.plan-card ul { margin: 15px 0 0; padding: 0; list-style: none; }
.plan-card li { padding: 6px 0; color: var(--muted); border-top: 1px solid rgba(190, 208, 221, .65); font-size: 12px; }

.footer { display: flex; justify-content: space-between; width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 18px 0 30px; color: var(--muted); font-size: 12px; }
.footer a { color: var(--blue-dark); text-decoration: none; }

.login-page { min-height: 100vh; background: radial-gradient(circle at 10% 10%, #e1f3fc 0, transparent 38%), radial-gradient(circle at 90% 90%, #e8ecfa 0, transparent 40%), var(--background); }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.login-card { width: min(440px, 100%); padding: 38px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 65px rgba(31, 63, 89, .14); }
.login-brand { margin-bottom: 34px; }
.login-card h1 { margin: 7px 0 6px; color: var(--navy); font-size: 32px; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 24px; color: var(--muted); }
.login-form { display: grid; gap: 8px; }
.login-form label { margin-top: 8px; color: var(--ink); font-size: 12px; font-weight: 750; }
.login-form input { min-height: 46px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid #b9cad7; border-radius: 8px; outline: none; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 111, 172, .12); }
.login-admin-link { display: block; margin-top: 24px; text-align: center; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .topbar { padding: 0 18px; }
  .top-actions .button:first-child { display: none; }
  .page-shell, .footer { width: min(100% - 28px, 1280px); }
  .page-shell { padding-top: 26px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .summary-grid, .plans-grid, .entitlements, .period-details { grid-template-columns: 1fr; }
  .period-details div { padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel { padding: 20px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .usage-copy { flex-direction: column; gap: 3px; }
  .footer { gap: 12px; flex-direction: column; }
  .login-card { padding: 28px 22px; }
}
