/* Copyright (c) 2026 Carl Palacio (SiteTracker). All rights reserved. Proprietary and confidential; see LICENSE. */
:root {
  /* Light theme: soft grey page, white cards, navy header, amber accent. */
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #172033;
  --muted: #5d687c;
  --line: #dde2ea;
  --brand: #f0b429;
  --brand-strong: #d99a0b;
  --brand-soft: #fdf2d3;
  --on-brand: #172033;
  --sidebar: #16244a;
  --header: #16244a;   /* top bar; companies can override */
  --sidebar-ink: #c3cbdb;
  --sidebar-active: #1f3060;
  --ok: #15803d;
  --ok-soft: #dcf5e4;
  --bad: #c8321f;
  --bad-soft: #fde4e0;
  --warn: #a8590a;
  --warn-soft: #fdf0d5;
  --info: #1f5fd1;
  --info-soft: #e0eafd;
  --planned: #9aa5b8;
  --track: #e6eaf1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 2px 6px rgba(23, 32, 51, .05);
  --font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", "Arial Narrow", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 700 30px/1.1 var(--font-head); text-transform: uppercase; letter-spacing: .01em; }
h2 { font-size: 16px; }
.card-head h2, .card-pad > h2 { font: 700 19px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .02em; }
h3 { font-size: 14px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- layout */
/* Top bar: brand, company, date and user on one row; main navigation tabs below. */
.topbar { background: var(--header); border-bottom: 4px solid var(--brand); position: sticky; top: 0; z-index: 30; }
.topbar-row { display: flex; align-items: center; gap: 16px; padding: 12px 28px 6px; flex-wrap: wrap; max-width: 1440px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font: 700 26px/1 var(--font-head); text-transform: uppercase; letter-spacing: .01em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; flex: none; }
.company { color: #c3cbdb; font-weight: 500; }
.today-date { color: #c3cbdb; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #fff; }
.who-name { font-weight: 600; }
.role-tag { display: inline-block; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 2px 9px; border-radius: 4px; }
.who button { color: #fff; border-color: rgba(255,255,255,.25); }
.mainnav { display: flex; gap: 6px; padding: 6px 28px 10px; overflow-x: auto; max-width: 1440px; margin: 0 auto; scrollbar-width: none; }
.mainnav a { color: #dfe5f1; font-weight: 600; font-size: 16px; padding: 8px 16px; border-radius: 8px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.mainnav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.mainnav a.active { background: #fff; color: var(--header); box-shadow: inset 0 -3px 0 var(--brand); }
.badge { background: var(--brand); color: var(--on-brand); border-radius: 99px; font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; }
.main { min-width: 0; padding: 26px 28px 56px; max-width: 1440px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 16px; align-content: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; margin-top: 2px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; transition: border-color .15s; }
.project-card:hover { border-color: var(--brand); text-decoration: none; }
.project-card .title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.project-card .meta { color: var(--muted); font-size: 12px; }

/* ---------- progress bars */
.bar-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.bar-row strong { color: var(--ink); }
.bar { position: relative; height: 8px; background: var(--track); border: 1px solid var(--line); border-radius: 99px; overflow: visible; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar.money > span { background: var(--info); }
.bar.over > span { background: var(--bad); }
.bar .marker { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; opacity: .55; }

/* ---------- chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.Active, .chip.approved, .chip.ahead { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.Planning { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.On-Hold, .chip.pending, .chip.behind { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.rejected, .chip.late { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.role { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }

/* ---------- buttons & forms */
button, .btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.primary:hover, .btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
button.danger { color: var(--bad); }
button.ok { color: var(--ok); }
button.small, .btn.small { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
.sidebar button { background: transparent; color: var(--sidebar-ink); border-color: #303848; width: 100%; }
.sidebar button:hover { background: var(--sidebar-active); color: #fff; }
button:disabled { opacity: .55; cursor: default; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type=range] { padding: 0; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-help { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.form-error { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-weight: 500; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .count { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; margin-left: 4px; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; }
tfoot td { font-weight: 700; background: var(--surface-2); }
.ms-progress { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.ms-progress input { flex: 1; }
.ms-progress .val { width: 44px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- reports */
.report { padding: 18px; }
.report + .report { margin-top: 14px; }
.report-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.report-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 4px; }
.report-section { margin-top: 12px; }
.report-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
.report-section p { margin: 0; white-space: pre-wrap; }
.report-section.issues h3 { color: var(--bad); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo button { position: absolute; top: 4px; right: 4px; padding: 0 7px; font-size: 14px; line-height: 20px; background: rgba(0,0,0,.6); color: #fff; border: 0; }

/* ---------- charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .planned { stroke: var(--planned); stroke-dasharray: 5 4; fill: none; stroke-width: 2; }
.chart .actual { stroke: var(--brand); fill: none; stroke-width: 2.5; }
.chart .actual-dot { fill: var(--brand); }
.chart .today { stroke: var(--info); stroke-dasharray: 2 3; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.cols { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 18px; }
.cols .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.cols .col span { width: 100%; max-width: 46px; background: var(--info); border-radius: 4px 4px 0 0; min-height: 2px; }
.cols .col small { color: var(--muted); font-size: 11px; margin-top: 4px; white-space: nowrap; }
.cols .col b { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 3px; white-space: nowrap; }
.hbars { display: grid; gap: 10px; }

/* ---------- activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity .when { color: var(--muted); font-size: 12px; }

/* ---------- dashboard project cards */
.dash-section { margin-bottom: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font: 700 34px/1 var(--font-head); text-transform: uppercase; letter-spacing: .01em; }
.section-head .hint { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 22px; }
.pcard {
  --tone: var(--info);
  background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--tone); border-radius: 12px;
  padding: 22px 26px; display: flex; flex-direction: column; gap: 18px; cursor: pointer; transition: border-color .15s, transform .15s;
}
.pcard:hover, .pcard:focus-visible { border-color: var(--info); border-top-color: var(--tone); outline: none; }
.tone-over { --tone: var(--bad); }
.tone-trend { --tone: var(--warn); }
.tone-ok { --tone: var(--ok); }
.tone-plan { --tone: var(--info); }
.tone-done { --tone: var(--planned); }
.pcard-head { display: flex; justify-content: space-between; gap: 16px; }
.pcode { font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pname { font: 700 32px/1.1 var(--font-head); margin: 4px 0 8px; }
.pinfo { color: var(--muted); font-size: 16px; line-height: 1.6; }
.pills { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.pill { display: inline-block; padding: 4px 14px; border-radius: 99px; font-size: 15px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); font-family: var(--font); letter-spacing: 0; text-transform: none; line-height: 1.4; }
.pill.over { background: var(--bad-soft); color: var(--bad); }
.pill.trend { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.plan { background: var(--info-soft); color: var(--info); }
.pill.link { background: var(--info-soft); color: var(--info); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
h1 .pill { font-size: 14px; vertical-align: middle; }
.meter-row { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; margin-bottom: 9px; }
.mono { font-family: var(--font-mono); font-weight: 700; letter-spacing: -.02em; }
.track { position: relative; height: 14px; background: var(--track); border-radius: 99px; }
.fill { display: block; height: 100%; border-radius: 99px; background: var(--planned); }
.fill.work { background: var(--info); }
.fill.over { background: var(--bad); }
.fill.trend { background: var(--warn); }
.fill.ok { background: var(--ok); }
.tick { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--bg); box-shadow: 0 0 0 1px var(--ink); border-radius: 2px; }
.pcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; }
.team { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.person { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.person i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.person small { color: var(--muted); font-size: 12px; }
.chip.req-requested { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.req-ordered { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.req-delivered { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.checklist label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0; cursor: pointer; }
.checklist input { width: auto; margin-top: 3px; }
.checklist small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 560px) {
  .pcard { padding: 18px; }
  .pcard-head { flex-direction: column; }
  .pills { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .pname { font-size: 27px; }
  .section-head h2 { font-size: 28px; }
  .meter-row { font-size: 15px; }
}

.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--sidebar); }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { color: var(--ink); padding: 0 0 18px; font-size: 20px; }
.auth form > div { margin-bottom: 14px; }
.auth button.primary { width: 100%; padding: 10px; }
.auth .switch { text-align: center; margin-top: 16px; color: var(--muted); }

/* ---------- modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(13, 17, 26, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal .card-head { flex: none; }
.modal form { display: flex; flex-direction: column; min-height: 0; }
.modal .modal-body { padding: 18px; overflow-y: auto; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); flex: none; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: grid; place-items: center; z-index: 60; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 8px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--bad); color: #fff; }

.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--line); }

/* ---------- overview */
.kpis-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 32px; }
.kpi-link { color: inherit; text-decoration: none; padding: 18px 22px; transition: border-color .15s; }
.kpi-link:hover { border-color: var(--info); text-decoration: none; }
.kpi-link .value { font: 700 44px/1.1 var(--font-head); }
.kpi-link .label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.kpi-link .hint { color: var(--muted); }
.kpi-link.attn { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.kpi-link.attn .value { color: var(--brand); }
.fchips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.fchip { border-radius: 99px; padding: 6px 14px; font-weight: 600; background: var(--surface); }
.fchip span { margin-left: 8px; font-size: 12px; background: var(--surface-2); border-radius: 99px; padding: 0 7px; color: var(--muted); }
.fchip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fchip.on span { background: rgba(255,255,255,.2); color: inherit; }
.fchip.over:not(.on) { color: var(--bad); }
.fchip.trend:not(.on) { color: var(--warn); }
.fchip.ok:not(.on) { color: var(--ok); }
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.daily { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--ok); }
.daily.missing { border-left-color: var(--warn); }
.daily-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.daily-title { font: 700 22px/1.15 var(--font-head); color: var(--ink); }
.daily-body p { margin: 4px 0; }
.daily-body .issue { color: var(--warn); }
.daily-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }
.row-link { display: block; color: inherit; text-decoration: none; }
.row-link:hover { text-decoration: none; }
.activity li:has(.row-link):hover { background: var(--surface-2); }
.comment-body { white-space: pre-wrap; margin: 3px 0; }
.eng-card { display: flex; flex-direction: column; gap: 10px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ptitle { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.done-head { padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); }
.done-row { opacity: .6; }
.chip.kind-daily { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.kind-weekly { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- material requests */
.section-head.small-head h2 { font-size: 24px; }
.req-group { margin-bottom: 24px; }
.req-list { display: flex; flex-direction: column; }
.req-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(110px, .8fr) minmax(120px, .9fr) minmax(0, 2.2fr); gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.req-row:last-child { border-bottom: 0; }
.req-row:hover { background: var(--surface-2); text-decoration: none; }
.req-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.stepper { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.step { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.step.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step.current { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.step.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.stepper.compact .step { font-size: 11px; padding: 2px 7px; }
.req-detail-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.req-detail-top .stepper .step { font-size: 15px; padding: 7px 14px; }
.next-step { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip.paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.unpaid { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.st-submitted { background: var(--surface-2); color: var(--ink); }
.chip.st-for_approval { background: var(--brand-soft); color: var(--warn); border-color: transparent; }
.chip.st-returned { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.st-approved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.st-ordered { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.st-delivered { background: var(--ok); color: #fff; border-color: transparent; }
.chip.st-cancelled { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.step.back { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px 18px; }
.facts small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 18px; border-bottom: 1px solid var(--line); }

.tl-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-who i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.timeline .comment-body { margin: 6px 0 0 34px; }
.comment-form { display: flex; gap: 10px; padding: 14px 18px; align-items: flex-end; }
.comment-form textarea { min-height: 44px; }
.receipts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.receipt { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.receipt img, .receipt .pdf { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.receipt .pdf { display: grid; place-items: center; font-weight: 700; color: var(--bad); }
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger-solid:hover { filter: brightness(1.08); background: var(--bad); }
.inline-check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.inline-check input { width: auto; }
.req { color: var(--bad); }
.role-help { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; display: grid; gap: 4px; }
.role-help strong { color: var(--ink); }

/* ---------- responsive */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { position: static; }
  .topbar-row { padding: 10px 16px 4px; gap: 8px 12px; }
  .company, .today-date { display: none; }
  .who-name { display: none; }
  .mainnav { padding: 6px 16px 10px; }
  .mainnav a { font-size: 15px; padding: 7px 12px; }
  .main { padding: 18px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  th, td { padding: 9px 10px; }
  .req-row { grid-template-columns: 1fr 1fr; }
  .req-main, .req-status { grid-column: 1 / -1; }
}

/* ---------- print (progress report) */
.print-page { max-width: 800px; margin: 0 auto; padding: 32px 24px; background: #fff; color: #111; min-height: 100vh; }
.print-page .report-section h3 { color: #555; }
.print-page .photos { grid-template-columns: repeat(3, 1fr); }
.print-head { display: flex; justify-content: space-between; border-bottom: 3px solid var(--brand); padding-bottom: 12px; margin-bottom: 16px; gap: 16px; }
.print-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.print-facts div { border: 1px solid #ddd; border-radius: 6px; padding: 6px 10px; }
.print-facts small { display: block; color: #666; font-size: 11px; }
.no-print { margin-bottom: 16px; display: flex; gap: 8px; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .print-page { padding: 0; }
}

/* ---------- light-theme refinements */
.card { border-color: var(--line); }
.pcard { box-shadow: var(--shadow); }
.pcard:hover, .pcard:focus-visible { box-shadow: 0 4px 14px rgba(23, 32, 51, .1); }
.kpi-link.attn .value { color: var(--brand-strong); }
.pill.trend, .chip.unpaid { color: var(--warn); }
th { background: var(--surface-2); }
.muted-row td { opacity: .55; }
.role-tag.soft { background: var(--brand-soft); color: var(--warn); }
.role-help.big { font-size: 15px; gap: 8px; }
.big-num { font-size: 20px; }
button.big { padding: 10px 18px; font-size: 16px; }
.modal.wide { max-width: 760px; }
.hint.ok-text, .hint.trend-text { font-weight: 600; }
.trend-text { color: var(--warn); font-weight: 600; }
.over-text { color: var(--bad); font-weight: 600; }
.chip.cat-Payroll { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.cat-Materials { background: var(--brand-soft); color: var(--warn); border-color: transparent; }

/* ---------- request items editor */
.items-editor { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface-2); }
.item-head, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px 34px; gap: 8px; align-items: center; }
.item-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 2px 6px; }
.item-row { margin-bottom: 8px; }
.item-row input { background: var(--surface); }

/* ---------- big-screen board (viewer) */
body.board-mode { background: #0f1a36; }
.board { min-height: 100vh; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, #16244a 0%, #0f1a36 100%); }
.board-head { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; padding: 22px 36px; border-bottom: 5px solid var(--brand); }
.board-brand { display: flex; align-items: center; gap: 14px; }
.board-brand .brand-mark { width: 52px; height: 52px; border-radius: 12px; }
.board-brand .brand-mark svg { width: 30px; height: 30px; }
.board-company { font: 700 34px/1 var(--font-head); text-transform: uppercase; letter-spacing: .02em; }
.board-sub { color: #b9c3d8; font-size: 16px; margin-top: 4px; }
.board-quote { font: 600 30px/1.25 var(--font-head); color: var(--brand); text-align: center; letter-spacing: .01em; }
.board-clock { text-align: right; color: #d5dbea; font-size: 17px; }
.board-clock #board-time { font: 700 46px/1 var(--font-head); color: #fff; }
.board-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 24px 36px 36px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 20px; align-content: start; }
.board-tile { background: #fff; color: var(--ink); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; border-top: 8px solid var(--ok); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.board-tile.sched-trend { border-top-color: var(--brand); }
.board-tile.sched-over { border-top-color: var(--bad); }
.bt-head { display: flex; justify-content: space-between; gap: 14px; }
.bt-head h3 { font: 700 32px/1.05 var(--font-head); margin: 2px 0 6px; }
.bt-head img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; flex: none; }
.bt-info { color: var(--muted); font-size: 17px; }
.board-tile .meter-row { font-size: 19px; }
.board-tile .track { height: 18px; }
.bt-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.bt-pills .pill { font-size: 16px; }
.bt-note { margin: 0; font-size: 17px; color: #333c4e; }
.bt-reqs { display: flex; gap: 6px; flex-wrap: wrap; }
.bt-reqs .chip { font-size: 14px; }
.board-side { background: rgba(255,255,255,.06); border-radius: 16px; padding: 22px; align-self: start; }
.board-side h2 { font: 700 24px/1 var(--font-head); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 14px; color: #fff; }
.board-side h2 + * { margin-bottom: 26px; }
.board-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.board-stat { background: rgba(255,255,255,.08); border-radius: 10px; padding: 12px 14px; }
.board-stat b { display: block; font: 700 36px/1 var(--font-head); color: var(--brand); }
.board-stat span { color: #d5dbea; font-size: 15px; }
.board-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.board-notes li { background: rgba(255,255,255,.08); border-radius: 10px; padding: 12px 14px; display: grid; gap: 3px; }
.board-notes strong { color: var(--brand); font-size: 15px; }
.board-notes span { font-size: 16px; white-space: pre-wrap; }
.board-notes small { color: #aeb8cc; font-size: 13px; }
.board-empty { color: #d5dbea; font-size: 22px; }
.board-logout { position: fixed; bottom: 10px; right: 12px; color: rgba(255,255,255,.5); border-color: transparent; }
.board-logout:hover { color: #fff; background: rgba(255,255,255,.1); }
@media (max-width: 1100px) {
  .board-head { grid-template-columns: 1fr auto; }
  .board-quote { grid-column: 1 / -1; grid-row: 2; font-size: 24px; }
  .board-body { grid-template-columns: 1fr; padding: 18px; }
}
@media (max-width: 560px) {
  .board-head { padding: 16px; gap: 12px; }
  .board-company { font-size: 24px; }
  .board-clock #board-time { font-size: 30px; }
  .item-head, .item-row { grid-template-columns: minmax(0, 1fr) 64px 70px 30px; }
}
.tone-trend { --tone: var(--brand); }
.fill.trend { background: var(--brand); }
.fchip.on.trend, .fchip.on.over, .fchip.on.ok { color: #fff; }

/* ---------- avatars & profile */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-soft); color: var(--warn); font-weight: 700; border: 1px solid var(--line); vertical-align: middle; }
.who-link { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.who-link:hover { text-decoration: none; opacity: .9; }
.who-link .avatar { border-color: rgba(255,255,255,.3); }
.person { display: inline-flex; align-items: center; gap: 10px; }
.tl-who .avatar { margin-right: 2px; }
.profile-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; max-width: 980px; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; align-self: start; }
.profile-card .avatar { font-size: 42px !important; }
.profile-name { font: 700 26px/1.1 var(--font-head); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-bottom: 14px; }
.team-card { display: flex; gap: 14px; padding: 18px; align-items: flex-start; }
.team-name { font: 700 22px/1.1 var(--font-head); margin-bottom: 4px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }

/* ---------- receipts with history */
.receipt { gap: 4px; }
.receipt.replaced { opacity: .55; }
.receipt.replaced img, .receipt.replaced .pdf { filter: grayscale(1); }
.receipt button { align-self: flex-start; }

/* ---------- board: light, same look as the rest of the site */
body.board-mode { background: var(--bg); }
.board { background: var(--bg); color: var(--ink); }
.board-head { background: var(--header); color: #fff; }
.board-body { padding-top: 28px; }
.board-tile { box-shadow: var(--shadow); border: 1px solid var(--line); border-top-width: 8px; }
.board-side { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.board-side h2 { color: var(--ink); }
.board-stat { background: var(--surface-2); border: 1px solid var(--line); }
.board-stat b { color: var(--warn); }
.board-stat span { color: var(--muted); }
.board-reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board-reqs li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; justify-items: start; }
.board-reqs strong { font-size: 15px; }
.board-reqs span { font-size: 15px; }
.board-reqs small { color: var(--muted); }
.board-empty { color: var(--muted); }
.board-logout { color: var(--muted); }
.board-logout:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- stage photos tab */
.photo-stage { margin-bottom: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sphoto { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sphoto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.sphoto figcaption { font-size: 13px; color: var(--muted); }
.sphoto figcaption strong { color: var(--ink); }
.board-total { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 10px; }
.board-total b { display: block; font: 700 44px/1 var(--font-head); color: var(--ink); }
.board-total span { color: var(--muted); font-size: 15px; }

/* ---------- sign-in page with Onsite pitch */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-pitch { background: linear-gradient(160deg, #16244a 0%, #0f1a36 100%); color: #fff; padding: 56px 56px 40px; display: flex; flex-direction: column; justify-content: center; gap: 18px; border-right: 6px solid var(--brand); }
.login-pitch h1 { font: 700 46px/1.05 var(--font-head); text-transform: none; max-width: 560px; }
.login-pitch p { font-size: 18px; color: #d5dbea; max-width: 560px; margin: 0; }
.login-pitch ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 17px; }
.login-pitch li::before { content: "✓"; color: var(--brand); font-weight: 700; margin-right: 10px; }
.pitch-cta { margin-top: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 16px 18px; font-size: 16px; max-width: 560px; }
.pitch-cta a { color: var(--brand); font-weight: 600; }
.brand.big { font-size: 34px; }
.brand.big .brand-mark { width: 44px; height: 44px; }
.login-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px 20px 0; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 30px; margin: auto 0; }
.login-card form > div { margin-bottom: 14px; }
.login-card button.primary { width: 100%; padding: 11px; font-size: 16px; }
.login-card .switch { text-align: center; margin-top: 14px; }
.legal-note { text-align: center; margin: 14px 0 0; }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-pitch { padding: 32px 20px; border-right: 0; border-bottom: 6px solid var(--brand); }
  .login-pitch h1 { font-size: 34px; }
  .login-side { order: -1; padding-top: 24px; }
}

/* ---------- public pages (forgot / reset / legal) */
.public { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 0; background: var(--bg); }
.public-inner { width: 100%; max-width: 440px; flex: 1; }
.public-inner.wide { max-width: 860px; }
.public-card { padding: 28px; }
.public-card form > div { margin-bottom: 14px; }
.public-card button.primary { width: 100%; padding: 10px; }
.public-card .switch { text-align: center; margin-top: 16px; }
.brand.dark { color: var(--ink); font-size: 22px; margin-bottom: 18px; }
.notice { background: var(--ok-soft); border: 1px solid transparent; border-radius: 10px; padding: 14px 16px; color: var(--ink); }
.notice.warn { background: var(--warn-soft); }
.legal { padding: 32px 40px; line-height: 1.65; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font: 700 20px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .02em; margin: 26px 0 8px; }
.legal ul { padding-left: 20px; }
.legal-wrap { max-width: 860px; }
.public-inner.wide .brand.dark { display: inline-flex; margin-bottom: 16px; }
@media (max-width: 560px) { .legal { padding: 22px 18px; } }

/* ---------- footer */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px 30px; }
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.login-side .site-footer { padding-top: 10px; }

/* ---------- admin: companies */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.company-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.company-card:hover { border-color: var(--info); text-decoration: none; box-shadow: 0 4px 14px rgba(23, 32, 51, .1); }
.company-card.suspended { opacity: .65; }
.company-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.company-top h2 { font: 700 26px/1.1 var(--font-head); }
.company-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.company-stats b { color: var(--ink); }

/* ---------- board credit */
.board-credit { position: fixed; bottom: 12px; left: 16px; font-size: 13px; color: var(--muted); }

/* ---------- sign-in pitch (Onsite) */
.login-pitch { justify-content: center; }
.pitch-eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; margin-top: 6px; }
.login-pitch h1 { font-size: 44px; max-width: 600px; }
.pitch-lead { font-size: 18px; }
.pitch-points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; margin-top: 4px; }
.pitch-points div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.pitch-points b { color: #fff; font-size: 16px; }
.pitch-points span { color: #c8d0e0; font-size: 14px; line-height: 1.45; }
.pitch-trust { color: #aeb8cc; font-size: 14px; }
@media (max-width: 1100px) { .pitch-points { grid-template-columns: 1fr; } }

/* ---------- company colors */
.brand-mark { color: var(--on-brand); }
.login-pitch .brand-mark, .public .brand-mark { color: #172033; }
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.theme-preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; font-weight: 600; }
.swatch { width: 30px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.swatch i { width: 12px; height: 12px; border-radius: 50%; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 56px; height: 40px; padding: 3px; cursor: pointer; }

/* ---------- accounts waiting for a role */
.team-card.needs-role { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.waiting { max-width: 620px; margin: 30px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.waiting h1 { margin-top: 6px; }

/* =====================================================================
   Polish & motion
   Every animation here moves or fades (transform / opacity), which the
   browser can run smoothly. People who turn on "reduce motion" in their
   device settings get none of it (see the end of this block).
   ===================================================================== */
:root {
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 51, .04), 0 6px 20px -10px rgba(23, 32, 51, .16);
  --shadow-hover: 0 2px 4px rgba(23, 32, 51, .05), 0 16px 32px -14px rgba(23, 32, 51, .26);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
}

/* Soft glow in the company's accent color behind every page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 100% -8%, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%),
    radial-gradient(700px 480px at -10% 110%, color-mix(in srgb, var(--info) 7%, transparent), transparent 70%);
}
body.board-mode::before { display: none; }

/* Cards: rounder, softer, and they lift a little under the pointer */
.card { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 85%, transparent); box-shadow: var(--shadow); }
.pcard, .company-card, .kpi-link, .daily, .team-card, .report, .photo-stage, .req-group .card {
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s;
}
.pcard:hover, .company-card:hover, .kpi-link:hover, .team-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-hover);
}
.req-row { transition: background-color .15s, transform .2s var(--ease-out); }
.req-row:hover { transform: translateX(2px); }
.thumbs img, .photo img, .sphoto img { transition: transform .35s var(--ease-out), filter .3s; }
.thumbs img:hover, .photo img:hover, .sphoto img:hover { transform: scale(1.03); filter: saturate(1.1); }

/* Top bar: a subtle sheen over the header color */
.topbar { background: linear-gradient(135deg, var(--header) 0%, color-mix(in srgb, var(--header) 78%, #000) 100%); box-shadow: 0 6px 24px -14px rgba(0,0,0,.5); }
.mainnav a { transition: background-color .2s, color .2s, transform .2s var(--ease-out); }
.mainnav a:not(.active):hover { transform: translateY(-1px); }
.badge { animation: pop-in .4s var(--ease-spring) both; }
#app.calm .badge { animation: none; }

/* Buttons respond to being pressed */
button, .btn { transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .12s; }
button:active:not(:disabled), .btn:active { transform: scale(.97); }
button.primary, .btn.primary { box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
button.primary:hover, .btn.primary:hover { box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
input, select, textarea { transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }

/* Switching pages: a quick, gentle fade. No sliding and no cascades, which felt dizzying. */
.main, .public-inner > *, .waiting { animation: fade-in .18s ease-out both; }
img { animation: fade-in .25s ease both; }

/* Progress and budget bars fill up */
.fill, .bar > span { transform-origin: left center; animation: grow .8s var(--ease-out) both; }
/* Bars fill only on the first page after signing in, not on every page switch */
#app.calm .fill, #app.calm .bar > span { animation: none; }

/* Pop-ups, photos and messages */
.modal-backdrop { animation: fade-in .2s ease both; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal { animation: pop-in .32s var(--ease-spring) both; }
.lightbox { animation: fade-in .2s ease both; }
.lightbox img { animation: zoom-in .35s var(--ease-out) both; }
#toast { transition: opacity .25s, transform .35s var(--ease-spring); border-radius: 12px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.4); }
.notice { animation: fade-in .25s ease both; }

/* Thin loading bar at the very top while the server answers */
#loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .3s; overflow: hidden; }
#loadbar::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--brand), transparent); }
#loadbar.on { opacity: 1; }
#loadbar.on::before { animation: slide 1.1s ease-in-out infinite; }

/* Sign-in page: drifting blueprint grid and a soft glow */
.login-pitch { position: relative; overflow: hidden; isolation: isolate; }
.login-pitch::before {
  content: ""; position: absolute; inset: -60px; z-index: -1; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: drift 24s linear infinite;
}
.login-pitch::after {
  content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -160px; top: -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,180,41,.28), transparent 65%);
  animation: float 12s ease-in-out infinite alternate;
}
.login-pitch > * { animation: rise .6s var(--ease-out) both; }
.login-pitch > *:nth-child(2) { animation-delay: .06s; }
.login-pitch > *:nth-child(3) { animation-delay: .12s; }
.login-pitch > *:nth-child(4) { animation-delay: .18s; }
.login-pitch > *:nth-child(5) { animation-delay: .26s; }
.login-pitch > *:nth-child(n+6) { animation-delay: .34s; }
.pitch-points div { transition: transform .25s var(--ease-out), background-color .25s, border-color .25s; }
.pitch-points div:hover { transform: translateY(-3px); background: rgba(255,255,255,.1); border-color: rgba(240,180,41,.45); }
.login-card { animation: pop-in .5s var(--ease-spring) .15s both; box-shadow: 0 2px 6px rgba(23,32,51,.05), 0 30px 60px -30px rgba(23,32,51,.35); }

/* Big screen: a gentle "live" dot by the clock */
.board-clock #board-time::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; margin-right: 10px; vertical-align: middle; animation: live 2s ease-in-out infinite; }
#app.quiet *, #app.quiet *::before { animation: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(40px, 40px, 0); } }
@keyframes float { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-60px, 50px, 0) scale(1.1); } }
@keyframes live { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

/* Respect the "reduce motion" setting on phones and computers */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- subscription reminder (CEO and secretary) */
.billing-banner { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 20px; font-size: 14px; text-align: center; }
.billing-banner.due_soon { background: var(--warn-soft); color: var(--warn); }
.billing-banner.overdue { background: var(--bad-soft); color: var(--bad); }
.billing-banner a { font-weight: 600; color: inherit; text-decoration: underline; }

/* ---------- link to pass on (invitations, password resets) */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font: 13px var(--font-mono); }

/* ---------- issues flagged from site */
.flag-box { background: var(--bad-soft); border: 1px solid #f5c2ba; border-left: 6px solid var(--bad); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 26px; }
.flag-box h2 { font: 700 19px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .02em; color: var(--bad); margin-bottom: 10px; }
.flag-item { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid #f5c2ba; }
.flag-item:first-of-type { border-top: 0; padding-top: 0; }
.flag-line { margin-top: 8px; display: inline-flex; gap: 10px; align-items: center; color: var(--bad); font-weight: 600; font-size: 13px; }
.flag-line.done { color: var(--muted); font-weight: 400; }

/* ---------- unit prices and delivered quantities inside forms */
.price-table { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; background: var(--surface-2); }
.price-table table { width: 100%; border-collapse: collapse; }
.price-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.price-table td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.price-table td + td, .price-table th + th { padding-left: 12px; }
.price-table input { width: 100%; }
.bar.money.near > span { background: var(--brand); }
.bar.money.over > span { background: var(--bad); }
.row-link-tr { cursor: pointer; }
.row-link-tr:hover td { background: var(--surface-2); }

/* ---------- IT manager: data tools */
.data-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 22px; }
.data-actions p { margin: 4px 0 10px; }
.data-actions button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- board: rotating spotlight, project strip, photo of the day */
.board-body.spot-layout { grid-template-columns: minmax(0, 1fr) 380px; padding-bottom: 12px; }
.spotlight { min-height: 0; }
.spotlight.spot-in .spot { animation: spot-in .7s ease-out both; }
@keyframes spot-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spot { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-top: 8px solid var(--ok); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); height: 100%; min-height: 470px; }
.spot.sched-trend { border-top-color: var(--brand); }
.spot.sched-over { border-top-color: var(--bad); }
.spot-photo { position: relative; background: var(--surface-2); }
.spot-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-photo-cap { position: absolute; left: 14px; bottom: 14px; background: rgba(15, 26, 54, .75); color: #fff; padding: 5px 12px; border-radius: 99px; font-size: 15px; }
.spot-nophoto { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); font-size: 18px; }
.spot-nophoto svg { width: 64px; height: 64px; opacity: .4; }
.spot-info { padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; }
.spot-info .pcode { font-size: 16px; }
.spot-name { font: 700 46px/1.02 var(--font-head); text-transform: uppercase; letter-spacing: .01em; }
.spot-sub { color: var(--muted); font-size: 19px; }
.spot-progress { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.spot-progress b { font: 700 64px/1 var(--font-head); }
.spot-progress span { color: var(--muted); font-size: 18px; }
.track.big { height: 22px; }
.spot .bt-pills .pill { font-size: 16px; padding: 5px 12px; }
.spot-stages h3 { font: 700 17px/1 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 8px; }
.spot-stage { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 54px; gap: 12px; align-items: center; font-size: 17px; padding: 4px 0; }
.spot-stage .track { height: 10px; }
.spot-stage b { text-align: right; }
.board-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; padding: 0 36px 48px; }
.strip-tile { display: grid; gap: 8px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ok); border-radius: 12px; padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer; transition: box-shadow .2s, transform .2s; }
.strip-tile.sched-trend { border-left-color: var(--brand); }
.strip-tile.sched-over { border-left-color: var(--bad); }
.strip-tile.on { box-shadow: 0 0 0 3px var(--brand); }
.strip-name { font: 700 18px/1.1 var(--font-head); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-tile .track { height: 8px; display: block; }
.strip-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.ok-dot { color: var(--ok); font-weight: 600; }
.warn-dot { color: var(--warn); font-weight: 600; }
.pod { margin-bottom: 26px; }
.pod img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; display: block; border: 1px solid var(--line); }
.pod-cap { margin-top: 8px; color: var(--muted); font-size: 15px; }
@media (max-width: 1100px) {
  .board-body.spot-layout { grid-template-columns: 1fr; }
  .spot { grid-template-columns: 1fr; }
  .spot-photo { min-height: 280px; }
  .board-strip { padding: 0 18px 48px; }
}
@media (max-width: 560px) {
  .spot-name { font-size: 32px; }
  .spot-progress b { font-size: 46px; }
  .spot-info { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .spotlight.spot-in .spot { animation: none; }
}

/* ---------- company branding: own sign-in page, logo in the header, "Powered by Onsite" */
.co-brand { gap: 12px; }
.co-brand > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.co-logo { display: inline-grid; place-items: center; height: 40px; padding: 4px 8px; background: #fff; border-radius: 8px; flex: none; }
.co-logo img { max-height: 32px; max-width: 120px; display: block; }
.co-logo.lg { height: 64px; padding: 6px 10px; border-radius: 12px; }
.co-logo.lg img { max-height: 52px; max-width: 160px; }
.co-initials { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font: 700 17px/1 var(--font-head); flex: none; }
.co-initials.lg { width: 56px; height: 56px; border-radius: 12px; font-size: 26px; }
.co-initials.xl { width: 84px; height: 84px; border-radius: 18px; font-size: 38px; }
.brand.dark.co-brand .co-logo { border: 1px solid var(--line); }

.site-footer.powered { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.powered-by { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none !important; }
.powered-by .brand-mark { width: 20px; height: 20px; border-radius: 5px; background: #f0b429; }
.powered-by .brand-mark svg { width: 13px; height: 13px; color: #16244a; }
.powered-by strong { color: var(--ink); }
.board .board-brand .co-initials, .board .board-brand .co-logo { box-shadow: none; }

.logo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.logo-preview { width: 140px; height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; }
.logo-preview img { max-width: 120px; max-height: 76px; object-fit: contain; }

/* ---------- welcome tour (once per role) */
#tour { position: fixed; inset: 0; z-index: 200; animation: fade-in .25s ease-out both; }
#tour.out { opacity: 0; transition: opacity .2s; }
.tour-shade { position: absolute; inset: 0; background: rgba(15, 26, 54, .55); }
.tour-ring { position: absolute; border-radius: 10px; box-shadow: 0 0 0 3px var(--brand), 0 0 0 9999px rgba(15, 26, 54, .55);
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; pointer-events: none; }
.tour-card { position: absolute; width: min(360px, calc(100vw - 24px)); background: var(--surface); color: var(--ink);
  border-radius: 14px; padding: 18px 18px 14px; box-shadow: 0 18px 50px rgba(15, 26, 54, .35); border-top: 5px solid var(--brand); }
.tour-card.center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-card.bottom { left: 12px; right: 12px; bottom: 16px; width: auto; }
.tour-card.top { left: 12px; right: 12px; top: 12px; width: auto; }
.tour-card h2 { font: 700 21px/1.15 var(--font-head); text-transform: uppercase; letter-spacing: .02em; margin: 2px 0 8px; }
.tour-card p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.tour-count { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tour-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots i.on { background: var(--brand); width: 18px; border-radius: 4px; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-foot .actions { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) {
  #tour, .tour-ring, .tour-card { animation: none; transition: none; }
}

/* ---------- schedule (timeline) */
.gantt { padding: 6px 0 12px; overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: minmax(180px, 260px) minmax(560px, 1fr); align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.gantt-row.stage { min-height: 34px; background: var(--surface-2); }
.gantt-row.stage .gantt-label { padding-left: 34px; font-size: 13px; }
.gantt-head { min-height: 34px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.gantt-label { padding: 6px 14px 6px 18px; font-size: 14px; font-weight: 600; min-width: 0; }
.gantt-label a { color: var(--ink); }
.gantt-label .small { font-weight: 400; }
.gantt-track { position: relative; height: 100%; min-height: inherit; }
.gantt-month { position: absolute; top: 9px; font-size: 12px; color: var(--muted); padding-left: 6px; white-space: nowrap; }
.gantt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bad); opacity: .55; z-index: 1; }
.gantt-bar { position: absolute; top: 50%; height: 16px; margin-top: -8px; border-radius: 99px; background: var(--track); border: 1px solid #c9d1de; overflow: visible; }
.gantt-row.stage .gantt-bar { height: 10px; margin-top: -5px; }
.gantt-fill { display: block; height: 100%; border-radius: 99px; background: var(--info); }
.gantt-bar.done .gantt-fill { background: var(--ok); }
.gantt-bar.late { border-color: var(--bad); }
.gantt-bar.late .gantt-fill { background: var(--bad); }
.gantt-planned { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; opacity: .6; }
.gantt-nodates { position: absolute; top: 50%; transform: translateY(-50%); left: 8px; font-size: 12px; color: var(--muted); }
.gantt-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 18px 0; }
.gantt-legend .lg { display: inline-block; width: 14px; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.lg.fill { background: var(--info); } .lg.late { background: var(--bad); } .lg.today { width: 2px; height: 12px; background: var(--bad); opacity: .55; } .lg.planned { width: 3px; height: 12px; background: var(--ink); opacity: .6; }
.change-facts { display: flex; gap: 14px; font-weight: 600; margin-top: 4px; }

/* ---------- offline: bar, outbox */
#offline-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; background: #3a2a05; color: #fde7a8; text-align: center; font-size: 13px; padding: 9px 16px; }
.outbox-pill { margin-left: auto; background: var(--brand); color: var(--on-brand); border: 0; border-radius: 99px; padding: 5px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.outbox-pill.bad { background: var(--bad); color: #fff; }
.outbox-pill[hidden] { display: none; }  /* the button style would otherwise override [hidden] */
.outbox-pill + .who { margin-left: 12px; }
.outbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.outbox-list li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
