:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec;
  --brand: #1f3a5f; --primary: #2563eb; --primary-ink: #fff;
  --st-received: #8a94a6; --st-awaiting: #d97706; --st-ready: #1e3a8a; --st-approved: #0d9488;
  --st-scheduled: #7c3aed; --st-paid: #16a34a;
  --hold: #dc2626; --late: #b91c1c; --warn-bg: #fef2f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 6px; } h2 { font-size: 15px; margin: 0 0 12px; } h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 52px; background: var(--brand); color: #fff; }
.topbar a, .topbar .link { color: #dfe7f3; }
.topbar .brand { color: #fff; font-weight: 700; font-size: 16px; line-height: 20px; }
.topbar nav { display: flex; align-items: center; gap: 18px; flex: 1; }
/* Every header item gets the same box; the underline is always there, just transparent until active, so text lines up. */
.topbar nav a, .topbar nav span, .topbar .menu summary { display: block; line-height: 20px; padding: 3px 0; border-bottom: 2px solid transparent; border-top: 2px solid transparent; }
.topbar nav a.active { color: #fff; border-bottom-color: #fff; }
.topbar nav .muted { color: #8ea3c0; }
.topbar .who { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.topbar form { margin: 0; }

.page { max-width: 1400px; margin: 0 auto; padding: 20px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.crumb { margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 7px; font: inherit; cursor: pointer; }
.btn:hover { border-color: #b8bfcc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; text-align: center; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }

.messages { margin-bottom: 14px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 6px; background: #eef4ff; border: 1px solid #c9d9fb; }
.msg.error { background: var(--warn-bg); border-color: #f5c2c2; color: var(--late); }
.msg.success { background: #ecfdf3; border-color: #b7ebc9; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi.warn { background: var(--warn-bg); border-color: #f5c2c2; } .kpi.warn strong { color: var(--late); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filters input[type=text], .filters select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; }
.filters input[type=text] { width: 220px; }
.check { display: flex; gap: 6px; align-items: center; }

.group { margin-bottom: 22px; }
.group h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.group .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.group .count { background: #e9ecf2; border-radius: 10px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.group .gtotal { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.st-received { --c: var(--st-received); } .st-awaiting_receipt_qc { --c: var(--st-awaiting); }
.st-ready_for_approval { --c: var(--st-ready); } .st-approved { --c: var(--st-approved); }
.st-scheduled { --c: var(--st-scheduled); } .st-paid { --c: var(--st-paid); }
.empty { color: var(--muted); margin: 0 0 0 18px; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; background: var(--card); }
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1240px; }
table.grid.small { min-width: 0; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow: hidden; text-overflow: ellipsis; }
.grid th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.grid th.num, .grid td.num { text-align: right; }
.grid tbody tr { cursor: pointer; } .grid tbody tr:hover { background: #f7f9fc; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-vendor { width: auto; } .c-inv { width: 120px; } .c-po { width: 64px; } .c-co { width: 130px; } .c-due { width: 116px; }
.grid td.due, .grid td.num { white-space: nowrap; }
.c-amt { width: 112px; } .c-method { width: 88px; } .c-owner { width: 120px; } .c-flags { width: 180px; }
.overdue { color: var(--late); font-weight: 600; }

.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; margin: 0 3px 3px 0; white-space: nowrap; }
.tag.hold { background: #fde2e2; color: var(--hold); } .tag.late { background: #fde2e2; color: var(--late); }
.tag.norec { background: #fff1d6; color: #92400e; } .tag.review { background: #e0e7ff; color: #3730a3; }
.tag.bank { background: #ede9fe; color: #5b21b6; } .tag.part { background: #dcfce7; color: #166534; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; color: #fff; background: var(--c); font-weight: 600; font-size: 12px; margin-right: 6px; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; } .kv dd.num { text-align: left; }
.step { margin: 0 0 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.step.row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.step input, .step select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.inline { display: inline; margin-left: 8px; }
.ok { color: var(--st-paid); font-weight: 600; }
.error { color: var(--late); }

.formgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.formgrid.compact { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; width: 100%; }
.field small { color: var(--muted); font-size: 11px; } .field.err input { border-color: var(--late); }
.actions { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.form .actions { margin-top: 18px; }

.history { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow-y: auto; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.history time { color: var(--muted); font-size: 12px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.history .note { color: var(--muted); margin-top: 2px; }

.login { max-width: 380px; margin: 80px auto; text-align: center; }
.login .dev { margin-top: 10px; }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .formgrid, .formgrid.compact { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .topbar { gap: 12px; padding: 0 16px; } .topbar .who { display: none; }
}

.docs { margin-bottom: 16px; } .docs p { margin: 0 0 8px; }
.grid tr.plain { cursor: default; } .grid tr.plain:hover { background: none; }
.grid.intake { min-width: 900px; } .grid.intake td { white-space: normal; }
.tag.out-created { background: #dcfce7; color: #166534; } .tag.out-duplicate { background: #e9ecf2; color: var(--muted); }
.tag.out-not_invoice { background: #e9ecf2; color: var(--muted); } .tag.out-no_pdf { background: #e9ecf2; color: var(--muted); }
.tag.out-failed { background: #fde2e2; color: var(--late); }
.ro { background: rgba(255,255,255,.15); border-radius: 8px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.access td select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.invite { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.invite .field { min-width: 180px; }
.invite-msg { background: #f7f9fc; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; }
.grid.access { min-width: 720px; } .grid.access td { vertical-align: middle; } .grid.access select { width: 100%; }
.people-cols { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.people-cols .field { margin-bottom: 12px; }
.boardlist { margin: 4px 0 14px; }
.boardrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.boardrow:last-child { border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid #c9cfda; border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg label span { display: block; padding: 5px 12px; font-size: 12px; color: var(--muted); border-left: 1px solid #e3e6ec; min-width: 50px; text-align: center; }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: #e0e9fd; color: #1d4ed8; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
.people { border-top: 1px solid var(--line); }
.person { border-bottom: 1px solid var(--line); }
.person summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 12px; align-items: center; padding: 11px 4px; cursor: pointer; }
.person summary::-webkit-details-marker { display: none; }
.person summary:hover { background: #f7f9fc; }
.person .who-cell { min-width: 0; } .person .nm, .person .who-cell .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .chips { display: block; margin-top: 5px; }
.person .when { color: var(--muted); font-size: 12px; text-align: right; }
.person .caret { font-style: normal; color: var(--muted); transition: transform .15s; }
.person[open] .caret { transform: rotate(90deg); }
.chip { display: inline-block; white-space: nowrap; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef1f6; color: #3b4456; margin: 2px 4px 2px 0; }
.chip.admin { background: #e0e9fd; color: #1d4ed8; }
.person-edit { padding: 2px 4px 14px; max-width: 420px; }
.small { font-size: 12px; margin-left: 10px; }
@media (max-width: 900px) { .people-cols { grid-template-columns: 1fr; } }
.ar-invoiced { --c: var(--st-ready); } .ar-in_process { --c: var(--st-scheduled); } .ar-paid { --c: var(--st-paid); }
.grid.ar { min-width: 1240px; } .c-cust { width: auto; }
.aging { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.age { padding: 10px 14px; border-left: 1px solid var(--line); } .age:first-child { border-left: 0; }
.age span { display: block; font-size: 12px; color: var(--muted); } .age strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.age.late strong { color: #9a3412; }
.small-kpi { font-size: 17px !important; }
.row-actions { display: flex; gap: 8px; align-items: center; } .row-actions form { margin: 0; }
.small-p { font-size: 12px; margin: 4px 0 0; }
.grid.custs { min-width: 560px; } .grid.custs td { vertical-align: middle; }
@media (max-width: 900px) { .aging { grid-template-columns: repeat(2, 1fr); } .age { border-left: 0; border-top: 1px solid var(--line); } }
.grid.custs .sub { display: block; } .step.row input[name=note] { flex: 1; min-width: 200px; }
.tag.unbilled { background: #fff1d6; color: #92400e; }
.so-card { margin-bottom: 16px; } .grid.so { min-width: 720px; } .grid.so .sub { display: block; }
.unbilled-cell { color: #92400e; font-weight: 600; }
.topbar nav { flex: 0 1 auto; }
.topbar .menu { position: relative; margin-right: auto; }
.topbar .menu summary { list-style: none; cursor: pointer; color: #dfe7f3; user-select: none; }
.topbar .menu summary::-webkit-details-marker { display: none; }
.topbar .menu summary .chev { display: inline-block; vertical-align: 0; margin-left: 5px; transition: transform .15s; }
.topbar .menu[open] summary .chev { transform: rotate(180deg); }
.topbar .menu.active summary { color: #fff; border-bottom-color: #fff; }
.topbar .menu-pop { position: absolute; top: calc(100% + 10px); left: 0; min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 6px; z-index: 20; }
.topbar .menu-pop a { display: block; color: var(--ink); padding: 8px 10px; border-radius: 6px; }
.topbar .menu-pop a:hover { background: #f1f4f9; }
.topbar .menu-pop a.current { background: #e0e9fd; color: #1d4ed8; font-weight: 600; }
.topbar .who { margin-left: 0; }
@media (max-width: 900px) { .topbar .menu-pop { left: auto; right: -40px; } }
@media (max-width: 600px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; }
  .topbar .brand { width: 100%; }
  .topbar nav { gap: 14px; }
  .topbar .menu { margin-right: 0; }
  .topbar .menu-pop { left: auto; right: 0; }
}

/* Receivables: Ready to invoice group */
.ar-ready { --c: var(--st-awaiting); }
.kpis.six { grid-template-columns: repeat(6, 1fr); }
.kpi em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tag.ok-tag { background: #dcfce7; color: #166534; }
.grid .sub-inline { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; }
@media (max-width: 900px) { .kpis.six { grid-template-columns: repeat(2, 1fr); } }
.grid.ship { min-width: 560px; } .grid.ship td.trk { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Executive dashboard ---------- */
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ex-pillar.wide { grid-column: 1 / -1; }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ex-head h2 { margin: 0; font-size: 17px; }
.ex-nums h3, .ex-update h3 { margin-top: 10px; }
.ex-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ex-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ex-kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 6px; }
.ex-kpis .kpi small { display: block; font-size: 12px; }
.ex-table { --c: var(--line); margin-bottom: 6px; }
.ex-table table { width: 100%; border-collapse: collapse; }
.ex-table th, .ex-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.ex-table th.num, .ex-table td.num { text-align: right; }
.ex-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.ex-table tr.tot td { border-bottom: 0; background: #f9fafb; }
.ex-link { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.ex-update { border-top: 1px solid var(--line); margin-top: 12px; }
.ex-update dl { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; }
.ex-update dt { color: var(--muted); font-size: 13px; }
.ex-update dd { margin: 0; }
.ex-nonums { margin: 4px 0 0; }
.ex-err { color: var(--late); }
.ex-foot { margin-top: 14px; }
.ex-small { font-size: 12.5px; }
@media (max-width: 900px) {
  .ex-grid, .ex-two { grid-template-columns: 1fr; }
  .ex-kpis { grid-template-columns: 1fr 1fr; }
  .ex-update dl { grid-template-columns: 1fr; }
}

/* ---------- My dashboard ---------- */
.my-layout { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
.my-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px; }
.my-side h2 { margin-bottom: 4px; }
.my-side h3 { margin: 16px 0 6px; }
.my-lib { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.my-lib li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.my-lib li div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.my-lib li.on { background: #f9fafb; }
.my-lib form { margin: 0; }
.my-lib .tag { margin: 0; }
.small-btn { padding: 4px 10px; font-size: 12.5px; }
.my-reset { margin-top: 14px; }
.my-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.my-tile { padding: 14px 16px; min-width: 0; }
.my-tile.size-small { grid-column: span 2; } .my-tile.size-medium { grid-column: span 3; } .my-tile.size-large { grid-column: 1 / -1; }
.my-tile.dragging { opacity: .45; outline: 2px dashed var(--primary); }
.my-th { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.my-th h2 { margin: 0; font-size: 15px; flex: 1; min-width: 120px; }
.my-handle { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px; user-select: none; }
.my-handle:hover { background: #eef1f6; color: var(--ink); }
.my-tools { display: flex; gap: 6px; align-items: center; }
.my-tools form { margin: 0; display: flex; gap: 4px; align-items: center; }
.my-tools select { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12.5px; background: #fff; }
.icon-btn { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--muted); font: inherit; line-height: 1; padding: 0; }
.icon-btn:hover:not([disabled]) { color: var(--ink); border-color: #b8bfcc; }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.my-body .kpis { margin-bottom: 6px; }
.my-tile.size-small .ex-kpis, .my-tile.size-medium .ex-kpis { grid-template-columns: 1fr 1fr; }
.ex-kpis-2 { grid-template-columns: 1fr 1fr !important; }
.ex-kpis-c { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) !important; }
.ex-pweek { margin: 0 0 8px; }
.ex-dl { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.ex-dl dt { color: var(--muted); font-size: 13px; } .ex-dl dd { margin: 0; }
.my-tile.size-small .ex-dl { grid-template-columns: 1fr; }
.ex-c { margin: 0 0 6px; }
.my-empty { grid-column: 1 / -1; }
@media (max-width: 1000px) {
  .my-layout { grid-template-columns: 1fr; }
  .my-side { position: static; max-height: none; }
  .my-tile.size-small, .my-tile.size-medium { grid-column: span 3; }
}
@media (max-width: 640px) { .my-tile.size-small, .my-tile.size-medium { grid-column: 1 / -1; } }
.topbar nav.ex-nav { margin-right: auto; }
/* Let wide tables scroll inside their card instead of stretching the page on phones. */
.ex-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ex-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ex-pillar, .ex-two > div { min-width: 0; }
.my-layout { grid-template-columns: 290px minmax(0, 1fr); }
@media (max-width: 1000px) { .my-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .ex-grid, .ex-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) { .my-side { order: 2; } .my-main { order: 1; } }

/* Executive tiles: headline number first, details one click away */
.ex-subtile { min-width: 0; }
.ex-tile-link { display: flex; flex-direction: column; gap: 8px; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; transition: border-color .12s; }
.ex-tile-link:hover { border-color: var(--primary); }
.ex-tile-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ex-hero { font-size: 28px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ex-kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 0; font-size: 13px; }
.ex-kv dt { color: var(--muted); } .ex-kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; }
.ex-bar { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.ex-bar span, .ex-bar small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-bar-track { width: 100%; height: 44px; display: flex; align-items: flex-end; background: #f1f3f7; border-radius: 4px; overflow: hidden; }
.ex-bar-fill { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 0; }
.ex-bars-lg .ex-bar-track { height: 120px; }
.ex-bars-lg { margin-bottom: 14px; max-width: 640px; }
.ex-more { font-size: 12.5px; color: var(--primary); font-weight: 600; }
.ex-tight { margin: 0; }
.ex-trio { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.ex-trio span { display: block; font-size: 12px; color: var(--muted); }
.ex-trio strong { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ex-trio strong.ex-hero { font-size: 28px; }
.ex-trio .late strong { color: var(--late); }
.ex-meter { display: flex; gap: 2px; height: 8px; }
.ex-meter div { background: var(--primary); border-radius: 4px; }
.ex-meter div.late { background: var(--late); }
.ex-crumbs { margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.ex-weeknav { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-gap { margin-top: 16px; }
.ex-gap h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 14px; }
.ex-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.ex-tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ex-tabs a span { background: #e9ecf2; border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }
.ex-tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.ex-table td.num, .ex-table th.num { white-space: nowrap; }
@media (max-width: 640px) { .pagehead { flex-wrap: wrap; } .ex-weeknav { width: 100%; } .ex-weeknav .btn { white-space: nowrap; } .ex-trio { gap: 16px; } }
.ex-fixed { table-layout: fixed; }
.ex-fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .ex-fixed { table-layout: auto; min-width: 560px; } }

/* Trend strips: 6 weeks on the tile, 52 weeks when expanded */
.ex-trend { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ex-trend-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.ex-key { font-weight: 400; color: var(--muted); margin-left: 6px; }
.ex-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--primary); margin: 0 3px 0 6px; vertical-align: -1px; }
.ex-key i.late { background: var(--late); } .ex-key i.sf { background: #d97706; }
.ex-tbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; height: 56px; gap: 6px; }
.ex-tbars.wide { height: 80px; gap: 2px; }
.ex-tbars.thin { height: 48px; }
.ex-tbar { height: 100%; display: flex; align-items: flex-end; background: #f1f3f7; border-radius: 3px; overflow: hidden; }
.ex-tbars.wide .ex-tbar { background: none; border-radius: 1px; }
.ex-tbar-fill { width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; display: flex; align-items: flex-end; min-height: 1px; }
.ex-tbar.partial .ex-tbar-fill { opacity: .45; }
.ex-tbar.missing .ex-tbar-fill { background: none; min-height: 0; }
.ex-tbar-part { width: 100%; background: var(--late); }
.ex-tbar-part.sf { background: #d97706; }
.ex-tlabels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ex-tlabels span { font-size: 11px; color: var(--muted); text-align: center; display: flex; flex-direction: column; min-width: 0; }
.ex-tlabels b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-tlabels em { font-style: normal; color: var(--late); }
.ex-more52 summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.ex-more52[open] summary { margin-bottom: 8px; }
.ex-more52 { display: flex; flex-direction: column; gap: 4px; }
.ex-tends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.ex-gap8 { margin-top: 8px; }
.ex-two .ex-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Lead time on the sales orders tile, and its 52-week line */
.ex-lead { margin-left: auto; text-align: right; }
.ex-lead p { margin: 0; display: flex; gap: 6px; align-items: baseline; justify-content: flex-end; font-size: 12.5px; }
.ex-lead em { font-style: normal; color: var(--muted); }
.ex-lead strong { font-size: 16px; }
.ex-lead small { font-size: 11px; }
.ex-line { display: grid; grid-template-columns: 26px 1fr; gap: 4px; height: 110px; }
.ex-line svg { width: 100%; height: 110px; overflow: visible; }
.ex-line-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--muted); text-align: right; padding: 0 0 2px; font-variant-numeric: tabular-nums; }
.ex-line polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ex-line-axis { stroke: var(--line); vector-effect: non-scaling-stroke; }
.ex-line .ex-hit { fill: transparent; }
.ex-line .ex-hit:hover { fill: var(--ink); opacity: .25; }
polyline.ex-l-vb { stroke: var(--primary); } polyline.ex-l-sf { stroke: #d97706; }
.ex-key i.ex-l-vb { background: var(--primary); } .ex-key i.ex-l-sf { background: #d97706; }
.ex-tends-line { padding-left: 30px; }
circle.ex-dot.ex-l-vb { fill: var(--primary); } circle.ex-dot.ex-l-sf { fill: #d97706; }

/* 52-week trends page */
.ex-big-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ex-big-head h2 { margin: 0; }
.ex-big .ex-kpis { margin-bottom: 14px; }
.ex-bigchart { display: grid; grid-template-columns: 64px 1fr; gap: 6px; height: 260px; margin-top: 8px; }
.ex-bigchart .ex-line-y { padding-bottom: 0; }
.ex-bigplot { position: relative; height: 100%; }
.ex-gridlines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.ex-gridlines i { display: block; border-top: 1px solid var(--line); }
.ex-tbars.big { position: relative; height: 100%; gap: 3px; }
.ex-tbars.big .ex-tbar { background: none; }
.ex-tbars.big .ex-tbar:hover .ex-tbar-fill { filter: brightness(1.15); }
.ex-xticks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; margin-left: 70px; margin-top: 4px; }
.ex-xticks span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: visible; }
.ex-xticks-line { margin-left: 70px; }
.ex-line-big { grid-template-columns: 64px 1fr; height: 260px; gap: 6px; margin-top: 8px; }
.ex-line-big svg { height: 260px; }
.ex-weektable td, .ex-weektable th { padding: 6px 10px; }
tr.ex-partial td { background: #f9fafb; }
@media (max-width: 640px) {
  .ex-bigchart, .ex-line-big { grid-template-columns: 40px 1fr; height: 200px; }
  .ex-line-big svg { height: 200px; }
  .ex-xticks, .ex-xticks-line { margin-left: 46px; }
  .ex-tbars.big { gap: 1px; }
  .ex-xticks span.t4 { visibility: hidden; }
  .ex-weektable { min-width: 760px; }
}
/* Axis labels sit on their gridline */
.ex-line-y { position: relative; display: block; }
.ex-line-y span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; }
.ex-line-y span:nth-child(1) { top: 0; } .ex-line-y span:nth-child(2) { top: 50%; } .ex-line-y span:nth-child(3) { top: 100%; }

/* My dashboard: ranked lists, KPI table, pipeline bars, POs, cash */
.ex-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ex-rank li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ex-rank li:last-child { border-bottom: 0; }
.ex-rank-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-rank-main small { display: block; overflow: hidden; text-overflow: ellipsis; }
.ex-rank b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-rank .tag { margin: 0 4px; }
.ex-keyvendor { background: #f5f8ff; }
.ex-rank li.ex-keyvendor { padding: 6px 8px; border-radius: 6px; border-bottom: 0; margin-bottom: 3px; }
.ex-kpitable td, .ex-kpitable th { padding: 6px 10px; }
tr.ex-muted-row td { color: var(--muted); }
.ex-delta { font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 8px; margin-left: 4px; }
.ex-delta.up { background: #dcfce7; color: #166534; } .ex-delta.down { background: #fde2e2; color: var(--late); }
.ex-key i.ly { background: #c7d2fe; }
.ex-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 200px; align-items: end; }
.ex-month { height: 100%; display: flex; flex-direction: column; gap: 4px; }
.ex-month-bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.ex-month-bars i { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 1px; }
.ex-month-bars i.ly { background: #c7d2fe; }
.ex-month span { font-size: 11px; color: var(--muted); text-align: center; }
.ex-hbars { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ex-hbar { display: grid; grid-template-columns: 180px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; }
.ex-hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-hbar-track { position: relative; height: 16px; background: #f1f3f7; border-radius: 4px; overflow: hidden; }
.ex-hbar-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.ex-hbar-track i.tot { background: #c7d2fe; } .ex-hbar-track i.w { background: var(--primary); }
.ex-hbar b { text-align: right; font-variant-numeric: tabular-nums; }
tr.ex-sub td { border-top: 0; padding-top: 0; }
.ex-vendor { padding: 0; margin-bottom: 10px; }
.ex-vendor summary { display: flex; gap: 12px; align-items: baseline; padding: 12px 16px; cursor: pointer; }
.ex-vendor summary strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.ex-vendor .tablewrap { margin: 0 12px 12px; }
details.ex-keyvendor { border-left: 4px solid var(--primary); }
.ex-netbars { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; height: 110px; }
.ex-netbar { display: grid; grid-template-rows: 1fr 1fr auto; height: 100%; }
.ex-netbar .up { display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.ex-netbar .down { display: flex; align-items: flex-start; }
.ex-netbar i { display: block; width: 100%; }
.ex-netbar .up i { background: #16a34a; border-radius: 3px 3px 0 0; } .ex-netbar .down i { background: var(--late); border-radius: 0 0 3px 3px; }
.ex-netbar span { font-size: 10.5px; color: var(--muted); text-align: center; }
.ex-cashform { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ex-cashform h2, .ex-cashform p { flex-basis: 100%; margin: 0; }
.ex-cashwrap { overflow-x: auto; }
.ex-cashtable { min-width: 1100px; }
.ex-cashtable td:first-child, .ex-cashtable th:first-child { position: sticky; left: 0; background: var(--card); min-width: 190px; }
.my-th h2 a { color: inherit; } .my-th h2 a:hover { color: var(--primary); }
@media (max-width: 640px) { .ex-hbar { grid-template-columns: 110px 1fr 80px; } .ex-months { gap: 3px; } }
.my-tools { flex-wrap: wrap; min-width: 0; } .my-tools form { flex-wrap: wrap; } .my-tools select { max-width: 100%; }
.ex-trio strong small { font-size: 12px; font-weight: 500; }
.ex-flow { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 150px; }
.ex-flow-m { display: flex; flex-direction: column; gap: 3px; height: 100%; }
.ex-flow-bars { flex: 1; display: flex; align-items: flex-end; gap: 1px; }
.ex-flow-bars i { flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.ex-flow-bars i.b { background: #93c5fd; } .ex-flow-bars i.s { background: var(--primary); } .ex-flow-bars i.v { background: #0d9488; }
.ex-flow-m.partial .ex-flow-bars { opacity: .5; }
.ex-flow-m span { font-size: 10.5px; color: var(--muted); text-align: center; }
.ex-key i.fb { background: #93c5fd; } .ex-key i.fs { background: var(--primary); } .ex-key i.fv { background: #0d9488; }
.ex-sharebar { display: block; height: 4px; background: #f1f3f7; border-radius: 2px; margin-top: 3px; }
.ex-sharebar i { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.ex-share li { align-items: center; }
.ex-share .ex-rank-main { flex: 1; } .ex-share .ex-sharebar { max-width: 260px; }

/* My dashboard: tile list as a drawer */
.my-side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.my-side-head h2 { margin: 0; }
.my-layout.drawer-closed { grid-template-columns: minmax(0, 1fr); }
.my-layout.drawer-closed .my-side { display: none; }
.my-main .pagehead { align-items: center; }
@media (max-width: 1000px) {
  .my-layout:not(.drawer-closed) .my-side { position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw); max-height: none; z-index: 40;
    border-radius: 0; overflow-y: auto; box-shadow: 4px 0 24px rgba(15, 23, 42, .2); order: 0; }
}
.ex-howbuilt { margin-bottom: 16px; padding: 12px 18px; }
.ex-howbuilt summary { cursor: pointer; font-weight: 600; }
.ex-howbuilt dl { margin: 10px 0 0; display: grid; grid-template-columns: 130px 1fr; gap: 4px 16px; font-size: 13.5px; }
.ex-howbuilt dt { font-weight: 600; grid-column: 1; }
.ex-howbuilt dd { margin: 0; grid-column: 2; color: var(--ink); }
.ex-howbuilt dt + dd { grid-row: auto; }
@media (max-width: 640px) { .ex-howbuilt dl { grid-template-columns: 1fr; } .ex-howbuilt dt, .ex-howbuilt dd { grid-column: 1; } .ex-howbuilt dt { margin-top: 6px; } }
.ex-cashrows { flex-basis: 100%; display: grid; grid-template-columns: 1fr 140px 2fr; gap: 6px; }
.ex-cashrows input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; min-width: 0; }
.ex-cashrows input[inputmode=decimal] { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .ex-cashrows { grid-template-columns: 1fr 110px; } .ex-cashrows input[name^=note] { grid-column: 1 / -1; } }
[id] { scroll-margin-top: 12px; } .ex-flow { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.boardsub { padding-left: 16px; } .boardsub input { width: 18px; height: 18px; }

/* Weekly: one 52-week link spanning both Ops tiles */
.ex-52band { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: inherit; transition: border-color .12s; }
.ex-52band:hover { border-color: var(--primary); }
.ex-52band:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ex-52title { font-size: 14px; font-weight: 650; color: var(--primary); }
.ex-52notes { margin-top: 8px; }

/* Weekly Ops pair: both tile boxes the same height so the 6-week strips line up */
.ex-subtile { display: flex; flex-direction: column; gap: 10px; }
.ex-subtile > .ex-tile-link { flex: 1; }
.ex-tile-link > .ex-more { margin-top: auto; }
.ex-herorow { display: flex; align-items: flex-start; gap: 12px; }
.ex-herorow .ex-lead span { display: block; font-size: 12px; color: var(--muted); }
.ex-hero-unit { font-size: 15px; font-weight: 500; color: var(--muted); }
.ex-kv dd.late { color: var(--late); }
.ex-split { display: flex; flex-direction: column; gap: 3px; }
.ex-split-track { display: flex; gap: 2px; height: 44px; border-radius: 4px; overflow: hidden; }
.ex-split-track div { background: var(--primary); }
.ex-split-track div.late { background: var(--late); }
.ex-split-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.ex-herorow .ex-lead p { flex-wrap: nowrap; white-space: nowrap; gap: 6px; }
.ex-herorow .ex-lead { flex-shrink: 0; }
.ex-herorow .ex-lead i { font-style: normal; color: var(--muted); }
.ex-herorow .ex-hero { white-space: nowrap; }
@media (max-width: 640px) {
  .ex-herorow { flex-wrap: wrap; gap: 6px; }
  .ex-herorow .ex-lead { margin-left: 0; text-align: left; width: 100%; }
  .ex-herorow .ex-lead p { justify-content: flex-start; }
}

/* Pillar owners' weekly posts, shown exactly as written in their status doc. */
.ex-post { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; margin: 8px 0 0; }
.ex-post.compact { max-height: 220px; overflow-y: auto; }

/* Sign-in by emailed code */
.login-alt { margin: 14px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.login .field { margin-bottom: 12px; }
.code-sender-h { margin-top: 22px; }
