/* ============================================================================
   VerlX OS — industrial mission-control theme
   Fonts are local-first by design (zero network deps): Bahnschrift ships with
   Windows 10/11; Cascadia Mono with Windows Terminal; graceful fallbacks.
   ========================================================================== */
:root {
  --bg: #07090c;
  --bg-2: #0b0f14;
  --panel: #10161d;
  --panel-2: #141c25;
  --line: #223041;
  --line-2: #2e415a;
  --txt: #dbe7f3;
  --dim: #7d8fa3;
  --faint: #4a5a6d;
  --amber: #f0b429;
  --amber-dim: #8a6a1a;
  --ok: #3fd068;
  --warn: #e8a530;
  --bad: #ff5c5c;
  --igp: #58a6ff;
  --farm: #3fd068;
  --fin: #f0b429;
  --per: #c495ff;
  --sys: #8b98a8;
  --qcl: #f0b429;
  --disp: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  --body: "Bahnschrift", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
  --rad: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(240,180,41,.05), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(88,166,255,.04), transparent 60%),
    var(--bg);
  color: var(--txt);
  font: 15px/1.5 var(--body);
  overflow-x: hidden;
}
::selection { background: rgba(240,180,41,.35); }
a { color: var(--igp); text-decoration: none; }
button { font-family: var(--body); }

/* ---- app frame: left rail + main ---------------------------------------- */
#app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.rail {
  background: linear-gradient(180deg, var(--bg-2), #090d11);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.wordmark {
  font-family: var(--disp);
  font-weight: 700; font-size: 21px; letter-spacing: .12em;
  padding: 4px 10px 14px; user-select: none;
}
.wordmark b { color: var(--amber); font-weight: 700; }
.wordmark small { display: block; font-size: 10px; letter-spacing: .3em; color: var(--faint); font-weight: 400; margin-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  color: var(--dim); font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel); color: var(--txt); }
.nav-item.on { background: var(--panel-2); color: var(--txt); border-color: var(--line); }
.nav-item.on .nv-ic { filter: none; }
.nav-item .nv-ic { width: 20px; text-align: center; filter: grayscale(.4); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.rail-foot { margin-top: auto; padding: 8px 10px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); line-height: 1.7; }
.rail-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }

main { padding: 0 30px 70px; min-width: 0; }

/* ---- top command bar ----------------------------------------------------- */
.topbar { display: flex; gap: 12px; align-items: center; padding: 20px 0 6px; position: relative; }
.cmdwrap { position: relative; flex: 1; }
#cmd {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--rad);
  color: var(--txt);
  padding: 13px 118px 13px 44px;
  font: 16px var(--body);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#cmd:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(240,180,41,.12); }
.cmd-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 15px; pointer-events: none; }
.cmd-hint { position: absolute; right: 46px; top: 50%; transform: translateY(-50%); color: var(--faint); font-family: var(--mono); font-size: 11px; pointer-events: none; }
.mic {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid var(--line); border-radius: 7px;
  color: var(--faint); width: 30px; height: 30px; cursor: not-allowed; font-size: 13px;
}
.mic:hover::after {
  content: "voice — future phase"; position: absolute; right: 0; top: 36px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--dim);
  font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 40;
}
.logout { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 8px; padding: 9px 14px; cursor: pointer; font-size: 13px; }
.logout:hover { color: var(--bad); border-color: var(--bad); }

/* command palette dropdown */
#pal {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--rad);
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  max-height: 480px; overflow-y: auto; display: none;
}
#pal.open { display: block; }
.pal-row {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 14px; cursor: pointer; border-bottom: 1px solid rgba(34,48,65,.5);
}
.pal-row:hover, .pal-row.sel { background: rgba(240,180,41,.08); }
.pal-row .pr-ic { text-align: center; font-size: 14px; }
.pal-row .pr-name { font-weight: 600; font-size: 14px; }
.pal-row .pr-name em { color: var(--amber); font-style: normal; }
.pal-row .pr-path { font-family: var(--mono); font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-row .pr-snip { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-row .pr-acts { display: flex; gap: 6px; }
.pal-foot { padding: 7px 14px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ---- alert strip ---------------------------------------------------------- */
.alerts { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.alert {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid; border-radius: 8px; padding: 8px 12px; font-size: 13.5px;
  background: var(--panel);
}
.alert.fail {
  border-color: rgba(255,92,92,.45);
  background:
    repeating-linear-gradient(-45deg, rgba(255,92,92,.06) 0 10px, transparent 10px 20px),
    var(--panel);
}
.alert.warn { border-color: rgba(232,165,48,.4); }
.alert .a-tag { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 2px 7px; border-radius: 4px; }
.alert.fail .a-tag { background: rgba(255,92,92,.18); color: var(--bad); }
.alert.warn .a-tag { background: rgba(232,165,48,.15); color: var(--warn); }
.alert .a-detail { color: var(--dim); font-size: 12.5px; margin-left: auto; font-family: var(--mono); }

/* ---- section headers ------------------------------------------------------ */
.sect { margin-top: 30px; }
.sect > h2 {
  font-family: var(--disp); font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--dim); margin: 0 0 12px; display: flex; align-items: center; gap: 10px;
}
.sect > h2::before { content: ""; width: 18px; height: 2px; background: var(--amber); }
.sect > h2 .h-note { margin-left: auto; letter-spacing: 0; text-transform: none; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ---- module tiles ---------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--rad);
  padding: 18px 16px 14px; cursor: pointer;
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--tc, var(--amber)); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.tile::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--tc, var(--amber));
}
.tile .t-ic { font-size: 22px; }
.tile .t-name { font-family: var(--disp); font-weight: 700; font-size: 17px; letter-spacing: .02em; margin-top: 8px; }
.tile .t-tag { color: var(--dim); font-size: 12px; margin-top: 3px; line-height: 1.4; }

/* ---- cards grid ------------------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad);
  padding: 16px;
  animation: rise .4s ease backwards;
}
.card.c4 { grid-column: span 4; } .card.c6 { grid-column: span 6; }
.card.c8 { grid-column: span 8; } .card.c12 { grid-column: span 12; }
@media (max-width: 1200px) { .card.c4 { grid-column: span 6; } .card.c8 { grid-column: span 12; } }
/* phone / narrow: rail becomes a slide-out drawer behind a ☰ button */
.menu-btn { display: none; background: var(--panel); border: 1px solid var(--line-2); color: var(--txt); border-radius: 9px; width: 44px; height: 44px; font-size: 19px; cursor: pointer; flex-shrink: 0; }
.rail-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 70; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 80; transform: translateX(-105%); transition: transform .18s ease; box-shadow: 8px 0 40px rgba(0,0,0,.5); }
  .rail.open { transform: none; }
  .rail.open + .rail-backdrop, .rail-backdrop.show { display: block; }
  .menu-btn { display: block; }
  main { padding: 0 14px 60px; }
  .card { grid-column: span 12 !important; }
  .cmd-hint { display: none; }
  #cmd { padding: 12px 46px 12px 40px; font-size: 15px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tile { padding: 13px 12px 11px; }
  .tile .t-name { font-size: 15px; }
  .mod-head { flex-wrap: wrap; gap: 8px; }
  .mod-head h1 { font-size: 23px; }
  .brief { padding: 16px 15px; }
  .b-greet { font-size: 20px; }
  .linkgrid { grid-template-columns: 1fr; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
/* HUD corner brackets */
.card::before, .card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 1px solid var(--line-2);
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: var(--rad); }
.card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: var(--rad); }
.card h3 {
  margin: 0 0 10px; font-family: var(--disp); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px;
}
.card h3 .h-note { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0; text-transform: none; color: var(--faint); }

/* rows inside cards */
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 7px; font-size: 13.5px;
}
.row:hover { background: var(--panel-2); }
.row .r-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-sub { font-family: var(--mono); font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-main { min-width: 0; flex: 1; }
.row .r-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.row .r-age { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

/* status dots */
.st { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.st.ok { background: var(--ok); box-shadow: 0 0 8px rgba(63,208,104,.6); }
.st.warn { background: var(--warn); box-shadow: 0 0 8px rgba(232,165,48,.6); }
.st.fail { background: var(--bad); box-shadow: 0 0 8px rgba(255,92,92,.7); }
.st.unknown { background: var(--faint); }

/* tags & buttons */
.tag { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.tag.IGP { background: rgba(88,166,255,.14); color: var(--igp); }
.tag.Farm { background: rgba(63,208,104,.12); color: var(--farm); }
.tag.Finance { background: rgba(240,180,41,.13); color: var(--fin); }
.tag.Personal { background: rgba(196,149,255,.13); color: var(--per); }
.tag.System, .tag.QCells { background: rgba(139,152,168,.14); color: var(--sys); }
.tag.Ventures { background: rgba(255,123,114,.13); color: #ff7b72; }
.tag.SmartHome { background: rgba(86,212,221,.12); color: #56d4dd; }
.tag.Content { background: rgba(227,160,60,.13); color: #e3a03c; }

/* ---- executive briefing ---------------------------------------------------- */
.brief {
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2); border-radius: 14px;
  padding: 22px 24px; margin-top: 16px;
  animation: rise .4s ease backwards; position: relative;
}
.brief::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--amber); border-radius: 14px 0 0 14px; }
.brief .b-greet { font-family: var(--disp); font-size: 24px; font-weight: 700; letter-spacing: .02em; }
.brief .b-since { font-family: var(--mono); font-size: 11px; color: var(--faint); margin: 2px 0 14px; }
.b-line { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; font-size: 14.5px; line-height: 1.5; }
.b-line .b-ic { flex-shrink: 0; width: 16px; text-align: center; }
.b-line a { color: var(--dim); font-size: 12px; margin-left: 6px; white-space: nowrap; }
.b-line a:hover { color: var(--amber); }
.b-rec { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid rgba(34,48,65,.5); font-size: 14px; }
.b-rec .b-n { font-family: var(--disp); font-weight: 700; color: var(--amber); flex-shrink: 0; width: 18px; }
.b-rec .b-act { margin-left: auto; flex-shrink: 0; }
.b-wait { color: var(--faint); font-size: 12.5px; padding: 3px 0 3px 28px; }
.b-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 26px; margin-top: 6px; }
@media (max-width: 1100px) { .b-cols { grid-template-columns: 1fr; } }
.b-h { font-family: var(--disp); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); margin: 12px 0 6px; }

/* ---- hermes / policies ------------------------------------------------------- */
.lvl { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; padding: 2px 7px; border-radius: 4px; border: 1px solid; }
.lvl.l0 { color: var(--faint); border-color: var(--line); }
.lvl.l1 { color: var(--igp); border-color: rgba(88,166,255,.4); }
.lvl.l2 { color: var(--warn); border-color: rgba(232,165,48,.4); }
.lvl.l3 { color: var(--ok); border-color: rgba(63,208,104,.4); }
.pol { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.pol .p-head { display: flex; gap: 10px; align-items: center; }
.pol .p-name { font-weight: 700; font-size: 14px; }
.pol .p-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 5px; line-height: 1.7; }
.pol .p-guard { font-size: 12px; color: var(--dim); margin-top: 5px; }
.switch { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.err-pre { font-family: var(--mono); font-size: 11px; color: #ffb3b3; background: rgba(255,92,92,.06); border: 1px solid rgba(255,92,92,.25); border-radius: 7px; padding: 8px 10px; margin-top: 7px; white-space: pre-wrap; word-break: break-word; }
.out-pre { font-family: var(--mono); font-size: 11px; color: var(--dim); background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; margin-top: 7px; white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow-y: auto; }
.conn-missing { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--warn); border: 1px dashed rgba(232,165,48,.5); border-radius: 4px; padding: 2px 7px; }
.tag.kind { background: var(--panel-2); color: var(--dim); border: 1px solid var(--line); }

.btn {
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--txt);
  border-radius: 7px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, color .12s;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #141003; }
.btn.primary:hover { filter: brightness(1.1); color: #141003; }
.btn.sm { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---- module page ------------------------------------------------------------ */
.mod-head { display: flex; align-items: baseline; gap: 14px; padding-top: 26px; }
.mod-head .m-ic { font-size: 30px; }
.mod-head h1 { font-family: var(--disp); font-size: 30px; letter-spacing: .03em; margin: 0; }
.mod-head .m-tag { color: var(--dim); font-size: 14px; }
.mod-note {
  margin-top: 12px; border: 1px solid rgba(240,180,41,.35); border-radius: 8px;
  background: rgba(240,180,41,.06); padding: 10px 14px; font-size: 13px; color: var(--warn);
}
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.linkcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .13s, transform .13s;
}
.linkcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.linkcard .lc-name { font-weight: 700; font-size: 14.5px; }
.linkcard .lc-desc { color: var(--dim); font-size: 12.5px; line-height: 1.45; flex: 1; }
.linkcard .lc-path { font-family: var(--mono); font-size: 10px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkcard .lc-acts { display: flex; gap: 6px; margin-top: 4px; }

.future {
  border: 1px dashed var(--line-2); border-radius: var(--rad); padding: 13px 15px;
  background: rgba(16,22,29,.5);
}
.future .f-name { font-weight: 700; font-size: 14px; color: var(--dim); }
.future .f-name::after { content: "PLANNED"; font-family: var(--mono); font-size: 9px; letter-spacing: .15em; color: var(--amber-dim); border: 1px solid var(--amber-dim); border-radius: 4px; padding: 1px 6px; margin-left: 9px; vertical-align: 2px; }
.future dl { margin: 8px 0 0; display: grid; grid-template-columns: 96px 1fr; gap: 3px 12px; font-size: 12.5px; }
.future dt { color: var(--faint); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.future dd { margin: 0; color: var(--dim); }
.future dd.next { color: var(--txt); }

/* ---- files/search page -------------------------------------------------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--dim);
  padding: 5px 13px; border-radius: 20px; font-size: 12.5px; cursor: pointer; font-weight: 600;
}
.chip.on { color: #141003; background: var(--amber); border-color: var(--amber); }
.empty { color: var(--faint); padding: 34px; text-align: center; font-size: 13.5px; }
.empty b { color: var(--dim); }

/* ---- admin ---------------------------------------------------------------------- */
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th { text-align: left; color: var(--faint); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.plain td { padding: 7px 8px; border-bottom: 1px solid rgba(34,48,65,.5); }
table.plain td.mono { font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* ---- login ------------------------------------------------------------------------ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card {
  width: 380px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 34px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.login-card .wordmark { padding: 0 0 6px; font-size: 26px; }
.login-card p { color: var(--dim); font-size: 13px; margin: 4px 0 20px; }
.login-card input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--txt); padding: 12px 14px; font-size: 15px; outline: none; margin-bottom: 12px;
}
.login-card input:focus { border-color: var(--amber); }
.login-card .btn.primary { width: 100%; padding: 11px; font-size: 14px; }
.login-err { color: var(--bad); font-size: 12.5px; min-height: 18px; margin-top: 10px; }

.loading { color: var(--faint); font-family: var(--mono); font-size: 12px; padding: 20px; }
