/* ══════════════════════════════════════════════════════════════════════════
   ShopCore Reports — the "Mate" look
   ══════════════════════════════════════════════════════════════════════════

   The same finish as the Admin portal (Admin's wwwroot/css/mate.css), spoken
   in rp- classes. Loaded after shopcore-reports.css and the shared
   fluent-shell.css so it decides the finish without touching the other
   portals. If a token or the pane changes in mate.css, change it here too.

   Parts, in order:
     1. Tokens + base + sidebar   (same as Admin)
     2. Reports tokens            (--rp-* resolved from the Mate tokens, so the
                                   dark theme follows without a second table)
     3. Top bar, page header, buttons, fields
     4. Cards, figure tiles, filters
     5. Tables, status, charts
     6. Report library, alerts, empty states
     7. Sign-in
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --dur-faster: 100ms; --dur-fast: 150ms; --dur-normal: 200ms; --dur-slow: 300ms;
  --ease:       cubic-bezier(.33, 0, .67, 1);
  --ease-decel: cubic-bezier(.1, .9, .2, 1);
}

/* ═══ 1. TOKENS ═══════════════════════════════════════════════════════════ */

:root {
  /* Primary is ink, not a hue: buttons, selection and links are near-black. */
  --brand-primary:   #0E1620;
  --brand-hover:     #1C2733;
  --brand-pressed:   #000000;
  --brand-selected:  #0E1620;
  --brand-fg:        #0E1620;
  --brand-fg-hover:  #000000;
  --brand-tint-60:   #F2F3F5;
  --brand-tint-40:   #E6E8EB;
  --brand-tint-20:   #C9CED5;
  --brand-on:        #FFFFFF;

  /* The one colour the design uses: the green of a paid order and a full ring. */
  --accent:          #2F6F55;
  --accent-hover:    #265B46;
  --accent-tint:     #EAF3EE;

  --neutral-canvas:       #FFFFFF;
  --neutral-layer:        #FFFFFF;
  --neutral-layer-alt:    #FAFAFB;
  --neutral-subtle:       #F6F7F8;
  --neutral-subtle-hover: #F2F3F5;
  --neutral-pressed:      #E9EBEE;
  --neutral-disabled-bg:  #F2F3F5;

  --stroke-1: #E3E5E8;   /* control borders */
  --stroke-2: #ECEDEF;   /* dividers */
  --ctl-stroke-hover: #CBD0D6;  /* a field under the pointer */
  --ctl-stroke-strong: #C3C9D0; /* checkbox edge, dashed chip edge */
  --ctl-track: #D3D8DE;         /* an off switch */
  --stroke-3: #F2F3F4;

  --fg-1: #0E1620;
  --fg-2: #2B333D;
  --fg-3: #6B7480;
  --fg-4: #9097A1;

  --success-fg: #1E7A4F; --success-bg: #EAF6EF; --success-br: #BFE3CF;
  --warning-fg: #B26A00; --warning-bg: #FFF5E6; --warning-br: #F4D9A8;
  --error-fg:   #D93036; --error-bg:   #FDEEEE; --error-br:   #F4BEC0;
  --info-fg:    #2F5FD0; --info-bg:    #EEF3FD; --info-br:    #C3D4F7;
  --purple-fg:  #6B4BC8; --purple-bg:  #F3F0FC; --purple-br:  #D5CCF2;

  /* Soft, short shadows: surfaces are drawn by their hairline, not their lift. */
  --shadow-2:  0 1px 2px rgba(14,22,32,.04);
  --shadow-4:  0 1px 3px rgba(14,22,32,.06);
  --shadow-8:  0 4px 12px rgba(14,22,32,.08);
  --shadow-16: 0 8px 24px rgba(14,22,32,.12);
  --shadow-28: 0 16px 40px rgba(14,22,32,.16);
  --shadow-64: 0 24px 64px rgba(14,22,32,.24);

  --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-xl: 14px;

  --font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont,
          'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', 'Segoe UI Variable Display', 'Segoe UI', sans-serif;

  --sidebar-w:           232px;
  --sidebar-w-collapsed: 64px;
  --topbar-h:            56px;
  --content-pad:         28px;

  /* The pane: a dark navy slab, lighter text as it comes forward. */
  --mt-side-bg:        #0B121A;
  --mt-side-raise:     #141C26;
  --mt-side-hover:     #111A24;
  --mt-side-stroke:    #1D2733;
  --mt-side-fg:        #8C97A4;
  --mt-side-fg-hover:  #D5DBE2;
  --mt-side-fg-active: #FFFFFF;
  --mt-side-faint:     #5B6673;

  --nav-bg:         var(--mt-side-bg);
  --nav-border:     var(--mt-side-stroke);
  --nav-fg:         var(--mt-side-fg);
  --nav-fg-hover:   var(--mt-side-fg-hover);
  --nav-fg-active:  var(--mt-side-fg-active);
  --nav-hover-bg:   var(--mt-side-hover);
  --nav-active-bg:  var(--mt-side-raise);
  --nav-section-fg: var(--mt-side-faint);
  --nav-rail:       transparent;

  --topbar-bg:     var(--neutral-layer);
  --topbar-border: var(--stroke-2);
  --focus-ring:    0 0 0 2px var(--neutral-layer), 0 0 0 4px var(--brand-primary);

  --sc-primary-light: #3A4756;
}

/* Dark theme: the page joins the pane. Ink flips to white for primary actions. */
:root[data-theme="dark"] {
  --brand-primary:  #F4F6F8;
  --brand-hover:    #FFFFFF;
  --brand-pressed:  #D9DEE4;
  --brand-selected: #F4F6F8;
  --brand-fg:       #F4F6F8;
  --brand-fg-hover: #FFFFFF;
  --brand-tint-60:  #1A232E;
  --brand-tint-40:  #243040;
  --brand-tint-20:  #33415A;
  --brand-on:       #0B121A;

  --accent:       #4DB68A;
  --accent-hover: #6BC9A0;
  --accent-tint:  #12261D;

  --neutral-canvas:       #0B121A;
  --neutral-layer:        #101821;
  --neutral-layer-alt:    #131C26;
  --neutral-subtle:       #151F2A;
  --neutral-subtle-hover: #1A2531;
  --neutral-pressed:      #0E1620;
  --neutral-disabled-bg:  #151F2A;

  --stroke-1: #2A3544;
  --stroke-2: #1F2A37;
  --ctl-stroke-hover: #3A4859;
  --ctl-stroke-strong: #3A4859;
  --ctl-track: #2E3B4B;
  --stroke-3: #19232E;

  --fg-1: #F4F6F8;
  --fg-2: #D3D9E0;
  --fg-3: #9AA4B0;
  --fg-4: #6F7A87;

  --success-fg: #5FD398; --success-bg: #11261B; --success-br: #1F4A33;
  --warning-fg: #F0B95B; --warning-bg: #2A2010; --warning-br: #54411D;
  --error-fg:   #FF7A80; --error-bg:   #2D1517; --error-br:   #5A2A2D;
  --info-fg:    #7DA2FF; --info-bg:    #131E36; --info-br:    #26396B;
  --purple-fg:  #B7A1F5; --purple-bg:  #1D1731; --purple-br:  #38305F;

  --shadow-2:  0 1px 2px rgba(0,0,0,.4);
  --shadow-4:  0 1px 3px rgba(0,0,0,.45);
  --shadow-8:  0 4px 12px rgba(0,0,0,.5);
  --shadow-16: 0 8px 24px rgba(0,0,0,.55);
  --shadow-28: 0 16px 40px rgba(0,0,0,.6);
  --shadow-64: 0 24px 64px rgba(0,0,0,.65);

  --mt-side-bg:     #070C12;
  --mt-side-raise:  #111923;
  --mt-side-hover:  #0D141C;
  --mt-side-stroke: #17202B;

  --sc-primary-light: #D3D9E0;
}

/* ═══ 2. BASE ═════════════════════════════════════════════════════════════ */

body { font-family: var(--font); color: var(--fg-1); background: var(--neutral-canvas);
       -webkit-font-smoothing: antialiased; }
.sc-shell { background: var(--neutral-canvas); }
.sc-main  { background: var(--neutral-canvas); }
.sc-content { background: var(--neutral-canvas); font-size: 13px; }
::selection { background: color-mix(in srgb, var(--brand-primary) 14%, transparent); color: var(--fg-1); }

/* ═══ 3. SIDEBAR ══════════════════════════════════════════════════════════
   A dark navy pane: mark and name with a fold button, a search field, the
   menu, and who is signed in. The selected item is a raised dark chip and
   white text — no rail, no tint. */

.fl-sidebar {
  background: var(--mt-side-bg); border-right: 0; color: var(--mt-side-fg);
  font-family: var(--font);
}
@media (min-width: 769px) {
  .fl-sidebar { width: var(--sidebar-w); }
  .fl-sidebar:not(.pinned) { width: var(--sidebar-w-collapsed); }
  .fl-sidebar:not(.pinned):not(:hover):not(:focus-within) :is(.fl-search, .fl-collapse, .fl-user-more, .fl-nav-none),
  .fl-sidebar.collapsed :is(.fl-search, .fl-collapse, .fl-user-more, .fl-nav-none) { display: none; }
  .fl-sidebar:not(.pinned):not(:hover):not(:focus-within) .fl-nav-section,
  .fl-sidebar.collapsed .fl-nav-section { background: var(--mt-side-stroke); }
  .fl-sidebar:not(.pinned):not(:hover):not(:focus-within) .fl-nav-item,
  .fl-sidebar.collapsed .fl-nav-item { border-radius: 8px; }
}

/* Header: mark, name, fold button */
.fl-logo { min-height: 60px; padding: 14px 14px 10px 16px; border-bottom: 0; gap: 10px; }
.fl-logo-mark { width: 24px; height: 24px; border-radius: 6px; }
.fl-logo-name { font-family: var(--font-display); font-size: 16px; font-weight: 600;
                letter-spacing: -.01em; color: #FFFFFF; }
.fl-logo-sub  { display: none; }
.fl-collapse {
  margin-left: auto; width: 28px; height: 28px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--mt-side-fg); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.fl-collapse:hover { background: var(--mt-side-raise); color: #FFFFFF; }
.fl-collapse svg { width: 17px; height: 17px; }

/* Search */
.fl-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  margin: 2px 14px 12px; padding: 0 8px 0 10px; height: 34px;
  border: 1px solid var(--mt-side-stroke); border-radius: 8px; background: #0F1822;
  color: var(--mt-side-fg); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.fl-search:focus-within { border-color: #2C3A4A; background: #111C28; }
.fl-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.fl-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  font: 400 13px/1 var(--font); color: #FFFFFF; box-shadow: none;
}
.fl-search input::placeholder { color: var(--mt-side-fg); }
.fl-search input:focus { box-shadow: none; border: 0; }
.fl-search kbd {
  flex-shrink: 0; padding: 2px 6px; border-radius: 5px; background: var(--mt-side-raise);
  border: 1px solid var(--mt-side-stroke); color: var(--mt-side-fg);
  font: 500 10.5px/1.3 var(--font); letter-spacing: .02em;
}
.fl-search:focus-within kbd { display: none; }

/* The trade chip: a quiet line of text, not a coloured badge. */
.fl-badge { margin: 0 14px 8px; padding: 0; background: transparent; color: var(--mt-side-faint);
            font-size: 10.5px; letter-spacing: .06em; }
.fl-badge::before { background: #3FB67F; }

/* Menu */
.fl-nav { padding: 2px 10px 12px; }
.fl-nav-section { padding: 18px 10px 6px; font-size: 11px; font-weight: 500; letter-spacing: .04em;
                  text-transform: none; color: var(--mt-side-faint); }
.fl-nav-section:first-child { padding-top: 4px; }

.fl-nav-item {
  min-height: 34px; padding: 6px 10px; margin: 2px 0; gap: 10px; border-radius: 7px;
  color: var(--mt-side-fg); font: 500 13px/1.3 var(--font);
}
.fl-nav-item svg { width: 16px; height: 16px; stroke-width: 1.7; }
.fl-nav-item:hover { background: var(--mt-side-hover); color: var(--mt-side-fg-hover); }
.fl-nav-item:active { background: var(--mt-side-raise); }
.fl-nav-item::before { display: none; }
.fl-nav-item.active { background: var(--mt-side-raise); color: #FFFFFF; font-weight: 500; }
.fl-nav-item.expanded:not(.active) { color: var(--mt-side-fg-hover); }
.fl-nav-chevron { opacity: .5; width: 13px; height: 13px; }

.fl-nav-count { padding: 0 6px; min-width: 18px; height: 18px; display: inline-flex; align-items: center;
                justify-content: center; border-radius: 999px; background: #E5484D; color: #FFFFFF;
                font-size: 10.5px; font-weight: 600; }
.fl-nav-item.active .fl-nav-count { background: #E5484D; color: #FFFFFF; }

.fl-nav-sub::before { left: 19px; background: var(--mt-side-stroke); }
.fl-nav-sub-item {
  min-height: 30px; padding: 5px 10px 5px 38px; margin: 1px 0; border-radius: 7px;
  color: var(--mt-side-fg); font: 400 12.5px/1.3 var(--font);
}
.fl-nav-sub-item:hover { background: var(--mt-side-hover); color: var(--mt-side-fg-hover); }
.fl-nav-sub-item.active { background: var(--mt-side-raise); color: #FFFFFF; font-weight: 500; }
.fl-nav-sub-item.active::before { left: 18px; width: 3px; height: 12px; background: #FFFFFF; opacity: .9; }
.fl-nav-none { padding: 14px 10px; font-size: 12.5px; color: var(--mt-side-faint); }

/* Signed-in user */
.fl-user { padding: 12px 14px 14px; border-top: 0; gap: 10px; }
.fl-avatar { width: 30px; height: 30px; background: #2A3644; color: #FFFFFF; font-size: 11.5px; font-weight: 600; }
.fl-user-name { font-size: 13px; font-weight: 500; color: #FFFFFF; }
.fl-user-role { font-size: 11.5px; color: var(--mt-side-faint); }
.fl-user-more {
  width: 26px; height: 26px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--mt-side-fg); text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.fl-user-more:hover { background: var(--mt-side-raise); color: #FFFFFF; text-decoration: none; }
.fl-user-more svg { width: 16px; height: 16px; }

/* On a phone the drawer keeps the same pane. */
@media (max-width: 768px) {
  .fl-sidebar { width: min(var(--sidebar-w), 86vw); }
}


/* ═══ 2. REPORTS TOKENS ═══════════════════════════════════════════════════ */

:root {
  --rp-primary:       var(--brand-primary);
  --rp-primary-dark:  var(--brand-pressed);
  --rp-primary-light: var(--brand-hover);
  --rp-accent:        var(--accent);
  --rp-accent-dark:   var(--accent-hover);
  --rp-success: var(--success-fg);  --rp-warning: var(--warning-fg);
  --rp-error:   var(--error-fg);    --rp-info:    var(--info-fg);
  --rp-purple:  var(--purple-fg);
  --rp-rail:    var(--mt-side-bg);

  --rp-bg:     var(--neutral-canvas);
  --rp-card:   var(--neutral-layer);
  --rp-alt:    var(--neutral-layer-alt);
  --rp-hover:  var(--neutral-subtle);
  --rp-border: var(--stroke-1);  --rp-border-2: var(--stroke-2);  --rp-border-strong: var(--ctl-stroke-strong);
  --rp-text: var(--fg-1);  --rp-text-2: var(--fg-2);  --rp-muted: var(--fg-3);
  --rp-ok-fg: var(--success-fg);   --rp-ok-bg: var(--success-bg);
  --rp-warn-fg: var(--warning-fg); --rp-warn-bg: var(--warning-bg);
  --rp-err-fg: var(--error-fg);    --rp-err-bg: var(--error-bg);
  --rp-shadow: var(--shadow-2);  --rp-shadow-lg: var(--shadow-16);
  --rp-radius: 14px;
  --rp-font: var(--font);
}

html, body { background: var(--neutral-canvas); }
body { font-size: 13px; }
.rp-shell, .rp-main { background: var(--neutral-canvas); }
.rp-content { padding: var(--content-pad) 32px 60px; font-size: 13px; }

/* ═══ 3. TOP BAR, PAGE HEADER, BUTTONS, FIELDS ════════════════════════════ */

.rp-topbar { height: var(--topbar-h); padding: 0 20px; gap: 10px; background: var(--neutral-layer);
             border-bottom: 1px solid var(--stroke-2); }
.rp-crumbs { font-size: 13px; color: var(--fg-3); }
.rp-crumbs .sep { color: var(--stroke-1); }
.rp-crumbs .cur { color: var(--fg-1); font-weight: 500; }
.rp-topbar-meta { font-size: 12.5px; color: var(--fg-3); }
.rp-topbar-meta b { color: var(--fg-1); font-weight: 500; }
.rp-iconbtn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--fg-3); }
.rp-iconbtn:hover { background: var(--neutral-subtle-hover); color: var(--fg-1); }

.rp-page-head { margin-bottom: 20px; align-items: center; }
.rp-page-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.02em;
                 line-height: 1.2; color: var(--fg-1); }
.rp-page-sub { font-size: 13px; color: var(--fg-3); margin-top: 4px; }

/* Ink for the main action, a white outlined button for the rest. */
.rp-btn {
  min-height: 32px; padding: 0 12px; gap: 6px; border-radius: 7px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--stroke-1); background: var(--neutral-layer); color: var(--fg-1); box-shadow: var(--shadow-2);
}
.rp-btn:hover:not(:disabled) { background: var(--neutral-subtle-hover); border-color: var(--stroke-1); }
.rp-btn:active:not(:disabled) { background: var(--neutral-pressed); }
.rp-btn svg { width: 14px; height: 14px; }
.rp-btn-primary, .rp-btn-accent { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on); box-shadow: none; }
.rp-btn-primary:hover:not(:disabled), .rp-btn-accent:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-on); }
.rp-btn-primary:active:not(:disabled), .rp-btn-accent:active:not(:disabled) { background: var(--brand-pressed); }
.rp-btn-outline { background: var(--neutral-layer); border-color: var(--stroke-1); color: var(--fg-1); }
.rp-btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); box-shadow: none; }
.rp-btn-ghost:hover:not(:disabled) { background: var(--neutral-subtle-hover); border-color: transparent; color: var(--fg-1); }
.rp-btn-sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.rp-btn-lg { min-height: 38px; padding: 0 16px; font-size: 14px; }
.rp-btn:disabled { opacity: .45; }

.rp-input, .rp-select {
  height: 34px; padding: 0 12px; border: 1px solid var(--stroke-1); border-radius: 7px;
  background: var(--neutral-layer); color: var(--fg-1); font: 400 13px/1 var(--font);
}
.rp-input::placeholder { color: var(--fg-4); }
.rp-input:hover, .rp-select:hover { border-color: var(--ctl-stroke-hover); }
.rp-input:focus, .rp-select:focus {
  border-color: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 9%, transparent);
}
.rp-label, .rp-field > label { font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.rp-static { height: 34px; border-radius: 7px; background: var(--neutral-subtle); font-weight: 500; }

/* ═══ 4. CARDS, FIGURE TILES, FILTERS ═════════════════════════════════════ */

.rp-card { background: var(--neutral-layer); border: 1px solid var(--stroke-2); border-radius: 14px; box-shadow: none; }
.rp-card-head { padding: 16px 20px; border-bottom: 1px solid var(--stroke-2); }
.rp-card-title { font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: var(--fg-1); }
.rp-card-sub { font-size: 12.5px; color: var(--fg-4); }
.rp-card-body { padding: 20px; }
/* A card that is only a table loses its frame: the rows are drawn by hairlines. */
.rp-card:has(> .rp-table-wrap), .rp-card:has(> .rp-card-body > .rp-table-wrap:only-child) {
  border: 0; border-radius: 0; background: transparent;
}
.rp-card:has(> .rp-card-body > .rp-table-wrap:only-child) > .rp-card-body { padding: 0; }

/* A figure on a soft grey tile with generous corners. */
.rp-kpis { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.rp-kpi { background: var(--neutral-subtle); border: 0; border-radius: 20px; padding: 18px 20px; box-shadow: none; overflow: visible; }
.rp-kpi:hover { background: var(--neutral-subtle-hover); }
.rp-kpi::after { display: none; }
.rp-kpi-label { font-size: 13px; font-weight: 500; color: var(--fg-3); text-transform: none; letter-spacing: 0; }
.rp-kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 10px; color: var(--fg-1); }
.rp-kpi-hint { font-size: 12.5px; color: var(--fg-4); margin-top: 6px; }
/* The tone is a small marker beside the label, not a bar under the tile. */
.rp-kpi-label::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
                        background: var(--kc, var(--brand-primary)); vertical-align: 1px; }

/* Filters: a quiet row, not a framed panel. Selects become dashed pills. */
.rp-filters { padding: 0 0 16px; gap: 8px; background: transparent; border: 0; border-radius: 0; box-shadow: none; align-items: flex-end; }
.rp-filters .rp-select {
  -webkit-appearance: none; appearance: none; min-width: 0; padding: 0 28px 0 12px; border: 1px dashed var(--ctl-stroke-strong);
  border-radius: 999px; background-color: transparent; font-size: 12.5px; font-weight: 500; color: var(--fg-2); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7480' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
.rp-filters .rp-select:hover { border-color: var(--fg-3); background-color: var(--neutral-subtle); }
.rp-filters .rp-select:focus { border-style: solid; border-color: var(--brand-primary); box-shadow: none; }
.rp-filters .rp-input { border-radius: 999px; font-size: 12.5px; }
.rp-filters .rp-static { border-radius: 999px; }

/* ═══ 5. TABLES, STATUS, CHARTS ═══════════════════════════════════════════
   A quiet header in the page's own words, rows 48px tall divided by a hairline,
   a soft fill under the pointer. Status is coloured text with a glyph. */

.rp-table-wrap { overflow-x: auto; }
.rp-table { font-size: 13px; border-collapse: separate; border-spacing: 0; }
.rp-table thead th {
  background: var(--neutral-layer); padding: 10px 14px; font-size: 12.5px; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--fg-4); border-top: 1px solid var(--stroke-2); border-bottom: 1px solid var(--stroke-2);
}
.rp-table tbody td { padding: 0 14px; height: 48px; border-bottom: 1px solid var(--stroke-2); color: var(--fg-1); }
.rp-table tbody tr:last-child td { border-bottom: 1px solid var(--stroke-2); }
.rp-table tbody tr:hover, .rp-table tbody tr:hover td { background: var(--neutral-subtle); }
.rp-table tfoot td { padding: 0 14px; height: 48px; font-weight: 600; background: transparent;
                     border-top: 0; border-bottom: 1px solid var(--stroke-2); color: var(--fg-1); }

.rp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 0; background: transparent !important;
            border: 0; border-radius: 0; font-size: 13px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.rp-badge::before { width: auto; height: auto; border-radius: 0; background: transparent; opacity: 1;
                    content: "•"; font-size: 14px; line-height: 1; font-weight: 700; }
.b-success { color: var(--success-fg); }  .b-success::before { content: "✓"; font-size: 12px; }
.b-error   { color: var(--error-fg); }    .b-error::before   { content: "✕"; font-size: 11px; }
.b-warning { color: var(--warning-fg); }  .b-warning::before { content: "◔"; font-size: 13px; font-weight: 400; }
.b-info    { color: var(--info-fg); }     .b-info::before    { content: "↗"; font-size: 12px; }
.b-neutral { color: var(--fg-3); }        .b-neutral::before { content: "↩"; font-size: 12px; }
.b-primary { color: var(--accent); }

.rp-pos { color: var(--success-fg); }  .rp-neg { color: var(--error-fg); }

/* Charts: ink bars, no gradient. */
.rp-bar { background: var(--brand-primary); border-radius: 6px 6px 0 0; }
.rp-bar-val, .rp-bar-label { color: var(--fg-3); }
.rp-legend-item { color: var(--fg-2); }
.rp-legend-val { color: var(--fg-1); font-weight: 500; }

/* ═══ 6. REPORT LIBRARY, ALERTS, EMPTY STATES ═════════════════════════════ */

.rp-cat-title { font-size: 14px; font-weight: 600; color: var(--fg-1); }
.rp-cat-count { color: var(--fg-4); }
.rp-report-card { background: var(--neutral-layer); border: 1px solid var(--stroke-2); border-radius: 14px; box-shadow: none; padding: 16px; }
.rp-report-card:hover { transform: none; box-shadow: none; background: var(--neutral-subtle); border-color: var(--stroke-1); }
.rp-report-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-primary); color: var(--brand-on); }
.rp-report-ico svg { width: 18px; height: 18px; }
.rp-report-name { font-size: 13.5px; font-weight: 600; color: var(--fg-1); }
.rp-report-desc { color: var(--fg-3); }
.rp-report-tag { color: var(--fg-4); letter-spacing: .04em; }

.rp-alert { border-radius: 10px; }
.rp-alert-info    { background: var(--info-bg);    border-color: var(--info-br);    color: var(--info-fg); }
.rp-alert-warning { background: var(--warning-bg); border-color: var(--warning-br); color: var(--warning-fg); }
.rp-alert-error   { background: var(--error-bg);   border-color: var(--error-br);   color: var(--error-fg); }
.rp-alert-success { background: var(--success-bg); border-color: var(--success-br); color: var(--success-fg); }
.rp-empty-title { font-weight: 600; color: var(--fg-1); }
.rp-empty-text, .rp-loading { color: var(--fg-3); }
.rp-spinner.dark { border-color: var(--stroke-1); border-top-color: var(--brand-primary); }
.rp-splash { background: var(--mt-side-bg); }
.rp-spinner { border-top-color: #FFFFFF; }

/* ═══ 7. SIGN-IN ══════════════════════════════════════════════════════════ */

.rp-login { background: var(--neutral-subtle); }
.rp-login::before { display: none; }
.rp-login-card { border-radius: 20px; border: 0; box-shadow: var(--shadow-28); }
.rp-login-brand { background: var(--mt-side-bg); }
.rp-login-brand-title { font-weight: 600; letter-spacing: -.02em; }
.rp-login-brand-sub, .rp-login-brand-copy { color: var(--mt-side-fg); }
.rp-login-brand-rule { background: #FFFFFF; opacity: .6; }
.rp-login-title { font-weight: 600; letter-spacing: -.01em; color: var(--fg-1); }
.rp-login-sub { color: var(--fg-3); }
.rp-pw-toggle:hover:not(:disabled) { background: var(--neutral-subtle-hover); color: var(--fg-1); }
.rp-login input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; cursor: pointer; flex-shrink: 0;
  border: 1.5px solid var(--ctl-stroke-strong); border-radius: 4px; background-color: var(--neutral-layer);
}
.rp-login input[type="checkbox"]:checked {
  background-color: var(--brand-primary); border-color: var(--brand-primary); background-repeat: no-repeat;
  background-position: center; background-size: 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .rp-login input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B121A' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

/* Print: keep the page white whatever the theme. */
@media print {
  body, .rp-shell, .rp-main, .rp-content { background: #FFFFFF !important; color: #111111; }
  .rp-kpi { background: #F6F7F8; }
  .rp-card { border: 1px solid #cbd5e1; }
}

/* The spinner on a primary button takes the button's own text colour, so it shows
   on the ink button in light theme and on the pale one in dark. */
.rp-btn-primary .rp-spinner {
  border-color: color-mix(in srgb, var(--brand-on) 35%, transparent) !important;
  border-top-color: var(--brand-on) !important;
}
