/* Biz-Comm Central: dark portal with Biz-Comm green accents. Shared by every signed-in page. */
:root {
  --bg:#0b0f0c; --panel:#131a15; --panel-2:#18211b; --line:#253028; --line-2:#334037;
  --fg:#e6ede7; --muted:#8fa094; --faint:#66756b;
  --accent:#56ab2f; --accent-hi:#74c94a; --accent-ink:#06120a; --accent-soft:rgba(86,171,47,.14);
  --ok:#74c94a; --warn:#e3b341; --bad:#ff7b72; --info:#79b8ff;
  --field:#0e1410; --radius:12px; --sbw:248px; --top:60px;
  --font:"IBM Plex Sans",-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,Menlo,Consolas,monospace;
  color-scheme: dark;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.45 var(--font); }
a { color:var(--accent-hi); text-decoration:none; }
a:hover { text-decoration:underline; }
h1 { font-size:1.5rem; margin:0; letter-spacing:-.01em; }
h2 { font-size:1.05rem; margin:0 0 4px; }
h3 { font-size:.95rem; margin:16px 0 6px; }
p { margin:6px 0; }
.sub, .muted { color:var(--muted); }
.sub { font-size:.88rem; }
.mono { font-family:var(--mono); font-size:.92em; }

/* ---------- frame: top bar + sidebar ---------- */
body.shell { padding:calc(var(--top) + 8px) 20px 40px calc(var(--sbw) + 32px); transition:padding-left .15s; }
.topbar { position:fixed; inset:0 0 auto 0; height:var(--top); z-index:40; display:flex; align-items:center; gap:16px; padding:0 16px 0 20px;
  background:rgba(11,15,12,.92); backdrop-filter:blur(8px); border-bottom:1px solid var(--line); }
.topbar .menu-btn { display:none; }
.topbar .logo { height:30px; width:auto; display:block; }
.topbar .appname { color:var(--muted); font-weight:500; padding-left:14px; border-left:1px solid var(--line); white-space:nowrap; }
.topbar .search { flex:1; max-width:560px; margin-left:auto; position:relative; }
.topbar .search input { padding-left:36px; background:var(--panel); }
.topbar .search svg { position:absolute; left:11px; top:50%; transform:translateY(-50%); width:17px; height:17px; color:var(--muted); pointer-events:none; }
.topbar .search kbd { position:absolute; right:10px; top:50%; transform:translateY(-50%); }
.topbar .me { display:flex; align-items:center; gap:10px; margin-left:auto; }
.topbar .who { text-align:right; line-height:1.2; font-size:.8rem; color:var(--muted); }
.topbar .who b { display:block; color:var(--fg); font-size:.88rem; font-weight:600; }
.avatar { width:34px; height:34px; border-radius:50%; background:var(--accent-soft); color:var(--accent-hi); border:1px solid var(--accent);
  display:grid; place-items:center; font-weight:700; font-size:.85rem; cursor:pointer; }
.usermenu { position:absolute; right:12px; top:calc(var(--top) - 4px); min-width:200px; background:var(--panel); border:1px solid var(--line-2);
  border-radius:10px; padding:6px; box-shadow:0 12px 32px rgba(0,0,0,.5); z-index:50; }
.usermenu a, .usermenu button { display:block; width:100%; text-align:left; padding:8px 10px; border-radius:7px; color:var(--fg); background:none;
  border:0; font:inherit; cursor:pointer; }
.usermenu a:hover, .usermenu button:hover { background:var(--panel-2); text-decoration:none; }
kbd { font:11px var(--mono); color:var(--muted); border:1px solid var(--line-2); border-radius:5px; padding:1px 5px; background:var(--panel-2); }

.sidebar { position:fixed; z-index:35; top:calc(var(--top) + 12px); bottom:12px; left:12px; width:var(--sbw); background:var(--panel);
  border:1px solid var(--line); border-radius:var(--radius); padding:10px; display:flex; flex-direction:column; gap:2px; overflow-y:auto; }
.sidebar .pick { display:flex; align-items:center; gap:10px; width:100%; margin-bottom:8px; padding:10px 12px; border-radius:10px;
  border:1px solid var(--line-2); background:var(--field); color:var(--fg); font:inherit; font-weight:600; text-align:left; cursor:pointer; }
.sidebar .pick:hover { border-color:var(--accent); }
.sidebar .pick .lbl { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar .pick svg { width:16px; height:16px; color:var(--muted); flex:none; }
.sidebar .grp { font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--faint); padding:14px 12px 4px; }
.sidebar a.it { display:flex; align-items:center; gap:12px; padding:9px 12px; border-radius:9px; color:var(--muted); font-weight:500; white-space:nowrap; }
.sidebar a.it:hover { background:var(--panel-2); color:var(--fg); text-decoration:none; }
.sidebar a.it[aria-current] { background:var(--accent-soft); color:var(--accent-hi); font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.sidebar a.it.soon { opacity:.55; cursor:default; }
.sidebar a.it.soon:hover { background:none; color:var(--muted); }
.sidebar a.it svg { width:18px; height:18px; flex:none; }
.sidebar a.it .badge { margin-left:auto; font-size:.66rem; border:1px solid var(--line-2); border-radius:999px; padding:0 7px; color:var(--faint); }
.sidebar .sp { flex:1; min-height:12px; }
.sidebar .foot { font-size:.72rem; color:var(--faint); padding:8px 12px 2px; }
.scrim { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:34; }

/* ---------- page ---------- */
.page { max-width:1240px; margin:0 auto; }
.head { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; margin:14px 0 16px; }
.head .grow { flex:1; min-width:200px; }
.crumb { font-size:.85rem; color:var(--muted); margin-bottom:4px; }
.crumb a { color:var(--muted); }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px; margin-bottom:16px; min-width:0; }
.panel > h2:first-child { margin-bottom:12px; }
.cols { display:grid; grid-template-columns:2fr 1fr; gap:16px; align-items:start; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:16px; }
.tile { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; display:block; color:var(--fg); }
a.tile:hover { border-color:var(--accent); text-decoration:none; }
.tile .n { font-size:1.9rem; font-weight:600; font-variant-numeric:tabular-nums; line-height:1.1; }
.tile .l { color:var(--muted); font-size:.85rem; display:flex; align-items:center; gap:7px; }

/* ---------- forms ---------- */
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px 14px; }
.grid .wide { grid-column:1 / -1; }
label { display:flex; flex-direction:column; gap:5px; font-size:.74rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); min-width:0; }
label.chk { flex-direction:row; align-items:center; gap:8px; text-transform:none; letter-spacing:0; font-size:.92rem; font-weight:500; color:var(--fg); }
input, select, textarea { font:inherit; font-size:.95rem; color:var(--fg); background:var(--field); border:1px solid var(--line-2); border-radius:8px;
  padding:9px 11px; width:100%; min-width:0; text-transform:none; letter-spacing:0; font-weight:400; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width:auto; accent-color:var(--accent); flex:none; box-shadow:none; }
textarea { min-height:90px; resize:vertical; }
button, .btn { font:inherit; font-size:.92rem; cursor:pointer; border-radius:8px; border:1px solid var(--line-2); background:var(--panel-2); color:var(--fg);
  padding:8px 14px; display:inline-flex; align-items:center; gap:7px; text-decoration:none; white-space:nowrap; }
button:hover, .btn:hover { border-color:var(--faint); text-decoration:none; }
button.primary, .btn.primary { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600; }
button.primary:hover, .btn.primary:hover { background:var(--accent-hi); border-color:var(--accent-hi); }
button.danger { color:var(--bad); }
button.small, .btn.small { padding:5px 10px; font-size:.84rem; }
button.link { background:none; border:0; padding:0; color:var(--accent-hi); }
button:disabled { opacity:.5; cursor:default; }
button svg, .btn svg { width:16px; height:16px; }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; flex-wrap:wrap; }
.msg { font-size:.9rem; margin-top:10px; min-height:1.2em; }
.msg.bad { color:var(--bad); } .msg.ok { color:var(--ok); }

/* ---------- tables ---------- */
.table { overflow-x:auto; border:1px solid var(--line); border-radius:10px; }
table { width:100%; border-collapse:collapse; font-size:.92rem; }
th, td { text-align:left; padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
th { color:var(--muted); font-weight:600; font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; background:var(--panel-2); white-space:nowrap; }
tr:last-child td { border-bottom:0; }
tbody tr.link { cursor:pointer; }
tbody tr.link:hover td { background:var(--panel-2); }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; }
.empty { text-align:center; color:var(--muted); padding:28px 12px; }

/* ---------- pills, status dots ---------- */
.pill { display:inline-flex; align-items:center; gap:6px; font-size:.76rem; font-weight:600; border-radius:999px; padding:2px 9px; border:1px solid var(--line-2);
  color:var(--muted); white-space:nowrap; }
.dot { width:8px; height:8px; border-radius:50%; background:var(--faint); flex:none; display:inline-block; }
.s-prospect .dot, .dot.s-prospect { background:var(--info); }
.s-construction .dot, .dot.s-construction { background:var(--warn); }
.s-managed .dot, .dot.s-managed { background:var(--ok); }
.s-inactive .dot, .dot.s-inactive { background:var(--faint); }
.pill.s-construction { color:var(--warn); border-color:rgba(227,179,65,.4); }
.pill.s-managed { color:var(--ok); border-color:rgba(116,201,74,.4); }
.pill.s-prospect { color:var(--info); border-color:rgba(121,184,255,.4); }
.pill.on { color:var(--ok); border-color:rgba(116,201,74,.4); } .pill.off { color:var(--warn); border-color:rgba(227,179,65,.4); }

/* ---------- tabs ---------- */
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; overflow-x:auto; }
.tabs a { padding:9px 14px; color:var(--muted); border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; font-weight:500; }
.tabs a:hover { color:var(--fg); text-decoration:none; }
.tabs a[aria-current] { color:var(--accent-hi); border-bottom-color:var(--accent); }
.tabs a.soon { opacity:.5; }
dl.facts { display:grid; grid-template-columns:150px 1fr; gap:8px 16px; margin:0; font-size:.94rem; }
dl.facts dt { color:var(--muted); }
dl.facts dd { margin:0; min-width:0; overflow-wrap:anywhere; }

/* ---------- dialogs, overlays, toasts ---------- */
dialog { background:var(--panel); color:var(--fg); border:1px solid var(--line-2); border-radius:14px; padding:0; width:min(640px, calc(100vw - 24px));
  box-shadow:0 24px 60px rgba(0,0,0,.6); }
dialog::backdrop { background:rgba(0,0,0,.6); }
dialog form, dialog .body { padding:20px; }
dialog h2 { margin-bottom:14px; }
.overlay { position:fixed; inset:0; z-index:60; background:rgba(0,0,0,.6); display:flex; align-items:flex-start; justify-content:center; padding:10vh 12px 12px; }
.finder { width:min(640px, 100%); background:var(--panel); border:1px solid var(--line-2); border-radius:14px; box-shadow:0 24px 60px rgba(0,0,0,.6); overflow:hidden; }
.finder input { border:0; border-bottom:1px solid var(--line); border-radius:0; padding:16px 18px; font-size:1.05rem; background:var(--panel); }
.finder input:focus { box-shadow:none; }
.finder ul { list-style:none; margin:0; padding:6px; max-height:56vh; overflow-y:auto; }
.finder li a { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:9px; color:var(--fg); }
.finder li a:hover, .finder li a.sel { background:var(--panel-2); text-decoration:none; }
.finder li a.sel { box-shadow:inset 3px 0 0 var(--accent); }
.finder .t { font-weight:600; }
.finder .s { color:var(--muted); font-size:.84rem; }
.finder .k { margin-left:auto; font-size:.72rem; color:var(--faint); text-transform:uppercase; letter-spacing:.06em; }
.finder .none { padding:18px; color:var(--muted); text-align:center; }
.finder .hint { padding:8px 14px; border-top:1px solid var(--line); color:var(--faint); font-size:.78rem; display:flex; gap:14px; }
.toast { position:fixed; right:18px; bottom:18px; z-index:70; background:var(--panel-2); border:1px solid var(--accent); color:var(--fg);
  padding:11px 16px; border-radius:10px; box-shadow:0 12px 30px rgba(0,0,0,.5); font-size:.92rem; }
.toast.bad { border-color:var(--bad); }
.notice { border:1px solid rgba(227,179,65,.45); background:rgba(227,179,65,.08); border-radius:10px; padding:12px 14px; margin-bottom:16px; }
.notice.ok { border-color:rgba(116,201,74,.45); background:var(--accent-soft); }
.codes { display:grid; grid-template-columns:repeat(2, max-content); gap:6px 24px; font:15px var(--mono); margin:10px 0; }
.qr { background:#fff; padding:10px; border-radius:10px; display:block; width:max-content; line-height:0; }
.qr svg { width:180px; height:180px; }

/* ---------- small screens ---------- */
@media (max-width:900px) {
  body.shell { padding:calc(var(--top) + 8px) 12px 32px; }
  .topbar { gap:10px; padding:0 10px; }
  .topbar .menu-btn { display:inline-flex; background:none; border:0; padding:6px; }
  .topbar .appname, .topbar .who, .topbar .search kbd { display:none; }
  .topbar .logo { height:24px; }
  .sidebar { transform:translateX(calc(-100% - 20px)); transition:transform .2s; }
  body.nav-open .sidebar { transform:none; }
  .cols { grid-template-columns:1fr; }
  dl.facts { grid-template-columns:1fr; gap:2px 0; }
  dl.facts dd { margin-bottom:8px; }
}
@media (max-width:640px) {
  .stack thead { display:none; }
  .stack table, .stack tbody, .stack tr, .stack td { display:block; width:100%; }
  .stack tr { border-bottom:1px solid var(--line); padding:8px 0; }
  .stack td { border:0; padding:3px 14px; }
  .stack td.num { text-align:left; }
}

/* ---------- projects: progress, stages, board ---------- */
.prog { height:6px; background:var(--panel-2); border:1px solid var(--line); border-radius:4px; overflow:hidden; min-width:80px; }
.prog > div { height:100%; background:var(--accent); }
.seg { display:flex; gap:3px; }
.seg i { flex:1; height:6px; border-radius:3px; background:var(--panel-2); border:1px solid var(--line-2); }
.seg i.on { background:var(--accent); border-color:var(--accent); }
.seg i.cur { background:var(--warn); border-color:var(--warn); }
.pill.d-pending { color:var(--faint); }
.pill.d-due { color:var(--warn); border-color:rgba(227,179,65,.5); }
.pill.d-invoiced { color:var(--info); border-color:rgba(121,184,255,.45); }
.pill.d-paid { color:var(--ok); border-color:rgba(116,201,74,.45); }
.late { color:var(--bad); }
.board { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(200px,1fr); gap:12px; overflow-x:auto; padding-bottom:6px; }
.board .col { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:10px; min-height:120px; }
.board .col h3 { margin:2px 4px 10px; font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); display:flex; justify-content:space-between; }
.board .card { display:block; background:var(--panel-2); border:1px solid var(--line-2); border-radius:10px; padding:10px 12px; margin-bottom:8px; color:var(--fg); }
.board .card:hover { border-color:var(--accent); text-decoration:none; }
.board .card .s { color:var(--muted); font-size:.82rem; }
.week { margin-bottom:18px; }
.week h3 { margin:0 0 6px; font-size:.78rem; text-transform:uppercase; letter-spacing:.07em; color:var(--faint); }
.ms { display:flex; gap:14px; align-items:center; padding:9px 4px; border-bottom:1px solid var(--line); }
.ms .d { width:92px; flex:none; font-variant-numeric:tabular-nums; color:var(--muted); font-size:.88rem; }
.ms .main { flex:1; min-width:0; }
input.mono, textarea.mono { font-family:var(--mono); font-size:.9rem; }
