/* ═══════════════════════════════════════════════════════════════════════════
   shell.css — the clean app shell (appShell.js):
   navy app bar · Projects / Workspace / Master tabs · tile grids · list cards ·
   options bottom-sheet · profile page. Loaded after style.css; overrides the
   older header / bottom-bar rules there.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --ts-navy: #c2321f;
  --ts-navy2: #ef8420;
  --ts-blue: var(--brand, #d9481f);
  --ts-bg: #eef1f6;
  --ts-card: #ffffff;
  --ts-ink: #111827;
  --ts-ink2: #4b5563;
  --ts-muted: #8a94a6;
  --ts-line: #e5e9f0;
  --ts-green: #1f8a3b;
  --ts-red: #d92d20;
  --ts-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
}

main, #appContainer main { background: var(--ts-bg) !important; }

/* ── App bar ─────────────────────────────────────────────────────────────── */
#breadcrumbBar.tsb-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px !important;
  background: linear-gradient(120deg, #c2321f 0%, #d6402c 45%, #ef8420 100%) !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(194, 50, 31, .28) !important;
  color: #fff;
}
.tsb-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.tsb-right { display: flex; align-items: center; gap: 8px !important; flex-shrink: 0; }
.tsb-menu { display: none !important; }
.tsb-ic {
  width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); border: none; color: #fff; cursor: pointer;
  transition: background .15s;
}
.tsb-ic:hover { background: rgba(255, 255, 255, .2); }
.tsb-back { background: transparent; width: 36px; margin-left: -8px; }
.tsb-bell { position: relative; display: inline-flex; }
.tsb-avatar {
  width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0; cursor: pointer;
  background: #fff; color: var(--ts-navy); border: 2px solid rgba(255, 255, 255, .5);
  font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.tsb-sync {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0;
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-weight: 700;
}
.tsb-sync[data-sync="ok"] svg { color: #86efac; }
.tsb-sync[data-sync="syncing"] svg { color: #93c5fd; animation: tsbPulse 1.2s ease-in-out infinite; }
.tsb-sync[data-sync="offline"] svg { color: #fca5a5; }
.tsb-sync[data-sync="local"] svg { color: #fcd34d; }
@keyframes tsbPulse { 50% { opacity: .35; } }
.tsb-org { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; background: none; border: none; color: inherit; padding: 0; text-align: left; }
.tsb-logo {
  width: 46px; height: 46px; border-radius: 999px; flex-shrink: 0; background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--ts-navy); font-weight: 800; font-size: 16px;
}
.tsb-logo img { width: 100%; height: 100%; object-fit: contain; }
.tsb-cap { font-size: 12px; color: rgba(255, 255, 255, .72); font-weight: 500; line-height: 1.2; }
.tsb-title { font-size: 19px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.tsb-sub { font-size: 13px; color: rgba(255, 255, 255, .78); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsb-txt { min-width: 0; }

/* the old in-page "← Back to Sales" bar is replaced by the app-bar back arrow */
#hubBackBar { display: none !important; }

@media (max-width: 768px) {
  #breadcrumbBar.tsb-bar { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px !important; min-height: 60px; gap: 8px; }
  .tsb-sync { width: 36px; padding: 0; justify-content: center; }
  .tsb-sync-tx { display: none; }
  .tsb-ic, .tsb-avatar { width: 38px; height: 38px; }
  .tsb-avatar { display: none; }          /* profile lives in the Master tab on phones */
  .tsb-title { font-size: 18px; }
  .tsb-logo { width: 42px; height: 42px; }
  .tsp-sum b { font-size: 15px; }
  body.filoo-home #breadcrumbBar { display: flex !important; }
  #filooHome { display: none !important; }
}

/* ── Shared page bits ────────────────────────────────────────────────────── */
.ts-page { max-width: 1180px; margin: 0 auto; }
.ts-sec { font-size: 12px; font-weight: 700; color: var(--ts-muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 4px 10px; }
.ts-sec:first-child { margin-top: 4px; }

/* Tile grid (Workspace, Master, Project Home) */
.ts-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ts-tile {
  position: relative; background: var(--ts-card); border: 1px solid var(--ts-line); border-radius: 14px;
  min-height: 118px; padding: 16px 8px 14px; cursor: pointer; box-shadow: var(--ts-shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.ts-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(16, 24, 40, .22); border-color: #d5dce8; }
.ts-tile:active { transform: scale(.97); }
.ts-tile .ts-emo { font-size: 38px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .12)); }
.ts-tile .ts-lbl { font-size: 14px; font-weight: 600; color: var(--ts-ink); line-height: 1.25; }
.ts-tile .ts-cnt { position: absolute; top: 8px; right: 9px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff1e8; color: var(--ts-blue); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.ts-tile.hl { background: linear-gradient(160deg, #ffd9b8, #ffb27a); border-color: #f5a066; }
.ts-tile.beta::after { content: 'BETA'; position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 800; color: #fff; background: #ef4444; padding: 2px 5px; border-radius: 4px; }

@media (max-width: 768px) {
  .ts-tiles { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ts-tile { min-height: 104px; padding: 12px 4px 10px; gap: 8px; border-radius: 12px; }
  .ts-tile .ts-emo { font-size: 34px; }
  .ts-tile .ts-lbl { font-size: 13px; }
}

/* Search bar + chips */
.ts-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--ts-line); border-radius: 10px; padding: 0 14px; height: 50px; box-shadow: var(--ts-shadow); }
.ts-search svg { color: var(--ts-muted); flex-shrink: 0; }
#appContainer .ts-search input, .ts-search input[type="search"] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; border: none !important; outline: none !important; background: transparent !important; font-size: 16px; color: var(--ts-ink); box-shadow: none !important; padding: 0 !important; height: 100%; min-height: 0 !important; }
.ts-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 12px; scrollbar-width: none; }
.ts-chips::-webkit-scrollbar { display: none; }
.ts-chip { flex-shrink: 0; border: 1px solid var(--ts-line); background: #fff; color: var(--ts-ink); border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 0 !important; }
.ts-chip b { font-weight: 700; margin-left: 6px; }
.ts-chip.on { background: var(--ts-blue); border-color: var(--ts-blue); color: #fff; }
.ts-link { background: none; border: none; color: var(--ts-blue); font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px 4px; white-space: nowrap; }

/* Project cards */
.ts-plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ts-pcard { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; box-shadow: var(--ts-shadow); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.ts-pcard:hover { box-shadow: 0 8px 22px -10px rgba(16, 24, 40, .25); border-color: #d5dce8; }
.ts-pcard-top { display: flex; align-items: flex-start; gap: 14px; padding: 16px 12px 12px 16px; }
.ts-pav { width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px; }
.ts-pname { font-size: 17px; font-weight: 700; color: var(--ts-ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-ploc { font-size: 14px; color: var(--ts-muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-pmeta { flex: 1; min-width: 0; }
.ts-kebab { width: 34px; height: 34px; border-radius: 999px; border: none; background: transparent; color: #374151; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 0 !important; }
.ts-kebab:hover { background: #f1f4f9; }
.ts-pcard-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--ts-line); margin: 0 12px 0 16px; padding: 11px 0 13px; font-size: 14px; color: var(--ts-ink2); }
.ts-pdate { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-ring { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ts-blue); flex-shrink: 0; }
.ts-ptag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }

/* Empty state */
.ts-empty { text-align: center; padding: 48px 16px; color: var(--ts-muted); }
.ts-empty .ts-emo { font-size: 64px; opacity: .55; margin-bottom: 8px; }
.ts-empty h3 { font-size: 18px; color: var(--ts-ink2); font-weight: 700; margin: 6px 0; }
.ts-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--ts-blue); color: #fff; border: none; border-radius: 10px; font-weight: 700; font-size: 15px; padding: 12px 22px; cursor: pointer; }
.ts-btn.ghost { background: #fff; color: var(--ts-blue); border: 1px solid #f6c9b0; }

/* Floating + */
.ts-fab {
  position: fixed; right: 22px; bottom: 26px; z-index: 8000;
  width: 62px; height: 62px; border-radius: 999px; border: none; cursor: pointer;
  background: linear-gradient(150deg, #ef8420, #d6402c); color: #fff;
  box-shadow: 0 10px 24px -6px rgba(214, 64, 44, .6);
  display: none; align-items: center; justify-content: center;
  border-radius: 999px !important; padding: 0 !important; min-height: 0 !important;
}
.ts-fab.on { display: flex; }
.ts-fab:active { transform: scale(.94); }
@media (max-width: 768px) { .ts-fab { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 58px; height: 58px; } }

/* Options bottom-sheet */
.ts-sheet-scrim { position: fixed; inset: 0; z-index: 100001; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; animation: tsFade .18s ease; }
.ts-sheet-wrap { position: relative; width: 100%; max-width: 560px; }
.ts-sheet { position: relative; width: 100%; background: #fff; border-radius: 22px 22px 0 0; padding: 22px 20px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 82vh; overflow: auto; animation: tsUp .22s cubic-bezier(.22, .61, .36, 1); }
.ts-sheet-x { position: absolute; z-index: 1; top: -26px; left: 50%; transform: translateX(-50%); width: 52px; height: 52px; border-radius: 999px; border: none; background: #fff; color: var(--ts-blue); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 999px !important; padding: 0 !important; min-height: 0 !important; }
.ts-sheet h3 { font-size: 19px; font-weight: 700; color: var(--ts-ink); margin: 14px 2px 8px; }
.ts-opt { display: flex; gap: 16px; align-items: flex-start; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--ts-line); padding: 15px 2px; cursor: pointer; min-height: 0 !important; }
.ts-opt:last-child { border-bottom: none; }
.ts-opt:hover { background: #f8fafc; }
.ts-opt-ic { font-size: 22px; width: 28px; text-align: center; flex-shrink: 0; line-height: 1.3; }
.ts-opt b { display: block; font-size: 16px; font-weight: 600; color: var(--ts-ink); }
.ts-opt small { display: block; font-size: 13px; color: var(--ts-muted); margin-top: 3px; }
.ts-opt.danger b { color: var(--ts-red); }
@keyframes tsFade { from { opacity: 0; } }
@keyframes tsUp { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 769px) { .ts-sheet-scrim { align-items: center; } .ts-sheet { border-radius: 18px; padding-top: 30px; } }

/* Project home */
#projDashKPIs.tsp-sum { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 0 !important; }
.tsp-sum { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; box-shadow: var(--ts-shadow); margin-bottom: 14px; }
.tsp-sum > div { background: transparent !important; border-radius: 0 !important; box-shadow: none !important; border-top: none !important; border-bottom: none !important; border-left: none !important; padding: 12px 8px !important; text-align: center; border-right: 1px solid var(--ts-line); min-width: 0; }
.tsp-sum > div:last-child { border-right: none; }
.tsp-sum b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsp-sum small { font-size: 12px; color: var(--ts-muted); font-weight: 500; }

/* Profile */
.ts-prof-hd { text-align: center; padding: 8px 0 18px; }
.ts-prof-logo { width: 96px; height: 96px; border-radius: 999px; margin: 0 auto 12px; background: #fff; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(16, 24, 40, .15); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 30px; font-weight: 800; color: var(--ts-navy); }
.ts-prof-logo img { width: 100%; height: 100%; object-fit: contain; }
.ts-prof-hd h2 { font-size: 21px; font-weight: 700; color: var(--ts-ink); margin: 0; }
.ts-role { display: inline-block; margin: 8px 0 4px; background: #fff1e8; color: var(--ts-blue); font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 14px; }
.ts-card { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; box-shadow: var(--ts-shadow); margin-bottom: 14px; overflow: hidden; }
.ts-card-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--ts-muted); letter-spacing: .07em; text-transform: uppercase; padding: 14px 16px 6px; }
.ts-card-h.danger { color: var(--ts-red); }
/* My Profile — inline edit (View ⇄ Edit on the same card, no navigation) */
.ts-card { transition: box-shadow .2s ease, border-color .2s ease; }
.ts-card.is-editing { border-color: rgba(217, 72, 31, .35); box-shadow: 0 0 0 3px rgba(217, 72, 31, .08), 0 10px 30px rgba(16, 24, 40, .08); }
.ts-card-h { min-height: 50px; gap: 10px; }
.ts-card-h > :first-child { min-width: 0; }
button.ts-pf-edit { display: inline-flex; align-items: center; gap: 6px; height: 32px; min-height: 0 !important; padding: 0 12px !important; border: 1px solid #f3d6c8; border-radius: 999px !important; background: #fff8f4; color: var(--ts-blue); font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0; text-transform: none; cursor: pointer; transition: background .15s, transform .15s; }
button.ts-pf-edit:hover { background: #ffefe6; } button.ts-pf-edit:active { transform: scale(.97); }
.ts-pf-acts { display: inline-flex; flex: 0 0 auto; gap: 8px; animation: tsPfIn .18s ease both; text-transform: none; letter-spacing: 0; }
button.ts-pf-cancel, button.ts-pf-save { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; height: 32px; min-height: 0 !important; padding: 0 14px !important; border-radius: 999px !important; font-size: 13px !important; font-weight: 700 !important; cursor: pointer; transition: filter .15s, transform .15s, opacity .15s; }
button.ts-pf-cancel { border: 1px solid var(--ts-line); background: #fff; color: var(--ts-ink2); }
button.ts-pf-save { border: none; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; box-shadow: 0 4px 12px rgba(214, 64, 44, .28); }
button.ts-pf-save:hover { filter: brightness(1.05); } button.ts-pf-save:active, button.ts-pf-cancel:active { transform: scale(.97); }
button.ts-pf-save:disabled, button.ts-pf-cancel:disabled { opacity: .7; cursor: default; }
.ts-spin { display: none; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: tsSpin .7s linear infinite; }
button.ts-pf-save.busy .ts-spin { display: inline-block; }
@keyframes tsSpin { to { transform: rotate(360deg); } }
@keyframes tsPfIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ts-pf .ts-row-tx b.ts-pf-none { color: #a0a9b8; font-weight: 500; font-style: italic; }
.ts-pf-sp { flex: 0 0 34px; width: 34px; }
.ts-pf.is-edit { padding-top: 8px; padding-bottom: 8px; }
.ts-card .ts-pf-in, #profileView .ts-card .ts-pf-in { display: block; width: calc(100% + 12px) !important; margin: 2px 0 -2px -12px !important; padding: 6px 11px !important; min-height: 0 !important; height: 36px !important; border: 1.5px solid #e3e8ef !important; border-radius: 10px !important; background: #fbfcfe !important; font-family: inherit; font-size: 15px !important; font-weight: 600; color: var(--ts-ink); outline: none; animation: tsPfIn .2s ease both; transition: border-color .15s, box-shadow .15s, background .15s; box-sizing: border-box; }
#profileView .ts-card textarea.ts-pf-in { height: auto !important; min-height: 60px !important; resize: vertical; line-height: 1.4; }
#profileView .ts-card .ts-pf-in:hover { border-color: #d3dae4 !important; }
#profileView .ts-card .ts-pf-in:focus { border-color: var(--ts-blue) !important; background: #fff !important; box-shadow: 0 0 0 4px rgba(217, 72, 31, .14), 0 0 18px rgba(239, 132, 32, .18) !important; }
#profileView .ts-card .ts-pf-in.bad { border-color: #dc2626 !important; background: #fffafa !important; } #profileView .ts-card .ts-pf-in.bad:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .14) !important; }
#profileView .ts-card .ts-pf-in:disabled { opacity: .65; }
.ts-pf-err { display: block; margin-top: 4px; font-style: normal; font-size: 12px; font-weight: 600; color: #dc2626; animation: tsPfIn .15s ease both; }
.ts-pf.is-edit .ts-row-tx small label { cursor: pointer; }
.ts-prof-logo-w { position: relative; width: 96px; margin: 0 auto 12px; }
.ts-prof-logo-w .ts-prof-logo { margin: 0; transition: box-shadow .2s; }
.ts-prof-logo-w.is-edit .ts-prof-logo { box-shadow: 0 0 0 3px rgba(217, 72, 31, .25), 0 4px 16px rgba(16, 24, 40, .15); }
.ts-prof-cam { position: absolute; right: -2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; display: grid; place-items: center; border: 3px solid #fff; cursor: pointer; box-shadow: 0 3px 10px rgba(214, 64, 44, .35); animation: tsPfIn .2s ease both; }
.ts-prof-cam input { display: none; }
button.ts-pf-rmlogo { display: block; margin: -4px auto 8px; background: none; border: none; min-height: 0 !important; padding: 2px 8px !important; color: var(--ts-muted); font-size: 12px !important; font-weight: 600 !important; text-decoration: underline; cursor: pointer; }
.ts-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 440px) { button.ts-pf-save .ts-pf-long { display: none; } }
@media (prefers-reduced-motion: reduce) { .ts-pf-in, .ts-pf-acts, .ts-pf-err, .ts-prof-cam { animation: none; } }
.ts-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid #f1f4f8; cursor: default; text-decoration: none; color: inherit; background: none; width: 100%; text-align: left; border-left: none; border-right: none; border-top: none; min-height: 0 !important; }
.ts-row:last-child { border-bottom: none; }
button.ts-row, a.ts-row { cursor: pointer; }
button.ts-row:hover, a.ts-row:hover { background: #f8fafc; }
.ts-row-ic { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.ts-row-tx { flex: 1; min-width: 0; }
.ts-row-tx small { display: block; font-size: 12px; color: var(--ts-muted); }
.ts-row-tx b { display: block; font-size: 15px; font-weight: 600; color: var(--ts-ink); overflow-wrap: anywhere; }
.ts-row-tx b.red { color: var(--ts-red); }
.ts-row-go { color: #9aa4b5; flex-shrink: 0; }

/* ── Bottom tab bar (phones) ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.app-ready .mobile-bottom-nav { height: calc(66px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -2px 12px rgba(15, 23, 42, .06); }
  .mobile-bottom-nav .mbn-item { font-size: 13px !important; font-weight: 500; color: #6b7280; gap: 4px; }
  .mobile-bottom-nav .mbn-item .mbn-ico { display: flex; }
  .mobile-bottom-nav .mbn-item.active { color: var(--ts-blue); font-weight: 600; }
  .mobile-bottom-nav .mbn-item:active { color: var(--ts-blue); }
  #appContainer main { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
  main > .p-4, main > div.p-4 { padding: 14px 12px !important; }
}

/* style.css has a global `button:not(.nav-btn)` rule (radius / weight / phone font-size,
   all !important). Same-specificity overrides here, loaded later, win. */
button.ts-fab, button.ts-sheet-x, button.ts-chip, button.ts-kebab, button.tsb-ic, button.tsb-avatar { border-radius: 999px !important; }
button.ts-opt, button.ts-row, button.tsb-org { border-radius: 0 !important; font-weight: inherit !important; }
button.ts-btn { border-radius: 10px !important; font-weight: 700 !important; font-size: 15px !important; }
button.ts-chip { font-size: 14px !important; font-weight: 600 !important; min-height: 0 !important; }
button.tsb-org, button.ts-opt, button.ts-row, button.ts-kebab, button.tsb-ic, button.ts-fab, button.ts-sheet-x { min-height: 0 !important; font-size: inherit !important; }
button.ts-fab:active, button.ts-sheet-x:active { transform: scale(.94) !important; }
@media (max-width: 768px) {
  body:not(.ts-root) #tsbChatBtn { display: none; }   /* room for the title; Chat is a project tile */
}

/* ── Module screens ──────────────────────────────────────────────────────── */
/* the app-bar ← replaces the in-page "← Back to …" buttons */
#labourBackBtn, #invBackBtn, #equipBackBtn, .pc-backbtn { display: none !important; }
#invTiles.ts-tiles, #eqTiles.ts-tiles { margin-bottom: 16px; }

/* Labour Attendance */
.lab-date { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; padding: 6px; box-shadow: var(--ts-shadow); }
button.lab-dnav { width: 44px; height: 44px; border: none; background: transparent; color: var(--ts-blue); border-radius: 10px !important; display: flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 0 !important; }
button.lab-dnav:hover { background: #fff4ec; }
button.lab-dnav:disabled { color: #c7cfdb; cursor: default; }
.lab-dlbl { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--ts-ink); cursor: pointer; min-width: 0; }
.lab-dlbl svg { color: var(--ts-blue); flex-shrink: 0; }
.lab-dlbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-dlbl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.lab-sum { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; box-shadow: var(--ts-shadow); margin-top: 12px; }
.lab-sum > div { text-align: center; padding: 12px 4px; border-right: 1px solid var(--ts-line); min-width: 0; }
.lab-sum > div:last-child { border-right: none; }
.lab-sum b { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-sum small { font-size: 12px; color: var(--ts-muted); }
/* minmax(0, …) + min-width:0: cards shrink to the screen instead of growing to their content */
.lab { min-width: 0; max-width: 100%; }
.lab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.lab-list > *, .lab-sum > * { min-width: 0; }
.lab-card { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; box-shadow: var(--ts-shadow); padding: 14px 10px 14px 14px; min-width: 0; overflow: hidden; }
.lab-top { display: flex; align-items: flex-start; gap: 12px; }
.lab-av { width: 44px; height: 44px; border-radius: 999px; background: #fff1e8; color: var(--ts-blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0; overflow: hidden; }
.lab-av img { width: 100%; height: 100%; object-fit: cover; }
.lab-meta { flex: 1; min-width: 0; }
button.lab-name { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; padding: 0; font-size: 16px !important; font-weight: 700 !important; color: var(--ts-ink); text-align: left; max-width: 100%; min-height: 0 !important; border-radius: 0 !important; }
button.lab-name svg { color: var(--ts-muted); flex-shrink: 0; }
.lab-trade { font-size: 13px; color: var(--ts-muted); margin-top: 3px; overflow-wrap: anywhere; }
.lab-pay { text-align: right; flex-shrink: 0; max-width: 42%; cursor: pointer; }
.lab-pay b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-pay b { display: block; font-size: 15px; font-weight: 700; color: var(--ts-ink); }
.lab-pay b.due { color: var(--ts-blue); }
.lab-pay small { font-size: 11px; color: var(--ts-muted); }
.lab-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 4px 0 0; }
button.lab-b { min-width: 0 !important; padding: 0 !important; overflow: hidden; white-space: nowrap; }
button.lab-b { height: 42px; border-radius: 8px !important; border: 1.5px solid transparent; font-size: 15px !important; font-weight: 700 !important; min-height: 0 !important; transition: background .12s, color .12s; }
button.lab-b.p { background: #e9f7ee; color: #15803d; }
button.lab-b.a { background: #fdecea; color: #d92d20; }
button.lab-b.h { background: #f1f3f6; color: #4b5563; }
button.lab-b.ot { background: #fff3e6; color: #c2410c; }
button.lab-b.p.on { background: #16a34a; color: #fff; }
button.lab-b.a.on { background: #dc2626; color: #fff; }
button.lab-b.h.on { background: #64748b; color: #fff; }
button.lab-b.ot.on { background: #ea580c; color: #fff; }
@media (max-width: 768px) {
  .lab-list { grid-template-columns: minmax(0, 1fr); }
  .lab-sum b { font-size: 16px; }
}
@media (max-width: 380px) {
  .lab-top { gap: 8px; }
  .lab-av { width: 38px; height: 38px; font-size: 15px; }
  .lab-pay b { font-size: 14px; }
  .lab-sum b { font-size: 14px; }
  .lab-sum small { font-size: 11px; }
}

/* Worker panel — payments & attendance (labourWorker.js) */
.lw-overlay { position: fixed; inset: 0; z-index: 200000; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; }
.lw-sheet { background: #f6f7f9; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 -10px 40px rgba(0,0,0,.25); padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 769px) { .lw-overlay { align-items: center; } .lw-sheet { border-radius: 18px; } }
.lw-grab { width: 40px; height: 4px; border-radius: 4px; background: #cbd2dc; margin: 8px auto 0; }
.lw-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; background: #fff; border-bottom: 1px solid var(--ts-line); }
.lw-who { flex: 1; min-width: 0; }
.lw-who b { display: block; font-size: 17px; color: var(--ts-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-who small { font-size: 13px; color: var(--ts-muted); }
button.lw-x { width: 36px; height: 36px; min-height: 0 !important; border: none; border-radius: 10px !important; background: #f1f3f6; color: #4b5563; font-size: 15px; flex-shrink: 0; }
.lw-body { overflow-y: auto; padding: 12px 14px 16px; -webkit-overflow-scrolling: touch; }
.lw-filter { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; padding: 10px; }
.lw-chips { display: flex; gap: 6px; }
.lw-chips .ts-chip { flex: 1; justify-content: center; }
.lw-step { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-weight: 700; color: var(--ts-ink); }
.lw-step button { width: 40px; height: 36px; min-height: 0 !important; border: none; border-radius: 8px !important; background: #f6f7f9; color: var(--ts-blue); font-size: 22px; line-height: 1; }
.lw-step button:disabled { color: #c7cfdb; }
.lw-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.lw-dates label { font-size: 11px; font-weight: 700; color: var(--ts-muted); text-transform: uppercase; min-width: 0; }
.lw-dates input { display: block; width: 100%; margin-top: 3px; padding: 8px; border: 1px solid var(--ts-line); border-radius: 8px; font-size: 14px; background: #fff; min-width: 0; }
.lw-period { margin-top: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ts-ink); }
.lw-paid { margin-top: 12px; border-radius: 14px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, #15803d, #1f8a3b 55%, #22a04b); }
.lw-paid small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; opacity: .85; }
.lw-paid b { display: block; font-size: 28px; font-weight: 800; margin: 2px 0; overflow-wrap: anywhere; }
.lw-paid span { font-size: 12px; opacity: .9; }
.lw-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.lw-money > div { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; padding: 10px; min-width: 0; }
.lw-money small { display: block; font-size: 11px; color: var(--ts-muted); }
.lw-money b { display: block; font-size: 14px; font-weight: 700; color: var(--ts-ink); margin-top: 2px; overflow-wrap: anywhere; }
.lw-money b.due { color: var(--ts-blue); }
.lw-att { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; margin-top: 10px; }
.lw-att > div { text-align: center; padding: 10px 2px; border-right: 1px solid var(--ts-line); }
.lw-att > div:last-child { border-right: none; }
.lw-att b { display: block; font-size: 18px; font-weight: 800; }
.lw-att small { font-size: 11px; color: var(--ts-muted); }
.lw-att .p { color: #15803d; } .lw-att .h { color: #b45309; } .lw-att .a { color: #d92d20; } .lw-att .ot { color: #c2410c; }
.lw-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; padding: 10px; margin-top: 10px; }
.lw-cal-h { text-align: center; font-size: 10px; font-weight: 700; color: var(--ts-muted); }
.lw-day { position: relative; display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #9aa3b2; background: #f3f5f8; }
.lw-day.p { background: #dcfce7; color: #15803d; }
.lw-day.h { background: #fef3c7; color: #b45309; }
.lw-day.a { background: #fee2e2; color: #d92d20; }
.lw-day.future { background: transparent; color: #d4d9e1; }
.lw-day i { position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: #ea580c; }
.lw-sec { margin: 14px 2px 6px; font-size: 12px; font-weight: 800; color: var(--ts-muted); text-transform: uppercase; letter-spacing: .4px; }
.lw-txs { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; }
.lw-tx { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--ts-line); }
.lw-tx:last-child { border-bottom: none; }
.lw-tx div { min-width: 0; }
.lw-tx b { display: block; font-size: 14px; color: var(--ts-ink); }
.lw-tx small { display: block; font-size: 12px; color: var(--ts-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-tx span { font-weight: 800; font-size: 14px; flex-shrink: 0; }
.lw-tx .paid { color: #15803d; } .lw-tx .adv { color: #b45309; } .lw-tx .ded { color: #d92d20; }
.lw-none { padding: 16px; text-align: center; font-size: 13px; color: var(--ts-muted); }
.lw-overall { margin-top: 10px; font-size: 12px; color: var(--ts-muted); text-align: center; }
.lw-overall b { color: var(--ts-ink); }
.lw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; background: #fff; border-top: 1px solid var(--ts-line); }
button.lw-btn { height: 46px; min-height: 0 !important; border: none; border-radius: 12px !important; background: var(--ts-blue); color: #fff; font-weight: 800; font-size: 15px; }
button.lw-btn.ghost { background: #fff; color: var(--ts-ink); border: 1.5px solid var(--ts-line); }

/* Petty cash accounts */
.pc-acct { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--ts-line); border-left: 4px solid #1f2937; border-radius: 10px; padding: 14px 16px; box-shadow: var(--ts-shadow); cursor: pointer; }
.pc-acct:hover { border-color: #d5dce8; border-left-color: var(--ts-blue); }
.pc-acct-n { font-size: 17px; font-weight: 700; color: var(--ts-ink); }
.pc-acct-l { font-size: 12px; color: var(--ts-muted); margin-top: 4px; }
.pc-acct-b { font-size: 17px; font-weight: 600; color: var(--ts-ink); margin-top: 2px; }
.pc-acct-b.neg { color: var(--ts-red); }
.pc-acct-p { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 1px 8px; }
.pc-acct-go { color: var(--ts-blue); font-size: 22px; font-weight: 700; }

/* Party */
.pt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pt-card { background: #fff; border: 1px solid var(--ts-line); border-left: 4px solid var(--ts-muted); border-radius: 10px; padding: 14px 16px; box-shadow: var(--ts-shadow); cursor: pointer; }
.pt-card:hover { box-shadow: 0 8px 20px -10px rgba(16, 24, 40, .25); }
.pt-card-h { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pt-card-h b { font-size: 16px; font-weight: 700; color: var(--ts-ink); text-transform: uppercase; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-go { color: var(--ts-blue); font-weight: 700; font-size: 20px; }
.pt-card-r { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.pt-card-r small { display: block; font-size: 12px; color: var(--ts-muted); }
.pt-card-r span { font-size: 15px; color: var(--ts-ink); }
.tsp-sum > div small + b { margin-top: 2px; }
.pt-head { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; padding: 14px 8px 14px 14px; box-shadow: var(--ts-shadow); }
.pt-av { width: 46px; height: 46px; border-radius: 10px; background: var(--ts-blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pt-name { display: block; font-size: 16px; font-weight: 700; color: var(--ts-ink); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-head small { color: var(--ts-muted); font-size: 12px; }
.pt-entries, .tx-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pt-entry, .tx-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--ts-line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.pt-entry:hover, .tx-row:hover { border-color: #d5dce8; }
.pt-e-ic, .tx-ic { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; flex-shrink: 0; background: #fff1e8; color: var(--ts-blue); }
.pt-e-ic.in, .tx-ic.in { background: #e9f7ee; color: #15803d; }
.pt-e-ic.out, .tx-ic.out { background: #fdecea; color: #d92d20; }
.pt-e-m, .tx-m { flex: 1; min-width: 0; }
.pt-e-m b, .tx-m b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ts-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-e-m small, .tx-m small { display: block; font-size: 12px; color: var(--ts-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-e-ded { font-size: 11.5px; color: #be123c; margin-top: 2px; }
.pt-e-a { text-align: right; flex-shrink: 0; }
.pt-e-a b { display: block; font-size: 15px; font-weight: 700; color: var(--ts-ink); }
.pt-e-a small { font-size: 11px; color: var(--ts-muted); }
.tx-a { font-size: 15px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.tx-a.in { color: #15803d; } .tx-a.out { color: #d92d20; }

/* Bottom action bar: money in (green) · money out (red) */
.ts-actbar { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0 calc(6px + env(safe-area-inset-bottom, 0px)); margin-top: 14px; background: linear-gradient(180deg, rgba(238, 241, 246, 0), var(--ts-bg) 30%); }
button.ts-act { height: 50px; border: none; border-radius: 10px !important; font-size: 16px !important; font-weight: 600 !important; color: #fff; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .45); min-height: 0 !important; }
button.ts-act.in { background: #1f8a3b; }
button.ts-act.out { background: #d92d20; }
@media (max-width: 768px) {
  .ts-actbar { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); padding-bottom: 6px; }
  .pt-list { grid-template-columns: 1fr; }
}

/* Long party names wrap in the detail header */
.pt-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
/* Payment entry form: blue / navy instead of the old purple theme */
body #paymentsHubView {
  --bg: var(--ts-bg); --purple: #d9481f; --purple-tint: #fff1e8; --indigo: #c2321f;
  --sh: 0 1px 3px rgba(16, 24, 40, .08); --sh-soft: 0 1px 2px rgba(16, 24, 40, .06);
}
body #paymentsHubView .pmt-bal.primary { background: linear-gradient(150deg, #c2321f, #ef8420); box-shadow: 0 10px 22px -12px rgba(194, 50, 31, .55); }
body #paymentsHubView .pmt-seg button.on-in, body #paymentsHubView .pmt-save.in { background: #1f8a3b; box-shadow: none; }
body #paymentsHubView .pmt-seg button.on-out, body #paymentsHubView .pmt-save.out { background: #d92d20; box-shadow: none; }
body #paymentsHubView .pmt-card, body #paymentsHubView .pmt-listcard { border-radius: 14px; }

/* ── Profile avatar (top-left) + slide-in profile menu ─────────────────── */
button.tsb-me { background: none; border: none; padding: 0; cursor: pointer; border-radius: 999px !important; min-height: 0 !important; flex-shrink: 0; }
button.tsb-me .tsb-logo { border: 2px solid rgba(255, 255, 255, .55); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.ts-drawer-scrim { position: fixed; inset: 0; z-index: 100002; background: rgba(15, 23, 42, .5); animation: tsFade .18s ease; }
.ts-drawer { position: absolute; top: 0; left: 0; bottom: 0; width: min(320px, 82vw); background: #fbfbfd; display: flex; flex-direction: column;
  box-shadow: 8px 0 30px rgba(0, 0, 0, .2); animation: tsSlide .22s cubic-bezier(.22, .61, .36, 1); padding-top: env(safe-area-inset-top, 0px); }
@keyframes tsSlide { from { transform: translateX(-100%); } }
.ts-drawer-hd { display: flex; align-items: center; gap: 12px; padding: 22px 14px 18px 18px; border-bottom: 1px solid var(--ts-line); }
.ts-drawer-av { width: 52px; height: 52px; border-radius: 999px; background: #ede9fe; color: #5b21b6; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.ts-drawer-av img { width: 100%; height: 100%; object-fit: cover; }
.ts-drawer-hd b { display: block; font-size: 17px; color: var(--ts-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-drawer-hd small { display: block; font-size: 12.5px; color: var(--ts-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-drawer-nav { flex: 1; overflow-y: auto; padding: 8px 8px; }
button.ts-drawer-it { display: flex; align-items: center; gap: 16px; width: 100%; background: none; border: none; text-align: left; padding: 13px 12px; font-size: 16px !important; font-weight: 500 !important; color: #1f2347; border-radius: 10px !important; min-height: 0 !important; }
button.ts-drawer-it:hover { background: #f1f2f8; }
button.ts-drawer-it span { font-size: 19px; width: 26px; text-align: center; }
button.ts-drawer-it.danger { color: var(--ts-red); }
.ts-drawer-ft { padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--ts-muted); border-top: 1px solid var(--ts-line); }
/* Payment form: amount + date side by side without the label wrapping; the
   Transactions list replaces the form's "Recent" card */
body #paymentsHubView .pmt-row { grid-template-columns: 1fr 1fr; }
body #paymentsHubView .pmt-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body #paymentsHubView .pmt-side .pmt-listcard { display: none; }
body #paymentsHubView .pmt-payfrom > .pmt-pf { min-width: 0; }
body #paymentsHubView .pmt-main, body #paymentsHubView .pmt-card { min-width: 0; max-width: 100%; }

/* ── Engineer Tools (calcTools.js) ─────────────────────────────────────── */
.ct-intro { margin: 2px 4px 14px; }
.ct-intro b { display: block; font-size: 18px; color: var(--ts-ink); }
.ct-intro small { font-size: 13px; color: var(--ts-muted); }
.ct { max-width: 860px; }
.ct-card, .ct-res { background: #fff; border: 1px solid var(--ts-line); border-radius: 14px; box-shadow: var(--ts-shadow); padding: 16px; margin-bottom: 14px; }
.ct-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ct-ic { width: 46px; height: 46px; border-radius: 12px; background: #fff1e8; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.ct-hd b { display: block; font-size: 17px; color: var(--ts-ink); }
.ct-hd small { font-size: 12.5px; color: var(--ts-muted); }
.ct-units { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; font-size: 12px; color: var(--ts-muted); font-weight: 600; }
.ct-units span { margin-right: 4px; }
.ct-units button { border: 1px solid var(--ts-line); background: #fff; color: var(--ts-ink2); padding: 5px 12px; font-size: 13px !important; font-weight: 600 !important; border-radius: 999px !important; min-height: 0 !important; }
.ct-units button.on { background: var(--ts-blue); border-color: var(--ts-blue); color: #fff; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ct-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ct-f > span { font-size: 12.5px; font-weight: 600; color: var(--ts-ink2); }
.ct-f select, .ct-in input { width: 100%; height: 46px; border: 1.5px solid var(--ts-line) !important; border-radius: 10px !important; background: #fff !important; padding: 0 12px !important; font-size: 16px !important; color: var(--ts-ink); outline: none; min-height: 0 !important; box-shadow: none !important; }
.ct-f select:focus, .ct-in input:focus { border-color: var(--ts-blue) !important; }
.ct-in { position: relative; }
.ct-in i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--ts-muted); font-weight: 600; pointer-events: none; }
.ct-in input { padding-right: 52px !important; }
.ct-chk { flex-direction: row; align-items: center; gap: 10px; padding-top: 22px; }
.ct-chk input { width: 20px; height: 20px; accent-color: var(--ts-blue); }
.ct-chk > span { font-size: 14px; }
.ct-sec { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ts-muted); margin: 10px 0 4px; }
.ct-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f3f7; }
.ct-row:last-of-type { border-bottom: none; }
.ct-row b { font-size: 14.5px; color: var(--ts-ink); font-weight: 600; }
.ct-row small { display: block; font-size: 12px; color: var(--ts-muted); margin-top: 1px; }
.ct-q { text-align: right; flex-shrink: 0; }
.ct-q b { font-size: 18px; font-weight: 700; color: var(--ts-blue); }
.ct-q span { font-size: 13px; color: var(--ts-ink2); font-weight: 600; }
.ct-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 4px; }
.ct-stats > div { background: #fff7f1; border: 1px solid #fde3d1; border-radius: 10px; padding: 9px 11px; min-width: 0; }
.ct-stats small { display: block; font-size: 11.5px; color: var(--ts-muted); }
.ct-stats b { font-size: 14.5px; color: var(--ts-ink); overflow-wrap: anywhere; }
.ct-big { background: linear-gradient(120deg, #c2321f, #ef8420); color: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 6px; }
.ct-big small { font-size: 12.5px; opacity: .9; }
.ct-big b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0; }
.ct-big span { font-size: 12.5px; opacity: .9; }
.ct-bar { height: 6px; background: #f3f4f6; border-radius: 99px; margin-top: 6px; overflow: hidden; width: 160px; max-width: 45vw; }
.ct-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ef8420, #d6402c); border-radius: 99px; }
.ct-total { display: flex; justify-content: space-between; align-items: center; background: #fff1e8; border-radius: 10px; padding: 12px 14px; margin-top: 10px; font-weight: 600; color: var(--ts-ink2); }
.ct-total b { font-size: 18px; color: var(--ts-ink); }
.ct-note { font-size: 12px; color: var(--ts-muted); margin: 12px 0 0; }
.ct-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
@media (max-width: 768px) {
  .ct-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ct-chk { padding-top: 0; }
}
/* calculator fields: one look for inputs & selects (beats global input rules) */
#calcView .ct-f select, #calcView .ct-in input[type="number"] { background: #fff !important; border: 1.5px solid var(--ts-line) !important; height: 46px !important; }
#calcView .ct-f select:focus, #calcView .ct-in input[type="number"]:focus { border-color: var(--ts-blue) !important; }
@media (max-width: 768px) { #calcView .ct-wide { grid-column: 1 / -1; } }

/* The app bar replaces the old breadcrumb row (mobile-polish.css forces it visible). */
#breadcrumbBar #breadcrumbPath, #breadcrumbBar > [hidden] { display: none !important; }
@media (max-width: 768px) {
  #breadcrumbBar #headerSyncBadge.tsb-sync { padding: 0 !important; font-size: 12px !important; }
  #breadcrumbBar .tsb-right { margin-left: 0; }
}
/* Phones: the app bar runs edge to edge (content keeps its own padding) */
@media (max-width: 768px) {
  #appContainer main { padding-left: 0 !important; padding-right: 0 !important; }
  .tx .tsp-sum b { font-size: 15px; }
}
/* Labour filter chips wrap instead of scrolling sideways */
.lab .ts-chips { flex-wrap: wrap; overflow: visible; }

/* ── Current Inventory: single-column card list (inventoryList.js) ──
   The page itself scrolls (no inner scroll boxes or side-scrolling tables),
   cards span the full width and stay compact; only the toolbar is sticky. */
.iv { max-width: 760px; margin: 0 auto; touch-action: pan-y; }
.iv-bar { position: sticky; top: var(--iv-top, 0px); z-index: 30; background: #eef1f6; margin: 0 -12px; padding: 8px 12px 6px; box-shadow: 0 6px 8px -8px rgba(15, 23, 42, .25); }
.iv-top { display: flex; gap: 8px; align-items: stretch; }
.iv-top .ts-search { flex: 1; min-width: 0; min-height: 0; height: 42px; }
button.iv-fbtn { position: relative; flex-shrink: 0; width: 44px; min-height: 0 !important; border: 1px solid var(--ts-line); border-radius: 12px !important; background: #fff; color: var(--ts-ink); display: flex; align-items: center; justify-content: center; }
button.iv-fbtn.on { background: var(--ts-ink); color: #fff; border-color: var(--ts-ink); }
button.iv-fbtn b { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ts-blue); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.iv-sel[hidden] { display: none !important; }
.iv-sel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.iv-sel select:last-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .iv-sel { grid-template-columns: repeat(3, minmax(0, 1fr)); } .iv-sel select:last-child { grid-column: auto; } }
.iv-sel select { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--ts-line); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ts-ink); text-overflow: ellipsis; }
/* Kind: segmented control (All · Raw material · Consumable · Tool) */
.iv-kinds { display: flex; gap: 2px; margin-top: 8px; padding: 3px; background: #dfe4ec; border-radius: 11px; }
.iv-kinds button { flex: 1 1 auto; min-width: 0; min-height: 0 !important; height: 32px; padding: 0 8px !important; border: none; border-radius: 8px !important; background: transparent; color: #334155; font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-kinds button.on { background: #fff; color: var(--ts-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.iv-chips { display: flex; gap: 6px; padding-top: 6px; }
.iv-chips button.ts-chip { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 4px 4px !important; font-size: 12.5px !important; gap: 4px; }
.iv-count { font-size: 12px; font-weight: 700; color: var(--ts-muted); margin: 8px 2px 6px; }
.iv-cards { display: flex; flex-direction: column; gap: 8px; }
/* Card ≈ 110px: name + status · kind + location · stock + meter */
.ivc { position: relative; background: #fff; border: 1px solid var(--ts-line); border-left: 4px solid #22a04b; border-radius: 12px; padding: 10px 12px 10px; box-shadow: var(--ts-shadow); cursor: pointer; min-width: 0; -webkit-tap-highlight-color: transparent; }
.ivc:active { background: #fbfcfd; }
.ivc.low { border-left-color: #f59e0b; }
.ivc.out { border-left-color: #dc2626; }
.ivc-top { display: flex; align-items: flex-start; gap: 8px; }
h3.ivc-name { flex: 1; min-width: 0; margin: 0; font-size: 16px !important; font-weight: 800 !important; color: #0b1220; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ivc-pill { flex-shrink: 0; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.ivc-pill.ok { background: #dcfce7; color: #15803d; }
.ivc-pill.low { background: #fef3c7; color: #b45309; }
.ivc-pill.out { background: #fee2e2; color: #b91c1c; }
.ivc-tags { display: flex; align-items: center; gap: 6px; margin-top: 6px; min-width: 0; }
.ivc-kind { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.ivc-kind.raw { background: #eef2ff; color: #3730a3; }
.ivc-kind.tool { background: #f3e8ff; color: #6b21a8; }
.ivc-kind.consumable { background: #ecfeff; color: #0e7490; }
button.ivc-loc { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; padding: 3px 9px; min-height: 0 !important; border: none; border-radius: 7px !important; background: #1e3a8a; color: #fff; font-size: 12.5px !important; font-weight: 700 !important; text-align: left; }
button.ivc-loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.ivc-loc svg { flex-shrink: 0; width: 13px; height: 13px; color: #fca5a5; }
button.ivc-loc.none { background: #fff; color: #64748b; border: 1.5px dashed #cbd5e1; }
button.ivc-loc.none svg { color: #94a3b8; }
.ivc-stock { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.ivc-stock > b { font-size: 19px; font-weight: 800; color: #0b1220; white-space: nowrap; }
.ivc-stock em { font-style: normal; font-size: 13px; font-weight: 700; color: #475569; }
.ivc.low .ivc-stock > b { color: #b45309; }
.ivc.out .ivc-stock > b { color: #b91c1c; }
.ivc-min { flex: 1; min-width: 0; text-align: right; font-size: 12.5px; font-weight: 600; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivc-chev { flex-shrink: 0; color: #94a3b8; align-self: center; display: flex; }
.ivc-chev svg { width: 16px; height: 16px; transition: transform .15s; }
.ivc.open .ivc-chev svg { transform: rotate(180deg); }
.ivc-meter { position: relative; height: 5px; border-radius: 5px; background: #eef1f5; margin-top: 6px; overflow: hidden; }
.ivc-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: #22a04b; }
.ivc.low .ivc-meter i { background: #f59e0b; }
.ivc.out .ivc-meter i { background: #dc2626; }
.ivc-meter u { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #0b1220; opacity: .3; }
.ivc-detail { margin-top: 10px; border-top: 1px solid var(--ts-line); padding-top: 8px; cursor: default; }
.ivc-tot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ivc-tot small { display: block; font-size: 11px; color: var(--ts-muted); }
.ivc-tot b { font-size: 14px; }
.ivc-tot .in, .ivc-moves .in { color: #15803d; }
.ivc-tot .out, .ivc-moves .out { color: #b91c1c; }
.ivc-moves { list-style: none; margin: 6px 0 0; padding: 0; }
.ivc-moves li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f1f3f6; font-size: 13px; }
.ivc-moves li span { min-width: 0; }
.ivc-moves li small { display: block; font-size: 11.5px; color: var(--ts-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivc-moves li.none { color: var(--ts-muted); justify-content: center; }
.ivc-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.ivc-acts button { height: 36px; min-height: 0 !important; border: 1px solid var(--ts-line); border-radius: 9px !important; background: #f8fafc; font-size: 13px !important; font-weight: 700 !important; color: var(--ts-ink); white-space: nowrap; overflow: hidden; }
.iv-more { display: none; text-align: center; padding: 12px; font-size: 13px; color: var(--ts-muted); }
button.iv-manage { display: block; width: 100%; margin: 14px 0 90px; padding: 11px; min-height: 0 !important; border: 1.5px dashed #cbd5e1; border-radius: 12px !important; background: transparent; color: #475569; font-weight: 700; font-size: 14px; }
/* Scroll cue: a soft fade at the bottom edge on phones, so cut-off cards read as "more below" */
@media (max-width: 768px) {
  #invSecStock:not(.hide)::after { content: ''; position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); height: 28px; pointer-events: none; background: linear-gradient(to bottom, rgba(238, 241, 246, 0), rgba(238, 241, 246, .95)); z-index: 5; }
}
main { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }

/* ── Material Received: stacked material cards + full-screen picker (grnPicker.js) ──
   Vertical only: no tables, no sideways scrolling; 48px+ tap targets for site use. */
.grn-items { display: flex; flex-direction: column; gap: 12px; }
.grn-item-row { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); min-width: 0; }
.grn-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
button.grn-del { width: 36px; height: 36px; min-height: 0 !important; border: none; border-radius: 10px !important; background: #fff1f2; color: #e11d48; font-size: 15px; font-weight: 800; }
button.grn-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px !important; padding: 10px 12px; border: 2px dashed #93c5fd; border-radius: 12px !important; background: #eff6ff; color: #1d4ed8; text-align: left; font-size: 15px !important; font-weight: 700 !important; }
button.grn-pick.set { border-style: solid; border-color: #e2e8f0; background: #f8fafc; color: #0f172a; }
.grn-pick-ic { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.grn-pick-txt { flex: 1; min-width: 0; }
.grn-pick-txt b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; overflow-wrap: anywhere; }
.grn-pick-txt small { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-top: 2px; }
.grn-pick-go { font-size: 26px; color: #94a3b8; line-height: 1; }
.grn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.grn-grid label { display: block; min-width: 0; font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .3px; }
.grn-grid label i { color: #f43f5e; font-style: normal; }
.grn-grid label small { text-transform: none; font-weight: 600; color: #94a3b8; }
.grn-grid .grn-wide { grid-column: 1 / -1; }
.grn-in { display: block; width: 100%; min-width: 0; height: 48px; margin-top: 4px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; font-size: 16px; font-weight: 700; color: #0f172a; text-transform: none; letter-spacing: 0; outline: none; }
.grn-in:focus { background: #fff; border-color: #60a5fa; box-shadow: 0 0 0 4px #dbeafe; }
button.grn-add { display: block; width: 100%; margin-top: 12px; min-height: 52px !important; border: 2px dashed #bfdbfe; border-radius: 14px !important; background: #fff; color: #1d4ed8; font-size: 15px !important; font-weight: 800 !important; }

.gp-overlay { position: fixed; inset: 0; z-index: 200000; background: rgba(15, 23, 42, .5); display: none; align-items: stretch; justify-content: center; }
.gp-sheet { display: flex; flex-direction: column; width: 100%; max-width: 620px; height: 100%; background: #f1f4f8; padding-top: env(safe-area-inset-top, 0px); }
@media (min-width: 769px) { .gp-overlay { align-items: center; } .gp-sheet { height: 86vh; border-radius: 18px; overflow: hidden; } }
.gp-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.gp-head b { font-size: 18px; font-weight: 800; color: #0f172a; }
button.gp-x { width: 44px; height: 44px; min-height: 0 !important; border: none; border-radius: 12px !important; background: #f1f5f9; color: #334155; font-size: 18px; flex-shrink: 0; }
.gp-bar { padding: 10px 14px 8px; background: #f1f4f8; }
.gp-chips { display: flex; gap: 4px; margin-top: 8px; padding: 3px; background: #dfe4ec; border-radius: 12px; }
.gp-chips button { flex: 1 1 auto; min-width: 0; height: 38px; min-height: 0 !important; padding: 0 6px !important; border: none; border-radius: 9px !important; background: transparent; color: #334155; font-size: 13.5px !important; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-chips button.on { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.gp-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: 4px 14px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
button.gp-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px !important; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px !important; background: #fff; text-align: left; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); flex-shrink: 0; }
button.gp-row:active { background: #f8fafc; transform: scale(.995); }
button.gp-row.on { border: 2px solid #2563eb; background: #eff6ff; }
.gp-ic { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.gp-txt { flex: 1; min-width: 0; }
.gp-txt b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; line-height: 1.25; overflow-wrap: anywhere; }
.gp-txt small { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 12.5px; font-weight: 600; }
.gp-txt small .ok { color: #15803d; }
.gp-txt small .zero { color: #94a3b8; }
.gp-txt small .po { color: #b45309; }
.gp-kind { flex-shrink: 0; align-self: flex-start; font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 7px; background: #ecfeff; color: #0e7490; }
.gp-kind.raw { background: #eef2ff; color: #3730a3; }
.gp-kind.tool { background: #f3e8ff; color: #6b21a8; }
.gp-none { text-align: center; padding: 40px 10px; color: #64748b; font-size: 14px; }
.gp-none button { margin-top: 12px; padding: 12px 18px; min-height: 0 !important; border: none; border-radius: 12px !important; background: #2563eb; color: #fff; font-weight: 800; }
@media (max-width: 380px) { .gp-kind { display: none; } }
.gp-bar .ts-search input { background: transparent !important; border: none !important; box-shadow: none !important; padding-left: 0 !important; height: 100%; font-size: 16px; outline: none; }

/* ── Premium cards (pcKit.js): Tools · Material Transfer · Physical Audit ──
   Design tokens — one spacing scale (4px base), one radius, two shadows. */
:root {
  --pc-gap: 20px;          /* between cards */
  --pc-pad: 20px;          /* inside cards */
  --pc-radius: 16px;       /* cards */
  --pc-radius-sm: 12px;    /* inputs, buttons, tiles */
  --pc-line: #e6e9ef;      /* hairline border */
  --pc-surface: #ffffff;
  --pc-sunk: #f7f8fa;      /* inputs / inner wells */
  --pc-ink: #0f172a;
  --pc-sub: #64748b;
  --pc-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
  --pc-shadow-hi: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .10);
}
@media (min-width: 769px) { :root { --pc-gap: 24px; --pc-pad: 24px; } }
#invTiles.ts-tiles { gap: 14px; }

.pc-page { display: flex; flex-direction: column; gap: var(--pc-gap); max-width: 880px; margin: 0 auto; padding-bottom: 96px; }
.pc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pc-stat { position: relative; background: var(--pc-surface); border: 1px solid var(--pc-line); border-radius: var(--pc-radius); box-shadow: var(--pc-shadow); padding: 14px 14px 12px; min-width: 0; overflow: hidden; }
.pc-stat::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--pc-tone, #94a3b8); }
.pc-stat span { display: block; min-height: 2.4em; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--pc-sub); line-height: 1.2; overflow-wrap: anywhere; }
.pc-stat b { display: block; margin-top: 6px; font-size: 22px; font-weight: 800; color: var(--pc-ink); letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pc-stat small { display: block; margin-top: 2px; font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-stat.brand { --pc-tone: var(--ts-blue); } .pc-stat.green { --pc-tone: #16a34a; } .pc-stat.amber { --pc-tone: #f59e0b; }
.pc-stat.red { --pc-tone: #dc2626; } .pc-stat.red b { color: #b91c1c; } .pc-stat.slate { --pc-tone: #94a3b8; }

.pc-card { background: var(--pc-surface); border: 1px solid var(--pc-line); border-radius: var(--pc-radius); box-shadow: var(--pc-shadow); overflow: hidden; }
.pc-head { display: flex; align-items: center; gap: 14px; padding: var(--pc-pad) var(--pc-pad) 0; }
.pc-ic { width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--pc-radius-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.pc-ic.brand { background: #fff1e8; } .pc-ic.violet { background: #f3e8ff; } .pc-ic.cyan { background: #e0f7fa; }
.pc-ic.red { background: #fee2e2; } .pc-ic.green { background: #dcfce7; }
.pc-ttl { flex: 1; min-width: 0; }
.pc-ttl h4 { margin: 0; font-size: 17px !important; font-weight: 800 !important; color: var(--pc-ink); letter-spacing: -.2px; line-height: 1.25; }
.pc-ttl p { margin: 3px 0 0; font-size: 13px; color: var(--pc-sub); line-height: 1.4; }
.pc-count { flex-shrink: 0; min-width: 32px; height: 28px; padding: 0 10px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pc-body { padding: 18px var(--pc-pad) var(--pc-pad); }
.pc-body.flush { padding: 14px 0 6px; }

.pc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.pc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pc-field.wide { grid-column: 1 / -1; }
.pc-field > span { font-size: 12px; font-weight: 700; color: #475569; letter-spacing: .2px; }
.pc-field > small { font-size: 11.5px; color: #94a3b8; }
.pc-in { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--pc-line); border-radius: var(--pc-radius-sm); background: var(--pc-sunk); color: var(--pc-ink); font-size: 15px; font-weight: 600; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.pc-in::placeholder { color: #a0aabb; font-weight: 500; }
.pc-in:focus { background: #fff; border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59, 130, 246, .12); }
.pc-note { margin-top: 16px; padding: 12px 14px; border-radius: var(--pc-radius-sm); background: #f0f9ff; border: 1px solid #e0f2fe; font-size: 13.5px; color: #075985; }
.pc-note:empty { display: none; }
button.pc-btn { display: block; width: 100%; margin-top: 20px; height: 52px; min-height: 0 !important; border: none; border-radius: var(--pc-radius-sm) !important; color: #fff; font-size: 15.5px !important; font-weight: 800 !important; letter-spacing: .2px; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 4px 10px -2px var(--pc-btn-glow, rgba(0,0,0,.15)); transition: transform .1s, filter .15s; background: var(--pc-btn, var(--ts-blue)); }
button.pc-btn:hover { filter: brightness(1.05); } button.pc-btn:active { transform: scale(.99); }
button.pc-btn.violet { --pc-btn: linear-gradient(135deg, #7c3aed, #6d28d9); --pc-btn-glow: rgba(109, 40, 217, .35); }
button.pc-btn.cyan { --pc-btn: linear-gradient(135deg, #0891b2, #0e7490); --pc-btn-glow: rgba(14, 116, 144, .35); }
button.pc-btn.red { --pc-btn: linear-gradient(135deg, #dc2626, #b91c1c); --pc-btn-glow: rgba(185, 28, 28, .3); }

.pc-list { display: flex; flex-direction: column; }
.pc-item { display: flex; align-items: center; gap: 14px; padding: 14px var(--pc-pad); border-top: 1px solid #f1f3f6; min-width: 0; }
.pc-item:first-child { border-top: none; }
.pc-item-ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; background: #f1f5f9; color: #475569; }
.pc-item-ic.violet { background: #f3e8ff; color: #6b21a8; } .pc-item-ic.green { background: #dcfce7; color: #15803d; }
.pc-item-ic.amber { background: #fef3c7; color: #b45309; } .pc-item-ic.red { background: #fee2e2; color: #b91c1c; }
.pc-item-txt { flex: 1; min-width: 0; }
.pc-item-txt b { display: block; font-size: 15px; font-weight: 700; color: var(--pc-ink); line-height: 1.3; overflow-wrap: anywhere; }
.pc-item-txt small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--pc-sub); line-height: 1.45; }
.pc-item-txt small i { font-style: normal; color: #b6c0ce; margin-right: 2px; }
.pc-item-txt small b { display: inline; font-size: inherit; color: #334155; font-weight: 800; }
.pc-item-r { flex-shrink: 0; }
button.pc-act { height: 40px; min-height: 0 !important; padding: 0 16px !important; border: 1px solid #c7d7fe; border-radius: 10px !important; background: #eef4ff; color: #1d4ed8; font-size: 13.5px !important; font-weight: 800 !important; }
button.pc-act.amber { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.pc-pill { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pc-pill.green { background: #dcfce7; color: #15803d; } .pc-pill.amber { background: #fef3c7; color: #b45309; }
.pc-pill.red { background: #fee2e2; color: #b91c1c; } .pc-pill.slate { background: #f1f5f9; color: #475569; } .pc-pill.blue { background: #dbeafe; color: #1d4ed8; }
.pc-empty { padding: 22px var(--pc-pad) 18px; text-align: center; font-size: 14px; color: #94a3b8; }
@media (max-width: 380px) { .pc-stat b { font-size: 18px; } .pc-stat { padding: 12px 10px 10px; } .pc-item { gap: 10px; } }

/* ── Register cards (reportCards.js): GST & other reports, Stock Register ──
   Phones: one card per entry, never wider than the screen. ≥769px: the table. */
.rpt-cards { display: none; }
@media (max-width: 768px) {
  #reportsView, #reportsDashContent, #invSecStatement, #stmtContent { max-width: 100%; overflow-x: hidden; }
  .rpt-table-wrap { background: transparent !important; border: none !important; overflow: visible !important; }
  .rpt-table-wrap > .rpt-table, .stmt-table { display: none !important; }
  .rpt-cards { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 4px; }
  .stmt-cards { padding: 12px; background: #f6f7f9; }
  .rpt-report-header { flex-wrap: wrap; gap: 10px; }
  .rpt-report-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .rpt-kpi-strip { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible !important; }
  .rpt-kpi-card { min-width: 0 !important; }
}
.rc-card { background: #fff; border: 1px solid #e6e9ef; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 3px 10px rgba(16, 24, 40, .05); overflow: hidden; min-width: 0; }
.rc-card.total { border-color: #bbf7d0; background: #f6fef9; }
.rc-top { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px 10px; }
.rc-id { flex: 1; min-width: 0; }
.rc-id > b { display: block; font-size: 15px; font-weight: 800; color: #0f172a; line-height: 1.3; overflow-wrap: anywhere; }
.rc-id small { display: block; margin-top: 3px; font-size: 12.5px; color: #64748b; line-height: 1.4; overflow-wrap: anywhere; }
.rc-id small i { font-style: normal; margin: 0 6px; color: #cbd5e1; }
.rc-right { flex-shrink: 0; max-width: 55%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.rc-hero span { display: block; font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .3px; }
.rc-hero b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rc-card.total .rc-id > b { color: #15803d; text-transform: uppercase; letter-spacing: .4px; font-size: 13px; }
/* 2-column micro-grid with hairline dividers */
.rc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #eef1f5; }
.rc-kv { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; min-width: 0; border-bottom: 1px solid #eef1f5; }
.rc-kv:nth-child(odd) { border-right: 1px solid #eef1f5; }
.rc-kv:nth-last-child(-n+2):nth-child(odd), .rc-kv:last-child { border-bottom: none; }
.rc-kv span { font-size: 11px; font-weight: 600; color: #8a94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-kv b { font-size: 13.5px; font-weight: 700; color: #1e293b; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rc-card.total .rc-kv b { color: #065f46; }
/* Progressive disclosure */
.rc-more { border-top: 1px solid #eef1f5; }
.rc-more > summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; font-size: 13px; font-weight: 700; color: #2563eb; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rc-more > summary::-webkit-details-marker { display: none; }
.rc-more > summary::after { content: '▾'; font-size: 12px; transition: transform .15s; }
.rc-more[open] > summary::after { transform: rotate(180deg); }
.rc-more > summary em { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #eff6ff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.rc-more[open] > summary { border-bottom: 1px solid #eef1f5; background: #fafbfc; }
.rc-more .rc-grid { border-top: none; }
@media print { .rpt-cards { display: none !important; } .rpt-table-wrap > .rpt-table { display: table !important; } .stmt-table { display: block !important; } }

/* ── Equipment Usage History: expandable cards (fleet.js renderEquipmentLog) ── */
.eu-wrap { padding: 14px; background: #f6f7f9; max-width: 100%; overflow-x: hidden; }
.eu-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.eu-sum > div { background: #fff; border: 1px solid #e6e9ef; border-radius: 12px; padding: 10px 10px 9px; min-width: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.eu-sum small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: #8a94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eu-sum b { display: block; margin-top: 4px; font-size: 16px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .eu-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.eu-list { display: flex; flex-direction: column; gap: 12px; }
.eu-card { background: #fff; border: 1px solid #e6e9ef; border-left: 4px solid #94a3b8; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 3px 10px rgba(16, 24, 40, .05); overflow: hidden; min-width: 0; transition: box-shadow .2s; }
.eu-card.green { border-left-color: #16a34a; } .eu-card.amber { border-left-color: #f59e0b; } .eu-card.blue { border-left-color: #2563eb; } .eu-card.red { border-left-color: #dc2626; }
.eu-card.open { box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 10px 24px rgba(16, 24, 40, .09); }
button.eu-face { display: block; width: 100%; padding: 14px 14px 10px; min-height: 0 !important; border: none; background: transparent; text-align: left; border-radius: 0 !important; -webkit-tap-highlight-color: transparent; }
button.eu-face:active { background: #fafbfc; }
.eu-top { display: flex; align-items: flex-start; gap: 10px; }
.eu-name { flex: 1; min-width: 0; }
.eu-name b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; line-height: 1.25; overflow-wrap: anywhere; }
.eu-name small { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; font-size: 11.5px; font-weight: 700; color: #475569; letter-spacing: .3px; }
.eu-type { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; background: #f1f5f9; color: #475569; }
.eu-type.green { background: #dcfce7; color: #15803d; } .eu-type.amber { background: #fef3c7; color: #b45309; }
.eu-type.blue { background: #dbeafe; color: #1d4ed8; } .eu-type.red { background: #fee2e2; color: #b91c1c; }
.eu-meta { display: block; margin-top: 6px; font-size: 13px; color: #64748b; line-height: 1.45; overflow-wrap: anywhere; }
.eu-meta i { font-style: normal; color: #cbd5e1; }
.eu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); margin-top: 12px; border: 1px solid #eef1f5; border-radius: 10px; overflow: hidden; }
.eu-m { display: block; padding: 8px 10px; border-right: 1px solid #eef1f5; min-width: 0; background: #fbfcfd; }
.eu-m:last-child { border-right: none; }
.eu-m small { display: block; font-size: 10.5px; font-weight: 700; color: #8a94a6; text-transform: uppercase; letter-spacing: .3px; }
.eu-m b { display: block; margin-top: 2px; font-size: 15px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.eu-chev { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: #2563eb; }
.eu-chev svg { transition: transform .25s ease; }
.eu-card.open .eu-chev svg { transform: rotate(180deg); }
/* Smooth expand: animate the panel's row from 0 to its natural height */
.eu-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1); }
.eu-card.open .eu-more { grid-template-rows: 1fr; }
.eu-more-in { overflow: hidden; min-height: 0; }
.eu-card.open .eu-more-in { border-top: 1px solid #eef1f5; }
.eu-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.eu-kv > div { padding: 9px 14px; border-bottom: 1px solid #f1f3f6; min-width: 0; }
.eu-kv > div:nth-child(odd) { border-right: 1px solid #f1f3f6; }
.eu-kv dt { font-size: 11px; font-weight: 600; color: #8a94a6; }
.eu-kv dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: #1e293b; overflow-wrap: anywhere; }
.eu-note { padding: 10px 14px; font-size: 13.5px; color: #334155; line-height: 1.45; border-bottom: 1px solid #f1f3f6; overflow-wrap: anywhere; }
.eu-note span { display: block; font-size: 11px; font-weight: 600; color: #8a94a6; margin-bottom: 2px; }
.eu-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 12px; flex-wrap: wrap; }
.eu-by { font-size: 12px; color: #94a3b8; min-width: 0; }
button.eu-del { height: 40px; min-height: 0 !important; padding: 0 14px !important; border: 1px solid #fecaca; border-radius: 10px !important; background: #fff5f5; color: #dc2626; font-size: 13px !important; font-weight: 800 !important; }
.eu-empty { padding: 30px 10px; text-align: center; color: #94a3b8; font-size: 14px; }
button.eu-moreBtn { display: block; width: 100%; margin-top: 12px; height: 48px; min-height: 0 !important; border: 1.5px dashed #cbd5e1; border-radius: 12px !important; background: #fff; color: #334155; font-weight: 800; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .eu-more, .eu-chev svg { transition: none; } }

/* ── Record cards (pcKit pcRecord) — Fuel fills, tanks, pump khata, efficiency ── */
.pc-recs { display: flex; flex-direction: column; gap: 14px; }
.pc-recs.inset { padding: 4px var(--pc-pad) var(--pc-pad); }
.pc-rec { background: #fff; border: 1px solid var(--pc-line); border-left: 4px solid #94a3b8; border-radius: 14px; box-shadow: var(--pc-shadow); overflow: hidden; min-width: 0; }
.pc-rec.green { border-left-color: #16a34a; } .pc-rec.amber { border-left-color: #f59e0b; } .pc-rec.red { border-left-color: #dc2626; }
.pc-rec.blue { border-left-color: #2563eb; } .pc-rec.violet { border-left-color: #7c3aed; }
.pc-rec-top { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px; }
.pc-rec-id { flex: 1; min-width: 0; }
.pc-rec-id > b { display: block; font-size: 16.5px; font-weight: 800; color: var(--pc-ink); letter-spacing: -.1px; line-height: 1.25; overflow-wrap: anywhere; }
.pc-rec-id > small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--pc-sub); }
.pc-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; font-size: 11.5px; font-weight: 700; color: #475569; letter-spacing: .3px; }
.pc-rec-hero { flex-shrink: 0; max-width: 50%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.pc-rec-hero span { font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }
.pc-rec-hero b { font-size: 20px; font-weight: 800; color: var(--pc-ink); letter-spacing: -.3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pc-rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid #eef1f5; }
.pc-rec-grid > div { padding: 11px 16px; min-width: 0; border-bottom: 1px solid #eef1f5; }
.pc-rec-grid > div:nth-child(odd) { border-right: 1px solid #eef1f5; }
.pc-rec-grid > div:nth-last-child(-n+2):nth-child(odd), .pc-rec-grid > div:last-child { border-bottom: none; }
.pc-rec-grid dt { font-size: 11.5px; font-weight: 600; color: #8a94a6; }
.pc-rec-grid dd { margin: 3px 0 0; font-size: 14.5px; font-weight: 700; color: #1e293b; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pc-rec-foot { padding: 12px 16px 14px; border-top: 1px solid #eef1f5; }
.pc-meter { height: 8px; border-radius: 8px; background: #eef1f5; overflow: hidden; }
.pc-meter i { display: block; height: 100%; border-radius: 8px; background: #16a34a; }
.pc-meter.amber i { background: #f59e0b; } .pc-meter.red i { background: #dc2626; }
.pc-rec-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pc-rec-acts .pc-act { flex: 1 1 auto; }
button.pc-act.danger { flex: 0 0 auto; border-color: #fecaca; background: #fff5f5; color: #dc2626; }
.pc-empty.boxed { background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--pc-radius); }
button.pc-btn.amber { --pc-btn: linear-gradient(135deg, #f59e0b, #d97706); --pc-btn-glow: rgba(217, 119, 6, .35); }
button.pc-btn.green { --pc-btn: linear-gradient(135deg, #16a34a, #15803d); --pc-btn-glow: rgba(21, 128, 61, .3); }
.pc-check { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--pc-line); border-radius: var(--pc-radius-sm); background: var(--pc-sunk); cursor: pointer; }
.pc-check input { width: 22px; height: 22px; flex-shrink: 0; accent-color: #dc2626; }
.pc-check b { display: block; font-size: 14px; color: var(--pc-ink); }
.pc-check small { display: block; font-size: 12px; color: var(--pc-sub); }
/* Fuel tabs: full-width segmented control, never wider than the screen */
.fuel-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 0 auto 20px; max-width: 880px; background: #e3e7ee; border-radius: 14px; }
button.fuel-tab { height: 42px; min-height: 0 !important; padding: 0 4px !important; border: none; border-radius: 10px !important; background: transparent; color: #475569; font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.fuel-tab.on { background: #fff; color: var(--pc-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }

/* ── Payments: docked In/Out bar + expandable transaction cards (paymentsUI.js) ── */
.pmt-dock { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 0; }
/* Desktop: stays in view at the bottom of the window while the list scrolls under it */
@media (min-width: 769px) {
  .pmt-dock { position: sticky; bottom: 0; z-index: 20; padding: 12px 0 16px; background: linear-gradient(to bottom, rgba(238, 241, 246, 0), #eef1f6 14px); }
}
@media (max-width: 768px) {
  /* Solid bar docked right above the bottom tabs — never floats over the list */
  .pmt-dock { position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 30; margin: 0;
    padding: 10px 14px; background: #fff; border-top: 1px solid #e6e9ef; box-shadow: 0 -6px 16px -10px rgba(15, 23, 42, .25); }
  .pmt-dock button.ts-act { height: 48px; box-shadow: none; }
  .ts-page.tx { padding-bottom: 92px; }   /* room so the last transaction is never hidden under the bar */
}
.tx-card { background: #fff; border: 1px solid var(--ts-line); border-radius: 12px; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.tx-card.open { border-color: #d5dce8; box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 10px 24px rgba(16, 24, 40, .08); }
.tx-card > .tx-row { border: none !important; border-radius: 0; background: transparent; }
.tx-chev { flex-shrink: 0; color: #94a3b8; transition: transform .25s ease; margin-left: -4px; }
.tx-card.open .tx-chev { transform: rotate(180deg); }
.tx-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1); }
.tx-card.open .tx-more { grid-template-rows: 1fr; }
.tx-more-in { overflow: hidden; min-height: 0; }
.tx-card.open .tx-more-in { border-top: 1px solid #eef1f5; }
.tx-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.tx-kv > div { padding: 9px 14px; border-bottom: 1px solid #f1f3f6; min-width: 0; }
.tx-kv > div:not(.wide):nth-child(odd) { border-right: 1px solid #f1f3f6; }
.tx-kv > div.wide { grid-column: 1 / -1; }
.tx-kv dt { font-size: 11px; font-weight: 600; color: #8a94a6; }
.tx-kv dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: #1e293b; overflow-wrap: anywhere; }
.tx-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; }
button.tx-btn { flex: 1 1 auto; height: 42px; min-height: 0 !important; padding: 0 14px !important; border: 1px solid #dbe3ee; border-radius: 10px !important; background: #f8fafc; color: #1e293b; font-size: 13.5px !important; font-weight: 700 !important; white-space: nowrap; }
button.tx-btn.danger { border-color: #fecaca; background: #fff5f5; color: #dc2626; flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) { .tx-more, .tx-chev { transition: none; } }

/* ── Measurement sheet: one scroll container, keyboard-aware (ui.js _sheetDock) ──
   While open the sheet sits directly under <body> and <main> is locked, so a
   swipe can only ever scroll the sheet. Height follows the visible viewport
   (--sheet-h shrinks while the keyboard is up) instead of 100vh. */
html.sheet-open #appContainer main { overflow: hidden !important; }
.fullscreen-sheet {
  inset: 0 !important; height: var(--sheet-h, 100dvh) !important; width: 100% !important;
  overflow-y: auto !important; overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y;
  scroll-padding-bottom: 120px;     /* focused fields stop clear of the bottom bar */
}
@media (max-width: 768px) {
  /* Compact measurement rows (≈ half the old height):
     Code | Description · Nos L B H · Unit | Quantity · Remarks | delete */
  #entryTable tbody tr { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px 8px !important; padding: 12px !important; margin-bottom: 10px !important; }
  #entryTable tbody td { min-width: 0; order: 6; }   /* custom columns (no label) sit after H */
  #entryTable tbody td[data-label="Code"] { order: 1; } #entryTable tbody td[data-label="Description"] { order: 2; }
  #entryTable tbody td[data-label="Nos"], #entryTable tbody td[data-label="Length"],
  #entryTable tbody td[data-label="Breadth"], #entryTable tbody td[data-label="Height"] { order: 3; }
  #entryTable tbody td[data-label="Unit"] { order: 7; } #entryTable tbody td[data-label="Quantity"] { order: 8; }
  #entryTable tbody td[data-label="Remarks"] { order: 9; } #entryTable tbody td[data-label=""] { order: 10; }
  #entryTable tbody td::before { font-size: 10px !important; margin-bottom: 2px !important; }
  #entryTable tbody td[data-label="Code"] { grid-column: span 1 !important; }
  #entryTable tbody td[data-label="Description"] { grid-column: span 3 !important; }
  #entryTable tbody td[data-label="Unit"] { grid-column: span 1 !important; }
  #entryTable tbody td[data-label="Quantity"] { grid-column: span 3 !important; padding: 6px 10px !important; flex-direction: row !important; align-items: center; justify-content: space-between; }
  #entryTable tbody td[data-label="Quantity"]::before { margin: 0 !important; font-size: 11px !important; color: #1d4ed8 !important; }
  #entryTable tbody td[data-label="Quantity"] .table-input { max-width: 60%; text-align: right; border: none !important; background: transparent !important; min-height: 36px !important; }
  #entryTable tbody td[data-label="Remarks"] { grid-column: span 3 !important; }
  #entryTable tbody td[data-label=""] { grid-column: span 1 !important; justify-content: flex-end; }
  #entryTable tbody td[data-label=""] button { min-height: 44px; padding: 0 !important; font-size: 0 !important; }
  #entryTable tbody td[data-label=""] button::after { content: '✕'; font-size: 16px; }
  #entryTable tbody td .table-input { min-height: 44px !important; font-size: 16px !important; padding: 8px 10px !important; }
  #entryTable tbody td[data-label="Nos"] .table-input, #entryTable tbody td[data-label="Length"] .table-input,
  #entryTable tbody td[data-label="Breadth"] .table-input, #entryTable tbody td[data-label="Height"] .table-input { text-align: center; padding: 8px 4px !important; }
  #entryTable tbody td[data-label="Unit"] { justify-content: flex-start; }

  /* ── Edit Abstract: one scroller (the sheet), each item as a labelled card ── */
  #abstractEditModal > div { display: block !important; }
  #abstractEditModal .overflow-y-auto.flex-1 { overflow: visible !important; border: none !important; flex: none !important; }
  #abstractEditModal table, #abstractEditModal tbody { display: block !important; width: 100% !important; min-width: 0 !important; }
  #abstractEditModal thead { display: none !important; }
  #abstractEditModal tr.abs-erow { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; margin-bottom: 10px; background: #fff; border: 1px solid #e2e8f0 !important; border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
  #abstractEditModal tr.abs-erow td { display: flex !important; flex-direction: column; min-width: 0; padding: 0 !important; border: none !important; text-align: left !important; }
  #abstractEditModal tr.abs-erow td::before { content: attr(data-label); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #94a3b8; margin-bottom: 2px; }
  #abstractEditModal tr.abs-erow td[data-label=""]::before { content: none; }
  #abstractEditModal td[data-label="#"] { grid-column: span 1; font-size: 13px !important; font-weight: 800; color: #475569 !important; }
  #abstractEditModal td[data-label="Code"] { grid-column: span 3; }
  #abstractEditModal td[data-label="Description"] { grid-column: 1 / -1; }
  #abstractEditModal td[data-label="Unit"] { grid-column: span 1; }
  #abstractEditModal td[data-label="Qty"] { grid-column: span 1; }
  #abstractEditModal td[data-label="Rate"] { grid-column: span 2; }
  #abstractEditModal td[data-label="Amount"] { grid-column: span 3; justify-content: center; font-size: 17px; color: #0f172a !important; }
  #abstractEditModal td.abs-del { grid-column: span 1; justify-content: flex-end; align-items: flex-end; }
  #abstractEditModal td.abs-del button { width: 44px; height: 44px; border-radius: 10px; background: #fff5f5; border: 1px solid #fecaca; }
  #abstractEditModal tr.abs-erow input { min-height: 44px; font-size: 16px !important; padding: 8px 10px !important; border-radius: 10px !important; }
  #abstractEditModal tr.abs-erow input.text-right, #abstractEditModal tr.abs-erow input.text-center { text-align: left !important; }
}

/* ── Touch drag-and-drop (touchDnd.js) ── */
[draggable="true"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tdnd-press { transform: scale(.98); transition: transform .2s ease; }
.tdnd-source { opacity: .35 !important; }
.tdnd-ghost { position: fixed !important; z-index: 2147483000 !important; pointer-events: none !important; margin: 0 !important; opacity: .96;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .28), 0 4px 10px rgba(15, 23, 42, .15) !important; border-radius: 12px; transition: none !important; }
.tdnd-over { outline: 2px dashed #f97316 !important; outline-offset: 2px; background-color: rgba(249, 115, 22, .06) !important; }
html.tdnd-active, html.tdnd-active * { cursor: grabbing !important; }

/* ═══ Planning & Scheduling — shared header + phone layouts ═══ */
.ps-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
button.ps-back { padding: 6px 14px; background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b; font-size: 12px; font-weight: 600 !important; }
.ps-steps { display: flex; align-items: center; gap: 6px; }
button.ps-step { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; font-size: 12px; font-weight: 700 !important; white-space: nowrap; border-radius: 999px !important; }
button.ps-step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #f1f5f9; color: #64748b; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
button.ps-step.on { background: #7c3aed; border-color: #7c3aed; color: #fff; }
button.ps-step.on i { background: rgba(255, 255, 255, .22); color: #fff; }
.ps-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ps-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sb-tl-start { font-size: 11px; font-weight: 700; color: #64748b; display: flex; align-items: center; gap: 5px; }
.sb-tl-start input { padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; }
.sb-task-fields label em { font-style: normal; }
.sb-task-side { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; align-self: flex-start; }
button.sb-task-mv { width: 26px; height: 22px; min-height: 0 !important; border: 1px solid #e2e8f0; background: #fff; color: #64748b; font-size: 9px !important; padding: 0; border-radius: 7px !important; }
button.sb-task-mv:disabled { opacity: .35; cursor: default; }
.sb-pal-head { display: flex; align-items: center; gap: 8px; }
.sb-pal-head em { font-style: normal; font-size: 10px; font-weight: 800; color: #0ea5e9; background: #e0f2fe; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.sb-pal-hint, .sb-pal-tog { display: none; }
.ps-phone { display: none !important; }

@media (max-width: 768px) {
  .ps-desk { display: none !important; }
  .ps-phone { display: flex !important; }
  button.ps-back { display: none; }
  .ps-top { margin-bottom: 10px; }
  /* stepper: three equal segments on one line */
  .ps-steps { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: #f1f5f9; border-radius: 12px; padding: 3px; }
  button.ps-step { justify-content: center; gap: 5px; padding: 0 4px; min-height: 36px !important; border: none; background: transparent; font-size: 12px !important; border-radius: 9px !important; min-width: 0; }
  button.ps-step span { overflow: hidden; text-overflow: ellipsis; }
  button.ps-step i { width: 18px; height: 18px; font-size: 10px; flex-shrink: 0; }
  button.ps-step.on { box-shadow: 0 2px 6px -2px rgba(124, 58, 237, .6); }
  button.ps-step:not(.on) i { background: #e2e8f0; }
  .sb-modes { display: grid !important; grid-template-columns: 1fr 1fr; margin-bottom: 12px !important; }
  .sb-modes > button { padding: 0 6px !important; white-space: nowrap; }
  .ps-head { gap: 10px; margin-bottom: 12px; }
  .ps-head h2 { font-size: 20px !important; line-height: 1.2; }
  .ps-acts { width: 100%; gap: 8px; }
  .ps-acts > * { flex: 1 1 auto; min-width: 0; justify-content: center; }
  .ps-acts > button { padding: 0 10px; white-space: nowrap; }
  .ps-acts .sb-tl-start { flex-basis: 100%; justify-content: space-between; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 6px 6px 6px 12px; font-size: 12px; }
  .ps-acts .sb-tl-start input { font-size: 15px; border: none; background: #f8fafc; }
  .ps-overall { padding: 10px 12px !important; gap: 8px !important; flex-wrap: wrap; }

  /* activity cards (Planning list + Scheduling timeline) */
  .ps-cards { flex-direction: column; gap: 10px; }
  .ps-act { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
  .ps-act:active { background: #fafbff; }
  .ps-act-top { display: flex; align-items: flex-start; gap: 10px; }
  .ps-num { width: 24px; height: 24px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
  .ps-act-nm { flex: 1; min-width: 0; }
  .ps-act-nm b { display: block; font-size: 14.5px; font-weight: 700; color: #0f172a; line-height: 1.3; overflow-wrap: anywhere; }
  .ps-act-nm small { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 600; color: #7c3aed; }
  .sb-tl .ps-act-nm small { color: #64748b; }
  button.ps-del { width: 34px; height: 34px; min-height: 0 !important; border: none; background: #fef2f2; font-size: 14px !important; flex-shrink: 0; padding: 0; }
  .ps-prog { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; }
  .ps-bar { flex: 1; height: 7px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
  .ps-bar i { display: block; height: 100%; border-radius: 99px; }
  .ps-prog b { font-size: 12px; font-weight: 800; min-width: 34px; text-align: right; }
  .ps-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid #f1f5f9; }
  .ps-grid > div { padding: 7px 0 0; min-width: 0; }
  .ps-grid > div:nth-child(n+3) { padding-top: 6px; }
  .ps-grid dt { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
  .ps-grid dd { margin: 1px 0 0; font-size: 13px; font-weight: 700; color: #334155; }
  .ps-grid dd.done { color: #0369a1; }
  .ps-none { background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 13px; }

  /* Scheduling → Activity timeline cards */
  .sb-tl-range { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px; }
  .sb-tl-in { display: grid; grid-template-columns: 1fr 92px; gap: 8px; margin-top: 10px; }
  .sb-tl-in label { display: flex; flex-direction: column; gap: 3px; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
  .sb-tl-in input { width: 100%; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 15px; font-weight: 600; color: #0f172a; background: #f8fafc; text-transform: none; }
  .sb-tl-track { position: relative; height: 8px; background: #f1f5f9; border-radius: 99px; margin-top: 10px; overflow: hidden; }
  .sb-tl-track i { position: absolute; top: 0; bottom: 0; background: #7c3aed; border-radius: 99px; }

  /* Location Planner — palette docks above the bottom tabs as a tray */
  .sb-head { margin-bottom: 12px; }
  .sb-head .text-xs { display: none; }
  .sb-body.sb-has-dock { padding-bottom: 150px; }
  .sb-palette { position: fixed !important; top: auto !important; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 30; margin: 0;
    border-radius: 18px 18px 0 0; border: 1px solid #e2e8f0; border-bottom: none; padding: 6px 12px 10px; box-shadow: 0 -10px 24px -14px rgba(15, 23, 42, .35); }
  .sb-pal-head { min-height: 34px; margin: 0; cursor: pointer; }
  .sb-pal-head::before { content: ''; position: absolute; left: 50%; top: 5px; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: #e2e8f0; }
  .sb-pal-hint { display: block; flex: 1; text-align: right; font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-pal-tog { display: block; color: #64748b; transition: transform .2s; }
  .sb-palette.sb-pal-shut .sb-pal-tog { transform: rotate(180deg); }
  .sb-palette.sb-pal-shut .sb-pal-body { display: none; }
  .sb-pal-note { display: none; }
  /* search sits at the head of the category row, so the tray is just three slim rows */
  .sb-pal-body { display: grid; grid-template-columns: 116px minmax(0, 1fr); column-gap: 6px; align-items: center; }
  .sb-search { height: 32px; margin: 0 0 8px; padding: 0 10px; font-size: 16px; border-radius: 999px; }
  .sb-pal-list { grid-column: 1 / -1; }
  .sb-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 8px 0; padding: 0 12px 0 0; }
  .sb-cats::-webkit-scrollbar, .sb-pal-list::-webkit-scrollbar { display: none; }
  button.sb-cat { flex-shrink: 0; min-height: 30px !important; font-size: 12px !important; padding: 0 12px; }
  .sb-pal-list { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden;
    gap: 6px; margin: 0 -12px; padding: 0 12px 2px; scrollbar-width: none; }
  .sb-chip { flex: 0 0 auto; max-width: 220px; padding: 9px 11px; touch-action: pan-x; }
  .sb-chip:hover { transform: none; }

  /* task cards: number + name on top with the ▲▼✕ controls, then compact boxed fields */
  .sb-zone { padding: 8px; min-height: 140px; }
  .sb-task { position: relative; display: block; padding: 10px; }
  .sb-task-seq { position: absolute; top: 10px; left: 10px; }
  .sb-task-ic { display: none; }
  .sb-task-nm { font-size: 14px; flex-wrap: wrap; gap: 6px; line-height: 1.3; min-height: 26px; padding: 2px 104px 0 30px; }
  .sb-task-side { position: absolute; top: 8px; right: 8px; flex-direction: row; }
  .sb-task-fields { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 6px; margin-top: 8px; }
  .sb-task-fields label { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; min-width: 0; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px 8px 2px; }
  .sb-task-fields label:focus-within { border-color: #0ea5e9; background: #fff; }
  .sb-task-fields label em { flex-basis: 100%; font-size: 9.5px; }
  .sb-task-fields label span { font-size: 11px; color: #64748b; }
  .sb-task-fields label:nth-child(2) span { display: none; }
  .sb-task-fields label:nth-child(4) { grid-column: span 2; }
  .sb-task-fields .sb-in { flex: 1; min-width: 0; width: auto !important; height: 26px; padding: 0; border: none; background: transparent; box-shadow: none !important; font-size: 15px; text-align: left; }
  .sb-task-fields .sb-in-date { font-size: 14px; }
  .sb-task-fields select.sb-in { max-width: none; font-size: 14px; }
  .sb-end { align-self: center; text-align: center; }
  button.sb-task-del, button.sb-task-mv { width: 30px; height: 30px; min-height: 0 !important; font-size: 11px !important; }
  .sb-res-toggle { width: 100%; gap: 6px 10px; }
  .sb-res { margin: -6px 0 0; padding: 14px 8px 8px; }
  .sb-res-row .sb-in { height: 36px; font-size: 15px; }
  .sb-zonebar { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .sb-startfld { justify-content: space-between; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 4px 4px 4px 12px; }
  .sb-startfld input { font-size: 15px; border: none; background: #f8fafc; padding: 6px 8px; }
  .sb-zone-acts { display: flex; gap: 8px; }
  .sb-zone-acts > button { flex: 1 1 auto; white-space: nowrap; padding: 0 10px; }
  .sb-loctabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 2px 12px; }
  .sb-loctab { flex-shrink: 0; }

  /* beat the global phone input rules (48px min-height, 12px padding, all !important) */
  #scheduleBuilderContent .sb-task-fields input.sb-in, #scheduleBuilderContent .sb-task-fields select.sb-in {
    min-height: 0 !important; height: 28px; padding: 0 !important; border: none !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important; font-size: 16px !important; }
  #scheduleBuilderContent .sb-task-fields select.sb-in { background-position: right 0 center !important; padding-right: 16px !important; }
  #scheduleBuilderContent input.sb-search { min-height: 0 !important; height: 32px; padding: 0 12px !important; border-radius: 999px !important; }
  #scheduleBuilderContent .sb-startfld input, #scheduleBuilderContent .sb-tl-start input { min-height: 0 !important; height: 38px; padding: 0 10px !important; }
  #scheduleBuilderContent .sb-tl-in input { min-height: 0 !important; height: 42px; padding: 0 10px !important; }
  #scheduleBuilderContent .sb-res-row input.sb-in { min-height: 0 !important; height: 36px; padding: 0 8px !important; }
  .sb-res-toggle { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  .sb-res-word { display: none; }
}

/* ═══ Recipe editor — centred modal, clear of the phone's navigation bar ═══
   Tokens: backdrop rgba(10,15,26,.55) + 6 px blur · card radius 24 · padding 20/16
   · close & action targets ≥ 44 px · card max-height 70% of the screen, so at
   least 15% stays free above and below (plus the safe-area insets). */
.rcp-ov { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  background: rgba(10, 15, 26, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: rcpFade .2s ease; overscroll-behavior: contain; touch-action: none; }
.rcp-ov.out { animation: rcpFade .18s ease reverse forwards; }
.rcp-ov.out .rcp-modal { animation: rcpIn .18s ease reverse forwards; }
@keyframes rcpFade { from { opacity: 0; } }
@keyframes rcpIn { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.rcp-modal { width: min(560px, 100%); max-height: 70vh; max-height: min(70dvh, 100%); display: flex; flex-direction: column; overflow: hidden; touch-action: auto;
  background: #fff; border-radius: 24px; box-shadow: 0 24px 60px -12px rgba(10, 15, 26, .45), 0 2px 8px rgba(10, 15, 26, .12);
  animation: rcpIn .24s cubic-bezier(.2, .9, .3, 1.15); }
.rcp-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 12px 14px 20px; border-bottom: 1px solid #e8edf3; flex-shrink: 0; }
.rcp-head-txt { flex: 1; min-width: 0; }
.rcp-code { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .03em; color: #1d4ed8; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 8px; padding: 2px 8px; margin-bottom: 6px; }
.rcp-head h3 { margin: 0; font-size: 18px !important; font-weight: 800 !important; line-height: 1.3; color: #0a0f1a; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rcp-head p { margin: 4px 0 0; font-size: 13.5px; color: #4a5568; }
.rcp-head p b { color: #0a0f1a; }
button.rcp-x { width: 44px; height: 44px; min-height: 44px !important; flex-shrink: 0; margin-top: -6px; border: none; border-radius: 50% !important; background: #f1f5f9; color: #334155; display: flex; align-items: center; justify-content: center; cursor: pointer; }
button.rcp-x:hover { background: #e2e8f0; }
.rcp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rcp-list { display: flex; flex-direction: column; gap: 10px; }
.rcp-row { border: 1px solid #e2e8f0; border-radius: 16px; padding: 12px; background: #fafbfd; display: flex; flex-direction: column; gap: 10px; }
.rcp-row-top { display: flex; gap: 8px; align-items: center; }
.rcp-row-top select { flex: 1; min-width: 0; }
button.rcp-row-x { width: 44px; height: 44px; min-height: 44px !important; flex-shrink: 0; border: none; border-radius: 12px !important; background: #fef2f2; color: #dc2626; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rcp-row-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rcp-row-nums label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcp-row-nums span { font-size: 12px; font-weight: 700; color: #4a5568; }
#recipeEditorModal .rcp-in { width: 100%; height: 48px; min-height: 48px !important; padding: 0 12px !important; border: 1.5px solid #d3dbe6 !important; border-radius: 12px !important; background-color: #fff !important; font-size: 16px !important; font-weight: 600; color: #0a0f1a !important; }
#recipeEditorModal .rcp-in:focus { border-color: var(--ts-blue, #d9481f) !important; box-shadow: 0 0 0 4px rgba(217, 72, 31, .15) !important; outline: none; }
#recipeEditorModal select.rcp-in { padding-right: 36px !important; text-overflow: ellipsis; }
.rcp-need { font-size: 12.5px; font-weight: 600; color: #15803d; min-height: 0; }
.rcp-need:empty { display: none; }
button.rcp-add { height: 48px; min-height: 48px !important; border: 1.5px dashed #93c5fd; border-radius: 14px !important; background: #eff6ff; color: #1d4ed8; font-size: 15px !important; font-weight: 700 !important; cursor: pointer; flex-shrink: 0; }
.rcp-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid #e8edf3; background: #fff; flex-shrink: 0; }
button.rcp-btn { height: 48px; min-height: 48px !important; padding: 0 18px; border-radius: 14px !important; font-size: 15px !important; font-weight: 700 !important; cursor: pointer; border: none; }
button.rcp-btn.ghost { margin-left: auto; background: #f1f5f9; color: #334155; }
button.rcp-btn.primary { background: var(--ts-blue, #d9481f); color: #fff; box-shadow: 0 6px 16px -6px rgba(217, 72, 31, .6); }
button.rcp-del { width: 48px; height: 48px; min-height: 48px !important; border: none; border-radius: 14px !important; background: #fef2f2; color: #dc2626; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.rcp-foot > :first-child.rcp-btn.ghost { margin-left: auto; }
@media (max-width: 380px) { .rcp-foot button.rcp-btn { padding: 0 14px; } }
@media (prefers-reduced-motion: reduce) { .rcp-ov, .rcp-modal { animation: none !important; } }
/* style.css turns every [id$="Modal"] into a bottom sheet on phones (align-items:flex-end,
   padding:0, full-width card, 92vh) — keep the Recipe editor centred instead. */
#recipeEditorModal.rcp-ov { align-items: center !important;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px)) !important; }
#recipeEditorModal > .rcp-modal { width: min(560px, 100%) !important; max-width: 100% !important; max-height: 70vh !important; max-height: min(70dvh, 100%) !important;
  border-radius: 24px !important; margin: 0 !important; animation: rcpIn .24s cubic-bezier(.2, .9, .3, 1.15) !important; }
#recipeEditorModal.out > .rcp-modal { animation: rcpIn .18s ease reverse forwards !important; }

/* Business tab (phones): a short last row fills the width instead of leaving holes —
   6-column grid, tiles span 2; two leftovers span 3 each, a single leftover spans the
   row and lays out horizontally. */
@media (max-width: 768px) {
  #workspaceView .ts-tiles { grid-template-columns: repeat(6, 1fr); }
  #workspaceView .ts-tile { grid-column: span 2; }
  #workspaceView .ts-tile:nth-child(3n+1):nth-last-child(2),
  #workspaceView .ts-tile:nth-child(3n+2):last-child { grid-column: span 3; }
  #workspaceView .ts-tile:nth-child(3n+1):last-child { grid-column: span 6; flex-direction: row; min-height: 72px; gap: 14px; }
}

/* ═══ Parties: tappable Receivable / Payable cards + their drill-down list ═══ */
.pt-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
button.pt-kpi { position: relative; display: flex; align-items: center; gap: 6px; min-height: 92px !important; padding: 14px 12px 14px 16px; text-align: left; cursor: pointer; overflow: hidden;
  background: #fff; border: 1px solid var(--ts-line); border-radius: 16px !important; box-shadow: var(--ts-shadow); font-weight: 400 !important;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease !important; -webkit-tap-highlight-color: transparent; }
button.pt-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
button.pt-kpi.rec::before { background: var(--ts-green, #16a34a); }
button.pt-kpi.pay::before { background: var(--ts-red, #dc2626); }
button.pt-kpi:hover { border-color: #cfd7e3; box-shadow: 0 8px 20px -10px rgba(16, 24, 40, .25); }
button.pt-kpi:active { transform: scale(.97) !important; background: #f8fafc; }
.pt-kpi-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-kpi-t small { font-size: 13px; font-weight: 600; color: var(--ts-muted); }
.pt-kpi-t b { font-size: 19px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-kpi-t b.long { font-size: 16px; }
.pt-kpi-t b.xlong { font-size: 14px; }
.pt-kpi.rec b { color: var(--ts-green, #16a34a); }
.pt-kpi.pay b { color: var(--ts-red, #dc2626); }
.pt-kpi-t em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--ts-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-kpi-go { position: absolute; top: 12px; right: 8px; display: flex; color: #94a3b8; transition: transform .2s ease; }
.pt-kpi-t small { padding-right: 20px; }
button.pt-kpi:hover .pt-kpi-go { transform: translateX(2px); color: var(--ts-ink); }

.pb-hero { border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; color: #fff; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--ts-shadow); }
.pb-hero.rec { background: linear-gradient(135deg, #15803d, #16a34a 60%, #22c55e); }
.pb-hero.pay { background: linear-gradient(135deg, #b91c1c, #dc2626 60%, #ef4444); }
.pb-hero small { font-size: 13px; font-weight: 600; opacity: .9; }
.pb-hero b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pb-hero span { font-size: 13.5px; opacity: .92; }
.pb-search { position: sticky; top: var(--pb-stick, 0px); z-index: 4; }
.pb-list { display: flex; flex-direction: column; gap: 8px; }
/* name | amount | chevron — the amount column right-aligns on tabular figures */
button.pb-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; width: 100%; min-height: 68px !important; padding: 12px 10px 12px 14px;
  background: #fff; border: 1px solid var(--ts-line); border-radius: 14px !important; box-shadow: var(--ts-shadow); text-align: left; cursor: pointer; font-weight: 400 !important;
  transition: transform .12s ease, box-shadow .15s ease !important; -webkit-tap-highlight-color: transparent; }
button.pb-row:hover { box-shadow: 0 8px 20px -10px rgba(16, 24, 40, .25); }
button.pb-row:active { transform: scale(.98) !important; background: #f8fafc; }
.pb-av { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #334155; background: #eef2f7; }
.pb-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pb-name b { font-size: 15.5px; font-weight: 700; line-height: 1.3; color: var(--ts-ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pb-name small { font-size: 12.5px; color: var(--ts-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-amt { font-size: 16px; font-weight: 800; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pb-page .pb-hero.rec ~ .pb-list .pb-amt { color: #15803d; }
.pb-page .pb-hero.pay ~ .pb-list .pb-amt { color: #b91c1c; }
.pb-chev { display: flex; color: #94a3b8; }
@media (max-width: 380px) { .pt-kpi-t b:not(.long):not(.xlong) { font-size: 17px; } button.pb-row { gap: 10px; padding-left: 12px; } .pb-amt { font-size: 15px; } }

/* ═══ Estimate editor: document style + saved T&C ═══ */
.ed-tc-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
#estimateEditor select.ed-tc-sel { flex: 1 1 200px; min-width: 0; height: 44px; min-height: 44px !important; padding: 0 36px 0 12px !important; border: 1.5px solid #d3dbe6 !important; border-radius: 12px !important; background-color: #fff !important; font-size: 15px !important; font-weight: 600; color: #0f172a !important; }
#estimateEditor button.ed-tc-btn { height: 44px; min-height: 44px !important; padding: 0 14px; border: none; border-radius: 12px !important; background: #0f1b2d; color: #fff; font-size: 13.5px !important; font-weight: 700 !important; white-space: nowrap; cursor: pointer; }
#estimateEditor button.ed-tc-btn.ghost { background: #eef2f7; color: #334155; }
#estimateEditor textarea.ed-tc-text { min-height: 140px; line-height: 1.55; font-size: 14px !important; background: #fff !important; border: 1.5px solid #d3dbe6 !important; border-radius: 12px !important; padding: 10px 12px !important; }
#estimateEditor textarea.ed-tc-text.ed-flash { animation: edFlash .9s ease; }
@keyframes edFlash { 0% { box-shadow: 0 0 0 0 rgba(217, 72, 31, .45); background: #fff7f3 !important; } 100% { box-shadow: 0 0 0 10px rgba(217, 72, 31, 0); } }
.ed-doc { margin-top: 16px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; display: flex; flex-direction: column; gap: 12px; }
.ed-doc-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ed-doc-h b { font-size: 14px; color: #0f172a; }
.ed-doc-h span { font-size: 12px; color: #64748b; }
.ed-tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#estimateEditor button.ed-tpl { display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 84px !important; border: 2px solid #e2e8f0; border-radius: 14px !important; background: #fff; text-align: left; cursor: pointer; font-weight: 400 !important; transition: border-color .15s, box-shadow .15s !important; }
#estimateEditor button.ed-tpl.on { border-color: #d9481f; box-shadow: 0 0 0 3px rgba(217, 72, 31, .14); }
.ed-tpl-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ed-tpl-t b { font-size: 14.5px; color: #0f172a; }
.ed-tpl-t small { font-size: 12px; color: #64748b; line-height: 1.3; }
/* miniature page thumbnails */
.ed-thumb { position: relative; flex-shrink: 0; width: 48px; height: 62px; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 6px 5px; }
.ed-thumb i { display: block; height: 3px; border-radius: 2px; background: #cbd5e1; }
.ed-thumb.classic .h { height: 5px; width: 60%; background: #111827; }
.ed-thumb.classic .r { height: 1px; background: #111827; box-shadow: 0 2px 0 -0.5px #d9481f; width: 100%; }
.ed-thumb.modern { padding-top: 0; }
.ed-thumb.modern .h { height: 15px; margin: 0 -5px 2px; border-radius: 0; background: linear-gradient(115deg, #0f1b2d 68%, #d9481f 68%); }
.ed-thumb.modern .c { height: 7px; background: #fcece5; }
.ed-thumb .s { width: 55%; align-self: flex-end; background: #d9481f; }
#estimateEditor button.ed-preview { height: 48px; min-height: 48px !important; border: 1.5px solid #0f1b2d; border-radius: 12px !important; background: #fff; color: #0f1b2d; font-size: 14.5px !important; font-weight: 700 !important; cursor: pointer; }
@media (max-width: 520px) { .ed-tpls { grid-template-columns: 1fr; } }

/* Saved-T&C manager + desktop preview (centred windows) */
#termsPresetOverlay .rcp-in { width: 100%; height: 48px; padding: 0 12px !important; border: 1.5px solid #d3dbe6 !important; border-radius: 12px !important; background: #fff !important; font-size: 16px !important; }
#termsPresetOverlay .rcp-head h3 { font-size: 18px !important; }
.ed-f { display: flex; flex-direction: column; gap: 6px; }
.ed-f > span { font-size: 13px; font-weight: 700; color: #475569; }
#termsPresetOverlay textarea.ed-tp-body { min-height: 200px; padding: 10px 12px !important; border: 1.5px solid #d3dbe6 !important; border-radius: 12px !important; background: #fff !important; font-size: 15px !important; line-height: 1.5; resize: vertical; }
.ed-chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 600; color: #334155; }
.ed-chk input { width: 22px; height: 22px; }
.ed-tp { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fafbfd; }
.ed-tp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ed-tp-t b { font-size: 15px; color: #0f172a; }
.ed-tp-t b em { font-style: normal; font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: #d9481f; background: #fcece5; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.ed-tp-t small { font-size: 12.5px; color: #64748b; line-height: 1.35; }
.ed-tp-a { display: flex; gap: 6px; flex-shrink: 0; }
#termsPresetOverlay .ed-tp-a button { min-width: 44px; height: 44px; min-height: 44px !important; padding: 0 10px; border: none; border-radius: 12px !important; background: #eef2f7; color: #334155; font-size: 13px !important; font-weight: 700 !important; cursor: pointer; }
#termsPresetOverlay .ed-tp-a button.del { background: #fef2f2; color: #dc2626; }
.ed-empty { font-size: 14px; color: #64748b; line-height: 1.5; text-align: center; padding: 16px 8px; }
.ed-pv { width: min(960px, 100%); height: min(92vh, 100%); background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 60px -12px rgba(10, 15, 26, .5); }
.ed-pv header { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid #e8edf3; }
.ed-pv header b { font-size: 15px; }
.ed-pv header span { flex: 1; font-size: 12.5px; color: #64748b; }
.ed-pv header button { width: 44px; height: 44px; border: none; border-radius: 50% !important; background: #f1f5f9; cursor: pointer; font-size: 16px; }
.ed-pv iframe { flex: 1; width: 100%; border: 0; background: #525659; }
/* The estimate editor is a full-screen layer at z-index 99999 — its windows go above it. */
#termsPresetOverlay.rcp-ov, #estPreviewOverlay.rcp-ov { z-index: 100010; }
@media (max-width: 640px) {
  #estimateEditor select.ed-tc-sel { flex-basis: 100%; }
  #estimateEditor button.ed-tc-btn { flex: 1; }
}

/* ── Mix Design: long BOQ titles wrap, clamp to 2 lines, "Read more" expands ── */
.rcp-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.35; }
.rcp-title.open { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
button.rcp-more { display: inline-block; margin-top: 2px; padding: 2px 0 !important; min-height: 0 !important; background: none; border: none;
  border-radius: 0 !important; color: #2563eb; font-size: 11.5px !important; font-weight: 700 !important; cursor: pointer; }

/* ── Central Store: the add-store row can never push the button off-screen ── */
.st-add { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-add input { flex: 1 1 auto; min-width: 0; width: 100%; }
.st-add button { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
  .st-add { flex: 1 1 100%; width: 100%; }            /* drops onto its own full-width line */
  .st-add input { min-height: 44px !important; }
  .st-add button { min-height: 44px !important; padding: 0 14px !important; font-size: 13px !important; }
}

/* ── GRN Register: table on ≥769px, one card per GRN on phones (Stock Register card kit) ── */
@media (max-width: 768px) {
  #grnRegisterContent { max-width: 100%; overflow-x: hidden; }
  .grn-table { display: none !important; }
  .grn-cards { padding: 12px; background: #f6f7f9; }
  .grn-flt { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px !important; }
  .grn-flt > select, .grn-flt > input, .grn-flt > button { width: 100%; min-width: 0; }
  .grn-flt-acts { grid-column: 1 / -1; margin-left: 0 !important; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grn-pager { padding: 12px !important; }
  .grn-pager > div:last-child { margin-left: 0 !important; width: 100%; justify-content: space-between; flex-wrap: wrap; }
}
.grn-card { border-left: 4px solid #dc2626; }
.grn-card.billed { border-left-color: #16a34a; }
.grn-card .rc-top { align-items: flex-start; }
input.grn-card-tick, .grn-selall input { width: 22px; height: 22px; min-height: 0 !important; padding: 0 !important; margin: 2px 0 0; flex-shrink: 0; accent-color: #dc2626; }
.grn-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #4338ca !important; }
.grn-pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.grn-pill.ok { background: #dcfce7; color: #15803d; } .grn-pill.no { background: #fee2e2; color: #b91c1c; }
.grn-mat { padding: 0 14px 10px; font-size: 14px; font-weight: 800; color: #334155; overflow-wrap: anywhere; }
.grn-short { color: #e11d48; font-size: 11px; }
.grn-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid #eef1f5; }
.grn-qc { font-size: 12px; font-weight: 700; color: #16a34a; } .grn-qc.pend { color: #d97706; }
.grn-acts { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
button.grn-act { height: 36px; min-height: 0 !important; padding: 0 12px !important; border: 1px solid #c7d7fe; border-radius: 10px !important; background: #eef4ff;
  color: #1d4ed8; font-size: 12.5px !important; font-weight: 800 !important; white-space: nowrap; }
button.grn-act.danger { border-color: #fecaca; background: #fff5f5; color: #dc2626; }
button.grn-act.ok { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.grn-locked { font-size: 12px; color: #94a3b8; font-weight: 600; }
.grn-selall { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: #475569; padding: 2px 2px 0; }
.grn-empty { padding: 30px 10px; text-align: center; color: #94a3b8; font-size: 14px; }

/* ── Petty Cash wallet (pettyCash.js): owner overview + supervisor wallet + ledger cards ── */
.pcw { max-width: 760px; }
.pcw-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 18px 18px 16px; color: #fff; margin-bottom: 14px;
  background: radial-gradient(120% 140% at 100% 0%, #1f8a3b 0%, #14532d 55%, #0f172a 100%); box-shadow: 0 10px 28px -12px rgba(20, 83, 45, .55); }
.pcw-hero-l { font-size: 13px; font-weight: 600; opacity: .85; overflow-wrap: anywhere; }
.pcw-hero-cap { margin-top: 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.pcw-hero-v { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcw-hero-v.neg { color: #fecaca; }
.pcw-hero-note { margin-top: 10px; font-size: 12.5px; font-weight: 600; color: #fde68a; }
.pcw-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pcw-split.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pcw-split > div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.pcw-split span { display: block; font-size: 11px; font-weight: 600; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcw-split b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcw-bar { height: 6px; border-radius: 6px; background: #e8edf3; overflow: hidden; }
.pcw-bar i { display: block; height: 100%; border-radius: 6px; background: #16a34a; transition: width .4s; }
.pcw-bar.light { margin-top: 12px; background: rgba(255, 255, 255, .18); } .pcw-bar.light i { background: #86efac; }
@media (max-width: 768px) {
  /* the running balance stays on screen while the history scrolls */
  .pcw-sticky { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 4; }   /* just under the 60px app bar */
}
.pcw-acts { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pcw-acts > * { flex: 1 1 140px; }
.pcw-acts.sm > * { flex: 1 1 110px; }
button.pcw-btn { height: 46px; min-height: 0 !important; padding: 0 14px !important; border-radius: 12px !important; border: 1px solid transparent;
  font-size: 14px !important; font-weight: 800 !important; white-space: nowrap; cursor: pointer; }
button.pcw-btn.green { background: #16a34a; color: #fff; box-shadow: 0 4px 12px -6px rgba(22, 163, 74, .7); }
button.pcw-btn.dark { background: #0f172a; color: #fff; }
button.pcw-btn.ghost { background: #fff; color: #334155; border-color: #dfe4ec; }
button.pcw-btn.ghost.red { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
button.pcw-btn:disabled { opacity: .45; cursor: not-allowed; }
button.pcw-log { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; min-height: 0 !important; margin-bottom: 12px;
  border: none; border-radius: 14px !important; background: #0f172a; color: #fff; font-size: 17px !important; font-weight: 800 !important;
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, .8); cursor: pointer; }
button.pcw-log:active { transform: scale(.985); }
button.pcw-back { height: 36px; min-height: 0 !important; padding: 0 14px !important; margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 10px !important;
  background: #fff; color: #475569; font-size: 13px !important; font-weight: 700 !important; }
.pcw-h { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; font-size: 15px; font-weight: 800; color: var(--ts-ink); }
.pcw-h span { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: #eef1f5; color: #64748b; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.pcw-list { display: flex; flex-direction: column; gap: 10px; }
.pcw-empty { padding: 28px 10px; text-align: center; color: #94a3b8; font-size: 14px; background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; }
.pcw-chip { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.pcw-chip.amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pcw-chip.red { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
/* supervisor card (owner view) */
.pcw-sup { background: #fff; border: 1px solid var(--ts-line); border-radius: 16px; padding: 14px 14px 12px; box-shadow: var(--ts-shadow); cursor: pointer; min-width: 0; }
.pcw-sup:hover { border-color: #cfd8e3; }
.pcw-sup-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pcw-av { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #dcfce7; color: #166534; font-weight: 800; font-size: 17px; }
.pcw-sup-id { flex: 1; min-width: 0; }
.pcw-sup-id b { display: block; font-size: 16px; font-weight: 800; color: var(--ts-ink); overflow-wrap: anywhere; line-height: 1.25; }
.pcw-sup-id small { display: block; font-size: 12.5px; color: var(--ts-muted); }
.pcw-sup-bal { text-align: right; flex-shrink: 0; max-width: 50%; }
.pcw-sup-bal small { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; }
.pcw-sup-bal b { display: block; font-size: 18px; font-weight: 800; color: #15803d; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcw-sup-bal.neg b { color: #dc2626; }
.pcw-sup-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: #64748b; }
.pcw-sup-foot b { color: #1e293b; font-variant-numeric: tabular-nums; }
/* pending-confirmation box */
.pcw-pend { background: #fffbeb; border: 1px solid #fde68a; border-radius: 16px; padding: 12px; margin-bottom: 4px; }
.pcw-pend > b { display: block; color: #b45309; font-size: 14px; }
.pcw-pend > small { display: block; color: #92400e; font-size: 12.5px; margin: 2px 0 10px; }
/* transaction card */
.pcw-tx { background: #fff; border: 1px solid var(--ts-line); border-left: 4px solid #dc2626; border-radius: 14px; box-shadow: var(--ts-shadow); min-width: 0; }
.pcw-tx.in { border-left-color: #16a34a; } .pcw-tx.ret { border-left-color: #2563eb; }
.pcw-tx.pend { border-left-color: #f59e0b; } .pcw-tx.disp { border-left-color: #b91c1c; }
.pcw-tx.flash { animation: pcwFlash 1.4s ease; }
@keyframes pcwFlash { 0%, 30% { box-shadow: 0 0 0 3px rgba(22, 163, 74, .35); } 100% { box-shadow: var(--ts-shadow); } }
.pcw-tx-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.pcw-tx-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #f1f5f9; }
.pcw-tx.in .pcw-tx-ic { background: #dcfce7; } .pcw-tx.ret .pcw-tx-ic { background: #dbeafe; } .pcw-tx.pend .pcw-tx-ic { background: #fef3c7; }
.pcw-tx-main { flex: 1; min-width: 0; }
.pcw-tx-main b { display: block; font-size: 15px; font-weight: 700; color: var(--ts-ink); overflow-wrap: anywhere; line-height: 1.3; }
.pcw-tx-main small { display: block; margin-top: 2px; font-size: 12.5px; color: #64748b; overflow-wrap: anywhere; line-height: 1.35; }
.pcw-tx-amt { flex-shrink: 0; max-width: 45%; text-align: right; }
.pcw-tx-amt b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcw-tx.in .pcw-tx-amt b { color: #15803d; } .pcw-tx.ret .pcw-tx-amt b { color: #1d4ed8; }
.pcw-tx.pend .pcw-tx-amt b, .pcw-tx.disp .pcw-tx-amt b { color: #94a3b8; }
.pcw-tx-amt small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 600; color: #94a3b8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcw-tx-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 12px 64px; }
.pcw-tx-acts > * { flex: 1 1 auto; }
.pcw-tx-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
button.pcw-mini.del { display: inline-block; width: 30px; height: 26px; margin: 2px -6px -6px 0; padding: 0 !important; border-color: transparent; background: transparent; opacity: .7; }
button.pcw-mini { height: 30px; min-height: 0 !important; padding: 0 10px !important; border: 1px solid #e2e8f0; border-radius: 8px !important; background: #f8fafc;
  color: #475569; font-size: 12px !important; font-weight: 700 !important; }
button.pcw-mini.del { color: #94a3b8; }
@media (max-width: 380px) { .pcw-tx-acts { padding-left: 14px; } .pcw-hero-v { font-size: 30px; } }
/* Log Expense sheet */
.pcx { padding: 16px 18px 18px; }
.pcx-wallet { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #f6f8fb; border: 1px solid #e6ebf2; margin-bottom: 14px; }
.pcx-wallet > div:not(.pcx-arrow) { flex: 1; min-width: 0; }
.pcx-wallet span { display: block; font-size: 11px; font-weight: 700; color: #8a94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcx-wallet b { display: block; font-size: 17px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcx-arrow { color: #94a3b8; font-weight: 800; }
.pcx-after { text-align: right; } .pcx-after b { color: #15803d; transition: color .15s; }
.pcx-after.neg b { color: #dc2626; }
.pcx-l { margin: 4px 0 6px; font-size: 12.5px; font-weight: 700; color: #475569; }
.pcx-l i { font-style: normal; font-weight: 600; color: #94a3b8; }
.pcx-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
button.pcx-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; min-height: 0 !important; padding: 4px !important;
  border: 1.5px solid #e2e8f0; border-radius: 12px !important; background: #fff; color: #334155; font-size: 12px !important; font-weight: 700 !important; line-height: 1.15; text-align: center; }
button.pcx-chip span { font-size: 20px; }
button.pcx-chip.on { border-color: #0f172a; background: #0f172a; color: #fff; }
.pcx-amt { display: flex; align-items: center; gap: 6px; padding: 0 14px; margin-bottom: 10px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #fff; }
.pcx-amt:focus-within { border-color: #0f172a; }
.pcx-amt span { font-size: 24px; font-weight: 800; color: #94a3b8; }
.pcx-amt input { flex: 1; min-width: 0; height: 58px; border: none !important; outline: none; background: transparent; padding: 0 !important; box-shadow: none !important;
  font-size: 28px !important; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.pcx-in { width: 100%; height: 46px; padding: 0 12px; margin-bottom: 10px; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 14.5px; background: #fff; box-sizing: border-box; outline: none; }
.pcx-in:focus { border-color: #0f172a; }
.pcx-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pcx-photo { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; margin-bottom: 10px; border: 1.5px dashed #cbd5e1; border-radius: 12px;
  font-size: 13.5px; font-weight: 700; color: #334155; cursor: pointer; white-space: nowrap; overflow: hidden; }
#pcExPhotoPreview img { max-height: 120px; border-radius: 10px; border: 1px solid #e2e8f0; margin-bottom: 10px; }
.pcx .pcw-log { margin: 6px 0 0; }
/* Project Home money strip opens that site in the Business dashboard */
#projDashKPIs.ts-link { cursor: pointer; transition: box-shadow .15s; }
#projDashKPIs.ts-link:hover { box-shadow: 0 0 0 2px #e2e8f0, var(--ts-shadow); }
.pcw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -4px 0 14px; background: #fff; border: 1px solid var(--ts-line); border-radius: 14px; box-shadow: var(--ts-shadow); }
.pcw-stats > div { padding: 10px 12px; min-width: 0; border-right: 1px solid #eef1f5; }
.pcw-stats > div:last-child { border-right: none; }
.pcw-stats span { display: block; font-size: 11.5px; font-weight: 600; color: #8a94a6; }
.pcw-stats b { display: block; font-size: 15px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pcw-stats .in b { color: #15803d; } .pcw-stats .ret b { color: #1d4ed8; }
/* the global phone input skin (style.css) is beaten by id specificity here */
#pcModalOverlay #pcExAmount { height: 58px; min-height: 0 !important; padding: 0 !important; border: none !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; font-size: 28px !important; font-weight: 800; color: #0f172a !important; }
#pcModalOverlay .pcx-in { height: 46px; min-height: 0 !important; padding: 0 12px !important; border: 1px solid #e2e8f0 !important; border-radius: 12px !important; font-size: 14.5px !important; background: #fff !important; }
#pcModalOverlay .pcx-in:focus { border-color: #0f172a !important; box-shadow: 0 0 0 3px rgba(15, 23, 42, .08) !important; }
.ts-dash-link { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border-top: 1px solid var(--ts-line);
  font-size: 13px; font-weight: 700; color: var(--ts-blue); }
.ts-dash-link i { font-style: normal; font-size: 16px; line-height: 1; }
#projDashKPIs.tsp-sum > div:nth-child(3) { border-right: none; }

/* ── Measurement export: step 2 (Simple / Detailed) — measurementExports.js ──
   Phones: bottom sheet that slides up over a dimmed page. ≥640px: centred dialog. */
.mx-ov { position: fixed; inset: 0; z-index: 200002; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, 0); transition: background .18s ease; -webkit-tap-highlight-color: transparent; }
.mx-ov.open { background: rgba(15, 23, 42, .5); }
.mx-sheet { width: 100%; max-width: 520px; background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(15, 23, 42, .22);
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.mx-ov.open .mx-sheet { transform: none; }
.mx-grab { width: 40px; height: 4px; border-radius: 4px; background: #d6dbe3; margin: 2px auto 10px; }
.mx-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mx-fmt { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 900; letter-spacing: .06em; color: #fff; }
.mx-fmt.pdf { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.mx-fmt.excel { background: linear-gradient(135deg, #22c55e, #15803d); }
.mx-ttl { flex: 1; min-width: 0; }
.mx-ttl h3 { margin: 0; font-size: 18px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.mx-ttl small { display: block; margin-top: 2px; font-size: 13px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#measExportOverlay button.mx-x { width: 36px; height: 36px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 10px !important;
  background: #f1f5f9; color: #475569; font-size: 20px !important; font-weight: 600 !important; line-height: 1; flex-shrink: 0; }
.mx-q { margin: 0 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.mx-opts { display: flex; flex-direction: column; gap: 10px; }
#measExportOverlay button.mx-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px !important; padding: 12px 14px !important; text-align: left;
  border: 1.5px solid #e5e9f0; border-radius: 16px !important; background: #fff; color: #0f172a; font-weight: 400 !important; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .08s, background .15s; }
#measExportOverlay button.mx-opt:hover { border-color: #cbd5e1; box-shadow: 0 6px 18px -10px rgba(15, 23, 42, .35); }
#measExportOverlay button.mx-opt:focus-visible { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
#measExportOverlay button.mx-opt:active { transform: scale(.985); background: #f8fafc; }
#measExportOverlay button.mx-opt:disabled { cursor: progress; opacity: .55; }
#measExportOverlay button.mx-opt.busy { opacity: 1; border-color: #0f172a; }
.mx-ic { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #f1f5f9; }
.mx-opt[data-depth="simple"] .mx-ic { background: #eef4ff; }
.mx-opt[data-depth="detailed"] .mx-ic { background: #fdf4ff; }
.mx-tx { flex: 1; min-width: 0; }
.mx-tx b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; }
.mx-tx small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: #64748b; }
.mx-tag { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: #f3e8ff; color: #7e22ce; font-size: 11.5px; font-weight: 800; }
.mx-go { flex-shrink: 0; font-size: 24px; line-height: 1; color: #94a3b8; }
.mx-opt.busy .mx-go { width: 18px; height: 18px; font-size: 0; border: 2.5px solid #cbd5e1; border-top-color: #0f172a; border-radius: 50%; animation: mxSpin .7s linear infinite; }
@keyframes mxSpin { to { transform: rotate(360deg); } }
/* Bar Bending Schedule: a card with two orientation buttons (not a button itself) */
#measExportOverlay .mx-opt.mx-bbs { display: flex; align-items: flex-start; gap: 14px; padding: 12px 14px; border: 1.5px solid #fed7aa; border-radius: 16px; background: #fffaf5; }
.mx-bbs .mx-ic { background: #ffedd5; }
.mx-bbs em.mx-style { display: block; margin-top: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: #9a3412; }
.mx-bbs em.mx-style span { font-weight: 500; color: #94a3b8; }
.mx-orient { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
#measExportOverlay button.mx-or { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-height: 0 !important; padding: 0 10px !important;
  border: 1.5px solid #e5e9f0; border-radius: 12px !important; background: #fff; color: #0f172a; font-size: 14px !important; font-weight: 800 !important; cursor: pointer; }
#measExportOverlay button.mx-or:hover { border-color: #ea580c; color: #c2410c; }
#measExportOverlay button.mx-or:focus-visible { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
#measExportOverlay button.mx-or:disabled { cursor: progress; opacity: .55; }
.mx-or i { display: inline-block; border: 2px solid currentColor; border-radius: 3px; }
.mx-or i.land { width: 20px; height: 14px; } .mx-or i.port { width: 14px; height: 19px; }
@media (min-width: 640px) {
  .mx-ov { align-items: center; padding: 24px; }
  .mx-sheet { max-width: 440px; border-radius: 20px; padding: 18px 18px 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    transform: translateY(8px) scale(.97); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
  .mx-ov.open .mx-sheet { transform: none; opacity: 1; }
  .mx-grab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mx-ov, .mx-sheet { transition: none !important; } }
.mx-sheet:focus { outline: none; }

/* ── Bill forms: pending items by month (billPickers.js) — Purchase GRNs + Sale abstracts ── */
.pg-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 10px 12px 12px; }
.pg-month { flex-shrink: 0; background: #fff; border: 1px solid #e6e9ef; border-radius: 12px; overflow: hidden; }   /* never squashed by the list's max-height */
.pg-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; user-select: none;
  position: sticky; top: 0; z-index: 1; background: #fafbfc; border-bottom: 1px solid transparent; }
.pg-head::-webkit-details-marker { display: none; }
.pg-month[open] > .pg-head { border-bottom-color: #eef1f5; }
.pg-head:hover { background: #f4f6f9; }
.pg-head:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.pg-chev { width: 8px; height: 8px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(-45deg); transition: transform .15s; flex-shrink: 0; margin: 0 2px 0 0; }
.pg-month[open] .pg-chev { transform: rotate(45deg); }
.pg-label { font-size: 13px; font-weight: 800; color: #0f172a; letter-spacing: -.1px; white-space: nowrap; }
.pg-count { min-width: 20px; height: 20px; padding: 0 7px; border-radius: 10px; background: #eef1f5; color: #475569; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.pg-sum { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #334155; font-variant-numeric: tabular-nums; }
button.pg-selm { height: 26px; min-height: 0 !important; padding: 0 10px !important; border: 1px solid #e2e8f0; border-radius: 8px !important; background: #fff;
  color: #2563eb; font-size: 11.5px !important; font-weight: 700 !important; white-space: nowrap; }
.pg-items { display: flex; flex-direction: column; }
.pg-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid #f1f3f6; cursor: pointer; min-width: 0; }
.pg-row:first-child { border-top: none; }
.pg-row:hover { background: #f8fafc; }
.pg-row.done { opacity: .55; cursor: default; }
.pg-row input[type="checkbox"] { width: 17px; height: 17px; min-height: 0 !important; padding: 0 !important; margin: 0; flex-shrink: 0; accent-color: #2563eb; }
.pg-date { width: 74px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: #64748b; font-variant-numeric: tabular-nums; }
.pg-main { flex: 1; min-width: 0; }
.pg-main b { display: block; font-size: 13px; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-main small { display: block; font-size: 11.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #b45309; font-weight: 700; }
.pg-amt { flex-shrink: 0; font-size: 13px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
button.pg-add { height: 28px; min-height: 0 !important; padding: 0 12px !important; border: none; border-radius: 8px !important; background: #2563eb; color: #fff;
  font-size: 12px !important; font-weight: 800 !important; flex-shrink: 0; }
.pg-added { flex-shrink: 0; font-size: 11.5px; font-weight: 800; color: #16a34a; }
#siPendingItemsPanel .pg-list { padding: 0; max-height: 300px; }
@media (max-width: 640px) {
  .pg-row { flex-wrap: wrap; row-gap: 2px; }
  .pg-date { width: auto; order: 3; }
  button.pg-add, .pg-added { order: 4; margin-left: auto; }
  .pg-main { flex-basis: calc(100% - 140px); }
  .pg-sum { font-size: 12px; }
}

/* ── Tax scope: segmented control over the native select ──
   Lives in the "Line items" header; the per-line Type column keeps its width. */
.tx-host { display: flex; align-items: center; min-width: 0; }
select.tx-scope-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.tx-scope-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tx-scope-cap { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.tx-scope { display: inline-flex; padding: 3px; gap: 2px; background: #eef1f5; border-radius: 11px; box-shadow: inset 0 0 0 1px #e2e6ec; }
.tx-scope.mixed { box-shadow: inset 0 0 0 1px #fcd34d; background: #fffbeb; }
.tx-scope button.tx-opt { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: 38px; min-height: 0 !important;
  padding: 0 12px !important; border: none; border-radius: 8px !important; background: transparent; color: #475569; text-align: left; cursor: pointer;
  font-weight: 400 !important; transition: background .15s, color .15s, box-shadow .15s; }
.tx-scope button.tx-opt b { font-size: 12.5px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.tx-scope button.tx-opt small { font-size: 10.5px; font-weight: 600; color: #94a3b8; line-height: 1.15; white-space: nowrap; }
.tx-scope button.tx-opt:hover { background: rgba(255, 255, 255, .6); color: #0f172a; }
.tx-scope button.tx-opt.on { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 1px 6px rgba(15, 23, 42, .06); }
.tx-scope button.tx-opt.on small { color: #2563eb; }
.tx-scope button.tx-opt:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.tx-hint { flex-basis: 100%; font-size: 11.5px; color: #64748b; }
.tx-hint b { color: #334155; }
button.tx-hint-use { min-height: 0 !important; height: auto; padding: 0 0 0 6px !important; border: none; background: none; color: #2563eb; font-size: 11.5px !important; font-weight: 700 !important; }
/* Sale form: header bar above the line items (matches the purchase "Line Items" bar) */
.li-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.li-head h3 { margin: 0 auto 0 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #334155; }
@media (max-width: 640px) {
  .tx-scope { width: 100%; }
  .tx-scope button.tx-opt { flex: 1 1 0; padding: 0 8px !important; }
}

/* ── Manage Materials store context (ui.js _invLockedStore) ──
   Inside a project the store is fixed: a read-only chip replaces the store picker. */
.inv-store-lock { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid #dbe3ee; border-radius: 10px; background: #f6f9fc; min-width: 0; }
.isl-ic { font-size: 16px; flex-shrink: 0; }
.isl-tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.isl-tx b { font-size: 14px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isl-tx small { font-size: 11.5px; font-weight: 600; color: #64748b; }
.inv-ctx { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--ts-line, #e5e9f0); box-shadow: var(--ts-shadow, none); }
.inv-ctx.central { background: #f0fdfa; border-color: #99f6e4; }
.inv-ctx-note { margin-left: auto; font-size: 12px; color: #64748b; }
@media (max-width: 640px) { .inv-ctx-note { margin-left: 0; flex-basis: 100%; } }

/* ═══ Bill forms (Purchase · Sale): action bar, tax bar, phone layout ══════════
   Tokens shared by both: 12px field radius, 46px controls, 14px card radius,
   11px uppercase micro-labels; accent = --lxf-accent (orange purchase / blue sale). */
.pf-foot { flex-shrink: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 24px;
  background: #fff; border-top: 1px solid #ece7e1; box-shadow: 0 -8px 22px -16px rgba(120, 60, 20, .35); }
.pf-save-short { display: none; }
button.pf-cancel { height: 48px; min-height: 0 !important; padding: 0 22px !important; border: 1px solid #e2e8f0; border-radius: 12px !important;
  background: #fff; color: #334155; font-size: 15px !important; font-weight: 700 !important; }
/* "Rates incl. GST" → a real toggle switch (any width) */
.tgl input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; width: 38px !important; height: 22px !important;
  min-height: 0 !important; padding: 0 !important; margin: 0; border: none !important; border-radius: 999px !important; background: #cbd5e1 !important;
  cursor: pointer; transition: background .18s; flex-shrink: 0; }
.tgl input[type="checkbox"]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .18s; }
.tgl input[type="checkbox"]:checked { background: var(--lxf-accent, #2563eb) !important; }
.tgl input[type="checkbox"]:checked::after { transform: translateX(16px); }
.tgl input[type="checkbox"]:focus-visible { outline: 2px solid var(--lxf-accent, #2563eb); outline-offset: 2px; }

@media (max-width: 768px) {
  /* ── Compact header: one line, actions live in the bottom bar ── */
  .lxform .lxform-head { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px !important; min-height: 0 !important; gap: 8px; flex-wrap: nowrap; }
  .lxform .lxform-head .sub, .lxform .lxform-head .lxform-ic { display: none !important; }
  .lxform .lxform-head h2 { font-size: 17px !important; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lxform .lxform-head > div:first-child { min-width: 0; flex: 1; gap: 10px !important; }
  .lxform .lxform-head > div:first-child > div { min-width: 0; }
  #saleInvoiceFormPanel .lxseg { margin-left: auto !important; flex-shrink: 0; }
  #saleInvoiceFormPanel .lxseg button { padding: 6px 12px !important; min-height: 0 !important; font-size: 13px !important; }
  #saleInvoiceFormPanel .lxform-head .lxbtn-primary { display: none !important; }           /* Save is in the bottom bar */
  button.si-head-cancel { width: 36px; height: 36px; min-height: 0 !important; padding: 0 !important; font-size: 0 !important; border-radius: 10px !important; }
  button.si-head-cancel::after { content: '✕'; font-size: 16px; font-weight: 700; }

  /* ── Purchase: bottom action bar, form scrolls above it ── */
  #purchaseFormPanel > div > div:nth-child(2) { padding: 12px !important; }
  .pf-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  button.pf-cancel { flex: 0 0 auto; }
  .pf-save-long { display: none; } .pf-save-short { display: inline; }
  .pf-foot > * { min-width: 0; }
  .pf-foot .pf-save { flex: 1; justify-content: center; padding: 0 12px !important; height: 48px; font-size: 15px !important; white-space: nowrap; }

  /* ── Tax bar: segmented scope full width, then GST % + incl. toggle on one row ── */
  #purchaseFormPanel .pf-taxbar { margin-left: 0 !important; width: 100%; display: grid !important; grid-template-columns: 1fr auto; gap: 10px 12px !important; align-items: center; }
  #purchaseFormPanel .pf-taxbar .tx-host { grid-column: 1 / -1; }
  #purchaseFormPanel .pf-taxbar .tx-scope-wrap { width: 100%; }
  .pf-gst { font-size: 11px !important; letter-spacing: .04em; }
  .pf-gst input { width: 64px !important; height: 38px !important; min-height: 0 !important; padding: 0 10px !important; font-size: 15px !important;
    border-radius: 10px !important; text-align: center !important; }
  .tgl { font-size: 11px !important; letter-spacing: .04em; justify-self: end; }

  /* ── Purchase line items: one card per line, 2-column micro-grid, no sideways scroll ──
     Material (full) · Qty | Unit · Rate | Disc % · GST % | Type · Ref (GRN) | HSN · Amount (full) */
  #purchaseFormPanel .overflow-x-auto:has(#plFormTableBody) { overflow: visible !important; }
  table:has(#plFormTableBody) { display: block !important; min-width: 0 !important; width: 100% !important; }
  table:has(#plFormTableBody) thead { display: none !important; }
  #plFormTableBody { display: flex !important; flex-direction: column; gap: 12px; padding: 12px; background: #faf7f4; }
  #plFormTableBody > tr { position: relative; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 10px;
    padding: 14px; background: #fff; border: 1px solid #efe6dc; border-radius: 14px; box-shadow: 0 6px 16px -12px rgba(120, 60, 20, .4); }
  #plFormTableBody > tr > td { display: flex !important; flex-direction: column; min-width: 0; padding: 0 !important; border: none !important; background: transparent !important; }
  #plFormTableBody > tr > td::before { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8a94a6; margin-bottom: 4px; }
  #plFormTableBody td :is(input, select) { width: 100% !important; height: 46px; min-height: 0 !important; padding: 0 12px !important; font-size: 15px !important;
    border: 1px solid #e6e0d8 !important; border-radius: 12px !important; background: #fdfbf9 !important; }
  #plFormTableBody .pr-num { position: absolute; top: 12px; left: 14px; width: auto; flex-direction: row !important; align-items: baseline; gap: 4px;
    font-size: 12px !important; font-weight: 800 !important; color: #b45309 !important; }
  #plFormTableBody .pr-num::before { content: 'Line'; margin: 0; color: #b45309; }
  #plFormTableBody .pr-mat::before { margin-top: 2px; }
  #plFormTableBody .pr-mat { grid-column: 1 / -1; padding-top: 18px !important; }
  #plFormTableBody .pr-mat::before { content: 'Material / Tool'; }
  #plFormTableBody .pr-qty { order: 1; } #plFormTableBody .pr-qty::before { content: 'Qty'; }
  #plFormTableBody .pr-unit { order: 2; } #plFormTableBody .pr-unit::before { content: 'Unit'; }
  #plFormTableBody .pr-rate { order: 3; } #plFormTableBody .pr-rate::before { content: 'Rate (₹)'; }
  #plFormTableBody .pr-disc { order: 4; } #plFormTableBody .pr-disc::before { content: 'Disc %'; }
  #plFormTableBody .pr-tax { order: 5; } #plFormTableBody .pr-tax::before { content: 'GST %'; }
  #plFormTableBody .pr-type { order: 6; } #plFormTableBody .pr-type::before { content: 'Tax type'; }
  #plFormTableBody .pr-ref { order: 7; } #plFormTableBody .pr-ref::before { content: 'Ref (GRN)'; }
  #plFormTableBody .pr-hsn { order: 8; } #plFormTableBody .pr-hsn::before { content: 'HSN / SAC'; }
  #plFormTableBody .pr-amt { order: 9; grid-column: 1 / -1; flex-direction: row !important; align-items: center; justify-content: space-between;
    padding-top: 10px !important; border-top: 1px dashed #eadfd2 !important; }
  #plFormTableBody .pr-amt::before { content: 'Amount'; margin: 0; }
  #plFormTableBody .pr-amt input { width: auto !important; max-width: 60%; height: auto; border: none !important; background: transparent !important;
    padding: 0 !important; font-size: 18px !important; font-weight: 800 !important; color: #0f172a !important; text-align: right; }
  #plFormTableBody .pr-del { position: absolute; top: 8px; right: 8px; }
  #plFormTableBody .pr-del-btn { width: 32px; height: 32px; min-height: 0 !important; padding: 0 !important; border-radius: 9px !important; background: #fef2f2 !important; color: #dc2626 !important; }

  /* ── Sale line items: tighten the existing cards (Disc % beside Amount, small × instead of a red bar) ── */
  #siFormTableBody > tr { position: relative; padding-top: 18px !important; }
  #siFormTableBody > tr > td:nth-child(9) { grid-column: auto !important; order: 1; justify-content: flex-end; }
  #siFormTableBody > tr > td:nth-child(8) { order: 2; }
  #siFormTableBody > tr > td:nth-child(10) { position: absolute; top: 8px; right: 8px; grid-column: auto !important; }
  #siFormTableBody > tr > td:last-child button { width: 32px !important; height: 32px !important; min-height: 0 !important; border-radius: 9px !important; }
  #siFormTableBody > tr > td:nth-child(2) { padding-right: 34px !important; }
  #siFormTableBody .si-amt-total { font-size: 18px !important; }

  /* ── Sale: Notes first, Totals card under it — never side by side ── */
  #saleInvoiceFormPanel .si-sum-grid { grid-template-columns: 1fr !important; }
  #saleInvoiceFormPanel .si-sum-grid > * { min-width: 0; }
  #saleInvoiceFormPanel .lxtotals { width: 100%; }
}
@media (max-width: 768px) {
  /* Sale bottom bar: Cancel · Save & New · Save (same order as the purchase bar) */
  .si-mobile-savebar button.sc { flex: 0 0 auto; padding: 18px 16px; background: #fff; color: #64748b; border-right: 1px solid #eef0f4; }
  button.si-head-cancel { display: none !important; }        /* Cancel now lives in the bottom bar */
}

/* ── Estimates list (estimate.js): one dense row each, swipe trays on touch ── */
.esl-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ts-line, #e5e9f0); border-radius: 14px; overflow: hidden; box-shadow: var(--ts-shadow, none); }
.esl-sum { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #f8fafc; border-bottom: 1px solid #eef1f5;
  font-size: 12.5px; color: #64748b; font-weight: 600; }
.esl-sum b { color: #0f172a; font-variant-numeric: tabular-nums; }
.esl { position: relative; overflow: hidden; border-bottom: 1px solid #eef1f5; }
.esl:last-child { border-bottom: none; }
.esl-row { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto 32px; align-items: center; gap: 14px;
  padding: 12px 10px 12px 16px; background: #fff; cursor: pointer; transition: transform .2s ease, background .15s; touch-action: pan-y; user-select: none; }
.esl-row:hover { background: #f8fafc; }
.esl-row:focus-visible { outline: 2px solid #059669; outline-offset: -2px; }
.esl-id, .esl-who, .esl-amt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.esl-id b { font-size: 14px; font-weight: 800; color: #0f172a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esl-id small, .esl-who small { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esl-who b { font-size: 14.5px; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esl-amt { align-items: flex-end; text-align: right; }
.esl-amt b { font-size: 15px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.esl-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.esl-badge.draft { background: #f1f5f9; color: #475569; } .esl-badge.sent { background: #dbeafe; color: #1d4ed8; }
.esl-badge.approved { background: #dcfce7; color: #15803d; } .esl-badge.rejected { background: #fee2e2; color: #b91c1c; }
button.esl-more { width: 32px; height: 32px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 8px !important; background: transparent;
  color: #64748b; font-size: 20px !important; font-weight: 800 !important; line-height: 1; }
button.esl-more:hover { background: #eef1f5; color: #0f172a; }
.esl-tray { position: absolute; top: 0; bottom: 0; display: flex; width: 168px; visibility: hidden; }
.esl-tray.left { left: 0; } .esl-tray.right { right: 0; }
.esl.show-left .esl-tray.left, .esl.open-right .esl-tray.left, .esl.show-right .esl-tray.right, .esl.open-left .esl-tray.right { visibility: visible; }
.esl-tray button { flex: 1; min-height: 0 !important; border: none; border-radius: 0 !important; color: #fff; font-size: 12.5px !important; font-weight: 800 !important; padding: 0 6px !important; }
.esl-tray .share { background: #0f766e; } .esl-tray .xls { background: #15803d; }
.esl-tray .dup { background: #475569; } .esl-tray .del { background: #dc2626; }
.esl-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 16px; color: #64748b; font-size: 13.5px; text-align: center; }
.esl-empty b { color: #0f172a; font-size: 15px; }
@media (max-width: 640px) {
  /* phones: number + date stack on the left, client takes the middle, amount + badge on the right */
  .esl-row { grid-template-columns: minmax(0, 1fr) auto 28px; grid-template-areas: "id amt more" "who amt more"; row-gap: 3px; column-gap: 10px; padding: 12px 6px 12px 14px; }
  .esl-id { grid-area: id; flex-direction: row; align-items: baseline; gap: 8px; }
  .esl-who { grid-area: who; } .esl-amt { grid-area: amt; } button.esl-more { grid-area: more; width: 28px; }
}
/* Settings → Auto-Numbering on phones: one compact block per document type, no sideways scroll */
@media (max-width: 640px) {
  table.an-table, table.an-table tbody { display: block; border: none !important; }
  table.an-table thead { display: none; }
  table.an-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid #eef1f5; }
  table.an-table td { padding: 0 !important; min-width: 0; }
  table.an-table td:first-child { grid-column: 1 / -1; font-weight: 700; }
  table.an-table td:last-child { grid-column: 1 / -1; }
  table.an-table td:last-child::before { content: 'Preview  '; font-family: inherit; color: #94a3b8; font-weight: 600; }
  table.an-table input { width: 100% !important; }
}
/* Pending GRNs: empty state when the chosen site has none (purchase.js) */
.pg-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; margin: 10px 12px 12px; text-align: center;
  background: #fff; border: 1px dashed #e5d4c4; border-radius: 12px; }
.pg-empty-ic { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.pg-empty b { font-size: 14px; color: #0f172a; }
.pg-empty small { font-size: 12.5px; color: #64748b; }
button.pg-empty-btn { margin-top: 8px; height: 34px; min-height: 0 !important; padding: 0 14px !important; border: 1px solid #fdba74; border-radius: 9px !important;
  background: #fff7ed; color: #c2410c; font-size: 12.5px !important; font-weight: 800 !important; }

/* Party payment terms: quick presets under the credit-days box */
.terms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
button.terms-chip { height: 30px; min-height: 0 !important; padding: 0 11px !important; border: 1px solid #e2e8f0; border-radius: 999px !important; background: #fff;
  color: #334155; font-size: 12.5px !important; font-weight: 700 !important; }
button.terms-chip.on { background: #0f172a; border-color: #0f172a; color: #fff; }

/* ── Cash Forecast hero (cashForecastUI.js) ── */
.xcf { --in: #059669; --out: #dc2626; --ink: #0f172a; --ink2: #475569; --mute: #64748b; --line: #e5e9f0; }
.xcf-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.xcf-seg { display: inline-flex; padding: 3px; gap: 2px; background: #eef1f5; border-radius: 12px; max-width: 100%; }
button.xcf-seg-b { height: 36px; min-height: 0 !important; padding: 0 16px !important; border: none; border-radius: 9px !important; background: transparent;
  color: var(--ink2); font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; }
button.xcf-seg-b.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.xcf-cash { text-align: right; }
.xcf-cash span, .xcf-cash small { display: block; font-size: 12px; color: var(--mute); font-weight: 600; }
.xcf-cash b { display: block; font-size: 26px; line-height: 1.15; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.xcf .neg { color: var(--out) !important; }
.xcf-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 14px; border: 1px solid; }
.xcf-alert b { display: block; font-size: 15px; } .xcf-alert span { font-size: 13px; } .xcf-alert span b { display: inline; font-size: inherit; }
.xcf-alert-ic { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #fff; }
.xcf-alert.neg { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; } .xcf-alert.neg .xcf-alert-ic { background: var(--out); }
.xcf-alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #064e3b; } .xcf-alert.ok .xcf-alert-ic { background: var(--in); }
.xcf-timeline { display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); margin-bottom: 14px; }
.xcf-timeline.n1 { --cols: 1; max-width: 520px; } .xcf-timeline.n3 { --cols: 3; }
.xcf-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xcf-card.short { border-color: #fca5a5; background: linear-gradient(#fff7f7, #fff 60%); box-shadow: inset 0 3px 0 var(--out); }
.xcf-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.xcf-card header b { display: block; font-size: 15px; font-weight: 800; color: var(--ink); } .xcf-card header small { font-size: 12px; color: var(--mute); }
.xcf-flag { font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--out); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.xcf-n { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink2); }
.xcf-n b { white-space: nowrap; font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.xcf-n.end { border-top: 1px solid var(--line); padding-top: 10px; } .xcf-n.end b { font-size: 19px; }
button.xcf-flow { display: block; width: 100%; text-align: left; min-height: 0 !important; padding: 8px 10px !important; border: 1px solid transparent; border-radius: 11px !important;
  background: #f8fafc; cursor: pointer; transition: background .15s, border-color .15s; }
button.xcf-flow:hover:not(:disabled), button.xcf-flow:focus-visible { border-color: #cbd5e1; background: #f1f5f9; }
button.xcf-flow:disabled { cursor: default; opacity: .65; }
.xcf-flow-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.xcf-flow-h b { white-space: nowrap; margin-left: auto; font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.xcf-track { display: block; height: 10px; border-radius: 5px; background: #e9edf2; overflow: hidden; }
.xcf-track i { display: block; height: 100%; border-radius: 5px; }
.xcf-flow.in .xcf-track i { background: var(--in); } .xcf-flow.out .xcf-track i { background: var(--out); }
.xcf-set { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.xcf-set > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.xcf-set > summary small { display: block; font-weight: 500; font-size: 12px; color: var(--mute); margin-top: 2px; }
.xcf-how { margin: 10px 0; padding-left: 18px; font-size: 13px; color: var(--ink2); display: grid; gap: 4px; list-style: disc; }
.xcf-how b.in { color: #047857; } .xcf-how b.out { color: #b91c1c; }
.xcf-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.xcf-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--mute); }
.xcf-form select, .xcf-form input { height: 38px; border: 1px solid #dbe1e8; border-radius: 9px; padding: 0 10px; font-size: 13.5px; color: var(--ink); background: #fff; }
.xcf-hint { font-size: 12.5px; color: var(--mute); margin-top: 10px; }
button.xcf-link { background: none; border: none; padding: 0 !important; min-height: 0 !important; color: #c2410c; font-weight: 700; text-decoration: underline; font-size: inherit !important; }
/* drill-down: side panel on desktop, bottom sheet on phones */
.xcf-sheet-bg { position: fixed; inset: 0; z-index: 200000; background: rgba(15, 23, 42, .45); display: flex; justify-content: flex-end; animation: xcfFade .15s ease; }
.xcf-sheet { --in: #059669; --out: #dc2626; width: min(460px, 100%); height: 100%; background: #fff; overflow-y: auto; padding: 18px 18px 28px; box-shadow: -8px 0 30px rgba(15, 23, 42, .18); animation: xcfSlide .2s ease; }
.xcf-sheet header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.xcf-sheet header small { font-size: 12px; color: #64748b; font-weight: 600; }
.xcf-sheet h3 { font-size: 18px; font-weight: 800; color: #0f172a; margin: 2px 0 0; } .xcf-sheet h3 b { font-variant-numeric: tabular-nums; }
.xcf-sheet b.in { color: #047857; } .xcf-sheet b.out { color: #b91c1c; }
button.xcf-x { width: 36px; height: 36px; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 1px solid #e2e8f0; background: #fff; color: #334155; font-size: 15px !important; flex: 0 0 36px; }
.xcf-sheet-note { font-size: 13px; color: #7f1d1d; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.xcf-grp { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin: 14px 0 4px; }
.xcf-item { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.xcf-item > div:first-child { min-width: 0; } .xcf-item b { font-size: 14px; color: #0f172a; }
.xcf-item small { display: block; font-size: 12px; color: #64748b; margin-top: 2px; }
.xcf-item em { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.xcf-item em.od { background: #fee2e2; color: #b91c1c; } .xcf-item em.mv { background: #ffedd5; color: #c2410c; }
.xcf-item-r { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.xcf-item-r b { font-variant-numeric: tabular-nums; }
.xcf-item-r button { height: 28px; min-height: 0 !important; padding: 0 10px !important; border: 1px solid #fdba74; border-radius: 8px !important; background: #fff7ed; color: #c2410c; font-size: 12px !important; font-weight: 800 !important; white-space: nowrap; }
@keyframes xcfFade { from { opacity: 0; } } @keyframes xcfSlide { from { transform: translateX(30px); opacity: .6; } }
@media (max-width: 900px) { .xcf-timeline { --cols: 2; } .xcf-timeline.n1 { --cols: 1; } }
@media (max-width: 640px) {
  .xcf-top { flex-direction: column-reverse; align-items: stretch; } .xcf-cash { text-align: left; }
  .xcf-seg { display: flex; } button.xcf-seg-b { flex: 1; padding: 0 6px !important; font-size: 12.5px !important; }
  .xcf-timeline, .xcf-timeline.n3 { --cols: 1; }
  .xcf-sheet-bg { align-items: flex-end; }
  .xcf-sheet { width: 100%; height: auto; max-height: 82vh; border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation-name: xcfUp; }
  .xcf-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; margin: -6px auto 12px; }
}
@keyframes xcfUp { from { transform: translateY(40px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .xcf-sheet, .xcf-sheet-bg { animation: none; } }

/* ── Piece-Rate Work (pieceRate.js) ── */
.prw { --ink: #0f172a; --ink2: #475569; --mute: #64748b; --line: #e5e9f0; --acc: #c2410c; }
.prw-tabs { display: flex; gap: 2px; padding: 3px; background: #eef1f5; border-radius: 12px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.prw-tabs button { flex: 1 0 auto; height: 36px; min-height: 0 !important; padding: 0 14px !important; border: none; border-radius: 9px !important; background: transparent; color: var(--ink2); font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; }
.prw-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.prw-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.prw-bar p { margin: 0; font-size: 13px; color: var(--mute); }
button.prw-btn { flex: 0 0 auto; height: 38px; min-height: 0 !important; padding: 0 14px !important; border: none; border-radius: 10px !important; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; font-size: 13px !important; font-weight: 800 !important; white-space: nowrap; cursor: pointer; }
button.prw-btn.sm { height: 32px; padding: 0 11px !important; font-size: 12px !important; }
button.prw-btn.ghost { background: #fff; color: var(--acc); border: 1px solid #fdba74; }
button.prw-btn.ghost.danger { color: #b91c1c; border-color: #fecaca; }
button.prw-icon { flex: 0 0 32px; width: 32px; height: 32px; min-height: 0 !important; padding: 0 !important; border: 1px solid var(--line); border-radius: 9px !important; background: #fff; color: var(--ink2); font-size: 14px !important; cursor: pointer; }
button.prw-link { background: none; border: none; padding: 0 !important; min-height: 0 !important; color: var(--acc); font-weight: 700; text-decoration: underline; font-size: inherit !important; cursor: pointer; }
.prw-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.prw-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.prw-card > header b { display: block; font-size: 14.5px; color: var(--ink); } .prw-card > header small { font-size: 12px; color: var(--mute); }
.prw-amt { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prw-rows { margin-top: 6px; }
.prw-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f1f5f9; }
.prw-row.off { opacity: .55; }
.prw-main { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink2); } .prw-main b { color: var(--ink); }
.prw-main small, .prw-num small { display: block; font-size: 12px; color: var(--mute); margin-top: 1px; }
.prw-main em.warn { font-style: normal; color: #b45309; font-weight: 700; }
.prw-num { text-align: right; flex: 0 0 auto; font-variant-numeric: tabular-nums; } .prw-num b { font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.prw-chip { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #f1f5f9; color: var(--ink2); white-space: nowrap; }
.prw-chip.ok { background: #dcfce7; color: #166534; } .prw-chip.warn { background: #ffedd5; color: #9a3412; } .prw-chip.off { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }
.prw-day-h { font-size: 11.5px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 2px; }
.prw-day { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 2px 14px 4px; margin-bottom: 8px; }
.prw-day .prw-day-h { margin: 10px 0 2px; }
.prw-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 26px 16px; background: #fff; border: 1px dashed #e5d4c4; border-radius: 14px; }
.prw-empty b { font-size: 14px; color: var(--ink); } .prw-empty span { font-size: 12.5px; color: var(--mute); }
.prw-hint { font-size: 12px; color: var(--mute); margin: 8px 0 0; } .prw-hint.warn { color: #b45309; }
.prw-ready { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.prw-ready button { flex: 0 0 auto; text-align: left; min-height: 0 !important; padding: 9px 12px !important; border: 1px solid #fed7aa; border-radius: 12px !important; background: #fff7ed; cursor: pointer; }
.prw-ready b { display: block; font-size: 13px; color: var(--ink); } .prw-ready span { font-size: 12px; color: var(--acc); font-weight: 700; }
.prw-bill-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prw-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.prw-line { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: #fafbfc; }
.prw-line-nums { display: grid; grid-template-columns: 1fr 1fr 1fr 32px; gap: 8px; margin-top: 8px; align-items: end; }
.prw-line-nums label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: var(--mute); }
.prw-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.prw-kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.prw-kpis span, .prw-kpis small { display: block; font-size: 12px; color: var(--mute); font-weight: 600; }
.prw-kpis b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.prw .pos { color: #047857 !important; } .prw .neg { color: #b91c1c !important; }
.prw-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.prw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prw-table th { text-align: right; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--mute); padding: 10px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prw-table td { text-align: right; padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; font-variant-numeric: tabular-nums; color: var(--ink2); }
.prw-table th:first-child, .prw-table td:first-child { text-align: left; }
.prw-table.rep th:nth-child(5), .prw-table.rep td:nth-child(5) { text-align: left; }
.prw-table td small { display: block; font-size: 11.5px; color: var(--mute); font-weight: 500; }
.prw-table td b { color: var(--ink); } .prw-table tfoot td { background: #fff7ed; font-weight: 700; color: var(--ink); border-bottom: none; }
.prw-table.rep td:first-child { min-width: 200px; }
.prw-g { white-space: nowrap; }
.prw-bud { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 12px; color: var(--mute); }
.prw-bud input { width: 68px; height: 30px; border: 1px solid #dbe1e8; border-radius: 7px; padding: 0 6px; text-align: right; font-size: 13px; color: var(--ink); }
@media (max-width: 640px) {
  .prw-bar { flex-direction: column; align-items: stretch; } .prw-bar button.prw-btn { width: 100%; }
  .prw-line-nums { grid-template-columns: 1fr 1fr; } .prw-line-nums .prw-icon { grid-column: 2; justify-self: end; }
  .prw-row { flex-wrap: wrap; } .prw-main { flex-basis: calc(100% - 42px); }
  .prw-kpis { grid-template-columns: 1fr 1fr; } .prw-kpis b { font-size: 17px; }
  /* BOQ cost: one card per item */
  .prw-scroll:has(.rep) { overflow: visible; background: none; border: none; }
  .prw-table.rep thead { display: none; }
  .prw-table.rep tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
  .prw-table.rep td { display: block; padding: 0; border: none; text-align: left; min-width: 0 !important; }
  .prw-table.rep td.rep-item, .prw-table.rep td[data-l="Sub contractors"] { grid-column: 1 / -1; }
  .prw-table.rep td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--mute); margin-bottom: 2px; }
  .prw-table.rep tfoot tr { background: #fff7ed; } .prw-table.rep tfoot td { background: none; }
  .prw-table.rep tfoot td.rep-item { font-size: 14px; }
}

/* Pro Forma list: row actions */
button.pi-more { width: 34px; height: 34px; min-height: 0 !important; padding: 0 !important; border: 1px solid #e2e8f0; border-radius: 10px !important; background: #fff; color: #334155; font-size: 18px !important; font-weight: 800; line-height: 1; cursor: pointer; }
button.pi-more:hover, button.pi-more:focus-visible { background: #f1f5f9; border-color: #cbd5e1; }

/* ── Finance dashboards: Cost & Profit, Other Income (financeViz.js) ── */
.fx { --ink: #0f172a; --ink2: #475569; --mute: #64748b; --line: #e8ecf1; --gain: #047857; --loss: #b91c1c; font-feature-settings: "tnum" 1; }
.fx .pos { color: var(--gain) !important; } .fx .neg { color: var(--loss) !important; }
.fx-filter { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 16px; display: grid; gap: 8px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.fx-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fx-filter select, .fx-dates input { height: 36px; border: 1px solid #dbe1e8; border-radius: 10px; padding: 0 10px; font-size: 13px; color: var(--ink); background: #fff; max-width: 100%; }
.fx-filter-note { margin-left: auto; font-size: 12px; color: var(--mute); }
.fx-dates { display: inline-flex; gap: 6px; align-items: center; color: var(--mute); }
button.fx-chip { height: 32px; min-height: 0 !important; padding: 0 12px !important; border: 1px solid #e2e8f0; border-radius: 999px !important; background: #fff; color: var(--ink2); font-size: 12.5px !important; font-weight: 700 !important; cursor: pointer; }
button.fx-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fx-hero { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 16px; background: linear-gradient(180deg, #fff, #fbfcfd); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05); }
.fx-hero-main { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.fx-eyebrow { font-size: 12px; font-weight: 700; color: var(--mute); letter-spacing: .02em; }
.fx-hero-main > b { font-size: 38px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.fx-pill { display: inline-block; width: fit-content; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.fx-pill.pos { background: #ecfdf5; } .fx-pill.neg { background: #fef2f2; }
.fx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fx-kpis > div { border-left: 1px solid var(--line); padding: 4px 0 4px 14px; min-width: 0; }
.fx-kpis span, .fx-kpis small { display: block; font-size: 12px; color: var(--mute); font-weight: 600; }
.fx-kpis b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); margin: 2px 0; overflow-wrap: anywhere; }
.fx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.fx-grid2 > .fx-card { margin-bottom: 0; }
.fx-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; min-width: 0; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .04); }
.fx-card.flush { padding: 0; overflow: hidden; }
.fx-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fx-card.flush > header { padding: 14px 18px 0; margin-bottom: 8px; }
.fx-card > header b { font-size: 15px; font-weight: 800; color: var(--ink); } .fx-card > header small { font-size: 12px; color: var(--mute); }
.fx-donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.fx-donut { width: 190px; height: 190px; flex: 0 0 auto; }
.fx-slice { transition: opacity .15s; } .fx-donut:hover .fx-slice { opacity: .55; } .fx-donut .fx-slice:hover { opacity: 1; }
.fx-donut-val { font-size: 22px; font-weight: 800; fill: var(--ink); } .fx-donut-sub { font-size: 11.5px; font-weight: 600; fill: var(--mute); }
.fx-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 200px; }
.fx-legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 10px; align-items: center; font-size: 13.5px; color: var(--ink2); }
.fx-legend i { width: 12px; height: 12px; border-radius: 4px; } .fx-legend b { color: var(--ink); font-weight: 800; } .fx-legend em { font-style: normal; color: var(--mute); text-align: right; font-size: 12.5px; }
.fx-area { width: 100%; height: auto; display: block; } .fx-ax { font-size: 11px; fill: var(--mute); }
.fx-pt:hover circle { r: 6; }
.fx-scroll { overflow-x: auto; }
.fx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fx-table th { text-align: right; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fx-table td { text-align: right; padding: 11px 14px; border-bottom: 1px solid #f3f5f8; color: var(--ink2); vertical-align: top; }
.fx-table th:first-child, .fx-table td.l, .fx-table td:first-child { text-align: left; }
.fx-table td b { color: var(--ink); } .fx-table td small { color: var(--mute); font-size: 11.5px; }
.fx-table tbody tr:hover td { background: #fafbfc; } .fx-table tr:last-child td { border-bottom: none; }
.fx-none, .fx-empty { text-align: center !important; color: #94a3b8; padding: 22px !important; font-size: 13px; }
.fx-pl { display: grid; gap: 2px; }
.fx-pl-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--ink2); border-bottom: 1px dashed #eef1f5; }
.fx-pl-row b { color: var(--ink); font-weight: 700; } .fx-pl-row.in b { color: var(--gain); }
.fx-pl-row.total { border-bottom: none; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 800; color: var(--ink); }
.fx-pl-row.total b { font-size: 16px; font-weight: 800; } .fx-pl-row.total em { font-style: normal; font-size: 12px; margin-left: 6px; }
.fx-pl-row.warn b { color: #b45309; }
.fx-foot { font-size: 11.5px; color: var(--mute); margin: 0; padding: 10px 18px 14px; } .fx-foot.warn { color: #b45309; background: #fffbeb; }
.fx > .fx-foot { padding: 4px 2px; }
@media (max-width: 860px) { .fx-grid2 { grid-template-columns: 1fr; } .fx-hero { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .fx-hero { padding: 16px; border-radius: 18px; } .fx-hero-main > b { font-size: 32px; }
  .fx-kpis { grid-template-columns: 1fr 1fr; } .fx-kpis > div { border-left: none; border-top: 1px solid var(--line); padding: 8px 0 0; } .fx-kpis b { font-size: 17px; }
  .fx-card { padding: 14px; border-radius: 16px; } .fx-donut-wrap { justify-content: center; } .fx-donut { width: 170px; height: 170px; }
  .fx-card > header { flex-direction: column; align-items: flex-start; gap: 2px; }
  .fx-filter select { flex: 1 1 140px; } .fx-filter-note { width: 100%; margin-left: 0; }
}
.fx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.fx-head h2 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; } .fx-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--mute); }
button.fx-cta { flex: 0 0 auto; height: 42px; min-height: 0 !important; padding: 0 18px !important; border: none; border-radius: 12px !important; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; font-size: 14px !important; font-weight: 800 !important; cursor: pointer; box-shadow: 0 6px 16px rgba(214, 64, 44, .22); }
.fx-filter input[type=search] { flex: 1 1 220px; height: 36px; border: 1px solid #dbe1e8; border-radius: 10px; padding: 0 12px; font-size: 13px; }
.fx-list { display: grid; }
button.fx-li { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 0 !important; padding: 12px 18px !important; border: none; border-top: 1px solid #f1f4f7; border-radius: 0 !important; background: #fff; cursor: pointer; }
button.fx-li:hover, button.fx-li:focus-visible { background: #fafbfc; }
.fx-li-ic { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; }
.fx-li-main { flex: 1; min-width: 0; } .fx-li-main b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-li-main small { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.fx-li-amt { font-size: 15px; font-weight: 800; white-space: nowrap; } .fx-li-more { color: #94a3b8; font-weight: 800; }
@media (max-width: 640px) { .fx-head { flex-direction: column; align-items: stretch; } .fx-head h2 { font-size: 22px; } button.fx-cta { width: 100%; } button.fx-li { padding: 12px 14px !important; } }

/* ── End of Day — Daily Progress suite (endOfDay.js) ── */
.eod, .eod-sheet-bg { --ink: #0f172a; --ink2: #475569; --mute: #64748b; --line: #e8ecf1; --acc: #ea580c; }
.eod { max-width: 920px; margin: 0 auto; }
.eod-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 8px 10px; box-shadow: 0 4px 18px rgba(15, 23, 42, .06); }
button.eod-nav { flex: 0 0 44px; height: 44px; min-height: 0 !important; padding: 0 !important; border: 1px solid var(--line); border-radius: 12px !important; background: #fff; color: var(--ink); font-size: 24px !important; line-height: 1; cursor: pointer; }
button.eod-nav:disabled { opacity: .35; cursor: default; }
.eod-date { flex: 1; position: relative; min-width: 0; text-align: center; cursor: pointer; }
.eod-date b { display: block; font-size: 17px; font-weight: 800; color: var(--ink); } .eod-date small { display: block; font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eod-date input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.eod-ring { flex: 0 0 46px; width: 46px; height: 46px; } .eod-ring text { font-size: 11px; font-weight: 800; fill: var(--ink); }
.eod-tabs { position: sticky; top: 72px; z-index: 4; display: flex; gap: 4px; margin: 10px 0 14px; padding: 4px; background: #eef1f5; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.eod-tabs button { flex: 1 0 auto; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; min-height: 0 !important; padding: 0 12px !important; border: none; border-radius: 11px !important; background: transparent; color: var(--ink2); font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; cursor: pointer; }
.eod-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.eod-ok { font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #059669; color: #fff; font-size: 10px; }
.eod-body { display: grid; gap: 12px; }
.eod-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.eod-kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.eod-kpis b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; } .eod-kpis span { font-size: 12px; color: var(--mute); font-weight: 600; }
.eod-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); min-width: 0; }
.eod-card > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.eod-card > header b { font-size: 15px; font-weight: 800; color: var(--ink); } .eod-card > header small { font-size: 12px; color: var(--mute); }
button.eod-btn { height: 40px; min-height: 0 !important; padding: 0 14px !important; border: none; border-radius: 11px !important; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; font-size: 13px !important; font-weight: 800 !important; white-space: nowrap; cursor: pointer; }
button.eod-btn.wide { width: 100%; height: 48px; font-size: 15px !important; }
button.eod-btn.ghost { background: #fff; color: var(--ink); border: 1px solid #dbe1e8; }
button.eod-btn.danger { background: #dc2626; }
button.eod-link { background: none; border: none; padding: 6px 4px !important; min-height: 0 !important; color: #c2410c; font-size: 13px !important; font-weight: 800 !important; cursor: pointer; }
button.eod-x { flex: 0 0 34px; width: 34px; height: 34px; min-height: 0 !important; padding: 0 !important; border: 1px solid var(--line); border-radius: 10px !important; background: #fff; color: var(--mute); cursor: pointer; }
.eod-list { list-style: none; margin: 0; padding: 0; display: grid; }
.eod-list > li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #f1f4f7; }
.eod-list > li:first-child { border-top: none; padding-top: 2px; }
.eod-list > li.sev { border-left: 4px solid var(--sev); padding-left: 10px; margin-left: -4px; }
.eod-li-main { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink2); } .eod-li-main b { color: var(--ink); }
.eod-li-main small { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; }
.eod-li-r { text-align: right; flex: 0 0 auto; } .eod-li-r b { display: block; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.eod-tag { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: var(--ink2); }
.eod-tag.sub { background: #fff7ed; color: #c2410c; }
.eod-pill { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: var(--ink2); }
.eod-pill.ok { background: #ecfdf5; color: #047857; } .eod-pill.bad { background: #fef2f2; color: #b91c1c; }
.eod-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 22px 12px; border: 1px dashed #e5d4c4; border-radius: 14px; background: #fffdfb; }
.eod-empty b { font-size: 14px; color: var(--ink); } .eod-empty span { font-size: 12.5px; color: var(--mute); max-width: 420px; }
.eod-empty.ok { border-color: #a7f3d0; background: #f0fdf4; } .eod-empty.ok b { color: #047857; }
.eod-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
button.eod-chip { height: 40px; min-height: 0 !important; padding: 0 14px !important; border: 1px solid #dbe1e8; border-radius: 999px !important; background: #fff; color: var(--ink2); font-size: 13.5px !important; font-weight: 700 !important; cursor: pointer; }
button.eod-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.eod-sev button.eod-chip { border-color: var(--sev); color: var(--sev); } .eod-sev button.eod-chip.on { background: var(--sev); color: #fff; }
.eod-sev { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.eod-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--mute); margin-top: 10px; min-width: 0; }
.eod-field input, .eod-field select, .eod-field textarea { width: 100%; min-height: 46px; border: 1px solid #dbe1e8; border-radius: 12px; padding: 10px 12px; font-size: 16px; color: var(--ink); background: #fff; box-sizing: border-box; font-family: inherit; }
.eod-field textarea { resize: vertical; }
.eod-qty { display: flex; align-items: center; gap: 6px; }
.eod-qty input { flex: 1; min-width: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.eod-qty button { flex: 0 0 auto; height: 46px; min-width: 46px; min-height: 0 !important; padding: 0 12px !important; border: 1px solid #dbe1e8; border-radius: 12px !important; background: #f8fafc; color: var(--ink); font-size: 15px !important; font-weight: 800 !important; cursor: pointer; }
.eod-qty em { font-style: normal; font-size: 13px; color: var(--mute); font-weight: 700; min-width: 28px; }
.eod-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.eod-sec { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); margin: 16px 0 8px; }
.eod-hint { font-size: 12px; color: var(--mute); margin: 8px 0 0; }
.eod-checks { display: grid; gap: 6px; }
.eod-checks label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--ink); cursor: pointer; }
.eod-checks input { width: 22px; height: 22px; accent-color: #059669; }
.eod-pour { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.eod-grade { flex: 0 0 58px; height: 58px; border-radius: 14px; background: #1e293b; color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 800; }
.eod-pour-main { flex: 1; min-width: 0; } .eod-pour-main b { font-size: 15px; color: var(--ink); } .eod-pour-main small { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; }
.eod-pour-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--mute); } .eod-pour-stats b { color: var(--ink); font-size: 15px; }
.eod-pour-acts { display: flex; flex-direction: column; }
.eod-qc { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.eod-qc li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--ink); }
.eod-seg { display: inline-flex; flex: 0 0 auto; border: 1px solid #dbe1e8; border-radius: 10px; overflow: hidden; }
.eod-seg button { height: 38px; min-height: 0 !important; padding: 0 10px !important; border: none; border-radius: 0 !important; background: #fff; color: var(--ink2); font-size: 12.5px !important; font-weight: 800 !important; cursor: pointer; }
.eod-seg button + button { border-left: 1px solid #dbe1e8; }
.eod-seg button.on[data-r="Pass"] { background: #059669; color: #fff; } .eod-seg button.on[data-r="Fail"] { background: #dc2626; color: #fff; } .eod-seg button.on[data-r="NA"] { background: #64748b; color: #fff; }
.eod-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: #1e293b; color: #fff; border-radius: 18px; padding: 16px 18px; }
.eod-head > div b { display: block; font-size: 40px; font-weight: 800; line-height: 1; } .eod-head > div span { font-size: 13px; color: #cbd5e1; }
.eod-head ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.eod-head li { background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 8px 12px; font-size: 12px; color: #cbd5e1; } .eod-head li b { display: block; font-size: 18px; color: #fff; }
.eod-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.eod-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eod-bars li { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr 40px; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); }
.eod-bars li i { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #ea580c var(--w), #f1f5f9 var(--w)); }
.eod-bars li b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; } .eod-bars li.none { display: block; color: #94a3b8; }
/* Daily Report feed — vertical checklist */
.eod-step > header { justify-content: flex-start; }
.eod-num { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--mute); background: #f1f4f7; border: 1.5px dashed #cbd5e1; }
.eod-step.done .eod-num { background: #059669; border: none; color: #fff; }
.eod-step-t { flex: 1; min-width: 0; } .eod-step-t b { display: block; } .eod-step-t small { display: block; margin-top: 1px; }
.eod-step + .eod-step { position: relative; }
button.eod-crew { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 0 !important; padding: 14px 16px !important; border: none; border-radius: 14px !important; background: linear-gradient(135deg, #1e293b, #334155); color: #fff; text-align: left; cursor: pointer; }
.eod-crew-ic { font-size: 30px; }
.eod-crew-n b { display: block; font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; } .eod-crew-n span { font-size: 12.5px; color: #cbd5e1; font-weight: 600; }
.eod-crew-s { flex: 1; min-width: 0; text-align: right; font-size: 12.5px; color: #e2e8f0; font-weight: 600; } .eod-crew-s em { display: block; margin-top: 4px; font-style: normal; font-size: 11.5px; color: #fdba74; }
.eod-nudge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; }
.eod-nudge > span { font-size: 24px; } .eod-nudge > div { flex: 1; min-width: 180px; } .eod-nudge b { display: block; font-size: 14px; color: #9a3412; } .eod-nudge small { font-size: 12.5px; color: #9a3412; opacity: .8; }
.eod-grps { display: grid; gap: 8px; margin-bottom: 10px; }
.eod-grp { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.eod-grp > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; }
.eod-grp > summary::-webkit-details-marker { display: none; }
.eod-grp > summary::after { content: '›'; font-size: 18px; color: #94a3b8; transition: transform .15s; } .eod-grp[open] > summary::after { transform: rotate(90deg); }
.eod-grp-c { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: #1e293b; color: #fff; }
.eod-grp-d { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; } .eod-grp-d small { display: block; font-size: 11.5px; font-weight: 600; color: var(--mute); }
.eod-grp-q { flex: 0 0 auto; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; } .eod-grp-q em { font-style: normal; font-size: 12px; color: var(--mute); }
.eod-grp .eod-list { padding: 0 12px 6px; border-top: 1px solid #f1f4f7; }
.eod-dim { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.eod-dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.eod-dims label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--mute); }
.eod-dims input { width: 100%; min-height: 44px; border: 1px solid #dbe1e8; border-radius: 12px; padding: 8px 10px; font-size: 16px; font-variant-numeric: tabular-nums; }
.eod-sec-n { text-transform: none; letter-spacing: 0; font-weight: 600; color: #94a3b8; }
.eod-nb-ph { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: #f1f5f9; display: grid; place-items: center; font-size: 20px; }
.eod-nb-ph img { width: 100%; height: 100%; object-fit: cover; }
.eod-eq-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; background: #fef3c7; display: grid; place-items: center; font-size: 20px; }
.eod-swipe { --p: 0; position: relative; height: 62px; border-radius: 999px; background: linear-gradient(90deg, rgba(5,150,105,calc(.12 + var(--p) * .6)), #f1f5f9); border: 1px solid #d1fae5; display: flex; align-items: center; justify-content: center; margin-top: 4px; user-select: none; touch-action: pan-y; }
.eod-swipe-t { font-size: 15px; font-weight: 800; color: #047857; opacity: calc(1 - var(--p)); }
button.eod-swipe-k { position: absolute; left: 4px; top: 4px; width: 54px; height: 54px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 50% !important; background: linear-gradient(135deg, #10b981, #047857); color: #fff; font-size: 22px !important; box-shadow: 0 4px 12px rgba(4,120,87,.35); cursor: grab; touch-action: none; }
.eod-done-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.eod-done-card > span { font-size: 24px; } .eod-done-card > div { flex: 1; } .eod-done-card b { display: block; color: #047857; font-size: 15px; } .eod-done-card small { color: #065f46; font-size: 12.5px; }
.eod-lockbar { padding: 9px 14px; border-radius: 12px; background: #1e293b; color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.eod-step input:disabled, .eod-step textarea:disabled { background: #f8fafc; color: var(--ink2); }
@media (max-width: 520px) { .eod-crew-s { display: none; } .eod-dims { gap: 6px; } }
.eod-foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 16px 0 8px; }
.eod-photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eod-photo-list { display: contents; }
.eod-photo { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.eod-photo img { width: 100%; height: 100%; object-fit: cover; }
.eod-photo button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 50% !important; background: rgba(15, 23, 42, .7); color: #fff; font-size: 11px !important; cursor: pointer; }
.eod-photo-add { width: 76px; height: 76px; border: 2px dashed #cbd5e1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--mute); cursor: pointer; }
.eod-photo-add span { font-size: 22px; } .eod-photo-add input { display: none; } .eod-photo-add[hidden] { display: none; }
.eod-sheet-bg { position: fixed; inset: 0; z-index: 200000; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: xcfFade .15s ease; }
.eod-sheet { width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); overflow: hidden; }
.eod-sheet > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #f1f4f7; }
.eod-sheet h3 { margin: 0; font-size: 17px; font-weight: 800; color: #0f172a; }
.eod-sheet-body { padding: 4px 18px 16px; overflow-y: auto; }
.eod-sheet > footer { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #f1f4f7; background: #fafbfc; }
@media (max-width: 640px) {
  .eod-tabs { top: 70px; } .eod-tabs button { font-size: 12.5px !important; padding: 0 10px !important; }
  .eod-grid2, .eod-row2 { grid-template-columns: 1fr; }
  .eod-sheet-bg { align-items: flex-end; padding: 0; }
  .eod-sheet { width: 100%; max-height: 90vh; border-radius: 20px 20px 0 0; animation: xcfUp .2s ease; }
  .eod-sheet > header::before { content: ''; position: absolute; left: 50%; transform: translateX(-50%); margin-top: -12px; width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; }
  .eod-sheet > header { position: relative; padding-top: 20px; }
  .eod-sev { grid-template-columns: 1fr 1fr; }
  .eod-head > div b { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { .eod-sheet, .eod-sheet-bg { animation: none; } }

/* ── Add / Edit Client sheet + Billing & compliance rules (clientHub.js, billingRulesUI.js) ── */
.clf-bg:not(.hidden) { position: fixed; inset: 0; z-index: 199999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .55); animation: xcfFade .15s ease; }
body.clf-open { overflow: hidden; }
.clf-sheet { width: min(620px, 100%); max-height: 94vh; display: flex; flex-direction: column; background: #f6f7fb; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: tsPfIn .2s ease both; }
.clf-h { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #fff; border-bottom: 1px solid #eef0f4; }
.clf-ic { flex: 0 0 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, #fff1e8, #ffe2d1); }
.clf-h > div { flex: 1; min-width: 0; } .clf-h h3 { margin: 0; font-size: 18px; font-weight: 800; color: #0f172a; } .clf-h small { display: block; font-size: 12.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.clf-x { flex: 0 0 38px; width: 38px; height: 38px; min-height: 0 !important; padding: 0 !important; border: 1px solid #e5e9f0; border-radius: 12px !important; background: #fff; color: #475569; font-size: 15px !important; cursor: pointer; }
.clf-body { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 12px; overscroll-behavior: contain; }
.clf-card, .br-card { background: #fff; border: 1px solid #e8ebf1; border-radius: 16px; padding: 14px; }
.clf-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.clf-card > header b { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; } .clf-card > header small { font-size: 12px; color: #94a3b8; }
.clf-f { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: #475569; min-width: 0; }
#clientModal .clf-f input, #clientModal .clf-f textarea, .br-in input { width: 100% !important; min-height: 46px !important; padding: 10px 12px !important; border: 1.5px solid #e3e8ef !important; border-radius: 12px !important; background: #fbfcfe !important; font-size: 15px !important; font-weight: 600; color: #0f172a; outline: none; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
#clientModal .clf-f textarea { resize: vertical; line-height: 1.4; }
#clientModal .clf-f input:focus, #clientModal .clf-f textarea:focus, .br-in input:focus { border-color: #d9481f !important; background: #fff !important; box-shadow: 0 0 0 4px rgba(217, 72, 31, .13) !important; }
.clf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; text-transform: uppercase; letter-spacing: .03em; }
.clf-row2, .br-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clf-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #eef0f4; }
button.clf-btn { height: 46px; min-height: 0 !important; padding: 0 22px !important; border: none; border-radius: 13px !important; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; font-size: 15px !important; font-weight: 800 !important; cursor: pointer; box-shadow: 0 6px 16px rgba(214, 64, 44, .28); }
button.clf-btn.ghost { background: #fff; color: #334155; border: 1px solid #e2e8f0; box-shadow: none; }
.br-card { border-color: #f1dccf; background: linear-gradient(180deg, #fffaf6, #fff 60%); }
.br-card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.br-ic { flex: 0 0 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #fff1e8; font-size: 18px; }
.br-card > header b { display: block; font-size: 15px; font-weight: 800; color: #0f172a; } .br-card > header small { font-size: 12px; color: #64748b; }
.br-rule { margin-top: 12px; min-width: 0; }
.br-rule-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.br-rule-h label { font-size: 12.5px; font-weight: 800; color: #334155; }
.br-flow { font-size: 11px; font-weight: 700; color: #94a3b8; }
.br-rule.t .br-flow { color: #2563eb; } .br-rule.x .br-flow { color: #7c3aed; } .br-rule.r .br-flow { color: #c2410c; }
.br-in { position: relative; margin-top: 6px; }
.br-in input { padding-right: 52px !important; font-variant-numeric: tabular-nums; }
.br-in em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; font-weight: 700; color: #94a3b8; pointer-events: none; }
.br-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
button.br-chip { height: 30px; min-height: 0 !important; padding: 0 11px !important; border: 1px solid #e2e8f0; border-radius: 999px !important; background: #fff; color: #334155; font-size: 12.5px !important; font-weight: 700 !important; cursor: pointer; transition: background .12s, color .12s; }
button.br-chip.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.br-note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: #64748b; }
@media (max-width: 560px) {
  .clf-bg:not(.hidden) { padding: 0; align-items: flex-end; }
  .clf-sheet { width: 100%; max-height: 96vh; border-radius: 22px 22px 0 0; }
  .clf-foot .clf-btn { flex: 1; }
}
@media (max-width: 380px) { .clf-row2, .br-row2 { grid-template-columns: 1fr; } }

/* ── Project form: modern card look (markup + BOQ editor unchanged) ── */
.pf-modern { background: #f6f7fb !important; }
.pf-modern > div:nth-of-type(1) { padding: 12px 20px !important; box-shadow: 0 1px 0 #eef0f4 !important; }
.pf-modern #projFormTitle { font-size: 18px; letter-spacing: -.01em; }
.pf-modern > div:nth-of-type(1) button[onclick="saveProject()"] { background: linear-gradient(135deg, #ef8420, #d6402c) !important; border-radius: 13px !important; height: 42px; padding: 0 22px !important; box-shadow: 0 6px 16px rgba(214, 64, 44, .28) !important; }
.pf-modern > div:nth-of-type(1) button[onclick="closeProjectForm()"]:not(:first-child) { border-radius: 13px !important; height: 42px; }
.pf-modern .max-w-5xl > .bg-white { border-radius: 18px !important; border-color: #e8ebf1 !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important; }
.pf-modern .max-w-5xl > .bg-white > .border-b:first-child { background: #fff !important; border-color: #f1f3f7 !important; padding: 14px 20px !important; }
.pf-modern .max-w-5xl > .bg-white > .border-b:first-child h4 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.pf-modern label.block { font-size: 12px !important; letter-spacing: 0 !important; text-transform: none !important; color: #475569 !important; font-weight: 700 !important; margin-bottom: 6px !important; }
.pf-modern .p-5 input:not([type=checkbox]):not([type=color]):not([type=file]):not(.br-in input), .pf-modern .p-5 select, .pf-modern .p-5 textarea { border: 1.5px solid #e3e8ef !important; border-radius: 12px !important; background: #fbfcfe !important; min-height: 46px; font-size: 15px !important; }
.pf-modern .p-5 input:focus, .pf-modern .p-5 select:focus, .pf-modern .p-5 textarea:focus { border-color: #d9481f !important; background: #fff !important; box-shadow: 0 0 0 4px rgba(217, 72, 31, .13) !important; outline: none; }
.pf-modern #projFormName { font-size: 16px !important; }
@media (max-width: 720px) {
  .pf-modern .flex-1.overflow-y-auto { padding: 12px !important; }
  .pf-modern .p-5 > .grid.grid-cols-3 { grid-template-columns: 1fr 1fr !important; }
  .pf-modern .p-5 > .grid.grid-cols-3 > .col-span-2, .pf-modern .p-5 > .grid.grid-cols-3 > .col-span-3 { grid-column: 1 / -1 !important; }
  .pf-modern > div:nth-of-type(1) { padding: 10px 12px !important; }
  .pf-modern > div:nth-of-type(1) > div:last-child { display: none; }   /* the bottom bar has Cancel / Save */
}

/* Sale invoice — client deductions (TDS + retention → net receivable) */
.si-ded { margin-top: 10px; padding: 10px 12px; border: 1px dashed #e2e8f0; border-radius: 12px; background: #fafbfc; transition: background .2s, border-color .2s; }
.si-ded.on { background: #fff8f3; border: 1px solid #fed7aa; }
.si-ded-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.si-ded-h b { font-size: 12px; font-weight: 800; color: #334155; text-transform: uppercase; letter-spacing: .05em; } .si-ded-h small { font-size: 11px; color: #94a3b8; font-weight: 600; text-align: right; }
.si-ded-r { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12px; }
.si-ded-r label { display: flex; align-items: center; gap: 6px; color: #64748b; font-weight: 600; }
.si-ded-in { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: #94a3b8; }
#siDedBox .si-ded-in input { width: 58px !important; min-height: 0 !important; height: 26px !important; padding: 2px 6px !important; border: 1px solid #e2e8f0 !important; border-radius: 6px !important; font-size: 12px !important; font-weight: 700; text-align: right; background: #fff !important; }
.si-ded-r b { font-weight: 700; color: #b45309; font-variant-numeric: tabular-nums; }
.si-ded:not(.on) .si-ded-r b { color: #94a3b8; }
.si-ded-net { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 6px; border-top: 1px solid #f1e3d6; font-size: 13px; }
.si-ded-net span { font-weight: 800; color: #0f172a; } .si-ded-net b { font-size: 15px; font-weight: 800; color: #047857; font-variant-numeric: tabular-nums; }
.si-ded:not(.on) .si-ded-net b { color: #64748b; }
.si-ded-note { margin: 6px 0 0; font-size: 10.5px; line-height: 1.4; color: #94a3b8; }

/* Cash forecast — locked future cash (retention) */
.xcf-lock { margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #1e293b, #334155); color: #e2e8f0; }
.xcf-lock-h { display: flex; align-items: center; gap: 12px; }
.xcf-lock-ic { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); font-size: 19px; }
.xcf-lock-h > div { flex: 1; min-width: 0; } .xcf-lock-h > div b { display: block; color: #fff; font-size: 15px; } .xcf-lock-h small { display: block; margin-top: 2px; font-size: 12px; color: #cbd5e1; line-height: 1.4; }
.xcf-lock-amt { font-size: 22px; font-weight: 800; color: #fdba74; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xcf-lock-split { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: #cbd5e1; }
.xcf-lock-split b { color: #fff; margin-left: 4px; font-variant-numeric: tabular-nums; }
.xcf-lock-split i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.xcf-lock-split i.h { background: #fdba74; } .xcf-lock-split i.d { background: #94a3b8; } .xcf-lock-split i.c { background: #34d399; }
.xcf-lock-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.xcf-lock-list button { width: 100%; display: flex; justify-content: space-between; gap: 10px; min-height: 0 !important; padding: 8px 10px !important; border: none; border-radius: 10px !important; background: rgba(255, 255, 255, .06); color: #e2e8f0; font-size: 13px !important; font-weight: 600 !important; cursor: pointer; }
.xcf-lock-list button:hover { background: rgba(255, 255, 255, .12); } .xcf-lock-list b { color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .xcf-lock-h { flex-wrap: wrap; } .xcf-lock-amt { width: 100%; padding-left: 52px; font-size: 20px; } }

/* Client "Financial health" (parties.js) */
.fh { margin-top: 12px; padding: 14px; background: #fff; border: 1px solid var(--ts-line, #e5e9f0); border-radius: 18px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.fh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fh-card { position: relative; padding: 12px 12px 11px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef1f5; min-width: 0; }
.fh-card small { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin: 6px 0 2px; }
.fh-card b { display: block; font-size: 19px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-card b.long { font-size: 16px; } .fh-card b.xlong { font-size: 14px; }
.fh-card em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: #64748b; line-height: 1.35; }
.fh-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.fh-card.rcv { background: #f0fdf7; border-color: #d1fae5; } .fh-card.rcv b { color: #047857; }
.fh-card.ret { background: #fff7ed; border-color: #fed7aa; } .fh-card.ret b { color: #c2410c; }
.fh-card.tds { background: #f5f3ff; border-color: #e4defe; } .fh-card.tds b { color: #6d28d9; }
.fh-bar { display: flex; gap: 2px; height: 12px; margin-top: 14px; border-radius: 6px; overflow: hidden; background: #f1f5f9; }
.fh-bar i { min-width: 3px; }
.fh-bar i.rcv, .fh-legend i.rcv { background: #059669; } .fh-bar i.tds, .fh-legend i.tds { background: #7c3aed; }
.fh-bar i.ret, .fh-legend i.ret { background: #ea580c; } .fh-bar i.due, .fh-legend i.due { background: #a8b0bd; }
.fh-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: #64748b; }
.fh-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fh-legend b { color: #0f172a; font-variant-numeric: tabular-nums; margin-left: 2px; }
.fh-rules { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f4f7; }
.ts-page > .fh-rules { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--ts-line, #e5e9f0); border-radius: 14px; background: #fff; }
.fh-rules-l { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; margin-right: 2px; }
.fh-rule { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #0f172a; color: #fff; }
.fh-rule.off { background: #f1f5f9; color: #94a3b8; }
button.fh-link { min-height: 0 !important; padding: 4px 8px !important; border: none; background: none; color: var(--ts-blue, #d9481f); font-size: 12.5px !important; font-weight: 800 !important; cursor: pointer; }
button.fh-release { margin-left: auto; min-height: 0 !important; height: 34px; padding: 0 14px !important; border: 1px solid #fed7aa; border-radius: 999px !important; background: #fff7ed; color: #c2410c; font-size: 12.5px !important; font-weight: 800 !important; cursor: pointer; }
@media (max-width: 640px) {
  .fh { padding: 12px; } .fh-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fh-card b { font-size: 17px; } .fh-card b.long { font-size: 15px; } .fh-card b.xlong { font-size: 13px; }
  button.fh-release { margin-left: 0; width: 100%; }
}

/* ── TransactionListCard (txList.js): Sale Invoices, Purchase Bills, Proforma, Purchase Orders, Purchase Returns ── */
table.txl-hidden-table { display: none !important; }
.txl-list { display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e9f0; border-radius: 16px; overflow: hidden; }
.txl-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 16px; background: #f8fafc; border-bottom: 1px solid #eef1f5; font-size: 12.5px; font-weight: 700; color: #64748b; }
.txl-sum b { color: #0f172a; font-variant-numeric: tabular-nums; }
.txl { display: grid; grid-template-columns: minmax(104px, 160px) minmax(0, 1fr) auto 34px; align-items: center; gap: 14px; padding: 13px 8px 13px 16px; border-bottom: 1px solid #eef1f5; cursor: pointer; transition: background .12s; animation: tsPfIn .2s ease both; }
.txl:last-child { border-bottom: none; }
.txl:hover { background: #f8fafc; }
.txl:focus-visible { outline: 2px solid #059669; outline-offset: -2px; }
.txl-id, .txl-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.txl-id b { font-size: 14px; font-weight: 800; color: #0f172a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txl-id small, .txl-who small { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txl-who b { font-size: 14.5px; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Money never truncates: the column is as wide as its content and does not shrink. */
.txl-amt { flex-shrink: 0; min-width: max-content; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.txl-amt b { font-size: 15px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txl-amt small { font-size: 11.5px; color: #64748b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.txl-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.txl-badge.good { background: #dcfce7; color: #15803d; } .txl-badge.info { background: #dbeafe; color: #1d4ed8; }
.txl-badge.warn { background: #fef3c7; color: #b45309; } .txl-badge.bad { background: #fee2e2; color: #b91c1c; }
.txl-badge.muted { background: #f1f5f9; color: #475569; }
.txl-badge.cancel { background: #dc2626; color: #fff; letter-spacing: .06em; text-transform: uppercase; }
.txl-bar { display: block; width: 90px; height: 4px; margin-top: 4px; border-radius: 99px; background: #e2e8f0; overflow: hidden; } .txl-bar i { display: block; height: 100%; background: #f59e0b; } .txl-bar.done i { background: #059669; }
button.txl-more { width: 34px; height: 34px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 9px !important; background: transparent; color: #64748b; font-size: 18px !important; font-weight: 800 !important; cursor: pointer; }
button.txl-more:hover { background: #eef1f5; color: #0f172a; }
/* Cancelled: kept for audit — struck through, dimmed, red badge. */
.txl.is-cancel { background: #fcfcfd; }
.txl.is-cancel .txl-id b, .txl.is-cancel .txl-id small, .txl.is-cancel .txl-who b, .txl.is-cancel .txl-who small, .txl.is-cancel .txl-amt b, .txl.is-cancel .txl-amt small { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .5; }
.txl-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 16px; color: #64748b; font-size: 13.5px; text-align: center; }
.txl-empty b { color: #0f172a; font-size: 15px; }
@media (max-width: 640px) {
  .txl { grid-template-columns: minmax(0, 1fr) auto 30px; grid-template-areas: "id amt more" "who amt more"; row-gap: 3px; column-gap: 10px; padding: 12px 6px 12px 14px; }
  .txl-id { grid-area: id; flex-direction: row; align-items: baseline; gap: 8px; }
  .txl-who { grid-area: who; } .txl-amt { grid-area: amt; } button.txl-more { grid-area: more; width: 30px; }
}
.si-cx-list { margin: 2px 0 6px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; color: #334155; }
.si-cx-list li.warn { color: #b45309; font-weight: 600; }

/* Money never truncates (Estimates list + TransactionListCard).
   The amount column is content-sized and never shrinks; the party / project text gives way first.
   If a card is too narrow even for that (small phone + large Android text), the amount moves to its own line. */
.esl-amt { flex-shrink: 0; min-width: max-content; }
.esl-amt b, .txl-amt b { overflow: visible; text-overflow: clip; }
.esl-row { grid-template-columns: minmax(96px, 170px) minmax(0, 1fr) max-content 32px; }
.esl, .txl-list { container-type: inline-size; }
@media (max-width: 640px) {
  .esl-row { grid-template-columns: minmax(0, 1fr) max-content 28px; }
  .txl { grid-template-columns: minmax(0, 1fr) max-content 30px; }
  .esl-id b, .txl-id b { flex-shrink: 0; overflow: visible; }
  .esl-id small, .txl-id small { min-width: 0; }
}
@container (max-width: 330px) {
  .esl-row, .txl { grid-template-columns: minmax(0, 1fr) 30px; grid-template-areas: "id more" "who more" "amt more"; }
  .esl-amt, .txl-amt { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 4px 8px; text-align: left; min-width: 0; }
  .esl-amt b, .txl-amt b { white-space: normal; overflow-wrap: anywhere; }
}

/* Transactional screens (.txv): Sale Invoices, Purchase Bills, Proforma, Purchase Orders, Purchase Returns */
.txv .bg-slate-800.rounded-t-xl { background: #fff !important; color: #0f172a !important; border-bottom: 1px solid #eef1f5; }
.txv .bg-slate-800.rounded-t-xl h3 { color: #0f172a !important; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.txv .bg-slate-800.rounded-t-xl button { background: #f1f5f9 !important; color: #334155 !important; }
.txv .txl-list { border: none; border-radius: 0; }
@media (max-width: 640px) {
  /* totals: two compact columns instead of one tall card each */
  .txv .grid.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .txv .grid.grid-cols-2 > div { padding: 12px !important; min-width: 0; }
  .txv .grid.grid-cols-2 > div p.text-2xl { font-size: 18px !important; white-space: nowrap; }
  .txv .lx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .txv .lx-kpis .lx-val { font-size: 19px !important; white-space: nowrap; }
  .txv .lx-kpis .lx-tile { min-width: 0; padding: 12px !important; }
  /* filters: a tidy two-column grid that does not float over the list */
  .txv .lx-toolbar, .txv > .bg-white.flex-wrap { position: static !important; display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; padding: 10px !important; }
  .txv .lx-toolbar > *, .txv > .bg-white.flex-wrap > * { width: 100% !important; min-width: 0 !important; max-width: 100%; margin: 0 !important; }
  .txv .lx-toolbar .lx-search, .txv > .bg-white.flex-wrap > input[type=text], .txv > .bg-white.flex-wrap > input[type=search] { grid-column: 1 / -1; }
  .txv .lx-toolbar .to, .txv > .bg-white.flex-wrap > span { display: none !important; }
  .txv .lx-toolbar select, .txv .lx-toolbar input, .txv > .bg-white.flex-wrap select, .txv > .bg-white.flex-wrap input { min-height: 44px !important; font-size: 14px !important; }
}

/* ══ Bank & Cash (bankCash.js) ══ */
.bk { --ink: #0f172a; --ink2: #475569; --mute: #64748b; --line: #e8ebf1; --in: #047857; --cashc: #fbbf24; --bankc: #38bdf8; max-width: 860px; margin: 0 auto; padding-bottom: 24px; }
.bk-sentinel { display: block; height: 1px; }
.bk-sticky { position: sticky; top: 0; z-index: 6; margin: -1px -4px 0; padding: 0 4px 6px; background: linear-gradient(#eef1f6 85%, rgba(238, 241, 246, 0)); }
.bk-hero { position: relative; overflow: hidden; padding: 18px 18px 14px; border-radius: 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #334155 0%, #1e293b 45%, #0b1220 100%); box-shadow: 0 14px 34px rgba(15, 23, 42, .28); transition: padding .2s ease, border-radius .2s ease; }
.bk-hero::after { content: ''; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(239, 132, 32, .35), rgba(239, 132, 32, 0) 70%); pointer-events: none; }
.bk-hero-k { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.bk-total { display: block; margin-top: 4px; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bk-total.neg { color: #fca5a5; }
.bk-mini { display: none; gap: 14px; font-size: 12.5px; color: #cbd5e1; } .bk-mini b { color: #fff; font-variant-numeric: tabular-nums; }
.bk-split { display: flex; gap: 3px; height: 8px; margin: 14px 0 10px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.bk-split i { display: block; min-width: 3px; } .bk-split .c, .bk-split-l .c { background: var(--cashc); } .bk-split .b, .bk-split-l .b { background: var(--bankc); }
.bk-split-l { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-split-l > div { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .07); min-width: 0; }
.bk-split-l span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #cbd5e1; }
.bk-split-l span i { width: 8px; height: 8px; border-radius: 3px; }
.bk-split-l b { display: block; margin-top: 3px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-credit { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12px; color: #cbd5e1; } .bk-credit svg { width: 16px; height: 16px; flex: 0 0 16px; color: #fca5a5; } .bk-credit b { color: #fff; }
.bk-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.bk-acts button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0 !important; padding: 9px 4px !important; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px !important; background: rgba(255, 255, 255, .06); color: #fff; font-size: 12px !important; font-weight: 700 !important; cursor: pointer; transition: background .15s, transform .1s; }
.bk-acts button:hover { background: rgba(255, 255, 255, .12); } .bk-acts button:active { transform: scale(.97); }
.bk-acts button svg { width: 19px; height: 19px; } .bk-acts .in svg { color: #6ee7b7; } .bk-acts .out svg { color: #fca5a5; }
/* folded header while scrolling */
.bk-sticky.compact .bk-hero { padding: 10px 16px; border-radius: 16px; }
.bk-sticky.compact .bk-hero-k { font-size: 10.5px; }
.bk-sticky.compact .bk-total { font-size: 21px; margin-top: 0; }
.bk-sticky.compact .bk-hero-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
.bk-sticky.compact .bk-mini { display: flex; }
.bk-sticky.compact .bk-split, .bk-sticky.compact .bk-split-l, .bk-sticky.compact .bk-credit, .bk-sticky.compact .bk-acts { display: none; }
/* chips */
.bk-chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; scroll-snap-type: x proximity; }
.bk-chips::-webkit-scrollbar { display: none; }
button.bk-chip, button.bk-fbtn { flex: 0 0 auto; scroll-snap-align: start; height: 36px; min-height: 0 !important; padding: 0 14px !important; border: 1px solid #dfe4eb; border-radius: 999px !important; background: #fff; color: #334155; font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
button.bk-chip.on { background: #0f172a; border-color: #0f172a; color: #fff; }
button.bk-fbtn { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px !important; }
button.bk-fbtn svg { width: 17px; height: 17px; }
button.bk-fbtn.on { border-color: #d9481f; color: #c2410c; background: #fff7ed; }
button.bk-fbtn em { font-style: normal; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #d9481f; color: #fff; font-size: 11px; }
/* accounts row */
.bk-accts { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 4px; margin-bottom: 4px; }
.bk-accts::-webkit-scrollbar { display: none; }
.bk-acct { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 168px; max-width: 240px; padding: 10px 34px 10px 10px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.bk-acct.on { border-color: #0f172a; box-shadow: 0 0 0 3px rgba(15, 23, 42, .08); }
.bk-acct-ic { flex: 0 0 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #e0f2fe; color: #0369a1; }
.bk-acct.cash .bk-acct-ic { background: #fef3c7; color: #b45309; } .bk-acct.credit .bk-acct-ic { background: #fee2e2; color: #b91c1c; }
.bk-acct-t { min-width: 0; } .bk-acct-t small { display: block; font-size: 12px; font-weight: 700; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-acct-t b { display: block; font-size: 15.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; } .bk-acct-t b.neg { color: #b91c1c; }
.bk-acct-t em { display: block; font-style: normal; font-size: 11px; color: var(--mute); white-space: nowrap; }
button.bk-acct-ed { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 8px !important; background: transparent; color: #94a3b8; display: grid; place-items: center; cursor: pointer; }
button.bk-acct-ed svg { width: 14px; height: 14px; } button.bk-acct-ed:hover { background: #f1f5f9; color: var(--ink); }
/* result line + ledger */
.bk-res { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px; font-size: 13px; color: var(--mute); }
.bk-res b { color: var(--ink); } .bk-res em { font-style: normal; font-weight: 800; color: var(--ink); margin-left: 10px; font-variant-numeric: tabular-nums; } .bk-res em.pos { color: var(--in); }
button.bk-link { min-height: 0 !important; padding: 0 !important; border: none; background: none; color: #c2410c; font-weight: 800 !important; font-size: 13px !important; cursor: pointer; }
.bk-day { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.bk-day > header { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: #f8fafc; border-bottom: 1px solid #eef1f5; font-size: 12.5px; }
.bk-day > header b { color: var(--ink2); font-weight: 800; } .bk-day > header span { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); } .bk-day > header span.pos { color: var(--in); }
button.bk-tx { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 0 !important; padding: 12px 14px !important; border: none; border-bottom: 1px solid #f1f4f7; border-radius: 0 !important; background: #fff; text-align: left; cursor: pointer; transition: background .12s; animation: tsPfIn .18s ease both; }
button.bk-tx:last-child { border-bottom: none; } button.bk-tx:hover { background: #f8fafc; }
.bk-tx-ic { flex: 0 0 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #f1f5f9; color: #475569; }
.bk-tx-ic.receipt, .bk-tx-ic.income { background: #dcfce7; color: #15803d; } .bk-tx-ic.supplier { background: #ffedd5; color: #c2410c; }
.bk-tx-ic.labour { background: #fef3c7; color: #b45309; } .bk-tx-ic.expense { background: #fce7f3; color: #be185d; }
.bk-tx-ic.transfer { background: #e0e7ff; color: #4338ca; } .bk-tx-ic.petty { background: #fef9c3; color: #a16207; } .bk-tx-ic.equipment { background: #e2e8f0; color: #334155; }
.bk-tx-m { flex: 1; min-width: 0; } .bk-tx-m b { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tx-m small { display: block; margin-top: 2px; font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-k { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; background: #e0f2fe; color: #0369a1; }
.bk-k.cash { background: #fef3c7; color: #92400e; } .bk-k.credit { background: #fee2e2; color: #b91c1c; }
.bk-tx-a { flex: 0 0 auto; min-width: max-content; text-align: right; } .bk-tx-a b { display: block; font-size: 15.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
button.bk-tx.in .bk-tx-a b { color: var(--in); } .bk-tx-a small { display: block; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; margin-top: 10px; text-align: center; color: var(--mute); font-size: 13.5px; background: #fff; border: 1px dashed #d8dee6; border-radius: 18px; }
.bk-empty b { color: var(--ink); font-size: 15px; }
button.bk-btn { height: 46px; min-height: 0 !important; padding: 0 20px !important; border: none; border-radius: 14px !important; background: linear-gradient(135deg, #ef8420, #d6402c); color: #fff; font-size: 15px !important; font-weight: 800 !important; cursor: pointer; box-shadow: 0 6px 16px rgba(214, 64, 44, .25); }
button.bk-btn.ghost { background: #fff; color: #334155; border: 1px solid #e2e8f0; box-shadow: none; }
/* filter sheet: bottom sheet on phones, side panel on desktop */
body.bk-lock { overflow: hidden; }
.bk-sheet-bg { --kb: 0px; position: fixed; inset: 0; z-index: 200000; background: rgba(15, 23, 42, 0); transition: background .22s ease; }
.bk-sheet-bg.open { background: rgba(15, 23, 42, .5); }
.bk-sheet { position: absolute; left: 0; right: 0; bottom: var(--kb); max-height: calc(92dvh - var(--kb)); display: flex; flex-direction: column; background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px rgba(15, 23, 42, .25); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1), bottom .15s ease; }
.bk-sheet-bg.open .bk-sheet { transform: none; }
.bk-grab { display: block; width: 42px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: #d6dbe3; }
.bk-sheet > header { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 10px; }
.bk-sheet h3 { margin: 0; font-size: 19px; font-weight: 800; color: #0f172a; }
button.bk-x { width: 38px; height: 38px; min-height: 0 !important; padding: 0 !important; border: 1px solid #e5e9f0; border-radius: 12px !important; background: #fff; color: #475569; display: grid; place-items: center; cursor: pointer; }
.bk-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 8px; }
.bk-sheet-body section { padding: 12px 0; border-top: 1px solid #f1f4f7; }
.bk-sheet-body h4 { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #64748b; }
.bk-sheet > footer { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #eef0f4; background: #fff; }
.bk-pills { display: flex; flex-wrap: wrap; gap: 8px; }
button.bk-pill { display: inline-flex; align-items: center; gap: 7px; height: 38px; min-height: 0 !important; padding: 0 14px !important; border: 1.5px solid #e2e8f0; border-radius: 999px !important; background: #fff; color: #334155; font-size: 13.5px !important; font-weight: 700 !important; cursor: pointer; transition: all .12s; }
button.bk-pill svg { width: 16px; height: 16px; }
button.bk-pill.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.bk-pill-ic { display: inline-grid; place-items: center; } .bk-pill-ic svg { width: 15px; height: 15px; }
.bk-seg { display: flex; padding: 4px; gap: 4px; background: #f1f4f8; border-radius: 14px; }
.bk-seg button { flex: 1; height: 38px; min-height: 0 !important; padding: 0 6px !important; border: none; border-radius: 10px !important; background: transparent; color: #475569; font-size: 13.5px !important; font-weight: 700 !important; cursor: pointer; white-space: nowrap; }
.bk-seg button.on { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.bk-range { display: flex; align-items: center; gap: 10px; } .bk-range > i { color: #94a3b8; font-style: normal; }
.bk-range label { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 46px; border: 1.5px solid #e3e8ef; border-radius: 14px; background: #fbfcfe; }
.bk-range label span { font-size: 12px; font-weight: 800; color: #94a3b8; }
.bk-range input, .bk-search input { flex: 1; min-width: 0; width: 100% !important; min-height: 0 !important; height: auto !important; padding: 0 !important; border: none !important; background: transparent !important; box-shadow: none !important; outline: none; font-size: 15px !important; font-weight: 700; color: #0f172a; }
.bk-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border: 1.5px solid #e3e8ef; border-radius: 14px; background: #fbfcfe; color: #94a3b8; }
.bk-range label:focus-within, .bk-search:focus-within { border-color: #d9481f; background: #fff; box-shadow: 0 0 0 4px rgba(217, 72, 31, .12); }
.bk-sw-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bk-sw-row b { display: block; font-size: 14px; color: #0f172a; } .bk-sw-row small { font-size: 12px; color: #64748b; }
button.bk-switch { flex: 0 0 52px; position: relative; width: 52px; height: 32px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 999px !important; background: #cbd5e1; cursor: pointer; transition: background .18s; }
button.bk-switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .25); transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
button.bk-switch.on { background: #059669; } button.bk-switch.on i { transform: translateX(20px); }
/* range calendar */
.bk-cal { margin-top: 12px; padding: 12px; border: 1px solid #e8ebf1; border-radius: 18px; background: #fbfcfe; }
.bk-cal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bk-cal-h b { font-size: 15px; color: #0f172a; }
.bk-cal-h button { width: 36px; height: 36px; min-height: 0 !important; padding: 0 !important; border: 1px solid #e2e8f0; border-radius: 11px !important; background: #fff; font-size: 18px !important; font-weight: 800 !important; color: #334155; cursor: pointer; }
.bk-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bk-cal-g i { font-style: normal; text-align: center; font-size: 11px; font-weight: 800; color: #94a3b8; padding: 4px 0; }
.bk-cal-g button { height: 40px; min-height: 0 !important; padding: 0 !important; border: none; border-radius: 12px !important; background: transparent; color: #0f172a; font-size: 14px !important; font-weight: 700 !important; cursor: pointer; font-variant-numeric: tabular-nums; }
.bk-cal-g button:hover { background: #eef1f5; }
.bk-cal-g button.today { box-shadow: inset 0 0 0 1.5px #d9481f; }
.bk-cal-g button.future { color: #cbd5e1; }
.bk-cal-g button.in { background: #ffedd5; border-radius: 4px !important; }
.bk-cal-g button.sel { background: #d9481f; color: #fff; }
.bk-cal p { margin: 8px 0 0; font-size: 12.5px; color: #64748b; text-align: center; }
@media (min-width: 900px) {
  .bk-sheet { left: auto; top: 0; bottom: 0; width: 440px; max-height: none; border-radius: 24px 0 0 24px; transform: translateX(100%); }
  .bk-grab { display: none; } .bk-sheet > header { padding-top: 18px; }
  .bk-total { font-size: 40px; }
}
@media (max-width: 400px) { .bk-total { font-size: 30px; } .bk-split-l b { font-size: 16px; } .bk-acts button span { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .bk-sheet, .bk-hero, button.bk-tx { transition: none; animation: none; } }
