/* NetPeak Apps — command center. Palette follows netpeaksolutions.com. */
:root {
  --navy: #2B3862; --navy-deep: #1e2a4a; --navy-ink: #141d33;
  --coral: #E27D60; --coral-deep: #d06a4e; --teal: #49778D; --teal-soft: #7aa5bd;
  --bg: #f7f8f8; --panel: #ffffff; --line: #e6e8ec; --ink: #1c2230; --muted: #6b7280;
  --ok: #2e7d32; --warn: #b7791f; --bad: #b3261e; --hot-bg: #fff6ee; --over-bg: #fdecea; --draft-bg: #fffbea;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 13px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
code, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* layout: fixed sidebar on desktop, top bar + drawer below 900px */
body { min-height: 100vh; }
.topbar { display: none; }
.side { background: var(--navy-ink); color: #cfd6e6; padding: 18px 14px; display: flex; flex-direction: column; gap: 22px; position: fixed; top: 0; left: 0; bottom: 0; width: 220px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; padding: 2px 4px; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand__app { color: var(--coral); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 6px; }
.brand--big { justify-content: center; }
.brand--big img { height: 48px; }
.brand--big .brand__app { font-size: 15px; padding-top: 10px; }
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__nav a { color: #b9c2d6; padding: 9px 10px; border-radius: 6px; font-weight: 500; }
.side__nav a:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: #fff; }
.side__nav a.active { background: var(--navy); color: #fff; }
.side__who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.side__who .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid rgba(255,255,255,0.25); }
.side__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.linkish { background: none; border: 0; color: var(--teal-soft); cursor: pointer; font: inherit; padding: 0; }
/* The page never scrolls sideways; anything wide scrolls inside its own card. */
body { overflow-x: hidden; }
.main { margin-left: 220px; padding: 22px 28px 60px; min-width: 0; min-height: 100vh; }
.main.is-loading { pointer-events: none; }
.scrim { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
/* Grid items default to min-content width, which lets a wide table push the whole page sideways. */
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .grid--2 { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 45; background: var(--navy-ink); padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar__toggle { width: 40px; height: 40px; border: 0; background: transparent; display: grid; gap: 5px; place-content: center; cursor: pointer; }
  .topbar__toggle span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
  .brand--top img { height: 28px; }
  .side { transform: translateX(-100%); transition: transform 0.2s ease; width: min(280px, 85vw); padding-top: max(18px, env(safe-area-inset-top)); }
  .side > .brand { display: none; }
  body.nav-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(20,29,51,0.5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; padding: 14px 12px 40px; }
  h1 { font-size: 19px; }
  .page-head { gap: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat__value { font-size: 22px; }
  .card { padding: 12px 12px; border-radius: 8px; }
  .entry-form label, .sheet__form label { flex: 1 1 100%; }
  .filters label { flex: 1 1 45%; }
  .exports .btn { padding: 6px 10px; font-size: 12px; }
  .sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .sheet__body { max-height: 100dvh; padding: 14px 14px 40px; }
  .sheet__stats { grid-template-columns: repeat(2, 1fr); }
  .period__label { min-width: 0; }
  .grid--chart { grid-template-columns: 1fr; }
  .tabs a { padding: 5px 9px; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .btn { padding: 8px 10px; }
  .actions .btn { padding: 4px 6px; }
}

/* tables scroll inside their card, never the page */
/* Tables lay out to their column on desktop; the floor below only applies on phones, where the card scrolls instead of the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
@media (max-width: 900px) { .table-scroll > .table { min-width: 640px; } }
.table--compact { min-width: 0 !important; }
.table--kv { min-width: 0 !important; }

/* skeleton while the next page loads */
.skeleton { display: flex; flex-direction: column; gap: 16px; }
.skeleton__head { display: flex; justify-content: space-between; align-items: center; }
.skeleton__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skeleton__card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, #eceef2 25%, #f5f6f8 37%, #eceef2 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; }
.sk--title { width: 180px; height: 26px; }
.sk--pill { width: 220px; height: 34px; border-radius: 8px; }
.sk--stat { height: 84px; border-radius: 10px; }
.sk--line { height: 14px; width: 100%; }
.sk--line.w60 { width: 60%; } .sk--line.w80 { width: 80%; } .sk--line.w40 { width: 40%; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (max-width: 900px) { .skeleton__stats { grid-template-columns: repeat(2, 1fr); } }

/* cards + stats */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat--warn { border-left-color: var(--coral); }
.stat--hot { border-left-color: var(--warn); }
.stat--ok { border-left-color: var(--ok); }
.stat__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat__value { font-size: 28px; font-weight: 600; line-height: 1.1; color: var(--navy-deep); }
.stat__value small { font-size: 14px; color: var(--muted); margin-left: 2px; }

/* period nav */
.period { display: flex; align-items: center; gap: 10px; }
.period__label { display: flex; flex-direction: column; align-items: center; min-width: 250px; line-height: 1.2; } /* wide enough for any period text, so the arrows never drift */
.period__label .muted { font-size: 11px; }
.tabs { display: flex; gap: 4px; background: #eceef2; padding: 3px; border-radius: 8px; }
.tabs a { padding: 5px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.tabs a.active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.tabs a:hover { text-decoration: none; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.table th.num, .table td.num { text-align: right; }
.table tr:last-child td { border-bottom: 0; }
/* zebra + hover: navy tints from the palette. Filterable tables restripe via .zebra; the rest use nth-child. */
/* Painted on the row, not the cells: the clamped description cell is a
   -webkit-box, so a cell-level tint would leave a white gap under it. */
.table:not(.table--filter) tbody tr:nth-child(even) { background: #f5f7fa; }
.table--filter tbody tr.zebra { background: #f5f7fa; }
.table tbody tr:hover { background: #e9eef7; }
.table tbody tr:hover td { background: transparent !important; }
.table tbody tr.row--history, .table tbody tr.row--history:hover { background: transparent; }
.table tfoot th { border-top: 2px solid var(--line); padding-top: 8px; font-size: 12px; text-transform: none; color: var(--ink); }
.table tfoot th.num { font-family: var(--mono); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--navy); }
th.sortable[data-dir="asc"]::before { content: '▲ '; font-size: 8px; }
th.sortable[data-dir="desc"]::before { content: '▼ '; font-size: 8px; }
.th-filter { background: none; border: 0; padding: 0 2px; margin-left: 4px; color: #b3b9c6; cursor: pointer; vertical-align: -1px; line-height: 1; }
.th-filter:hover { color: var(--navy); }
th.filtered .th-filter { color: var(--coral); }
.picker { position: fixed; z-index: 30; width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(20,29,51,0.18); padding: 8px; font-size: 13px; }
.picker__search { width: 100%; padding: 6px 8px; margin-bottom: 6px; }
.picker__tools { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.picker__tools button { background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.picker__tools .picker__count { margin-left: auto; }
.picker__list { max-height: 260px; overflow-y: auto; border-top: 1px solid var(--line); }
.picker__item { display: flex; align-items: center; gap: 8px; padding: 4px 4px; cursor: pointer; border-radius: 4px; }
.picker__item:hover { background: #f1f4f9; }
.picker__item span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__item input { margin: 0; }
/* searchable dropdown */
.combo { position: relative; display: block; }
.combo__native { display: none; }
.combo__input { width: 100%; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #98a0b0 50%), linear-gradient(135deg, #98a0b0 50%, transparent 50%); background-position: right 13px center, right 8px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.combo--open .combo__input { cursor: text; border-color: var(--teal); }
/* The list is free to grow past the field so names are never cut. */
.combo__list { position: absolute; z-index: 25; top: calc(100% + 3px); left: 0; min-width: 100%; width: max-content; max-width: min(420px, 70vw); max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(20,29,51,0.18); padding: 4px; }
.combo__item { padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; line-height: 1.3; }
.combo__item:hover, .combo__item.active { background: #f1f4f9; }
.combo__item.selected .combo__name { font-weight: 650; color: var(--navy); }
.combo__name { overflow-wrap: anywhere; }
/* A subclient is marked with the same roll-up glyph the filters use, and
   names its parent underneath, indented to line up with the name. */
.combo__name--child::before { content: '└ '; color: #b3b9c6; font-family: var(--mono); }
.combo__parent { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; padding-left: 15px; }
.combo__empty { padding: 8px; color: var(--muted); font-size: 12px; }

.table-reset { margin-left: 4px; text-transform: none; letter-spacing: 0; font-weight: 600; padding: 2px 10px; }
.picker--date { width: 230px; }
.picker__field { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.picker__field input { flex: 1; }
.picker--date .picker__tools { border-top: 1px solid var(--line); padding-top: 6px; margin: 0; }
.table .desc { max-width: 520px; }
/* Ledger descriptions are 2–4 sentences; clamp to two lines, click to expand. */
.table--ledger .desc { cursor: pointer; }
.table--ledger .desc .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.table--ledger .desc.open .clamp { -webkit-line-clamp: unset; display: block; }
.table--kv th { width: 40%; text-transform: none; font-size: 13px; color: var(--ink); }
tr.row--hot, tr.row--hot.zebra { background: var(--hot-bg); }
tr.row--over, tr.row--over.zebra { background: var(--over-bg); }
tr.row--draft, tr.row--draft.zebra { background: var(--draft-bg); }
.table--breakdown .row--child, .table--breakdown .row--child.zebra { background: #fafbfc; }
.row--nonbill td { color: var(--muted); }
.actions { white-space: nowrap; text-align: right; }
.editable { cursor: text; border-bottom: 1px dashed transparent; }
.editable:hover { background: #f3f4f6; }
.bar { height: 6px; background: #eceef2; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--teal); }
.row--hot .bar span { background: var(--coral); }
.row--over .bar span { background: var(--bad); }

/* pills + sources */
.pill { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: #eceef2; color: #4b5563; font-weight: 600; letter-spacing: 0.03em; vertical-align: middle; white-space: nowrap; }
.pill--ok { background: #e6f4ea; color: var(--ok); }
.pill--no { background: #f1e7e4; color: var(--coral-deep); }
.pill--toggle { border: 0; font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; cursor: pointer; }
.pill--toggle:hover { filter: brightness(0.94); }
.pill--warn { background: #fff3cd; color: var(--warn); }
.pill--nps { background: #e3ebf0; color: var(--teal); }
.pill--ndc { background: #e6e9f3; color: var(--navy); }
.pill--imi { background: #f6e6df; color: var(--coral-deep); }
.src { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.src--claude { color: var(--coral-deep); }
.src--calendar { color: var(--teal); }

/* forms */
.entry-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.entry-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.entry-form label.grow { flex: 1 1 260px; }
.entry-form label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
input, select { font: inherit; padding: 7px 9px; border: 1px solid #d5d9e0; border-radius: 6px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: 2px solid rgba(73,119,141,0.35); border-color: var(--teal); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline label { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.select--inline { padding: 3px 6px; font-size: 12px; }
.btn { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 7px; border: 1px solid transparent; cursor: pointer; background: #eceef2; color: var(--ink); }
.btn:hover { filter: brightness(0.97); text-decoration: none; }
.btn--primary { background: var(--coral); color: #fff; }
.btn--primary:hover { background: var(--coral-deep); }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.btn--ghost { background: transparent; border-color: #d5d9e0; }
.btn--small { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.code { background: var(--navy-ink); color: #e6e9f3; padding: 14px 16px; border-radius: 8px; font: 12.5px/1.55 var(--mono); overflow-x: auto; }
.token-reveal { background: #e6f4ea; border: 1px solid #bfe3c8; padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.form__error { color: var(--bad); margin: 8px 0 0; }

/* client detail card */
.sheet { border: 0; border-radius: 12px; padding: 0; width: min(860px, 92vw); max-height: 88vh; box-shadow: 0 30px 80px rgba(20,29,51,0.35); }
.sheet::backdrop { background: rgba(20,29,51,0.45); }
.sheet__body { padding: 20px 24px 24px; overflow-y: auto; max-height: 88vh; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.sheet__title { font-size: 20px; margin: 6px 0 2px; font-weight: 650; letter-spacing: -0.01em; }
.sheet__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.sheet__stats div { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.sheet__stats strong { font: 600 16px var(--mono); color: var(--navy-deep); }
.sheet__form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sheet__form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sheet__form label.grow { flex: 1 1 220px; }
.sheet__form label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.sheet__row { display: flex; gap: 14px; flex: 1 1 100%; flex-wrap: wrap; }
.sheet__row label.grow { flex: 1 1 220px; }
.sheet__form textarea { font: inherit; padding: 7px 9px; border: 1px solid #d5d9e0; border-radius: 6px; resize: vertical; }
.sheet__form label.grow:has(textarea) { flex: 1 1 100%; }
.sheet__contact { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sheet__section { padding-top: 16px; }
.sheet__section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); margin: 0 0 8px; }
.sheet__inline { display: flex; gap: 12px; align-items: flex-end; margin-top: 10px; }
.sheet__inline label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sheet__details { margin-top: 14px; }
.sheet__details summary { cursor: pointer; font-size: 12px; color: var(--teal); }
.row--current td { background: #f2f9f4; }
.linkish--name { color: inherit; font: inherit; font-weight: inherit; text-align: left; padding: 0; }
.linkish--name:hover { color: var(--teal); text-decoration: underline; }
@media (max-width: 700px) { .sheet__stats { grid-template-columns: repeat(2, 1fr); } }

/* clients table */
.table--clients .row--top td { border-top: 2px solid var(--line); }
.table--clients .row--top:first-child td { border-top: 0; }
.table--clients .strong { font-weight: 650; }
.table--clients .indent { padding-left: 28px; }
/* Glyph + chip as a flex row so a long name wraps beside the glyph, never under it. */
.tree { display: flex; align-items: flex-start; gap: 5px; }
.tree::before { content: '└'; color: #c3c8d2; flex: none; }
.tree > .chip { text-align: left; align-items: flex-start; }
.tree > .chip > .chip__logo { margin-top: 2px; }
.row--inactive td { color: var(--muted); }
.row--history td { border-bottom: 1px solid var(--line); padding-top: 0; }
.row--history .hist { display: inline-block; margin-right: 14px; white-space: nowrap; }
.row--history .indent-history { padding-left: 28px; }
.row--inactive .strong, .row--inactive .indent { text-decoration: line-through; text-decoration-color: #c3c8d2; }

/* login */
.login-body .main { margin-left: 0; }
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy-ink), var(--navy) 60%, var(--teal)); }
.login__card { background: #fff; padding: 32px; border-radius: 14px; width: 360px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login__card .brand { color: var(--navy); }
.login__card form { display: flex; flex-direction: column; gap: 12px; }
.login__card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }

/* project health */
.pill--health-on-track { background: #e6f4ea; color: var(--ok); }
.pill--health-at-risk { background: #fff3cd; color: var(--warn); }
.pill--health-over { background: #fdecea; color: var(--bad); }
.pill--health-done { background: #eceef2; color: var(--muted); }
.pill--health-no-loe { background: #f3f4f6; color: var(--muted); }
.pill--status-active { background: #e6e9f3; color: var(--navy); }
.pill--status-done { background: #e6f4ea; color: var(--ok); }
.pill--status-archived { background: #eceef2; color: var(--muted); }
.sheet__burn { margin-bottom: 16px; }
.sheet__burn .bar { height: 8px; }
.bar--marked { position: relative; }
.bar--marked::after { content: ''; position: absolute; top: -3px; bottom: -3px; left: var(--mark); width: 2px; background: var(--navy-ink); opacity: 0.6; }
.bulk { display: flex; gap: 8px; align-items: center; }
.table--detailed td.num { white-space: nowrap; }

/* reports */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.filters .spacer { flex: 1; }
.grid--chart { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid--chart { grid-template-columns: 1fr; } }
.chart svg text { font: 11px var(--sans); fill: var(--muted); }
.chart svg text.value { font: 11px var(--mono); fill: var(--ink); }
.chart svg text.donut-total { font: 600 18px var(--mono); fill: var(--navy-deep); }
.chart svg rect, .chart svg path { transition: opacity 0.1s; cursor: default; }
.chart svg rect:hover, .chart svg path:hover { opacity: 0.85; }
.chart--donut { display: flex; justify-content: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--ink); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__item i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.table--compact td { padding: 4px 6px; font-size: 12px; }
.table--breakdown .indent { padding-left: 22px; color: #3b4351; }
.bar--thin { height: 4px; }
.disclose { background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--muted); transition: transform 0.15s; padding: 0 4px; }
.disclose.open { transform: rotate(90deg); }
.tip { position: fixed; z-index: 20; background: var(--navy-ink); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.tip .muted { color: #b9c2d6; }

/* toast */
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--navy-ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); max-width: 420px; z-index: 10; }
.toast--bad { background: var(--bad); }

/* entity chip: logo + code, colored per entity */
.pill--entity { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--c) 13%, white); color: var(--c); padding-left: 5px; }
.pill--entity img { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; background: #fff; }
.pill--entity img.pill__logo--dark { background: #141d33; }
.entity-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid rgba(0,0,0,0.1); }

/* dashboard trends */
.banner { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.banner--record { background: linear-gradient(90deg, #e6f4ea, #f2f9f4); border: 1px solid #bfe3c8; color: #1d4d27; }
.stats--trend .stat__value.good { color: var(--ok); }
.stats--trend .stat__value.bad { color: var(--bad); }
.spark { width: 100%; height: 34px; display: block; margin: 4px 0 2px; }
.spark rect { fill: #c9d3e8; }
.spark rect.spark__now { fill: var(--coral); }
.spark rect.spark__best { fill: var(--ok); }

/* integrations */
.integ__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.integ__head h2 { margin-bottom: 2px; }
.integ__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 12px; }
.integ__stats div { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.integ__stats strong { font: 600 15px var(--mono); color: var(--navy-deep); }
.integ__actions { flex-wrap: wrap; margin-top: 6px; }
.btn--danger { background: #fdecea; color: var(--bad); border-color: #f5c6c2; }
.btn--danger:hover { background: #f9d9d5; }
.code--log { max-height: 260px; overflow: auto; white-space: pre-wrap; margin-top: 10px; font-size: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 36px; height: 20px; border-radius: 999px; background: #cfd4dd; position: relative; transition: background 0.15s; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:disabled + .switch__track { opacity: 0.5; }
.plan__head { display: flex; gap: 10px; align-items: baseline; margin: 12px 0 8px; }
.plan__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan__grid h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy); margin: 0 0 6px; }
.plan { list-style: none; padding: 0; margin: 0; font-size: 12.5px; max-height: 220px; overflow: auto; }
.plan li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.stats--inline { margin-bottom: 12px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); margin: 14px 0 8px; }
@media (max-width: 900px) { .integ__stats, .plan__grid { grid-template-columns: 1fr 1fr; } }

/* client chip: logo + name, links to the client's card */
.chip { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); vertical-align: middle; }
.chip__logo { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.chip--small { font-size: 12px; color: var(--muted); }
.chip--small .chip__logo { width: 16px; height: 16px; }
.linkish.chip { text-align: left; }
.sheet__logo { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); vertical-align: -5px; margin-right: 8px; }
.sheet__brandmark { display: block; max-height: 56px; max-width: 240px; width: auto; height: auto; object-fit: contain; margin-bottom: 8px; }
/* A mark drawn for dark backgrounds gets the same navy tile as its favicon. */
.sheet__brandmark--dark { background: #141d33; border-radius: 8px; padding: 6px; }
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.brand-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.brand-box h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy); }
.brand-box__preview { min-height: 44px; display: flex; align-items: center; gap: 10px; }
.brand-box__preview .chip__logo { width: 16px; height: 16px; }
.chip__logo--dark { background: #141d33; border-color: #141d33; }
.brand-box .check { font-size: 12px; }
.brand-box__preview .sheet__brandmark { margin: 0; }
.brand-box .inline { flex-wrap: wrap; }
@media (max-width: 700px) { .brand-grid { grid-template-columns: 1fr; } }

/* Sign in with Microsoft */
.btn--block { display: flex; width: 100%; justify-content: center; }
.btn--ms { gap: 10px; align-items: center; }
