/* ===========================================================================================
   Phases 2–4 (docs/DECISIONS.md, 2026-11-13): one modern component set for every new screen —
   a page header with a kicker, a main area beside a sticky summary, KPI tiles, status pills,
   quantity steppers, choice pills, a board (job cards), a timeline and the note-count grid.
   Same navy / gold as app.css, softer shadows, rounded corners, smooth focus and hover.
   =========================================================================================== */
:root {
  --ok: #157f3b; --ok-soft: #e6f6ec; --warn: #b54708; --warn-soft: #fff4e5;
  --danger: #b42318; --danger-soft: #fdecea; --info: #1f4fa8; --info-soft: #e8f0fb;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lift: 0 6px 24px rgba(16, 24, 40, .14);
}

/* Page header */
.page-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 12px; padding: 14px 18px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(105deg, #101a3d 0%, #1f2f6b 60%, #2b3f8f 100%); border-bottom: 3px solid var(--gold);
  box-shadow: var(--shadow); }
.page-hero h1 { margin: 2px 0 0; font-size: 1.35rem; letter-spacing: .2px; }
.page-hero .kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold); font-weight: 700; }
.page-hero .sub { font-size: .85rem; color: rgba(255, 255, 255, .78); margin-top: 3px; }
.page-hero .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-hero .actions .button, .page-hero .actions a.tool, .page-hero .actions button {
  background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .28); border-radius: 8px;
  padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; text-decoration: none; }
.page-hero .actions .button:hover, .page-hero .actions a.tool:hover { background: rgba(255, 255, 255, .22); }
.page-hero .actions .gold { background: var(--gold) !important; border-color: var(--gold) !important; color: #1b1b1b !important;
  font-weight: 700; }
.page-hero form.inline-form select, .page-hero form.inline-form input { min-height: 30px; border-radius: 8px; }

/* Main area beside a sticky summary */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.split > aside { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } .split > aside { position: static; } }

.card-x { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 12px; }
.card-x > h2, .card-x > header h2 { margin: 0 0 10px; font-size: 1rem; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.card-x > h2::before, .card-x > header h2::before { content: ""; width: 4px; height: 1em; border-radius: 2px; background: var(--gold); }
.card-x > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-x > header h2 { margin: 0; }
.card-x.flush { padding: 0; overflow: hidden; }
.card-x.flush > header { padding: 12px 16px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }

/* The navy summary box with the big total */
.side-total { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-lift); }
.side-total .label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, .7); }
.side-total .big { display: block; font-size: 2rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums;
  line-height: 1.15; margin: 4px 0 6px; transition: transform .15s; }
.side-total .big.bump { transform: scale(1.04); }
.side-total dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 8px 0 0; font-size: .85rem; }
.side-total dt { color: rgba(255, 255, 255, .72); }
.side-total dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.side-total .field label { color: rgba(255, 255, 255, .85); }
.side-total button[type=submit], .side-total .button { width: 100%; margin-top: 12px; padding: 10px; font-size: 1rem;
  font-weight: 700; border: none; border-radius: 8px; background: #1d7a3a; color: #fff; cursor: pointer; }
.side-total button[type=submit]:hover { background: #166030; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 12px 16px;
  box-shadow: var(--shadow); overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #98a2b3; }
.kpi.ok::after { background: var(--ok); } .kpi.warn::after { background: var(--gold); }
.kpi.danger::after { background: var(--danger); } .kpi.info::after { background: var(--info); }
.kpi .label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); font-weight: 700; }
.kpi strong { display: block; font-size: 1.3rem; color: var(--navy); font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi small { color: var(--muted); font-size: .76rem; }
a.kpi:hover { text-decoration: none; box-shadow: var(--shadow-lift); }

/* Status pills */
.pill-s { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .74rem;
  font-weight: 700; background: #eef1f6; color: #344054; white-space: nowrap; }
.pill-s::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill-s.ok { background: var(--ok-soft); color: var(--ok); } .pill-s.warn { background: var(--warn-soft); color: var(--warn); }
.pill-s.danger { background: var(--danger-soft); color: var(--danger); } .pill-s.info { background: var(--info-soft); color: var(--info); }
.pill-s.gold { background: var(--gold-soft); color: #7a5d00; }

/* Choices as pills (radio buttons) */
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice label { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid #c9d1df;
  border-radius: 999px; background: #fff; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--text);
  transition: all .15s; user-select: none; }
.choice label:hover { border-color: var(--navy); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { background: var(--gold); border-color: var(--gold); color: #1b1b1b; box-shadow: var(--shadow); }
.choice label:has(input:focus-visible) { outline: 3px solid rgba(201, 162, 39, .45); }

/* − 1 + */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid #c9d1df; border-radius: 8px; overflow: hidden; background: #fff; }
.stepper button { width: 30px; border: none; background: #f2f4f8; color: var(--navy); font-size: 1rem; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: var(--gold-soft); }
.stepper input { width: 48px; border: none !important; box-shadow: none !important; text-align: center; font: inherit; font-weight: 700;
  min-height: 30px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Tables */
table.data.pick tbody tr { transition: background-color .12s; }
table.data.pick tbody tr.picked { background: #fff8e1; box-shadow: inset 4px 0 0 var(--gold); }
table.data tbody tr:hover { background: #f7f9fc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-modern { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.table-modern thead th { position: sticky; top: 0; background: #1b2550; color: #fff; font-weight: 600; text-align: left;
  padding: 8px 10px; font-size: .78rem; letter-spacing: .3px; }
.table-modern thead th:first-child { border-top-left-radius: 8px; } .table-modern thead th:last-child { border-top-right-radius: 8px; }
.table-modern tbody td { padding: 7px 10px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
.table-modern tbody tr:nth-child(even) td { background: #fafbfd; }
.table-modern tbody tr:hover td { background: #f3f6fb; }
.table-modern tfoot th { padding: 8px 10px; background: #fff7e0; text-align: left; border-top: 2px solid var(--gold); }
.table-modern .num, .table-modern th.num { text-align: right; }

.empty-state { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-state .icon-big { font-size: 2rem; display: block; margin-bottom: 6px; opacity: .7; }

/* A board of columns (job cards): drag a card to the next column */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; align-items: start; }
.board-col { background: #e9edf5; border-radius: var(--radius); padding: 8px; min-height: 160px; transition: background-color .15s; }
.board-col.drop { background: var(--gold-soft); outline: 2px dashed var(--gold); }
.board-col > header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 800; color: var(--navy); }
.board-col > header .count { background: #fff; border-radius: 999px; padding: 1px 8px; font-size: .74rem; }
.board-card { display: block; background: #fff; border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; box-shadow: var(--shadow);
  border-left: 4px solid var(--gold); color: var(--text); cursor: grab; transition: transform .12s, box-shadow .12s; }
.board-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); text-decoration: none; }
.board-card.dragging { opacity: .5; }
.board-card.late { border-left-color: var(--danger); }
.board-card strong { display: block; color: var(--navy); font-size: .88rem; }
.board-card small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 10px 10px; font-size: .86rem; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--gold); }
.timeline li time { display: block; color: var(--muted); font-size: .74rem; }

/* Cashier's note count */
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.denom { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: linear-gradient(180deg, #fff, #f8fafc); }
.denom .face { font-weight: 800; color: var(--navy); min-width: 56px; }
.denom .face small { display: block; font-size: .66rem; color: var(--muted); font-weight: 600; }
.denom input { width: 64px; text-align: right; padding: 4px 6px; border: 1px solid #c9d1df; border-radius: 6px; font: inherit; }
.denom output { min-width: 74px; text-align: right; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.diff-ok { color: var(--ok); font-weight: 800; } .diff-bad { color: var(--danger); font-weight: 800; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.toolbar-row .spacer { flex: 1; }
.messages li { animation: slide-in .25s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.hint-box { background: var(--info-soft); border: 1px solid #c9d8f2; color: #1d3c78; border-radius: 10px; padding: 8px 12px;
  font-size: .84rem; margin-bottom: 10px; }
.warn-box { background: var(--warn-soft); border: 1px solid #f7c58a; color: #7a3304; border-radius: 10px; padding: 8px 12px;
  font-size: .84rem; margin-bottom: 10px; }
.mini-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mini-form input, .mini-form select { min-height: 30px; padding: 4px 8px; border: 1px solid #c9d1df; border-radius: 6px; font: inherit;
  font-size: .85rem; }
.mini-form button { min-height: 30px; padding: 4px 12px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy);
  color: #fff; font: inherit; font-size: .85rem; cursor: pointer; }
.mini-form button.light { background: #fff; color: var(--navy); }
.mini-form button.danger { background: #fff; color: var(--danger); border-color: #f4b4ae; }
@media print { .page-hero { color: #000; background: none; border: none; box-shadow: none; } .page-hero .actions { display: none; } }

/* The tabs row of a module (cash desk, expenses …) */
.toolbar-row .chip { text-decoration: none; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.on:hover { color: #fff; }

/* Budget vs actual */
.budget-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 90px; gap: 12px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid #edf0f5; }
.budget-row:last-child { border-bottom: none; }
.budget-name { display: flex; flex-direction: column; }
.budget-bar { height: 12px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.budget-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), #e6c65c);
  transition: width .6s ease; }
.budget-bar.over span { background: linear-gradient(90deg, #d92d20, #f97066); }
.budget-pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
