/* ------------------------------------------------------------------------
   Aster & Loom Operations · DStudio Inventory & Operations demo
   Dark, warm, operational. Teal = state/action. Violet = editorial accent.
   ------------------------------------------------------------------------ */
:root {
  color-scheme: dark;
  --bg: #0e1113;
  --bg-sidebar: #0a0d0f;
  --panel: #151a1d;
  --panel-2: #1b2125;
  --panel-3: #222a2f;
  --line: rgba(243, 239, 232, 0.08);
  --line-strong: rgba(243, 239, 232, 0.16);
  --text: #f2ede4;
  --text-2: #b3ada3;
  --text-3: #7c766e;
  --teal: #37c6a9;
  --teal-2: #63d8c0;
  --teal-soft: rgba(55, 198, 169, 0.14);
  --teal-line: rgba(55, 198, 169, 0.4);
  --violet: #a293e6;
  --violet-soft: rgba(162, 147, 230, 0.16);
  --amber: #e2a83f;
  --amber-soft: rgba(226, 168, 63, 0.16);
  --red: #e3705f;
  --red-soft: rgba(227, 112, 95, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 236px;
  --topbar-h: 62px;
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.01em; }
.ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.ico svg { width: 16px; height: 16px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* Boot -------------------------------------------------------------------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 18px; text-align: center; color: var(--text-2); }
.boot-mark { width: 44px; height: 44px; margin: 0 auto; border-radius: 12px; border: 2px solid var(--teal-line); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth screens ------------------------------------------------------------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.gate-aside { padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(1200px 600px at 20% -10%, rgba(55, 198, 169, 0.18), transparent 60%), radial-gradient(800px 500px at 100% 100%, rgba(162, 147, 230, 0.16), transparent 60%), var(--bg-sidebar); border-right: 1px solid var(--line); }
.gate-main { display: grid; place-items: center; padding: 32px; }
.gate-card { width: min(420px, 100%); }
.gate h1 { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; max-width: 14ch; }
.gate h2 { font-size: 24px; margin-bottom: 6px; }
.gate .lede { color: var(--text-2); font-size: 15px; margin-top: 18px; max-width: 46ch; }
.gate-points { display: grid; gap: 14px; margin-top: 40px; }
.gate-points > div { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: var(--text-2); }
.gate-points > div > span:first-child { color: var(--teal); font-family: var(--mono); font-size: 12px; padding-top: 2px; }
.gate-points strong { color: var(--text); display: block; font-weight: 600; }
.gate-footer { color: var(--text-3); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .gate { grid-template-columns: 1fr; } .gate-aside { padding: 28px 22px; min-height: 0; } .gate-points { margin-top: 24px; } .gate-footer { display: none; } }

/* Brand ------------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, rgba(55, 198, 169, 0.22), rgba(162, 147, 230, 0.2)); border: 1px solid var(--line-strong); flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* Shell ------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--bg-sidebar); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.sidebar .brand { padding: 2px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; position: relative; transition: background 160ms var(--ease), color 160ms var(--ease); }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav a.active { background: var(--teal-soft); color: var(--text); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.nav a .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); display: grid; gap: 8px; }
.sidebar-foot strong { color: var(--text); font-weight: 600; }
.dstudio-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); }
.dstudio-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(14, 17, 19, 0.85); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .crumb { font-size: 12px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.countdown { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--teal-line); background: var(--teal-soft); color: var(--teal-2); font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.countdown .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(55, 198, 169, 0.18); }
.countdown.warn { border-color: rgba(226, 168, 63, 0.5); background: var(--amber-soft); color: var(--amber); }
.countdown.danger { border-color: rgba(227, 112, 95, 0.55); background: var(--red-soft); color: var(--red); }
.countdown .label { font-family: var(--font); color: inherit; opacity: 0.85; }
.role-switch { position: relative; }
.role-switch select { appearance: none; -webkit-appearance: none; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 34px 7px 14px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.role-switch::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); font-weight: 700; font-size: 12.5px; border: 1px solid rgba(162, 147, 230, 0.35); }

.content { padding: 26px 28px 60px; display: grid; gap: 22px; align-content: start; }
.content > *, .grid > *, .card, .main, .drawer-body > * { min-width: 0; }
.page-head p { overflow-wrap: anywhere; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); margin-top: 4px; max-width: 64ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Mobile nav ---------------------------------------------------------------- */
.bottom-nav { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .toolbar .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .page-head h2 { font-size: 22px; }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 96px; gap: 16px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(10, 13, 15, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 4px; font-size: 10.5px; color: var(--text-3); background: none; border: 0; padding: 4px 0; border-radius: 8px; font-weight: 600; }
  .bottom-nav a svg, .bottom-nav button svg { width: 20px; height: 20px; }
  .bottom-nav a.active { color: var(--teal); }
  .countdown .label { display: none; }
  .topbar-title .crumb { display: none; }
  .role-switch select { padding: 6px 28px 6px 10px; font-size: 12px; }
}
.sheet { position: fixed; inset: auto 0 0 0; z-index: 60; background: var(--panel); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line-strong); padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; box-shadow: var(--shadow); }
.sheet a { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.sheet a.active { background: var(--teal-soft); color: var(--text); }
.sheet a svg { width: 20px; height: 20px; }

/* Buttons ------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease); }
.btn:hover { background: var(--panel-3); border-color: rgba(243, 239, 232, 0.24); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #06231d; }
.btn-primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: transparent; }
.btn-danger { background: transparent; border-color: rgba(227, 112, 95, 0.45); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-violet { background: var(--violet-soft); border-color: rgba(162, 147, 230, 0.4); color: var(--violet); }

/* Cards / panels ------------------------------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .hint { font-size: 12px; color: var(--text-3); }
.card-body { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
@media (max-width: 1180px) { .grid-main { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; display: grid; gap: 6px; }
.kpi-label { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-family: var(--mono); font-size: 11.5px; }
.delta.up { color: var(--teal); background: var(--teal-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--text-2); background: rgba(255, 255, 255, 0.05); }

/* Badges ------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; background: rgba(255, 255, 255, 0.06); color: var(--text-2); border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge-teal { background: var(--teal-soft); color: var(--teal-2); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-grey { background: rgba(255, 255, 255, 0.06); color: var(--text-2); }
.badge-outline { background: transparent; border-color: var(--line-strong); }
.badge-plain::before { display: none; }

/* Tables ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; transition: background 120ms var(--ease); }
.table tbody tr.clickable:hover { background: rgba(255, 255, 255, 0.03); }
.table .primary { font-weight: 600; color: var(--text); }
.table .primary.mono { white-space: nowrap; }
.sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; font-family: var(--font); font-weight: 400; }
.table .th-right, .table .td-right { text-align: right; }
.stock-cell { display: inline-grid; grid-auto-flow: column; gap: 10px; align-items: baseline; }
.stock-cell small { color: var(--text-3); font-size: 11px; }
.bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.bar.low i { background: var(--amber); }
.bar.out i { background: var(--red); }

/* Toolbar ------------------------------------------------------------------ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { position: relative; min-width: 220px; flex: 1; max-width: 340px; }
.search input { width: 100%; padding: 9px 12px 9px 36px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 140ms var(--ease); }
.chip:hover { color: var(--text); border-color: rgba(243, 239, 232, 0.3); }
.chip.active { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal-2); }
.chip .n { font-family: var(--mono); font-size: 11px; opacity: 0.8; margin-left: 6px; }

/* Forms -------------------------------------------------------------------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { min-height: 84px; resize: vertical; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }
.field.error input, .field.error select { border-color: var(--red); }
.field .err { font-size: 12px; color: var(--red); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.lines { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 34px; gap: 8px; align-items: center; }
.line-3 { grid-template-columns: minmax(0, 1fr) 90px 110px 34px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.icon-btn svg { width: 15px; height: 15px; }
.form-note { font-size: 12.5px; color: var(--text-3); padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--line-strong); }

/* Drawer & dialog ------------------------------------------------------------ */
.backdrop { position: fixed; inset: 0; background: rgba(5, 7, 8, 0.6); z-index: 50; animation: fade 160ms var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 51; background: var(--panel); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide 220ms var(--ease); }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h3 { font-size: 17px; }
.drawer-head .sub { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.drawer-foot { padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--panel); }
.dialog { position: fixed; z-index: 52; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; animation: pop 180ms var(--ease); }
.dialog h3 { font-size: 16px; }
.dialog p { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }

.section { display: grid; gap: 10px; }
.section h4 { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 8px 0; }
.timeline-item .tick { width: 10px; height: 10px; margin: 5px auto 0; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.timeline-item .tick.seed { background: var(--text-3); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); }
.timeline-item .tick.system { background: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.timeline-item .t { font-size: 13.5px; }
.timeline-item .m { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Pipeline ------------------------------------------------------------------ */
.pipeline { display: flex; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); background: rgba(255, 255, 255, 0.02); }
.step.done { color: var(--teal-2); border-color: var(--teal-line); background: var(--teal-soft); }
.step.current { color: var(--text); border-color: var(--line-strong); background: var(--panel-3); }
.step .i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; border: 1px solid currentColor; }
.step.done .i { background: var(--teal); color: #06231d; border-color: var(--teal); }

/* Mission ------------------------------------------------------------------- */
.mission { display: grid; gap: 10px; }
.mission-progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mission-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--violet)); border-radius: inherit; transition: width 400ms var(--ease); }
.mission-step { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mission-step:last-child { border-bottom: 0; }
.mission-step .check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; margin-top: 2px; }
.mission-step.done .check { background: var(--teal); border-color: var(--teal); color: #06231d; }
.mission-step .title { font-weight: 600; font-size: 13.5px; }
.mission-step.done .title { color: var(--text-2); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }
.mission-step .hint { font-size: 12px; color: var(--text-3); }

/* Alerts list --------------------------------------------------------------- */
.alert-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row .sev { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.alert-row .sev.critical { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.alert-row .t { font-weight: 600; font-size: 13.5px; }
.alert-row .m { font-size: 12px; color: var(--text-3); }

/* Charts -------------------------------------------------------------------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--text-3); }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.06); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c, var(--teal)); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--c, var(--teal)); border-radius: inherit; }
.bar-row .v { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* Empty / toast --------------------------------------------------------------- */
.empty { padding: 34px 20px; text-align: center; color: var(--text-2); display: grid; gap: 8px; justify-items: center; }
.empty strong { color: var(--text); font-size: 15px; }
.empty .icon { width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; color: var(--text-3); margin-bottom: 4px; }
.empty .icon svg { width: 20px; height: 20px; }
.toasts { position: fixed; right: 20px; top: calc(var(--topbar-h) + 12px); z-index: 70; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow); display: grid; grid-template-columns: 8px 1fr; gap: 12px; align-items: start; animation: pop-up 200ms var(--ease); font-size: 13.5px; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--teal); }
.toast.error .dot { background: var(--red); }
.toast.warn .dot { background: var(--amber); }
.toast .m { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
@keyframes pop-up { from { transform: translateY(-8px); opacity: 0; } }
@media (max-width: 960px) { .toasts { right: 16px; left: 16px; width: auto; } }

.banner { padding: 12px 16px; border-radius: var(--radius); border: 1px solid rgba(162, 147, 230, 0.35); background: var(--violet-soft); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.banner strong { color: var(--violet); }
.banner .spacer { flex: 1; }
.skeleton { background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--teal); }
.stat-list { display: grid; gap: 10px; }
.stat-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.stat-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.stat-list span:last-child { font-family: var(--mono); font-size: 12.5px; }
.perm-grid { display: grid; grid-template-columns: 1fr repeat(4, 74px); font-size: 12.5px; }
.perm-grid > div { padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.perm-grid .head { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.perm-grid .yes { color: var(--teal); justify-content: center; }
.perm-grid .yes svg { width: 15px; height: 15px; }
.perm-grid .head { justify-content: center; text-align: center; }
.perm-grid .head:first-child { justify-content: flex-start; }
.perm-grid .no { color: var(--text-3); justify-content: center; opacity: 0.5; }
@media (max-width: 700px) { .perm-grid { grid-template-columns: 1fr repeat(4, 56px); font-size: 12px; } }
.expired { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; padding: 32px; }
.expired h1 { font-size: 30px; }
.expired p { color: var(--text-2); max-width: 44ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
@media print { .sidebar, .topbar, .bottom-nav, .toasts { display: none !important; } .shell { grid-template-columns: 1fr; } }
