/* =====================================================================
   Misc. Pro Business — Apple (macOS / iOS) design system
   One stylesheet for the whole app. Principles, in order of priority:
   response (instant press feedback) · clarity (type + spacing hierarchy) ·
   depth (translucent materials, hairline separators, soft shadows) ·
   deference (content first, chrome recedes) · restraint (no
   motion except charts). Honors prefers-reduced-motion,
   prefers-reduced-transparency and prefers-contrast. Light, Dark and Auto.
   The Fund Balance card (fund-balance-card.css) and the invoice voucher
   (invoice-document.css) are documents and keep their own look.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;
  --font: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg: #f2f2f7; /* grouped background */
  --surface: #ffffff; /* cards, sheets */
  --surface-2: #f7f7fa; /* inset areas, table heads */
  --material: rgba(255, 255, 255, .72);
  --material-thick: rgba(255, 255, 255, .88);
  --sidebar-bg: rgba(244, 244, 247, .78);
  --scrim: rgba(0, 0, 0, .32);

  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, .66);
  --label-3: rgba(60, 60, 67, .44);
  --hair: rgba(60, 60, 67, .14);
  --hair-strong: rgba(60, 60, 67, .30);
  --fill: rgba(120, 120, 128, .11);
  --fill-2: rgba(120, 120, 128, .18);
  --fill-3: rgba(120, 120, 128, .26);

  --accent: #007aff;
  --accent-2: #0066d6;
  --accent-tint: rgba(0, 122, 255, .12);
  --green: #34c759; --green-ink: #1c7c37; --green-tint: rgba(52, 199, 89, .16);
  --orange: #ff9500; --orange-ink: #9a5600; --orange-tint: rgba(255, 149, 0, .16);
  --red: #ff3b30; --red-ink: #c62018; --red-tint: rgba(255, 59, 48, .13);
  --indigo: #5856d6; --purple: #af52de; --teal: #30b0c7; --pink: #ff2d55;

  --shadow-1: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .03);
  --shadow-2: 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
  --shadow-3: 0 0 0 .5px rgba(0, 0, 0, .10), 0 28px 70px rgba(0, 0, 0, .28), 0 8px 20px rgba(0, 0, 0, .12);

  --r-1: 8px; --r-2: 12px; --r-3: 16px; --r-4: 22px;
  --ease: cubic-bezier(.32, .72, 0, 1); /* iOS standard curve */
  --ease-soft: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 268px;
  --toolbar-h: 52px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Bootstrap bridge */
  --bs-body-font-family: var(--font);
  --bs-font-sans-serif: var(--font);
  --bs-font-monospace: var(--font);
  --bs-body-font-size: .875rem;
  --bs-body-color: var(--label);
  --bs-body-color-rgb: 29, 29, 31;
  --bs-body-bg: var(--bg);
  --bs-emphasis-color: var(--label);
  --bs-heading-color: var(--label);
  --bs-secondary-color: var(--label-2);
  --bs-tertiary-color: var(--label-3);
  --bs-border-color: var(--hair);
  --bs-border-color-translucent: var(--hair);
  --bs-border-radius: var(--r-1);
  --bs-primary: var(--accent); --bs-primary-rgb: 0, 122, 255;
  --bs-success: var(--green-ink); --bs-success-rgb: 28, 124, 55;
  --bs-danger: var(--red-ink); --bs-danger-rgb: 198, 32, 24;
  --bs-warning: var(--orange-ink); --bs-warning-rgb: 154, 86, 0;
  --bs-info: var(--teal); --bs-info-rgb: 48, 176, 199;
  --bs-link-color: var(--accent); --bs-link-color-rgb: 0, 122, 255;
  --bs-link-hover-color: var(--accent-2); --bs-link-hover-color-rgb: 0, 102, 214;
  --bs-focus-ring-color: rgba(0, 122, 255, .3);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #232326;
  --material: rgba(30, 30, 33, .72);
  --material-thick: rgba(38, 38, 42, .88);
  --sidebar-bg: rgba(28, 28, 31, .78);
  --scrim: rgba(0, 0, 0, .56);
  --label: #f5f5f7;
  --label-2: rgba(235, 235, 245, .64);
  --label-3: rgba(235, 235, 245, .38);
  --hair: rgba(84, 84, 88, .55);
  --hair-strong: rgba(120, 120, 128, .55);
  --fill: rgba(120, 120, 128, .20);
  --fill-2: rgba(120, 120, 128, .30);
  --fill-3: rgba(120, 120, 128, .40);
  --accent: #0a84ff; --accent-2: #3d9bff; --accent-tint: rgba(10, 132, 255, .20);
  --green: #30d158; --green-ink: #4cd964; --green-tint: rgba(48, 209, 88, .20);
  --orange: #ff9f0a; --orange-ink: #ffb340; --orange-tint: rgba(255, 159, 10, .20);
  --red: #ff453a; --red-ink: #ff6961; --red-tint: rgba(255, 69, 58, .20);
  --indigo: #5e5ce6; --purple: #bf5af2; --teal: #40c8e0; --pink: #ff375f;
  --shadow-1: 0 0 0 .5px rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 0 0 .5px rgba(255, 255, 255, .10), 0 10px 30px rgba(0, 0, 0, .6);
  --shadow-3: 0 0 0 .5px rgba(255, 255, 255, .14), 0 30px 80px rgba(0, 0, 0, .8);
  --bs-body-color-rgb: 245, 245, 247;
  --bs-primary-rgb: 10, 132, 255; --bs-success-rgb: 76, 217, 100; --bs-danger-rgb: 255, 105, 97; --bs-warning-rgb: 255, 179, 64;
  --bs-link-color-rgb: 10, 132, 255; --bs-link-hover-color-rgb: 61, 155, 255;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--toolbar-h) + var(--safe-t) + 12px); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 14px; line-height: 1.45; letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Motion policy: nothing animates except charts. Chart.js animates itself on <canvas> (JS, unaffected by this rule) and the
   KPI sparklines opt back in with !important (see "kpi-spark" below). This also neutralises Bootstrap's own transitions,
   fades, collapses and spinners loaded from the CDN. */
*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4, h5, h6 { color: var(--label); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h5, .h5 { font-size: 1.0625rem; } h6, .h6 { font-size: .9375rem; }
small, .small { font-size: .8125rem; letter-spacing: 0; }
.text-muted, .form-text { color: var(--label-2) !important; }
.form-text { font-size: .78rem; margin-top: .3rem; }
code { font-family: inherit; font-size: .85em; color: var(--label); background: var(--fill); border-radius: 5px; padding: .1em .4em; }
hr { border-color: var(--hair); opacity: 1; }
::selection { background: rgba(0, 122, 255, .25); }
.fw-bold, b, strong { font-weight: 600 !important; }
.fw-semibold { font-weight: 600 !important; }
:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0, 122, 255, .32); border-radius: 6px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 3000; background: var(--accent); color: #fff; padding: .55rem 1rem; border-radius: var(--r-1); font-weight: 600; }
.skip-link:focus { top: calc(10px + var(--safe-t)); color: #fff; text-decoration: none; }
.container-fluid { --bs-gutter-x: 0; }

/* ---------- 3. App shell: sidebar (source list) · toolbar · content ---------- */
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040; width: var(--sidebar-w); display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-t)) 12px calc(12px + var(--safe-b));
  background: var(--sidebar-bg); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border-right: .5px solid var(--hair);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; }
.sidebar-brand-icon { width: 36px; height: 36px; flex: none; border-radius: 8.5px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .18); background: #fff; }
.sidebar-brand-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar-brand-name { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.sidebar-brand-tagline { font-size: .72rem; color: var(--label-2); letter-spacing: 0; line-height: 1.3; margin-top: 1px; }
.sidebar-cta { margin: 0 4px 12px; height: 36px; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.sidebar-section-label { font-size: .72rem; font-weight: 600; color: var(--label-2); letter-spacing: .01em; padding: 12px 10px 5px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: default; }
details.sidebar-group > summary { cursor: pointer; border-radius: 6px; }
details.sidebar-group > summary::-webkit-details-marker { display: none; }
details.sidebar-group > summary .bi { font-size: .7rem; }
details.sidebar-group:not([open]) > summary .bi { transform: rotate(-90deg); }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 10px; margin: 1px 0; border-radius: 8px;
  color: var(--label); font-size: .875rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none !important;
   -webkit-tap-highlight-color: transparent;
}
.sidebar-link:hover { background: var(--fill); color: var(--label); }
.sidebar-link:active { background: var(--fill-2); }
.sidebar-link .nav-ico { width: 22px; display: inline-flex; justify-content: center; font-size: 1.05rem; color: var(--accent); }
.sidebar-link.active { background: var(--accent); color: #fff; }
.sidebar-link.active .nav-ico { color: #fff; }
.sidebar-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.sidebar-footer { border-top: .5px solid var(--hair); padding-top: 12px; margin-top: 8px; display: grid; gap: 10px; }
.sidebar-footer-row { display: flex; gap: 8px; align-items: center; }
.sidebar-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--label); text-decoration: none !important; }
.sidebar-user:hover { background: var(--fill); color: var(--label); }
.sidebar-user > div { min-width: 0; }
.sidebar-user-name { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-mail { font-size: .72rem; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-signout { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--label-2); font-size: 1.05rem; text-decoration: none !important; }
.sidebar-signout:hover { background: var(--fill); color: var(--red-ink); }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #8e8e93, #636366); color: #fff; font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; background: var(--scrim); opacity: 0; visibility: hidden; }
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

.app-content-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
html.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
html.sidebar-collapsed .app-content-wrap { margin-left: 0; }
body.auth-body .app-content-wrap { margin-left: 0; }

.app-topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 10px; min-height: calc(var(--toolbar-h) + var(--safe-t));
  padding: var(--safe-t) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-bottom: .5px solid transparent;
}
html.title-collapsed .app-topbar { border-bottom-color: var(--hair); }
.topbar-toggle { width: 34px; height: 34px; flex: none; border: 0; background: transparent; border-radius: 8px; color: var(--label-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.topbar-toggle:hover { background: var(--fill); color: var(--label); }
.topbar-toggle:active { background: var(--fill-2); }
.topbar-heading { flex: 1 1 auto; min-width: 0; opacity: 0; transform: translateY(4px); pointer-events: none; }
html.title-collapsed .topbar-heading { opacity: 1; transform: none; }
.topbar-title { font-size: .95rem; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.topbar-subtitle { font-size: .72rem; color: var(--label-2); letter-spacing: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-search { position: relative; flex: 0 1 260px; margin: 0; }
.global-search .bi-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--label-2); pointer-events: none; }
.global-search input { width: 100%; height: 32px; padding: 0 30px 0 30px; border: 0; border-radius: 9px; background: var(--fill); color: var(--label); font: inherit; font-size: .84rem; letter-spacing: 0; }
.global-search input::placeholder { color: var(--label-2); }
.global-search input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 4px rgba(0, 122, 255, .3), 0 0 0 1px var(--accent) inset; }
.global-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--font); font-size: .68rem; padding: 0 5px; line-height: 17px; border-radius: 5px; background: var(--fill-2); color: var(--label-2); }
.header-widget { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; height: 32px; border-radius: 9px; background: var(--fill); font-size: .78rem; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.header-widget #hwClock { color: var(--label); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.btn-quick-add { height: 32px; display: inline-flex; align-items: center; gap: .35rem; padding: 0 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: .84rem; font-weight: 500; }
.btn-quick-add:hover { background: var(--accent-2); color: #fff; }
.btn-quick-add.dropdown-toggle::after { display: none; }
.topbar-bell { position: relative; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--label-2); font-size: 1.05rem; text-decoration: none !important; }
.topbar-bell:hover { background: var(--fill); color: var(--label); }
.topbar-bell .count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.topbar-avatar-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 4px; border: 0; border-radius: 17px; background: transparent; color: var(--label); font-size: .84rem; font-weight: 500; }
.topbar-avatar-btn:hover { background: var(--fill); }
.topbar-avatar-btn .name { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-avatar-btn.dropdown-toggle::after { display: none; }

.app-scroll { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }
.app-main { flex: 1 0 auto; width: 100%; max-width: none; margin: 0; padding: 6px max(24px, env(safe-area-inset-right)) 28px max(24px, env(safe-area-inset-left)); min-width: 0; }

/* Desktop: pages stretch to the full screen width */
@media (min-width: 1200px) { .app-main { padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); } }
.app-main > .alert { margin-top: .75rem; }
.app-footer { padding: 14px max(24px, env(safe-area-inset-left)) calc(18px + var(--safe-b)); text-align: center; color: var(--label-2); font-size: .74rem; overflow-wrap: anywhere; }
.app-footer .small { font-size: .74rem; line-height: 1.7; }
.app-footer strong { color: var(--label); font-weight: 600 !important; }
.app-footer a { color: var(--label-2); }
.app-footer .dev-footer { margin-top: 2px; }

/* ---------- 4. Page heading (large title) ---------- */
.page-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 14px 0 18px; }
.page-heading .dot { display: none; }
.page-heading h4 { margin: 0; font-size: 1.85rem; font-weight: 700; letter-spacing: -.028em; line-height: 1.1; flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.page-heading > .d-flex { min-width: 0; }
.page-heading > .ms-auto, .page-heading > .d-flex.ms-auto { margin-left: auto !important; }

/* ---------- 5. Cards (grouped inset) ---------- */
.card { --bs-card-bg: var(--surface); --bs-card-border-color: transparent; --bs-card-cap-bg: transparent; background: var(--surface); border: 0; border-radius: var(--r-2); box-shadow: var(--shadow-1); color: var(--label); min-width: 0; overflow: visible; }
.card-body { padding: 1.1rem 1.15rem; min-width: 0; }
.card-header { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .85rem 1.15rem; background: transparent; border-bottom: .5px solid var(--hair); font-size: .9375rem; font-weight: 600; letter-spacing: -.012em; color: var(--label); }
.card-header:first-child { border-radius: var(--r-2) var(--r-2) 0 0; }
.card-footer { background: transparent; border-top: .5px solid var(--hair); padding: .7rem 1.15rem; border-radius: 0 0 var(--r-2) var(--r-2); }
.card > .table-responsive:last-child, .card-body.p-0 > .table-responsive:last-child { border-radius: 0 0 var(--r-2) var(--r-2); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--hair); --bs-list-group-color: var(--label); }
.list-group-item { background: transparent; border-color: var(--hair); padding: .75rem 1.15rem; }
.list-group-flush > .list-group-item { border-width: 0 0 .5px; }
.list-group-flush > .list-group-item:last-child { border-bottom: 0; }

/* KPI tiles (Health / Widgets style) */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.dash-kpi { min-width: 0; }
.kpi-card { container-type: inline-size; height: 100%; }
.kpi-card .card-body { padding: 1rem 1.1rem 1.05rem; display: flex; flex-direction: column; gap: 2px; }
.kpi-ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; color: #fff; margin-bottom: .7rem; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12); }
.kpi-green .kpi-ico { background: linear-gradient(180deg, #4cd964, #2fb350); }
.kpi-blue .kpi-ico { background: linear-gradient(180deg, #2f9bff, #0a6fe0); }
.kpi-orange .kpi-ico { background: linear-gradient(180deg, #ffad33, #f08400); }
.kpi-violet .kpi-ico { background: linear-gradient(180deg, #bf6ef0, #8e44d4); }
.kpi-label { font-size: .8rem; font-weight: 500; color: var(--label-2); letter-spacing: 0; }
.kpi-value { font-size: clamp(1.05rem, 5.8cqi, 1.5rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--label); }
.kpi-sub { font-size: .74rem; color: var(--label-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* KPI mini-graphs: number on the left, colourful graph on the right, always inside the card.
   Colour comes from --kc (set per card, redefined for dark mode). */
.kpi-green { --kc: #2fb350; --kg: rgba(47, 179, 80, 0); --ka: .30; }
.kpi-blue { --kc: #0a6fe0; --kg: rgba(10, 111, 224, 0); --ka: .28; }
.kpi-orange { --kc: #f08400; --kg: rgba(240, 132, 0, 0); --ka: .30; }
.kpi-violet { --kc: #8e44d4; --kg: rgba(142, 68, 212, 0); --ka: .28; }
[data-theme="dark"] .kpi-green { --kc: #4cd964; --kg: rgba(76, 217, 100, .50); --ka: .42; }
[data-theme="dark"] .kpi-blue { --kc: #3d9bff; --kg: rgba(61, 155, 255, .50); --ka: .42; }
[data-theme="dark"] .kpi-orange { --kc: #ffad33; --kg: rgba(255, 173, 51, .50); --ka: .42; }
[data-theme="dark"] .kpi-violet { --kc: #bf6ef0; --kg: rgba(191, 110, 240, .50); --ka: .42; }

.kpi-card .card-body { flex: 1 1 auto; }
.kpi-row { display: flex; align-items: flex-end; gap: 10px; min-width: 0; margin-top: auto; }
.kpi-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kpi-spark { flex: 0 0 36%; max-width: 132px; min-width: 64px; height: 46px; overflow: hidden; color: var(--kc); }
.kpi-spark-svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.kpi-spark-svg stop:first-child { stop-opacity: var(--ka, .3); }
.kpi-spark-line { fill: none; stroke: var(--kc); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 4px var(--kg)); }
.kpi-spark-empty { stroke: var(--hair-strong); stroke-width: 1.5; stroke-dasharray: 3 4; stroke-linecap: round; }
.kpi-spark-bars { display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; }
.kpi-spark-bars > span { flex: 1 1 0; max-width: 18px; min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--kc), color-mix(in srgb, var(--kc) 62%, transparent)); box-shadow: 0 2px 8px var(--kg); transform-origin: bottom; }
.kpi-spark-empty-bar { flex: 1 1 auto; height: 0; border-top: 1.5px dashed var(--hair-strong); align-self: flex-end; margin-bottom: 8px; }

/* Narrow cards (phones / 2-up grid): graph drops below the number at full card width */
@container (max-width: 270px) {
  .kpi-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .kpi-spark { flex: 0 0 auto; width: 100%; max-width: none; height: 38px; }
  .kpi-value { font-size: clamp(1.05rem, 8cqi, 1.4rem); }
}

@keyframes sparkReveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes sparkGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.kpi-spark-line-wrap { animation: sparkReveal 1s var(--ease) .45s backwards !important; }
.kpi-spark-bars > span { animation: sparkGrow .7s var(--ease) backwards !important; animation-delay: calc(.4s + var(--i, 0) * .07s) !important; }
@media (prefers-reduced-motion: reduce) { .kpi-spark-line-wrap, .kpi-spark-bars > span { animation: none !important; } }
html.is-exporting .kpi-spark-line-wrap, html.is-exporting .kpi-spark-bars > span { animation: none !important; }
@media print { .kpi-spark, .kpi-spark-bars > span, .kpi-spark-svg * { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; } }

/* ---------- 6. Tables (lists) ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--label); --bs-table-border-color: var(--hair); --bs-table-hover-bg: var(--fill); --bs-table-hover-color: var(--label); --bs-table-striped-bg: var(--surface-2); margin: 0; font-size: .8125rem; letter-spacing: 0; }
.table > :not(caption) > * > * { padding: .72rem .9rem; border-bottom-width: .5px; border-color: var(--hair); background-color: transparent; box-shadow: none; }
.table thead th { font-size: .74rem; font-weight: 600; color: var(--label-2); background: var(--surface-2); white-space: nowrap; border-bottom: .5px solid var(--hair); letter-spacing: .005em; vertical-align: middle; }
.table tbody tr:last-child > * { border-bottom-width: 0; }
.table-hover > tbody > tr:hover > * { background-color: var(--fill); }
.table tfoot th, .table tfoot td { background: var(--surface-2); font-weight: 600; border-top: .5px solid var(--hair); border-bottom: 0; }
.table-sm > :not(caption) > * > * { padding: .45rem .6rem; }
.table-bordered > :not(caption) > * > * { border-width: .5px; }
.table-borderless > :not(caption) > * > * { border-width: 0; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.amount-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.table td a.fw-bold { font-weight: 600 !important; font-variant-numeric: tabular-nums; }
.dashboard-link-row { cursor: pointer; }
.sort-link { color: inherit; text-decoration: none !important; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.sort-link:hover { color: var(--label); }
.drag-handle { cursor: grab; width: 32px; color: var(--label-3); }
.sortable-ghost { opacity: .35; }
.rank-col { width: 44px; }
.rank-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--fill); color: var(--label-2); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-pill.rank-top { background: var(--orange-tint); color: var(--orange-ink); }
.share-tag { display: inline-block; font-size: .74rem; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.share-bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.share-bar > i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.delta { font-size: .76rem; font-weight: 600; white-space: nowrap; }
.delta-up { color: var(--green-ink); } .delta-down { color: var(--red-ink); }

/* Badges: tinted capsules */
.badge { font-size: .72rem; font-weight: 600; letter-spacing: 0; padding: .28em .7em; border-radius: 999px; line-height: 1.25; }
.badge.text-bg-success { background: var(--green-tint) !important; color: var(--green-ink) !important; }
.badge.text-bg-danger { background: var(--red-tint) !important; color: var(--red-ink) !important; }
.badge.text-bg-secondary { background: var(--fill-2) !important; color: var(--label-2) !important; }
.badge.text-bg-primary { background: var(--accent-tint) !important; color: var(--accent) !important; }
.badge.text-bg-warning { background: var(--orange-tint) !important; color: var(--orange-ink) !important; }
.badge.text-bg-info { background: rgba(48, 176, 199, .16) !important; color: #1b7a8c !important; }
[data-theme="dark"] .badge.text-bg-info { color: #5ad1e6 !important; }

/* ---------- 7. Buttons ---------- */
.btn { --bs-btn-border-radius: 8px; --bs-btn-focus-box-shadow: 0 0 0 4px rgba(0, 122, 255, .32); display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 34px; padding: .3rem .95rem; font-size: .84rem; font-weight: 500; letter-spacing: -.005em; line-height: 1.25; border: 0; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.btn:disabled, .btn.disabled { opacity: .45; }
.btn-sm { min-height: 30px; padding: .2rem .75rem; font-size: .8125rem; border-radius: 7px; }
.btn-lg { min-height: 46px; padding: .55rem 1.2rem; font-size: 1rem; border-radius: 12px; }
.btn-primary, .btn-brand, .btn-dark-ink { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; background: var(--accent); color: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.btn-primary:hover, .btn-brand:hover, .btn-dark-ink:hover { background: var(--accent-2); color: #fff; }
.btn-primary:active, .btn-brand:active, .btn-dark-ink:active { background: var(--accent-2) !important; color: #fff !important; }
.btn-dark-ink.w-100 { min-height: 46px; font-size: 1rem; font-weight: 600; border-radius: 12px; }
.btn-secondary, .btn-outline-secondary, .btn-outline-dark, .btn-light { background: var(--fill); color: var(--label); }
.btn-secondary:hover, .btn-outline-secondary:hover, .btn-outline-dark:hover, .btn-light:hover { background: var(--fill-2); color: var(--label); }
.btn-secondary:active, .btn-outline-secondary:active, .btn-outline-dark:active { background: var(--fill-3) !important; color: var(--label) !important; }
.btn-outline-primary { background: var(--accent-tint); color: var(--accent); }
.btn-outline-primary:hover { background: rgba(0, 122, 255, .2); color: var(--accent); }
.btn-outline-primary:active { background: rgba(0, 122, 255, .28) !important; color: var(--accent) !important; }
.btn-outline-danger, .btn-danger { background: var(--red-tint); color: var(--red-ink); }
.btn-outline-danger:hover, .btn-danger:hover { background: rgba(255, 59, 48, .22); color: var(--red-ink); }
.btn-outline-danger:active { background: rgba(255, 59, 48, .3) !important; color: var(--red-ink) !important; }
.btn-danger.btn-solid, .btn-destructive { background: var(--red); color: #fff; }
.btn-outline-success { background: var(--green-tint); color: var(--green-ink); }
.btn-outline-success:hover { background: rgba(52, 199, 89, .26); color: var(--green-ink); }
.btn-outline-success:active { background: rgba(52, 199, 89, .34) !important; color: var(--green-ink) !important; }
.btn-outline-info { background: rgba(48, 176, 199, .16); color: #1b7a8c; }
.btn-outline-info:hover { background: rgba(48, 176, 199, .26); color: #1b7a8c; }
.btn-outline-info:active { background: rgba(48, 176, 199, .34) !important; color: #1b7a8c !important; }
[data-theme="dark"] .btn-outline-info, [data-theme="dark"] .btn-outline-info:hover { color: #5ad1e6; }
.btn-link { color: var(--accent); background: transparent; padding-left: .3rem; padding-right: .3rem; text-decoration: none; }
.btn-link:hover { color: var(--accent-2); background: transparent; text-decoration: underline; }
.btn-pill { border-radius: 999px; }
.btn-close { opacity: .55; filter: none; width: 28px; height: 28px; padding: 0; border-radius: 50%; background-color: var(--fill-2); background-size: 10px; }
.btn-close:hover { opacity: .9; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.btn .bi { line-height: 1; }
.btn-sm.remove-line-btn { width: 34px; padding: 0; }

/* ---------- 8. Forms ---------- */
.form-label { font-size: .8125rem; font-weight: 500; color: var(--label-2); margin-bottom: .35rem; letter-spacing: 0; }
.required-mark { color: var(--red); margin-left: 1px; }
.form-control, .form-select { --bs-border-color: var(--hair-strong); min-height: 36px; padding: .4rem .75rem; font-size: .875rem; letter-spacing: -.006em; color: var(--label); background-color: var(--surface); border: 1px solid var(--hair-strong); border-radius: 9px; box-shadow: none; }
.form-control::placeholder { color: var(--label-3); }
.form-control:focus, .form-select:focus { color: var(--label); background-color: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 122, 255, .28); outline: none; }
.form-control-sm, .form-select-sm { min-height: 32px; padding: .25rem .65rem; font-size: .8125rem; border-radius: 8px; }
.form-select { padding-right: 2.2rem; }
textarea.form-control { min-height: 72px; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--red); background-image: none; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(255, 59, 48, .25); }
.form-control:disabled, .form-select:disabled, .form-control[readonly], .readonly-field { background-color: var(--fill); color: var(--label-2); border-color: transparent; }
.form-control[type="file"] { padding: .3rem .5rem; line-height: 1.9; }
.form-control[type="file"]::file-selector-button { border: 0; border-radius: 6px; background: var(--fill-2); color: var(--label); padding: .25rem .7rem; margin-right: .7rem; font: inherit; font-size: .8rem; font-weight: 500; }
.form-control[type="date"], .form-control[type="datetime-local"] { min-width: 0; }
div.readonly-field { display: block; min-height: 36px; padding: .45rem .75rem; border-radius: 9px; overflow-wrap: anywhere; }
.input-group > .form-control { border-radius: 9px; }
#grandTotalDisplay { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.amount-line-input { text-align: right; font-variant-numeric: tabular-nums; }
#inWordsDisplay { min-height: 44px; font-weight: 500; color: var(--label); }

/* Checkbox / radio / iOS switch */
.form-check-input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; background-color: var(--surface); border: 1.5px solid var(--hair-strong); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(0, 122, 255, .3); border-color: var(--accent); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input[type="checkbox"] { border-radius: 6px; }
.form-check-label { font-size: .875rem; color: var(--label); }
.form-switch { padding-left: 3.4rem; min-height: 1.75rem; display: flex; align-items: center; }
.form-switch .form-check-input { width: 2.8rem; height: 1.7rem; margin-left: -3.4rem; margin-top: 0; border: 0; border-radius: 1rem; background-color: var(--fill-3); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3.2' fill='%23fff'/%3e%3c/svg%3e"); background-position: left center; background-size: 1.5rem 1.5rem; }
.form-switch .form-check-input:checked { background-color: var(--green); background-position: right center; border: 0; }
.form-switch .form-check-input:not(:checked) { background-position: left center; }
.form-switch .form-check-input:active { background-size: 1.75rem 1.5rem; }
.form-switch .form-check-label { margin-left: .1rem; }
.form-switch.switch-sm { padding-left: 2.9rem; } .form-switch.switch-sm .form-check-input { width: 2.3rem; height: 1.4rem; margin-left: -2.9rem; background-size: 1.2rem 1.2rem; }
.field-eye { position: relative; }
.field-eye .form-control { padding-right: 2.6rem; }
.eye-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: transparent; color: var(--label-2); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.eye-btn:hover { color: var(--label); background: var(--fill); }

/* Segmented control (theme switch, Master Data tabs) */
.seg, .pill-tabs { display: inline-flex; align-items: stretch; gap: 2px; padding: 2px; background: var(--fill); border-radius: 9px; max-width: 100%; }
.seg button, .pill-tab { appearance: none; border: 0; background: transparent; color: var(--label); font: inherit; font-size: .8125rem; font-weight: 500; letter-spacing: -.005em; padding: .3rem .85rem; border-radius: 7px; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; cursor: pointer; }
.seg button:hover:not([aria-pressed="true"]), .pill-tab:hover:not(.active) { background: var(--fill); color: var(--label); }
.seg button[aria-pressed="true"], .pill-tab.active { background: var(--surface); color: var(--label); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .08); }
[data-theme="dark"] .seg button[aria-pressed="true"], [data-theme="dark"] .pill-tab.active { background: #636366; color: #fff; }
.pill-tabs { margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.pill-tabs::-webkit-scrollbar { display: none; }
.sidebar-theme { width: 100%; display: flex; }
.sidebar-theme button { flex: 1; padding: .28rem .3rem; font-size: .76rem; }
.sidebar-footer .seg { background: var(--fill); }

/* ---------- 9. Alerts, dropdowns, modals, pagination, toast, HUD ---------- */
.alert { --bs-alert-border-color: transparent; border: 0; border-radius: var(--r-2); padding: .8rem 1rem; font-size: .875rem; display: flex; align-items: flex-start; gap: .6rem; color: var(--label); }
.alert > ul { margin: 0; padding-left: 1.1rem; }
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close { position: absolute; right: .7rem; top: .6rem; }
.alert-success { background: var(--green-tint); color: var(--green-ink); }
.alert-danger { background: var(--red-tint); color: var(--red-ink); }
.alert-warning { background: var(--orange-tint); color: var(--orange-ink); }
.alert-info { background: var(--accent-tint); color: var(--accent); }
[data-theme="dark"] .alert-info { color: #6cb2ff; }
.alert-info.small { color: var(--label-2); background: var(--fill); }
.dropdown-menu { --bs-dropdown-bg: var(--material-thick); --bs-dropdown-border-color: var(--hair); --bs-dropdown-link-hover-bg: var(--accent); --bs-dropdown-link-hover-color: #fff; --bs-dropdown-link-active-bg: var(--accent); --bs-dropdown-link-color: var(--label); padding: 5px; border-radius: 11px; border: .5px solid var(--hair); box-shadow: var(--shadow-2); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px); font-size: .84rem; min-width: 12rem; max-width: calc(100vw - 1rem); transform-origin: top right; }

.dropdown-item { display: flex; align-items: center; gap: .55rem; padding: .4rem .65rem; border-radius: 6px; color: var(--label); font-weight: 450; }
.dropdown-item .bi { color: var(--label-2); width: 1.1em; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--accent); color: #fff; text-decoration: none; }
.dropdown-item:hover .bi, .dropdown-item:focus .bi { color: #fff; }
.dropdown-header { font-size: .78rem; font-weight: 600; color: var(--label); padding: .4rem .65rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dropdown-divider { border-color: var(--hair); margin: 5px 0; opacity: 1; }
.account-menu .seg { display: flex; width: 100%; margin-bottom: 4px; }
.account-menu .seg button { flex: 1; }

.modal-backdrop { --bs-backdrop-bg: #000; --bs-backdrop-opacity: .34; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-content { background: var(--material-thick); -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px); border: .5px solid var(--hair); border-radius: var(--r-3); box-shadow: var(--shadow-3); color: var(--label); }
.modal-header { border-bottom: 0; padding: 1.1rem 1.25rem .4rem; }
.modal-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; }
.modal-body { padding: .7rem 1.25rem 1rem; }
.modal-footer { border-top: 0; padding: .4rem 1.25rem 1.1rem; gap: .5rem; }
.modal-footer .btn { flex: 1; min-height: 38px; }
.modal-footer > * { margin: 0; }
.modal-dialog-sheet { max-width: 340px; }
.confirm-sheet .modal-body { text-align: center; padding-top: 1.4rem; }
.confirm-sheet .confirm-icon { width: 46px; height: 46px; margin: 0 auto .7rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: var(--red-tint); color: var(--red-ink); }
.confirm-sheet h6 { font-size: 1.0625rem; margin: 0 0 .3rem; }
.confirm-sheet p { margin: 0; color: var(--label-2); font-size: .84rem; }
.confirm-sheet .modal-footer { flex-direction: column-reverse; padding-top: .2rem; }
.confirm-sheet .modal-footer .btn { width: 100%; flex: none; min-height: 42px; font-size: .95rem; }

.pagination { --bs-pagination-bg: transparent; --bs-pagination-border-width: 0; --bs-pagination-color: var(--accent); --bs-pagination-hover-bg: var(--fill); --bs-pagination-hover-color: var(--accent); --bs-pagination-active-bg: var(--accent); --bs-pagination-active-color: #fff; --bs-pagination-focus-bg: var(--fill); --bs-pagination-focus-box-shadow: 0 0 0 4px rgba(0, 122, 255, .3); --bs-pagination-disabled-bg: transparent; --bs-pagination-disabled-color: var(--label-3); gap: 3px; }
.page-link { border: 0; border-radius: 8px !important; min-width: 32px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; font-size: .8125rem; }
.page-item.active .page-link { box-shadow: 0 1px 2px rgba(0, 122, 255, .35); }
.page-item.disabled .page-link { background: transparent; }

.ap-toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 2100; transform: translate(-50%, 16px) scale(.96); opacity: 0; pointer-events: none; padding: .6rem 1.1rem; border-radius: 999px; background: var(--material-thick); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-2); font-size: .84rem; font-weight: 500; }
.ap-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.loading-overlay { position: fixed; inset: 0; z-index: 2200; display: none; align-items: center; justify-content: center; flex-direction: column; background: rgba(0, 0, 0, .12); }
.loading-overlay.show { display: flex; }
.loading-overlay::before { content: ""; width: 128px; height: 112px; border-radius: 18px; background: rgba(40, 40, 44, .82); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: var(--shadow-3); position: absolute; }
.loading-overlay .spinner-border { position: relative; width: 2rem; height: 2rem; border-width: .2rem; color: #fff !important; margin-bottom: 1.6rem !important; }
.loading-overlay .loading-text { position: relative; color: #fff; font-size: .78rem; font-weight: 500; margin-top: -.6rem; margin-bottom: -2.4rem; max-width: 118px; text-align: center; }

.export-preview { position: fixed; inset: 0; z-index: 2150; display: flex; flex-direction: column; align-items: center; background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.export-preview .bar { flex: none; display: flex; gap: 10px; justify-content: center; padding: calc(14px + var(--safe-t)) 14px 12px; width: 100%; }
.export-preview .bar a, .export-preview .bar button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 1.1rem; border: 0; border-radius: 999px; font: 600 .84rem/1 var(--font); text-decoration: none; cursor: pointer; }
.export-preview .bar a { background: var(--accent); color: #fff; }
.export-preview .bar button { background: rgba(255, 255, 255, .92); color: #1d1d1f; }
.export-preview .box { flex: 1 1 auto; min-height: 0; width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 20px; text-align: center; }
.export-preview img { max-width: 100%; height: auto; background: #fff; border-radius: 10px; box-shadow: var(--shadow-3); }

/* Select2 (searchable dropdowns) */
.select2-container { max-width: 100%; font-family: var(--font); }
.select2-container .select2-selection--single { height: 36px; border: 1px solid var(--hair-strong); border-radius: 9px; background: var(--surface); display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--label); line-height: 1.2; padding-left: .75rem; padding-right: 2.2rem; font-size: .875rem; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--label-3); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; right: 8px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--label-2) transparent transparent; }
.select2-container--default .select2-selection--single .select2-selection__clear { color: var(--label-2); margin-right: 4px; font-size: 1.1rem; }
.select2-container--default.select2-container--focus .select2-selection--single, .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 122, 255, .28); }
.select2-dropdown { background: var(--material-thick); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px); border: .5px solid var(--hair); border-radius: 11px; box-shadow: var(--shadow-2); overflow: hidden; margin-top: 4px; z-index: 1100; }
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 0; border-radius: 8px; background: var(--fill); color: var(--label); padding: .4rem .65rem; font: inherit; font-size: .84rem; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .3); }
.select2-results__options { padding: 0 5px 5px; max-height: 260px; }
.select2-container--default .select2-results__option { border-radius: 6px; padding: .4rem .65rem; font-size: .84rem; color: var(--label); }
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--accent); color: #fff; }
.select2-container--default .select2-results__option--selected, .select2-container--default .select2-results__option[aria-selected="true"] { background: var(--fill); color: var(--label); font-weight: 600; }
.select2-container--default .select2-results__option--selected.select2-results__option--highlighted { background: var(--accent); color: #fff; }
.is-invalid + .select2-container .select2-selection--single { border-color: var(--red); }

/* ---------- 10. Dashboard layout (container-query driven) ---------- */
.dash-fit, .dash-wrap { min-width: 0; }
.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-layout.has-fb { grid-template-columns: minmax(0, 1fr) 340px; }
.dash-main { min-width: 0; container-type: inline-size; container-name: dash; }
.dash-fb { min-width: 0; position: sticky; top: calc(var(--toolbar-h) + var(--safe-t) + 12px); }
.dash-fb .form-select { margin-bottom: .6rem; }
.dash-cards { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.dash-cell { grid-column: span 12; min-width: 0; }
.dash-card { height: 100%; overflow: hidden; }
.dash-card .card-header { padding-top: .8rem; padding-bottom: .8rem; }
.dash-scroll { overflow-x: auto; }
.dash-card .num-cell, .dash-card .amount-cell, .dash-card td.text-nowrap { white-space: nowrap; }
.dash-card .table thead th { position: sticky; top: 0; z-index: 1; }
.dash-card .col-opt { display: none; }
@container dash (min-width: 720px) { .dash-card .col-opt { display: table-cell; } .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container dash (max-width: 559px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container dash (min-width: 880px) { .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4w { grid-column: span 12; } }
@container dash (min-width: 1100px) { .span-4w { grid-column: span 4; } }
@media (max-width: 1199.98px) { .dash-layout.has-fb { grid-template-columns: minmax(0, 1fr); } .dash-fb { position: static; max-width: 460px; margin: 0 auto; width: 100%; } }
.dash-kpis { container-type: normal; }
.dash-card:has(.dash-chart) { display: flex; flex-direction: column; }
.dash-card:has(.dash-chart) > .card-body { flex: 1 1 auto; position: relative; min-height: 300px; }
.dash-card:has(.dash-chart-tall) > .card-body { min-height: 340px; }
.dash-chart { position: absolute; inset: 14px 16px; }
.dash-chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--label-2); font-size: .85rem; }
.dash-card .card-body { padding: 14px 16px; }

/* ---------- 11. Authentication (wallpaper + sheet) ---------- */
.auth-shell, .auth-main { flex: 1 0 auto; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: calc(28px + var(--safe-t)) 18px calc(28px + var(--safe-b)); position: relative; isolation: isolate; }
.auth-shell::before, .auth-main::before { content: ""; position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(60vmax 48vmax at 12% 8%, rgba(0, 122, 255, .30), transparent 60%),
  radial-gradient(52vmax 44vmax at 92% 14%, rgba(175, 82, 222, .22), transparent 60%),
  radial-gradient(60vmax 50vmax at 80% 96%, rgba(48, 176, 199, .26), transparent 60%),
  radial-gradient(50vmax 40vmax at 6% 92%, rgba(255, 149, 0, .16), transparent 60%), var(--bg); }
[data-theme="dark"] .auth-shell::before, [data-theme="dark"] .auth-main::before { background:
  radial-gradient(60vmax 48vmax at 12% 8%, rgba(10, 132, 255, .34), transparent 60%),
  radial-gradient(52vmax 44vmax at 92% 14%, rgba(94, 92, 230, .30), transparent 60%),
  radial-gradient(60vmax 50vmax at 80% 96%, rgba(64, 200, 224, .20), transparent 60%), #000; }
.auth-wrapper { width: 100%; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; padding: 2.1rem 1.8rem 1.6rem; background: var(--material-thick); -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px); border: .5px solid var(--hair); border-radius: var(--r-4); box-shadow: var(--shadow-3); }
.auth-logo { display: block; width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 16.5px; object-fit: cover; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 6px 18px rgba(0, 0, 0, .2); }
.auth-brand { text-align: center; font-size: 1.65rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.auth-subtitle { text-align: center; color: var(--label-2); font-size: .9rem; margin: .35rem 0 1.5rem; letter-spacing: 0; }
.auth-card .form-control { min-height: 44px; font-size: 1rem; border-radius: 11px; }
.auth-card .form-label { font-size: .8rem; }
.auth-card .btn-dark-ink { margin-top: .4rem; }
.auth-card .alert { font-size: .84rem; }
.auth-footer-note { margin-top: 1.5rem; padding-top: 1rem; border-top: .5px solid var(--hair); text-align: center; font-size: .72rem; color: var(--label-2); line-height: 1.7; }
.auth-top-flash { position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 2000; width: min(92vw, 420px); }

/* ---------- 12. Mobile tab bar (iOS) ---------- */
.tabbar { display: none; }
@media (max-width: 767.98px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; align-items: stretch; justify-content: space-around; padding: 6px 6px calc(6px + var(--safe-b)); background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border-top: .5px solid var(--hair); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 46px; color: var(--label-2); font-size: .66rem; font-weight: 500; letter-spacing: .005em; text-decoration: none !important; -webkit-tap-highlight-color: transparent; }
  .tabbar a .bi { font-size: 1.3rem; line-height: 1; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.add .bi { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(0, 122, 255, .4); margin-top: -10px; }
  .tabbar a.add span { display: none; }
  body { padding-bottom: calc(62px + var(--safe-b)); }
  .app-footer { padding-bottom: 12px; }
}

/* ---------- 13. Invoice screen wrappers, misc ---------- */
.invoice-screen-wrap { overflow-x: auto; padding: 18px 0 1rem; max-width: 100%; }
.invoice-print-page { border-radius: 4px; }
body.print-mode { background: #e8e8ed; }
.signature-panel .form-text { min-height: 2.4em; }
.amount-line { align-items: center; }
.drag-handle i { font-size: 1.1rem; }
#receivedByTextWrap { display: none; }

/* Stacked "card rows" for wide list tables on phones */
@media (max-width: 767.98px) {
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
  table.table-cards thead { display: none; }
  table.table-cards tbody tr { padding: .75rem 1rem; border-bottom: .5px solid var(--hair); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
  table.table-cards tbody tr:last-child { border-bottom: 0; }
  table.table-cards td { border: 0 !important; padding: 0 !important; width: auto; background: transparent !important; }
  table.table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--label-2); font-size: .74rem; }
  table.table-cards td.m-hide { display: none; }
  table.table-cards td.m-title { order: -3; flex: 1 1 60%; font-size: .95rem; }
  table.table-cards td.m-title::before, table.table-cards td.m-amount::before { content: none; }
  table.table-cards td.m-status { order: -2; margin-left: auto; }
  table.table-cards td.m-amount { order: -1; flex: 1 1 100%; text-align: left; font-size: 1.05rem; font-weight: 600; margin: 2px 0 4px; }
  table.table-cards td.m-actions { flex: 1 1 100%; margin-top: 8px; display: flex; gap: 8px; }
  table.table-cards td.m-actions .btn { min-height: 38px; min-width: 44px; }
}

/* ---------- 14. Responsive shell ---------- */
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); width: min(86vw, 300px); box-shadow: none; }
  .app-sidebar.sidebar-open { transform: none; box-shadow: var(--shadow-3); }
  .app-content-wrap, html.sidebar-collapsed .app-content-wrap { margin-left: 0; }
  .header-widget { display: none; }
  .topbar-heading { opacity: 1; transform: none; }
}
@media (max-width: 767.98px) {
  html { font-size: 15px; }
  .app-main { padding: 4px 14px 20px; }
  .app-topbar { padding-left: 10px; padding-right: 10px; }
  .global-search, .topbar-avatar-btn .name, .btn-quick-add .label { display: none; }
  .btn-quick-add { width: 34px; padding: 0; justify-content: center; }
  .page-heading h4 { font-size: 1.65rem; }
  .page-heading > .d-flex { width: 100%; gap: .4rem !important; }
  .page-heading > .d-flex .btn { flex: 1 1 auto; }
  .page-heading > .btn.ms-auto { margin-left: 0 !important; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: .95rem; }
  .form-control, .form-select, .select2-container .select2-selection--single { font-size: 1rem; min-height: 44px; }
  .select2-container .select2-selection--single { height: 44px; }
  .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
  .form-control-sm, .form-select-sm { min-height: 40px; font-size: .95rem; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .modal-dialog { margin: .75rem; }
  .app-footer .dev-footer { line-height: 1.9; }
}

/* ---------- 15. Export + print ---------- */
html.is-exporting, html.is-exporting body { height: auto !important; overflow: visible !important; background: #fff !important; padding: 0 !important; }
html.is-exporting .app-content-wrap { margin-left: 0 !important; }
html.is-exporting .app-main { padding: 0 !important; max-width: none !important; }
html.is-exporting .table-responsive, html.is-exporting .dash-scroll, html.is-exporting .fbc-body, html.is-exporting .dash-fb { max-height: none !important; overflow: visible !important; position: static !important; }
html.is-exporting thead th, html.is-exporting tfoot th { position: static !important; }
html.is-exporting .dash-layout.has-fb { grid-template-columns: minmax(0, 1fr) 300px !important; }
html.is-exporting .dash-cards { display: block !important; }
html.is-exporting .dash-cell { display: block !important; margin-bottom: 1rem; }
html.is-exporting .dash-card { display: block !important; overflow: visible !important; }
html.is-exporting .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
html.is-exporting .col-opt { display: table-cell !important; }
html.is-exporting .card { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12) !important; }

@page { size: A4 portrait; margin: 20mm; }
@page a4landscape { size: A4 landscape; margin: 20mm; }
#reportArea { page: a4landscape; }
@media print {
  html, body { background: #fff !important; overflow: visible !important; width: auto !important; min-height: 0; padding: 0 !important; color: #000; }
  .app-sidebar, .sidebar-backdrop, .app-topbar, .app-footer, .tabbar, .loading-overlay, .no-print, .dropdown-menu, .alert, .ap-toast, .skip-link { display: none !important; }
  .app-content-wrap { margin-left: 0 !important; display: block !important; }
  .app-main, .app-main.container-fluid { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: .5px solid #d2d2d7 !important; break-inside: avoid; background: #fff !important; }
  .table-responsive, .dash-scroll { overflow: visible !important; max-height: none !important; }
  tr, .card, canvas { break-inside: avoid; page-break-inside: avoid; }
  thead { display: table-header-group; }
  a { color: inherit !important; text-decoration: none !important; }
  .dash-fb { position: static; }
  .invoice-screen-wrap { overflow: visible !important; padding: 0 !important; }
  .invoice-print-page { width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; }
  .invoice-print-page .invoice-body { padding: 0 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 16. Accessibility preferences ---------- */
@media (prefers-reduced-transparency: reduce) {
  :root { --material: var(--surface); --material-thick: var(--surface); --sidebar-bg: var(--surface-2); }
  .app-sidebar, .app-topbar, .modal-content, .dropdown-menu, .tabbar, .auth-card, .select2-dropdown, .modal-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --hair: rgba(60, 60, 67, .45); --label-2: rgba(0, 0, 0, .8); }
  [data-theme="dark"] { --hair: rgba(235, 235, 245, .4); --label-2: rgba(255, 255, 255, .85); }
  .card { box-shadow: 0 0 0 1px var(--hair-strong); }
}
.table td.m-title, .table td a.fw-bold { white-space: nowrap; }
.select2-container--default .select2-selection--single .select2-selection__clear { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); margin: 0; float: none; line-height: 1; }

/* ---------- Desktop: navigation lives in the top bar, content uses the full screen ---------- */
.topbar-brand, .topbar-nav { display: none; }
@media (min-width: 1024px) {
  .app-sidebar, .sidebar-backdrop, .topbar-toggle, .topbar-heading { display: none !important; }
  .app-content-wrap, html.sidebar-collapsed .app-content-wrap { margin-left: 0; }
  .app-topbar { gap: 8px; padding-left: max(20px, env(safe-area-inset-left)); }
  .topbar-brand { display: inline-flex; align-items: center; gap: 9px; flex: none; margin-right: 10px; color: var(--label); text-decoration: none !important; }
  .topbar-brand-icon { width: 30px; height: 30px; border-radius: 7px; overflow: hidden; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.12); flex: none; }
  .topbar-brand-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .topbar-brand-name { font-weight: 700; font-size: .95rem; letter-spacing: -.02em; white-space: nowrap; }
  .topbar-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
  .topnav-link { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--label); font: inherit; font-size: .86rem; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; text-decoration: none !important; cursor: pointer; }
  .topnav-link .bi { color: var(--accent); font-size: 1rem; }
  .topnav-link:hover { background: var(--fill); color: var(--label); }
  .topnav-link.active { background: var(--accent); color: #fff; }
  .topnav-link.active .bi { color: #fff; }
  .topnav-link.dropdown-toggle::after { display: none; }
  .topnav-link .sidebar-badge { margin-left: 2px; height: 18px; min-width: 18px; font-size: .68rem; }
  .topbar-nav .dropdown-item.active { background: var(--accent); color: #fff; }
  .topbar-nav .dropdown-item .bi { margin-right: 6px; }
  .global-search { flex: 0 1 240px; min-width: 130px; }
  /* Three-zone top bar: brand (left) · navigation (true centre) · tools (right).
     Both outer zones share the free space equally, so the nav sits in the middle of the bar. */
  .topbar-brand { flex: 1 1 0; margin-right: 0; min-width: max-content; }
  .topbar-nav { flex: 0 0 auto; justify-content: center; }
  .topbar-right { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
}
@media (min-width: 1024px) and (max-width: 1399.98px) { .header-widget { display: none; } .topbar-brand-name { display: none; } .global-search { flex-basis: 180px; } }
@media (min-width: 1024px) and (max-width: 1199.98px) { .topnav-link span:not(.sidebar-badge) { display: none; } .topnav-link { padding: 0 10px; } }

/* ---------- Motion: gentle entrance, hover and press feedback ---------- */

.kpi-card:hover, .dash-card:hover { box-shadow: var(--shadow-2); }
.kpi-card { position: relative; overflow: hidden; }
.btn:hover:not(:disabled):not(.disabled), .btn-quick-add:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .14); }
.btn:active:not(:disabled):not(.disabled), .btn-quick-add:active, .topnav-link:active { box-shadow: none; }

/* ---------- Brand logos (square mark = logo-icon.png, horizontal = logo-full*.png) ---------- */
.logo-h { display: block; height: 34px; width: auto; }
.logo-h-light { display: none; }
html[data-theme="dark"] .logo-h-dark { display: none; }
html[data-theme="dark"] .logo-h-light { display: block; }
.sidebar-brand { padding: 4px 8px 14px; }
.sidebar-brand .logo-h { height: 38px; }
@media (min-width: 1024px) { .topbar-brand { margin-right: 14px; } .topbar-brand .logo-h { height: 32px; } }
@media (min-width: 1024px) and (max-width: 1399.98px) { .topbar-brand-name { display: none; } }
.auth-logo { border-radius: 22.5%; box-shadow: 0 8px 24px rgba(88, 86, 214, .35); }
.logo-sq { display: none; width: 32px; height: 32px; border-radius: 22.5%; }
@media (min-width: 1024px) and (max-width: 1279.98px) { .topbar-brand .logo-h { display: none !important; } .topbar-brand .logo-sq { display: block; } }

/* ---------- Dark-mode safety net: Bootstrap utility text colours that stay near-black ---------- */
[data-theme="dark"] .text-dark, [data-theme="dark"] .text-black, [data-theme="dark"] .text-body,
[data-theme="dark"] .link-dark, [data-theme="dark"] .text-emphasis { color: var(--label) !important; }
[data-theme="dark"] .text-secondary, [data-theme="dark"] .text-body-secondary { color: var(--label-2) !important; }
[data-theme="dark"] .dash-card .card-header, [data-theme="dark"] .dash-card .table td, [data-theme="dark"] .dash-card .table th { color: var(--label); }
[data-theme="dark"] .dash-card .table thead th { color: var(--label-2); }

/* ---------- Dashboard heading: action buttons end on the main column's right edge ---------- */
.page-heading > .d-flex { justify-content: flex-end; align-items: center; }
@media (min-width: 1200px) {
  /* keep the buttons aligned with the cards' right edge (the Fund Balance column is 340px + 16px gap) */
  .page-heading.has-fb { padding-right: calc(340px + 16px); }
}

/* ---------- Profile menu: Administration group ---------- */
.account-menu .dropdown-header.text-uppercase { font-size: .68rem; letter-spacing: .06em; color: var(--label-2); padding-top: .45rem; padding-bottom: .2rem; }
.account-menu .dropdown-header .bi { color: var(--label-2); }
.account-menu .dropdown-item .bi { margin-right: 6px; }
.account-menu .dropdown-item.active, .account-menu .dropdown-item.active .bi { background: var(--accent); color: #fff; }
.account-menu .dropdown-item.active .bi { background: transparent; }

/* ---------- Profile menu: solid, opaque panel (no translucency / blur) ---------- */
.account-menu { --bs-dropdown-bg: var(--surface); background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; opacity: 1; }

/* ---------- Export Preview (toolbar, loading state, page messages) ----------
   Used by assets/js/export-preview.js: the preview window links this stylesheet, so the tokens above apply there too. */
.xp-doc body { margin: 0; padding: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-2); color: var(--label); font-family: var(--font); }
.xp-doc [hidden] { display: none !important; }
.xp-bar { position: sticky; top: 0; z-index: 5; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: calc(10px + var(--safe-t)) 14px 10px; background: var(--material-thick); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: .5px solid var(--hair-strong); }
.xp-file { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 160px; }
.xp-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-badge { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-2); font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.xp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.xp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 1.1rem; border: 1px solid var(--hair-strong); border-radius: 999px; background: var(--surface); color: var(--label); font: 600 .84rem/1 var(--font); text-decoration: none; cursor: pointer; }
.xp-btn:hover { background: var(--fill); }
.xp-btn:focus-visible, .xp-toast-btn:focus-visible, .xp-toast-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xp-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.xp-btn-primary:hover { background: var(--accent-2); }
.xp-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; outline: none; }
.xp-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--surface); }
.xp-note { flex: none; margin: 0; padding: 4px 14px; font-size: .8rem; color: var(--label-2); }
.xp-note:empty { display: none; }
.xp-panel { margin: auto; max-width: 440px; padding: 32px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.xp-panel p { margin: 0; color: var(--label-2); overflow-wrap: anywhere; }
.xp-panel-error p { color: var(--red-ink); }
.xp-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-3); border-top-color: var(--accent); animation: xp-spin .8s linear infinite; }
.xp-spinner-sm { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
@keyframes xp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .xp-spinner { animation: none; border-top-color: var(--fill-3); border-right-color: var(--accent); }
}
/* messages on the dashboard page (errors, pop-up-blocked notice) */
.xp-toasts { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 2200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.xp-toast { pointer-events: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; max-width: 560px; width: 100%; padding: 10px 14px; border-radius: var(--r-2); background: var(--surface); box-shadow: var(--shadow-2); border-left: 4px solid var(--red); font-size: .85rem; }
.xp-toast-warning { border-left-color: var(--orange); }
.xp-toast-text { flex: 1 1 200px; overflow-wrap: anywhere; }
.xp-toast-btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; }
.xp-toast-x { border: 0; background: transparent; color: var(--label-2); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
[data-export-preview].is-loading { cursor: progress; }
