:root {
  --font-sans: "Outfit", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --bg: #efe8d8;
  --bg-2: #e4dcc8;
  --surface: rgba(255, 250, 240, 0.86);
  --surface-2: #fffdf8;
  --ink: #16140f;
  --muted: #5e584c;
  --line: rgba(22, 20, 15, 0.1);
  --accent: #0f6e62;
  --accent-2: #c45c16;
  --info: #1d4e89;
  --warning: #a16207;
  --danger: #9f1239;
  --success: #166534;
  --shadow: 0 18px 50px rgba(40, 28, 8, 0.12);
  --radius: 18px;
  --radius-sm: 10px;
  --sidebar: 232px;
  --topbar: 64px;
}

[data-theme="dark"] {
  --bg: #0c1014;
  --bg-2: #151b22;
  --surface: rgba(20, 27, 34, 0.88);
  --surface-2: #1b242e;
  --ink: #eef3f1;
  --muted: #9aa7a1;
  --line: rgba(238, 243, 241, 0.1);
  --accent: #3dd6c1;
  --accent-2: #f0a05a;
  --info: #7db4ff;
  --warning: #f5c36e;
  --danger: #ff8aa0;
  --success: #7dffa6;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-2), var(--bg));
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1, h2, h3 { font-weight: 560; letter-spacing: -0.03em; margin: 0 0 0.35em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
p { color: var(--muted); line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 650;
}
.lede { max-width: 42rem; }
.muted { color: var(--muted); }
.fine { font-size: 0.8rem; color: var(--muted); }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
}
.btn-primary { background: var(--accent); color: #06221e; font-weight: 650; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.icon-btn, .text-btn {
  background: transparent; border: 0; color: var(--ink); cursor: pointer; min-height: 40px; min-width: 40px;
}
.field { display: grid; gap: 0.35rem; font-size: 0.9rem; }
.field span { color: var(--muted); }
.field input, .command-box input, .choice {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}
.stack { display: grid; gap: 0.9rem; }
.alert { padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); }
.alert-danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--ink); }

.auth-body { min-height: 100vh; }
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.auth-panel {
  padding: 4.5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card {
  margin: auto;
  width: min(420px, calc(100% - 2rem));
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.brand-mark { font-weight: 650; letter-spacing: 0.02em; font-size: 0.95rem; }
.auth-points { padding-left: 1.1rem; color: var(--muted); }
.choice {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-align: left;
}

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 1rem 0.8rem;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(20px);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.logo {
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: baseline;
}
.brand-lockup { display: inline-flex; align-items: baseline; line-height: 1; }
.brand-in { color: var(--muted); font-weight: 450; letter-spacing: -0.04em; }
.brand-e { color: var(--accent); font-weight: 650; }
.brand-spect { color: var(--ink); font-weight: 560; letter-spacing: -0.03em; }
.logo .brand-in { font-size: 0.92em; }
.company-label { margin-bottom: 1rem; font-size: 0.85rem; opacity: 0.85; }
.side-nav { display: grid; gap: 0.2rem; }
.nav-link {
  display: flex; gap: 0.7rem; align-items: center;
  text-decoration: none; padding: 0.55rem 0.7rem; border-radius: 12px; color: var(--muted);
}
.nav-link.is-active, .nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-ico {
  width: 8px; height: 8px; border-radius: 99px; background: var(--accent); opacity: 0.55;
}

.topbar {
  height: var(--topbar);
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px);
}
.search-trigger {
  flex: 1; display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 0.55rem 0.9rem; cursor: pointer; min-height: 44px;
}
kbd {
  font-family: var(--font-mono); font-size: 0.72rem;
  border: 1px solid var(--line); border-radius: 6px; padding: 0.1rem 0.35rem;
}
.topbar-actions, .profile { display: flex; align-items: center; gap: 0.7rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #06221e; font-weight: 650;
}
.profile-meta { display: grid; line-height: 1.15; }
.profile-meta small { color: var(--muted); }
.content { padding: 1.4rem 1.5rem 5.5rem; display: grid; gap: 1.4rem; }

.hero-band, .section-head, .split { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.hero-pills, .strip { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.78rem; border: 1px solid var(--line);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.warning { color: var(--warning); }
.status-pill.info { color: var(--info); }
.status-pill.danger { color: var(--danger); }
.status-pill.success { color: var(--success); }
.status-pill.neutral { color: var(--muted); }

.chip-action {
  text-decoration: none; border: 1px solid var(--line); padding: 0.65rem 0.9rem;
  border-radius: 999px; background: var(--surface); min-height: 44px; display: inline-flex; align-items: center;
}
.metric-rail {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem;
}
.metric-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.metric-label, .metric-hint { margin: 0; font-size: 0.82rem; }
.metric-value { font-family: var(--font-mono); font-size: 1.45rem; margin: 0.25rem 0; color: var(--ink); }
.attention { background: linear-gradient(180deg, color-mix(in srgb, var(--warning) 10%, var(--surface)), var(--surface)); }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; }
.timeline, .attention-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.timeline li, .attention-list li { display: flex; gap: 0.8rem; align-items: flex-start; }
.time { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); min-width: 3rem; }
.empty-state {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; background: var(--surface);
}
.empty-state.compact { padding: 1rem; }
.trend-placeholder {
  height: 140px; display: grid; place-items: center; color: var(--accent); opacity: 0.7;
}
.trend-placeholder svg { width: min(100%, 520px); height: 90px; }

.mobile-dock { display: none; }
.mobile-only { display: none; }

.command-overlay {
  position: fixed; inset: 0; background: rgba(8, 10, 12, 0.55);
  display: grid; place-items: start center; padding-top: 12vh; z-index: 30;
}
.command-box {
  width: min(640px, calc(100% - 1.5rem));
  background: var(--surface-2); border-radius: 20px; padding: 1rem; box-shadow: var(--shadow);
}
.command-box ul { list-style: none; padding: 0; margin: 0.6rem 0; }
.command-box a { display: block; text-decoration: none; padding: 0.65rem; border-radius: 10px; }
.command-box a:hover, .command-box a:focus { background: var(--surface); }

.app-shell.is-nav-open .sidebar { transform: translateX(0); }

@media (max-width: 1100px) {
  .metric-rail { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 280px); z-index: 20;
    transform: translateX(-110%); transition: transform 160ms ease;
  }
  .app-shell.is-nav-open .sidebar { transform: translateX(0); }
  .mobile-dock {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 0.45rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
    z-index: 15;
  }
  .mobile-dock a, .mobile-dock button {
    background: none; border: 0; color: var(--muted); text-decoration: none; text-align: center; min-height: 44px;
  }
  .mobile-only { display: inline-flex; }
  .profile-meta, kbd, .nav-label { } 
  .auth-layout { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
