/* Kuaka Timesheets. Hand-written CSS, no build step. Tokens and shared
   components are copied from the Kuaka Tasks app (task-app/src/app/globals.css),
   which is the source of truth for the look of both apps. Keep the two in step
   by copying from there, not by inventing here. */
:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #0f1011;
  --raised: #17181a;
  --border: #212224;
  --border-strong: #313335;
  --hover: #131415;
  --accent: #e65533;
  --accent-hover: #ff6a45;
  --accent-glow: 0 0 0 1px rgba(230,85,51,0.5), 0 4px 14px rgba(230,85,51,0.28);
  --text: #f5f5f6;
  --muted: #a1a1a6;
  --faint: #6b6b6f;
  --warning: #e0a83a;
  --danger: #ff5b3d;
  --success: #37c07f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Status pill dot colours, referenced by name from entries.status_dot_color. */
  --color-accent: var(--accent);
  --color-status-green: #4bb87a;
  --color-status-grey: #8a8f96;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f3f1; --surface: #ffffff; --raised: #ffffff; --border: #dedcd8; --border-strong: #c9c6c0;
    --hover: #ecebe8; --text: #17181a; --muted: #5c5c60; --faint: #9a9a9e;
    --accent-glow: 0 0 0 1px rgba(230,85,51,0.35), 0 4px 14px rgba(230,85,51,0.18);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3f1; --surface: #ffffff; --raised: #ffffff; --border: #dedcd8; --border-strong: #c9c6c0;
  --hover: #ecebe8; --text: #17181a; --muted: #5c5c60; --faint: #9a9a9e;
  --accent-glow: 0 0 0 1px rgba(230,85,51,0.35), 0 4px 14px rgba(230,85,51,0.18);
}
* { box-sizing: border-box; }
/* Safari runs transitions on page load (the closed drawer slid out across the
   top of every page, buttons faded in). drawer.js adds .ready after the first
   paint; until then nothing animates. */
html:not(.ready) *, html:not(.ready) *::before, html:not(.ready) *::after { transition: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* App shell */
.app-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 24px; border-bottom: 1px solid var(--border); position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { height: 24px; display: block; }
.brand-word { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.brand-sub { color: var(--muted); font-weight: 400; }
.app-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px; }
.app-nav a { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; text-decoration: none; }
.app-nav a:hover, .app-nav a.active { color: var(--accent); }
.app-nav a.active { border-bottom-color: var(--accent); }
.app-nav a:focus-visible, .btn:focus-visible, .seg button:focus-visible, .cust:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-content { padding: 32px clamp(16px, 4vw, 40px) 64px; max-width: 1680px; margin: 0 auto; }
/* Header search shares the nav link look: uppercase text, underline, no box. */
.search-form { display: inline-flex; align-items: baseline; }
.search-form input { width: 96px; background: none; border: 0; border-bottom: 2px solid var(--border-strong); border-radius: 0; padding: 0 0 2px; margin: 0; line-height: inherit; height: auto; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); transition: width .15s ease; -webkit-appearance: none; appearance: none; }
.search-form input:focus { width: 200px; outline: none; border-bottom-color: var(--accent); }
.search-form input::placeholder { color: var(--muted); }
mark { background: rgba(230,85,51,0.28); color: inherit; border-radius: 2px; padding: 0 1px; }

.app-nav .signout { background: none; border: 0; cursor: pointer; padding: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.app-nav .signout:hover { color: var(--accent); }
.login { max-width: 420px; margin: 64px auto; display: grid; gap: 16px; }
.login input { width: 100%; background: var(--raised); border: 1px solid var(--border-strong); border-radius: 4px; padding: 10px 12px; font-size: 15px; }
.login input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.danger-zone summary { color: var(--danger); }
.log-table td { font-size: 13px; }

/* Typography roles */
h1 { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.2; margin: 0; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.2; margin: 0; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { display: inline-block; border: 1px solid var(--border-strong); background: transparent; color: var(--text); border-radius: 4px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.2; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.btn:hover { border-color: var(--text); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--accent-glow); }
.btn.accent:hover { background: var(--accent-hover); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.flash, .btn.accent.flash { background: var(--success); border-color: var(--success); color: #08090a; box-shadow: none; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--raised); color: var(--text); }
.btn-outline-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); padding: 8px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.btn-outline-danger:hover { background: rgba(255,91,61,0.12); }
.btn-outline-danger.small { padding: 4px 10px; font-size: 12px; }
.btn-outline-danger:disabled { opacity: .45; cursor: default; }
/* Icon-only entry-row delete: borderless and muted at rest so it does not
   compete with Copy; destructive colour only on hover and focus. */
.delete-row-btn { width: 22px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; border-radius: 4px; cursor: pointer; }
.delete-row-btn:hover { background: rgba(255,91,61,0.12); color: var(--danger); }
.delete-row-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Page header row */
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.page-head .end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.2; border-radius: 4px; padding: 4px 8px; border: 1px solid; text-decoration: none; }
.badge.warn { color: var(--warning); border-color: var(--warning); background: rgba(224,168,58,0.12); }
.badge.danger { color: var(--danger); border-color: var(--danger); background: rgba(255,91,61,0.12); }
.badge.ok { color: var(--success); border-color: var(--success); background: rgba(55,192,127,0.12); }
a.badge:hover { text-decoration: underline; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 24px; margin-bottom: 32px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Dashboard customer cards */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 32px; }
.cust { display: block; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--cc, var(--border-strong)); border-radius: 6px; padding: 16px 20px; cursor: pointer; min-width: 0; text-decoration: none; }
.cust:hover { background: var(--hover); }
.cust.active { background: var(--raised); border-color: var(--border-strong); border-left-color: var(--cc, var(--border-strong)); }
.cust h2 { margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 12px; justify-content: start; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.bad b { color: var(--danger); }
.stat.warn b { color: var(--warning); }
.stat.ok b { color: var(--success); }
.stat.quiet b { color: var(--faint); }

/* Filter bar (same shape as the Tasks app's Updates page) */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 20px; margin-bottom: 24px; }
.filter-bar label { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.filter-bar select { background: var(--raised); border: 1px solid var(--border-strong); border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.filter-bar input[type="date"] { font-weight: 400; background: transparent; }
.filter-bar input[type="date"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
table.fixed { table-layout: fixed; }
table.fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.fixed td.wrap { white-space: normal; overflow-wrap: anywhere; }
/* Settings rows keep one height whether showing text or fields, so Edit never shifts the page. */
table.fixed td { height: 44px; }
tbody td.mono { font-size: 13px; }
tr.warn td { color: var(--danger); }
/* Entry tables (landing, customer timesheet). Fixed layout keyed off the
   header so every customer's table lines up; Description takes the rest. */
.entries-table { table-layout: fixed; }
.entries-table thead th:nth-child(1) { width: 155px; }
.entries-table thead th:nth-child(3) { width: 70px; }
.entries-table thead th:nth-child(4) { width: 150px; }
.entries-table thead th:nth-child(5) { width: 150px; }
.entries-table thead th:nth-child(6) { width: 200px; }
.entries-table td.desc { overflow-wrap: anywhere; }
.all-entries-table { table-layout: fixed; }
.all-entries-table td.desc { overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions.end { justify-content: flex-end; }
td .row-actions .btn { min-width: 64px; }
.cell-input { width: calc(100% - 12px); box-sizing: border-box; height: 28px; margin-left: -6px; padding: 0 5px; font-size: 14px; background: var(--raised); border: 1px solid var(--accent); border-radius: 4px; color: inherit; }
.cell-input:focus-visible { outline: none; border-color: var(--accent-hover); }
select.cell-input { padding: 0 2px; }
.cell-colour { width: 22px; height: 22px; padding: 0; margin: -2px 0 -2px -2px; background: none; border: 1px solid var(--border-strong); border-radius: 4px; vertical-align: middle; cursor: pointer; }
.cell-colour::-webkit-color-swatch-wrapper { padding: 1px; }
.cell-colour::-webkit-color-swatch { border: 0; border-radius: 3px; }
.cell-check { font-size: 13px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; height: 28px; }
.cell-check input { accent-color: var(--accent); margin: 0; }
.cell-file { font-size: 12px; color: var(--muted); max-width: 100%; }
/* Logo cell: file input and the remove tick share one line so the editing row stays 44px. */
td .row-actions.nowrap { flex-wrap: nowrap; }
td .row-actions.nowrap .cell-file { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; }
td .row-actions.nowrap .cell-check { flex: none; }
.cell-file::file-selector-button { font: inherit; font-size: 12px; font-weight: 600; color: var(--text); background: var(--raised); border: 1px solid var(--border-strong); border-radius: 4px; padding: 2px 8px; margin-right: 8px; cursor: pointer; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border-strong); vertical-align: middle; }
.chip { font-size: 12px; line-height: 1.2; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.callout { font-size: 13px; color: var(--faint); margin: 8px 0 0; }
.callout.danger { color: var(--danger); }
details.adder { margin-top: 12px; }
details.adder summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
details.adder summary::-webkit-details-marker { display: none; }
details.adder summary::before { content: "+ "; color: var(--accent); }
details.adder[open] summary { margin-bottom: 8px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input[type="text"], .inline-form input[type="number"], .inline-form input[type="email"], .inline-form input[type="date"], .inline-form select { background: var(--raised); border: 1px solid var(--border-strong); border-radius: 4px; padding: 8px 10px; font-size: 15px; min-width: 0; }
.inline-form input[type="color"] { width: 36px; height: 36px; padding: 2px; background: var(--raised); border: 1px solid var(--border-strong); border-radius: 4px; cursor: pointer; }
.inline-form input[type="number"] { width: 110px; }
.inline-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-form .cell-file { font-size: 13px; }
.inline-form input:focus-visible, .inline-form select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.error-text { color: var(--danger); font-size: 13px; margin: 0 0 8px; }
.inline-form .error-text, tr.editing .error-text { flex-basis: 100%; margin: 0; }
.cust-logo { display: inline-block; vertical-align: middle; object-fit: contain; object-position: left center; flex: none; }
.with-logo { display: inline-flex; align-items: center; gap: 10px; }

/* Status pill: the Tasks app chip (rounded, 12px, muted) with a colour dot ahead of the label */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.2; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.dot-mark { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.needs-review-icon { color: var(--warning); vertical-align: middle; margin-left: 4px; }

/* Customer group (landing and customer timesheet) */
.panel.group { border-left: 3px solid var(--cc, var(--border-strong)); }
.group-header-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.group-header-row h3 { font-size: 20px; }
.group-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mark-invoiced-form:has(.needs-review-ack), .mark-submitted-form:has(.needs-review-ack) { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.needs-review-ack { color: var(--warning); font-size: 13px; margin: 0; }
.group-total { color: var(--muted); margin: 4px 0 16px; font-size: 13px; }
.copy-action { display: inline-flex; align-items: center; gap: 8px; }
.copy-fallback[hidden] { display: none; }
.copy-fallback { display: flex; flex-direction: column; gap: 4px; }
.copy-fallback input[readonly], .copy-fallback textarea[readonly] { background: var(--raised); border: 1px solid var(--border-strong); border-radius: 4px; padding: 4px 8px; font-size: 13px; width: 100%; }

/* Banners */
.result-banner { background: rgba(55,192,127,0.12); border: 1px solid var(--success); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.error-banner { background: rgba(255,91,61,0.12); border: 1px solid var(--danger); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.empty-state { padding: 48px 0; }
.empty-state h3 { font-size: 20px; }
.empty-state p { color: var(--muted); margin: 8px 0 0; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; }
.checkbox-label input { accent-color: var(--accent); margin: 0; }

/* Slide-over drawer: the entry edit and add surface. drawer.js reparents a
   hidden .edit-row's nodes into #drawer-body, so the class names below are
   load-bearing. */
.edit-row[hidden] { display: none; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: calc(96px + env(safe-area-inset-top, 0px)); right: 24px; width: 420px; max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); background: var(--raised); border: 1px solid var(--border-strong); border-radius: 6px; z-index: 101; transform: translateX(calc(100% + 24px)); transition: transform .25s ease; display: flex; flex-direction: column; overflow: hidden; }
.drawer.open { transform: none; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); flex: none; }
.drawer-close { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0; }
.drawer-close:hover { color: var(--text); }
.drawer-body { padding: 20px; overflow: auto; flex: 1 1 auto; }
.drawer-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: none; }
.drawer-footer:empty { display: none; }
.drawer-footer-actions { display: flex; gap: 8px; }
.edit-form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.edit-form-fields { display: contents; }
.edit-row label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.edit-row label.checkbox-label { display: inline-flex; color: var(--text); font-size: 14px; }
.edit-row input[type="text"], .edit-row input[type="number"], .edit-row input[type="date"], .edit-row select, .edit-row textarea { width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; padding: 8px 10px; font-size: 15px; color: var(--text); }
.edit-row textarea { resize: vertical; min-height: 4.5em; }
.edit-row input:focus-visible, .edit-row select:focus-visible, .edit-row textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.edit-row input.error, .edit-row select.error, .edit-row textarea.error { border-color: var(--danger); }
.edit-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 2px; border-top: 1px solid var(--border); }
.amount-preview, .trip-key-display { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.amount-preview .mono { color: var(--text); font-size: 15px; }
.drawer-body textarea::-webkit-resizer { background-color: transparent; background-image: linear-gradient(135deg, transparent 44%, var(--border-strong) 44%, var(--border-strong) 48%, transparent 48%, transparent 60%, var(--border-strong) 60%, var(--border-strong) 64%, transparent 64%, transparent 76%, var(--border-strong) 76%, var(--border-strong) 80%, transparent 80%); }

/* Discard confirmation over the drawer */
.drawer-confirm-overlay { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.55); align-items: center; justify-content: center; }
.drawer-confirm-overlay[hidden] { display: none; }
.drawer-confirm-overlay:not([hidden]) { display: flex; }
.drawer-confirm-box { background: var(--raised); border: 1px solid var(--border-strong); border-radius: 6px; padding: 24px; max-width: 360px; display: flex; flex-direction: column; gap: 24px; }
#drawer-confirm-message { margin: 0; text-align: center; }
.drawer-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Settings inline editing: the display row and its editing twin swap. */
tr.editing[hidden], tr[hidden] { display: none; }
tr.editing td { white-space: normal; overflow: visible; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-scrim { transition: none; } }

/* Narrow widths. Below 1200px the entry tables run out of room for a readable
   Description column (Bobby's floor is roughly a 1230px window, where it has
   about 240px), so tables stop being tables: each row becomes a wrapped flex
   line with the description on its own full-width line. */
.seg { flex-wrap: wrap; }
.filter-range { display: inline-flex; align-items: center; gap: 12px 16px; flex-wrap: nowrap; }
@media (max-width: 1199px) {
  table.stackable:not(.fixed), table.stackable:not(.fixed) tbody { display: block; }
  table.stackable:not(.fixed) thead, table.stackable:not(.fixed) colgroup { display: none; }
  table.stackable:not(.fixed) tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.stackable:not(.fixed) tr[hidden] { display: none; }
  table.stackable:not(.fixed) td { display: block; padding: 0; border: 0; white-space: normal; overflow: visible; min-width: 0; height: auto; }
  /* Entry rows: date, hours and actions on the first line, description on
     its own line, statuses last. */
  .entries-table td:nth-child(1), .all-entries-table td:nth-child(1) { order: 1; }
  .all-entries-table td:nth-child(2) { order: 2; font-weight: 600; }
  .entries-table td:nth-child(3), .all-entries-table td:nth-child(4) { order: 3; }
  .entries-table td:nth-child(6), .all-entries-table td:nth-child(7) { order: 4; margin-left: auto; }
  .entries-table td.desc, .all-entries-table td.desc { order: 5; flex: 1 1 100%; }
  .entries-table td:nth-child(4), .entries-table td:nth-child(5), .all-entries-table td:nth-child(5), .all-entries-table td:nth-child(6) { order: 6; }
  .entries-table td:nth-child(3)::before, .all-entries-table td:nth-child(4)::before { content: "hrs "; color: var(--muted); font-family: var(--font); font-size: 12px; }
}
@media (max-width: 960px) {
  table.fixed.stackable, table.fixed.stackable tbody { display: block; }
  table.fixed.stackable thead, table.fixed.stackable colgroup { display: none; }
  table.fixed.stackable tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.fixed.stackable tr[hidden] { display: none; }
  table.fixed.stackable td { display: block; padding: 0; border: 0; white-space: normal; overflow: visible; min-width: 0; height: auto; }
  .page-head { margin-bottom: 24px; }
  .page-head .end { margin-left: 0; width: 100%; }
  .filter-bar label { flex: 1 1 auto; }
  .filter-bar select { flex: 1; }
  .filter-range { flex-wrap: wrap; }
  .filter-range label { flex: 0 1 auto; }
  /* Settings rows: fields take their natural width and the action cell
     sits at the right. */
  table.fixed.stackable tr.editing td { flex: 1 1 160px; }
  table.fixed.stackable tr td:last-child { flex: 1 1 100%; }
  table.fixed.stackable tr:not(.editing) td:last-child .row-actions { justify-content: flex-start; }
  .cell-input { width: 100%; margin-left: 0; }
  .group-header-row h3 { font-size: 17px; }
}
@media (max-width: 600px) {
  .app-header { padding: 16px; }
  .app-content { padding-top: 20px; }
  .panel { padding: 16px; }
  .cust { padding: 14px 16px; }
  .stats { gap: 10px; }
  .stat b { font-size: 17px; }
  .drawer { top: 0; right: 0; width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; height: 100vh; }
}
