/* eMapp shared UI theme (decisions/0044) -- dark navy + orange, ported
   from AdvancedAppsRebuild/eMapp/index.html's own <style> block. Loaded
   on every eMapp page (root, /variance, /multiseg, /trxdetail) so the
   look is consistent across all of them, not just wherever it was first
   built. The splash-screen canvas animation was skipped here at first
   (decisions/0044), later ported, and is now the data-driven suite
   loading screen in static/vs-loader.js (decisions/0147) -- not in this
   file. The reference app's own version badge
   WAS skipped there for the same reason, but is now a real, functional
   requirement (David: every module needs a real, bumped version visible
   on screen) -- #emapp-version below, not a port of the old decorative one.
*/

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0d1f35;
  color: #d0e4f4;
  /* Report pages' grid fills whatever's left of the viewport instead of a
     fixed calc(100vh - Npx) guess (David: "drop down to the bottom, only
     very small borders") -- a flex column lets the grid-wrap claim exactly
     the remaining space regardless of how tall the toolbar/filter rows
     above it are, real or embedded-in-Portal's-iframe alike. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#app-header { flex-shrink: 0; }

a { color: #f5a623; }

/* Suite-wide dark scrollbar (decisions/0088) -- the default OS/browser
   scrollbar (light grey) looks out of place against every module's dark
   background; same light-on-transparent style applied identically in
   Portal/eMapp/Documents/Vulani's own theme files. */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); }

/* ── App header ── */
#app-header {
  background: linear-gradient(135deg, #0d1f35 0%, #1a3a5c 100%);
  color: white; padding: 10px 18px 8px;
  border-bottom: 2px solid #f5a623;
  display: flex; align-items: center; justify-content: space-between;
}
#app-header .brand { display: flex; align-items: center; gap: 12px; }
#app-header .logo {
  width: 36px; height: 36px; border-radius: 50%; background: #f5a623;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #0d1f35; flex-shrink: 0;
}
#app-header h1 { font-size: .95rem; font-weight: 700; margin: 0; }
#app-header .back-link { font-size: .75rem; color: #8aaac8; text-decoration: none; }
#app-header .back-link:hover { color: #f5a623; }
#app-header .session-info { font-size: .75rem; color: #cdd5e0; text-align: right; }

/* decisions/0077 (supersedes decisions/0071's back-link reasoning below,
   found not to hold once checked against the real app): when embedded in
   Portal, this module's entire own header -- not just the logo/sign-out
   0071 targeted -- is redundant. Portal's own tab bar already carries the
   "eMapp" identity, and the back-link's destination (this module's own
   bare root menu) was never actually needed for real navigation -- the
   side flyout (variance.js/multiseg.js) already switches reports, and
   drill-through already reaches Transaction Detail. Standalone access (no
   Portal parent) is unaffected -- full original header stays exactly as
   before, since there's no Portal chrome to defer to there. */
.vs-embedded #app-header { display: none; }
.vs-embedded .emapp-page form[action='/auth/logout'] { display: none; }

/* David: a real, hand-bumped version visible on screen at all times, even
   embedded (deliberately outside #app-header so 0077's hide rule above
   doesn't take it down too) -- so a stale tab/iframe is distinguishable
   from a genuinely updated one without opening devtools. Same idea as
   Portal's own .vs-version (Portal/app/static/theme.css), unstyled to
   match it: small, muted, out of the way. Top-right, not bottom-right --
   bottom-right collided with the ambient Vulani widget bubble
   (decisions/0074) that floats there across every Portal tab. */
#emapp-version {
  position: fixed; right: 6px; top: 4px; z-index: 900;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: .62rem; letter-spacing: .06em;
  color: #6b7f94; opacity: .75; pointer-events: none;
}

/* ── Page body / toolbar ── */
/* decisions/0072 addendum: report pages wrap everything above the grid in
   one '.report-toolbar' div (natural height, untouched inline/row flow
   inside it) so '.emapp-page' itself can be a flex column with exactly
   two items -- the toolbar (auto height) and '.grid-wrap' (flex:1). A
   first attempt at this made '.emapp-page' itself the flex container
   directly, which turned every one of its many direct children (buttons,
   selects) into its own block-level flex item and broke their row layout
   -- the single wrapper avoids that without touching the toolbar markup's
   internal flow at all. A second attempt used JS to measure and set an
   explicit pixel height on the grid instead of this -- fragile (an inline
   style beats any later CSS layout change, and it only stayed correct at
   the exact moments something explicitly re-triggered the measurement) --
   this is the reliable, DOM-flow-driven fix in its place. */
.emapp-page { padding: 0 18px 8px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.report-toolbar { flex-shrink: 0; }

/* David: "when I have set the angle up... then drill into details... I
   want the ability to come back to the position I was in" -- shown only
   when this drill page was actually reached via a drill (its href is set
   from the real ?back= param the drill carried), hidden otherwise. */
/* 2026-09-25, David: the plain text link was too subtle -- same button
   look as the "⊕ Filter for …" button (.chip-action-btn), on every drill page. */
.report-back-link {
  display: none; font-size: 11px; padding: 4px 9px; border-radius: 4px; white-space: nowrap;
  background: rgba(245,166,35,.15); border: 1px solid rgba(245,166,35,.4);
  color: #f5a623; text-decoration: none; cursor: pointer; margin: 4px 0 8px;
}
.report-back-link:hover { background: rgba(245,166,35,.3); color: #f5a623; }
.report-back-link.visible { display: inline-block; }

/* Transaction Detail's Dr/Cr totals -- moved out of the grid (was AG
   Grid's own pinnedTopRowData) into this visible toolbar panel per direct
   feedback ("it must be in the panel above"). */
.trx-totals {
  display: flex; align-items: center; gap: 18px;
  margin: 4px 0 10px; padding: 8px 14px;
  background: #112235; border: 1px solid #2a5a8a; border-radius: 6px;
  font-size: .82rem;
}
.trx-totals:empty { display: none; }
.trx-totals-label {
  font-size: .68rem; font-weight: 700; color: #8aaac8;
  text-transform: uppercase; letter-spacing: .08em;
}
.trx-totals-field { color: #d0e4f4; }
.trx-totals-field strong { color: #f5a623; margin-left: 4px; font-variant-numeric: tabular-nums; }
.trx-totals-net { padding-left: 18px; border-left: 1px solid #2a5a8a; }


/* Dr/Cr grid header text AND cell values, distinct from every other
   column's plain white text -- David asked for both to stand out. */
.ag-header-cell.trx-dr-col .ag-header-cell-text,
.ag-header-cell.trx-cr-col .ag-header-cell-text {
  color: #f5a623;
}
.ag-cell.trx-dr-col, .ag-cell.trx-cr-col {
  color: #f5a623;
}
.emapp-page h1 { font-size: 1.1rem; color: #f5a623; margin: 14px 0 8px; }
.emapp-page h3 {
  font-size: .7rem; color: #f5a623; text-transform: uppercase;
  letter-spacing: .1em; margin: 14px 0 6px; opacity: .8;
}
.ms-sequence-clickable {
  cursor: pointer; display: inline-block; padding: 4px 0;
  border-bottom: 1px dashed transparent;
}
.ms-sequence-clickable:hover { border-bottom-color: #f5a623; color: #f5a623; }

select, input[type="text"] {
  background: #1a3a5c; border: 1px solid #2a5a8a; color: #d0e4f4;
  padding: 4px 8px; border-radius: 3px; font-size: 12px;
}
select:focus, input[type="text"]:focus { outline: none; border-color: #f5a623; }

button {
  padding: 5px 14px; border: 1px solid #3a5a7a; border-radius: 3px;
  cursor: pointer; font-size: 12px; background: #1e3a58; color: #b8d0e8;
  transition: all .15s;
}
button:hover:not(:disabled) { background: #254870; color: white; border-color: #5a7a9a; }
button:disabled { opacity: .4; cursor: default; }

.view-toggle-btn.active { background: #f5a623; color: #0d1f35; border-color: #f5a623; font-weight: 700; }
/* decisions/0125: one visible Excel download on every report page, top
   right of the toolbar. Floated so the toolbar's own first row (context
   picker, back link, sequence summary) flows beside it untouched. */
.excel-export-btn {
  /* David, live in Portal: sat over the fixed #emapp-version badge (top
     right). Right margin clears the badge; shorter so it fits the row. */
  /* David: same size and top as the cycle dropdown beside it (measured
     live: 90x27px, top of the toolbar row). */
  float: right; margin: 0 56px 4px 12px; padding: 0 12px;
  box-sizing: border-box; height: 27px; min-width: 90px; line-height: 25px;
  /* Found live on MultiSeg: its block-level "Sequence" <h3> spans the full
     row under the float and took the clicks. Stacked above it. */
  position: relative; z-index: 2;
  background: #1d7a46; border: 1px solid #2ea866; border-radius: 4px;
  color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap;
}
.excel-export-btn:hover:not(:disabled) { background: #2ea866; border-color: #3cc47a; color: #fff; }
/* Packs (David, 2026-10-12): left of the Excel button; its pop-up has the
   filter pop-up's look (#packs-modal beside #filter-modal below). */
.excel-export-btn.packs-btn { margin-right: 0; }
.packs-pane { padding: 14px 16px; background: #07131f; flex: 1; overflow-y: auto; font-size: 12px; color: #c8d8e8; }
.packs-pane h4 { margin: 0 0 8px; color: #f5a623; font-size: 13px; }
.packs-pane p { margin: 0 0 12px; line-height: 1.45; }
.packs-context { color: #8aaac8; margin-bottom: 4px; }
.packs-context + .packs-option-label { margin-top: 12px; }
.packs-option-label { color: #6a8aaa; font-size: 11px; margin-bottom: 4px; }
.packs-pane label { display: block; padding: 3px 0; cursor: pointer; }
.packs-pane input[type="radio"] { accent-color: #f5a623; }
.packs-error { flex: 1; color: #ffaaaa; font-size: 12px; align-self: center; }
.fm-type-btn.packs-placeholder { cursor: not-allowed; opacity: .45; }
#apply-filters-btn, #ms-run-btn, #trx-run-btn {
  background: #f5a623; border-color: #f5a623; color: #0d1f35; font-weight: 700;
}
#apply-filters-btn:hover, #ms-run-btn:hover:not(:disabled), #trx-run-btn:hover { background: #ffc04d; }

/* ── Error banner ── */
#variance-error, #multiseg-error, #trxdetail-error {
  background: #3a1010; border-top: 2px solid #cc3333; border-radius: 3px;
  padding: 8px 14px; color: #ffaaaa; font-size: 12px; margin: 8px 0;
}
/* decisions/0132: an empty banner still drew as a red strip (found behind
   MultiSeg's builder). Only show it when there is an error to show. */
#variance-error:empty, #multiseg-error:empty, #trxdetail-error:empty { display: none; }

/* decisions/0065 item 3: "N rows loaded" feedback after a successful run. */
#variance-status, #multiseg-status, #trxdetail-status {
  color: #8aaac8; font-size: 12px; margin: 4px 0;
}

/* ── Filter panel (decisions/0037/0040) ── */
#filter-panel, #ms-filter-rows {
  background: #112235; border: 1px solid #1e3a5c; border-radius: 4px;
  padding: 8px 14px; margin: .5rem 0;
}
.filter-row, .trx-filter-row, .ms-sequence-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.fp-label { font-size: 11px; color: #8aaac8; font-weight: 600; white-space: nowrap; width: 70px; }
.fp-input { width: 90px; }
.fp-val { width: 130px; }
.btn-remove {
  background: none; border: none; color: #6a8aaa; cursor: pointer;
  font-size: 14px; padding: 0 4px; line-height: 1;
}
.btn-remove:hover { color: #ff6a6a; }

/* ── Variance filter chip bar -- David, item 3: applied filters previously
   had no visible display at all (moved out of a hidden wrapper, see
   main.py). Scoped to Variance only; the 5 detail pages and MultiSeg's own
   sequence builder keep the existing .filter-row/.ms-sequence-row rows. ── */
.filter-chip-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: #112235; border: 1px solid #1e3a5c; border-radius: 4px;
  padding: 8px 14px; margin: .5rem 0;
}
.filter-chip-bar-label { font-size: 11px; color: #8aaac8; font-weight: 600; white-space: nowrap; }
.filter-chip-list { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 80px; }
.filter-chip {
  position: relative;
  display: flex; align-items: center; gap: 5px; padding: 3px 4px 3px 9px;
  background: rgba(245,166,35,.12); border: 1px solid rgba(245,166,35,.4);
  border-radius: 14px; font-size: 11.5px; white-space: nowrap;
}
.filter-chip-none { font-size: 11.5px; color: #6a8aaa; font-style: italic; }
.chip-type { color: #f5a623; font-weight: 600; }
.chip-label { color: #c8d8e8; }
.chip-remove {
  background: none; border: none; color: #6a8aaa; cursor: pointer;
  font-size: 12px; padding: 0 4px; line-height: 1; border-radius: 50%;
}
.chip-remove:hover { color: #ff6a6a; background: rgba(255,106,106,.12); }

/* Grouped chip ("Item (3)"): David's pick over one chip per value, so a
   heavily filtered report can never run the bar off the page -- there are
   only 8 segment types. The values live in a popover, each removable. */
.filter-chip-grouped { cursor: pointer; }
.filter-chip-grouped:hover { background: rgba(245,166,35,.2); }
.chip-caret { color: #f5a623; font-size: 8px; line-height: 1; }
.filter-chip.chip-open .chip-caret { transform: rotate(180deg); }
.chip-popover {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 900;
  min-width: 240px; max-height: 260px; overflow-y: auto;
  background: #0a1828; border: 1px solid rgba(245,166,35,.5); border-radius: 6px;
  padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.55); cursor: default;
}
.filter-chip.chip-open .chip-popover { display: block; }
.chip-popover-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 6px; border-radius: 3px; color: #c8d8e8; font-size: 11.5px;
}
.chip-popover-row:hover { background: rgba(245,166,35,.1); }
.chip-action-btn {
  font-size: 11px; padding: 4px 9px; border-radius: 4px; white-space: nowrap;
  background: rgba(245,166,35,.15); border: 1px solid rgba(245,166,35,.4);
  color: #f5a623; cursor: pointer;
}
.chip-action-btn:hover { background: rgba(245,166,35,.3); }
/* Disabled still has to read as a button -- the first version was a
   transparent outline at .4 opacity, which David read as plain text. Keeps
   the filled shape, just drained of colour. */
.chip-action-btn:disabled {
  background: rgba(138,170,200,.1); border-color: rgba(138,170,200,.3);
  color: #6a8aaa; cursor: default;
}
.chip-action-btn:disabled:hover { background: rgba(138,170,200,.1); color: #6a8aaa; }

/* ── Always-visible current-angle readout, next to dept/cycle (decisions/
   0044 added #angle-current but it only shows on hover, inside #angle-list;
   David asked for this without opening the flyout).

   Text, not a pill. It first shipped with a border and filled background
   and David pulled it up: it read as a button while being strictly
   read-only, and meanwhile the real Clear Filters button read as text. The
   affordances were backwards, so they were swapped. Changing angle is the
   flyout's job. ── */
.angle-badge { font-size: 11px; white-space: nowrap; padding: 4px 2px; }
.angle-badge-key { color: #8aaac8; }
.angle-badge-value { color: #f5a623; font-weight: 600; text-transform: uppercase; } /* David: ITEM, not Item */
.angle-badge-value.detail-data-date-value { text-transform: none; } /* David: 24-August-2026 */
/* decisions/0116 item 2: the Layout dropdown, beside the angle; the select
   itself takes .context-picker select's look, as department and cycle. */
.layout-picker { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.context-picker select#layout-select { min-width: 190px; }
/* The Excel's calc labels above the layout's titles ("1", "(1 vs. 4)"), in the amber
   accent so they stand out from the white titles (David, 2026-10-02: "a color that
   stands out against the dark blue and not white"). */
.ag-theme-alpine .ag-header-group-cell.layout-calc-group { background: #1a3a5c !important; }
.ag-theme-alpine .ag-header-group-cell.layout-calc-group .ag-header-group-cell-label {
  flex: 1 1 auto; width: 100%; justify-content: center; color: #f5a623 !important; font-size: 10px; font-weight: 700; }
/* A layout title wraps to two lines, as the Excel's do ("Variance % Spent"). */
#variance-grid .dated-header-title { white-space: normal; text-align: right; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#detail-report-badge, #detail-data-date { margin-left: 10px; }

/* ── Filter picker modal (decisions/0037/0040), MultiSeg reuses the same
   markup/classes ── */
#filter-modal, #ms-filter-modal, #packs-modal {
  display: none; position: fixed; inset: 0; z-index: 5000;
  align-items: center; justify-content: center;
}
#filter-modal.open, #ms-filter-modal.open, #packs-modal.open { display: flex; }
.fm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.fm-box {
  position: relative; width: 720px; max-width: 96vw; max-height: 92vh;
  background: #0b1d30; border: 1px solid #1e4070; border-radius: 6px;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
.fm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #0d2240; border-bottom: 2px solid #f5a623;
  border-radius: 6px 6px 0 0; flex-shrink: 0;
}
.fm-header h3 { color: #f5a623; font-size: 13px; font-weight: 700; letter-spacing: .06em; margin: 0; }
.fm-close { background: none; border: none; color: #6a8aaa; cursor: pointer; font-size: 18px; padding: 0 2px; }
.fm-close:hover { color: #ff6a6a; }
.fm-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.fm-left { width: 148px; flex-shrink: 0; background: #07131f; border-right: 1px solid #1a3a5c; overflow-y: auto; padding: .5rem 0; }
.fm-type-btn {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  border: none; background: none; color: #8aaac8; font-size: 12px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.fm-type-btn:hover { background: #0d2038; color: #c8d8e8; }
.fm-type-btn.active { background: #0d2038; color: #f5a623; border-left: 3px solid #f5a623; font-weight: 600; }
.fm-type-count {
  font-size: 10px; background: #f5a623; color: #0d1f35; border-radius: 10px;
  padding: 1px 6px; font-weight: 700; margin-left: 6px;
}
/* An empty count drew a bare orange dot on every tab (Variance's and
   Transactions' pop-ups alike); only a real count shows. */
.fm-type-count:empty { display: none; }
.fm-right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#modal-seg-list, #ms-modal-seg-list { flex: 1; overflow-y: auto; padding: 4px 0; background: #07131f; }
.seg-item { display: flex; align-items: center; gap: 10px; padding: 5px 14px; cursor: pointer; }
.seg-item:hover { background: #0d2038; }
.seg-item.selected { background: rgba(245,166,35,.12); }
.seg-item input[type="checkbox"] { accent-color: #f5a623; }
.seg-no { font-size: 11px; color: #6a9ac8; min-width: 96px; }
.seg-descr { font-size: 12px; color: #c8d8e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-list-empty, .fm-list-loading { padding: 24px; text-align: center; color: #3a6a8a; font-size: 12px; }
/* decisions/0159: Transaction filter pop-up count line, kept in view above the paged list */
#modal-seg-list .fm-list-status { position: sticky; top: -4px; z-index: 1; padding: 8px 12px; text-align: left; background: #07131f; border-bottom: 1px solid #13283b; }
.fm-search { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid #1a3a5c; align-items: center; background: #07131f; }
.fm-search span { font-size: 11px; color: #6a8aaa; }
.fm-search input { flex: 1; }
.fm-footer {
  display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px;
  border-top: 1px solid #1a3a5c; background: #07131f; border-radius: 0 0 6px 6px;
}
.fm-generate { background: #f5a623; border-color: #f5a623; color: #0d1f35; font-weight: 700; padding: 5px 22px; }
.fm-generate:hover { background: #ffc04d; }

/* ── MultiSeg sequence list ── */
.ms-sequence-row {
  background: rgba(100,160,200,.06); border: 1px solid rgba(100,160,200,.2);
  border-radius: 4px; padding: 6px 10px; gap: 10px;
}
.ms-sequence-row button { padding: 2px 8px; font-size: 11px; }
.ms-step-remove { color: #cc5555; border-color: rgba(200,80,80,.3); }

/* ── MultiSeg Report Builder popup (decisions/0072), ported from the
   reference app's #multiSegModal -- the dimming is the modal's own
   translucent fill, not a separate backdrop element. ── */
#msm-modal {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.7); align-items: center; justify-content: center;
}
#msm-modal.open { display: flex; }
.msm-dialog {
  background: #0a1a2e; border: 1px solid rgba(245,166,35,.4); border-radius: 8px;
  width: 680px; max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}
.msm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid rgba(245,166,35,.25); flex-shrink: 0;
}
.msm-header span { color: #f5a623; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.msm-header button { background: none; border: none; color: #6a9ac8; font-size: 18px; cursor: pointer; }
.msm-header button:hover { color: #fff; }
.msm-context-row {
  display: flex; gap: 8px; padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.msm-body { display: flex; flex: 1; min-height: 0; }
/* decisions/0135: dept/cycle shown as plain text, not controls. The hidden
   value holders include the <select> ContextPicker swaps in for the cycle
   input, which doesn't carry the hidden attribute -- hence the rule. */
.msm-context-row select, .msm-context-row input { display: none; }
.msm-context-label { font-size: 13px; color: var(--text-muted, #9fb3c8); }
.msm-drill-section {
  padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.msm-drill-title {
  font-size: 9px; color: #f5a623; text-transform: uppercase;
  letter-spacing: .1em; opacity: .7; margin-bottom: 6px;
}
.msm-left { width: 148px; flex-shrink: 0; border-right: 1px solid rgba(255,255,255,.08); padding: 8px 0; overflow-y: auto; }
.msm-left-title { font-size: 9px; color: #f5a623; text-transform: uppercase; letter-spacing: .1em; padding: 0 12px 6px; opacity: .7; }
.msm-type-btn { display: block; width: 100%; text-align: left; padding: 7px 14px; background: none; border: none; color: #c8d8e8; font-size: 11px; cursor: pointer; }
.msm-type-btn:hover { background: rgba(245,166,35,.1); }
.msm-type-btn.active { background: rgba(245,166,35,.18); color: #fff; font-weight: 600; border-left: 2px solid #f5a623; }
.msm-mid { width: 160px; flex-shrink: 0; border-right: 1px solid rgba(255,255,255,.08); padding: 8px; overflow-y: auto; }
.msm-mid-title { font-size: 9px; color: #f5a623; text-transform: uppercase; letter-spacing: .1em; padding: 0 4px 6px; opacity: .7; }
.msm-level-btn {
  display: block; width: 100%; padding: 6px 10px; margin-bottom: 4px;
  background: rgba(100,160,200,.08); border: 1px solid rgba(100,160,200,.2);
  border-radius: 4px; color: #c8d8e8; font-size: 11px; cursor: pointer; text-align: left;
}
.msm-level-btn:hover { background: rgba(245,166,35,.15); border-color: rgba(245,166,35,.4); color: #fff; }
.msm-no-levels { font-size: 11px; color: #3a6a8a; padding: 8px 4px; }
.msm-right { flex: 1; padding: 8px 12px; overflow-y: auto; display: flex; flex-direction: column; }
.msm-right-title { font-size: 9px; color: #f5a623; text-transform: uppercase; letter-spacing: .1em; padding-bottom: 8px; opacity: .7; }
.msm-seq-empty { font-size: 11px; color: #3a6a8a; padding: 16px 0; text-align: center; }
.msm-seq-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: rgba(100,160,200,.06); border: 1px solid rgba(100,160,200,.15);
  border-radius: 4px; margin-bottom: 4px;
}
.msm-seq-num {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(245,166,35,.2);
  border: 1px solid rgba(245,166,35,.5); color: #f5a623; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.msm-seq-label { flex: 1; font-size: 11px; color: #c8d8e8; }
.msm-seq-btns { display: flex; gap: 3px; }
.msm-seq-btns button { padding: 2px 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); border-radius: 3px; color: #8abadc; font-size: 11px; cursor: pointer; }
.msm-seq-btns button:hover:not(:disabled) { background: rgba(245,166,35,.2); color: #f5a623; }
.msm-seq-btns button:disabled { opacity: .3; cursor: default; }
.msm-remove-btn { color: #cc5555 !important; border-color: rgba(200,80,80,.3) !important; }
.msm-remove-btn:hover { background: rgba(200,80,80,.2) !important; }
.msm-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.msm-footer button { padding: 6px 16px; border-radius: 4px; font-size: 12px; cursor: pointer; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.2); color: #c8d8e8; }
.msm-footer button:hover { background: rgba(255,255,255,.12); }
.msm-run-btn { background: #f5a623 !important; border-color: #f5a623 !important; color: #0a1a2e !important; font-weight: 700 !important; }
.msm-run-btn:hover { background: #ffc04d !important; }
.msm-run-btn:disabled { opacity: .4; cursor: default; }

/* ── Right-click context menu (decisions/0041) ── */
#ctx-menu {
  display: none; position: fixed; z-index: 2000; min-width: 200px;
  background: #0d2038; border: 1px solid #2a4a6a; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.6); padding: 4px 0; font-size: 12px;
}
#ctx-menu.open { display: block; }
.ctx-title {
  padding: 6px 14px 5px; color: #f5a623; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px;
}
.ctx-item { padding: 7px 14px; color: #d0e0f0; cursor: pointer; white-space: nowrap; }
.ctx-item:hover { background: rgba(245,166,35,.15); }
/* decisions/0145: an action that can't run here is shown, greyed, with why. */
.ctx-item.disabled { color: #6f879e; cursor: default; }
.ctx-item.disabled:hover { background: none; }

/* ── "Set Level" menu on the Level column header (decisions/0116 item 4).
   Same shell as #ctx-menu above; the items carry a tick column so the
   current depth is visible at a glance, as the reference app's own submenu
   does. ── */
#level-menu {
  display: none; position: fixed; z-index: 2000; min-width: 150px;
  background: #0d2038; border: 1px solid #2a4a6a; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.6); padding: 4px 0; font-size: 12px;
}
#level-menu.open { display: block; }
#level-menu-items { max-height: 320px; overflow-y: auto; }
.level-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px; }
.level-tick { width: 10px; color: #f5a623; font-size: 11px; flex-shrink: 0; }
.level-item.level-active { color: #fff; font-weight: 600; background: rgba(245,166,35,.1); }
/* The Level header is the only clickable one -- sorting is off everywhere
   (decisions/0065 item 2), so without this it looks as inert as the rest.
   Scoped to #variance-grid deliberately: MultiSeg's grid ALSO has a
   segLevel column but no Set Level menu wired, so an unscoped rule made
   its Level header look clickable while doing nothing -- the exact mistake
   decisions/0116 3d had just corrected, reintroduced one page over. */
#variance-grid .ag-header-cell[col-id="segLevel"] { cursor: pointer; }
#variance-grid .ag-header-cell[col-id="segLevel"]:hover { background: rgba(245,166,35,.15); }

/* ── Loading overlay / empty state (decisions/0044) ── */
.grid-wrap { position: relative; flex: 1; min-height: 240px; display: flex; flex-direction: column; }
.grid-wrap > .ag-theme-alpine { width: 100%; flex: 1; }
.loading-overlay {
  display: none; position: absolute; inset: 0; background: rgba(13,31,53,.75);
  z-index: 100; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
.loading-overlay.visible { display: flex; }
.spinner {
  width: 32px; height: 32px; border: 3px solid #2a5a8a; border-top-color: #f5a623;
  border-radius: 50%; animation: emapp-spin .8s linear infinite;
}
@keyframes emapp-spin { to { transform: rotate(360deg); } }
.loading-text { color: #8aaac8; font-size: 13px; }
.empty-state {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; pointer-events: none;
}
.empty-state.visible { display: flex; }
.empty-state .empty-icon { font-size: 32px; opacity: .4; }
.empty-state .empty-text { color: #4a6a8a; font-size: 13px; }

/* ── AG Grid overrides -- ported from the reference app's own dark
   header/pinned-column treatment. CSS custom properties are set
   directly since ag-grid's own generated theme CSS otherwise wins on
   specificity over plain class selectors for header colors. ── */
.ag-theme-alpine {
  --ag-header-background-color: #1a3a5c;
  --ag-header-foreground-color: #e8f0f8;
  --ag-foreground-color: #d8e4ee;
  --ag-background-color: #0d1f35;
  --ag-odd-row-background-color: #112235;
  --ag-row-hover-color: #163257;
  --ag-border-color: #1e3a5c;
  --ag-row-height: 24px;
  --ag-header-height: 30px;
  --ag-font-size: 12px;
}
.ag-theme-alpine .ag-root-wrapper { border: none; }
/* decisions/0139: AG Grid injects its own stylesheet at runtime, after this
   file, so its white --ag-background-color default wins over the value set
   above. The white only showed through where rows don't paint -- the
   scrollbar strips -- which made the 25%-white scrollbar thumb (0088)
   invisible. `html` raises specificity enough to win regardless of order. */
html .ag-theme-alpine .ag-root-wrapper { background-color: #0d1f35; }
.ag-theme-alpine .ag-header, .ag-theme-alpine .ag-header-row { background: #1a3a5c !important; }
.ag-theme-alpine .ag-header { border-bottom: 2px solid #f5a623; }
.ag-theme-alpine .ag-header-cell-label { color: #e8f0f8 !important; font-size: 11.5px; font-weight: 600; }
.ag-theme-alpine .ag-header-group-cell { background: #122d4a !important; }
.ag-theme-alpine .ag-header-group-cell-label { color: #f5a623 !important; font-size: 11px; font-weight: 700; }
/* David, 2026-10-02: Variance's column data dates, under the title and
   smaller, as the Excel eMapp ("[01 Oct 2026]"; variance-columns.js
   DatedHeader). The group header carries it after its title. */
.dated-header { display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  width: 100%; height: 100%; line-height: 1.2; overflow: hidden; }
.dated-header-title { color: #e8f0f8; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dated-header-date { color: #a9c1d9; font-size: 9.5px; font-weight: 400; white-space: nowrap; }
.dated-header.dated-header-group { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 6px; }
.dated-header-group .dated-header-title { color: #f5a623; font-size: 11px; font-weight: 700; }
.ag-theme-alpine .ag-cell { font-size: 12px; padding-top: 2px; padding-bottom: 2px; }
/* Multi-row selection (David: pick a run, ctrl-click more, add them all to
   the filter in one go). !important is load-bearing, not laziness: getRowStyle
   sets each row's background as an INLINE style (rowBg, per tree level), and
   an inline style beats any ordinary stylesheet rule -- without this the
   selection is applied but completely invisible. */
.ag-theme-alpine .ag-row-selected {
  background: #1f4d7a !important;
  box-shadow: inset 2px 0 0 #f5a623;
}
.ag-theme-alpine .ag-row-selected .ag-cell { color: #eaf3ff; }
.ag-theme-alpine .ag-pinned-left-header { background: #152d4a !important; }

/* ── Angle slide-out panel (decisions/0044), Variance only -- replaces
   the bare <select id="angle-select">, which stays in the DOM (hidden)
   as the source of truth existing JS already reads/writes. ── */
#angle-select { display: none; }
#angle-panel {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 800;
  display: flex; filter: drop-shadow(2px 0 8px rgba(0,0,0,.5));
}
#angle-trigger {
  width: 22px; min-height: 120px; background: linear-gradient(180deg, #f5a623, #c87d00);
  color: #0d1f35; cursor: pointer; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; text-orientation: mixed; font-size: 9px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; border-radius: 0 4px 4px 0;
  transition: width .15s; user-select: none;
}
#angle-trigger:hover { width: 26px; }
#angle-list {
  width: 0; overflow: hidden; background: #0a1828; border: 1px solid #f5a623;
  border-left: none; border-radius: 0 6px 6px 0;
  transition: width .22s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column;
}
#angle-panel:hover #angle-list, #angle-panel:focus-within #angle-list { width: 168px; }
.angle-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap; min-width: 168px;
}
.angle-item:last-child { border-bottom: none; }
.angle-item:hover { background: rgba(245,166,35,.12); }
.angle-item.active { background: rgba(245,166,35,.18); }
.angle-num {
  width: 18px; height: 18px; border-radius: 3px; background: rgba(245,166,35,.2);
  border: 1px solid rgba(245,166,35,.4); display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; color: #f5a623; flex-shrink: 0;
}
.angle-item.active .angle-num { background: #f5a623; color: #0d1f35; border-color: #f5a623; }
.angle-label { font-size: 12px; color: #c8d8e8; font-weight: 500; }
.angle-item.active .angle-label { color: #fff; font-weight: 600; }
.angle-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 4px 14px; min-width: 168px; border-bottom: 1px solid rgba(245,166,35,.2);
}
.angle-current {
  font-size: 8px; color: #f5a623; letter-spacing: .08em;
  text-transform: uppercase; opacity: .7; white-space: nowrap;
}
.angle-filter-btn {
  font-size: 10px; padding: 2px 6px; border-radius: 3px;
  background: rgba(245,166,35,.15); border: 1px solid rgba(245,166,35,.4);
  color: #f5a623; cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.angle-filter-btn:disabled { opacity: .45; cursor: default; }
.angle-filter-btn:hover:not(:disabled) { background: rgba(245,166,35,.3); }
.angle-divider { margin: 4px 10px; border-top: 1px solid rgba(255,255,255,.1); }
.angle-placeholder { cursor: pointer; pointer-events: auto; }

/* decisions/0111 round 5: the 5 detail-report pages' own "Detail Data
   Options" flyout (Modules/eMapp/app/main.py's _detail_options_panel) --
   same #angle-panel/.angle-item visual system as Variance's angle
   selector above, just different content. */
.detail-options-icons { display: flex; gap: 4px; }
/* Commitments/Persal: real items in the reference app, no route in this
   build yet -- shown, not hidden, so the full real list is visible, but
   inert and visually muted rather than clickable into nothing. */
.angle-item.angle-disabled { cursor: not-allowed; opacity: .45; pointer-events: none; }
.angle-item.angle-disabled .angle-num { color: #8aaac8; border-color: rgba(138,170,200,.4); background: rgba(138,170,200,.1); }

/* decisions/0147: the old #splash styles moved into static/vs-loader.js (the suite loader). */

/* decisions/0115: each module owns its own dept/cycle controls again, so
   they need real styling in the toolbar rather than the display:none they
   inherited while Portal owned a single global picker. */
.context-picker {
  display: inline-flex; align-items: center; gap: 8px; margin-right: 12px;
}
.context-picker select,
.context-picker input {
  background: #0f2540; color: #d0e4f4; border: 1px solid #1e3a5f;
  border-radius: 4px; padding: 4px 8px; font-size: 13px; min-width: 90px;
}
.context-picker select#dept-select { min-width: 260px; }

/* David, 2026-10-02: the detail reports' totals row, above the column
   titles as in the Excel eMapp (totals-row.js). */
.ag-header-group-cell.totals-row-group { padding: 0 8px; border-bottom: 1px solid #2a5a8a; }
.ag-header-group-cell.totals-row-group .ag-header-group-cell-label,
.totals-row-cell { width: 100%; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
  color: #f5a623; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.totals-row-cell.totals-row-average { color: #8aaac8; }
.ag-header-group-cell.totals-row-group .ag-header-cell-resize { display: none; } /* resize from the title row */

/* ── Charts (decisions/0159 addendum, 2026-10-21) ─────────────────────── */
.ctx-sep { height: 1px; margin: 4px 8px; background: rgba(138,170,200,.25); }
.chart-open-btn { background: linear-gradient(135deg, #1d4f8a, #3987e5); border-color: #3987e5; color: #fff; }
.chart-open-btn:hover:not(:disabled) { background: linear-gradient(135deg, #2560a3, #5a9df0); border-color: #5a9df0; }
#chart-modal { display: none; position: fixed; inset: 0; z-index: 2000; }
#chart-modal.open { display: block; }
.chart-backdrop { position: absolute; inset: 0; background: rgba(4,12,22,.62); backdrop-filter: blur(4px); }
.chart-box {
  position: absolute; inset: 3vh 2.5vw; display: flex; flex-direction: column; border-radius: 14px;
  background: radial-gradient(1200px 500px at 15% -10%, rgba(57,135,229,.18), transparent 60%),
              radial-gradient(900px 400px at 100% 110%, rgba(245,166,35,.10), transparent 60%),
              linear-gradient(180deg, #0f2440, #0b1b30);
  border: 1px solid rgba(138,170,200,.22);
  box-shadow: 0 24px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
  animation: chart-in .28s ease-out; overflow: hidden;
}
@keyframes chart-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.chart-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 16px 20px 12px; border-bottom: 1px solid rgba(138,170,200,.14); flex-wrap: wrap; }
.chart-header h3 { margin: 0; font-size: 18px; color: #fff; letter-spacing: .2px; }
.chart-subtitle { color: #8aaac8; font-size: 12px; margin-top: 4px; }
.chart-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chart-seg { display: inline-flex; border: 1px solid rgba(138,170,200,.3); border-radius: 8px; overflow: hidden; }
.chart-seg button { border: 0; border-radius: 0; background: transparent; color: #c9d8e8; padding: 6px 11px; font-size: 12px; }
.chart-seg button + button { border-left: 1px solid rgba(138,170,200,.3); }
.chart-seg button.active { background: #f5a623; color: #0d1f35; font-weight: 700; }
.chart-tool { font-size: 12px; padding: 6px 11px; border-radius: 8px; }
.chart-tool.active { background: #254870; color: #fff; }
.chart-close { font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.chart-body { flex: 1; display: flex; min-height: 0; }
.chart-side { width: 300px; flex: none; display: flex; flex-direction: column; border-right: 1px solid rgba(138,170,200,.14); }
.chart-lines { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chart-add-btn { margin: 0 14px 14px; padding: 9px; border-radius: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, rgba(57,135,229,.25), rgba(57,135,229,.10)); border: 1px dashed rgba(90,157,240,.7); }
.chart-add-btn:hover:not(:disabled) { background: rgba(57,135,229,.35); border-style: solid; }
.chart-main { position: relative; }
.chart-picker { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; padding: 14px 18px;
  background: rgba(11,27,48,.97); backdrop-filter: blur(3px); }
.chart-picker[hidden] { display: none; }
.chart-picker-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.chart-picker-head strong { color: #fff; font-size: 14px; white-space: nowrap; }
.chart-picker-head input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(138,170,200,.35);
  background: #0d1f35; color: #e6eef7; font-size: 13px; }
.chart-picker-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chart-pick { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-radius: 6px; padding: 6px 10px;
  background: transparent; color: #d0e0f0; font-size: 12px; }
.chart-pick:hover:not(:disabled) { background: rgba(57,135,229,.18); color: #fff; }
.chart-pick.on { opacity: .55; cursor: default; }
.chart-pick-no { color: #8aaac8; font-variant-numeric: tabular-nums; min-width: 72px; }
.chart-pick-name { flex: 1; }
.chart-pick-level { color: #8aaac8; font-size: 11px; }
.chart-pick-act { color: #f5a623; font-weight: 700; min-width: 74px; text-align: right; }
.chart-picker-empty { color: #8aaac8; font-size: 12px; padding: 10px; }
.chart-chip { position: relative; border-radius: 10px; padding: 10px 12px 10px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(138,170,200,.18); box-shadow: inset 3px 0 0 var(--chip), 0 0 18px -10px var(--chip); }
.chart-chip-head { display: flex; align-items: center; gap: 8px; }
.chart-chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chip); flex: none;
  box-shadow: 0 0 10px var(--chip); }
.chart-chip-name { color: #fff; font-size: 12px; font-weight: 600; flex: 1; line-height: 1.3; }
.chart-chip-x { border: 0; background: transparent; color: #8aaac8; padding: 0 2px; font-size: 12px; }
.chart-chip-x:hover:not(:disabled) { background: transparent; color: #fff; }
.chart-chip-sub { color: #8aaac8; font-size: 11px; margin: 3px 0 8px 18px; }
.chart-chip-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-left: 18px; }
.chart-kpi-label { display: block; color: #8aaac8; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.chart-kpi-value { display: block; color: #e6eef7; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 18px 14px; }
.chart-note { color: #f5a623; font-size: 12px; min-height: 16px; }
.chart-canvas-wrap { position: relative; flex: 1; min-height: 260px; }
.chart-table { max-height: 34%; overflow: auto; margin-top: 10px; border-top: 1px solid rgba(138,170,200,.14); }
.chart-values { border-collapse: collapse; width: 100%; font-size: 11px; color: #c9d8e8; }
.chart-values th { position: sticky; top: 0; background: #0f2440; color: #8aaac8; text-align: right; padding: 5px 8px; font-weight: 600; }
.chart-values th:first-child, .chart-values td:first-child { text-align: left; }
.chart-values td { padding: 4px 8px; border-top: 1px solid rgba(138,170,200,.08); white-space: nowrap; }
.chart-values td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .chart-body { flex-direction: column; }
  .chart-side { width: auto; max-height: 34%; border-right: 0; border-bottom: 1px solid rgba(138,170,200,.14); }
}
.chart-tool.chart-pdf { background: linear-gradient(135deg, #b8740f, #f5a623); border-color: #f5a623; color: #0d1f35; font-weight: 700; }
.chart-tool.chart-pdf:hover:not(:disabled) { background: linear-gradient(135deg, #d08a1a, #ffc04d); color: #0d1f35; }

/* ── Journals (decisions/0159 addendum, 2026-10-21) ───────────────────── */
#jnl-modal { display: none; position: fixed; inset: 0; z-index: 2100; }
#jnl-modal.open { display: block; }
.jnl-backdrop { position: absolute; inset: 0; background: rgba(4,12,22,.62); backdrop-filter: blur(4px); }
.jnl-box { position: absolute; inset: 2.5vh 2vw; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #0f2440, #0b1b30); border: 1px solid rgba(138,170,200,.22);
  box-shadow: 0 24px 80px rgba(0,0,0,.55); animation: chart-in .25s ease-out; }
.jnl-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px;
  background: linear-gradient(90deg, #1f3864, #2e5597); }
.jnl-header h3 { margin: 0; color: #fff; font-size: 16px; }
.jnl-actions { display: flex; gap: 8px; }
.jnl-create { background: #4fd18b; border-color: #4fd18b; color: #0d1f35; font-weight: 700; padding: 7px 14px; border-radius: 8px; }
.jnl-create:hover:not(:disabled) { background: #6be3a2; color: #0d1f35; }
.jnl-cancel { background: #c6efce; border-color: #c6efce; color: #0d1f35; font-weight: 700; padding: 7px 14px; border-radius: 8px; }
.jnl-cancel:hover:not(:disabled) { background: #dff7e3; color: #0d1f35; }
.jnl-fields { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 12px 18px;
  border-bottom: 1px solid rgba(138,170,200,.14); }
.jnl-fields label { display: flex; flex-direction: column; gap: 4px; color: #8aaac8; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.jnl-fields input { background: #0d1f35; border: 1px solid rgba(138,170,200,.35); border-radius: 6px; color: #fff; padding: 7px 9px; font-size: 13px; }
.jnl-fields #jnl-desc { width: 360px; }
.jnl-summary { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.jnl-sum { background: rgba(255,255,255,.04); border: 1px solid rgba(138,170,200,.2); border-radius: 8px; padding: 6px 12px; min-width: 120px; }
.jnl-sum.warn { border-color: #f5a623; } .jnl-sum.bad { border-color: #e66767; }
/* David, 2026-10-22: totals that don't match flash. */
.jnl-sum.flash { animation: jnl-flash 1s ease-in-out infinite; }
@keyframes jnl-flash { 0%, 100% { background: rgba(230,103,103,.08); box-shadow: none; }
  50% { background: rgba(230,103,103,.45); box-shadow: 0 0 12px rgba(230,103,103,.8); } }
@media (prefers-reduced-motion: reduce) { .jnl-sum.flash { animation: none; background: rgba(230,103,103,.35); } }
.jnl-sum-label { display: block; color: #8aaac8; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.jnl-sum-value { display: block; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.jnl-note { padding: 6px 18px; color: #8aaac8; font-size: 12px; min-height: 18px; }
.jnl-note.bad { color: #ff8f8f; }
.jnl-legs { flex: 1; overflow-y: auto; padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.jnl-leg { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 12px; padding: 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(138,170,200,.18); box-shadow: inset 3px 0 0 #f5a623; }
.jnl-leg.done { box-shadow: inset 3px 0 0 #4fd18b; }
.jnl-side-head { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.jnl-side.from .jnl-side-head { color: #8fb4ff; } .jnl-side.to .jnl-side-head { color: #9be27a; }
.jnl-segs { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.jnl-segs th { text-align: left; color: #8aaac8; font-weight: 600; padding: 3px 6px; background: rgba(255,255,255,.05); }
.jnl-segs td { padding: 3px 6px; border-top: 1px solid rgba(138,170,200,.08); color: #d0e0f0; }
.jnl-type { color: #8aaac8 !important; width: 92px; } .jnl-no { width: 74px; font-variant-numeric: tabular-nums; }
.jnl-moved td { background: rgba(245,166,35,.14); color: #fff; }
.jnl-change { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.jnl-apply-all { margin-left: 4px; background: #f5a623; border-color: #f5a623; color: #0d1f35; font-weight: 700; }
.jnl-apply-all:hover:not(:disabled) { background: #ffc35a; border-color: #ffc35a; color: #0d1f35; }
.jnl-match { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 8px; }
.jnl-match-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #8aaac8; }
.jnl-match-row span { width: 96px; flex: none; }
.jnl-match-row input { flex: 1; min-width: 0; background: #0d1f35; border: 1px solid rgba(138,170,200,.25); border-radius: 4px; color: #fff; padding: 3px 6px; font-size: 11px; }
.jnl-match-row input[readonly] { opacity: .65; }
.jnl-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 22px; }
.jnl-num { background: #f5a623; color: #0d1f35; font-weight: 800; border-radius: 8px; padding: 4px 14px; }
.jnl-state { font-size: 11px; color: #f5a623; text-align: center; } .jnl-leg.done .jnl-state { color: #4fd18b; }
.jnl-small { font-size: 11px; padding: 4px 10px; border-radius: 6px; }
.jnl-from-amount { margin-top: 8px; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.jnl-amount { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #fff; font-weight: 700; }
.jnl-amount input { width: 150px; text-align: right; background: #0d1f35; border: 1px solid rgba(155,226,122,.6); border-radius: 6px; color: #fff; padding: 5px 8px; font-weight: 700; }
.jnl-search { position: absolute; top: 120px; right: 4vw; width: 520px; max-width: 92vw; max-height: 70vh; display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 12px; background: #0f2440; border: 1px solid rgba(245,166,35,.5); box-shadow: 0 20px 60px rgba(0,0,0,.6); z-index: 3; }
.jnl-search[hidden], .jnl-confirm[hidden] { display: none; }
.jnl-search-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff; }
.jnl-search input[type=search] { background: #0d1f35; border: 1px solid rgba(138,170,200,.35); border-radius: 6px; color: #fff; padding: 7px 9px; }
.jnl-search-all { color: #c9d8e8; font-size: 12px; }
.jnl-search-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.jnl-pick { display: flex; gap: 10px; text-align: left; border: 0; background: transparent; color: #d0e0f0; padding: 6px 8px; border-radius: 6px; font-size: 12px; }
.jnl-pick:hover:not(:disabled) { background: rgba(57,135,229,.2); color: #fff; }
.jnl-pick-no { color: #8aaac8; min-width: 80px; font-variant-numeric: tabular-nums; }
.jnl-pick-empty { color: #8aaac8; font-size: 12px; padding: 8px; }
.jnl-confirm { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(11,27,48,.96); color: #fff; font-size: 15px; z-index: 4; }
.jnl-confirm button { margin: 0 6px; }
@media (max-width: 1000px) { .jnl-leg { grid-template-columns: 1fr; } .jnl-mid { flex-direction: row; padding-top: 0; } }
