/* ===========================================================================
   gCode design system — May 2026
   Devtool · dark · sharp · high-density. Sans + italic serif accents.
   Used by every gcode-web + kanban surface.
   =========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* Core */
  --bg:      #0B0B0E;
  --bg-2:    #111114;
  --bg-3:    #18181D;
  --panel:   #15151A;
  --rule:    #23232A;
  --rule-2:  #2E2E37;
  --ink:     #F1F1EE;
  --ink-2:   #C8C8C2;
  --muted:   #7E7E84;
  --muted-2: #54545A;

  /* Accent + status */
  --acc:     #00FF85;
  --acc-2:   #00C46A;
  --acc-ink: #03130A;
  --warn:    #FFB454;
  --hot:     #FF5577;
  --info:    #6CC8FF;
  --plum:    #C792EA;

  /* Typography */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Menlo", monospace;

  /* Density (compact default; --d=0 compact, --d=1 comfortable) */
  --d: 0;
  --u: calc(4px + var(--d) * 2px);          /* base unit */
  --row: calc(28px + var(--d) * 8px);       /* row height */
  --pad-x: calc(12px + var(--d) * 4px);
  --base-fs: calc(13px + var(--d) * 1px);

  --maxw: 1400px;
}

[data-density="comfortable"] { --d: 1; }

/* ===== Light theme override ===== */
:root[data-theme="light"] {
  --bg:      #F7F6F2;
  --bg-2:    #EFEEE8;
  --bg-3:    #E5E3DA;
  --panel:   #FCFBF7;
  --rule:    #DDDBD0;
  --rule-2:  #C5C2B3;
  --ink:     #15161A;
  --ink-2:   #3D3E44;
  --muted:   #6B6B6F;
  --muted-2: #9A9893;

  --acc:     #00A85C;
  --acc-2:   #008047;
  --acc-ink: #FCFBF7;
  --warn:    #B5651D;
  --hot:     #C53056;
  --info:    #2A6FB8;
  --plum:    #7D52B5;
}

/* Smooth theme transitions */
html { transition: background-color .18s ease, color .18s ease; }
body, .topnav, .panel, .section, .card, .ctable, .ttable, .keys-table, .team-table,
input, textarea, button, .step, .agents-glance, .quote, .stats > .s, .plan, .plan-card,
.danger-card, .filter button, .toggles, .toggles button, .oauth button, .form .field input,
.form .field .input-row, .form .checkrow input[type=checkbox], .plan-pick label,
.crumbs, .sidenav, .sidenav a, .row, .ses, .ses .icn, .toggle, .model {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--base-fs);
  line-height: 1.45;
  font-feature-settings: "ss01","cv11","tnum";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: color-mix(in oklab, var(--acc) 35%, transparent); color: var(--ink); }

/* ===== Primitives ===== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(16px, 3vw, 36px); }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc);
  display: inline-block;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-2);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn-acc { background: var(--acc); color: var(--acc-ink); }
.btn-acc:hover { background: color-mix(in oklab, var(--acc) 90%, white); }
.btn-pri { background: var(--ink); color: var(--bg); }
.btn-pri:hover { background: color-mix(in oklab, var(--ink) 90%, var(--acc)); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.btn-ghost:hover { color: var(--ink); border-color: var(--rule-2); background: var(--bg-2); }
.btn-icon { padding: 6px; }
.btn-sm { padding: 5px 9px; font-size: 11.5px; }
.btn-lg { padding: 11px 18px; font-size: 13.5px; }

/* ===== Pills ===== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--muted); }
.pill.ok    { color: var(--acc);  border-color: color-mix(in oklab, var(--acc) 35%, var(--rule)); }
.pill.ok    .dot { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.pill.warn  { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 35%, var(--rule)); }
.pill.warn  .dot { background: var(--warn); }
.pill.hot   { color: var(--hot);  border-color: color-mix(in oklab, var(--hot) 35%, var(--rule)); }
.pill.hot   .dot { background: var(--hot); }
.pill.info  { color: var(--info); border-color: color-mix(in oklab, var(--info) 35%, var(--rule)); }
.pill.info  .dot { background: var(--info); }
.pill.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.acc   { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }

/* ===== Cards / panels ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-body { padding: 12px; }

/* ===== Form controls ===== */
.input, .textarea, .select {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--acc) 22%, transparent);
}
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ===== Top app bar (chrome) ===== */
.appbar {
  display: flex; align-items: center; gap: 12px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--rule);
  font-size: 12.5px;
}
.appbar .traffic { display: inline-flex; gap: 6px; margin-right: 8px; }
.appbar .traffic i { width: 11px; height: 11px; border-radius: 999px; background: var(--rule-2); display: inline-block; }
.appbar .traffic i.r { background: #FF5F56; }
.appbar .traffic i.y { background: #FFBD2E; }
.appbar .traffic i.g { background: #27C93F; }

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-mark {
  width: 22px; height: 22px;
  background: var(--acc); color: var(--acc-ink);
  border-radius: 5px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 12px;
  box-shadow: 0 0 14px color-mix(in oklab, var(--acc) 45%, transparent);
}
/* When the brand mark is an <img> (Gavedu Sri Yantra), neutralise the
   text-styling defaults so the image renders cleanly without the
   saturated green fill bleeding behind a transparent PNG. Saffron
   drop shadow matches the install-tui hero. */
img.brand-mark {
  background: transparent;
  object-fit: cover;
  font-size: 0;
  box-shadow: 0 0 10px rgba(255, 180, 84, 0.22);
  display: inline-block;
  flex-shrink: 0;
}

.crumbs { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { color: var(--muted-2); }
.crumbs .cur { color: var(--ink); }

/* ===== Tables ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl thead th {
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  position: sticky; top: 0;
}
.tbl tbody tr:hover td { background: color-mix(in oklab, var(--acc) 5%, var(--bg-2)); }
.tbl td .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ===== Status dot pulse ===== */
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.live { animation: pulse-dot 1.6s ease-in-out infinite; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ===== Utility ===== */
.hr { border: 0; height: 1px; background: var(--rule); margin: 12px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.gap { flex: 1; }
.muted { color: var(--muted); }
.acc { color: var(--acc); }
.serif-acc { font-family: var(--font-serif); font-style: italic; color: var(--acc); font-weight: 400; }

/* Glow ring for hero accents */
.glow {
  background: radial-gradient(60% 80% at 30% 0%, color-mix(in oklab, var(--acc) 18%, transparent) 0%, transparent 60%),
              radial-gradient(40% 60% at 90% 100%, color-mix(in oklab, var(--plum) 20%, transparent) 0%, transparent 70%);
}

/* Density toggle — compact label everywhere */
[data-density] .panel-body { padding: calc(8px + var(--d)*4px) calc(10px + var(--d)*4px); }
