/* AIBOS spreadsheet showcase. Black and gold, light ledger. */
:root {
  --black: #0e0e0e;
  --black-2: #1a1a1a;
  --charcoal: #303030;
  --accent: #c9a227;
  --accent-light: #ddb947;
  --heading: #ffffff;
  --ink: #f2f0ea;
  --muted: #bdbab2;
  --bg: #141414;
  --bg-alt: #1b1b1b;
  --card: #232323;
  --line: #383838;
  --paper: #f7f6f2;
  --paper-2: #fbfaf6;
  --grid: #e3dfd4;
  --gutter: #eceae4;
  --ink-sheet: #1c1b19;
  --muted-sheet: #5c574e;
  --roww: 2.5rem;
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 40% at 100% -10%, rgba(201, 162, 39, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 30% at -10% 20%, rgba(201, 162, 39, 0.06), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; color: var(--heading); margin: 0; }
p { margin: 0; }
button, a { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--accent-light); }
a:hover { color: #fff; }
::selection { background: var(--accent); color: var(--black); }
:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -999px; top: 0.5rem; z-index: 80;
  background: var(--accent); color: var(--black);
  padding: 0.5rem 0.9rem; border-radius: 8px; font-weight: 750; text-decoration: none;
}
.skip:focus { left: 0.5rem; }

.wrap { width: min(1240px, calc(100% - 1.5rem)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { display: block; height: 52px; width: auto; }
.header-marks { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

.view-only {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent); color: var(--black);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.38rem 0.7rem; border-radius: 999px;
  margin: 0; white-space: nowrap;
}
.lock { display: block; }

.chip-static {
  border: 1px solid rgba(201, 162, 39, 0.5);
  color: var(--accent-light);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-bar {
  margin: 0;
  background: #0e0e0e;
  color: #e7e3da;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
  text-align: center;
  font-size: 0.92rem;
  padding: 0.55rem 1rem;
}
.demo-bar strong { color: var(--accent-light); font-weight: 750; }

.intro { padding: 1.6rem 0 1rem; }
.eyebrow {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 750;
  margin-bottom: 0.55rem;
}
.intro h1 {
  font-size: clamp(2rem, 4.5vw, 3.35rem);
  letter-spacing: -0.03em;
  font-weight: 650;
  max-width: 16ch;
  margin-bottom: 0.45rem;
}
.pitch { color: var(--accent-light); font-size: 1.15rem; font-weight: 650; margin-bottom: 0.45rem; }
.lead { color: #ddd9d0; max-width: 42rem; font-size: 1.05rem; }

.switcher {
  display: flex; gap: 0.55rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.2rem 0 0.9rem;
  scrollbar-color: var(--accent) transparent;
}
.switcher button {
  scroll-snap-align: start;
  flex: 0 0 auto;
  min-width: 9.5rem;
  text-align: left;
  background: #1b1b1b;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem 0.6rem;
  min-height: 64px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}
.switcher button:hover { border-color: rgba(201, 162, 39, 0.7); }
.switcher button.is-active {
  border-color: var(--accent);
  background: #241f12;
  box-shadow: inset 0 0 0 1px var(--accent), 0 8px 18px rgba(0, 0, 0, 0.22);
}
.sw-name { display: block; font-weight: 750; font-size: 0.98rem; }
.sw-file { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 0.18rem; }
.switcher button.is-active .sw-file { color: var(--accent-light); }

#workbook { padding-bottom: 2.5rem; outline: none; }

.book {
  background: var(--paper);
  color: var(--ink-sheet);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(201, 162, 39, 0.32);
}
@media (prefers-reduced-motion: no-preference) {
  .book { animation: rise 0.35s ease; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .book { animation: none; }
}

.book-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  background: var(--black);
  color: #fff;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
}
.book-id { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.book-title { font-size: 1.2rem; letter-spacing: -0.02em; font-weight: 680; }
.book-title:focus { outline: none; }
.book-title:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }
.book-file { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }

.xls {
  flex: none;
  width: 18px; height: 22px; border-radius: 3px;
  background:
    linear-gradient(var(--accent), var(--accent)) 4px 7px / 10px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 4px 11px / 10px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 4px 15px / 10px 2px no-repeat,
    #1f6e43;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.back {
  flex: none;
  display: inline-flex; align-items: center;
  background: transparent; color: #f2f0ea;
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 750;
  min-height: 40px;
  font-size: 0.92rem;
}
.back:hover { border-color: var(--accent-light); color: var(--accent-light); }

.formula {
  display: flex; align-items: center; gap: 0.65rem;
  background: #f3f1ea;
  border-bottom: 1px solid var(--grid);
  padding: 0.45rem 0.75rem;
  min-height: 42px;
}
.namebox {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 4.4rem; height: 28px;
  border: 1px solid #d5d0c4; background: #fff; border-radius: 4px;
  font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-sheet); font-size: 0.85rem;
}
.fx { color: var(--accent); font-style: italic; font-weight: 750; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; }
.formula-value {
  flex: 1; min-width: 0; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-sheet); font-size: 0.92rem;
}

.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #141414;
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
}
.kpi { padding: 0.75rem 1rem 0.8rem; border-right: 1px solid #2a2a2a; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi b {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-light);
  line-height: 1.2;
}
.kpi-bad { color: #ffb4ae; }
.kpi-ok { color: #b7e4c4; }
.kpi-soon { color: #f0d48a; }
.kpi span {
  display: block; margin-top: 0.15rem;
  color: var(--muted); font-size: 0.72rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase;
}

.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.75rem 0.85rem 0.15rem;
  background: var(--paper);
}
.chip {
  border: 1px solid #d9d3c6;
  background: #fff;
  color: var(--ink-sheet);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.86rem;
  min-height: 40px;
}
.chip:hover { border-color: #b89a3e; }
.chip[aria-pressed="true"] { background: var(--black); color: var(--accent-light); border-color: var(--black); }
.chip .count { margin-left: 0.35rem; font-variant-numeric: tabular-nums; opacity: 0.75; }

.swipe-hint { display: none; margin: 0; padding: 0.35rem 0.85rem 0; background: var(--paper); color: var(--muted-sheet); font-size: 0.8rem; }

.sheet-scroll {
  overflow: auto;
  max-height: min(68vh, 740px);
  background: var(--paper);
  border-top: 1px solid var(--grid);
  scrollbar-color: #b7a46a var(--gutter);
}

.sheet {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-sheet);
  font-variant-numeric: tabular-nums lining-nums;
}
.sheet caption {
  caption-side: top;
  text-align: left;
  padding: 0.7rem 0.85rem 0.55rem;
  color: #3c3934;
  font-size: 13px;
  background: var(--paper);
}
.sheet th, .sheet td {
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  padding: 0.42rem 0.6rem;
  text-align: left;
  vertical-align: top;
  font-weight: 450;
}
.letters th {
  position: sticky; top: 0; z-index: 3;
  background: var(--gutter);
  color: #4e4b45;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  height: 22px;
  padding: 0 0.25rem;
  vertical-align: middle;
}
.corner { position: sticky; left: 0; z-index: 6; width: var(--roww); }
.rownum {
  position: sticky; left: 0; z-index: 2;
  background: var(--gutter);
  color: #4e4b45;
  text-align: center !important;
  font-size: 11px;
  font-weight: 650;
  width: var(--roww);
  min-width: var(--roww);
  vertical-align: middle;
}
.colnames .rownum { position: sticky; top: 22px; z-index: 6; }
.colnames th.cell {
  position: sticky; top: 22px; z-index: 3;
  background: var(--black);
  color: var(--accent-light);
  font-weight: 750;
  font-size: 12px;
  vertical-align: bottom;
}
.sheet td.cell { background: var(--paper-2); }
.sticky-col { position: sticky; left: var(--roww); z-index: 1; }
.colnames th.sticky-col { z-index: 5; background: var(--black); }
.h-dow, .h-date { display: block; text-align: center; }
.h-dow { color: var(--accent-light); }
.h-date { color: #f7f3ea; font-weight: 650; }

.sheet .is-selected { box-shadow: inset 0 0 0 2px var(--accent); position: relative; z-index: 2; }
.sticky-col.is-selected { z-index: 3; }
.colnames th.is-selected { z-index: 6; }
.sheet .cell:focus-visible { outline: none; }

.sheet tbody tr:not(.section-row):hover td.cell {
  background-image: linear-gradient(rgba(201, 162, 39, 0.09), rgba(201, 162, 39, 0.09));
}
.can-open:hover .rownum { box-shadow: inset 3px 0 0 var(--accent); }

.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hours { text-align: right; white-space: nowrap; }
.hours .sub { display: block; text-align: right; }
.strong, .hrs { font-weight: 750; }
.sub { display: block; color: var(--muted-sheet); font-size: 11.5px; font-weight: 500; margin-top: 0.12rem; }
.dash { color: #b0aa9e; }
.nowrap { white-space: nowrap; }
.sku { font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace; font-size: 12px; letter-spacing: 0.01em; }

.section-row .rownum { background: var(--black); color: var(--accent-light); }
.section-cell, .section-row .section-cell {
  background: var(--black) !important;
  color: #f4f0e6;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.section-line { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.section-line > span:first-child { position: sticky; left: calc(var(--roww) + 0.6rem); }
.section-meta { color: var(--accent-light); font-size: 12px; font-weight: 650; white-space: nowrap; }

.note-cell { background: #f3f1ea !important; color: #3f3c36; font-size: 12.5px; font-style: italic; }

.sheet tr.total-row td.cell { background-color: #f6f0dc; font-weight: 700; box-shadow: inset 0 1px 0 #e4d7a4; }
.sheet tr.total-row .rownum { background: #f3ead0; }
.sheet tr.tone-gold.total-row td.cell { background-color: #f3e4b0; }
.sheet tr.tone-unpaid.total-row td.cell { background-color: #f8d4cf; }
.sheet tr.tone-soon.total-row td.cell { background-color: #f8e7c0; }

.sheet tr.tone-gold td.cell { background-color: #f8efc4; }
.sheet tr.tone-late td.cell { background-color: #fbe6d4; }
.sheet tr.tone-unpaid td.cell,
.sheet tr.tone-bad td.cell,
.sheet tr.tone-out td.cell { background-color: #fde2df; }
.sheet tr.tone-soon td.cell,
.sheet tr.tone-low td.cell { background-color: #f8e7b0; }
.sheet tr.tone-ok td.cell { background-color: #e7f6ea; }
.sheet tr.tone-gap td.cell { background-color: #f3f0e8; }
.sheet td.cell.tone-free { background-color: #e5f6e8; }
.sheet td.cell.tone-leave { background-color: #e3f0fb; }

.tone-bad .rownum, .tone-out .rownum, .tone-unpaid .rownum { box-shadow: inset 4px 0 0 #a33b3b; }
.tone-soon .rownum, .tone-low .rownum, .tone-gold .rownum { box-shadow: inset 4px 0 0 var(--accent); }
.tone-ok .rownum { box-shadow: inset 4px 0 0 #2f7d4a; }
.tone-late .rownum { box-shadow: inset 4px 0 0 #d4762c; }
.tone-gap .rownum { box-shadow: inset 4px 0 0 #8a8478; }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.08rem 0.48rem 0.12rem;
  border-radius: 999px;
  font-size: 11px; font-weight: 750; line-height: 1.45;
  letter-spacing: 0.01em;
  max-width: 100%;
}
.pill::before {
  content: ""; width: 0.42rem; height: 0.42rem; border-radius: 50%;
  background: currentColor; flex: none;
}
.pill-ok { background: #dff3e4; color: #145c32; }
.pill-soon, .pill-gold, .pill-late { background: #f8e7b8; color: #6d4d08; }
.pill-late { background: #f8d7b4; color: #8a3d0b; }
.pill-bad { background: #f8d0cb; color: #8d1d24; }
.pill-info { background: #d9e8f8; color: #1a4e7a; }
.pill-neutral { background: #ece7dc; color: #3f3d38; }
.pill-gap { background: #fff; color: #3f3d38; box-shadow: inset 0 0 0 1px #b7b1a4; }
.pill-gap::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

.prog { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 6.5rem; }
.bar { display: inline-block; width: 64px; height: 6px; background: #e4dfd4; border-radius: 99px; overflow: hidden; flex: none; }
.bar > span { display: block; height: 100%; background: #c9a227; border-radius: 99px; }
.bar-late > span { background: #d4762c; }
.bar-done > span { background: #2f7d4a; }
.bar-zero > span { background: transparent; }
.bar-label { font-weight: 750; font-variant-numeric: tabular-nums; }

.open-hit {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem;
  background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.open-hit strong { font-weight: 780; text-decoration: underline; text-decoration-color: #c9a227; text-underline-offset: 2px; }
.open-hit em { font-style: normal; color: #6d5310; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.open-hit:hover em { color: #3d2e08; }

.who-name { display: block; font-weight: 780; }
.who-role { display: block; color: var(--muted-sheet); font-size: 12px; margin-top: 0.12rem; }
.who-cell { vertical-align: middle; }

.sheet-calendar td.card { background: var(--paper); padding: 0.35rem; }
.slot {
  border-radius: 8px;
  padding: 0.55rem 0.6rem 0.6rem;
  min-height: 108px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.08rem;
}
.slot-booked { background: #fbf7ee; box-shadow: inset 3px 0 0 #c9a227; }
.slot-gold { background: #f8efc4; box-shadow: inset 3px 0 0 #a48418; }
.slot-late { background: #fbe6d4; box-shadow: inset 3px 0 0 #d4762c; }
.slot-free { background: #e5f6e8; box-shadow: inset 3px 0 0 #2f7d4a; }
.slot-leave { background: #e3f0fb; box-shadow: inset 3px 0 0 #2c6eae; }
.slot-title, .slot-client { margin: 0; font-weight: 750; }
.slot-task, .slot-sub { margin: 0; color: #4e4b45; font-size: 12px; }
.slot .pill { margin-top: auto; }
.slot-code {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 780; color: var(--ink-sheet);
  cursor: pointer; text-decoration: underline; text-decoration-color: #c9a227; text-underline-offset: 2px;
}
.slot-code:hover { color: #6d5310; }

.plate {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  letter-spacing: 0.08em;
  font-weight: 750;
  font-size: 12px;
  background: #f4f0e4;
  border: 1px solid #c9a227;
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
  color: var(--ink-sheet);
}

.book-bottom { background: #eceae4; }
.sheet-tabs {
  display: flex; gap: 2px; padding: 0.4rem 0.55rem 0; overflow-x: auto;
}
.sheet-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #5c574e;
  border-radius: 8px 8px 0 0;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  min-height: 40px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.sheet-tab:hover { color: var(--ink-sheet); }
.sheet-tab[aria-selected="true"] {
  background: var(--paper);
  color: var(--ink-sheet);
  border-color: #e4dfd4;
  border-bottom-color: var(--paper);
  box-shadow: inset 0 2px 0 var(--accent);
}
.statusbar {
  display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  margin: 0; padding: 0.35rem 0.85rem 0.55rem;
  color: #5c574e; font-size: 12px;
}
.statusbar span { margin: 0; }

.legend {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem 1rem;
  margin: 0.85rem 0 0; padding: 0; color: var(--muted); font-size: 0.86rem;
}
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch { width: 0.85rem; height: 0.85rem; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.swatch-gold { background: #f8efc4; }
.swatch-late { background: #fbe6d4; }
.swatch-free, .swatch-ok { background: #e5f6e8; }
.swatch-leave { background: #e3f0fb; }
.swatch-booked { background: #fbf7ee; box-shadow: inset 3px 0 0 #c9a227; }
.swatch-unpaid, .swatch-bad, .swatch-out { background: #fde2df; }
.swatch-soon, .swatch-low { background: #f8efd2; }
.swatch-gap { background: #fff; box-shadow: inset 0 0 0 1px #b7b1a4; }

.fine { color: var(--muted); font-size: 0.85rem; margin: 0.7rem 0 0; max-width: 70rem; }

.site-footer {
  background: #080808;
  color: #b5b2aa;
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.4rem;
  font-size: 0.95rem;
}
.footer-logo { display: block; width: 200px; height: auto; margin-bottom: 0.9rem; }
.site-footer p { margin: 0 0 0.4rem; max-width: 46rem; }
.site-footer strong { color: #fff; }
.footer-small { color: #8f8c85; margin-top: 0.8rem !important; }

.noscript {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--card);
}

.sheet-timesheet { min-width: 1040px; }
.sheet-calendar { min-width: 1080px; }
.sheet-jobs { min-width: 1180px; }
.sheet-overview { min-width: 1088px; }
.sheet-invoices { min-width: 920px; }
.sheet-accounting { min-width: 980px; }
.sheet-inventory { min-width: 1180px; }
.sheet-vehicles { min-width: 1040px; }
.sheet-employees { min-width: 1040px; }

@media (min-width: 980px) {
  .switcher { display: grid; grid-template-columns: repeat(6, 1fr); overflow: visible; }
  .switcher button { min-width: 0; }
}

@media (max-width: 800px) {
  .swipe-hint { display: block; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(odd) { border-right: 1px solid #2a2a2a; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid #2a2a2a; }
  .book-top, .statusbar { flex-direction: column; }
  .header-inner { flex-wrap: wrap; }
  .brand-logo { height: 42px; }
  .intro h1 { max-width: none; }
  .sheet-scroll { max-height: 70vh; }
}

@media (forced-colors: active) {
  .pill, .view-only, .sheet td, .sheet th, .book { border: 1px solid CanvasText; }
  .is-selected { outline: 2px solid Highlight; }
}
