/* ==========================================================================
   style.css — shared by the admin app (index.html) and client page (timesheet.html)

   Mobile first: base rules are for phones. The @media (min-width: 900px)
   block turns the admin into a two-pane desktop layout.
   --accent is replaced by your brand color at runtime (applyBrand in shared.js).
   ========================================================================== */
:root {
  /* Boldt Productions palette */
  --oregon: #984B0B; --meteor: #D87510; --bronze: #4D300B; --gold: #F9B140; --allports: #056CB3;
  --bg: #f6f3ee; --card: #fff; --ink: #1f1a14; --muted: #6e665c; --line: #e8e1d6;
  --accent: var(--oregon); --accent-ink: #fff; --danger: #a32d2d; --warn: var(--oregon); --good: #2f7a4a;
  --link: var(--allports);
  --soft: #FCE8C6;        /* Yellow Orange tint: secondary buttons */
  --soft-hover: #F9DBA8;
  --tint: #FDF4E6;        /* lighter warm tint: highlight panels */
  --radius: 12px; --topbar: 58px; --tabbar: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); overflow-x: clip; }
h1 { font-size: 22px; line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 0 0 6px; font-weight: 600; }
.stack-form h2 { margin-top: 18px; }
.stack-form h2:first-child { margin-top: 0; }
p { margin: 6px 0; }

/* ---------- controls ---------- */
input, select, textarea, button, .btn {
  font: inherit; font-size: 16px; /* 16px stops iPhone zooming into fields */
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); min-height: 44px;
}
textarea { resize: vertical; min-height: 64px; }
input[type="checkbox"] { min-height: 0; width: 20px; height: 20px; accent-color: var(--accent); }
input[type="color"] { padding: 4px; width: 64px; }
/* Buttons — "soft pill": primary = solid brand color, everything else = warm tint. */
button, .btn {
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; background: var(--soft); color: var(--bronze); font-weight: 550; padding: 9px 18px;
  transition: background .12s, filter .12s, transform .06s;
}
button:hover:not(:disabled), .btn:hover { background: var(--soft-hover); }
button:active:not(:disabled), .btn:active { transform: scale(.98); }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.12); }
button.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px #E8B4AE; }
button.danger:hover:not(:disabled) { background: #FBEDEB; }
@media (prefers-reduced-motion: reduce) { button, .btn { transition: none; } button:active, .btn:active { transform: none; } }
button.small, .btn.small { padding: 5px 14px; min-height: 36px; font-size: 14px; }
button.big { font-size: 17px; padding: 12px 22px; min-height: 52px; }
button.wide { width: 100%; }
button:disabled, .btn.disabled { opacity: .45; cursor: default; pointer-events: none; }
/* Icons (see ICONS in shared.js) */
.ic { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.inline { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
button.small .ic, .btn.small .ic { width: 17px; height: 17px; }
button.icon-only { padding: 0; width: 36px; }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn { background: none; color: var(--bronze); font-size: 20px; padding: 6px 10px; min-height: 44px; }
.icon-btn:hover:not(:disabled) { background: var(--tint); }
.linkish, .linkish:hover:not(:disabled) { background: none; padding: 0; min-height: 0; color: var(--link); text-decoration: underline; font-size: inherit; font-weight: inherit; border-radius: 4px; }
a { color: var(--link); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }

/* ---------- utilities ---------- */
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.good { color: var(--good); font-size: 13px; }
.overdue { color: var(--danger); font-size: 13px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.left { text-align: left; }
.grow { flex: 1; }
.pad { padding: 8px 4px; }
.msg { margin: 8px 0 0; font-size: 13px; color: var(--danger); min-height: 1em; }
.msg.ok { color: var(--good); }
.msg:empty { margin: 0; min-height: 0; }
.top-msg { margin: 0; padding: 0 16px; }
.print-only { display: none; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: #eee; white-space: nowrap; line-height: 1.3; }
.pill.billed { background: #dcefe4; color: var(--good); }
.pill.unbilled { background: var(--soft); color: var(--oregon); }
.pill.late { background: #f8dcd6; color: var(--danger); }
button.pill.inv, button.pill.inv:hover { background: #E3EFF8; color: var(--allports); text-decoration: none; padding: 3px 8px; min-height: 0; font-weight: 600; }

/* ---------- layout pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1 1 140px; }
.row > label.grow { flex: 3 1 220px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { margin: 12px 0 4px; }
.share { font-size: 13px; word-break: break-all; color: var(--muted); background: var(--bg); padding: 8px 10px; border-radius: 8px; margin: 6px 0 10px; }
.login { max-width: 380px; margin: 80px auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px;
  padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand, .brand:hover:not(:disabled) { background: none; color: var(--bronze); padding: 0; border-radius: 0; font-weight: 700; font-size: 16px; min-height: 44px; justify-content: flex-start; flex: 1 1 0; overflow: hidden; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { height: 30px; max-width: 110px; object-fit: contain; }
.brand-logo:not(.hidden) + span { display: none; } /* logo replaces the name on phones */
.quick { display: flex; gap: 6px; align-items: center; flex: none; }
.quick select { width: 150px; font-size: 14px; }
.quick .primary { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.quick .primary .ic { width: 22px; height: 22px; }
.running-chip { background: var(--soft); border-radius: 999px; padding: 3px 3px 3px 12px; }
.running-chip .primary { width: 38px; height: 38px; min-height: 38px; }
.chip-link, .chip-link:hover:not(:disabled) { background: none; padding: 0; min-height: 38px; gap: 6px; color: var(--bronze); font-weight: 400; }
.chip-link #quickLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 76px; font-size: 13px; }
.chip-link strong { font-variant-numeric: tabular-nums; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--meteor); flex: none; display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* ---------- shell: phones show ONE pane ---------- */
.shell { max-width: 1320px; margin: 0 auto; }
.sidebar, .detail { padding: 14px; }
body[data-view="home"] .detail { display: none; }
body:not([data-view="home"]) .sidebar { display: none; }
.phone-only { }
.back { margin-bottom: 10px; }

/* ---------- overview ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile:first-child { grid-column: 1 / -1; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tile:first-child .muted { color: inherit; opacity: .8; }
.tile-num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.attn-title { margin-top: 4px; }
.attn { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.attn-item, .client-row, .inv-row { border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 400; }
.attn-item:hover:not(:disabled), .client-row:hover:not(:disabled), .inv-row:hover:not(:disabled) { background: var(--card); border-color: var(--meteor); }
.attn-item { justify-content: flex-start; text-align: left; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.attn-item > span:nth-child(2) { flex: 1; }
.attn-icon .ic { width: 17px; height: 17px; }
.attn-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--oregon); display: grid; place-items: center; flex: none; font-weight: 700; }
.attn-item.warn .attn-icon { background: #f8dcd6; color: var(--danger); }
.attn-item.good .attn-icon { background: #dcefe4; color: var(--good); }
.chev { color: var(--muted); display: flex; }
.empty { text-align: center; padding: 28px 18px; }

/* ---------- client list ---------- */
.side-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.side-head h2 { margin: 0; }
.client-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.client-row { flex-direction: column; align-items: stretch; gap: 4px; text-align: left; padding: 12px 14px; border-radius: var(--radius); }
.client-row.selected { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.client-row.is-running { border-color: var(--accent); }
.cr-top, .cr-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cr-name { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.cr-amt { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
.cr-sub > span:last-child { flex: none; white-space: nowrap; }
.side-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
details > summary { cursor: pointer; padding: 6px 0; }

/* ---------- client screen ---------- */
.cv-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-start; margin-bottom: 12px; }
.cv-head .back { margin: 0; padding: 0 12px; min-height: 40px; font-size: 18px; }
.cv-title { flex: 1; }
.cv-title .muted { margin-top: 3px; }
.stat { flex: 1 0 100%; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-left: 58px; }
.stat-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
#cvUnbilledSub { }

/* Tabs: a bottom bar on phones (thumb-friendly)… */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
.tabs button, .tabs button:hover:not(:disabled) { flex: 1; flex-direction: column; gap: 2px; border-radius: 0; background: none; font-weight: 500; font-size: 11px; color: var(--muted); padding: 6px 0; min-height: var(--tabbar); }
.tabs .ic { width: 23px; height: 23px; }
.tabs button.on, .tabs button.on:hover:not(:disabled) { color: var(--oregon); font-weight: 700; }
body[data-view="client"] .detail { padding-bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }

#tab-settings > h2 { margin-top: 24px; }
.timer-display { font-size: 52px; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 14px; }
.running { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
#tIdle .row { margin-bottom: 12px; }
#tIdle .field { margin-bottom: 14px; }
.recent { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.recent:empty { display: none; }
.recent-row { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; }
.recent-row span:first-child { color: var(--muted); width: 54px; flex: none; }
.recent-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.add-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.add-head h2 { margin: 0; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button, .seg button:hover:not(:disabled) { background: none; min-height: 38px; font-size: 14px; padding: 6px 14px; border-radius: 999px; color: var(--bronze); font-weight: 500; }
.seg button.on, .seg button.on:hover { background: var(--oregon); color: #fff; font-weight: 600; }
.seg.locked button:not(.on) { display: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.chips button { min-height: 34px; padding: 4px 14px; font-size: 13px; white-space: nowrap; flex: none; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.chips button:hover:not(:disabled) { background: var(--tint); }
.preview { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.preview strong { color: var(--ink); }
.preview-box { background: var(--bg); padding: 12px 14px; border-radius: 10px; }

.period-sum { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--tint); }
.period-sum:empty { display: none; }
.ps-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-num .muted { font-size: 14px; font-weight: 400; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-bottom: none; }
tr.locked td { background: color-mix(in srgb, var(--bg) 50%, #fff); }
.c-desc .small { margin-top: 2px; }

/* ---------- invoices list ---------- */
.inv-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; text-align: left; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; }
.ir-main { display: flex; flex-direction: column; }
.ir-mid { grid-column: 1; }
.ir-end { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }

/* ---------- settings editors ---------- */
.editor { display: flex; flex-direction: column; gap: 8px; }
.ed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 8px; background: var(--bg); border-radius: 10px; }
.ed-row.dim input[data-k="name"] { opacity: .55; }
.ed-row.proj { grid-template-columns: minmax(0, 1fr) auto auto; padding: 10px; }
.proj-rates { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 0; }
.pick-chips { flex-wrap: wrap; overflow: visible; padding-bottom: 0; margin: 0; }
.pick-chips button.on, .pick-chips button.on:hover:not(:disabled) { background: var(--oregon); color: #fff; box-shadow: none; }
.ovr-list { display: flex; flex-direction: column; gap: 6px; }
.ovr { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; align-items: center; gap: 8px; font-size: 14px; }
.ovr input { min-height: 38px; padding: 6px 10px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.logo-preview { display: flex; align-items: center; gap: 12px; }
.logo-preview img { max-height: 60px; max-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.sticky-save { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px); background: var(--card); padding: 10px 0; z-index: 5; }
#bizView .sticky-save { bottom: 8px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 18, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--card); width: 100%; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 0 16px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.modal-bar { position: sticky; top: 0; background: var(--card); display: flex; justify-content: space-between; align-items: center; padding: 10px 0; margin-bottom: 6px; border-bottom: 1px solid var(--line); z-index: 2; }
.modal-actions { margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }

/* ---------- invoice document ---------- */
.invoice { font-size: 14px; color: var(--ink); }
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 3px solid var(--accent); }
.inv-logo { max-height: 56px; max-width: 220px; object-fit: contain; display: block; margin-bottom: 8px; }
.inv-biz { font-size: 18px; font-weight: 700; }
.inv-meta { text-align: right; }
.inv-title { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: -.01em; }
.inv-status { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--oregon); }
.inv-status.paid { background: #dcefe4; color: var(--good); }
.inv-status.late { background: #f8dcd6; color: var(--danger); }
.inv-to { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 16px 0; }
.inv-table td { padding: 8px 6px; }
.inv-group td { font-weight: 700; background: var(--bg); padding-top: 8px; }
.inv-sub td { font-size: 13px; color: var(--muted); text-align: right; }
.inv-sub td.num { color: var(--ink); font-weight: 600; }
.inv-total td { font-size: 18px; font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; text-align: right; }
.inv-pay { background: var(--bg); padding: 12px 14px; border-radius: 10px; margin-top: 14px; }
.inv-thanks { margin-top: 16px; text-align: center; }

/* ---------- phone-only table → cards ---------- */
@media screen and (max-width: 899px) {
  .col-time { display: none; }
  h1 { font-size: 20px; }
  .inv-meta { text-align: left; }
  table.log tr.group-row td { display: block; padding: 6px 8px; border-radius: 6px; }
  #ratesEditor .ed-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  #ratesEditor .ed-row > * { grid-row: auto !important; grid-column: auto !important; justify-self: stretch !important; }
  #ratesEditor .ed-row input[data-k="name"] { grid-column: 1 / -1 !important; }
  table.log thead { display: none; }
  table.log tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "sel date amt" "sel desc qty" "sel status act"; gap: 3px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.log td { border: 0; padding: 0; }
  table.log .c-sel { grid-area: sel; padding-top: 2px; } table.log .c-date { grid-area: date; font-weight: 600; }
  table.log .c-desc { grid-area: desc; } table.log .c-qty { grid-area: qty; color: var(--muted); }
  table.log .c-amt { grid-area: amt; font-weight: 700; } table.log .c-status { grid-area: status; align-self: center; }
  table.log .c-act { grid-area: act; justify-self: end; }
  table.log .c-rate { display: none; }
  table.log.ts tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date amt" "desc qty" "status status"; }
  table.log tr.locked td { background: none; }
  table.log tr.total { display: flex; gap: 12px; }
  table.log tr.total td:empty, table.log tr.total td.no-print { display: none; }
  table.log tr.total .t-lab { flex: 1; }
  table.log tr.empty-row { display: block; }
  table.log tr.group-row { display: block; border: 0; padding: 14px 0 0; }
  .inv-table thead { display: none; }
  .inv-table tr:not(.inv-group):not(.inv-total):not(.inv-sub) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "desc amt" "date qty"; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .inv-table tr:not(.inv-group):not(.inv-total):not(.inv-sub) td { border: 0; padding: 0; }
  .inv-table td:nth-child(1) { grid-area: date; color: var(--muted); font-size: 13px; }
  .inv-table td:nth-child(2) { grid-area: desc; }
  .inv-table td:nth-child(3) { grid-area: qty; color: var(--muted); font-size: 13px; }
  .inv-table td:nth-child(4) { display: none; }
  .inv-table td:nth-child(5) { grid-area: amt; font-weight: 600; }
  .inv-table tr.inv-group, .inv-table tr.inv-total, .inv-table tr.inv-sub { display: flex; justify-content: space-between; }
  .inv-table tr.inv-group td { flex: 1; }
  .inv-table tr.inv-sub td, .inv-table tr.inv-total td { padding: 8px 0; }
  .inv-table tfoot tr td:first-child, .inv-sub td:first-child { text-align: left; }
}

/* ---------- desktop: two panes ---------- */
@media (min-width: 900px) {
  :root { --topbar: 60px; }
  h1 { font-size: 26px; }
  .topbar { padding: 0 18px 0 22px; }
  .brand-logo:not(.hidden) + span { display: inline; }
  .brand { gap: 10px; }
  .quick select { width: 220px; }
  .chip-link #quickLabel { max-width: 220px; }
  .shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
  .sidebar {
    display: block !important; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto;
    border-right: 1px solid var(--line); padding: 18px 16px;
  }
  .detail { display: block !important; padding: 22px 28px 40px; }
  body[data-view="client"] .detail { padding-bottom: 40px; }
  .phone-only { display: none !important; }
  #summarySlotPhone { display: none; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .tile:first-child { grid-column: auto; }
  .tile { padding: 16px 18px; }
  .tile-num { font-size: 30px; }
  .attn { max-width: 760px; }

  .tabs { position: static; height: auto; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: none; margin-bottom: 16px; gap: 4px; }
  .tabs button, .tabs button:hover:not(:disabled) { flex: none; flex-direction: row; gap: 7px; font-size: 15px; padding: 10px 14px; min-height: 44px; border-bottom: 2px solid transparent; }
  .tabs .ic { width: 19px; height: 19px; }
  .tabs button.on, .tabs button.on:hover:not(:disabled) { color: var(--bronze); border-bottom-color: var(--oregon); }
  .cv-head { flex-wrap: nowrap; }
  .stat { flex: none; display: block; text-align: right; padding: 0; }
  .stat-num { font-size: 28px; }

  #tab-timer, #tab-add, #tab-settings, #tab-invoices { max-width: 760px; }
  #tab-settings > h2 { margin-top: 24px; }
.timer-display { font-size: 72px; }
  .sticky-save { bottom: 0; }
  #ratesEditor .ed-row { grid-template-columns: minmax(0, 1fr) 120px 110px auto; }
  #ratesEditor .ed-row > * { grid-row: auto !important; grid-column: auto !important; justify-self: stretch !important; }
  .ed-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .modal { align-items: center; padding: 24px; }
  .modal-card { max-width: 820px; border-radius: 16px; padding: 0 28px 28px; }
  .inv-row { grid-template-columns: 160px minmax(0, 1fr) auto; align-items: center; }
  .ir-mid { grid-column: 2; grid-row: 1; }
  .ir-end { grid-column: 3; grid-row: 1; flex-direction: row; align-items: center; gap: 12px; }
}

/* ---------- client page (timesheet.html) ---------- */
.ts-wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.ts-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 3px solid var(--accent); }
.ts-head .inv-logo { margin: 0 0 6px; }
.ts-contact { text-align: right; }
.ts-tabs { position: static; height: auto; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: none; margin-bottom: 14px; gap: 4px; }
.ts-tabs button, .ts-tabs button:hover:not(:disabled) { flex: none; flex-direction: row; font-size: 15px; padding: 10px 14px; min-height: 44px; background: none; border-radius: 0; border-bottom: 2px solid transparent; }
.ts-tabs button.on, .ts-tabs button.on:hover:not(:disabled) { color: var(--bronze); border-bottom-color: var(--oregon); }
tr.group-row td { font-weight: 700; background: var(--bg); border-bottom: 0; padding-top: 10px; }
tr.group-sub td { color: var(--muted); font-size: 13px; text-align: right; }
.approve-box { margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--tint); }
.approve-box .row { margin-top: 8px; }
.approve-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--soft); color: var(--bronze); padding: 12px 14px; border-radius: 12px; margin: 12px 0 4px; font-size: 14px; }
.approve-banner > .ic { width: 22px; height: 22px; color: var(--oregon); margin-top: 1px; }

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .no-print, .topbar, .tabs, .sidebar, .msg, button, input, select, .period-sum, .toolbar, .back, .cv-head .stat { display: none !important; }
  .print-only { display: block !important; }
  .shell, .detail { display: block !important; padding: 0 !important; max-width: none; }
  .card { border: 0; padding: 0; }
  .cv-head { display: none; }
  .col-time { display: table-cell !important; }
  /* With an invoice open, print only the invoice. */
  body.modal-open #app, body.modal-open .ts-wrap > :not(.modal) { display: none !important; }
  body.modal-open .modal { position: static; background: none; display: block; padding: 0; }
  body.modal-open .modal-card { max-height: none; overflow: visible; padding: 0; box-shadow: none; max-width: none; }
  .invoice { font-size: 12px; }
  tr { break-inside: avoid; }
}
