/* ============================================================
   DataGo — datago.id
   Design system: Linear-inspired dark-mode-native
   Self-hosted fonts, zero JS frameworks, zero external CDN
   ============================================================ */

/* ---------- 1. Fonts (self-hosted, variable, latin subset) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-variable-latin.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format("woff2");
}

/* ---------- 2. Tokens (Linear palette) ---------- */
:root {
  /* Backgrounds — luminance stacking */
  --bg:         #08090a;
  --bg-panel:   #0f1011;
  --bg-surface: #191a1b;
  --bg-hover:   #28282c;

  /* Text — cool grayscale */
  --text:       #f7f8f8;
  --text-2:     #d0d6e0;
  --text-3:     #8a8f98;
  --text-4:     #62666d;

  /* Brand accent — indigo-violet */
  --accent:     #5e6ad2;
  --accent-bright: #7170ff;
  --accent-hover:  #828fff;
  --accent-soft: rgba(94, 106, 210, 0.12);
  --accent-ink: #ffffff;

  /* Borders — semi-transparent white */
  --line:       rgba(255,255,255,0.08);
  --line-soft:  rgba(255,255,255,0.05);
  --line-solid: #23252a;

  /* Status */
  --green:      #27a644;

  /* Layout */
  --radius:     8px;
  --radius-lg:  12px;
  --wrap:       1100px;

  /* Fonts */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- 3. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "cv01", "ss03";
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  line-height: 1.0;
  font-weight: 510;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  letter-spacing: -1.056px;
}
h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  letter-spacing: -0.704px;
  line-height: 1.13;
}
h3 {
  font-size: 1.25rem;
  font-weight: 590;
  letter-spacing: -0.24px;
  line-height: 1.33;
}
p { margin: 0 0 1em; }

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link (a11y / Rule 5) ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
}
.skip:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 590;
  border-radius: 6px;
  outline: 2px solid var(--accent-bright);
}

/* ---------- 4. Buttons (Linear style) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 510;
  font-size: 0.875rem;
  line-height: 1.14;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-feature-settings: "cv01", "ss03";
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-solid:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: rgba(255,255,255,0.02);
  color: var(--text-2);
  border-color: var(--line-solid);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

/* ---------- 5. Header (Linear: sticky, translucent) ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 9, 10, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 590;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .mark { flex: 0 0 auto; }

.menu {
  display: flex;
  align-items: center;
  gap: 20px;
}
.menu a:not(.btn) {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 510;
}
.menu a:not(.btn):hover { color: var(--text); text-decoration: none; }
.menu .btn { padding: 7px 14px; }

/* ---------- 6. Hero (Linear: compressed headline + spec card) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 80px 0 72px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 20px;
  font-weight: 400;
}

h1 em {
  font-style: normal;
  color: var(--accent-bright);
}
.lede {
  color: var(--text-3);
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 52ch;
  letter-spacing: -0.165px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.chips li {
  font-size: 12px;
  font-weight: 510;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line-solid);
  border-radius: 9999px;
  padding: 5px 12px;
}

.hero-spec {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-spec dl {
  margin: 0;
  display: grid;
}
.hero-spec dl > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.875rem;
}
.hero-spec dl > div:last-child { border-bottom: 0; }
.hero-spec dt {
  color: var(--text-4);
  font-weight: 510;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.hero-spec dd { margin: 0; color: var(--text-2); }
.hero-spec code {
  white-space: normal;
  color: var(--text);
}

/* ---------- 7. Sections (generous spacing, Linear whitespace) ---------- */
main > section { padding: 64px 0; }
main > section:first-of-type { padding-top: 0; }
.section-sub {
  color: var(--text-3);
  max-width: 60ch;
  margin: 0 0 36px;
  font-size: 0.9375rem;
  letter-spacing: -0.165px;
  line-height: 1.6;
}

/* ---------- 8. Modes / Features (Linear card style) ---------- */
.modes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: mode;
}
.mode {
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  counter-increment: mode;
  transition: background 0.15s ease;
}
.mode:hover {
  background: rgba(255,255,255,0.04);
}
.mode::before {
  content: "0" counter(mode);
  position: absolute;
  top: 22px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-4);
  font-weight: 510;
}
.mode-when {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 16px;
}
.mode-when span {
  display: block;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  border-radius: 9999px;
  padding: 4px 12px;
  width: fit-content;
  font-weight: 510;
}
.mode-body { padding-right: 40px; }
.mode-body h3 { margin-bottom: 8px; }
.mode-body p {
  color: var(--text-3);
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.6;
  letter-spacing: -0.165px;
}

/* ---------- 9. Models & terminal ---------- */
.provs {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.provs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 510;
  color: var(--text-2);
}
.p-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  flex: 0 0 auto;
}

.terminal {
  margin: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.term-bar {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.term-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-solid);
}
.term-bar span:first-child { background: var(--accent); opacity: 0.8; }
.term-title {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-4);
  font-weight: 510;
  background: none !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
}
.terminal pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
}
.terminal code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  color: inherit;
}
.c-comment { color: var(--text-4); }

/* ---------- 10. Pricing table (Linear data table) ---------- */
.table-wrap,
.plans {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.thead,
.trow {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
}
.thead {
  background: var(--bg-panel);
  font-size: 12px;
  font-weight: 510;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-4);
  border-bottom: 1px solid var(--line);
}
.trow + .trow { border-top: 1px solid var(--line-soft); }
.trow em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--text-4);
  margin-top: 2px;
}
.trow s { color: var(--text-3); opacity: 0.8; }
.trow strong {
  font-size: 1rem;
  font-weight: 510;
  color: var(--text);
}
.trow-hl {
  background: var(--accent-soft);
}
.trow-hl strong { color: var(--accent-bright); }

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 24px;
}
.plan {
  padding: 24px 20px;
}
.plan + .plan { border-left: 1px solid var(--line-soft); }
.plan p {
  color: var(--text-3);
  font-size: 0.875rem;
  margin: 8px 0 0;
  line-height: 1.5;
}
.plan strong {
  color: var(--text);
  font-weight: 510;
}

/* ---------- 11. Agents (pill badges) ---------- */
.agent-pills {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.agent-pills li {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-solid);
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 510;
  color: var(--text-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.agent-pills li:hover {
  border-color: var(--accent);
  background: rgba(255,255,255,0.04);
}

/* ---------- Language Switcher (Linear pill toggle) ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-solid);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 510;
}
.lang-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 9999px;
  color: var(--text-3);
  text-decoration: none;
  transition: all 0.15s ease;
}
.lang-toggle a:hover {
  color: var(--text);
  text-decoration: none;
}
.lang-toggle a.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 590;
}

/* ---------- Model search filter ---------- */
.model-search-wrap {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-end;
}
.model-search {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "cv01", "ss03";
  font-size: 0.875rem;
  font-weight: 400;
  width: 100%;
  max-width: 300px;
  outline: none;
  transition: border-color 0.15s ease;
}
.model-search:focus {
  border-color: var(--accent-bright);
}
.model-search::placeholder {
  color: var(--text-4);
}

/* ---------- 12. FAQ (Linear accordion) ---------- */
.faq {
  border-top: 1px solid var(--line-soft);
}
.faq details {
  border-bottom: 1px solid var(--line-soft);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 510;
  font-size: 1rem;
  padding: 18px 40px 18px 0;
  position: relative;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-bright);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after {
  content: "–";
}
.faq details p {
  color: var(--text-3);
  max-width: 72ch;
  margin: 0 0 20px;
  padding-right: 28px;
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* ---------- 13. CTA band (Linear: subtle gradient) ---------- */
.cta-band {
  text-align: center;
  background:
    radial-gradient(120% 140% at 50% 0%, var(--accent-soft) 0%, transparent 60%),
    rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 64px 24px;
}
.cta-band h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -1.056px;
}
.cta-band p {
  color: var(--text-3);
  max-width: 46ch;
  margin: 0 auto 8px;
}
.cta-band .cta-row {
  justify-content: center;
  margin: 24px 0 0;
}

/* ---------- 14. Footer (Linear: minimal grid) ---------- */
.site-foot {
  border-top: 1px solid var(--line-soft);
  margin-top: 56px;
  padding: 48px 0 24px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
}
.foot-brand p {
  color: var(--text-4);
  font-size: 0.875rem;
  margin: 12px 0 0;
  max-width: 34ch;
  line-height: 1.5;
}
.foot-h {
  font-size: 12px;
  font-weight: 510;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-4);
  margin: 0 0 12px;
}
.site-foot nav,
.site-foot > div > div:last-child { display: grid; }
.site-foot nav a,
.site-foot > div > div:last-child a {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 510;
  padding: 4px 0;
}
.site-foot nav a:hover,
.site-foot > div > div:last-child a:hover { color: var(--text); text-decoration: none; }
.foot-note {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.foot-note p {
  color: var(--text-4);
  font-size: 12px;
  margin: 0;
}

/* ---------- 15. Hamburger button ---------- */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--line-solid);
  border-radius: 6px;
  padding: 7px 8px;
  cursor: pointer;
  color: var(--text-2);
  line-height: 0;
}
.hamburger svg { display: block; }

/* ---------- 15a. Drawer overlay ---------- */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open { display: block; opacity: 1; }

/* ---------- 15b. Landing drawer (slide from right) ---------- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-panel);
  border-left: 1px solid var(--line);
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.drawer-close {
  background: none;
  border: 1px solid var(--line-solid);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-2);
  line-height: 0;
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 510;
  text-decoration: none;
}
.drawer-nav a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration: none;
}
.drawer-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 12px 0;
}
.drawer-nav .btn {
  margin-top: 4px;
  width: 100%;
  text-align: center;
}

/* ---------- 15c. Dashboard drawer (slide from left) ---------- */
.dash-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: 260px;
  max-width: 85vw;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  padding: 20px 18px;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
}
.dash-drawer.open { transform: translateX(0); }
.dash-drawer .brand { margin-bottom: 20px; }
.dash-drawer nav { display: flex; flex-direction: column; gap: 3px; }
.dash-drawer nav a {
  color: var(--text-3);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 510;
}
.dash-drawer nav a:hover { background: rgba(255,255,255,0.04); color: var(--text); text-decoration: none; }
.dash-drawer nav a.active { background: var(--accent-soft); color: var(--accent-bright); font-weight: 590; }

/* Dashboard mobile topbar */
.dash-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}

/* ---------- 15d. Responsive ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 56px 0 48px;
  }
  .modes { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .plan + .plan {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  /* Landing: show hamburger, hide inline menu links */
  .hamburger { display: block; }
  .menu > a:not(.btn),
  .menu > .lang-toggle,
  .menu > .btn { display: none; }
  .menu { gap: 8px; }

  /* Dashboard: hide sidebar, show topbar + drawer */
  .app-shell { grid-template-columns: 1fr; }
  .app-side { display: none; }
  .dash-topbar { display: flex; }
  .dash-drawer { display: block; }
  .app-main { padding: 22px 18px 50px; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }

  main > section { padding: 48px 0; }

  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }

  .thead { display: none; }
  .trow {
    grid-template-columns: 1fr 1fr;
    row-gap: 8px;
    padding: 16px;
  }
  .trow > span:first-child {
    grid-column: 1 / -1;
  }

  .foot-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 48px 20px; }

  h1 { font-size: 2rem; letter-spacing: -0.704px; }
}

/* ---------- 16. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- 17. Print ---------- */
@media print {
  .site-head,
  .cta-band,
  .site-foot { display: none; }
  body { background: #fff; color: #000; }
}

/* ============================================================
   App shell (dashboard, auth, billing)
   Tokens shared with landing via CSS custom properties
   ============================================================ */

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.app-side { border-right: 1px solid var(--line); padding: 22px 18px; background: var(--bg-panel); }
.app-side .brand { display: flex; align-items: center; gap: 9px; font-weight: 590; font-size: 17px; color: var(--text); text-decoration: none; }
.app-side nav { margin-top: 26px; display: flex; flex-direction: column; gap: 3px; }
.app-side nav a { color: var(--text-3); text-decoration: none; padding: 9px 11px; border-radius: 6px; font-size: 14px; font-weight: 510; }
.app-side nav a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.app-side nav a.active { background: var(--accent-soft); color: var(--accent-bright); font-weight: 590; }
.app-main { padding: 30px 34px 60px; max-width: 1040px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; margin: 0 0 5px; letter-spacing: -0.704px; font-weight: 510; }
.page-head p { margin: 0; color: var(--text-3); font-size: 14px; }

/* ---------- Cards ---------- */
.card { background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 16px; margin: 0 0 4px; font-weight: 510; }
.card .card-sub { color: var(--text-3); font-size: 13px; margin: 0 0 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .label { color: var(--text-4); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 510; }
.stat .value { font-size: 24px; font-weight: 510; margin-top: 7px; letter-spacing: -0.704px; }
.stat .value.accent { color: var(--accent-bright); }
.stat .hint { color: var(--text-4); font-size: 12px; margin-top: 5px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 6px; font-weight: 510; }
.input, select.input, textarea.input {
  width: 100%; background: rgba(255,255,255,0.02); border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; padding: 10px 12px;
  font-family: inherit; font-size: 15px; font-feature-settings: "cv01", "ss03";
}
.input:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono { font-family: var(--font-mono); font-size: 13px; }
.field-error { color: #ff8b7a; font-size: 13px; margin-top: 5px; }

/* ---------- App Buttons ---------- */
.btn-danger { background: transparent; border-color: #4a2020; color: #ff8b7a; }
.btn-danger:hover { background: #2a1212; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: var(--text-4); font-weight: 510; font-size: 12px;
  text-transform: uppercase; letter-spacing: 1.2px; padding: 9px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono-cell { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 9999px; font-size: 12px; font-weight: 510; }
.badge-ok { background: var(--accent-soft); color: var(--accent-bright); }
.badge-warn { background: rgba(255, 196, 84, 0.14); color: #ffc454; }
.badge-err { background: rgba(255, 139, 122, 0.14); color: #ff8b7a; }
.badge-mute { background: rgba(255,255,255,0.04); color: var(--text-3); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); padding: 13px 15px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-ok { background: rgba(39, 166, 68, 0.1); border-color: rgba(39, 166, 68, 0.3); color: #b8f5cd; }
.alert-err { background: rgba(255,139,122,0.1); border-color: rgba(255,139,122,0.3); color: #ffb4a8; }
.alert-warn { background: rgba(255,196,84,0.1); border-color: rgba(255,196,84,0.3); color: #ffd88a; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.704px; font-weight: 510; }
.auth-card .sub { color: var(--text-3); font-size: 14px; margin: 0 0 22px; }
.auth-foot { margin-top: 18px; font-size: 14px; color: var(--text-3); text-align: center; }
.auth-foot a { color: var(--accent-bright); text-decoration: none; }

/* ---------- Code block ---------- */
pre.code { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px;
  line-height: 1.65; margin: 0; color: var(--text-2); }
.key-reveal { background: var(--accent-soft); border: 1px solid rgba(94,106,210,0.35);
  border-radius: var(--radius); padding: 15px; margin-bottom: 16px; }
.key-reveal .k { font-family: var(--font-mono); font-size: 13px; word-break: break-all; color: var(--accent-bright); }

/* ---------- App Responsive ---------- */
@media (max-width: 820px) {
  .app-main { padding: 22px 18px 50px; }
}
