/* AP — SoPoly Cash Planner. Plain CSS, no build step — adapted from ../AR/ar.css
   so the two apps read as one family. Structural rules (topbar, tabs, KPI grid,
   tables, chips, modals, detail drawer) are deliberately identical; the changes
   are semantic, not stylistic:

     - A/R's single "tone" ramp (good = current, bad = late) gains a cash
       DIRECTION axis: --cash-in for money arriving, --cash-out for money
       leaving. Green means "cash in / on plan", not merely "not late".
     - --plan / --actual distinguish a Cash-Planner-owned planned payment from
       a payment that actually happened.
     - --critical..--defer carry the payment-priority hierarchy's five levels.
     - The sticky-note palette (--note-*) backs the user-selectable colors on
       manual/recurring calendar tiles.
*/

:root {
  --bg:        #eef1f6;
  --panel:     #ffffff;
  --panel-2:   #f6f8fb;
  --line:      #dbe1ea;
  --text:      #1a2233;
  --text-dim:  #5b6578;
  --accent:    #2c6fe0;
  --good:      #1f9d63;
  --warn:      #d98a10;
  --bad:       #d64545;

  /* Cash direction */
  --cash-in:   #1f9d63;
  --cash-out:  #c2410c;
  /* Cash-Planner-owned tiles */
  --plan:      #7b4ce0;
  --actual:    #0f766e;
  /* Payment priority hierarchy */
  --critical:  #b91c1c;
  --high:      #d98a10;
  --normal:    #2c6fe0;
  --defer:     #6b7280;
  --nopay:     #4b1d95;

  /* Sticky-note colors for manual / recurring tiles (TILE_COLORS in ApApi) */
  --note-yellow: #f2d24b;
  --note-green:  #62c37a;
  --note-blue:   #55a8e8;
  --note-purple: #a37ae8;
  --note-orange: #ef9448;
  --note-pink:   #ea7ba8;
  --note-gray:   #9aa4b5;

  --shadow: 0 1px 3px rgba(20, 30, 50, 0.08), 0 8px 24px rgba(20, 30, 50, 0.06);
  --radius: 16px;
  --font-ui:   'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'SFMono-Regular', Menlo, monospace;
}

html[data-theme="night"] {
  --bg:        #0d1420;
  --panel:     #161f30;
  --panel-2:   #1c2740;
  --line:      #2a374f;
  --text:      #e7ecf5;
  --text-dim:  #93a1bb;
  --accent:    #5b9dff;
  --good:      #3ecf8e;
  --warn:      #f0ad3d;
  --bad:       #f0625f;

  --cash-in:   #3ecf8e;
  --cash-out:  #fb923c;
  --plan:      #b79bff;
  --actual:    #2dd4bf;
  --critical:  #f87171;
  --high:      #f0ad3d;
  --normal:    #5b9dff;
  --defer:     #9aa4b5;
  --nopay:     #c4b5fd;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; min-height: 100vh; }

.topbar { display: flex; align-items: center; gap: 20px; padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 800; font-size: 22px; letter-spacing: 0.08em; color: var(--accent); }
.topbar .brand small { display: block; font-weight: 500; font-size: 11px; letter-spacing: 0.05em; color: var(--text-dim); }
.version-badge { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-dim); vertical-align: middle; }

.tabs { display: flex; gap: 6px; margin-left: 12px; }
.tab-btn { border: none; background: transparent; color: var(--text-dim); font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.tab-btn:hover { background: var(--panel-2); color: var(--text); }
.tab-btn.active { background: var(--accent); color: #fff; }

.spacer { flex: 1; }
.updated { font-size: 12px; color: var(--text-dim); }
.theme-toggle { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; }

main { flex: 1; padding: 22px 28px; max-width: 1900px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ── What-If / Scenario banner ─────────────────────────────────────────────
   Deliberately loud and always at the top of the Calendar tab: the whole point
   of scenario mode is that nothing typed while it's on ever reaches the server,
   so it must be impossible to be in it without noticing. */

.scenario-bar { display: none; align-items: center; gap: 12px; background: color-mix(in srgb, var(--plan) 16%, transparent); border: 1px solid var(--plan); color: var(--plan); border-radius: 12px; padding: 10px 16px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.scenario-bar.on { display: flex; }
.scenario-bar .spacer { flex: 1; }

/* Weekly plan-due reminder — see renderPlanDueBanner() in ap.js. Sits above
   every tab (index.html puts it directly in <main>, outside any .view). */
.plan-due-banner { margin: 0 0 16px; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid; }
.plan-due-banner.hidden { display: none; }
.plan-due-banner.tone-info { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent); color: var(--accent); }
.plan-due-banner.tone-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); border-color: var(--warn); color: var(--warn); }
.plan-due-banner.tone-bad  { background: color-mix(in srgb, var(--bad) 16%, transparent);  border-color: var(--bad);  color: var(--bad); }

/* ── KPI tiles ─────────────────────────────────────────────────────────── */

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi-tile h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); }
.kpi-tile .big { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi-tile .sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.kpi-tile .sub.good { color: var(--good); }
.kpi-tile .sub.warn { color: var(--warn); }
.kpi-tile .sub.bad  { color: var(--bad); }
.kpi-tile.good .big { color: var(--good); }
.kpi-tile.warn .big { color: var(--warn); }
.kpi-tile.bad  .big { color: var(--bad); }
.kpi-tile.cash-in  .big { color: var(--cash-in); }
.kpi-tile.cash-out .big { color: var(--cash-out); }
/* The one tile that is a live control, not just a readout (the cash floor). */
.kpi-tile .tile-link { background: none; border: none; padding: 0; margin-top: 4px; font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 600; }

/* ── Cash Calendar ─────────────────────────────────────────────────────── */

.cal-header { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; flex-wrap: wrap; }
.cal-header h2 { margin: 0; font-size: 18px; min-width: 240px; white-space: nowrap; }
.cal-nav-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; cursor: pointer; font-size: 14px; padding: 7px 12px; }
.cal-today-btn { font-weight: 700; font-size: 13px; }
.cal-views { display: flex; gap: 4px; }
.cal-view-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.cal-view-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-legend { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Rolling weekly-row calendar, same idiom as ../AR: a static header row of
   day-of-week labels (in index.html, never re-rendered), then #cal-grid — a
   scrolling list of one .cal-row per week. Five day cells (Mon-Fri) plus a
   sixth Saturday cell that doubles as the week's rollup: beginning cash,
   expected A/R in, A/P due, planned A/P out, other planned out, forecast
   ending cash, floor variance. A Saturday-dated item displays on the Friday
   before it and a Sunday-dated item on the Monday after (calendarDisplayDate
   in ap.js) so every day still has a cell and the rollup cell isn't fighting
   tiles for the same space — presentation only, the real dates are untouched. */
.cal-grid { display: flex; flex-direction: column; gap: 6px; overflow: auto; max-height: 900px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--panel-2); }
.cal-row { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)) 260px; gap: 6px; min-width: 1400px; }
.cal-week-header { padding-bottom: 2px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; padding: 4px 0; }
.cal-day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 260px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day.drop-target { border-color: var(--plan); box-shadow: 0 0 0 2px var(--plan) inset; }
.cal-day-num { font-size: 12px; font-weight: 700; color: var(--text-dim); display: flex; justify-content: space-between; gap: 6px; }

.cal-tiles { display: flex; flex-direction: column; gap: 4px; }
.cal-tile { font-size: 11px; padding: 4px 6px; border-radius: 6px; cursor: pointer; border-left: 3px solid var(--text-dim); background: var(--panel-2); }
.cal-tile-top { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-tile-sub { color: var(--text-dim); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A/P bill due — source-controlled (QBO's own due date). Never draggable: the
   due date is an accounting fact, and moving WHEN WE PAY is what a planned
   payment tile is for. Toned by priority, falling back to aging. */
.cal-tile.kind-bill { border-left-color: var(--normal); }
.cal-tile.kind-bill.prio-critical { border-left-color: var(--critical); }
.cal-tile.kind-bill.prio-high     { border-left-color: var(--high); }
.cal-tile.kind-bill.prio-normal   { border-left-color: var(--normal); }
.cal-tile.kind-bill.prio-defer    { border-left-color: var(--defer); }
.cal-tile.kind-bill.prio-nopay    { border-left-color: var(--nopay); }
.cal-tile.kind-bill.overdue { background: color-mix(in srgb, var(--bad) 12%, var(--panel-2)); }
/* Planned A/P payment — Cash-Planner-owned, editable and draggable. */
.cal-tile.kind-planned { border-left-color: var(--plan); background: color-mix(in srgb, var(--plan) 10%, var(--panel-2)); cursor: grab; }
.cal-tile.kind-planned:active { cursor: grabbing; }
/* Approved by the President (see Payment Approvals tab) — still the same
   planned-payment tile, just visibly signed-off vs. still Proposed. */
.cal-tile.kind-planned.approved { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--panel-2)); }
/* Actual cash payment (known to have left the bank). */
.cal-tile.kind-actual { border-left-color: var(--actual); background: color-mix(in srgb, var(--actual) 10%, var(--panel-2)); }
/* Manual / recurring cash requirement — sticky-note colored by the user. */
.cal-tile.kind-manual { border-left-width: 3px; }
.cal-tile.note-yellow { border-left-color: var(--note-yellow); background: color-mix(in srgb, var(--note-yellow) 18%, var(--panel-2)); }
.cal-tile.note-green  { border-left-color: var(--note-green);  background: color-mix(in srgb, var(--note-green) 18%, var(--panel-2)); }
.cal-tile.note-blue   { border-left-color: var(--note-blue);   background: color-mix(in srgb, var(--note-blue) 18%, var(--panel-2)); }
.cal-tile.note-purple { border-left-color: var(--note-purple); background: color-mix(in srgb, var(--note-purple) 18%, var(--panel-2)); }
.cal-tile.note-orange { border-left-color: var(--note-orange); background: color-mix(in srgb, var(--note-orange) 18%, var(--panel-2)); }
.cal-tile.note-pink   { border-left-color: var(--note-pink);   background: color-mix(in srgb, var(--note-pink) 18%, var(--panel-2)); }
.cal-tile.note-gray   { border-left-color: var(--note-gray);   background: color-mix(in srgb, var(--note-gray) 18%, var(--panel-2)); }
.cal-tile.kind-manual.direction-in { border-left-color: var(--cash-in); }
.cal-more { font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 600; }
.cal-add { font-size: 11px; color: var(--text-dim); cursor: pointer; font-weight: 600; margin-top: auto; }
.cal-add:hover { color: var(--accent); }

/* Saturday cell = the week's rollup. */
.cal-week-total { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.cal-week-total h5 { margin: 0 0 2px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); }
.cal-total-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 1px 0; }
.cal-total-row.rule { border-top: 1px solid var(--line); padding-top: 5px; margin-top: 3px; font-weight: 700; }
.cal-total-row .num.in   { color: var(--cash-in); }
.cal-total-row .num.out  { color: var(--cash-out); }
.cal-total-row .num.good { color: var(--good); }
.cal-total-row .num.bad  { color: var(--bad); font-weight: 700; }

/* ── Badges (shared: planner, calendar legend, detail drawer) ───────────── */

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.tone-good    { background: color-mix(in srgb, var(--good) 16%, transparent);  color: var(--good); }
.badge.tone-warn    { background: color-mix(in srgb, var(--warn) 18%, transparent);  color: var(--warn); }
.badge.tone-bad     { background: color-mix(in srgb, var(--bad) 16%, transparent);   color: var(--bad); }
.badge.tone-plan    { background: color-mix(in srgb, var(--plan) 18%, transparent);  color: var(--plan); }
.badge.tone-actual  { background: color-mix(in srgb, var(--actual) 18%, transparent); color: var(--actual); }
.badge.tone-neutral { background: var(--panel-2); color: var(--text-dim); }
.badge.prio-critical { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical); }
.badge.prio-high     { background: color-mix(in srgb, var(--high) 18%, transparent);     color: var(--high); }
.badge.prio-normal   { background: color-mix(in srgb, var(--normal) 16%, transparent);   color: var(--normal); }
.badge.prio-defer    { background: color-mix(in srgb, var(--defer) 20%, transparent);    color: var(--defer); }
.badge.prio-nopay    { background: var(--nopay); color: #fff; }
.cleanup-badge { background: color-mix(in srgb, var(--warn) 85%, black); color: #fff; }

/* ── Toolbars / filter chips / search ─────────────────────────────────── */

.planner-toolbar, .activity-toolbar, .cleanup-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cleanup-toolbar { justify-content: space-between; }
.search-input { flex: 0 0 280px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .count { opacity: 0.75; margin-left: 4px; }
.approvals-total { font-size: 13px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }

/* ── Tables ────────────────────────────────────────────────────────────── */

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); white-space: nowrap; }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row td { text-align: center; color: var(--text-dim); padding: 28px; cursor: default; }
.empty-row td:hover { background: none; }

/* ── Vendor / Payment Log ──────────────────────────────────────────────── */

.activity-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.activity-feed { display: flex; flex-direction: column; gap: 10px; }
.activity-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.activity-card .row1 { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; }
.activity-card .meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.activity-card .notes { font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.activity-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; position: sticky; top: 14px; }
.activity-side h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); }
.followup-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.followup-item:last-child { border-bottom: none; }
.followup-item .fu-name { font-weight: 700; }
.followup-item .fu-meta { font-size: 12px; color: var(--text-dim); }

/* ── Modals / drawer ───────────────────────────────────────────────────── */

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 28, 0.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-backdrop.hidden { display: none; }
.modal { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; width: 480px; max-width: 100%; max-height: 88vh; overflow-y: auto; }
.modal-wide { width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x { border: none; background: none; color: var(--text-dim); font-size: 16px; cursor: pointer; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; }
.modal label { display: block; font-size: 12px; font-weight: 700; color: var(--text-dim); margin: 10px 0 4px; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-family: var(--font-ui); font-size: 13px; }
.modal textarea { min-height: 80px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.checkbox-row input { width: auto; }

/* Color picker for a manual/recurring tile's sticky-note color. */
.color-picker { display: flex; gap: 8px; margin-top: 4px; }
.color-swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.color-swatch.selected { border-color: var(--text); }

.btn { border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ── Detail drawer content ────────────────────────────────────────────── */

.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.detail-section { margin-bottom: 16px; }
.detail-section h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); }
/* Rule-based cleanup suggestions (SoPolyAPSync's computeCleanupInsights) — see openDetail. */
.insight-section { background: color-mix(in srgb, var(--warn) 8%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); border-radius: 10px; padding: 10px 12px; }
.insight-card { margin-bottom: 8px; font-size: 12px; }
.insight-card:last-child { margin-bottom: 0; }
.insight-card p { margin: 0 0 6px; color: var(--text); }
.insight-card button { border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); border-radius: 6px; font-size: 11px; padding: 3px 8px; cursor: pointer; }
.insight-card button:hover { color: var(--text); }
/* On-demand AI analysis (ApApi's ai-insight resource) — distinct accent tone
   from the rule-based .insight-section above so the two are never confused. */
.ai-insight-section { background: color-mix(in srgb, var(--accent) 6%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.ai-insight-section p { margin: 0 0 6px; font-size: 12px; color: var(--text); }
.ai-insight-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv-list dt { color: var(--text-dim); }
.kv-list dd { margin: 0; font-weight: 600; text-align: right; }
.timeline { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.related-bill { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; gap: 10px; }
.related-bill:last-child { border-bottom: none; }
/* The per-bill list of planned partial payments inside the detail drawer. */
.planned-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.planned-row:last-child { border-bottom: none; }
.planned-row .planned-actions { display: flex; gap: 6px; }
.planned-row button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim); border-radius: 6px; font-size: 11px; padding: 3px 8px; cursor: pointer; }
.planned-row button:hover { color: var(--text); }

/* Approve/Reject controls inside the planned-payment modal (Payment Approvals tab, or opened from anywhere else). */
.approval-box { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.approval-actions { display: flex; gap: 8px; }

.tv-footer { text-align: center; font-size: 11px; color: var(--text-dim); padding: 10px; }

/* Save confirmation toast — see showToast() in ap.js. */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--text); color: var(--panel); font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media print {
  .topbar, .tv-footer, .cleanup-toolbar, .scenario-bar { display: none !important; }
  main { padding: 0; max-width: none; }
}

@media (max-width: 900px) {
  .activity-layout { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
