:root {
  --navy: #071a3c;
  --blue: #1465ff;
  --sky: #21a7ff;
  --gold: #f9b72f;
  --blue-soft: #eaf2ff;
  --line: #d9e3f2;
  --text: #0d1b33;
  --muted: #63708a;
  --bg: #f5f8fc;
  --card: #ffffff;
  --good: #0f9f6e;
  --warn: #d48806;
  --bad: #d92d20;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
a { color: var(--blue); text-decoration: none; }
.shell { display: grid; grid-template-columns: 245px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: white; padding: 22px 16px; display: flex; flex-direction: column; }
.sidebar.account { background: var(--navy); height: 100vh; overflow-y: auto; position: sticky; top: 0; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.brand { font-size: 30px; font-weight: 900; letter-spacing: .2px; }
.muted { color: #a9b9d6; margin: 2px 0 0; }
.muted-text { color: var(--muted); }
.sidebar nav { display: grid; gap: 7px; margin-top: 24px; }
.sidebar a { color: #eaf2ff; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.sidebar a:hover { background: rgba(255,255,255,.1); }
.admin-nav { gap: 20px !important; }
.account-nav { gap: 18px !important; }
.nav-group { display: grid; gap: 4px; }
.nav-label { color: #8298bd; font-size: 11px; font-weight: 900; letter-spacing: .06em; padding: 0 12px 5px; text-transform: uppercase; }
.sidebar a.active { background: #f9b72f; color: #071a3c; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.14); margin-top: auto; padding-top: 16px; }
.sidebar-footer .sidebar-link { display: block; margin-bottom: 8px; }
.logout-form { margin-top: 24px; }
.sidebar-footer .logout-form { margin-top: 0; }
.button.full { width: 100%; text-align: center; }
.content { padding: 28px; min-width: 0; max-width: 1680px; width: 100%; }
.account-content { max-width: 1280px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 32px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.user-chip { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 18px rgba(13,27,51,.045); }
.card { padding: 18px; }
.card span { color: var(--muted); display: block; font-weight: 700; }
.card strong { display: block; font-size: 26px; margin-top: 8px; }
.card small { color: var(--muted); font-weight: 700; }
.metric-card strong { line-height: 1.05; }
.metric-alert { border-color: #f3b7ae; box-shadow: inset 3px 0 0 var(--bad); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; inset: auto -28px -36px auto; width: 96px; height: 96px; border-radius: 999px; background: rgba(20,101,255,.08); }
.panel { padding: 18px; margin-bottom: 18px; overflow-x: auto; }
.panel h2 { font-size: 19px; margin: 0; }
.panel .section-heading p { margin: 4px 0 0; }
.info-panel { background: #f8fbff; }
.info-panel p { color: var(--muted); margin-bottom: 0; }
.grid.two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 9px; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.table-subline { color: var(--muted); display: block; font-size: 12px; margin-top: 3px; }
.empty-state { color: var(--muted); padding: 22px 10px; text-align: center; }
.badge { display: inline-block; border-radius: 999px; background: var(--blue-soft); color: var(--blue); padding: 4px 9px; font-weight: 800; font-size: 12px; }
.badge.good { background: #e9fbf4; color: var(--good); }
.badge.bad { background: #fff0ed; color: var(--bad); }
.badge.soft { background: #fff7df; color: #9a6300; }
.button, button { background: var(--blue); color: white; border: 0; border-radius: 8px; padding: 10px 13px; font-weight: 800; cursor: pointer; }
.button.small { padding: 6px 10px; font-size: 13px; }
.button.secondary, button.secondary { background: var(--blue-soft); color: var(--blue); }
.action-list { display: flex; flex-wrap: wrap; gap: 10px; }
button:disabled { background: #dbe4f1; color: #7a879c; cursor: not-allowed; }
button.danger { background: var(--bad); }
.secondary-danger { background: #fff0ed !important; color: var(--bad) !important; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; margin-top: 5px; }
textarea { min-height: 95px; resize: vertical; }
input[type="checkbox"] { width: auto; margin-right: 6px; }
.password-input-wrap { display: block; position: relative; }
.password-field { min-width: 0; }
.password-input-wrap input[type="password"], .password-input-wrap input[type="text"] { padding-right: 46px; }
.password-visibility-toggle { align-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--muted); display: inline-flex; height: 36px; justify-content: center; padding: 0; position: absolute; right: 5px; top: calc(50% + 2.5px); transform: translateY(-50%); width: 36px; }
.password-visibility-toggle:hover { background: var(--blue-soft); color: var(--navy); }
.password-visibility-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.password-visibility-toggle svg { height: 19px; width: 19px; }
label { display: block; font-weight: 800; margin: 10px 0; }
form { display: grid; gap: 10px; margin-bottom: 14px; }
.inline-form { grid-template-columns: 1fr auto; align-items: end; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.form-stack { max-width: 760px; }
.user-create-form { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.user-create-form label { margin-bottom: 0; }
.user-active-check { min-height: 42px; }
.compact-form { display: inline; margin: 0; }
.compact-grid { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; margin: 0; align-items: center; }
.copyable { background: var(--blue-soft); color: var(--navy); border-radius: 6px; padding: 4px 7px; }
.note { background: var(--blue-soft); border-radius: 10px; padding: 10px; }
.download-grid { align-items: stretch; }
.download-card { display: flex; flex-direction: column; gap: 9px; }
.download-card-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.download-card p { margin: 0; }
.download-admin-card h2 { margin-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.page-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-bar { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto auto; margin-bottom: 18px; }
.filter-bar label { margin: 0; }
.form-note { margin: 0; }
.status-bad { color: var(--bad); font-weight: 800; }
.control-stack { display: grid; }
.control-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) auto; margin: 0; padding: 13px 0; }
.control-row:first-child { padding-top: 0; }
.control-row:last-child { border-bottom: 0; padding-bottom: 0; }
.control-row small { color: var(--muted); display: block; margin-top: 3px; }
.limits-form { grid-template-columns: 1fr 1fr auto; }
.limits-form label { margin-bottom: 0; }
.reset-usage-form { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.summary-grid { margin: 18px 0; }
.notes-list { display: grid; gap: 8px; }
.notes-list .note { margin: 0; }
.notes-list .note p { margin: 0 0 4px; }
.action-panel { background: #f8fbff; }
.activation-panel { border-left: 3px solid var(--gold); }
.account-summary-panel { align-items: center; display: flex; justify-content: space-between; gap: 20px; padding: 22px; }
.account-summary-main { align-items: center; display: flex; gap: 18px; }
.account-summary-main strong { display: block; font-size: 28px; line-height: 1.1; margin-top: 4px; }
.eyebrow { color: var(--muted); display: block; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.account-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-settings-panel .action-list { margin-top: 16px; }
.quick-setting-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.quick-setting-list div { padding: 14px 16px; }
.quick-setting-list div + div { border-left: 1px solid var(--line); }
.quick-setting-list span { color: var(--muted); display: block; font-size: 13px; }
.quick-setting-list strong { display: block; margin-top: 4px; }
.plan-summary { align-items: start; display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); }
.plan-summary h2 { font-size: 28px; margin: 4px 0 10px; }
.compact-summary { max-width: 520px; }
.plan-actions { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.download-version { color: var(--muted); font-size: 13px; }
.download-description { display: -webkit-box; flex: 1; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.download-channel-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.download-footer-note { align-items: center; border-top: 1px solid var(--line); color: var(--muted); display: flex; gap: 10px; padding: 4px 2px; }
.download-footer-note strong { color: var(--text); }
.label-optional { color: var(--muted); font-size: 12px; font-weight: 600; }
.form-hint { color: var(--muted); font-size: 13px; margin: 0; }
.success-hint { color: var(--good); }
.marketing-opt-out { align-items: flex-start; display: flex; font-size: 13px; gap: 7px; margin: 0; }
.marketing-opt-out input { margin: 2px 0 0; }
.usage-list { display: grid; gap: 14px; }
.usage-item { margin-bottom: 0; }
.usage-heading { align-items: end; display: flex; justify-content: space-between; gap: 16px; }
.usage-heading div > span, .usage-item > small { color: var(--muted); }
.usage-heading strong { display: block; font-size: 22px; margin-top: 3px; }
.usage-heading > span { font-weight: 900; }
.progress-track { background: #e6edf8; border-radius: 999px; height: 10px; margin: 16px 0 8px; overflow: hidden; }
.progress-track span { background: var(--blue); display: block; height: 100%; }
.preference-form { gap: 0; }
.setting-row { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) auto; margin: 0; padding: 16px 0; }
.setting-row span, .setting-row small { display: block; }
.setting-row small { color: var(--muted); font-weight: 500; margin-top: 4px; }
.setting-row input { height: 20px; margin: 0; width: 20px; }
.privacy-details { border-top: 1px solid var(--line); color: var(--muted); padding-top: 14px; }
.privacy-details summary { color: var(--blue); cursor: pointer; font-weight: 800; }
.privacy-details p { margin-bottom: 0; }
.sticky-save-row { display: flex; justify-content: flex-end; }
.sticky-save-row button { min-width: 180px; }
.account-editor-grid .panel { margin-bottom: 0; }
.saved-item-list { display: grid; }
.saved-item { align-items: center; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; padding: 14px 0; }
.saved-item:first-child { border-top: 0; }
.saved-item small { color: var(--muted); display: block; margin-top: 3px; }
.saved-item.vertical { align-items: flex-start; display: block; }
.saved-item p { color: var(--muted); margin: 5px 0 0; }
.checkout-summary { align-items: center; display: flex; justify-content: space-between; gap: 24px; }
.checkout-summary h2 { font-size: 26px; margin: 4px 0; }
.checkout-summary p { margin: 0; }
.checkout-summary .lead { color: var(--text); font-size: 24px; font-weight: 900; white-space: nowrap; }
.checkout-form { margin: 22px 0 10px; }
.checkout-form button { width: 100%; }
.checkout-invite { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 16px; }
.checkline { display: inline-flex; align-items: center; gap: 6px; margin-top: 0; white-space: nowrap; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(460px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 18px 54px rgba(7,26,60,.12); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.brand-mark { color: var(--blue); font-weight: 900; font-size: 28px; }
.brand-badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(145deg, var(--gold), #ffd979); color: var(--navy); font-weight: 950; border: 3px solid var(--navy); box-shadow: 0 8px 24px rgba(7,26,60,.14); }
.brand-badge.small { width: 42px; height: 42px; border-radius: 13px; font-size: 18px; }
.login-card h1 { margin-bottom: 4px; }
.login-card p { color: var(--muted); margin-top: 0; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.alert { background: #fff0ed; border: 1px solid #ffd1c8; color: var(--bad); padding: 10px; border-radius: 8px; }
.alert.success { background: #e9fbf4; border-color: #b9efd9; color: var(--good); margin-bottom: 14px; }
pre { white-space: pre-wrap; background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.summary-list { display: grid; gap: 10px; margin: 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.summary-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-list dt { color: var(--muted); font-weight: 800; }
.summary-list dd { margin: 0; font-weight: 900; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar, .sidebar.account { height: auto; overflow: visible; position: static; }
  .account-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-nav .nav-group { align-content: start; }
  .sidebar-footer { margin-top: 16px; }
  .grid.two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .user-create-form { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: 1fr; }
  .filter-bar, .limits-form { grid-template-columns: 1fr; }
  .control-row { align-items: stretch; grid-template-columns: 1fr; }
  .account-summary-panel, .checkout-summary { align-items: flex-start; flex-direction: column; }
  .account-metrics, .quick-setting-list, .plan-summary { grid-template-columns: 1fr; }
  .quick-setting-list div + div { border-left: 0; border-top: 1px solid var(--line); }
  .download-footer-note, .checkout-invite { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .signup-card input:not([type="hidden"]):not([type="checkbox"]) { font-size: 16px; min-height: 46px; }
  .signup-card .password-input-wrap input { padding-right: 52px; }
  .signup-card .password-visibility-toggle { width: 44px; height: 44px; right: 2px; }
  .signup-card > button[type="submit"] { min-height: 44px; }
  .content { padding: 20px 16px; }
  .sidebar { padding: 18px 14px; }
  .account-nav { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 28px; }
  .user-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .account-summary-main { align-items: flex-start; flex-direction: column; }
  .usage-heading { align-items: flex-start; flex-direction: column; }
}
