/* MAP
 * §1 brand and text L5-L34
 * §2 forms and buttons L36-L90
 * §3 navigation L92-L130
 * §4 themes menu L132-L178
 * §5 dashboard cards L180-L250
 */

/* §1 brand and text */
.brand-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 75%, var(--on-band));
  border-radius: 15px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  letter-spacing: -.04em;
}
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 13px; }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { margin-bottom: 0; color: var(--text-3); }
.login-status { margin-top: 40px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; color: var(--sidebar-muted); border: 1px solid var(--sidebar-2); border-radius: 999px; font-size: 12px; }
.login-status span, .status-badge i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border-radius: 10px; font-weight: 800; }

/* §2 forms and buttons */
.form-stack { display: grid; gap: 10px; }
.form-stack label { margin-top: 4px; color: var(--text-2); font-size: 13px; font-weight: 700; }
input[type="text"], input[type="password"] { width: 100%; height: 48px; padding: 0 14px; color: var(--text); background: var(--surface-2); border: 2px solid var(--border); border-radius: 10px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.button { min-height: 44px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); border: 2px solid transparent; border-radius: 10px; background: transparent; font-weight: 700; cursor: pointer; }
.button svg, .icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { margin-top: 12px; background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--surface-2); border-color: var(--border); }
.button-secondary:hover, .button-secondary[aria-expanded="true"] { border-color: var(--border-strong); background: var(--accent-soft); }
.button-quiet { color: var(--text-2); }
.button-quiet:hover { background: var(--surface-2); color: var(--text); }
.icon-button { width: 44px; height: 44px; padding: 0; place-items: center; color: var(--text); background: var(--surface-2); border: 2px solid var(--border); border-radius: 10px; cursor: pointer; }
.alert { padding: 12px 14px; border: 2px solid; border-radius: 10px; font-size: 13px; }
.alert-danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 60%, var(--border)); }

/* §3 navigation */
.nav-item { min-height: 43px; padding: 9px 12px; display: flex; align-items: center; gap: 11px; border-radius: 9px; color: var(--sidebar-muted); font-size: 13px; font-weight: 650; }
.nav-item + .nav-item { margin-top: 2px; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item small { margin-left: auto; padding: 2px 6px; color: var(--sidebar-muted); border: 1px solid var(--sidebar-2); border-radius: 999px; font-size: 9px; text-transform: uppercase; }
.nav-item:hover:not(.disabled) { color: var(--sidebar-text); background: var(--sidebar-2); }
.nav-item.active { color: var(--sidebar-text); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.disabled { cursor: default; }

/* §4 themes menu */
.theme-control { position: relative; }
.theme-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 250px; padding: 8px; background: var(--surface); border: 2px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.theme-menu[hidden] { display: none; }
.theme-menu button { width: 100%; min-height: 58px; padding: 9px 10px; display: flex; align-items: center; gap: 12px; color: var(--text); text-align: left; background: transparent; border: 2px solid transparent; border-radius: 9px; cursor: pointer; }
.theme-menu button:hover, .theme-menu button.selected { background: var(--accent-soft); border-color: var(--border); }
.theme-menu button > span:last-child { display: flex; flex-direction: column; }
.theme-menu small { color: var(--text-3); }
.theme-swatch { width: 34px; height: 34px; flex: 0 0 auto; border: 2px solid var(--border-strong); border-radius: 9px; }
.theme-swatch.amber { background: linear-gradient(135deg, #faf9f5 50%, #c96442 50%); }
.theme-swatch.azure { background: linear-gradient(135deg, #2d3542 50%, #5aa6dc 50%); }

/* §5 dashboard cards */
.status-badge { min-height: 32px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 8px; color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--border)); border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-badge.neutral { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.metric-grid { margin-bottom: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card, .panel { background: var(--surface); border: 2px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.metric-card { min-height: 150px; padding: 20px; display: flex; flex-direction: column; }
.metric-card > span { color: var(--text-2); font-size: 13px; font-weight: 700; }
.metric-card strong { margin: 10px 0 auto; font: 750 34px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.metric-card small { color: var(--text-3); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 24px; }
.panel { padding: 24px; }
.panel-heading { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.foundation-list { display: grid; gap: 12px; }
.foundation-list > div { padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.foundation-list strong { display: block; margin-bottom: 2px; }
.foundation-list p { margin: 0; color: var(--text-3); font-size: 13px; }
.step { width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 9px; font: 700 11px/1 ui-monospace, monospace; }
.step.done { color: var(--text); background: var(--ok-soft); border-color: var(--ok); }
.next-panel { background: linear-gradient(145deg, var(--surface), var(--accent-soft)); }
.next-panel p:not(.eyebrow) { min-height: 96px; }
.progress-track { height: 8px; margin: 28px 0 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.progress-track span { width: 34%; height: 100%; display: block; background: var(--accent); border-radius: inherit; }
.next-panel small { color: var(--text-3); }

@media (max-width: 1120px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .metric-grid { grid-template-columns: 1fr; } .topbar-actions { gap: 0; } }
