/* ============================================================
   MTOS — MC3 Tech Labs Operating System
   Charcoal + Gold, Inter, dark-first admin UI.
   ============================================================ */
:root {
  --c900: #14161B;
  --c800: #1A1C22;
  --c700: #23262D;
  --c600: #2F333D;
  --gold: #C8A84B;
  --gold-2: #D4B85E;
  --gold-dim: rgba(200, 168, 75, 0.12);
  --gold-line: rgba(200, 168, 75, 0.28);
  --ink: #FAFAFA;
  --muted: #A1A1AA;
  --muted-2: #71717A;
  --line: #2F333D;
  --line-soft: rgba(255, 255, 255, 0.07);
  --ok: #10B981;
  --warn: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --purple: #8B5CF6;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--c900); color: var(--ink); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .9rem; color: var(--muted); }
strong { color: var(--ink); }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px; flex: 0 0 272px; background: var(--c800); border-right: 1px solid var(--line-soft);
  height: 100vh; position: sticky; top: 0; overflow-y: auto; padding: 18px 14px 40px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; }
.sidebar .brand img { height: 40px; width: auto; }
.sidebar .brand small { display: block; font-size: .68rem; color: var(--muted-2); letter-spacing: .12em; text-transform: uppercase; }
.group-label { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(200,168,75,.85); margin: 18px 10px 8px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.group-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-line), transparent); }
.nav-section > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary:hover { background: var(--c700); color: var(--ink); }
.nav-section[open] > summary { color: var(--ink); }
.nav-section > summary .emoji { font-size: .95rem; }
.nav-section ul { list-style: none; margin: 2px 0 6px; padding: 0 0 0 12px; }
.nav-section li a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; font-size: .8rem; color: var(--muted); }
.nav-section li a:hover { background: var(--c700); color: var(--ink); }
.nav-section li a.active { background: var(--gold-dim); color: var(--gold-2); }

.main { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(20,22,27,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); padding: 12px 26px; display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.search { display: flex; align-items: center; gap: 8px; background: var(--c700); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; flex: 1; max-width: 460px; }
.search input { background: none; border: none; color: var(--ink); outline: none; font: inherit; width: 100%; }
.search i { color: var(--muted-2); }
.content { padding: 30px 26px 70px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .badge { display: inline-block; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-line); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.page-head p { max-width: 70ch; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
.g4 { grid-template-columns: repeat(4,1fr); }
.card { background: var(--c700); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.flat { background: var(--c800); }
.card h3 { margin-bottom: .5rem; }
.card p:last-child { margin-bottom: 0; }
.section { margin-bottom: 34px; }
.section > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section > h2::before { content: ''; width: 4px; height: 20px; background: var(--gold); border-radius: 2px; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }
.kpi .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; }
.kpi .value.gold { color: var(--gold); }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.trend { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.trend.up { background: rgba(16,185,129,.14); color: #6EE7B7; }
.trend.down { background: rgba(239,68,68,.14); color: #FCA5A5; }

/* ---------- Pills / status ---------- */
.pill { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--c600); color: var(--muted); }
.pill.gold { background: var(--gold-dim); color: var(--gold-2); border: 1px solid var(--gold-line); }
.pill.ok { background: rgba(16,185,129,.14); color: #6EE7B7; }
.pill.warn { background: rgba(245,158,11,.14); color: #FCD34D; }
.pill.danger { background: rgba(239,68,68,.14); color: #FCA5A5; }
.pill.info { background: rgba(59,130,246,.14); color: #93C5FD; }
.pill.purple { background: rgba(139,92,246,.14); color: #C4B5FD; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: var(--font); font-size: .85rem; font-weight: 600; padding: 0 15px; min-height: 40px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: .15s ease; }
.btn-primary { background: var(--gold); color: #16181D; }
.btn-primary:hover { background: var(--gold-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-danger { background: rgba(239,68,68,.14); color: #FCA5A5; border-color: rgba(239,68,68,.35); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: .78rem; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; font-family: var(--font); font-size: .9rem; color: var(--ink); background: var(--c900); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.row { display: grid; gap: 14px; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: 1fr 1fr 1fr; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); }
tr:hover td { background: rgba(255,255,255,.015); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(900px 500px at 50% -10%, rgba(200,168,75,.10), transparent), var(--c900); }
.login-card { width: 100%; max-width: 400px; background: var(--c800); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.login-card img { height: 56px; margin: 0 auto 18px; }
.login-card h1 { text-align: center; font-size: 1.35rem; }
.login-card p { text-align: center; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mt-0 { margin-top: 0 } .mt-2 { margin-top: 14px } .mt-3 { margin-top: 22px }
.mb-0 { margin-bottom: 0 }
.flex { display: flex; } .between { justify-content: space-between } .items-center { align-items: center }
.gap { gap: 12px } .wrap { flex-wrap: wrap }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: none; }
.check { color: var(--gold); margin-top: 4px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted-2); border: 1px dashed var(--line); border-radius: var(--radius); }
.bar { height: 8px; background: var(--c900); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.divider { height: 1px; background: var(--line-soft); margin: 22px 0; border: 0; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--c700); border: 1px solid var(--gold-line); color: var(--ink); padding: 12px 16px; border-radius: 10px; font-size: .85rem; box-shadow: 0 20px 50px rgba(0,0,0,.5); z-index: 100; display: none; }
.toast.show { display: block; }
dialog { border: 1px solid var(--line); background: var(--c800); color: var(--ink); border-radius: 14px; padding: 0; max-width: 640px; width: calc(100vw - 40px); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog .dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
dialog .dlg-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
dialog .dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; }
.x { background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.burger { display: none; background: none; border: 1px solid var(--line); color: var(--ink); width: 38px; height: 38px; border-radius: 9px; cursor: pointer; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; gap: 4px; background: var(--c800); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg .btn { min-height: 30px; }

/* ---------- Kanban board ---------- */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--c800); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; min-height: 140px; display: flex; flex-direction: column; }
.kb-col.drop { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-line); }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.kb-col-head h3 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.kb-count { font-size: .7rem; font-weight: 700; color: var(--gold-2); background: var(--gold-dim); border-radius: 999px; padding: 2px 8px; }
.kb-cards { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kb-card { background: var(--c700); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: grab; transition: .12s ease; }
.kb-card:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.kb-card.dragging { opacity: .45; }
.kb-card h4 { margin: 0 0 4px; font-size: .92rem; }
.kb-card .meta { font-size: .74rem; color: var(--muted-2); margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; }
.kb-move { display: flex; gap: 4px; margin-top: 10px; }
.kb-move button { flex: 1; font-size: .68rem; min-height: 26px; padding: 0 6px; }

/* ---------- Tabs (project detail) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .85rem; padding: 10px 14px; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab .n { font-size: .68rem; background: var(--c600); border-radius: 999px; padding: 1px 7px; margin-left: 6px; color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Milestones / timeline ---------- */
.ms { position: relative; padding-left: 26px; }
.ms::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.ms-item { position: relative; padding: 0 0 18px; }
.ms-item::before { content: ''; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--c800); border: 2px solid var(--muted-2); }
.ms-item.done::before { background: var(--gold); border-color: var(--gold); }
.ms-item.prog::before { border-color: var(--info); background: var(--info); }
.ms-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ms-head strong { font-size: .9rem; }
.ms-date { font-size: .74rem; color: var(--muted-2); }
.ms-item .small { margin-top: 4px; }

/* ---------- Activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.feed li:last-child { border-bottom: none; }
.feed .dot { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c600); color: var(--gold-2); font-size: .74rem; }
.feed .body { flex: 1; min-width: 0; }
.feed .body .when { font-size: .72rem; color: var(--muted-2); }
.feed .who { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-left: 6px; }
.feed .who.client { color: var(--info); }
.feed .who.mc3 { color: var(--gold-2); }

/* ---------- Chat / messages ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 78%; padding: 10px 13px; border-radius: 12px; font-size: .86rem; line-height: 1.45; }
.bubble.client { align-self: flex-start; background: var(--c600); border-bottom-left-radius: 3px; }
.bubble.mc3 { align-self: flex-end; background: var(--gold-dim); border: 1px solid var(--gold-line); border-bottom-right-radius: 3px; }
.bubble .meta { display: block; font-size: .68rem; color: var(--muted-2); margin-top: 5px; }
.chat-form { display: flex; gap: 8px; margin-top: 14px; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; font-family: var(--font); font-size: .9rem; color: var(--ink); background: var(--c900); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; resize: vertical; }

/* ---------- Client portal (public) ---------- */
.portal { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1000px 520px at 50% -8%, rgba(200,168,75,.10), transparent), var(--c900); }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 26px; border-bottom: 1px solid var(--line-soft); }
.portal-brand img { height: 38px; width: auto; }
.portal-badge { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-line); padding: 5px 12px; border-radius: 999px; }
.portal-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 30px 26px 60px; }
.portal-foot { border-top: 1px solid var(--line-soft); padding: 18px 26px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: var(--muted-2); }
.portal-foot a { color: var(--gold-2); }
.p-welcome { background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px; }
.p-welcome h2 { margin-bottom: 4px; }
.p-proj { margin-bottom: 18px; }
.p-proj .p-phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.p-proj .p-phead h3 { margin: 0; }
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; }
.tile { background: var(--c800); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.tile .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); }
.tile .val { font-size: 1.15rem; font-weight: 700; }
.tile .val.gold { color: var(--gold); }
.privacy-note { font-size: .74rem; color: var(--muted-2); margin-top: 10px; }

/* ---------- Client-visible previews ---------- */
.preview-callout { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--gold-line); background: var(--gold-dim); }
.preview-callout-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.preview-callout-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--c800); border: 1px solid var(--gold-line); color: var(--gold); font-size: 1rem; }
.preview-callout-title { font-weight: 700; font-size: .95rem; }
.preview-history { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.preview-history summary { cursor: pointer; color: var(--gold-2); font-weight: 600; }
.preview-history .list { margin-top: 8px; }
.preview-history .list li { align-items: flex-start; }

/* ---------- Funnel: inline controls (selects used outside .field) ---------- */
select {
  font-family: var(--font); font-size: .82rem; color: var(--ink);
  background: var(--c900); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; cursor: pointer;
}
select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
td select { padding: 5px 8px; font-size: .78rem; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 7px; font: inherit; }
.icon-btn:hover { color: var(--gold-2); background: var(--c600); }

@media (max-width: 900px) {
  .g4 { grid-template-columns: repeat(2,1fr); }
  .g3 { grid-template-columns: repeat(2,1fr); }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar { position: fixed; z-index: 50; left: -290px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 0 0 60px rgba(0,0,0,.6); }
}
@media (max-width: 620px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .row.c2, .row.c3 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 60px; }
  .portal-main { padding: 20px 16px 50px; }
}

/* ---------- Company pages (lead text, numbered lists, org chart, callouts) ---------- */
.lead { font-size: 1.02rem; font-weight: 500; color: var(--ink); }
.mb-3 { margin-bottom: 22px }
.stack { display: flex; flex-direction: column; gap: 12px; }
.numbered { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.numbered li { display: flex; gap: 14px; align-items: flex-start; }
.numbered li:not(.card) { align-items: center; }
.numbered .num { flex: 0 0 28px; height: 28px; border-radius: 999px; background: var(--gold-dim); border: 1px solid var(--gold-line); color: var(--gold); font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.numbered h3 { font-size: .98rem; }
.org-chart { display: flex; flex-direction: column; align-items: center; overflow-x: auto; }
.org-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 24px; border: 1px solid var(--gold-line); border-radius: var(--radius); background: var(--c800); text-align: center; }
.org-head i { color: var(--gold); font-size: 1.2rem; }
.org-trunk { width: 1px; height: 22px; background: var(--line); }
.org-nodes { width: 100%; display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.org-node { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--c800); text-align: center; font-size: .8rem; font-weight: 600; }
.org-node i { color: var(--gold); }
.callout { display: flex; gap: 14px; align-items: flex-start; }
.callout > i { color: var(--gold); font-size: 1.1rem; margin-top: 3px; }
.callout.ok { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.05); }
.callout.ok > i { color: var(--ok); }
.callout.warn { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.05); }
.callout.warn > i { color: var(--warn); }
.kpi strong { font-size: .95rem; }

/* ---------- Company One-Pager: a white, printable letter-size sheet ---------- */
.op-sheet { background: #fff; color: #1A1C22; border-radius: var(--radius); overflow: hidden; max-width: 900px; margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.op-sheet p { color: #4B5563; }
.op-sheet h2 { margin: 0; }
.op-band { background: #1A1C22; padding: 26px 32px; }
.op-logo { height: 46px; width: auto; }
.op-eyebrow { margin: 0; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: #C8A84B; font-weight: 700; }
.op-band-sub { margin: 2px 0 0; font-size: .74rem; color: #9CA3AF !important; }
.op-tagline { margin: 18px 0 0; color: #fff !important; font-size: 1.1rem; font-weight: 600; line-height: 1.45; max-width: 60ch; }
.op-body { padding: 26px 32px; display: flex; flex-direction: column; gap: 24px; }
.op-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.op-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.op-box { border: 1px solid #E5E7EB; border-radius: 10px; padding: 16px; break-inside: avoid; }
.op-box p { font-size: .8rem; line-height: 1.55; }
.op-box h2 { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.op-problem { background: #FEF2F2; border-color: #FECACA; }
.op-problem h2 { color: #DC2626; }
.op-help { background: rgba(200,168,75,.1); border-color: rgba(200,168,75,.4); }
.op-help h2 { color: #9A7F2E; }
.op-h { font-size: .86rem !important; text-transform: uppercase; letter-spacing: .1em; color: #1A1C22; display: flex; align-items: center; gap: 8px; margin-bottom: 12px !important; }
.op-h::before { content: ''; width: 4px; height: 16px; background: #C8A84B; border-radius: 2px; }
.op-line-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.op-line-head strong { color: #1A1C22; letter-spacing: .03em; }
.op-icon { width: 30px; height: 30px; border-radius: 8px; background: #1A1C22; color: #C8A84B; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.op-box ul, .op-serves { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .78rem; color: #374151; }
.op-serves { grid-template-columns: 1fr 1fr; }
.op-box li i, .op-serves i { color: #C8A84B; width: 16px; margin-right: 6px; }
.op-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.op-step { display: inline-flex; align-items: center; gap: 6px; background: #1A1C22; color: #fff; font-size: .76rem; font-weight: 600; padding: 3px 12px 3px 4px; border-radius: 999px; }
.op-step b { background: #C8A84B; color: #1A1C22; width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
.op-small { font-size: .78rem; margin: 10px 0 0; }
.op-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 32px; }
.op-foot-title { margin: 0; color: #fff !important; font-weight: 600; font-size: .9rem; }

@media (max-width: 900px) {
  .org-nodes { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .op-grid-2, .op-grid-3, .op-serves { grid-template-columns: 1fr; }
  .op-band, .op-body { padding-left: 18px; padding-right: 18px; }
}
/* Printing the One-Pager prints only the sheet, laid out at desktop width. */
@media print {
  body:has(.op-sheet) { background: #fff; }
  body:has(.op-sheet) .sidebar,
  body:has(.op-sheet) .topbar,
  body:has(.op-sheet) .page-head,
  body:has(.op-sheet) .no-print,
  body:has(.op-sheet) .toast { display: none !important; }
  body:has(.op-sheet) .content { padding: 0; max-width: none; }
  /* Scale the sheet down so the whole page fits on one letter page. */
  .op-sheet { box-shadow: none; border-radius: 0; max-width: none; zoom: 0.74; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .op-grid-2 { grid-template-columns: 1fr 1fr !important; }
  .op-grid-3 { grid-template-columns: repeat(3,1fr) !important; }
  .op-serves { grid-template-columns: 1fr 1fr !important; }
}
@page { size: letter; margin: 0.4in; }

/* ---------- Corporate vault lock screen ---------- */
.vault-lock { text-align: center; padding: 34px 20px; }
.vault-lock > i { font-size: 1.4rem; color: var(--gold); width: 52px; height: 52px; border-radius: 999px; background: var(--gold-dim); border: 1px solid var(--gold-line); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.vault-lock p { max-width: 52ch; margin-left: auto; margin-right: auto; }
.vault-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 8px; }
.vault-form input { width: 260px; max-width: 100%; font-family: var(--font); font-size: .9rem; color: var(--ink); background: var(--c900); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.vault-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- QuickBooks (Financial Dashboard) ---------- */
.qbo-link { display: block; transition: border-color .15s ease; }
.qbo-link:hover { border-color: var(--gold-line); }
.qbo-list { list-style: none; margin: 0 0 12px; padding: 0; }
.qbo-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: .88rem; color: var(--muted); }
.qbo-row span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.qbo-row.strong { color: var(--ink); font-weight: 600; border-bottom: none; }
#qbo-period { background: var(--c900); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: .82rem; }
.callout > div { min-width: 0; }
.qbo-email { overflow-wrap: anywhere; }

/* ---------- Shared: standalone badge, interactive cards ---------- */
.page-head-badge { display: inline-block; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-line); padding: 4px 10px; border-radius: 999px; }
.card.interactive { display: block; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.card.interactive:hover { transform: translateY(-2px); border-color: var(--gold-line); box-shadow: 0 10px 30px rgba(200,168,75,.06); }

/* ---------- Formatted client document (/documents/:id) — white printable sheet ---------- */
.doc-sheet { background: #fff; color: #1F2937; border-radius: var(--radius); overflow: hidden; max-width: 860px; margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.doc-cover { background: #1A1C22; color: #fff; text-align: center; padding: 40px 32px 32px; }
.doc-brand { font-size: .72rem; letter-spacing: .3em; color: #C8A84B; margin-bottom: 14px; font-weight: 700; }
.doc-cover h1 { color: #fff; font-size: 1.8rem; margin-bottom: 6px; }
.doc-subtitle { color: #C8A84B !important; margin: 0 0 18px; }
.doc-meta p { color: #9CA3AF !important; font-size: .84rem; margin: 2px 0; }
.doc-meta strong { color: #fff; }
.doc-body { padding: 28px 36px 10px; }
.doc-body p, .doc-text { color: #374151; font-size: .9rem; line-height: 1.6; }
.doc-h { color: #1A1C22 !important; font-size: 1.1rem; border-left: 4px solid #C8A84B; padding-left: 10px; margin: 18px 0 10px !important; }
.doc-h::before { display: none; }
.doc-sub { color: #1A1C22; font-size: .98rem; margin: 6px 0; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: 6px 0 10px; }
.doc-table th, .doc-table td { text-align: left; padding: 7px 10px; border: 1px solid #E5E7EB; color: #374151; vertical-align: top; white-space: pre-wrap; }
.doc-table thead th { background: #1A1C22; color: #fff; border-color: #1A1C22; }
.doc-table tbody th { background: #F9FAFB; color: #6B7280; font-weight: 600; }
.doc-hr { border: none; border-top: 1px solid #E5E7EB; margin: 16px 0; }
.doc-cta { border: 2px solid #C8A84B; background: #FFFBEB; border-radius: 10px; padding: 20px; text-align: center; margin: 8px 0; break-inside: avoid; }
.doc-cta h3 { color: #1A1C22; margin-bottom: 6px; }
.doc-cta a { display: inline-block; background: #C8A84B; color: #1A1C22; font-weight: 600; padding: 9px 20px; border-radius: 8px; font-size: .86rem; }
.doc-sign { display: flex; justify-content: space-between; gap: 30px; margin: 28px 0 10px; font-size: .78rem; color: #6B7280; break-inside: avoid; }
.doc-sign > div { flex: 1; max-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.doc-sign .line { border-top: 1px solid #9CA3AF; height: 36px; display: block; border-top-width: 0; border-bottom: 1px solid #9CA3AF; margin-bottom: 4px; }
.doc-foot { text-align: center; font-size: .72rem; color: #9CA3AF; padding: 14px 20px 18px; border-top: 1px solid #F3F4F6; }
@media (max-width: 620px) {
  .doc-body { padding: 20px 16px 6px; }
  .doc-cover { padding: 28px 16px 22px; }
  .doc-sign { flex-direction: column; }
}
@media print {
  body:has(.doc-sheet) { background: #fff; }
  body:has(.doc-sheet) .sidebar,
  body:has(.doc-sheet) .topbar,
  body:has(.doc-sheet) .page-head,
  body:has(.doc-sheet) .no-print,
  body:has(.doc-sheet) .toast { display: none !important; }
  body:has(.doc-sheet) .content { padding: 0; max-width: none; }
  .doc-sheet { box-shadow: none; border-radius: 0; max-width: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Builder preview is a white sheet: keep bold text dark (the app default is light ink). */
#builder-preview strong { color: inherit; }
#builder-preview thead strong, #builder-preview thead th { color: #fff; }

/* Client portal: file upload row */
.p-upload { margin-bottom: 14px; }
.p-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.p-upload-row select { max-width: 320px; min-width: 0; flex: 1 1 200px; }

/* Builder documents: totals, term list */
.doc-totals { margin: 4px 0 14px auto; max-width: 320px; font-size: .88rem; color: #374151; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 10px; }
.doc-totals .grand { border-top: 2px solid #1A1C22; font-weight: 700; color: #1A1C22; font-size: .98rem; padding-top: 7px; }
.doc-list { margin: 0 0 10px; padding-left: 20px; color: #374151; font-size: .86rem; line-height: 1.55; }
.doc-list li { margin-bottom: 6px; }
.doc-sheet strong { color: #1A1C22; }
.doc-cover strong { color: #fff; }
.doc-small { font-size: .8rem !important; color: #6B7280 !important; }
@media print {
  body:has(.doc-sheet) .portal-main { padding: 0; max-width: none; }
}

/* ---------- Electronic signatures ---------- */
.doc-sign .signed .sig-name { font-family: 'Dancing Script', 'Brush Script MT', cursive; font-size: 1.7rem; color: #1A1C22; line-height: 1.1; margin-bottom: -6px; }
.doc-sign .signed .line { height: 6px; }
.doc-record { margin-top: 18px; break-inside: avoid; }
.doc-record td div { margin: 1px 0; }
.sign-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sign-panel { max-width: 860px; margin: 22px auto 0; background: var(--c800); border: 1px solid var(--gold-line, rgba(200,168,75,.35)); border-radius: var(--radius, 12px); padding: 22px 24px; }
.sign-panel h3 { margin: 0 0 6px; }
.sign-panel h3 i { color: #10B981; }
.sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.sig-preview { font-family: 'Dancing Script', 'Brush Script MT', cursive; font-size: 2rem; min-height: 48px; border-bottom: 1px solid var(--line, #2F333D); margin: 2px 0 14px; padding: 0 4px; }
.sign-agree { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; margin-bottom: 14px; }
.sign-agree input { width: auto; min-height: 0; margin-top: 3px; }
@media (max-width: 620px) { .sign-row { grid-template-columns: 1fr; } }

/* ---------- Business Blueprint (Abacus layouts) ---------- */
.gold-text { color: var(--gold); }
.tone-gold { color: var(--gold); } .tone-green { color: #34D399; } .tone-blue { color: #60A5FA; }
.tone-purple { color: #A78BFA; } .tone-amber { color: #FBBF24; } .tone-gray { color: var(--muted); }
.bp-steps { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 8px; align-items: center; }
.bp-steps li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.bp-steps li + li::before { content: '→'; color: var(--muted-2); margin-right: 4px; }
.bp-step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #16181D; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.bp-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bp-chip { background: var(--c800); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; color: var(--muted); }
.bp-quote { margin: 0; padding: 18px 20px; border-left: 3px solid var(--gold); background: var(--gold-dim); border-radius: 0 var(--radius) var(--radius) 0; color: var(--gold-2); font-style: italic; font-weight: 500; }
.bp-line { padding: 0; overflow: hidden; }
.bp-line-head::before { display: none; }
.bp-line-head { margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--line-color, var(--gold)); font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.bp-line-grid { padding: 20px; gap: 12px; }
.bp-line-grid .card { padding: 14px; }
.bp-line-grid h3 { font-size: .92rem; margin-bottom: 4px; }
.line-blue { --line-color: #3B82F6; } .line-purple { --line-color: #8B5CF6; } .line-green { --line-color: #10B981; }
.bp-stack-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.bp-stack-row:last-child { border-bottom: none; }
.bp-stack-row p { margin: 2px 0 0; }
.bp-stack-cat { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-weight: 700; padding-top: 3px; }
.bp-stack-tools { font-weight: 600; color: var(--ink); }
.bp-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bp-q { background: var(--gold); color: #16181D; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

/* ---------- Executive dashboards (Abacus layouts) ---------- */
.dx-intro { margin-bottom: 18px; }
.dx-kpi { display: flex; flex-direction: column; gap: 2px; }
.dx-kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.dx-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--c600); }
.dx-icon.tone-gold { background: var(--gold-dim); } .dx-icon.tone-green { background: rgba(52,211,153,.12); }
.dx-icon.tone-blue { background: rgba(96,165,250,.12); } .dx-icon.tone-purple { background: rgba(167,139,250,.12); }
.dx-icon.tone-amber { background: rgba(251,191,36,.12); }
.dx-trend { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.dx-trend.up { color: #34D399; background: rgba(52,211,153,.12); } .dx-trend.down { color: #F87171; background: rgba(248,113,113,.12); }
.dx-kpi .label { font-size: .8rem; color: var(--muted); }
.dx-kpi .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.dx-kpi .sub { font-size: .75rem; color: var(--muted-2); }
.dx-manual { font-size: .7rem; color: var(--muted-2); }
.dx-manual button { background: none; border: 0; color: var(--gold-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.dx-split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dx-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.dx-head h3 i { color: var(--gold); }
.dx-head p { margin: 2px 0 0; font-size: .8rem; color: var(--muted-2); }
.dx-count { font-size: .75rem; color: var(--muted); background: var(--c800); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.dx-stage + .dx-stage { margin-top: 14px; }
.dx-stage-top { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 6px; }
.dx-stage-top .desc { color: var(--muted-2); }
.dx-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.dx-bar { height: 8px; background: var(--c900); border-radius: 999px; overflow: hidden; }
.dx-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.dx-gauge { position: relative; width: 150px; height: 150px; margin: 10px auto 14px; }
.dx-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dx-gauge-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dx-gauge-label strong { font-size: 1.6rem; }
.dx-gauge-label span { font-size: .72rem; color: var(--muted-2); }
.dx-gauge-foot { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 12px; }
.dx-gauge-foot strong { color: var(--ink); }
.dx-cols { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.dx-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: .75rem; color: var(--muted-2); }
.dx-col > div { width: 100%; max-width: 56px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.dx-col b { color: var(--ink); font-size: .8rem; }
.dx-rows a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.dx-rows a:last-child { border-bottom: none; }
.dx-rows a:hover .dx-name { color: var(--gold-2); }
.dx-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dx-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--gold-dim); color: var(--gold-2); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; }
.dx-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-meta { font-size: .75rem; color: var(--muted-2); }
.dx-status { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dx-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dx-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--c700); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-weight: 600; font-size: .88rem; }
.dx-link:hover { border-color: var(--gold-line); color: var(--gold-2); }
.dx-link > span { display: flex; align-items: center; gap: 10px; }
.dx-link > span i { color: var(--gold); width: 18px; text-align: center; }
.dx-link > i { color: var(--muted-2); font-size: .75rem; }
.dx-sops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dx-sop { display: flex; align-items: center; gap: 12px; background: var(--c800); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.dx-sop:hover { border-color: var(--gold-line); }
.dx-sop .dx-icon { width: 32px; height: 32px; font-size: .85rem; }
.dx-sop small { display: block; font-size: .68rem; color: var(--muted-2); font-weight: 600; letter-spacing: .04em; }
.dx-sop span { font-size: .85rem; font-weight: 600; }
.dx-fin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.dx-fin .card { padding: 14px; }
.dx-okr .dx-kr + .dx-kr { margin-top: 12px; }
.dx-kr-top { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; margin-bottom: 5px; }
.dx-kr-top span:first-child { color: var(--muted); }
.dx-kr-top > :last-child { white-space: nowrap; text-align: right; }
.dx-kr-top strong a, .dx-kr-top a { color: var(--gold-2); }
.dx-okr-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.dx-okr-title p { margin: 0; font-weight: 600; color: var(--ink); font-size: .92rem; line-height: 1.35; }
.dx-okr-title small { color: var(--gold-2); font-size: .75rem; }
.dx-quarter .pill { white-space: nowrap; }
.dx-quarter.active { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.dx-quarter .list li { font-size: .84rem; padding: 7px 0; }
.dx-quarter .list li i { margin-top: 5px; }
.dx-score { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.dx-score:last-child { border-bottom: none; }
.dx-score p { margin: 0; }
.dx-score .name { color: var(--ink); font-weight: 600; font-size: .86rem; }
.dx-score .tgt { font-size: .74rem; color: var(--muted-2); }
.dx-score .val { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.dx-note { font-size: .75rem; color: var(--muted-2); margin-top: 10px; }
@media (max-width: 900px) {
  .dx-split { grid-template-columns: 1fr; }
  .dx-sops, .bp-chips { grid-template-columns: repeat(2, 1fr); }
  .dx-fin { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 620px) {
  .dx-sops, .bp-chips, .dx-fin { grid-template-columns: 1fr; }
  .bp-stack-row { grid-template-columns: 1fr; gap: 4px; }
  .dx-cols { gap: 6px; }
}

/* ---------- Proposal revisions ---------- */
.change-panel summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.change-panel summary::-webkit-details-marker { display: none; }
.change-panel summary i { color: var(--gold); }
.change-panel[open] summary { margin-bottom: 12px; }
.change-panel textarea { width: 100%; }
.change-note, .vh-note { margin: 8px 0 10px; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--gold-dim); border-radius: 0 8px 8px 0; color: var(--ink); white-space: pre-wrap; font-size: .88rem; }
.doc-banner { border-color: var(--line); }
.doc-banner.warn { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.06); }
.doc-banner i { color: var(--gold); }
.version-history h3 i { color: var(--gold); margin-right: 4px; }
.vh-list { list-style: none; margin: 10px 0 0; padding: 0; }
.vh-list > li { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.vh-list > li:first-child { border-top: none; padding-top: 4px; }
.vh-list > li.current .vh-head strong { color: var(--gold-2); }
.vh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vh-events { list-style: none; margin: 6px 0 0; padding: 0 0 0 4px; }
.vh-events li { font-size: .82rem; color: var(--muted); padding: 3px 0; }
.vh-events li i { width: 16px; color: var(--muted-2); margin-right: 4px; }
@media print { .version-history, .doc-banner, .change-panel { display: none !important; } }

/* ---------- SOPs & playbooks (Abacus layouts) ---------- */
.sop-meta .label, .pb-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }
.sop-meta .val { color: var(--ink); font-weight: 500; font-size: .9rem; margin-top: 2px; }
.sop-role { font-weight: 600; color: var(--gold-2); margin-bottom: 4px; }
.sop-step { margin-bottom: 12px; }
.sop-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sop-num { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #16181D; font-weight: 700; font-size: .82rem; display: inline-flex; align-items: center; justify-content: center; }
.sop-items { margin: 0; padding-left: 18px; }
.sop-items li { font-size: .88rem; color: var(--muted); padding: 3px 0; }
.sop-items li::marker { color: var(--gold); }
.sop-items strong { color: var(--ink); }
.sop-items code, .pb-callout code { background: var(--c900); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: .8rem; color: var(--gold-2); }
.sop-checks { display: grid; gap: 2px; }
.sop-check-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: .88rem; color: var(--muted); }
.sop-check-row:hover { background: var(--c600); }
.sop-check-row input { width: auto; min-height: 0; margin-top: 3px; accent-color: var(--gold); }
.sop-check-row:has(input:checked) { background: var(--gold-dim); }
.sop-check-row:has(input:checked) span { text-decoration: line-through; color: var(--muted-2); }
.pb-callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--c700); font-size: .88rem; color: var(--muted); }
.pb-callout > i { margin-top: 3px; }
.pb-callout strong { color: var(--ink); }
.pb-callout a { color: var(--gold-2); text-decoration: underline; }
.pb-callout.info { border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.06); } .pb-callout.info > i { color: #60A5FA; }
.pb-callout.warn { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.06); } .pb-callout.warn > i { color: #FBBF24; }
.pb-callout.gold { border-color: var(--gold-line); background: var(--gold-dim); } .pb-callout.gold > i { color: var(--gold); }
.section > p a { color: var(--gold-2); text-decoration: underline; }
.pb-gap { gap: 12px; margin-bottom: 12px; }
.pb-kpi { font-size: 1.3rem; }
.pb-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.pb-card-head h3 { display: flex; align-items: center; gap: 8px; font-size: .98rem; }
.pb-card-head h3 i { color: var(--gold); }
.pb-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pb-bullets { list-style: none; margin: 4px 0 8px; padding: 0; }
.pb-bullets li { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--muted); padding: 3px 0; }
.pb-bullets li i { color: var(--gold); font-size: .75rem; margin-top: 5px; }
.pb-bullets strong { color: var(--ink); }
.pb-meta p { margin: 4px 0; }
.pb-foot { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 8px; }
.pb-point { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.pb-point > i { color: var(--gold); margin-top: 4px; }
.pb-point-title { font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pb-rows .pb-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.pb-rows .pb-row:last-child { border-bottom: none; }
.pb-row-title { font-weight: 600; color: var(--gold-2); font-size: .88rem; }
.pb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pb-steps > li { display: flex; gap: 12px; align-items: flex-start; }
.pb-steps > li > .card { flex: 1; padding: 14px 16px; }
.pb-strong { font-weight: 600; color: var(--ink); }
td.gold-text.pb-strong { color: var(--gold-2); white-space: nowrap; }
.pb-q { font-weight: 600; color: var(--ink); font-style: italic; margin-bottom: 6px; }
.pb-link-sub { display: block; font-weight: 400; color: var(--muted-2); font-size: .75rem; margin-top: 2px; }
@media (max-width: 620px) { .pb-rows .pb-row { grid-template-columns: 1fr; gap: 4px; } }
.card + .pb-callout, .list + .pb-callout { margin-top: 12px; }

/* ---------- Executive pages: Launch, Marketing, Social, Calendar, Revenue (Abacus layouts) ---------- */
.tone-pink { color: #F472B6; } .tone-sky { color: #38BDF8; }
.dx-icon.tone-pink { background: rgba(244,114,182,.12); } .dx-icon.tone-sky { background: rgba(56,189,248,.12); } .dx-icon.tone-gray { background: var(--c600); }
.ex-progress .ex-pct { font-size: 1.6rem; font-weight: 700; color: var(--gold); }
.ex-phase-title { font-size: 1.05rem; margin: 0 0 2px; }
.ex-phase .dx-icon { flex: 0 0 40px; }
.ex-tasks { display: grid; gap: 8px; margin-top: 14px; }
.ex-task { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: var(--c800); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; color: inherit; font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ex-task:hover { border-color: var(--gold-line); }
.ex-task .ex-check { font-size: 1.05rem; color: var(--muted-2); margin-top: 2px; }
.ex-task.done { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.3); }
.ex-task.done .ex-check { color: #34D399; }
.ex-task.done .ex-task-label { text-decoration: line-through; color: var(--muted); }
.ex-task-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-task-label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.ex-task-detail { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.ex-task-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .74rem; color: var(--muted-2); margin-top: 2px; }
.ex-divider { display: flex; align-items: center; gap: 12px; margin: 34px 0 10px; color: var(--gold); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ex-divider::before, .ex-divider::after { content: ''; flex: 1; height: 1px; background: var(--gold-line); }
.ex-rule-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ex-rule-head .dx-icon { flex: 0 0 40px; }
.ex-card-title { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; }
.ex-card-title i { margin-top: 3px; }
.ex-funnel { position: relative; }
.ex-funnel-num { position: absolute; top: 14px; right: 16px; font-size: 1.5rem; font-weight: 800; color: var(--c600); }
.ex-kpi-row { grid-template-columns: 1fr auto !important; align-items: center; font-size: .86rem; }
.ex-kpi-row strong { color: var(--gold-2); text-align: right; font-size: .82rem; }
.ex-best { display: flex; gap: 12px; align-items: flex-start; padding: 14px; }
.ex-best .dx-icon { flex: 0 0 40px; }
.cc-filter { border: 1px solid var(--line); background: var(--c700); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.cc-filter span { color: var(--muted-2); margin-left: 4px; }
.cc-filter.active { background: var(--gold); border-color: var(--gold); color: #16181D; }
.cc-filter.active span { color: rgba(22,24,29,.7); }
#cc-list { display: grid; gap: 10px; }
.cc-post { display: flex; gap: 14px; align-items: flex-start; }
.cc-post .dx-icon { flex: 0 0 40px; }
.cc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cc-body h3 { font-size: .98rem; }
.cc-copy { white-space: pre-wrap; margin: 0; }
.cc-link { word-break: break-all; }
.cc-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cc-slot { border: 1px solid var(--gold-line); background: var(--gold-dim); color: var(--gold-2); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .74rem; cursor: pointer; }
.ex-scen-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.ex-scen-btn:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.ex-scen-btn.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line); }
.ex-total-row td { font-weight: 700; color: var(--gold-2); border-top: 1px solid var(--gold-line); }
.ex-stack { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--c900); }
.ex-stack span { display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #16181D; }
.ex-seg-project { background: #60A5FA; } .ex-seg-recurring { background: var(--gold); } .ex-seg-hourly { background: #A78BFA; }
.ex-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ex-bottom { display: flex; gap: 14px; align-items: flex-start; border-color: var(--gold-line); background: var(--gold-dim); }
.ex-bottom > i { font-size: 1.2rem; margin-top: 3px; }
.ex-assumptions summary { cursor: pointer; font-weight: 600; color: var(--gold-2); }
@media (max-width: 620px) {
  .cc-post { flex-wrap: wrap; }
  .cc-actions { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
}

/* ---------- Finances hub & Financial Dashboard (Abacus layouts) ---------- */
.fin-banner { display: flex; gap: 16px; align-items: flex-start; border-color: var(--gold-line); background: var(--gold-dim); }
.fin-banner > i { font-size: 1.4rem; color: var(--gold); margin-top: 4px; }
.fin-banner.ok { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.06); }
.fin-banner.ok > i { color: #34D399; }
.fin-quick:hover { border-color: var(--gold-line); }
.fin-connect { text-align: center; padding: 40px 24px; max-width: 640px; margin: 0 auto 24px; }
.fin-connect .dx-icon { width: 56px; height: 56px; font-size: 1.4rem; margin-bottom: 12px; }
.fin-periods { display: inline-flex; gap: 4px; padding: 4px; background: var(--c800); border: 1px solid var(--line); border-radius: 10px; }
.fin-period { background: none; border: 0; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.fin-period:hover { color: var(--ink); }
.fin-period.active { background: var(--gold); color: #16181D; }
.fin-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: .88rem; color: var(--muted); }
.fin-line span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.fin-line.strong span { color: var(--ink); font-weight: 700; }
.fin-line.strong span:last-child { color: #34D399; }
.fin-line.neg span:last-child { color: #F87171; }
.card > .fin-line:last-of-type { margin-bottom: 10px; }

/* Project templates: SOP checklist phases */
.tpl-sop { padding: 10px 14px; }
.tpl-sop > summary { cursor: pointer; list-style: none; }
.tpl-sop > summary::-webkit-details-marker { display: none; }
.tpl-checklist { list-style: none; padding: 0; margin: 0 0 8px; columns: 2 280px; column-gap: 24px; }
.tpl-checklist li { padding: 4px 0; font-size: 0.875rem; break-inside: avoid; display: flex; gap: 8px; align-items: baseline; }
.tpl-checklist li i { color: var(--gold); flex: none; }

/* Standard Project Lifecycle (Abacus layout) */
.lc-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lc-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--c900); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px; font-size: .86rem; color: var(--ink); text-decoration: none; }
.lc-chip:hover { border-color: var(--gold-line); }
.lc-chip-n { color: var(--gold); font-weight: 800; font-size: .76rem; }
.lc-arrow { color: var(--muted-2); font-size: .75rem; }
.lc-stage { scroll-margin-top: 80px; }
.lc-num { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: var(--gold); color: #16181D; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.lc-goal { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2, var(--ink)); }
.lc-goal i { margin-top: 4px; }
.lc-label { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; display: flex; gap: 6px; align-items: center; }
.lc-acts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lc-acts li { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.lc-acts li i { font-size: .7rem; flex: none; }
.lc-crit { background: var(--c900); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.lc-crit-h { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.lc-sop { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--gold-2); background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: var(--radius-sm); padding: 6px 12px; text-decoration: none; }
.lc-sop:hover { border-color: var(--gold); }
.lc-list { display: grid; gap: 10px; }
.lc-item { background: var(--c800); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 8px; }
.lc-item .btn { flex: none; align-self: flex-start; white-space: nowrap; }
.lc-stage > .flex > .pill { align-self: flex-start; }
.lc-result { margin-top: 10px; color: var(--gold-2); background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: var(--radius-sm); padding: 8px 12px; }
#lc-dialog { max-width: 560px; width: calc(100% - 32px); }

/* Project tasks grouped by SOP phase */
.task-phases { display: grid; gap: 10px; }
.task-phase { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--c800); }
.task-phase > summary { cursor: pointer; position: relative; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 14px 12px 32px; list-style: none; }
.task-phase > summary::-webkit-details-marker { display: none; }
.task-phase > summary::before { content: '\25B8'; color: var(--gold); position: absolute; left: 14px; top: 12px; }
.task-phase[open] > summary::before { content: '\25BE'; }
.task-phase .tp-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-phase .tp-bar { grid-column: 1 / -1; height: 4px; background: var(--c900); border-radius: 4px; overflow: hidden; }
.task-phase .tp-bar span { display: block; height: 100%; background: var(--gold); }
.task-phase.complete .tp-bar span { background: #34D399; }
.task-phase > .list { padding: 0 14px 6px; margin: 0; border-top: 1px solid var(--line-soft); }
