/* NIGHTFALL OPS — Control Door
   Design language ported from the Dark Market design system
   (Barlow Condensed display · DM Sans body · Space Mono mono). */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,400..700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --background: 210 30.8% 94.9%;
  --foreground: 207 33.3% 17.1%;
  --border: 214 24.7% 83.3%;
  --card: 0 0% 100%;
  --primary: 209 53.2% 21.8%;
  --primary-foreground: 0 0% 100%;
  --secondary: 204 55.6% 91.2%;
  --secondary-foreground: 209 53.2% 21.8%;
  --muted: 207 26.8% 92%;
  --muted-foreground: 209 10% 45.3%;
  --accent: 22 94.4% 51.4%;
  --accent-foreground: 0 0% 100%;
  --input: 208 20.6% 87.6%;
  --ring: 22 94.4% 51.4%;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-sans: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --radius: 0.25rem;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-sans); font-size: 13px; background: hsl(var(--background)); color: hsl(var(--foreground)); }
button, input { font: inherit; }
button, a, input { outline-color: hsl(var(--accent)); outline-offset: 2px; }
button { cursor: pointer; }

/* ---- Layout primitives ---- */
.app-shell { min-height: 100dvh; padding-bottom: 44px; }
.container-wide { width: 100%; margin: 0; padding-inline: 32px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.w-full { width: 100%; }
.min-h-8 { min-height: 2rem; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; } .mt-5 { margin-top: 1.25rem; } .mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.p-3 { padding: .75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-8 { padding: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.text-3xl { font-size: 1.875rem; } .text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.tracking-wide { letter-spacing: .06em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Brand / chrome ---- */
.topline { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.topline .dot { display: inline-block; margin-right: .5rem; width: .4rem; height: .4rem; background: hsl(var(--accent)); }
.site-header { background: hsl(var(--card)); border-bottom: 1px solid hsl(var(--border)); }
.brand-title { font-family: var(--font-display); letter-spacing: .06em; }
.section-kicker { font-family: var(--font-mono); letter-spacing: .1em; font-size: 10px; color: hsl(var(--muted-foreground)); text-transform: uppercase; }
.nav-link { color: hsl(var(--primary)); text-decoration: none; font-family: var(--font-display); letter-spacing: .08em; font-weight: 700; }
.nav-link:hover, .nav-link:focus-visible { color: hsl(var(--accent)); }
.mono-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: hsl(var(--muted-foreground)); }
.footline { position: fixed; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 10px 32px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 10px; }
.mono-sm { font-family: var(--font-mono); font-size: 10px; }

/* ---- Panels / fields / buttons ---- */
.panel { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); }
.field-control { width: 100%; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); color: hsl(var(--foreground)); border-radius: 2px; padding: .6rem .75rem; font-size: 13px; }
.field-control:focus { border-color: hsl(var(--accent)); box-shadow: 0 0 0 2px hsl(var(--accent) / .16); }
.blue-button { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: 1px solid hsl(var(--primary)); }
.blue-button:hover { background: hsl(var(--primary) / .88); }
.orange-button { background: hsl(var(--accent)); color: white; border: 1px solid hsl(var(--accent)); }
.orange-button:hover { background: hsl(var(--accent) / .9); }
.text-button { color: hsl(var(--primary)); background: transparent; border: 0; }
.text-button:hover { color: hsl(var(--accent)); }
.focus-ring:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 2px; }

/* ---- Login page ---- */
.login-main { min-height: calc(100dvh - 120px); }
.login-hero { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: 2rem; display: flex; flex-direction: column; }
.kicker-inverse { color: hsl(var(--secondary)); }
.login-title { margin-top: 1rem; font-size: 3rem; line-height: .95; }
.login-sub { margin-top: 1.25rem; font-size: .8rem; line-height: 1.6; color: hsl(var(--secondary)); max-width: 24rem; }
.login-hero-meta { margin-top: auto; padding-top: 2rem; border-top: 1px solid hsl(var(--secondary) / .25); font-family: var(--font-mono); font-size: 10px; line-height: 1.8; color: hsl(var(--secondary)); }
.login-form-wrap { padding: 2rem; }
.form-title { margin-top: .5rem; font-size: 1.5rem; color: hsl(var(--primary)); }
.form-sub { margin-top: .5rem; font-size: .8rem; color: hsl(var(--muted-foreground)); }
.login-form { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.login-form label { display: block; margin-bottom: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: hsl(var(--foreground)); }
.form-submit { width: 100%; padding: .7rem 1rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; }
.error-box { border: 1px solid hsl(var(--destructive, 0 66.8% 44.9%)); background: #fdeeee; color: #a11; padding: .6rem .75rem; font-size: .75rem; }
.invite-badge { margin-top: 1.5rem; text-align: center; }
.invite-badge span { border: 1px solid hsl(var(--accent)); color: hsl(var(--accent)); padding: .25rem .75rem; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.form-footer { margin-top: 1.5rem; display: flex; justify-content: space-between; border-top: 1px solid hsl(var(--border)); padding-top: 1rem; font-size: .72rem; color: hsl(var(--muted-foreground)); }

/* ---- Ops console (post-login) ---- */
.console-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
.console-side { background: hsl(var(--sidebar, 204 55.6% 91.2%)); border: 1px solid hsl(var(--border)); padding: 1rem 0; }
.console-side .side-head { padding: 0 1rem .75rem; border-bottom: 1px solid hsl(var(--border)); }
.console-nav a { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; color: hsl(var(--primary)); text-decoration: none; font-size: .78rem; border-left: 2px solid transparent; }
.console-nav a:hover { background: hsl(var(--card) / .7); }
.console-nav a.active { border-left-color: hsl(var(--accent)); background: hsl(var(--card)); font-weight: 700; }
.stat-card { border-top: 2px solid hsl(var(--accent)); }
.ops-feed { font-family: var(--font-mono); font-size: 10px; line-height: 1.9; color: hsl(var(--muted-foreground)); }
.ops-feed .ok { color: hsl(var(--accent)); }
.signin-card { display: flex; align-items: center; gap: .6rem; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: .6rem .75rem; font-family: var(--font-mono); font-size: 10px; color: hsl(var(--primary)); }

@media (max-width: 767px) {
  .container-wide { padding-inline: 12px; }
  .login-hero, .login-form-wrap { padding: 1.25rem; }
  .login-hero { grid-row: 1; }
  .console-layout { grid-template-columns: 1fr; }
  .footline { padding-inline: 12px; }
}

/* ---- Telemetry console (C4) ---- */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.data-table th { text-align: left; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-foreground)); padding: .5rem .75rem; border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; }
.data-table td { padding: .55rem .75rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
.data-table tbody tr:hover { background: hsl(var(--muted) / .6); }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.stat-card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-top: 2px solid hsl(var(--accent)); padding: .7rem 1rem; }
.stat-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: hsl(var(--muted-foreground)); text-transform: uppercase; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: hsl(var(--primary)); line-height: 1.15; }

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-sub { font-size: .78rem; color: hsl(var(--muted-foreground)); margin-top: .4rem; line-height: 1.6; max-width: 54rem; }
.panel-divider { border-bottom: 1px solid hsl(var(--border)); padding-bottom: .75rem; }

.badge { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; padding: 2px 6px; border: 1px solid; border-radius: 2px; white-space: nowrap; }
.badge-running { color: hsl(var(--accent)); border-color: hsl(var(--accent)); }
.badge-idle { color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }

.live-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #16a34a; margin-right: .4rem; animation: livepulse 1.4s infinite; }
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.tabs { display: flex; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .55); }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: .7rem 1.15rem; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: hsl(var(--muted-foreground)); }
.tab:hover { color: hsl(var(--primary)); }
.tab.active { color: hsl(var(--primary)); border-bottom-color: hsl(var(--accent)); background: hsl(var(--card)); font-weight: 700; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1.25rem; border-bottom: 1px solid hsl(var(--border)); }
.tab-toolbar .field-control { max-width: 20rem; padding: .4rem .6rem; font-size: 11px; }
.scroll { max-height: 26rem; overflow: auto; }
.ops-feed { padding: .8rem 1.4rem; }
.memory-view { margin: 0; padding: 1.25rem; font-family: var(--font-mono); font-size: 11px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: hsl(var(--foreground)); }
.memory-view.is-empty { color: hsl(var(--muted-foreground)); }

.capture-meta-chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.chip { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; color: hsl(var(--primary)); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 2px 7px; border-radius: 2px; }

.proc-row { display: grid; grid-template-columns: 1fr 5rem auto; gap: .5rem; align-items: center; padding: .3rem .75rem; border-bottom: 1px solid hsl(var(--border)); font-family: var(--font-mono); font-size: 11px; }
.proc-row:hover { background: hsl(var(--muted) / .6); }
.proc-row .proc-name { color: hsl(var(--foreground)); }
.proc-row .proc-pid { color: hsl(var(--muted-foreground)); text-align: right; }

.empty-state { padding: 2rem 1.25rem; text-align: center; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; }

.mini-button { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: 1px solid hsl(var(--primary)); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; padding: .28rem .6rem; }
.mini-button:hover { background: hsl(var(--primary) / .88); }
.mini-button[disabled] { opacity: .45; cursor: default; }

@media (max-width: 767px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .proc-row { grid-template-columns: 1fr auto auto; }
}
/* ---- Management console (C6) — admin-plane variant ----------------------
   A SLIGHT colour shift from the operational apps: amber/gold accent instead
   of orange; the navy primary and the whole layout stay identical. */
:root {
  --accent: 38 92% 50%;        /* amber/gold — the admin control plane */
  --ring: 38 92% 50%;
}
/* subtle "management layer" cue on the chrome */
.site-header {
  border-bottom: 2px solid hsl(var(--accent));
}
.topline .dot {
  background: hsl(var(--accent));
}

/* ---- C6 console — dark admin chrome -------------------------------------
   The console (the pure-admin layer) uses a dark management shell (deep navy
   top bar + sidebar) with gold accents, over the shared light content panes.
   The sign-in pages keep the standard light template + gold accent. */
.mgmt-console .topline,
.mgmt-console .footline {
  background: hsl(218 42% 10%);
}
.mgmt-console .site-header {
  background: hsl(218 42% 13%);
  border-bottom: 1px solid hsl(38 92% 50% / .35);
}
.mgmt-console .brand-title { color: hsl(0 0% 100%); }
.mgmt-console .site-header .section-kicker { color: hsl(38 92% 60%); }
.mgmt-console .signin-card {
  background: hsl(218 42% 18%);
  border-color: hsl(38 92% 50% / .4);
  color: hsl(0 0% 90%);
}
.mgmt-console .console-side {
  background: hsl(218 42% 13%);
  border-color: hsl(38 92% 50% / .28);
}
.mgmt-console .side-head { border-bottom-color: hsl(38 92% 50% / .28); }
.mgmt-console .side-head .section-kicker { color: hsl(38 92% 60%); }
.mgmt-console .console-nav a {
  color: hsl(0 0% 86%);
  border-left-color: transparent;
}
.mgmt-console .console-nav a:hover {
  background: hsl(38 92% 50% / .08);
  color: hsl(0 0% 100%);
}
.mgmt-console .console-nav a.active {
  border-left-color: hsl(38 92% 50%);
  background: hsl(38 92% 50% / .12);
  color: hsl(0 0% 100%);
}
.mgmt-console .side-meta {
  padding: .75rem 1rem;
  border-top: 1px solid hsl(38 92% 50% / .28);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
  color: hsl(0 0% 86%);
}

/* console tool widgets (health probe / artifact export) */
.probe-box { margin-top: 1.25rem; border-top: 1px solid hsl(var(--border)); padding-top: 1rem; }
.probe-inputs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.probe-inputs .field-control { flex: 1 1 16rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
