/* AirSystem Unit Board
   Palette from the AirSystem mark: duct blue, signal yellow, deep navy, on a cool frost ground.
   Yellow is reserved for money that has come in. Brick is reserved for money still owed. */

:root {
  --frost: #EBF1F5;
  --paper: #FFFFFF;
  --ink: #112C39;
  --ink-2: #4E6676;
  --ink-3: #7F95A3;
  --line: #D3DEE6;
  --line-soft: #E3EAF0;
  --duct: #3E7DA6;
  --duct-soft: #DCEAF4;
  --signal: #FFC207;
  --signal-soft: #FFF2C7;
  --brick: #B5432C;
  --brick-soft: #F8E3DD;
  --leaf: #2F7D5B;
  --leaf-soft: #DDF0E6;
  --bar: #112C39;
  --bar-ink: #E8F0F5;

  --radius-card: 10px;
  --radius-control: 7px;
  --shadow-card: 0 1px 0 rgba(17, 44, 57, .06), 0 1px 2px rgba(17, 44, 57, .06);
  --shadow-lift: 0 14px 30px -10px rgba(17, 44, 57, .35), 0 2px 6px rgba(17, 44, 57, .12);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --frost: #0E1C24;
    --paper: #15272F;
    --ink: #E6EEF2;
    --ink-2: #A5B8C3;
    --ink-3: #7A909C;
    --line: #26404C;
    --line-soft: #1D333D;
    --duct: #6FAAD0;
    --duct-soft: #1C3A4C;
    --signal: #FFC930;
    --signal-soft: #3A3313;
    --brick: #E07A62;
    --brick-soft: #3B221C;
    --leaf: #6CC59C;
    --leaf-soft: #17352A;
    --bar: #0A161C;
    --shadow-card: 0 1px 0 rgba(0, 0, 0, .25);
    --shadow-lift: 0 16px 34px -10px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--frost);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: lining-nums; }
:focus-visible { outline: 2px solid var(--duct); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--paper); color: var(--ink);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--duct); border-color: var(--duct); color: #fff; }
.btn-accent { background: var(--signal); border-color: var(--signal); color: #112C39; }
.btn-danger { color: var(--brick); }
.btn-block { width: 100%; }
.btn-small { height: 30px; padding: 0 10px; font-size: 13px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--ink-3); }
  .btn-primary:hover { background: #356f95; }
  .btn-accent:hover { background: #f4b800; border-color: #f4b800; }
}
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-control); background: transparent; cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn:active { transform: scale(0.94); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60% 55% at 12% 10%, rgba(255,194,7,.22), transparent 70%),
    radial-gradient(65% 60% at 90% 95%, rgba(62,125,166,.30), transparent 70%),
    linear-gradient(160deg, #F7FAFC 0%, #E4EEF5 100%); }
.login[hidden] { display: none; }
.login-card { width: min(360px, 100%); display: grid; justify-items: center; gap: 14px; padding: 40px 32px 34px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9); border-radius: 22px; box-shadow: 0 30px 70px -30px rgba(17,44,57,.35), 0 2px 6px rgba(17,44,57,.06); }
.login-logo { width: 190px; height: auto; margin-bottom: 14px; }
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; height: 48px; padding: 0 48px 0 16px; font-size: 16px; color: #112C39; background: #fff; border: 1px solid #D3DEE6; border-radius: 12px; outline: none; transition: border-color 140ms ease, box-shadow 140ms ease; }
.pw-wrap input:focus { border-color: #3E7DA6; box-shadow: 0 0 0 3px rgba(62,125,166,.2); }
.pw-eye { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; border: 0; background: none; border-radius: 9px; color: #7F95A3; cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: #112C39; background: #EBF1F5; }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pw-eye .eye-slash { display: none; }
.pw-eye[aria-pressed="true"] .eye-slash { display: inline; }
.login-card .form-error { margin: -4px 0 0; min-height: 0; width: 100%; }
.login-card .form-error:empty { display: none; }
.login-go { width: 100%; height: 48px; border-radius: 12px; font-size: 16px; }

/* ---------- fields ---------- */
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  height: 36px; padding: 0 10px; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--paper);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--duct); box-shadow: 0 0 0 3px var(--duct-soft);
}
.field .peso { position: relative; }
.field .peso::before { content: '₱'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.field .peso input { padding-left: 24px; font-variant-numeric: lining-nums; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: var(--duct); }
.form-error { color: var(--brick); min-height: 20px; margin: 8px 0; font-size: 13px; }

/* ---------- top bar ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; background: var(--bar); color: var(--bar-ink);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand div { display: grid; line-height: 1.15; }
.brand strong { font-size: 16px; letter-spacing: -0.01em; }
.brand span { font-size: 12px; color: #9DB4C2; }
.tabs { display: flex; gap: 2px; background: rgba(255, 255, 255, .06); padding: 3px; border-radius: 9px; }
.tabs button {
  border: 0; background: transparent; color: #B8CAD5; height: 30px; padding: 0 14px; border-radius: 7px;
  font-weight: 600; cursor: pointer; transition: background-color 160ms ease, color 160ms ease;
}
.tabs button[aria-selected="true"] { background: #FFFFFF; color: #112C39; }
@media (hover: hover) and (pointer: fine) { .tabs button[aria-selected="false"]:hover { color: #fff; } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.top-actions .icon-btn { color: var(--bar-ink); }
@media (hover: hover) and (pointer: fine) { .top-actions .icon-btn:hover { background: rgba(255, 255, 255, .08); } }
.search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; width: 290px;
  background: rgba(255, 255, 255, .08); border-radius: var(--radius-control); color: #B8CAD5;
}
.search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.search input { border: 0; background: transparent; outline: none; color: #fff; width: 100%; }
.search input::placeholder { color: #8DA5B4; }
.search:focus-within { box-shadow: 0 0 0 2px var(--duct); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; z-index: 40;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lift); padding: 6px; display: grid;
  transform-origin: top right;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@starting-style { .menu { opacity: 0; transform: scale(0.96) translateY(-4px); } }
.menu a, .menu button {
  text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 6px;
  color: inherit; text-decoration: none; cursor: pointer; font-weight: 500;
}
.menu .danger { color: var(--brick); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; width: 100%; }
@media (hover: hover) and (pointer: fine) { .menu a:hover, .menu button:hover { background: var(--frost); } }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; }

/* ---------- board ---------- */
.view-board { display: flex; flex-direction: column; }
.board-strip {
  display: flex; align-items: baseline; gap: 4px 28px; flex-wrap: wrap;
  padding: 16px 20px 4px;
}
.board-strip h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 700; }
.board-strip .facts { display: flex; gap: 2px 22px; flex-wrap: wrap; color: var(--ink-2); }
.board-strip .facts b { color: var(--ink); font-weight: 700; }
.board-strip .facts .owed b { color: var(--brick); }

.columns {
  flex: 1; min-height: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(216px, 1fr);
  gap: 12px; padding: 12px 20px 20px; overflow-x: auto;
  scroll-snap-type: x proximity;
}
.column {
  display: flex; flex-direction: column; min-height: 0;
  background: color-mix(in srgb, var(--line-soft) 55%, transparent);
  border-radius: 12px; scroll-snap-align: start;
  animation: column-in 420ms var(--ease-out) both;
  animation-delay: calc(var(--i) * 45ms);
}
@keyframes column-in { from { opacity: 0; transform: translateY(10px); } }
.column.ready { animation: none; }
.column-head { padding: 12px 12px 8px; display: grid; gap: 2px; }
.column-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.column-title .step {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line);
}
.column[data-stage="paid"] .column-title .step { background: var(--signal); border-color: var(--signal); color: #112C39; }
.column-title .count { margin-left: auto; color: var(--ink-3); font-weight: 600; font-variant-numeric: lining-nums; }
.column-sub { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: lining-nums; padding-left: 28px; }
.column-sub .owed { color: var(--brick); font-weight: 600; }
.column-body { flex: 1; overflow-y: auto; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.column.drop-target { background: color-mix(in srgb, var(--duct-soft) 80%, transparent); }
.column-empty {
  border: 1.5px dashed var(--line); border-radius: var(--radius-card); padding: 18px 14px;
  color: var(--ink-3); font-size: 13px; text-align: center;
}
.column-add {
  margin: 0 8px 10px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600;
  height: 32px; border-radius: 7px; cursor: pointer; text-align: left; padding: 0 8px;
  transition: background-color 160ms ease, transform 140ms var(--ease-out);
}
.column-add:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .column-add:hover { background: var(--paper); color: var(--ink); } }

/* ---------- unit card ---------- */
.card {
  position: relative; background: var(--paper); border-radius: var(--radius-card);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-card);
  padding: 11px 12px 12px; cursor: grab; user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
  transition: transform 140ms var(--ease-out), border-color 160ms ease, box-shadow 200ms ease;
}
.card:active { transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) { .card:hover { border-color: var(--line); } }
.card.just-moved { animation: landed 900ms var(--ease-out); }
@keyframes landed {
  0% { box-shadow: 0 0 0 3px var(--signal), var(--shadow-card); }
  100% { box-shadow: 0 0 0 0 transparent, var(--shadow-card); }
}
.card-txn { font-size: 11.5px; color: var(--ink-3); margin-bottom: 1px; }
.card-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.card-unit { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-hp { color: var(--ink-2); font-weight: 600; font-size: 13px; flex: none; }
.card-customer { margin-top: 2px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-customer.none { color: var(--ink-3); font-style: italic; }

/* the money meter: yellow is money in, brick text is money still owed */
.meter { margin-top: 10px; }
.meter-track { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.meter-fill {
  height: 100%; width: 100%; background: var(--signal); border-radius: 3px;
  transform-origin: left center; transform: scaleX(var(--paid, 0));
  transition: transform 520ms var(--ease-out);
}
.meter-legend { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12.5px; font-variant-numeric: lining-nums; }
.meter-legend .due { color: var(--brick); font-weight: 600; }
.meter-legend .clear { color: var(--leaf); font-weight: 600; }
.meter-legend .margin { color: var(--ink); font-weight: 600; }
.meter-legend .total { color: var(--ink-2); }
.card-cost { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: lining-nums; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag {
  font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  background: var(--frost); color: var(--ink-2);
}
.tag.warn { background: var(--brick-soft); color: var(--brick); }
.tag.info { background: var(--duct-soft); color: var(--duct); }
.tag.good { background: var(--leaf-soft); color: var(--leaf); }

/* drag */
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; margin: 0;
  box-shadow: var(--shadow-lift); cursor: grabbing; will-change: transform;
}
.drag-ghost.settling { transition: transform 220ms var(--ease-out), opacity 220ms ease; }
.card.is-source { opacity: 0; }
.drop-line {
  height: 0; border-radius: 2px; margin: -4px 4px;
  box-shadow: 0 0 0 1.5px var(--duct);
}
body.dragging, body.dragging * { cursor: grabbing !important; }

/* ---------- drawer ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(9, 22, 29, .38); z-index: 70;
  transition: opacity 240ms ease;
}
@starting-style { .scrim { opacity: 0; } }
.scrim.closing { opacity: 0; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(560px, 100%); background: var(--paper); box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column;
  transform: translateX(0); transition: transform 320ms var(--ease-drawer);
}
@starting-style { .drawer { transform: translateX(100%); } }
.drawer.closing { transform: translateX(100%); transition-duration: 220ms; }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 12px; }
.drawer-title-row { display: flex; align-items: flex-start; gap: 12px; }
.drawer-title-row h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; }
.drawer-title-row p { margin: 2px 0 0; color: var(--ink-2); }
.drawer-title-row .icon-btn { margin-left: auto; margin-top: -4px; }
.drawer-title-row .icon-btn svg { fill: none; stroke: currentColor; stroke-width: 2; }
.save-state { font-size: 12px; color: var(--ink-3); min-height: 16px; transition: opacity 200ms ease; }

.stage-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; background: var(--frost); padding: 3px; border-radius: 9px; }
.stage-picker button {
  border: 0; background: transparent; border-radius: 7px; height: 32px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; padding: 0 4px; white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out);
}
.stage-picker button:active { transform: scale(0.96); }
.stage-picker button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-card); }
.stage-picker button[data-stage="paid"][aria-pressed="true"] { background: var(--signal); color: #112C39; }

.drawer-body { flex: 1; overflow-y: auto; padding: 6px 22px 28px; }
.drawer-section { padding: 18px 0 6px; border-bottom: 1px solid var(--line-soft); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-section h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: -0.01em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; margin-bottom: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.span-2 { grid-column: span 2; }

.ledger { display: grid; gap: 0; background: var(--frost); border-radius: 10px; padding: 6px 14px; margin-bottom: 14px; }
.ledger-row { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: lining-nums; }
.ledger-row + .ledger-row { border-top: 1px solid var(--line-soft); }
.ledger-row span:first-child { color: var(--ink-2); }
.ledger-row.strong span { font-weight: 700; color: var(--ink); }
.ledger-row span.due { color: var(--brick); }
.ledger-row span.clear { color: var(--leaf); }

.payments { display: grid; gap: 6px; margin-bottom: 12px; }
.payment {
  display: grid; grid-template-columns: 88px 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; font-variant-numeric: lining-nums;
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
@starting-style { .payment.new { opacity: 0; transform: translateY(-4px); } }
.payment .p-amount { font-weight: 700; }
.payment .p-meta { color: var(--ink-2); font-size: 12.5px; min-width: 0; }
.payment .icon-btn { width: 28px; height: 28px; color: var(--ink-3); }
.payment .icon-btn svg { fill: none; stroke: currentColor; stroke-width: 2; width: 14px; height: 14px; }
.payment a { color: var(--duct); font-size: 12.5px; }
.pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.pay-form .pay-proof { grid-column: 1 / -1; }
.pay-form #add-pay { grid-column: 2; justify-self: end; }
.no-recipient { color: var(--brick); font-weight: 600; }
.recipient-btn {
  border: 0; background: transparent; padding: 0 2px; margin: 0 -2px; font: inherit; font-weight: 600; color: var(--ink);
  border-bottom: 1px dashed var(--line); border-radius: 0; cursor: pointer;
}
.recipient-btn.no-recipient { color: var(--brick); border-bottom-color: currentColor; }
@media (hover: hover) and (pointer: fine) { .recipient-btn:hover { border-bottom-color: var(--duct); } }
.recipient-edit { height: 26px; width: 150px; padding: 0 6px; border: 1px solid var(--duct); border-radius: 5px; background: var(--paper); box-shadow: 0 0 0 3px var(--duct-soft); outline: none; }
.pay-form .btn { height: 36px; }
.empty-line { color: var(--ink-3); font-size: 13px; padding: 4px 0 10px; }

.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.activity time { color: var(--ink-3); margin-right: 6px; font-variant-numeric: lining-nums; }
.drawer-foot { display: flex; justify-content: space-between; padding: 14px 0 0; }

/* ---------- money view ---------- */
.view-money, .view-pos { overflow-y: auto; padding: 22px 20px 40px; }
.money-wrap { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.page-head p { margin: 2px 0 0; color: var(--ink-2); max-width: 64ch; }
.page-head .spacer { flex: 1; }
.month-pick { width: 180px; }

.figures {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; margin-bottom: 22px;
}
.figure { padding: 16px 18px 16px; border-right: 1px solid var(--line-soft); }
.figure:last-child { border-right: 0; }
.figure .f-label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.figure .f-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: lining-nums; margin-top: 4px; }
.figure .f-note { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.figure.owed .f-value { color: var(--brick); }
.figure.margin .f-value::after {
  content: ''; display: block; height: 3px; width: 40px; margin-top: 8px; border-radius: 2px; background: var(--signal);
}

.panels { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; padding: 16px 18px 10px; min-width: 0; }
.panel.wide { grid-column: span 2; }
.panel h2 { margin: 0; font-size: 16.5px; letter-spacing: -0.01em; }
.panel .panel-sub { margin: 2px 0 12px; color: var(--ink-2); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums; }
table.data th {
  text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 600;
  padding: 7px 8px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { table.data tbody tr.clickable:hover { background: var(--frost); } }
td .due { color: var(--brick); font-weight: 700; }
td .neg { color: var(--brick); }
.age { display: inline-block; min-width: 54px; }
.bar-cell { position: relative; }
.mini-bar { height: 6px; border-radius: 3px; background: var(--signal); margin-top: 4px; transform-origin: left; }
.panel-empty { color: var(--ink-3); padding: 10px 0 16px; }

/* ---------- POs ---------- */
.po-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1.2fr auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.paid-toggle { border: 0; border-radius: 6px; padding: 3px 9px; font-weight: 600; font-size: 12.5px; cursor: pointer; transition: transform 140ms var(--ease-out); }
.paid-toggle:active { transform: scale(0.95); }
.paid-toggle.yes { background: var(--leaf-soft); color: var(--leaf); }
.paid-toggle.no { background: var(--brick-soft); color: var(--brick); }

/* ---------- confirm dialog (hold to clear) ---------- */
.confirm {
  border: 0; border-radius: 14px; padding: 24px; width: min(420px, calc(100% - 32px));
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lift);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.confirm[open] { opacity: 1; transform: scale(1); }
@starting-style { .confirm[open] { opacity: 0; transform: scale(0.96); } }
.confirm::backdrop { background: rgba(9, 22, 29, .45); }
.confirm h2 { margin: 0 0 6px; font-size: 19px; }
.confirm p { margin: 0 0 20px; color: var(--ink-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-hold { position: relative; overflow: hidden; color: var(--brick); border-color: var(--brick); min-width: 140px; }
.btn-hold .hold-fill {
  position: absolute; inset: 0; background: var(--brick);
  clip-path: inset(0 100% 0 0); transition: clip-path 200ms var(--ease-out);
}
.btn-hold .hold-label { position: relative; }
.btn-hold.holding .hold-fill { clip-path: inset(0 0 0 0); transition: clip-path 1500ms linear; }
.btn-hold.holding .hold-label { color: #fff; transition: color 600ms ease 500ms; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 9px;
  box-shadow: var(--shadow-lift); display: flex; gap: 12px; align-items: center; font-weight: 500;
  transition: opacity 260ms ease, transform 260ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(12px); } }
.toast.leaving { opacity: 0; transform: translateY(8px); transition-duration: 180ms; }
.toast button { border: 0; background: transparent; color: var(--signal); font-weight: 700; cursor: pointer; padding: 0; }
.toast.error { background: var(--brick); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .figures { grid-template-columns: repeat(3, 1fr); }
  .figure:nth-child(3) { border-right: 0; }
  .figure:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
  .panels { grid-template-columns: 1fr; }
  .panel.wide { grid-column: auto; }
  .search { width: 200px; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; }
  .tabs button { flex: 1; }
  .search { display: none; }
  .columns { grid-auto-columns: 84%; padding: 12px 16px 20px; }
  .board-strip { padding: 14px 16px 2px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figure { border-right: 0 !important; border-top: 1px solid var(--line-soft); }
  .figure:nth-child(-n+2) { border-top: 0; }
  .figure:nth-child(odd) { border-right: 1px solid var(--line-soft) !important; }
  .view-money, .view-pos { padding: 18px 16px 32px; }
  .po-form { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stage-picker { grid-template-columns: repeat(3, 1fr); }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .column { animation: none; }
  .drawer, .drawer.closing { transition: opacity 200ms ease; transform: none; }
  @starting-style { .drawer { opacity: 0; transform: none; } }
  .drawer.closing { opacity: 0; }
  .card.just-moved { animation: none; box-shadow: 0 0 0 2px var(--signal); }
  .meter-fill { transition: none; }
  .toast { transition: opacity 200ms ease; }
  .btn:active, .card:active { transform: none; }
}

/* ---------- PO price list ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.price-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.price-search { width: min(320px, 100%); }
.price-table td { padding-top: 5px; padding-bottom: 5px; }
.price-table tr.group-start td { border-top: 1px solid var(--line); }
.price-table tbody tr:first-child td { border-top: 0; }
.cell-input {
  width: 96px; height: 30px; padding: 0 8px; text-align: right; font: inherit; font-variant-numeric: lining-nums;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}
.cell-input[data-field="po_price"] { font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .cell-input:hover { border-color: var(--line); background: var(--paper); } }
.cell-input:focus { outline: none; border-color: var(--duct); background: var(--paper); box-shadow: 0 0 0 3px var(--duct-soft); }
.price-table tr.saved td { animation: row-saved 900ms var(--ease-out); }
@keyframes row-saved { from { background: var(--signal-soft); } to { background: transparent; } }
.row-del { width: 28px; height: 28px; color: var(--ink-3); }
.row-del svg { fill: none; stroke: currentColor; stroke-width: 2; width: 14px; height: 14px; }
.prices-empty p { margin: 6px 0 12px; max-width: 60ch; }
.import-dialog { width: min(680px, calc(100% - 32px)); }
.import-dialog > p { margin: 0 0 12px; }
.import-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; color: var(--ink-2); }
.import-summary b { color: var(--ink); }
.import-summary .s-new b { color: var(--leaf); }
.import-summary .s-changed b { color: var(--duct); }
.import-table { max-height: 46vh; overflow: auto; margin-bottom: 16px; border: 1px solid var(--line-soft); border-radius: 8px; }
.import-table table { margin: 0; }
.import-table th { position: sticky; top: 0; background: var(--paper); }
.up { color: var(--brick); font-size: 12px; font-weight: 600; }
.down { color: var(--leaf); font-size: 12px; font-weight: 600; }
.cost-hint { font-size: 12.5px; color: var(--ink-2); margin: -4px 0 12px; }
.link-btn { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 600; color: var(--duct); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) { .tabs button { padding: 0 6px; font-size: 13px; } }
@media (max-width: 760px) {
  .tabs button { white-space: nowrap; }
  .price-table th:nth-child(2), .price-table td:nth-child(2) { display: none; }
  .price-table td, .price-table th { padding-left: 6px; padding-right: 6px; }
  .price-table .cell-input { width: 84px; }
}

/* ---------- header name ---------- */
.brand strong { white-space: nowrap; }
.brand span { white-space: nowrap; }
@media (max-width: 1400px) { .preview-note { display: none; } .search { width: 220px; } }
@media (max-width: 1240px) { .search { display: none; } }

/* ---------- pickers (styled dropdowns) ---------- */
.picker-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.field { position: relative; }
.picker {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px 0 11px;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--paper); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms var(--ease-out);
}
.picker .picker-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker.placeholder .picker-label { color: var(--ink-3); }
.picker svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms var(--ease-out); }
.picker[aria-expanded="true"] { border-color: var(--duct); box-shadow: 0 0 0 3px var(--duct-soft); }
.picker[aria-expanded="true"] svg { transform: rotate(180deg); }
.picker:focus-visible { outline: none; border-color: var(--duct); box-shadow: 0 0 0 3px var(--duct-soft); }
.picker:disabled { cursor: not-allowed; background: var(--frost); color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .picker:not(:disabled):hover { border-color: var(--ink-3); } }
.field input:disabled { background: var(--frost); color: var(--ink-3); cursor: not-allowed; }
.picker-pop {
  position: fixed; z-index: 200; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lift);
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
@starting-style { .picker-pop { opacity: 0; transform: scale(0.97) translateY(-3px); } }
.picker-pop.leaving { opacity: 0; transform: scale(0.98); transition-duration: 100ms; }
.picker-opt {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-weight: 500;
}
.picker-opt.blank { color: var(--ink-3); font-weight: 400; }
.picker-opt.active { background: var(--frost); }
.picker-opt svg { width: 15px; height: 15px; fill: none; stroke: var(--duct); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.picker-opt.selected { color: var(--duct); font-weight: 650; }
.picker-opt.selected svg { opacity: 1; }
.picker-empty { padding: 9px 10px; color: var(--ink-3); font-size: 13px; white-space: normal; max-width: 260px; }
dialog .picker-pop { position: fixed; }

/* ---------- cleaning board, cards ---------- */
.columns-4 { grid-auto-columns: minmax(240px, 1fr); }
.card.job .card-hp { font-weight: 500; color: var(--ink-2); }
.card-po { margin-top: 6px; font-size: 12px; color: var(--ink-3); font-variant-numeric: lining-nums; }
.card-po .neg { color: var(--brick); }
.stage-picker.four { grid-template-columns: repeat(4, 1fr); }
.stage-picker button[data-stage="c_paid"][aria-pressed="true"] { background: var(--signal); color: #112C39; }

/* ---------- finance ---------- */
.subtabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line-soft); margin-bottom: 16px; }
.subtabs button, .seg button {
  border: 0; background: transparent; color: var(--ink-2); height: 32px; padding: 0 14px; border-radius: 7px;
  font: inherit; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.subtabs button:active, .seg button:active { transform: scale(0.97); }
.subtabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--frost); align-self: end; }
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-card); }
.seg.small button { height: 28px; padding: 0 10px; font-size: 13px; }
.figures-3 { grid-template-columns: repeat(3, 1fr) !important; }
.figures-3 .figure { border-top: 0 !important; }
.figures-3 .figure:nth-child(-n+2) { border-right: 1px solid var(--line-soft) !important; }
.entry-form {
  display: grid; grid-template-columns: auto 150px 190px minmax(160px, 1fr) 140px 160px auto; gap: 10px; align-items: end;
  padding: 14px 16px; margin-bottom: 18px;
}
.entry-form .btn { height: 36px; }
.panel-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.panel.wide-left { grid-column: auto; }
.ledger-table td { vertical-align: top; }
.ledger-table .nowrap { white-space: nowrap; }
.ledger-table .in { color: var(--leaf); font-weight: 650; white-space: nowrap; }
.ledger-table .out { color: var(--ink); font-weight: 600; white-space: nowrap; }
.ledger-table .auto { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.cat { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--frost); color: var(--ink-2); }
.cat.income { background: var(--leaf-soft); color: var(--leaf); }
.cat-bars { display: grid; gap: 12px; padding-bottom: 12px; }
.cat-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; }
.cat-bar b { font-variant-numeric: lining-nums; }
.cat-bar i { grid-column: span 2; height: 6px; border-radius: 3px; background: var(--frost); position: relative; overflow: hidden; }
.cat-bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--duct); border-radius: 3px; animation: bar-in 600ms var(--ease-out) both; }
@keyframes bar-in { from { width: 0; } }

/* ---------- calendar ---------- */
.view-money .cal-wrap { max-width: 1400px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav strong { min-width: 132px; text-align: center; font-size: 15px; }
.cal-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; background: none !important; border: 0 !important; padding: 0 !important; }
.legend span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--ev); }
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; margin-bottom: 18px;
}
.cal-dow { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line-soft); }
.cal-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background-color 140ms ease; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: var(--frost); opacity: .5; cursor: default; }
@media (hover: hover) and (pointer: fine) { .cal-day:not(.out):hover { background: color-mix(in srgb, var(--frost) 60%, transparent); } }
.cal-num { font-size: 13px; font-weight: 650; color: var(--ink-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: lining-nums; }
.cal-day.today .cal-num { background: var(--ink); color: var(--paper); }
.cal-evs { display: grid; gap: 3px; min-width: 0; }
.ev {
  --ev: var(--ink-3);
  display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%;
  border: 0; border-left: 3px solid var(--ev); border-radius: 5px; padding: 3px 6px;
  background: color-mix(in srgb, var(--ev) 14%, var(--paper)); color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 140ms ease;
}
.ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev time { font-weight: 500; color: var(--ink-2); flex: none; font-variant-numeric: lining-nums; }
.ev:active { transform: scale(0.97); }
.ev.done span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .ev:hover { background: color-mix(in srgb, var(--ev) 24%, var(--paper)); } }
.ev-install { --ev: var(--duct); }
.ev-clean { --ev: var(--leaf); }
.ev-supplier { --ev: #D9A400; }
.ev-delivery { --ev: #8A63B8; }
.ev-other { --ev: var(--ink-3); }
.agenda { display: none; }
.need-date { margin-bottom: 18px; }
.need-list { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
.need-list .ev { width: auto; max-width: 100%; }

@media (max-width: 1100px) {
  .entry-form { grid-template-columns: 1fr 1fr 1fr; }
  .entry-form .seg { grid-column: span 3; justify-self: start; }
}
@media (max-width: 760px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; white-space: nowrap; padding: 0 12px; }
  .brand strong { font-size: 14.5px; }
  .cal { display: none; }
  .agenda { display: grid; gap: 8px; margin-bottom: 18px; }
  .agenda-day { display: grid; grid-template-columns: 44px 1fr; gap: 10px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px; }
  .agenda-day.today { border-color: var(--ink); }
  .agenda-date { display: grid; justify-items: center; align-content: start; line-height: 1.1; }
  .agenda-date b { font-size: 20px; }
  .agenda-date span { font-size: 12px; color: var(--ink-3); }
  .agenda-list { display: grid; gap: 4px; min-width: 0; }
  .agenda-list .ev { font-size: 13px; padding: 6px 8px; }
  .entry-form { grid-template-columns: 1fr 1fr; }
  .entry-form .seg { grid-column: span 2; }
  .entry-form .e-desc { grid-column: span 2; }
  .figures-3 { grid-template-columns: 1fr !important; }
  .figures-3 .figure { border-right: 0 !important; border-top: 1px solid var(--line-soft) !important; }
  .figures-3 .figure:first-child { border-top: 0 !important; }
  .head-actions { width: 100%; }
  .cal-nav { margin-right: auto; }
  .columns-4 { grid-auto-columns: 84%; }
}
@media (prefers-reduced-motion: reduce) {
  .picker-pop, .cat-bar i::after { transition: none; animation: none; }
}
.tabs button { white-space: nowrap; padding: 0 12px; }
@media (max-width: 1520px) { .preview-note { display: none; } }
.ledger-panels { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); align-items: start; }
.sticky-panel { position: sticky; top: 12px; }
.ledger-table td:nth-child(4) { min-width: 120px; }
@media (max-width: 1100px) { .ledger-panels { grid-template-columns: 1fr; } .sticky-panel { position: static; } }

/* dropdown lists in the top layer (above dialogs) */
.picker-pop[popover] { inset: auto; margin: 0; overflow-y: auto; }
/* calendar: schedule several cards at once */
.import-dialog:has(.event-form) { width: min(560px, calc(100% - 32px)); }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.pick-list { max-height: min(320px, 42vh); overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 10px; padding: 4px; display: grid; gap: 2px; }
.pick { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; transition: background-color 120ms ease; }
.pick input { width: 18px; height: 18px; accent-color: var(--duct); }
.pick.on { background: var(--duct-soft); }
@media (hover: hover) and (pointer: fine) { .pick:not(.on):hover { background: var(--frost); } }
.pick-main { display: grid; min-width: 0; }
.pick-main b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-main span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-when { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pick-when.none { color: var(--brick); }
/* calendar colours (Van, 24 Nov): installation yellow like the logo, cleaning blue, supplier run black, service green */
.ev-install { --ev: var(--signal); }
.ev-clean { --ev: var(--duct); }
.ev-supplier { --ev: #112C39; }
.ev-service { --ev: var(--leaf); }
.ev-other { --ev: var(--ink-3); }
.ev-install { background: color-mix(in srgb, var(--signal) 26%, var(--paper)); }
@media (hover: hover) and (pointer: fine) { .ev-install:hover { background: color-mix(in srgb, var(--signal) 40%, var(--paper)); } }
.ev-supplier { background: color-mix(in srgb, #112C39 12%, var(--paper)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ev-supplier { --ev: #C9D6DE; } }
:root[data-theme="dark"] .ev-supplier { --ev: #C9D6DE; }

/* ---------- finance: accounts, period, report ---------- */
.period-pick { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.period-pick .field { min-width: 150px; }
.period-pick .field:first-child { min-width: 210px; }
.subtabs { align-items: center; }
.period-note { padding: 0 12px 0 10px; color: var(--ink-3); font-size: 13px; font-weight: 500; }
.figures-4 { grid-template-columns: repeat(4, 1fr) !important; }
.figures-4 .figure { border-top: 0 !important; border-right: 1px solid var(--line-soft) !important; }
.figures-4 .figure:last-child { border-right: 0 !important; }
.f-value.neg, b.neg { color: var(--brick); }
.fin-notes { display: grid; gap: 6px; margin: -10px 0 18px; font-size: 13.5px; color: var(--ink-2); }
.warn-note { color: var(--brick); }
.accts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.acct { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px 8px; border-top: 3px solid var(--acct); }
.acct-cash { --acct: var(--signal); } .acct-hq { --acct: var(--duct); } .acct-partner { --acct: var(--leaf); } .acct-unset { --acct: var(--brick); }
.acct-head { display: flex; align-items: center; gap: 8px; }
.acct-head b { font-size: 15px; }
.acct-val { margin-left: auto; font-size: 18px; font-weight: 700; font-variant-numeric: lining-nums; }
.acct-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--acct); }
.acct-sub { margin: 2px 0 8px; font-size: 12.5px; color: var(--ink-3); }
.acct-out { margin: 4px 0 8px; font-size: 12.5px; color: var(--ink-2); }
table.data.mini td { padding: 5px 0; font-size: 13px; }
table.data.mini .in { color: var(--leaf); font-weight: 600; }
.acct-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--acct) 18%, var(--paper)); color: var(--ink); }
.seg.small { flex-wrap: wrap; }

.report-dialog {
  width: min(960px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 14px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lift);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.report-dialog[open] { opacity: 1; transform: none; }
@starting-style { .report-dialog[open] { opacity: 0; transform: translateY(8px) scale(0.98); } }
.report-dialog::backdrop { background: rgba(9, 22, 29, .45); }
.report-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line-soft); }
.report-bar .spacer { flex: 1; }
.report { padding: 24px 28px 32px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; }
.report-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.report-head p { margin: 2px 0 0; color: var(--ink-2); }
.r-meta { display: grid; text-align: right; font-size: 13px; color: var(--ink-2); }
.r-meta b { color: var(--ink); font-size: 14px; }
.r-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.r-figs div { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.r-figs span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.r-figs b { font-size: 20px; font-variant-numeric: lining-nums; }
.r-figs .r-total { background: var(--signal-soft); border-color: var(--signal); }
.r-note { color: var(--ink-2); font-size: 13px; margin: 6px 0 16px; }
.r-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 10px; }
.r-cols.two { grid-template-columns: 1fr 1fr; }
.report h3 { font-size: 14px; margin: 14px 0 6px; }
.report table.data td, .report table.data th { padding: 5px 6px; font-size: 13px; }
.report .r-sum td { font-weight: 700; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .accts { grid-template-columns: 1fr; } .figures-4 { grid-template-columns: 1fr 1fr !important; } .figures-4 .figure:nth-child(2) { border-right: 0 !important; } .figures-4 .figure:nth-child(n+3) { border-top: 1px solid var(--line-soft) !important; } }
@media (max-width: 760px) {
  .r-figs, .r-cols, .r-cols.two { grid-template-columns: 1fr 1fr; }
  .report { padding: 18px 16px 24px; }
  .report-bar { flex-wrap: wrap; }
  .period-pick { width: 100%; }
  .period-pick .field { flex: 1; min-width: 0 !important; }
  .figures-4 { grid-template-columns: 1fr !important; }
  .figures-4 .figure { border-right: 0 !important; border-top: 1px solid var(--line-soft) !important; }
  .figures-4 .figure:first-child { border-top: 0 !important; }
  .period-note { display: none; }
}
@media print {
  body.printing > *:not(#report-dialog) { display: none !important; }
  body.printing #report-dialog { position: static; width: auto; max-height: none; box-shadow: none; border-radius: 0; overflow: visible; }
  body.printing #report-dialog::backdrop { display: none; }
  body.printing .no-print { display: none !important; }
  body.printing .report { padding: 0; }
  body.printing { background: #fff; }
}
.report-bar .icon-btn { width: 36px; height: 36px; color: var(--ink-2); }
.report-bar .icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* PO prices: brand groups, five columns */
.price-tools .seg { align-self: center; }
.price-table { table-layout: fixed; width: 100%; }
.price-table .c-model { width: 30%; } .price-table .c-type { width: 18%; } .price-table .c-cap { width: 18%; }
.price-table .c-sup { width: 14%; } .price-table .c-price { width: 15%; } .price-table .c-del { width: 44px; }
.price-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-table .brand-row th { text-align: left; padding: 18px 8px 6px; font-size: 15px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); background: transparent; text-transform: none; letter-spacing: 0; }
.price-table .brand-row th .muted { font-size: 12.5px; font-weight: 500; margin-left: 6px; }
.price-table .brand-group:first-of-type .brand-row th { padding-top: 6px; }
.price-table tbody.brand-group tr:nth-child(2) td { border-top: 0; }
@media (max-width: 760px) {
  .price-table .c-type, .price-table .c-sup { width: 0; }
  .price-table th:nth-child(4), .price-table td:nth-child(4) { display: none; }
  .price-table .c-model { width: 44%; } .price-table .c-cap { width: 30%; } .price-table .c-price { width: 26%; }
}

/* "Type your own" in dropdowns */
.picker-opt.own { color: var(--duct); font-weight: 600; border-top: 1px solid var(--line-soft); margin-top: 2px; }
.picker-own { width: 100%; height: 36px; padding: 0 11px; font: inherit; border: 1px solid var(--duct); border-radius: var(--radius-control); background: var(--paper); color: var(--ink); box-shadow: 0 0 0 3px var(--duct-soft); outline: none; }

/* ledger: income or expense */
.kind-chip { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.kind-chip.income { background: var(--leaf-soft, #e3f3e8); color: var(--leaf); }
.kind-chip.expense { background: var(--frost); color: var(--ink-2); }
/* supplier POs: linked unit cards */
.po-cards { display: grid; font-weight: 600; white-space: nowrap; }
.po-cards .muted { font-size: 12px; font-weight: 400; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
#po-hint:empty, #cost-hint:empty { display: none; }

/* ---------- Admin View ---------- */
.tab-admin { display: inline-flex; align-items: center; gap: 6px; }
.tab-admin svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.admin-lock { display: grid; place-items: center; min-height: 60vh; }
.lock-card { width: min(400px, 100%); padding: 28px; display: grid; gap: 12px; text-align: left; }
.lock-card h1 { font-size: 22px; margin: 0; }
.lock-card p { margin: 0; color: var(--ink-2); }
.lock-card .btn { justify-self: start; }
.lock-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--signal-soft); color: var(--ink); }
.lock-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lock-note { font-size: 12.5px; }
.admin-top { display: grid; grid-template-columns: minmax(300px, 1fr) 2fr; gap: 14px; margin-bottom: 18px; align-items: start; }
.net-card { padding: 18px 20px; margin: 0; }
.net-lines { display: grid; margin-top: 10px; }
.nl { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.nl:first-child { border-top: 0; }
.nl b { font-weight: 600; white-space: nowrap; }
.nl.sub { font-weight: 650; border-top-color: var(--line); }
.nl.sub b { font-weight: 700; }
.nl.total { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 10px; font-size: 16px; font-weight: 700; }
.nl.total b { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.nl.total.neg b { color: var(--brick); }
.net-card .warn-note { font-size: 12.5px; margin: 10px 0 0; }
.funds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fund .acct-val.neg { color: var(--brick); }
.admin-form { grid-template-columns: 150px 1.4fr 150px 150px 1fr auto !important; }
@media (max-width: 1100px) { .admin-top { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .funds { grid-template-columns: 1fr; } .admin-form { grid-template-columns: 1fr 1fr !important; } .admin-form .a-name, .admin-form .a-notes { grid-column: span 2; } }
/* header fits with the Admin View tab */
@media (max-width: 1400px) { .search { width: 170px; } }
@media (max-width: 1340px) { .search { display: none; } }
@media (max-width: 1200px) and (min-width: 761px) { .tabs button { padding: 0 9px; font-size: 13.5px; } .brand-sub, .brand small { display: none; } }

.po-paidby + .picker { min-width: 150px; height: 32px; }
.po-paidby + .picker { max-width: 220px; }

/* ---------- materials ---------- */
.tabs button { position: relative; }
.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--brick); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.low-banner { background: var(--brick-soft, #FBE7E3); color: var(--ink); border: 1px solid color-mix(in srgb, var(--brick) 30%, transparent); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.low-banner b { color: var(--brick); }
.mat-table td { vertical-align: middle; }
.mat-unit { margin-left: 8px; font-size: 12.5px; }
.stock-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.stock-cell.low, .stock-cell.out { color: var(--brick); }
.stock-chip { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.stock-chip.ok { background: var(--leaf-soft); color: var(--leaf); }
.stock-chip.low { background: var(--signal-soft); color: var(--ink); }
.stock-chip.out { background: var(--brick); color: #fff; }
.btn-small { height: 28px; padding: 0 10px; font-size: 13px; }
.mat-table .cell-input { width: 72px; }
.moves { list-style: none; margin: 0; padding: 0; display: grid; }
.moves li { display: grid; grid-template-columns: 84px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.moves li:first-child { border-top: 0; }
.mv-qty { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-qty.pos { color: var(--leaf); }
.mv-main { display: grid; min-width: 0; }
.mv-main span { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.mv-date { color: var(--ink-3); font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.mv-date .row-del { width: 24px; height: 24px; }
.gap.neg { color: var(--brick); font-weight: 650; }
.gap.pos { color: var(--leaf); font-weight: 650; }
.new-tag { color: var(--leaf); }
@media (max-width: 760px) { .mat-table th:nth-child(4), .mat-table td:nth-child(4) { display: none; } }

.vs-po { color: var(--ink-2); }
.vs-po.under { color: var(--brick); font-weight: 700; }
:root { --orange: #C8641A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --orange: #F0A060; } }
:root[data-theme="dark"] { --orange: #F0A060; }
.vs-po.warn { color: var(--orange); font-weight: 700; }
.vs-po.good { color: var(--leaf); font-weight: 700; }
.mat-table .nowrap { white-space: nowrap; }
.mat-table .nowrap .row-del { vertical-align: middle; }
@media (max-width: 1580px) { .search { display: none; } }
@media (max-width: 1380px) and (min-width: 1101px) { .tabs button { padding: 0 10px; } }

/* activity log (Admin View) */
.audit-head { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.audit-head .panel-sub { margin-bottom: 0; }
.audit-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.audit-list li { display: grid; grid-template-columns: 170px 1fr auto; gap: 14px; padding: 8px 2px; border-top: 1px solid var(--line-soft); font-size: 13.5px; align-items: baseline; }
.audit-list li:first-child { border-top: 0; }
.audit-list time { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.a-dev { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
@media (max-width: 760px) { .audit-list li { grid-template-columns: 1fr; gap: 2px; } }
.menu-who { margin: 2px 10px 6px; font-size: 12.5px; color: var(--ink-3); }

/* who is logged in + log out, top right */
.who-chip { font-size: 12px; font-weight: 600; color: #D6E4EC; background: rgba(255,255,255,.12); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
#logout { white-space: nowrap; }
@media (max-width: 700px) { .who-chip { display: none; } }

/* ================= glass look (matches the login page, Van 24 Nov) ================= */
:root {
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .86);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shadow: 0 24px 60px -32px rgba(17, 44, 57, .32), 0 1px 3px rgba(17, 44, 57, .06);
  --bg-glow:
    radial-gradient(55% 50% at 8% 0%, rgba(255, 194, 7, .20), transparent 70%),
    radial-gradient(60% 55% at 100% 100%, rgba(62, 125, 166, .26), transparent 70%),
    linear-gradient(160deg, #F7FAFC 0%, #E4EEF5 100%);
  --top-ink: #112C39;
  --top-ink-2: #4E6676;
  --radius-card: 14px;
  --radius-control: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --glass: rgba(21, 39, 47, .55);
    --glass-strong: rgba(21, 39, 47, .88);
    --glass-edge: rgba(255, 255, 255, .07);
    --glass-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .3);
    --bg-glow:
      radial-gradient(55% 50% at 8% 0%, rgba(255, 194, 7, .08), transparent 70%),
      radial-gradient(60% 55% at 100% 100%, rgba(62, 125, 166, .22), transparent 70%),
      linear-gradient(160deg, #0F1E26 0%, #0A161C 100%);
    --top-ink: #E6EEF2;
    --top-ink-2: #A5B8C3;
  }
}
body { background: var(--bg-glow); background-attachment: fixed; }

/* top bar: frosted, light */
.topbar {
  background: var(--glass); color: var(--top-ink);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--glass-edge); box-shadow: 0 10px 30px -24px rgba(17, 44, 57, .4);
}
.brand span { color: var(--top-ink-2); }
.tabs { background: rgba(17, 44, 57, .06); border-radius: 12px; padding: 4px; }
.tabs button { color: var(--top-ink-2); border-radius: 9px; height: 32px; }
.tabs button[aria-selected="true"] { background: var(--glass-strong); color: var(--top-ink); box-shadow: 0 2px 8px -2px rgba(17, 44, 57, .18); }
@media (hover: hover) and (pointer: fine) { .tabs button[aria-selected="false"]:hover { color: var(--top-ink); } }
.top-actions .icon-btn { color: var(--top-ink); }
@media (hover: hover) and (pointer: fine) { .top-actions .icon-btn:hover { background: rgba(17, 44, 57, .07); } }
.search { background: var(--glass-strong); border: 1px solid var(--line); color: var(--ink-3); border-radius: 10px; }
.search input { color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.who-chip { color: var(--top-ink); background: rgba(17, 44, 57, .07); }
.preview-note { color: var(--top-ink-2) !important; }
@media (prefers-color-scheme: dark) {
  .tabs { background: rgba(255, 255, 255, .06); }
  .who-chip { background: rgba(255, 255, 255, .1); }
}

/* surfaces */
.column {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card { background: var(--glass-strong); border-color: var(--glass-edge); box-shadow: 0 6px 18px -12px rgba(17, 44, 57, .28), 0 1px 2px rgba(17, 44, 57, .05); }
@media (hover: hover) and (pointer: fine) { .card:hover { box-shadow: 0 14px 30px -16px rgba(17, 44, 57, .38), 0 1px 2px rgba(17, 44, 57, .06); } }
.panel, .cal {
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 18px; box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.cal-day.out { background: rgba(17, 44, 57, .03); }
.drawer, .menu {
  background: var(--glass-strong); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
.drawer { border-left: 1px solid var(--glass-edge); }
.menu { border-color: var(--glass-edge); border-radius: 14px; }
.confirm, .report-dialog { border-radius: 20px; }
.scrim, .confirm::backdrop, .report-dialog::backdrop { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* controls a little softer and taller, like the login */
.btn { border-radius: 10px; }
.btn-primary { box-shadow: 0 6px 16px -10px rgba(62, 125, 166, .8); }
.btn-accent { box-shadow: 0 6px 16px -10px rgba(214, 160, 0, .9); }
.field input, .field select, .field textarea { border-radius: 10px; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 3px rgba(62, 125, 166, .2); }

/* header never overlaps or hides a tab (Van 24 Nov): every tab stays visible. When the tabs don't fit beside
   the name and buttons, app.js adds .stacked and they move to their own full-width row, wrapping onto a
   second line on narrow phones. */
.brand { flex: none; min-width: 0; }
.top-actions { flex: none; }
.topbar { flex-wrap: wrap; row-gap: 8px; }
.tabs { flex: none; min-width: 0; overflow: visible !important; flex-wrap: wrap; width: auto; order: 0; }
.tabs button { flex: none !important; white-space: nowrap; }
.topbar.stacked .tabs { order: 3; flex-basis: 100%; width: 100%; }
.topbar.stacked .tabs { display: grid; grid-template-columns: repeat(var(--tab-cols, 4), minmax(0, 1fr)); gap: 2px; }
.topbar.stacked .tabs button { padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .brand div { display: none; } .top-actions { gap: 6px; } #new-unit { padding: 0 10px; } }

/* long text wraps instead of running into its neighbour */
.card-top { flex-wrap: wrap; row-gap: 0; }
.card.job .card-hp { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-table thead th { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; vertical-align: bottom; }
.topbar.stacked .tabs button { text-align: center; justify-content: center; }

/* date filter on Inventory, Cleaning and Supplier POs */
.board-strip { align-items: flex-end; }
.board-strip h1 { align-self: flex-end; order: 0; }
.board-strip .date-filter { margin-left: auto; order: 1; }
.board-strip .facts { order: 2; flex-basis: 100%; }
.date-filter .field:first-child { min-width: 180px; }
.date-filter .df-clear { height: 36px; }
.page-head .date-filter { margin-left: auto; }
@media (max-width: 760px) { .board-strip .date-filter { margin-left: 0; width: 100%; } }

/* search on smaller screens: an icon that opens the box underneath */
@media (max-width: 1580px) {
  .search { display: flex !important; position: relative; width: 36px !important; padding: 0; justify-content: center; cursor: pointer; flex: none; }
  .search input { position: absolute; top: calc(100% + 10px); right: 0; width: 0; height: 42px; padding: 0; opacity: 0; pointer-events: none;
    background: var(--glass-strong); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: opacity 140ms ease; z-index: 30; }
  .search:focus-within input { width: min(320px, calc(100vw - 32px)); padding: 0 14px; opacity: 1; pointer-events: auto; }
  .search.has-q { color: var(--duct); border-color: var(--duct); }
  .search.has-q::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
}
/* report: amounts stay on one line; the bar wraps instead of pushing the close button down */
.report-dialog td.r, .report-dialog .r-figs b { white-space: nowrap; }
.report-bar { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 600px) { .report-bar .spacer { display: none; } .report-bar #r-close { order: -1; margin-left: auto; } .report-bar b { order: -2; } }
@media (max-width: 380px) { .top-actions { gap: 4px; } #logout, #new-unit { padding: 0 9px; } .topbar { gap: 8px; } }

/* Admin report */
.r-period .period-pick { flex-wrap: nowrap; }
.r-period .field > span { display: none; }
.r-period .period-pick .field:first-child { min-width: 170px; }
.r-period .period-pick .field { min-width: 140px; }
.report .r-h2 { font-size: 17px; margin: 26px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); letter-spacing: -0.01em; }
.admin-report .r-figs + .r-figs { margin-top: 0; }
.admin-report .r-figs b { font-size: 18px; }
.report .neg { color: var(--brick); }
.report .warn-txt { color: var(--orange, #C9731A); }
.report table.data { margin-bottom: 4px; }
.report table.data td.r, .report table.data th.r { white-space: nowrap; }
@media (max-width: 900px) { .r-period { order: 5; flex-basis: 100%; } .r-period .period-pick { flex-wrap: wrap; } }
@media (max-width: 760px) {
  .admin-report .r-cols, .admin-report .r-cols.two { grid-template-columns: minmax(0, 1fr); }
  .admin-report table.data { display: block; overflow-x: auto; }
}

/* dark mode: primary buttons dark enough for white text (about 5:1) */
@media (prefers-color-scheme: dark) { .btn-primary { background: #2B6A93; border-color: #2B6A93; color: #fff; } }
@media (prefers-color-scheme: dark) and (hover: hover) and (pointer: fine) { .btn-primary:hover { background: #245B7F; } }
.ledger-row .muted { color: var(--ink-3); font-weight: 500; }

/* Finance entry being edited */
.entry-form.editing { box-shadow: 0 0 0 2px var(--duct) inset, var(--shadow-1, 0 1px 2px rgba(0,0,0,.06)); }
.entry-form .edit-note { flex-basis: 100%; grid-column: 1 / -1; margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }
.ledger-table tr.is-editing td { background: color-mix(in srgb, var(--duct) 12%, transparent); }
.row-edit svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
/* search: where the matches are */
.search-hits { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13.5px; color: var(--ink-2); }
.search-hits .link-btn { font-weight: 600; }
/* POs: paid on date under the toggle */
.po-status .paid-on { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.po-status .paid-on input { font: inherit; font-size: 12.5px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); max-width: 9.5em; }
/* phone: on a sold unit, customer and payments come first */
@media (max-width: 760px) {
  .drawer-body.sold { display: flex; flex-direction: column; }
  .drawer-body.sold > * { flex-shrink: 0; }
  .drawer-body.sold > [data-sec="customer"] { order: -3; }
  .drawer-body.sold > [data-sec="pay"] { order: -2; }
  .drawer-body.sold > [data-sec="money"] { order: -1; }
}

/* row buttons sit on one line with their neighbours */
td .row-del, td .row-edit { display: inline-grid; vertical-align: middle; }

/* board strip: title with its tool button */
.strip-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.due-btn.has-due { border-color: var(--signal, #E8A317); color: var(--ink); background: color-mix(in srgb, var(--signal, #E8A317) 16%, transparent); font-weight: 600; }
.tab-badge.due { background: var(--duct); }
/* reminder and warranty dialogs */
.import-dialog:has(.tool-dialog) { width: min(680px, calc(100% - 24px)); max-height: calc(100% - 24px); }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool-head h2 { margin: 0; }
.tool-sub { margin: 4px 0 14px !important; font-size: 13.5px; }
.tool-dialog .field { margin-bottom: 12px; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tool-list li { display: flex; gap: 10px 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass, transparent); }
.tool-list li.clickable { cursor: pointer; }
.tool-list li.clickable:hover { border-color: var(--duct); }
.tl-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 280px; overflow-wrap: anywhere; }
.tl-main .muted { font-size: 13px; }
.tl-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--line-soft, #eef2f5); color: var(--ink-2); white-space: nowrap; }
