/* ==========================================================================
   Flex Raports – design system
   Site logbook for a tower-section installation crew.
   Steel blue from the FLEXWIND logo, concrete greys, one signal colour
   (hi-vis orange) reserved for "missing" / warnings. Manrope = soft geometric type.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts (self-hosted Manrope variable, OFL) */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/manrope-latin-wght-normal.woff2?v=02c7fd8d99") format("woff2-variations"), url("/fonts/manrope-latin-wght-normal.woff2?v=02c7fd8d99") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/manrope-latin-ext-wght-normal.woff2?v=02c7fd8d99") format("woff2-variations"), url("/fonts/manrope-latin-ext-wght-normal.woff2?v=02c7fd8d99") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------------------------------------------------------------- tokens */
:root {
  /* premium: ink navy rail, airy cool canvas, steel-blue accent from the FLEXWIND logo */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #e9edf3;
  --border: #e3e8ef;
  --border-strong: #c9d2de;
  --text: #0d1726;
  --text-2: #344255;
  --muted: #5d6b7e;
  --accent: #2a62a3;
  --accent-strong: #1e4d85;
  --accent-soft: #e8f0fa;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(180deg, #3574bd 0%, #2a62a3 100%);
  --signal: #b4480e;
  --signal-fill: #ea6a1f;
  --signal-soft: #fdf0e6;
  --ok: #17734a;
  --ok-soft: #e4f4ec;
  --danger: #b4231b;
  --danger-soft: #fdecea;
  --mark: #ffe39a;
  --break: #c9d2de;
  --rail: #0c1828;
  --rail-2: #13233a;
  --rail-text: #c9d6e6;
  --rail-muted: #8ea2bb;
  --shadow-sm: 0 1px 2px rgba(13, 23, 38, .05);
  --shadow: 0 1px 2px rgba(13, 23, 38, .04), 0 4px 12px -2px rgba(13, 23, 38, .06), 0 12px 32px -12px rgba(13, 23, 38, .10);
  --shadow-lift: 0 2px 4px rgba(13, 23, 38, .05), 0 12px 28px -8px rgba(13, 23, 38, .16);
  --shadow-pop: 0 24px 60px -20px rgba(13, 23, 38, .45);
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sidebar: 260px;
  --topbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b131e; --surface: #111c2a; --surface-2: #162333; --surface-3: #1e2d40; --border: #213248; --border-strong: #31455f;
    --text: #e8eef5; --text-2: #c4d0dd; --muted: #92a2b6; --accent: #8cb6e8; --accent-strong: #b3cff1; --accent-soft: #17283d; --accent-ink: #08121e;
    --accent-grad: linear-gradient(180deg, #a1c4ee 0%, #8cb6e8 100%);
    --signal: #ffa36a; --signal-fill: #f9853c; --signal-soft: #36231a; --ok: #78d6a4; --ok-soft: #14301f; --danger: #ff8f84; --danger-soft: #38191a;
    --mark: #6b5414; --break: #31455f; --rail: #070e17; --rail-2: #0f1b2b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -12px rgba(0,0,0,.55); --shadow-lift: 0 14px 34px -10px rgba(0,0,0,.65); --shadow-pop: 0 24px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b131e; --surface: #111c2a; --surface-2: #162333; --surface-3: #1e2d40; --border: #213248; --border-strong: #31455f;
  --text: #e8eef5; --text-2: #c4d0dd; --muted: #92a2b6; --accent: #8cb6e8; --accent-strong: #b3cff1; --accent-soft: #17283d; --accent-ink: #08121e;
  --accent-grad: linear-gradient(180deg, #a1c4ee 0%, #8cb6e8 100%);
  --signal: #ffa36a; --signal-fill: #f9853c; --signal-soft: #36231a; --ok: #78d6a4; --ok-soft: #14301f; --danger: #ff8f84; --danger-soft: #38191a;
  --mark: #6b5414; --break: #31455f; --rail: #070e17; --rail-2: #0f1b2b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -12px rgba(0,0,0,.55); --shadow-lift: 0 14px 34px -10px rgba(0,0,0,.65); --shadow-pop: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: rgba(44, 93, 143, .15); font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 700; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, select, textarea, label, summary { touch-action: manipulation; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus { scroll-margin-top: calc(var(--topbar-h) + 16px); scroll-margin-bottom: 96px; }
::selection { background: var(--accent-soft); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; text-align: center; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 24px; height: 24px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: calc(12px + var(--safe-t)); }

/* ---------------------------------------------------------------- boot */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-logo { width: 56px; height: 56px; border-radius: var(--r-lg); background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .6; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary, .btn.brand { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, .btn.brand:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.icon-only { width: 44px; padding: 0; }
.btn.sm.icon-only { width: 36px; }
.btn.block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-inline { width: 16px; height: 16px; border: 2px solid var(--muted); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 13px; border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); outline: none; font-size: 16px; /* 16px = no iOS zoom */
  transition: border-color .15s, box-shadow .15s;
}
select.input { appearance: auto; background-color: var(--surface); color: var(--text); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid, .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.input-icon .clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 50px; }
.pw-wrap .toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.hint { font-size: 13.5px; color: var(--muted); }
.form-error { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-size: 15px; font-weight: 600; border-left: 4px solid var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px; }
.grid-crew { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.lg { gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; min-width: 0; }
.spacer-16 { height: 16px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; width: var(--sidebar); flex: none; display: flex; flex-direction: column;
  padding: 20px 12px 14px; border-right: 1px solid var(--border); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent); display: grid; place-items: center; color: #fff; flex: none; overflow: hidden; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark.logo { background: #fff; padding: 3px; border: 1px solid var(--border); }
.brand-mark.logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark.full { width: 132px; height: 132px; border-radius: 26px; padding: 8px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.1; }
.brand-sub { font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text-2);
  font-weight: 600; font-size: 15.5px; text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-item .badge-slot { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); color: inherit; text-decoration: none; }
.me-card:hover { border-color: var(--accent); }
.me-name { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.me-role { font-size: 13px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13.5px;
  color: #fff; background: var(--av, #2c5d8f); letter-spacing: .02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 32px 64px; }
.content.narrow { max-width: 780px; }
.content.full { max-width: none; padding: 0; height: 100dvh; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.eyebrow::first-letter { text-transform: uppercase; }
.bottom-nav { display: none; }

/* ---------------------------------------------------------------- cards & small parts */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; min-height: 92px; }
.stat { padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--accent); }
.stat-ic { color: var(--accent); flex: none; margin-top: 3px; }
.stat-ic .icon { width: 22px; height: 22px; }
.stat-ic.amber { color: var(--signal); }
.stat-ic.sky { color: var(--accent); }
.stat > div:last-child { flex: 1; min-width: 0; }
.stat-val { font-family: var(--font-head); font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-of { font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--muted); }
.stat-label { font-size: 14px; color: var(--muted); }
.stat .bar { margin-top: 8px; width: 100%; }
.stat.skeleton { border-style: dashed; background: transparent; min-height: 92px; }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge.amber { background: var(--signal-soft); color: var(--signal); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.success { background: var(--ok-soft); color: var(--ok); }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--signal-fill); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 14.5px; font-weight: 500; cursor: pointer; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips + .spacer-16 { height: 8px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon-wrap { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .row { justify-content: center; margin-top: 16px; }

/* day bar – the hours of a day on a 06:00–20:00 axis (the app's signature element) */
.daybar { position: relative; height: 10px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.daybar > span { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.daybar > span.brk { background: var(--break); }
.daybar > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--surface); opacity: .9; }
.daybar.lg { height: 14px; border-radius: 4px; }
.daybar-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar .field { min-width: 140px; }
.searched { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); margin: -4px 0 16px; }
.searched b { color: var(--text-2); font-weight: 600; }

/* ---------------------------------------------------------------- report list */
.month { display: flex; justify-content: space-between; font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--text-2); margin: 24px 2px 10px; }
.month::first-letter { text-transform: uppercase; }
.month:first-child { margin-top: 0; }
.report-list { display: flex; flex-direction: column; gap: 8px; }
.report-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 12px 16px 12px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none;
  content-visibility: auto; contain-intrinsic-size: auto 92px; transition: border-color .15s;
}
.report-item:hover { border-color: var(--accent); }
.report-item .meta { min-width: 0; }
.date-tile { width: 56px; height: 60px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.date-tile .d { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.date-tile .m { font-size: 12.5px; font-weight: 600; color: var(--accent-strong); }
.date-tile .w { font-size: 12px; color: var(--muted); }
.ri-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.ri-lines { margin-top: 2px; font-size: 14.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ri-hours { text-align: right; }
.ri-hours .h { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1; }
.ri-hours .l { font-size: 13px; color: var(--muted); }
.list-skeleton { height: 84px; border-radius: var(--r-md); border: 1px dashed var(--border); margin-bottom: 8px; }

/* ---------------------------------------------------------------- team today */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.person { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; }
.person:hover { border-color: var(--accent); }
.person .meta { min-width: 0; flex: 1; }
.person .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ---------------------------------------------------------------- report editor */
.editor { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.entries { display: flex; flex-direction: column; gap: 8px; }
.entry {
  display: grid; grid-template-columns: 76px 12px 76px minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center;
  padding: 8px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
}
.entry .dash { text-align: center; color: var(--muted); }
.entry .input { min-height: 44px; background: var(--surface); }
.entry .t { text-align: center; padding: 8px 6px; }
.entry.invalid { border-color: var(--danger); border-left: 4px solid var(--danger); }
.entry-dur { font-size: 13px; color: var(--muted); min-width: 52px; text-align: right; }
.entry .cam { position: relative; gap: 4px; padding: 0 8px; }
.entry .cam-n { font-size: 12px; font-weight: 600; color: var(--accent-strong); }
.entry-photos { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface-3); display: grid; place-items: center; }
.thumb-img { all: unset; cursor: zoom-in; width: 100%; height: 100%; display: block; }
.thumb-img img, .doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(12, 18, 26, .78); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb-x .icon { width: 14px; height: 14px; }
.entries-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.total { display: flex; align-items: baseline; gap: 8px; }
.total .v { font-family: var(--font-head); font-size: 28px; font-weight: 700; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sticky-side { position: sticky; top: 24px; }
.draft-note { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* report document (also the printed / PDF version) */
.doc { font-family: var(--font); }
.doc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 14px; border-bottom: 3px solid var(--accent); margin-bottom: 14px; }
.doc-head .brand-mark { width: 56px; height: 56px; border-radius: var(--r-md); }
.doc-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.doc-meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; font-size: 15px; margin-bottom: 14px; }
.doc-meta dt { color: var(--muted); }
.doc-meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.doc-table td.time { white-space: nowrap; font-weight: 600; width: 1%; }
.doc-table td.h { white-space: nowrap; text-align: right; color: var(--muted); width: 1%; }
.doc-total { display: flex; justify-content: flex-end; gap: 12px; padding: 12px 6px 0; font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.doc-notes { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border-left: 4px solid var(--border-strong); white-space: pre-wrap; font-size: 15px; }
.doc-notes b { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.doc-empty { color: var(--muted); font-size: 15px; padding: 18px 0; text-align: center; }
.doc-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.doc-thumb { all: unset; cursor: zoom-in; width: 88px; height: 66px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.doc-thumb:focus-visible, .thumb-img:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.doc .daybar { margin: 0 0 14px; }

/* ---------------------------------------------------------------- chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head .stat-ic { margin: 0; }
.chat-head h2 { font-size: 20px; }
.chat-search { padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 24px 12px; overscroll-behavior: contain; }
.chat-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 2px; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 82%; margin-top: 8px; }
.msg.cont { margin-top: 2px; }
.msg.cont .avatar { visibility: hidden; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg.mine .avatar { display: none; }
.bubble { position: relative; padding: 8px 13px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.msg:not(.mine) .bubble { border-bottom-left-radius: 4px; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.mine mark { background: rgba(255, 255, 255, .35); }
.bubble .who { font-size: 13.5px; font-weight: 600; color: var(--av, var(--accent)); margin-bottom: 1px; }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .time { font-size: 12px; opacity: .75; text-align: right; margin-top: 2px; }
.bubble .del { position: absolute; top: -12px; right: -12px; display: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--danger); cursor: pointer; place-items: center; }
.msg:hover .bubble .del, .bubble:focus-within .del { display: grid; }
.composer { padding: 12px 24px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.composer-inner { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 46px; max-height: 160px; resize: none; border-radius: 22px; padding: 11px 16px; }
.composer .btn { border-radius: 50%; width: 46px; height: 46px; min-height: 46px; padding: 0; flex: none; }
.result { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; }
.result .top { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.result .top b { color: var(--text); }
.result .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.load-more { align-self: center; margin: 4px 0 10px; }

/* ---------------------------------------------------------------- AI assistant */
.ai-hero { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--surface); margin-bottom: 16px; }
.ai-hero .meta { min-width: 0; }
.ai-orb { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-strong); flex: none; }
.ai-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.ai-msg { max-width: 88%; }
.ai-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: 11px 15px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.bot { align-self: flex-start; width: 100%; max-width: 680px; }
.ai-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; overflow: hidden; }
.ai-card .say { padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 15px; }
.ai-card pre { margin: 0; padding: 14px 16px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: var(--font); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-card .acts { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; align-items: center; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-input { position: sticky; bottom: 0; padding: 12px 0 calc(8px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.ai-input .card { padding: 8px; display: flex; gap: 10px; align-items: flex-end; }
.ai-input textarea { border: 0; box-shadow: none !important; min-height: 48px; max-height: 220px; resize: none; background: transparent; }

/* ---------------------------------------------------------------- admin */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 11px 14px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.card .tabs { border-bottom: 0; margin: 0; gap: 4px; }
.card .tab { border: 1px solid var(--border); border-radius: var(--r-md); margin: 0; flex: 1; justify-content: center; }
.card .tab.active { background: var(--accent-soft); border-color: var(--accent); }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .meta { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-row .sub { font-size: 14px; color: var(--muted); }
.list-row.off { opacity: .62; }
.syn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.audit-row { display: grid; grid-template-columns: 150px 170px 1fr; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.audit-row .when { color: var(--muted); }
.secret { font-family: var(--mono); font-size: 21px; font-weight: 700; letter-spacing: .04em; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--border-strong); text-align: center; user-select: all; }

/* password strength */
.reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.req { display: flex; align-items: center; gap: 6px; }
.req .icon { width: 15px; height: 15px; }
.req.ok { color: var(--ok); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.meter span { height: 5px; border-radius: 3px; background: var(--surface-3); transition: background-color .2s; }
.meter[data-s="1"] span:nth-child(-n+1) { background: var(--danger); }
.meter[data-s="2"] span:nth-child(-n+2) { background: var(--signal-fill); }
.meter[data-s="3"] span:nth-child(-n+3) { background: var(--accent); }
.meter[data-s="4"] span { background: var(--ok); }

/* ---------------------------------------------------------------- login */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; color: #e9f0f7;
  /* evening sky over the site: steel blue fading to the horizon */
  background: linear-gradient(180deg, #13263b 0%, #1f3d5c 62%, #3a6489 100%);
}
.auth-hero > .brand, .auth-hero .hero-copy { position: relative; z-index: 1; }
.auth-hero .brand-name { color: #fff; }
.auth-hero .brand-sub { color: #b9cadb; }
.hero-copy h1 { font-size: 48px; line-height: 1.02; color: #fff; max-width: 460px; }
.hero-copy p { margin-top: 14px; color: #c6d4e2; font-size: 17px; max-width: 430px; }
.hero-feats { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 24px; padding: 0; list-style: none; }
.hero-feats span { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: #dde7f1; }
.turbines { position: absolute; right: -10px; bottom: 0; width: 440px; max-width: 55%; pointer-events: none; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 30px; }
.auth-card .lead { color: var(--muted); margin: 6px 0 24px; }
.auth-foot { margin-top: 24px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.auth-mobile-brand { display: none; }

/* ---------------------------------------------------------------- dialogs & toasts */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); overscroll-behavior: contain; }
dialog.modal::backdrop { background: rgba(8, 13, 20, .6); }
dialog.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
dialog.modal.lightbox { width: min(980px, calc(100vw - 24px)); }
.lb-img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--r-md); background: #000; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 22px 20px; flex-wrap: wrap; }
#toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 440px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: #18232f; color: #f1f5f9; box-shadow: var(--shadow-pop); font-size: 15px; font-weight: 600; animation: toast-in .2s ease-out; transition: opacity .3s; }
.toast.err { background: #8c1c13; }
.toast.ok .icon { color: #8fe0ae; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); font-size: 15px; background: var(--signal-soft); color: var(--signal); font-weight: 600; border-left: 4px solid var(--signal-fill); }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; text-align: center; font-size: 14px; font-weight: 600; padding: calc(6px + var(--safe-t)) 12px 6px; background: var(--signal-fill); color: #fff; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; min-height: var(--topbar-h);
    padding: calc(9px + var(--safe-t)) 16px 9px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .topbar .brand-mark { width: 36px; height: 36px; }
  .topbar .title { font-family: var(--font-head); font-weight: 700; font-size: 20px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar a.mob { display: block; border-radius: 50%; }
  .content { padding: 18px 16px calc(100px + var(--safe-b)); }
  .content.full { height: calc(100dvh - var(--topbar-h) - var(--safe-t)); padding-bottom: 0; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 27px; }
  .page-head .desk { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--border);
  }
  .bn-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; min-height: 52px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .bn-item .icon { width: 24px; height: 24px; }
  .bn-item.active { color: var(--accent-strong); }
  .bn-item .ic { padding: 3px 16px; border-radius: 999px; transition: background-color .15s; }
  .bn-item.active .ic { background: var(--accent-soft); }
  .bn-item .count { position: absolute; top: 0; left: calc(50% + 6px); }
  .chat .composer { padding-bottom: calc(10px + 74px + var(--safe-b)); }
  .chat-head { display: none; }
  .chat-search, .chat-scroll { padding-left: 14px; padding-right: 14px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .msg { max-width: 90%; }
  .ai-input { bottom: calc(70px + var(--safe-b)); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; justify-content: center; margin-bottom: 18px; }
  .auth-panel { align-items: start; padding-top: calc(36px + var(--safe-t)); }
  .fab { position: fixed; right: 16px; bottom: calc(86px + var(--safe-b)); z-index: 25; min-height: 54px; padding: 0 20px; border-radius: 27px; box-shadow: var(--shadow-pop); }
}
@media (min-width: 901px) { .fab { display: none; } .mob { display: none !important; } }
@media (max-width: 640px) {
  h1 { font-size: 27px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .stat { padding: 12px 14px; }
  .stat-val { font-size: 24px; }
  .grid-2, .grid-3, .grid-crew { grid-template-columns: 1fr; }
  .report-item { grid-template-columns: 50px 1fr auto; gap: 12px; padding: 10px 12px 10px 10px; }
  .date-tile { width: 50px; height: 56px; }
  .date-tile .d { font-size: 21px; }
  .ri-hours .h { font-size: 22px; }
  .entry { grid-template-columns: 1fr 12px 1fr auto auto; }
  .entry .ts { grid-column: 1; grid-row: 1; }
  .entry .dash { grid-column: 2; grid-row: 1; }
  .entry .te { grid-column: 3; grid-row: 1; }
  .entry .entry-dur { grid-column: 4 / 6; grid-row: 1; }
  .entry .act { grid-column: 1 / 4; grid-row: 2; }
  .entry .cam { grid-column: 4; grid-row: 2; }
  .entry .rm { grid-column: 5; grid-row: 2; justify-self: end; }
  .entry-photos { grid-row: 3; }
  .thumb { width: 84px; height: 84px; }
  .audit-row { grid-template-columns: 1fr; gap: 2px; }
  .reqs { grid-template-columns: 1fr; }
  .card.pad, .card-body { padding: 16px; }
  .list-row { padding: 12px 16px; flex-wrap: wrap; }
  .list-row .acts { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .toolbar .field { min-width: 0; flex: 1 1 130px; }
  .ai-msg { max-width: 100%; }
}

/* ---------------------------------------------------------------- today summary (supervisor) */
.today-summary { display: grid; gap: 6px; margin: -8px 0 20px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.ts-row { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: baseline; }
.ts-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.ts-row.ok .ts-label { color: var(--ok); }
.ts-row.miss .ts-label { color: var(--signal); }
.ts-people { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; }
.who-code { font-weight: 600; letter-spacing: .02em; }
@media (max-width: 640px) { .ts-row { grid-template-columns: 1fr; gap: 2px; } }
/* dark theme: crew colours are dark – lighten names on dark bubbles */
:root[data-theme="dark"] .bubble .who { color: color-mix(in srgb, var(--av) 45%, #ffffff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble .who { color: color-mix(in srgb, var(--av) 45%, #ffffff); } }
.doc .daybar-axis { margin-bottom: 14px; }
/* never let long chips / inputs force horizontal scrolling */
.editor, .editor > * { min-width: 0; }
@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.chip { max-width: 100%; }
@media (max-width: 640px) { .chip { white-space: normal; text-align: left; line-height: 1.25; padding-top: 7px; padding-bottom: 7px; } }
.person { align-items: flex-start; }
.person .name { white-space: normal; overflow: visible; line-height: 1.25; }
.person .row.between { align-items: flex-start; }

/* ================================================================ premium layer */
body { font-size: 15.5px; line-height: 1.55; letter-spacing: -0.003em; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4 { font-weight: 750; letter-spacing: -0.022em; }
h1 { font-size: 34px; line-height: 1.12; }
h2 { font-size: 21px; }
h3 { font-size: 16.5px; letter-spacing: -0.012em; }
.muted, .hint, .stat-label, .page-head .sub { letter-spacing: 0; }

/* ink-navy sidebar rail */
.sidebar { background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%); border-right: 0; color: var(--rail-text); padding: 22px 14px 16px; }
.sidebar .brand { padding: 2px 8px 26px; }
.sidebar .brand-name { color: #fff; }
.sidebar .brand-sub { color: var(--rail-muted); }
.sidebar .brand-mark.logo { border: 0; box-shadow: 0 6px 18px -6px rgba(0,0,0,.6); }
.sidebar .nav { gap: 4px; }
.sidebar .nav-item { color: var(--rail-text); font-weight: 600; font-size: 14.5px; padding: 11px 14px; border-radius: 12px; transition: background-color .18s, color .18s; }
.sidebar .nav-item .icon { opacity: .85; }
.sidebar .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-item.active { background: rgba(140,182,232,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(140,182,232,.22); }
.sidebar .nav-item.active .icon { opacity: 1; color: #a9cbf2; }
.sidebar .nav-item.active::before { display: none; }
.sidebar .me-card { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); color: #fff; }
.sidebar .me-card:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); }
.sidebar .me-role { color: var(--rail-muted); }
.sidebar :focus-visible { outline-color: #a9cbf2; }

/* canvas & content */
.content { padding: 40px 44px 72px; }
.page-head { margin-bottom: 28px; }
.page-head .sub { font-size: 15.5px; margin-top: 6px; }
.eyebrow { font-size: 13.5px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }

/* surfaces */
.card { border-color: var(--border); box-shadow: var(--shadow); }
.card.pad { padding: 24px; }
.card-head { padding: 18px 24px; }
.card-body { padding: 24px; }

/* buttons */
.btn { border-radius: 12px; font-weight: 650; font-size: 14.5px; min-height: 44px; padding: 0 18px; box-shadow: var(--shadow-sm); border-color: var(--border); transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .08s; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn.primary, .btn.brand { background: var(--accent-grad); border-color: transparent; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px rgba(42,98,163,.55); }
.btn.primary:hover, .btn.brand:hover { background: var(--accent-strong); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 8px 20px -6px rgba(42,98,163,.6); }
.btn.ghost { box-shadow: none; }
.btn.sm { border-radius: 10px; min-height: 36px; }

/* inputs */
.input, textarea.input, select.input { border-radius: 12px; border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.input:hover { border-color: #b3bfcd; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field > label, .label { font-size: 13.5px; font-weight: 650; color: var(--text-2); }

/* stats */
.stats { gap: 16px; margin-bottom: 26px; }
.stat { padding: 18px 20px; border-radius: var(--r-lg); border-color: var(--border); box-shadow: var(--shadow); gap: 14px; align-items: center; }
a.stat { transition: box-shadow .2s, transform .2s, border-color .2s; }
a.stat:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); border-color: var(--border); }
.stat-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin: 0; background: var(--accent-soft); color: var(--accent); }
.stat-ic.amber { background: var(--signal-soft); color: var(--signal); }
.stat-val { font-size: 27px; font-weight: 750; letter-spacing: -0.025em; }
.stat-label { font-size: 13.5px; }
.stat.skeleton { box-shadow: none; }

/* badges & chips */
.badge { border-radius: 999px; padding: 0 10px; font-weight: 650; font-size: 12.5px; min-height: 24px; }
.chip { min-height: 38px; border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 550; font-size: 14px; transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); }

/* report list */
.month { font-family: var(--font); font-size: 15px; font-weight: 750; letter-spacing: -0.01em; color: var(--text); margin: 28px 4px 12px; }
.month .tnum { color: var(--muted); font-weight: 650; }
.report-list { gap: 10px; }
.report-item { border-radius: 16px; padding: 14px 20px 14px 14px; border-color: var(--border); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.report-item:hover { border-color: var(--border); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.date-tile { border-radius: 12px; border: 0; background: var(--accent-soft); height: 62px; }
.date-tile .d { font-family: var(--font); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.date-tile .m { color: var(--accent); font-weight: 700; font-size: 12px; }
.date-tile .w { font-size: 11.5px; }
.ri-title { font-weight: 700; letter-spacing: -0.01em; }
.ri-lines { font-size: 14px; }
.ri-hours .h { font-family: var(--font); font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.list-skeleton { border-radius: 16px; }

/* day bar – rounded segments */
.daybar { height: 8px; border-radius: 999px; background: var(--surface-3); margin-top: 10px; }
.daybar > span { border-radius: 999px; background: var(--accent-grad); }
.daybar > span.brk { background: var(--break); }
.daybar > i { background: var(--surface); opacity: .65; }
.daybar.lg { height: 12px; }

/* today summary */
.today-summary { border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 20px; gap: 8px; }
.ts-label { font-size: 13.5px; }
.who-code { font-weight: 700; letter-spacing: .01em; }

/* team / admin */
.person { border-radius: 16px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.person:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); border-color: var(--border); }
.bar { height: 6px; border-radius: 999px; }
.bar > span { background: var(--accent-grad); }
.tabs { border-bottom: 1px solid var(--border); gap: 6px; }
.tab { font-weight: 650; font-size: 14.5px; border-bottom-width: 2px; }
.list-row { padding: 16px 24px; }

/* editor */
.entry { border-radius: 14px; background: var(--surface-2); border-color: var(--border); }
.total .v { font-family: var(--font); font-weight: 800; letter-spacing: -0.03em; font-size: 26px; }
.thumb, .doc-thumb { border-radius: 10px; }

/* report document */
.doc-head { border-bottom: 0; padding-bottom: 16px; margin-bottom: 16px; position: relative; }
.doc-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--accent-grad); }
.doc-title { font-family: var(--font); font-weight: 800; letter-spacing: -0.025em; font-size: 22px; }
.doc-meta { font-size: 14.5px; gap: 4px 18px; }
.doc-meta dd { font-weight: 650; }
.doc-table td { padding: 10px 6px; }
.doc-total { font-family: var(--font); font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.doc-notes { border-radius: 12px; border-left-width: 3px; }

/* chat */
.chat-head, .chat-search, .composer { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.bubble { border-radius: 18px; box-shadow: var(--shadow-sm); padding: 9px 14px 7px; }
.msg.mine .bubble { background: var(--accent-grad); }
.composer textarea { box-shadow: var(--shadow-sm); }
.result { border-radius: 14px; box-shadow: var(--shadow-sm); }

/* AI */
.ai-hero { border-left-width: 1px; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 24px; background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 140%); }
.ai-orb { width: 50px; height: 50px; border-radius: 15px; background: var(--accent-grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(42,98,163,.6); }
.ai-card { border-radius: 18px 18px 18px 6px; box-shadow: var(--shadow); }
.ai-msg.user { background: var(--accent-grad); border-radius: 18px 18px 6px 18px; }
.ai-input .card { border-radius: 18px; box-shadow: var(--shadow-lift); }

/* login */
.auth-hero { background: radial-gradient(900px 520px at 85% 110%, rgba(53,116,189,.55), transparent 60%), linear-gradient(170deg, #0a1625 0%, #11243b 55%, #1b3a5e 100%); }
.hero-copy h1 { font-weight: 800; letter-spacing: -0.035em; font-size: 50px; line-height: 1.04; }
.hero-copy p { font-size: 16.5px; line-height: 1.6; }
.hero-feats span { font-size: 14px; font-weight: 600; color: #d3e0ee; }
.auth-panel { background: var(--bg); }
.auth-card { background: var(--surface); padding: 36px 32px; border-radius: 24px; box-shadow: var(--shadow-lift); border: 1px solid var(--border); }
.auth-card h2 { font-weight: 800; letter-spacing: -0.03em; font-size: 28px; }
.auth-foot { margin-top: 20px; }

/* modals & toasts */
dialog.modal { border-radius: 22px; }
dialog.modal::backdrop { background: rgba(8, 15, 26, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.toast { border-radius: 14px; }

/* mobile */
@media (max-width: 900px) {
  .content { padding: 20px 16px calc(104px + var(--safe-b)); }
  .topbar { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); }
  .topbar .title { font-family: var(--font); font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
  .bottom-nav { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); box-shadow: 0 -8px 24px -16px rgba(13,23,38,.25); }
  .bn-item { font-weight: 650; font-size: 11.5px; }
  .fab { background: var(--accent-grad); box-shadow: 0 12px 28px -10px rgba(42,98,163,.7); }
  .auth-card { padding: 26px 20px; border-radius: 20px; }
  .page-head h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  h1 { font-size: 28px; }
  .stat { padding: 14px; gap: 12px; }
  .stat-ic { width: 38px; height: 38px; border-radius: 11px; }
  .stat-val { font-size: 22px; }
  .report-item { padding: 12px 14px 12px 12px; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- print (report → PDF) */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --surface-3: #e6e6e6; --text: #000; --text-2: #111; --muted: #555; --border: #ccc; --accent: #2c5d8f; color-scheme: light; }
  body { background: #fff !important; font-size: 11pt; }
  .sidebar, .topbar, .bottom-nav, .no-print, #toasts, .fab, .offline-bar, .skip-link { display: none !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .card { border: 0 !important; }
  .card.pad { padding: 0 !important; }
  .doc-notes { background: none; border: 1px solid #ccc; }
  .doc-thumb { width: 120px; height: 90px; }
  .daybar > span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr 1fr; } .grid-3 > :first-child { grid-column: 1 / -1; } }
.today-summary.skeleton { min-height: 86px; border-style: dashed; background: transparent; }
@media (max-width: 640px) { .today-summary.skeleton { min-height: 170px; } }
.daybar > i { display: none; }
.entry-dur:empty { min-width: 0; }
.entry { grid-template-columns: 72px 10px 72px minmax(0, 1fr) auto auto auto; }
@media (max-width: 640px) { .entry { grid-template-columns: 1fr 12px 1fr auto auto; } }

/* ---------------------------------------------------------------- projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.project-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.project-card.off { opacity: .65; }
.pc-top { display: flex; gap: 14px; align-items: flex-start; }
.pc-top .meta { flex: 1; min-width: 0; }
.pc-top h3 { font-size: 17px; overflow-wrap: anywhere; }
.pc-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; flex: none; box-shadow: 0 8px 18px -8px rgba(42, 98, 163, .6); }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pc-val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.pc-foot { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.check:hover { background: var(--surface); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 640px) { .project-grid { grid-template-columns: 1fr; } }

/* AI assistant: with no conversation yet the input box is centred on the page */
.ai-page.ai-empty { min-height: calc(100dvh - 150px); display: flex; flex-direction: column; justify-content: center; }
.ai-page.ai-empty .ai-thread { display: none; }
.ai-page.ai-empty .ai-input { position: static; background: none; padding-top: 4px; }
.ai-page.ai-empty .ai-input textarea { min-height: 96px; }
@media (max-width: 900px) { .ai-page.ai-empty { min-height: calc(100dvh - var(--topbar-h) - 140px); } }
.section-title { flex-wrap: wrap; }
.section-title h3 { white-space: nowrap; }
@media (max-width: 640px) { .section-title .btn { width: 100%; white-space: normal; } }

/* chat photos */
.chat-pending{display:flex;gap:8px;flex-wrap:wrap;max-width:860px;margin:0 auto 8px}
.chat-pending .doc-thumb{position:relative}
.chat-pending .pend-x{position:absolute;top:-6px;right:-6px;width:22px;height:22px;border-radius:50%;border:0;background:var(--ink,#0f1b2d);color:#fff;display:grid;place-items:center;cursor:pointer;padding:0}
.bubble .doc-photos{margin:6px 0 2px}

/* ---------------------------------------------------------------- mobile polish (2026-11-15) */
.input { min-width: 0; max-width: 100%; }
/* iOS Safari: date/time inputs ignore width and push the layout sideways */
input[type="date"].input, input[type="time"].input, input[type="month"].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
html, body { overflow-x: hidden; }
.grid-2 > *, .grid-3 > *, .grid-crew > *, .field { min-width: 0; }
img, video { max-width: 100%; }
@media (max-width: 900px) {
  .content { padding-bottom: calc(160px + var(--safe-b)); }
  .bottom-nav { padding-left: 2px; padding-right: 2px; }
  .bn-item { font-size: 11px; letter-spacing: -.01em; white-space: nowrap; min-width: 0; }
  .bn-item .ic { padding: 3px 10px; }
  .fab { bottom: calc(84px + var(--safe-b)); }
  .modal { max-height: calc(100dvh - 24px); }
}
@media (max-width: 640px) {
  .tabs { gap: 0; }
  .tabs .tab { flex: 1 1 0; justify-content: center; padding: 10px 4px; font-size: 13.5px; gap: 5px; min-width: 0; white-space: nowrap; }
  .card .tabs .tab { padding: 9px 4px; }
  .page-head h1, h1, h2 { overflow-wrap: anywhere; }
  .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 380px) { .tabs .tab .icon { display: none; } }
.toolbar .field:has(> .input.hidden) { display: none; }
@media (max-width: 640px) {
  /* 5+ tabs do not fit – keep them scrollable, just tighter, with a fade hinting more */
  .tabs:not(.card .tabs) { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs:not(.card .tabs) .tab { flex: 0 0 auto; padding: 10px 11px; }
}
@media (max-width: 640px) {
  .toolbar:has(input[type="date"]) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .toolbar:has(input[type="date"]) > .field:has(select) { grid-column: 1 / -1; }
}
