/* SkyAcres Mission Control · dark ops console.
   Palette derives from the brand tokens (skyacres-website src/styles/tokens.css):
   olive #3d4323 · sage #98ae6e · rust #bb5a2e · cream #f1f0ee · dark #1d2327.
   A mission control is a dark room by design; this app deliberately stays dark. */

:root {
  --bg: #14181a;
  --panel: #1b2125;
  --panel-2: #20272c;
  --inset: #171c1f;
  --line: rgba(241,240,238,.08);
  --line-strong: rgba(152,174,110,.22);
  --text: #eceae5;
  --muted: #97a094;
  --faint: #67716a;
  --sage: #98ae6e;
  --sage-bright: #bccf93;
  --olive: #3d4323;
  --rust: #d06a3a;
  --amber: #d3a24a;
  --fill-accent: rgba(152,174,110,.14);
  --conflict-tint: rgba(208,106,58,.08);
  --hover: rgba(241,240,238,.03);
  --on-solid: #16211a;
  --bar-bg: rgba(20,24,26,.92);
  --shadow: none;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Sequel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
/* Light: same console, daylight glass. Cream ground from the brand, ink
   text, olive-leaning accents so sage still reads on white. */
:root[data-theme="light"] {
  --bg: #f1f0ee;
  --panel: #ffffff;
  --panel-2: #f8f7f4;
  --inset: #e9e8e4;
  --line: rgba(27,50,37,.10);
  --line-strong: rgba(61,67,35,.30);
  --text: #1b3225;
  --muted: #55635a;
  --faint: #8b948c;
  --sage: #5f7040;
  --sage-bright: #3d4323;
  --olive: #98ae6e;
  --rust: #b0512a;
  --amber: #96701f;
  --fill-accent: rgba(95,112,64,.12);
  --conflict-tint: rgba(176,81,42,.07);
  --hover: rgba(27,50,37,.035);
  --on-solid: #f5f4ef;
  --bar-bg: rgba(241,240,238,.92);
  --shadow: 0 1px 3px rgba(27,50,37,.07);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
::selection { background: rgba(152,174,110,.28); }
a { color: var(--sage-bright); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .9em; color: var(--muted); }

/* ---------- command bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar::before {
  content: ""; display: block; height: 2px;
  background: linear-gradient(90deg, var(--olive), var(--sage) 40%, rgba(152,174,110,0) 90%);
}
.bar-inner {
  max-width: 1360px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.mark { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.mark .logo { height: 24px; width: auto; display: block; }
.mark .app {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .26em; color: var(--sage);
  text-transform: uppercase; border-left: 1px solid var(--line-strong); padding-left: 12px;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 6px 11px; border-radius: 3px; border: 1px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--sage-bright); border-color: var(--line-strong); background: var(--panel); }
.bar-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.clock { color: var(--text); font-variant-numeric: tabular-nums; }
.leds { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.led {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 3px;
  padding: 4px 9px; background: var(--panel);
}
.led i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.led.ok i   { background: var(--sage);  box-shadow: 0 0 6px rgba(152,174,110,.8); }
.led.warn i { background: var(--amber); box-shadow: 0 0 6px rgba(211,162,74,.8); }
.led.crit i { background: var(--rust);  box-shadow: 0 0 7px rgba(208,106,58,.9); animation: pulse 1.6s ease-in-out infinite; }
.led.crit   { color: var(--rust); border-color: rgba(208,106,58,.35); }
.led.warn   { color: var(--amber); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .led.crit i { animation: none; } }

/* ---------- shell + grid ---------- */
.shell { max-width: 1360px; margin: 0 auto; padding: 20px 24px; }
.loading { font-family: var(--mono); color: var(--faint); padding: 40px 0; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-bottom: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
.panel-hd {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 8px;
}
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sage); white-space: nowrap;
}
.eyebrow::before { content: "▪ "; }
.panel-hd .sub { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-left: auto; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }  .span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }  .span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
@media (max-width: 1080px) {
  .span-8, .span-7, .span-6, .span-5 { grid-column: span 12; }
  .span-4, .span-3 { grid-column: span 6; }
}
@media (max-width: 620px) { .span-4, .span-3 { grid-column: span 12; } }

/* ---------- stat band ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 1080px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 15px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.stat .v { font-size: 32px; font-weight: 200; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.stat .d { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.crit .v { color: var(--rust); }  .stat.warn .v { color: var(--amber); }
.stat.good .v { color: var(--sage-bright); }
.stat.crit::after, .stat.warn::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; }
.stat.crit::after { background: var(--rust); }
.stat.warn::after { background: var(--amber); }
.stat.crit { border-color: rgba(208,106,58,.4); }

/* ---------- rows / chips ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; gap: 10px; align-items: baseline; position: relative;
  padding: 9px 2px 9px 13px; border-top: 1px solid var(--line); font-size: 14px;
}
.row:first-child { border-top: 0; }
.rows .row:hover { background: linear-gradient(90deg, var(--hover), transparent 85%); }
/* status stripe: colored left edge keyed to the row's state */
.row::before {
  content: ""; position: absolute; left: 0; top: 11px; bottom: 11px;
  width: 3px; border-radius: 2px; background: transparent;
}
.row.m-crit::before { background: var(--rust); }
.row.m-warn::before { background: var(--amber); }
.row.m-good::before { background: var(--sage); }
.row.m-dim::before  { background: var(--line-strong); }
.row .t { font-family: var(--mono); font-size: 12px; color: var(--faint); flex: none; width: 92px; font-variant-numeric: tabular-nums; }
.row .who { color: var(--text); }
.row .why {
  color: var(--muted); min-width: 0; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.row .end { margin-left: auto; flex: none; }
.chip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--sage); border-radius: 3px;
  padding: 2px 7px; white-space: nowrap;
}
.chip.crit { color: var(--rust); border-color: rgba(208,106,58,.45); }
.chip.warn { color: var(--amber); border-color: rgba(211,162,74,.4); }
.chip.dim  { color: var(--faint); border-color: var(--line); }
.chip.fill { background: var(--fill-accent); }
.chip.lock { color: var(--faint); border-style: dashed; }

.day-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); padding: 14px 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.day-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- masthead: the console identity line ---------- */
.masthead {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 2px 2px; user-select: none;
}
.masthead .mline { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong)); }
.masthead .mline:last-child { background: linear-gradient(90deg, var(--line-strong), transparent); }
.masthead .mtext {
  font-family: var(--mono); font-size: 13px; font-weight: 400;
  letter-spacing: .55em; text-indent: .55em; text-transform: uppercase;
  color: var(--sage); white-space: nowrap;
}
.masthead .mlive {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; color: var(--faint);
}
.masthead .mlive i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--sage);
  box-shadow: 0 0 6px rgba(152,174,110,.9); animation: pulse 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .masthead .mlive i { animation: none; } }

/* ---------- greeting ---------- */
.greet { padding: 6px 2px 16px; }
.greet h1 {
  margin: 0; font-size: clamp(26px, 4vw, 38px); font-weight: 200;
  letter-spacing: -.01em; text-wrap: balance;
}
.greet h1 .nm { color: var(--sage-bright); font-weight: 300; }
.greet-sub { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.greet-sub b { color: var(--text); font-weight: 400; }

/* ---------- theme toggle ---------- */
.theme-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 3px; padding: 4px 9px; cursor: pointer;
}
.theme-btn:hover { color: var(--text); border-color: var(--line-strong); }
.theme-btn:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.note { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 10px; line-height: 1.65; }

/* ---------- schedule ---------- */
.day { margin-top: 16px; }
.day:first-child { margin-top: 4px; }
.day-hd {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line-strong);
}
.date-badge {
  width: 46px; height: 46px; border-radius: 9px; flex: none;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.date-badge .dw { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.date-badge .dn { font-size: 19px; font-weight: 300; line-height: 1.15; font-variant-numeric: tabular-nums; }
.day.today .date-badge { background: var(--fill-accent); border-color: var(--line-strong); }
.day.today .date-badge .dn { color: var(--sage-bright); }
.day-hd .dt { font-size: 14.5px; }
.day-hd .dcount { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: auto; text-align: right; }
.day-hd .dcount .warnc { color: var(--rust); }

.day-evs { position: relative; padding-left: 20px; margin-top: 2px; }
.day-evs::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 2px; border-radius: 1px; background: var(--line);
}
.ev { display: flex; gap: 12px; padding: 8px 0; align-items: baseline; position: relative; border-radius: 4px; }
.ev::before {
  content: ""; position: absolute; left: -20px; top: 15px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--faint);
}
.ev:hover { background: linear-gradient(90deg, var(--hover), transparent 85%); }
.ev .time { font-family: var(--mono); font-size: 12.5px; color: var(--sage-bright); width: 102px; flex: none; font-variant-numeric: tabular-nums; }
.ev .name { font-size: 14.5px; min-width: 0; }
.ev .tag { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ev .end { margin-left: auto; flex: none; }
.ev.conflict .time { color: var(--rust); }
.ev.conflict { background: linear-gradient(90deg, var(--conflict-tint), transparent 70%); }
.ev.conflict::before { border-color: var(--rust); }

/* ---------- meters ---------- */
.meter { display: grid; grid-template-columns: 92px 1fr 104px; gap: 10px; align-items: center; padding: 6px 0; }
.meter .lbl { font-family: var(--mono); font-size: 12.5px; }
.meter .track { display: block; height: 7px; background: var(--inset); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.meter .fillbar { display: block; height: 100%; background: linear-gradient(90deg, var(--olive), var(--sage)); }
.meter .num { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- boards ---------- */
.boards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1080px) { .boards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .boards { grid-template-columns: 1fr; } }
.board { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; min-width: 0; }
.board .bh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.board .bh .nm { font-size: 15px; }
.board .bh .val { font-family: var(--mono); font-size: 12px; color: var(--sage-bright); margin-left: auto; white-space: nowrap; }
.board .bsub { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-bottom: 6px; }
.board .scroll { max-height: 430px; overflow-y: auto; scrollbar-width: thin; }
.card { border-top: 1px solid var(--line); padding: 8px 0 8px 4px; }
.card:hover { background: linear-gradient(90deg, var(--hover), transparent 85%); }

/* gated-action step progress */
.steps { display: inline-flex; gap: 5px; align-items: center; margin-right: 8px; }
.steps i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--inset); border: 1.5px solid var(--line-strong); flex: none;
}
.steps i.done { background: var(--sage); border-color: var(--sage); }
.card .cn { display: flex; gap: 8px; align-items: baseline; }
.card .cn b { font-weight: 400; font-size: 14px; }
.card .cn .end { margin-left: auto; flex: none; }
.card .cd { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bucket-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage); padding: 12px 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.bucket-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- entities ---------- */
.ent-tools { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ent-tools input {
  background: var(--inset); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); font-size: 12px; padding: 7px 12px; border-radius: 4px; width: 280px; max-width: 100%;
}
.ent-tools input:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.ent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ent-group { margin-bottom: 6px; }
.ent {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 10px 13px; cursor: pointer; display: block; color: var(--text);
}
.ent:hover { border-color: var(--line-strong); }
.ent .en { font-size: 14.5px; }
.ent .et { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.filelist { overflow-x: auto; }
.frow { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.frow:first-child { border-top: 0; }
.frow .fext {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--sage); border-radius: 3px;
  padding: 1px 6px; flex: none; min-width: 34px; text-align: center;
}
.frow .ft { font-size: 13.5px; }
.frow .fp { font-family: var(--mono); font-size: 10.5px; color: var(--faint); word-break: break-all; }
.backlink { font-family: var(--mono); font-size: 11px; display: inline-block; margin-bottom: 12px; }

/* ---------- health ---------- */
.hrow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.hrow:first-child { border-top: 0; }
.hrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--sage); }
.hrow.warn .dot { background: var(--amber); }
.hrow.crit .dot { background: var(--rust); box-shadow: 0 0 6px rgba(208,106,58,.6); }
.hrow .hn { font-size: 14px; min-width: 0; }
.hrow .hd { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.hrow .hv { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.hgauge { flex: none; width: 130px; }
.hgauge .track { display: block; height: 7px; background: var(--inset); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.hgauge .fillbar { display: block; height: 100%; background: var(--sage); }
.hgauge .fillbar.near { background: var(--amber); }
.hgauge .fillbar.over { background: var(--rust); }
.dom { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; padding: 4px 0; }
.dom .dn { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dom .track { display: block; height: 5px; background: var(--inset); border-radius: 3px; overflow: hidden; }
.dom .fillbar { display: block; height: 100%; background: var(--sage); opacity: .7; }
.dom .dv { font-family: var(--mono); font-size: 10.5px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }

.rails { display: flex; flex-wrap: wrap; gap: 8px; }
.rail {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 5px 10px;
  display: inline-flex; gap: 8px; align-items: center; background: var(--panel-2);
}
.rail i { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); flex: none; }
.rail.warn { border-color: rgba(211,162,74,.4); color: var(--amber); }
.rail.warn i { background: var(--amber); }

.footer { border-top: 1px solid var(--line); display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ---------- auth gate ---------- */
.gate { display: grid; place-items: center; min-height: 55vh; }
.gate-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 30px 32px; max-width: 440px; text-align: center;
}
.gate-card .logo { height: 30px; width: auto; display: inline-block; margin-bottom: 14px; }
.gate-mc {
  font-family: var(--mono); font-size: 12px; letter-spacing: .5em; text-indent: .5em;
  text-transform: uppercase; color: var(--sage); margin-bottom: 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.gate-card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.gate-err { color: var(--rust); font-family: var(--mono); font-size: 11.5px; }
.gate-btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sage); color: var(--on-solid); border: 0; border-radius: 4px;
  padding: 10px 18px; cursor: pointer;
}
.gate-btn:hover { background: var(--sage-bright); }
.gate-btn:focus-visible { outline: 2px solid var(--sage-bright); outline-offset: 2px; }
