/* BNZ Jarvis — obsidian & graphite, one electric-blue accent. Dense, quiet, precise. */
:root {
  --bg: #07090c;
  --bg-2: #0c1015;
  --panel: #10151b;
  --panel-2: #151b23;
  --line: #1c242e;
  --line-2: #2a3441;
  --text: #e8edf3;
  --text-2: #a3aebb;
  --text-3: #6b7786;
  --blue: #3d8bff;
  --blue-dim: rgba(61, 139, 255, 0.14);
  --green: #3ecf8e;
  --amber: #f5b84b;
  --red: #ff5d5d;
  --violet: #9d8cff;
  --r: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* boot */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.boot-mark, .brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(160deg, #1b2735, #0c1218); border: 1px solid #2a3a4e; color: var(--text); font-weight: 700; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(61,139,255,.15); }
.boot-mark { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(61,139,255,.06), inset 0 0 0 1px rgba(61,139,255,.4); } }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% -20%, rgba(61,139,255,.12), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth h1 { font-size: 20px; margin: 18px 0 6px; letter-spacing: -0.01em; }
.stack { display: grid; gap: 12px; margin-top: 16px; }
label { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
input { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 16px; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.btn { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 8px; padding: 9px 14px; cursor: pointer; font-weight: 550; min-height: 40px; }
.btn:hover { border-color: #3a4757; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; }
.small { font-size: 12px; }
.secret { display: block; font-family: var(--mono); font-size: 13px; background: var(--bg-2); border: 1px dashed var(--line-2); padding: 10px; border-radius: 8px; word-break: break-all; }
.msg { min-height: 20px; font-size: 13px; color: var(--amber); margin: 12px 0 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }

/* shell */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
.rail { border-right: 1px solid var(--line); background: var(--bg-2); padding: 18px 12px; display: flex; flex-direction: column; gap: 22px; }
.rail .brand { padding: 0 8px; }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
#nav a:hover { background: var(--panel); color: var(--text); }
#nav a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--blue); }
#nav .k { font-family: var(--mono); font-size: 10px; color: var(--text-3); width: 14px; }
.pill { margin-left: auto; background: rgba(245,184,75,.16); color: var(--amber); font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.rail-foot { margin-top: auto; padding: 0 10px; display: grid; gap: 6px; }
.entity { font-size: 12px; color: var(--text-3); }
.main { display: flex; flex-direction: column; min-height: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(7,9,12,.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.cmdk { flex: 1; max-width: 560px; display: flex; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; color: var(--text-3); cursor: text; text-align: left; }
.cmdk kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; color: var(--text-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.clock { font-family: var(--mono); color: var(--text-2); font-size: 12px; }
.mic { display: flex; align-items: center; gap: 8px; background: var(--blue-dim); border: 1px solid rgba(61,139,255,.45); color: #cfe1ff; border-radius: 99px; padding: 7px 14px 7px 10px; cursor: pointer; font-weight: 600; min-height: 36px; }
.mic-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(61,139,255,.25); }
.mic.live .mic-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255,93,93,.25); animation: pulse 1s infinite; }
.view { padding: 22px 24px 60px; overflow: auto; flex: 1; outline: none; }

/* typography inside views */
.h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.sub { color: var(--text-2); margin: 4px 0 0; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 0 0 10px; }
.sec { margin-top: 26px; }
.row { display: flex; gap: 12px; align-items: baseline; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.panel-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 13px; margin: 0; font-weight: 600; }
.panel-b { padding: 6px 16px 14px; }

/* briefing */
.brief-voice { margin: 14px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg, rgba(61,139,255,.07), transparent 80%), var(--panel); font-size: 16px; line-height: 1.55; display: flex; gap: 14px; align-items: flex-start; }
.brief-voice button { flex: none; }
.item { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover .item-t { color: #fff; }
.item-i { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.k-deadline { background: rgba(61,139,255,.14); color: var(--blue); }
.k-money { background: rgba(62,207,142,.14); color: var(--green); }
.k-blocker { background: rgba(245,184,75,.14); color: var(--amber); }
.k-conflict { background: rgba(157,140,255,.16); color: var(--violet); }
.k-approval { background: rgba(255,93,93,.14); color: var(--red); }
.item-t { font-weight: 550; color: var(--text); }
.item-w { color: var(--text-2); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text-3); white-space: nowrap; height: fit-content; }
.tag.v { color: var(--green); border-color: rgba(62,207,142,.35); }
.tag.r { color: var(--amber); border-color: rgba(245,184,75,.35); }
.src { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.src a { color: var(--text-3); text-decoration: underline dotted; }
.src a:hover { color: var(--blue); }

/* stat tiles */
.stat { padding: 14px 16px; }
.stat-l { font-size: 12px; color: var(--text-2); }
.stat-v { font-size: 24px; font-weight: 600; margin-top: 4px; font-family: var(--mono); letter-spacing: -0.03em; }
.stat-s { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.neg { color: var(--red); }
.pos { color: var(--green); }

/* salah */
.salah { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.salah div { padding: 8px 6px; border-radius: 8px; text-align: center; }
.salah div.next { background: var(--blue-dim); box-shadow: inset 0 0 0 1px rgba(61,139,255,.4); }
.salah b { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.salah span { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.r, th.r { text-align: right; }
.st { align-self: start; height: fit-content; line-height: 1.6; font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); white-space: nowrap; color: var(--text-2); }
.st.active, .st.awarded { color: var(--green); border-color: rgba(62,207,142,.4); }
.st.punch_list, .st.preconstruction, .st.walkthrough, .st.reviewing { color: var(--amber); border-color: rgba(245,184,75,.4); }
.st.closeout, .st.submitted { color: var(--blue); border-color: rgba(61,139,255,.45); }
.st.dispute, .st.lost { color: var(--red); border-color: rgba(255,93,93,.4); }
.unk { color: var(--text-3); font-family: var(--mono); font-size: 12px; }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); min-height: 200px; scroll-snap-align: start; }
.col-h { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); position: sticky; top: 0; }
.col-b { padding: 8px; display: grid; gap: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.card:hover { border-color: #33404f; }
.card-t { font-weight: 550; font-size: 13px; line-height: 1.35; }
.card-m { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.due-soon { color: var(--amber); }
.due-past { color: var(--red); }

/* ask */
.ask-box { display: flex; gap: 10px; }
.ask-box input { flex: 1; }
.agents { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.agent { padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.agent.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.agent b { display: block; font-size: 14px; }
.agent span { font-size: 12px; color: var(--text-2); }
.answer { margin-top: 16px; padding: 16px 18px; white-space: pre-wrap; line-height: 1.6; }
.meta { font-size: 11px; color: var(--text-3); margin-top: 10px; font-family: var(--mono); }
.fb { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* conflicts */
.conf { padding: 16px; display: grid; gap: 12px; }
.conf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.fact { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; background: var(--bg-2); }
.fact-v { font-family: var(--mono); font-size: 15px; }

/* systems */
.sys { display: grid; grid-template-columns: 140px 120px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.connected { background: var(--green); } .dot.snapshot { background: var(--amber); } .dot.not_connected { background: var(--text-3); } .dot.error { background: var(--red); }

/* palette / drawer / voice */
.palette { position: fixed; inset: 0; background: rgba(3,5,8,.6); backdrop-filter: blur(4px); z-index: 30; display: flex; justify-content: center; padding-top: 12vh; }
.palette-box { width: min(640px, 92vw); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; height: fit-content; }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 16px 18px; font-size: 16px; }
.palette-box input:focus { box-shadow: none; }
#palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
#palette-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
#palette-list li.sel, #palette-list li:hover { background: var(--panel-2); }
#palette-list .t { font-size: 10px; text-transform: uppercase; color: var(--text-3); width: 54px; flex: none; letter-spacing: .06em; }
.drawer { position: fixed; inset: 0; background: rgba(3,5,8,.5); z-index: 25; display: flex; justify-content: flex-end; }
.drawer-box { width: min(560px, 100vw); height: 100%; background: var(--bg-2); border-left: 1px solid var(--line-2); padding: 22px; overflow: auto; position: relative; }
.drawer-close { position: absolute; top: 14px; right: 14px; background: none; border: 0; font-size: 22px; color: var(--text-2); cursor: pointer; width: 36px; height: 36px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin-top: 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.voice { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(3,5,8,.72); backdrop-filter: blur(6px); }
.voice-ring { width: 110px; height: 110px; border-radius: 50%; border: 2px solid var(--blue); box-shadow: 0 0 40px rgba(61,139,255,.35), inset 0 0 30px rgba(61,139,255,.25); animation: pulse 1.2s ease-in-out infinite; margin: 0 auto; }
.voice p { text-align: center; color: var(--text-2); margin-top: 20px; max-width: 520px; font-size: 16px; }
.empty { padding: 24px; text-align: center; color: var(--text-3); }
.note { font-size: 12px; color: var(--text-3); margin-top: 8px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .brand-text, .rail-foot, #nav .k { display: none; }
  #nav { display: flex; gap: 2px; }
  #nav { flex: 0 0 auto; min-width: max-content; }
  #nav a { white-space: nowrap; padding: 7px 10px; flex: 0 0 auto; }
  .rail .brand { flex: 0 0 auto; }
  .g2, .g4 { grid-template-columns: 1fr; }
  .agents { grid-template-columns: repeat(2, 1fr); }
  .top { padding: 10px 12px; }
  .view { padding: 16px 12px 60px; }
  .clock { display: none; }
  .sys { grid-template-columns: 1fr auto; }
  .stack-table thead { display: none; }
  .stack-table tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stack-table td { border: 0; padding: 2px 4px; }
}
