/* ==========================================================================
   Osawaye Strategic Hub — application shell
   Executive-dashboard clarity: dark navigation, warm-neutral work surfaces.
   Tokens mirror packages/brand/tokens.json. Zero build, no CDN, no framework.
   ========================================================================== */

:root {
  /* surfaces */
  --nav:        #111214;
  --nav-2:      #191a1d;
  --nav-line:   #26272b;
  --nav-text:   #C6C3BC;
  --nav-dim:    #83807A;
  --surface:    #FAF8F3;
  --card:       #FFFFFF;
  --border:     #E4DED2;
  --border-2:   #F0EBE0;
  --text:       #1B1B1D;
  --muted:      #6B675F;

  /* brand */
  --champagne:      #C9A96A;
  --champagne-deep: #A8894E;
  --ink:            #141416;
  --forest:         #1F3A2E;
  --burgundy:       #5A1F24;

  /* status — never used as the only signal; every status also carries a
     glyph and a word (see .pill) */
  --ok:      #1F6F4A;
  --ok-bg:   #E8F2EC;
  --warn:    #9A6B00;
  --warn-bg: #FBF1DC;
  --danger:  #9B2C2C;
  --danger-bg:#FAEAEA;
  --info:    #2C4F9B;
  --info-bg: #E9EEF9;
  --neutral-bg: #F1EEE7;

  --radius:   10px;
  --radius-s: 6px;
  --shadow:   0 1px 2px rgba(20,20,22,.05), 0 4px 14px rgba(20,20,22,.05);
  --shadow-lg:0 12px 40px rgba(20,20,22,.16);
  --nav-w:    268px;
  --ease:     cubic-bezier(.2,.7,.2,1);

  --display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 2px solid var(--champagne-deep);
  outline-offset: 2px;
  border-radius: 3px;
}

.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;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-s); transition: top .18s var(--ease);
}
.skip-link:focus { top: 8px; }

/* ==========================================================================
   Layout
   ========================================================================== */

.layout { display: flex; min-height: 100vh; }

/* --- left navigation ----------------------------------------------------- */

.nav {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  background: var(--nav);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid #000;
}

.nav-identity {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--nav-line);
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.nav-identity:hover .nav-identity-name { color: #fff; }

.mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2a2b30, #17181b);
  border: 1px solid #34353a;
  color: var(--champagne);
  font-family: var(--display);
  font-size: 21px; font-weight: 700; line-height: 1;
  padding-bottom: 2px;
}

.nav-identity-name {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--nav-text);
  letter-spacing: .1px; transition: color .15s var(--ease);
}
.nav-identity-sub {
  display: block; font-size: 10.5px; color: var(--nav-dim);
  text-transform: uppercase; letter-spacing: .09em; margin-top: 2px;
}

.nav-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 4px; }
.nav-scroll::-webkit-scrollbar { width: 8px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #303136; border-radius: 4px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }

.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: .13em;
  color: #6B6862; padding: 6px 10px 7px; font-weight: 600;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--nav-text); text-decoration: none;
  font-size: 13px; position: relative;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.nav-item:hover { background: var(--nav-2); color: #fff; }
.nav-item.is-active { background: #232428; color: #fff; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--champagne);
}
.nav-item.is-denied { opacity: .38; cursor: not-allowed; }
.nav-item.is-denied:hover { background: transparent; color: var(--nav-text); }

.nav-ico {
  width: 18px; flex: 0 0 18px; text-align: center;
  font-size: 13px; color: var(--nav-dim);
}
.nav-item.is-active .nav-ico { color: var(--champagne); }
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; }

.nav-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 5px; border-radius: 3px;
  background: #2a2b30; color: #8E8A83; flex: 0 0 auto;
}
.nav-count {
  min-width: 19px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--champagne); color: #1a1509;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  flex: 0 0 auto;
}

.nav-foot {
  flex: 0 0 auto; border-top: 1px solid var(--nav-line);
  padding: 12px 14px 14px;
}

.nav-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: #2a2b30; border: 1px solid #3a3b40;
  color: var(--champagne); font-size: 11.5px; font-weight: 700;
}
.nav-user-meta { min-width: 0; flex: 1 1 auto; }
.nav-user-name {
  display: block; font-size: 12.5px; color: #E8E5DF; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-user-role {
  display: block; font-size: 10.5px; color: var(--nav-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-signout {
  background: none; border: 1px solid #35363b; color: var(--nav-dim);
  border-radius: 6px; width: 28px; height: 28px; cursor: pointer;
  font-size: 13px; display: grid; place-items: center; flex: 0 0 28px;
}
.nav-signout:hover { color: #fff; border-color: #4a4b50; }

/* --- main column --------------------------------------------------------- */

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,248,243,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 26px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.hamburger {
  display: none; width: 36px; height: 34px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; font-size: 15px; color: var(--text);
  align-items: center; justify-content: center; flex: 0 0 auto;
}

.search { flex: 1 1 260px; min-width: 0; max-width: 460px; position: relative; }
.search input {
  width: 100%; height: 34px; padding: 0 12px 0 32px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); font: inherit; font-size: 13px; color: var(--text);
}
.search input::placeholder { color: #9A968E; }
.search-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px; pointer-events: none;
}

.topbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* environment control */
.envctl { display: flex; border: 1px solid var(--border); border-radius: 8px;
          overflow: hidden; background: var(--card); }
.envctl button {
  border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 6px 11px; cursor: pointer; color: var(--muted); position: relative;
  display: flex; align-items: center; gap: 5px;
}
.envctl button[aria-pressed="true"] { background: var(--warn-bg); color: var(--warn); }
.envctl button[disabled] { cursor: not-allowed; color: #A9A49B; }
.envctl button[disabled]:hover { background: var(--neutral-bg); }

.iconbtn {
  position: relative; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); cursor: pointer;
  display: grid; place-items: center; font-size: 14px; color: var(--text);
}
.iconbtn:hover { border-color: #D2CAB9; }
.iconbtn[aria-expanded="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.iconbtn .dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.iconbtn .dot.is-champagne { background: var(--champagne-deep); }

.approval-chip {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--card);
  text-decoration: none; font-size: 12px; color: var(--text); white-space: nowrap;
}
.approval-chip:hover { border-color: var(--champagne); }
.approval-chip .n {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--champagne); color: #1a1509; font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
}
.approval-chip .n.is-zero { background: var(--neutral-bg); color: var(--muted); }

/* --- breadcrumbs + page head --------------------------------------------- */

.crumbs {
  padding: 12px 26px 0; font-size: 11.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .sep { color: #C3BDB1; }
.crumbs .current { color: var(--text); font-weight: 500; }

.page { padding: 14px 26px 40px; flex: 1 1 auto; }

.page-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 {
  font-family: var(--display); font-size: 30px; font-weight: 600;
  letter-spacing: -.2px; line-height: 1.15;
}
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 68ch; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap;
                     align-items: center; }

/* --- demo banner --------------------------------------------------------- */

.demo-banner {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--warn-bg); border: 1px solid #E8D9B4;
  color: #6E4C00; border-radius: var(--radius);
  padding: 9px 13px; font-size: 12.5px; margin-bottom: 16px;
}
.demo-banner strong { font-weight: 700; }

/* ==========================================================================
   Cards, grids, primitives
   ========================================================================== */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .card-note { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px 16px; }
.card-foot {
  padding: 11px 16px; border-top: 1px solid var(--border-2);
  background: #FCFBF8; border-radius: 0 0 var(--radius) var(--radius);
  font-size: 12px; color: var(--muted);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-tight { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.spacer { margin-left: auto; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.serif { font-family: var(--display); }
.strong { font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }

/* --- stat tiles ---------------------------------------------------------- */

.stat { padding: 14px 16px; }
.stat .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 600;
}
.stat .value {
  font-family: var(--display); font-size: 32px; font-weight: 600;
  line-height: 1.1; margin-top: 5px; letter-spacing: -.5px;
}
.stat .value.sm { font-size: 24px; }
.stat .foot { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.btn:hover { border-color: #CFC7B5; background: #FCFBF8; }
.btn-primary {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.btn-primary:hover { background: #2a2b30; border-color: #2a2b30; }
.btn-gold {
  background: var(--champagne); border-color: var(--champagne-deep); color: #1a1509;
  font-weight: 600;
}
.btn-gold:hover { background: var(--champagne-deep); color: #fff; }
.btn-danger { color: var(--danger); border-color: #E3C8C8; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-ok { color: var(--ok); border-color: #BFDDCD; }
.btn-ok:hover { background: var(--ok-bg); border-color: var(--ok); }
.btn-sm { height: 27px; padding: 0 10px; font-size: 11.5px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn[disabled], .btn.is-disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none;
}
.btn-block { width: 100%; }

/* --- pills / status ------------------------------------------------------
   Status is never colour alone: every pill carries a glyph and its own word. */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  background: var(--neutral-bg); color: var(--muted);
  border: 1px solid transparent; white-space: nowrap;
}
.pill .glyph { font-size: 10px; line-height: 1; }
.pill-ok     { background: var(--ok-bg);     color: var(--ok);     border-color: #C6E0D2; }
.pill-warn   { background: var(--warn-bg);   color: var(--warn);   border-color: #EADCB8; }
.pill-danger { background: var(--danger-bg); color: var(--danger); border-color: #E7CBCB; }
.pill-info   { background: var(--info-bg);   color: var(--info);   border-color: #CBD6EE; }
.pill-gold   { background: #F7EFDC; color: #7A5F22; border-color: #E7D6AE; }
.pill-ghost  { background: transparent; border-color: var(--border); color: var(--muted); }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: var(--neutral-bg); color: var(--muted);
  font-size: 10.5px; font-weight: 500;
}

/* --- progress ------------------------------------------------------------ */

.bar {
  height: 6px; border-radius: 3px; background: var(--border-2); overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--champagne);
           border-radius: 3px; transition: width .5s var(--ease); }
.bar.is-ok > i     { background: var(--ok); }
.bar.is-warn > i   { background: var(--warn); }
.bar.is-danger > i { background: var(--danger); }
.bar-lg { height: 9px; border-radius: 5px; }

.ring { display: block; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--border-2); }
.ring .fill  { stroke: var(--champagne); transition: stroke-dashoffset .7s var(--ease); }
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-label {
  position: absolute; text-align: center; line-height: 1.1;
}
.ring-label .n {
  font-family: var(--display); font-size: 30px; font-weight: 600; display: block;
}
.ring-label .u { font-size: 10px; color: var(--muted); text-transform: uppercase;
                 letter-spacing: .1em; }

/* --- tables -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th {
  text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); font-weight: 600;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: #FCFBF8;
}
table.t td {
  padding: 11px 12px; border-bottom: 1px solid var(--border-2);
  vertical-align: top;
}
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: #FCFBF7; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t a { color: var(--text); font-weight: 500; }
table.t a:hover { color: var(--champagne-deep); }

/* --- lists --------------------------------------------------------------- */

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  padding: 11px 16px; border-bottom: 1px solid var(--border-2);
  display: flex; gap: 11px; align-items: flex-start;
}
.list > li:last-child { border-bottom: 0; }
.list-title { font-weight: 600; font-size: 13px; }
.list-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 16px;
      font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; }

/* --- prose --------------------------------------------------------------- */

.prose { font-size: 13.5px; line-height: 1.65; max-width: 76ch; }
.prose p + p { margin-top: 9px; }

.quote {
  border-left: 3px solid var(--champagne); padding: 3px 0 3px 14px;
  font-family: var(--display); font-size: 17px; line-height: 1.45;
  color: #2b2b2e;
}

.evidence {
  background: #FCFBF8; border: 1px solid var(--border-2);
  border-radius: var(--radius-s); padding: 12px 14px;
  font-size: 13px; line-height: 1.6;
}
.evidence.locked { border-left: 3px solid var(--ink); }

/* --- empty / error states ------------------------------------------------ */

.empty {
  text-align: center; padding: 34px 20px; color: var(--muted);
}
.empty .ico { font-size: 26px; opacity: .45; margin-bottom: 8px; }
.empty h4 { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 46ch; margin: 0 auto; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--radius); padding: 11px 14px; font-size: 12.5px;
  border: 1px solid var(--border); background: var(--card);
}
.notice .ico { flex: 0 0 auto; font-size: 13px; line-height: 1.35; }
.notice-warn   { background: var(--warn-bg);   border-color: #E8D9B4; color: #6E4C00; }
.notice-danger { background: var(--danger-bg); border-color: #E7CBCB; color: #7C2020; }
.notice-info   { background: var(--info-bg);   border-color: #CBD6EE; color: #24407D; }
.notice-ok     { background: var(--ok-bg);     border-color: #C6E0D2; color: #175539; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: block; margin-bottom: 12px; }
.field > label, .label {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--text);
  margin-bottom: 5px;
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 13px; color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 11px;
}
select { height: 34px; padding: 0 30px 0 10px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B675F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--champagne-deep); outline: none;
  box-shadow: 0 0 0 3px rgba(201,169,106,.16);
}
input[disabled], select[disabled], textarea[disabled] {
  background: #F4F1EA; color: #938F87; cursor: not-allowed;
}

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px;
         cursor: pointer; }
.check input { width: auto; margin-top: 2px; accent-color: var(--champagne-deep); }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
}
.filters .field { margin-bottom: 0; min-width: 150px; }
.filters .field.grow { flex: 1 1 190px; }

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  border: 0; background: none; font: inherit; font-size: 13px; cursor: pointer;
  padding: 9px 14px; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  font-weight: 500;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.is-active, .tabs button.is-active {
  color: var(--text); border-bottom-color: var(--champagne); font-weight: 600;
}

/* ==========================================================================
   Drawers (notifications, AI recommendations)
   ========================================================================== */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(20,20,22,.34); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease);
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(410px, 92vw);
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 95;
  transform: translateX(103%); transition: transform .26s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer-head {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.drawer-head h2 { font-size: 15px; }
.drawer-close {
  margin-left: auto; border: 1px solid var(--border); background: var(--card);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font-size: 14px; color: var(--muted); display: grid; place-items: center;
}
.drawer-close:hover { color: var(--text); }
.drawer-body { overflow-y: auto; flex: 1 1 auto; }

.note-item {
  padding: 13px 18px; border-bottom: 1px solid var(--border-2);
  display: flex; gap: 11px; align-items: flex-start;
}
.note-item.is-unread { background: #FEFCF6; }
.note-item .ico { flex: 0 0 auto; font-size: 13px; margin-top: 1px; }
.note-item .t { font-weight: 600; font-size: 13px; }
.note-item .b { color: var(--muted); font-size: 12px; margin-top: 2px; }
.note-item .a { margin-top: 6px; display: flex; gap: 8px; align-items: center; }

/* ==========================================================================
   Charts (inline SVG)
   ========================================================================== */

.spark { display: block; overflow: visible; }
.spark path { fill: none; stroke: var(--champagne-deep); stroke-width: 1.6; }
.spark .area { fill: rgba(201,169,106,.14); stroke: none; }

.gantt-row { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 12px;
             align-items: center; padding: 5px 0; }
.gantt-track { position: relative; height: 24px; background: #F6F3EC;
               border-radius: 5px; overflow: hidden; }
.gantt-bar {
  position: absolute; top: 3px; bottom: 3px; border-radius: 4px;
  background: var(--champagne); display: flex; align-items: center;
  padding: 0 7px; font-size: 10.5px; color: #1a1509; font-weight: 600;
  overflow: hidden; white-space: nowrap; min-width: 3px;
}
.gantt-bar.is-progress { background: linear-gradient(90deg, var(--champagne-deep) var(--p), var(--champagne) var(--p)); }
.gantt-bar.is-blocked { background: #DFA9A9; }
.gantt-bar.is-delivered { background: #A9CFBB; }
.gantt-axis { display: grid; font-size: 10px; color: var(--muted);
              border-top: 1px solid var(--border-2); padding-top: 4px; }

.funnel-row { display: grid; grid-template-columns: 150px minmax(0,1fr) 46px;
              gap: 10px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.funnel-track { height: 20px; background: #F6F3EC; border-radius: 4px; overflow: hidden; }
.funnel-fill { height: 100%; background: var(--champagne); border-radius: 4px;
               min-width: 2px; transition: width .5s var(--ease); }

/* ==========================================================================
   Login
   ========================================================================== */

.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
}
.login-aside {
  background: var(--nav); color: #D8D4CC; padding: 46px 44px;
  display: flex; flex-direction: column; gap: 22px;
}
.login-aside .mark { width: 44px; height: 44px; flex: 0 0 44px; font-size: 25px; }
.login-north {
  font-family: var(--display); font-size: 40px; line-height: 1.12; color: #fff;
  font-weight: 600; letter-spacing: -.4px; margin-top: auto;
}
.login-aside p { color: #93908A; font-size: 13px; max-width: 42ch; }
.login-pillars { display: flex; gap: 7px; flex-wrap: wrap; }
.login-pillars span {
  border: 1px solid #33343a; border-radius: 20px; padding: 3px 11px;
  font-size: 11px; color: #A5A199;
}
.login-main {
  display: flex; align-items: center; justify-content: center; padding: 40px 26px;
}
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-family: var(--display); font-size: 27px; margin-bottom: 4px; }
.login-security {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--ink);
  border-radius: var(--radius-s); padding: 11px 13px; font-size: 11.5px;
  color: var(--muted); margin: 16px 0;
}
.login-security strong { color: var(--text); display: block; margin-bottom: 3px;
                         font-size: 12px; }
.login-switcher {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-top: 18px;
}
.login-foot { margin-top: 22px; font-size: 10.5px; color: #96928A; line-height: 1.7; }

/* ==========================================================================
   Interview screen
   ========================================================================== */

.interview { max-width: 780px; margin: 0 auto; }
.interview-q {
  font-family: var(--display); font-size: 31px; line-height: 1.24;
  font-weight: 600; letter-spacing: -.3px;
}
.interview-why {
  background: #FCFBF8; border-left: 3px solid var(--champagne);
  padding: 12px 15px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 13px; color: #4a4740; margin-top: 14px;
}
.interview-meta {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px;
  color: var(--muted); margin-top: 12px;
}

.mode-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.mode-tabs button {
  border: 1px solid var(--border); background: var(--card); border-radius: 7px;
  padding: 7px 13px; font: inherit; font-size: 12.5px; cursor: pointer;
  color: var(--muted); display: inline-flex; gap: 6px; align-items: center;
}
.mode-tabs button.is-active {
  border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600;
}

.recorder {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; background: #FCFBF8;
}
.recorder video, .recorder audio { width: 100%; max-width: 460px; border-radius: 8px;
                                   margin: 10px auto 0; display: block; background: #000; }
.rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); margin-right: 7px;
}
.rec-dot.is-live { animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .28; } }

/* ==========================================================================
   Interpretation panels
   ========================================================================== */

.panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.panel-head {
  padding: 10px 14px; background: #FCFBF8; border-bottom: 1px solid var(--border-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center;
}
.panel-body { padding: 14px; font-size: 13px; line-height: 1.6; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
               gap: 8px; }

/* ==========================================================================
   Vision board specifics
   ========================================================================== */

.tree-pillar {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden; margin-bottom: 14px;
}
.tree-pillar-head {
  padding: 13px 16px; background: var(--ink); color: #fff;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.tree-pillar-head h3 { font-family: var(--display); font-size: 19px; color: var(--champagne); }
.tree-obj { padding: 14px 16px; border-bottom: 1px solid var(--border-2); }
.tree-obj:last-child { border-bottom: 0; }
.tree-inits { display: grid; gap: 8px; margin-top: 10px;
              grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.init-chip {
  display: block; text-decoration: none; border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 10px 12px; background: #FCFBF8;
}
.init-chip:hover { border-color: var(--champagne); background: #fff; }
.init-chip .n { font-weight: 600; font-size: 12.5px; }

.horizon-col {
  border-left: 2px solid var(--border); padding-left: 14px; padding-bottom: 4px;
  position: relative;
}
.horizon-col::before {
  content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--champagne); border: 2px solid var(--surface);
}

/* ==========================================================================
   Planned module pages
   ========================================================================== */

.planned-hero {
  background: linear-gradient(150deg, #17181b, #101113); color: #D8D4CC;
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 18px;
}
.planned-hero h2 { font-family: var(--display); font-size: 27px; color: #fff; }
.planned-hero p { color: #A5A199; font-size: 13.5px; max-width: 74ch; margin-top: 8px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.product-foot {
  border-top: 1px solid var(--border); padding: 14px 26px 20px;
  font-size: 11px; color: #8B877F; display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; background: #F6F3EC;
}
.product-foot .sep { color: #C3BDB1; }

/* ==========================================================================
   CRM embed
   ========================================================================== */

.crm-embed {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; min-height: 420px;
}
.crm-embed .page { padding: 16px; }

/* ==========================================================================
   Responsive — tablet and mobile
   ========================================================================== */

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .nav {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    transform: translateX(-102%); transition: transform .24s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .nav.is-open { transform: none; }
  .hamburger { display: inline-flex; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page, .topbar, .crumbs, .product-foot { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 720px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 24px; }
  .interview-q { font-size: 24px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-aside { display: none; }
  .topbar { padding-top: 8px; padding-bottom: 8px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 9px; }
  .gantt-row { grid-template-columns: minmax(0, 1fr); }
  .funnel-row { grid-template-columns: 110px minmax(0,1fr) 34px; }

  /* Tables become cards. Each cell carries its own label via data-label. */
  table.t.responsive thead { display: none; }
  table.t.responsive, table.t.responsive tbody, table.t.responsive tr,
  table.t.responsive td { display: block; width: 100%; }
  table.t.responsive tr {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 10px; padding: 4px 0; background: var(--card);
  }
  table.t.responsive tr:hover { background: var(--card); }
  table.t.responsive td {
    border-bottom: 1px solid var(--border-2); padding: 8px 13px;
    display: grid; grid-template-columns: 40% minmax(0, 60%); gap: 10px;
    align-items: baseline; text-align: left;
  }
  table.t.responsive td:last-child { border-bottom: 0; }
  table.t.responsive td::before {
    content: attr(data-label);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); font-weight: 600;
  }
  table.t.responsive td.num { text-align: left; }
}

@media print {
  .nav, .topbar, .drawer, .drawer-backdrop, .page-head-actions { display: none; }
  .layout { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}

/* Joe Osawaye face mark (glasses + beard) — sourced from joeosawaye.com. */
.mark.joe-mark{background:#C9A96A;-webkit-mask:url('/static/img/joe-mark-white.png') center/78% no-repeat;mask:url('/static/img/joe-mark-white.png') center/78% no-repeat;border-radius:0;color:transparent;font-size:0}
.login-mark.joe-mark{display:block;width:72px;height:72px;margin:0 auto 12px;background:#C9A96A;-webkit-mask:url('/static/img/joe-mark-white.png') center/contain no-repeat;mask:url('/static/img/joe-mark-white.png') center/contain no-repeat}

/* ---- approval history timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--champagne, #C9A96A); border: 2px solid #fff; }
.timeline li:last-child { padding-bottom: 2px; }
.tl-when { margin-bottom: 2px; }
.list-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; flex: 0 0 auto; }

/* ---- AI agents drawer ---- */
.agent-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.agent-row:last-child { border-bottom: 0; }
.agent-row .n { flex: 1 1 auto; min-width: 0; }
.envctl button[aria-pressed="true"][value="Live"] { background: var(--ok-bg); color: #175539; }
.envctl button[disabled][aria-pressed="true"] { color: inherit; }
.iconbtn .dot.is-muted { background: #A9A49B; min-width: 10px; height: 10px; padding: 0; font-size: 0; top: -3px; right: -3px; }

/* ==========================================================================
   CRM embed — utility classes the CRM page modules rely on (light-theme
   equivalents of static/app.css, scoped to the embed so nothing leaks).
   ========================================================================== */
.crm-embed .flex { display: flex; align-items: center; gap: 9px; }
.crm-embed .flex-col { display: flex; flex-direction: column; gap: 9px; }
.crm-embed .spacer { flex: 1; }
.crm-embed .right { text-align: right; }
.crm-embed .dim { color: var(--muted); }
.crm-embed .gold { color: var(--champagne-deep); }
.crm-embed .tnum { font-variant-numeric: tabular-nums; }
.crm-embed .grid { display: grid; gap: 14px; }
.crm-embed .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.crm-embed .flex-col > .flex { padding: 8px 0; border-bottom: 1px solid var(--border); }
.crm-embed .flex-col > .flex:last-child { border-bottom: 0; }
.crm-embed .chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--neutral-bg); font-size: 11.5px; line-height: 1.7;
}
.crm-embed .chip.gold { background: var(--warn-bg); border-color: #E6D6AE; color: var(--champagne-deep); }
.crm-embed .chip.clickable { cursor: pointer; }
.crm-embed .chip.clickable:hover { border-color: var(--champagne-deep); }
.crm-embed .chip .x { margin-left: 2px; opacity: .5; cursor: pointer; }
.crm-embed .chip .x:hover { opacity: 1; color: var(--danger); }
.crm-embed .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-embed .tag-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.crm-embed .status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.crm-embed .status-dot.ok { background: #2E7D5B; }
.crm-embed .status-dot.warn { background: #B7791F; }
.crm-embed .status-dot.error { background: var(--danger); }
.crm-embed .delta { font-size: 11.5px; }
.crm-embed .delta.up { color: #2E7D5B; }
.crm-embed .delta.down { color: var(--danger); }
.crm-embed .callout {
  padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); border: 1px solid #E6D6AE;
  font-size: 12.5px; margin-bottom: 12px;
}
.crm-embed .callout strong { color: var(--champagne-deep); }
.crm-embed .window-banner { padding: 8px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 10px; }
.crm-embed .window-banner.ok { background: var(--ok-bg); border: 1px solid #C6E0D2; color: #175539; }
.crm-embed .window-banner.closed { background: var(--danger-bg); border: 1px solid #E7CBCB; color: #7C2020; }
.crm-embed .switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.crm-embed .switch input { display: none; }
.crm-embed .switch .track {
  width: 34px; height: 18px; border-radius: 999px; background: #D8D2C4; position: relative; transition: background .15s;
}
.crm-embed .switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.crm-embed .switch input:checked + .track { background: var(--champagne-deep); }
.crm-embed .switch input:checked + .track::after { transform: translateX(16px); }
.crm-embed .switch span.lbl { font-size: 13px; color: var(--muted); }
.crm-embed .drawer-section { margin-bottom: 20px; }
.crm-embed .drawer-section h4 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.crm-embed .who { font-weight: 600; font-size: 13px; }
.crm-embed .when { font-size: 11.5px; color: var(--muted); }
.crm-embed .sortable { cursor: pointer; user-select: none; }
.crm-embed .sortable:hover { color: var(--champagne-deep); }
.crm-embed .spinner {
  width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--champagne-deep);
  border-radius: 50%; animation: crm-spin .8s linear infinite; display: inline-block;
}
.crm-embed .skeleton { background: linear-gradient(90deg, var(--neutral-bg), #EFEBE2, var(--neutral-bg)); background-size: 200% 100%; animation: crm-shimmer 1.2s infinite; border-radius: 6px; min-height: 14px; }
@keyframes crm-spin { to { transform: rotate(360deg); } }
@keyframes crm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .crm-embed .spinner, .crm-embed .skeleton { animation: none; } }
