/* Thryvesuite Design System — unified brand tokens & components */

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  /* Legacy names, kept as-is — used inline across ~20 view files. Do not remove;
     --accent-* below are the same colors under honest names for new V2.0 UI. */
  --violet: #059669;
  --indigo: #047857;
  --cyan: #34d399;
  --amber: #C2703D;
  --grad: linear-gradient(135deg, #047857 0%, #059669 55%, #34d399 100%);
  --grad-soft: linear-gradient(135deg, rgba(4,120,87,.10) 0%, rgba(5,150,105,.10) 55%, rgba(52,211,153,.10) 100%);
  --grad-overlay: linear-gradient(to top, rgba(15,18,34,.58), rgba(15,18,34,.06) 45%);

  /* V2.0 design tokens — single accent family (teal/emerald), used by every new
     page/component built for the redesign. Same hex values as --indigo/--violet/
     --cyan above (this app's brand color already sits in the requested teal-
     emerald family), just named for what they actually are. */
  --accent-300: #34d399;
  --accent-500: #059669;
  --accent-600: #047857;
  --accent-rgb: 4, 120, 87;

  --ink: #0F1222;
  --ink-soft: #1A1B2E;
  --gray-900: #1A1B2E;
  /* gray-500/400 darkened from their original #78788D/#9494A8 — those failed WCAG AA
     (~2.8:1 on white) for the secondary/hint text they're used for everywhere. Shifted
     the whole ramp down one step (old 500 becomes new 400) so the visual hierarchy
     between them is preserved, just uniformly darker. */
  --gray-700: #3D3D56;
  --gray-600: #5C5C72;
  --gray-500: #6B6B85;
  --gray-400: #78788D;
  --gray-200: #E4E4EC;
  --gray-100: #F0F0F5;
  --gray-50: #F8F8FB;
  --border: #E4E4EC;
  --border-soft: #EEEEF4;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15,18,34,.05), 0 1px 1px rgba(15,18,34,.03);
  --shadow-md: 0 6px 20px rgba(4,120,87,.10), 0 1px 3px rgba(15,18,34,.05);
  --shadow-lg: 0 16px 40px rgba(4,120,87,.14), 0 2px 8px rgba(15,18,34,.06);
  --shadow-brand: 0 10px 26px rgba(4,120,87,.28);
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --serif: var(--font-display);
  --focus-ring: 0 0 0 3px rgba(4,120,87,.14);
  --brand-rgb: 4, 120, 87;

  /* Spacing scale (4px base) — new/touched V2.0 components use this instead of
     one-off inline px values. Existing components keep their current values. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* Motion tokens — used by the new sidebar accordion and hover states. */
  --transition-fast: 150ms ease;
  --transition-base: 220ms cubic-bezier(.2,.8,.2,1);

  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

  /* ── Semantic status colors ───────────────────────────────────────────────
     Distinct from --indigo/--violet/--cyan above (kept defined as the brand
     green under those legacy names — ~20 files reference them directly and
     stay untouched). These are real, unambiguous colors for status
     communication: a true indigo for "info", not another shade of green. */
  --info-500: #6366F1; --info-600: #4F46E5; --info-700: #4338CA;
  --success: var(--accent-500);
  --success-bg: #ECFDF5; --success-border: #A7F3D0;
  --warning: #B45309;
  --warning-bg: #FFFBEB; --warning-border: #FDE68A;
  --danger: #DC2626;
  --danger-bg: #FEF2F2; --danger-border: #FECACA;
  --info: var(--info-600);
  --info-bg: #EEF2FF; --info-border: #C7D2FE;
  --border-strong: #D6D6E4;
  --accent2-600: var(--info-600);
  --nav-active-bg: rgba(99,102,241,.10);

  /* ── Icon-chip palette ─────────────────────────────────────────────────
     A small rotating set of pastel tints for per-item icon badges (stat
     cards, quick actions) — distinct from the semantic success/warning/
     danger/info colors above, which are reserved for actual state. Six
     colors is enough to keep a row of cards visually distinct without
     turning into a rainbow. */
  --chip-blue: #3B82F6; --chip-blue-bg: rgba(59,130,246,.12);
  --chip-teal: #14B8A6; --chip-teal-bg: rgba(20,184,166,.12);
  --chip-violet: #8B5CF6; --chip-violet-bg: rgba(139,92,246,.12);
  --chip-green: #22C55E; --chip-green-bg: rgba(34,197,94,.12);
  --chip-orange: #F97316; --chip-orange-bg: rgba(249,115,22,.12);
  --chip-pink: #EC4899; --chip-pink-bg: rgba(236,72,153,.12);
}

/* Tenant-admin app shell only — Inter/DM Mono per the approved Figma design,
   distinct from the public marketing site's Instrument Serif/Plus Jakarta Sans
   brand fonts (loaded separately in views/layouts/tenant-admin.php's <head>). */
html.dashboard {
  --font-ui: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ── Dark mode ──────────────────────────────────────────────────────────────
   The Figma design this app now follows for the tenant-admin shell is a fixed
   light UI (with a permanently-dark sidebar, styled separately above) — no
   light/dark toggle, so this no longer auto-switches on OS preference. The
   explicit-attribute variants below are kept dormant (harmless, unused by any
   control right now) rather than deleted, in case a real toggle is reintroduced
   later. html.superadmin has its own separate always-dark theme, untouched. */
html.dashboard[data-theme="dark"] {
  color-scheme: dark;
  --ink: #F3F4F7; --ink-soft: #E4E4EC;
  --gray-900: #F3F4F7; --gray-700: #C4C4D4; --gray-600: #9799AC;
  --gray-500: #82869C; --gray-400: #767A8A;
  --gray-200: #2A2D3A; --gray-100: #1F212A; --gray-50: #191B23;
  --border: #262933; --border-soft: #1F212A; --border-strong: #33364A;
  --bg: #0B0D12; --surface: #14161D;
  --success: #34D399; --success-bg: rgba(52,211,153,.12); --success-border: rgba(52,211,153,.3);
  --warning: #FBBF24; --warning-bg: rgba(251,191,36,.12); --warning-border: rgba(251,191,36,.3);
  --danger: #F87171; --danger-bg: rgba(248,113,113,.12); --danger-border: rgba(248,113,113,.3);
  --info: #818CF8; --info-bg: rgba(129,140,248,.14); --info-border: rgba(129,140,248,.3);
  --nav-active-bg: rgba(129,140,248,.16);
  --chip-blue-bg: rgba(59,130,246,.18); --chip-teal-bg: rgba(20,184,166,.18); --chip-violet-bg: rgba(139,92,246,.2);
  --chip-green-bg: rgba(34,197,94,.18); --chip-orange-bg: rgba(249,115,22,.18); --chip-pink-bg: rgba(236,72,153,.18);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.5);
  --focus-ring: 0 0 0 3px rgba(52,211,153,.28);
}
html.dashboard[data-theme="light"] {
  color-scheme: light;
  --ink: #0F1222; --ink-soft: #1A1B2E;
  --gray-900: #1A1B2E; --gray-700: #3D3D56; --gray-600: #5C5C72;
  --gray-500: #6B6B85; --gray-400: #78788D;
  --gray-200: #E4E4EC; --gray-100: #F0F0F5; --gray-50: #F8F8FB;
  --border: #E4E4EC; --border-soft: #EEEEF4; --border-strong: #D6D6E4;
  --bg: #FAFAFA; --surface: #FFFFFF;
  --success: var(--accent-500); --success-bg: #ECFDF5; --success-border: #A7F3D0;
  --warning: #B45309; --warning-bg: #FFFBEB; --warning-border: #FDE68A;
  --danger: #DC2626; --danger-bg: #FEF2F2; --danger-border: #FECACA;
  --info: var(--info-600); --info-bg: #EEF2FF; --info-border: #C7D2FE;
  --nav-active-bg: rgba(99,102,241,.10);
  --chip-blue-bg: rgba(59,130,246,.12); --chip-teal-bg: rgba(20,184,166,.12); --chip-violet-bg: rgba(139,92,246,.12);
  --chip-green-bg: rgba(34,197,94,.12); --chip-orange-bg: rgba(249,115,22,.12); --chip-pink-bg: rgba(236,72,153,.12);
  --shadow-sm: 0 1px 2px rgba(15,18,34,.05), 0 1px 1px rgba(15,18,34,.03);
  --shadow-md: 0 6px 20px rgba(4,120,87,.10), 0 1px 3px rgba(15,18,34,.05);
  --shadow-lg: 0 16px 40px rgba(4,120,87,.14), 0 2px 8px rgba(15,18,34,.06);
  --focus-ring: 0 0 0 3px rgba(4,120,87,.14);
}

/* ── Accessibility: low-contrast text fix ────────────────────────────────────
   A handful of hardcoded grays (#9ca3af, #94a3b8, #6b7280, #64748b) are used inline
   across ~250+ spots app-wide for secondary/hint text — several fail WCAG AA
   (#9ca3af and #94a3b8 sit around 2.5-2.8:1 on white, well under the 4.5:1 minimum).
   Rewriting every inline style="" individually isn't practical, so this overrides
   them globally by attribute-matching the inline style value; !important is
   deliberate since it's specifically countering an inline style attribute. */
/* Redirected to the --gray-400 token (rather than a second fixed hex) so these
   ~250+ inline-styled spots also go dark-mode-aware for free, instead of being
   stuck at a light-mode-only override color. */
[style*="color:#9ca3af"], [style*="color: #9ca3af"],
[style*="color:#9CA3AF"], [style*="color: #9CA3AF"],
[style*="color:#94a3b8"], [style*="color: #94a3b8"],
[style*="color:#94A3B8"], [style*="color: #94A3B8"],
[style*="color:#6b7280"], [style*="color: #6b7280"],
[style*="color:#6B7280"], [style*="color: #6B7280"],
[style*="color:#64748b"], [style*="color: #64748b"],
[style*="color:#64748B"], [style*="color: #64748B"] { color: var(--gray-400) !important; }

/* Same technique, same reasoning, for the other recurring hardcoded inline
   colors found across views/tenant — an info banner (indigo), a success
   green, and an error red, each duplicated ad hoc in a dozen-plus files
   instead of using the shared tokens. Covers both the text color and its
   matching background/border so a whole inline-styled banner goes
   dark-mode-aware together. */
[style*="background:#eef2ff"], [style*="background: #eef2ff"] { background: var(--info-bg) !important; }
[style*="border:1px solid #c7d2fe"], [style*="border: 1px solid #c7d2fe"],
[style*="border-color:#c7d2fe"], [style*="border-color: #c7d2fe"] { border-color: var(--info-border) !important; }
[style*="color:#3730a3"], [style*="color: #3730a3"] { color: var(--info) !important; }
[style*="color:#166534"], [style*="color: #166534"] { color: var(--success) !important; }
[style*="color:#c00"], [style*="color: #c00"],
[style*="color:#dc2626"], [style*="color: #dc2626"],
[style*="color:#991b1b"], [style*="color: #991b1b"] { color: var(--danger) !important; }
[style*="background:#fef2f2"], [style*="background: #fef2f2"] { background: var(--danger-bg) !important; }
[style*="border:1px solid #fecaca"], [style*="border: 1px solid #fecaca"],
[style*="border-color:#fecaca"], [style*="border-color: #fecaca"] { border-color: var(--danger-border) !important; }

/* Same technique again for inline color:var(--indigo) — a dozen-plus "View lead →"/
   "+ Add a new type"-style inline links across views/tenant that predate the Figma
   per-page color identity and would otherwise stay the old flat brand green forever
   instead of picking up the current page's accent like every .link-brand/.btn-primary
   already does via --page-accent (see .page-body in tenant-admin.php). */
[style*="color:var(--indigo)"], [style*="color: var(--indigo)"] { color: var(--page-accent, var(--indigo)) !important; }
[style*="background:var(--indigo)"], [style*="background: var(--indigo)"] { background: var(--page-accent, var(--indigo)) !important; }
[style*="border-color:var(--indigo)"], [style*="border-color: var(--indigo)"] { border-color: var(--page-accent, var(--indigo)) !important; }

/* ── Reset & base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #fff;
  color: var(--gray-900);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
::selection { background: rgba(4,120,87,.18); color: var(--ink); }

/* ── Reveal-on-scroll ───────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.js-off .reveal { opacity: 1; transform: none; }

/* ── Utilities ──────────────────────────────────────────────────────────────── */
.container { max-width: min(94vw, 1600px); margin: 0 auto; padding: 0 24px; }
/* --page-accent* are set per-request on .page-body (views/layouts/tenant-admin.php)
   from current_page_color() — every button/link below picks up the current page's
   Figma color identity automatically, with the original brand green as a fallback
   for anywhere --page-accent* isn't set (public site, superadmin, emails). */
.text-brand { color: var(--page-accent, var(--indigo)); }
.link-brand { color: var(--page-accent, var(--indigo)); font-weight: 600; transition: color .15s, opacity .15s; }
.link-brand:hover { opacity: .8; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, color .15s, opacity .15s;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--page-accent-grad, var(--grad)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px var(--page-accent-shadow, rgba(4,120,87,.28)); }
.btn-outline { background: var(--surface); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--page-accent, var(--indigo)); color: var(--page-accent, var(--indigo)); background: var(--gray-50); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
/* Loading state — used by pages that disable-and-relabel a submit button via JS
   (e.g. onsubmit="this.querySelector('button').classList.add('btn-loading')");
   purely additive, no existing button markup needs to change to adopt it. */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: btn-spin .7s linear infinite;
}
.btn-outline.btn-loading::after, .btn-danger.btn-loading::after { border-color: var(--border); border-top-color: var(--gray-600); }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-loading::after { animation-duration: 1.4s; } }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px; border: 1px solid transparent;
  font-size: 11px; font-weight: 600;
}
.badge-trial { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-active { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-suspended { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-past_due { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-cancelled { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-200); }
.badge-starter { background: var(--gray-100); color: var(--gray-600); }
.badge-pro { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-studio { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }

/* ── Flash messages ─────────────────────────────────────────────────────────── */
.flash { max-width: min(94vw, 1600px); margin: 16px auto; padding: 0 24px; }
.flash-msg {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.flash-msg.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.flash-msg.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.flash-msg.info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

/* ── Platform nav ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15,18,34,.06);
  transition: box-shadow .2s, background .2s;
}
.nav.scrolled { background: rgba(255,255,255,.94); box-shadow: 0 1px 24px rgba(15,18,34,.06); }
.nav-inner {
  max-width: min(94vw, 1600px); margin: 0 auto; padding: 0 24px;
  height: 66px; display: flex; align-items: center; gap: 8px;
}
.nav-logo {
  font-size: 17px; font-weight: 800; letter-spacing: -.3px;
  color: var(--ink); display: flex; align-items: center; gap: 10px;
}
.nav-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.nav-logo-sub { font-size: 9.5px; font-weight: 600; color: var(--gray-400); letter-spacing: .1px; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--gray-600);
  transition: all .15s;
}
.nav-link:hover { color: var(--ink); background: var(--gray-100); }
.nav-cta {
  background: var(--grad); color: #fff !important;
  border-radius: var(--radius-sm); padding: 9px 18px;
  font-size: 14px; font-weight: 700; margin-left: 6px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(4,120,87,.25);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(4,120,87,.35); }
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-burger span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 1px; }

/* ── Platform footer ──────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--gray-100); margin-top: 80px;
  padding: 56px 24px 40px; background: var(--gray-50);
}
.footer-inner { max-width: min(94vw, 1600px); margin: 0 auto; }
.footer-top {
  display: flex; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--gray-200);
}
.footer-brand-col { max-width: 260px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--ink); }
.footer-tagline { font-size: 13px; color: var(--gray-400); margin-top: 8px; line-height: 1.6; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--gray-200); color: var(--gray-400); transition: all .15s;
}
.footer-social a:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.footer-social svg { width: 14px; height: 14px; fill: currentColor; }
.footer-payments { display: flex; gap: 8px; margin-top: 14px; }
.footer-pay-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 5px; background: #fff; border: 1px solid var(--gray-200);
  font-size: 11px; font-weight: 800; letter-spacing: -.2px;
}
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--gray-400); margin-bottom: 12px;
}
.footer-col a { display: block; font-size: 13.5px; color: var(--gray-600); margin-bottom: 9px; transition: color .15s; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; padding-top: 24px;
  font-size: 12.5px; color: var(--gray-400);
}

/* ── Legal pages (Privacy/Terms/Cookies) ──────────────────────────────────── */
.legal-hero { text-align: center; padding: 72px 24px 40px; max-width: 640px; margin: 0 auto; }
.legal-hero h1 { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 46px); font-weight: 400; letter-spacing: -.5px; color: var(--ink); margin-bottom: 10px; }
.legal-hero p { font-size: 13.5px; color: var(--gray-400); }
.legal-body { max-width: 720px; margin: 0 auto 96px; padding: 0 24px; }
.legal-body h2 { font-size: 18px; font-weight: 800; color: var(--gray-900); margin: 40px 0 12px; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { font-size: 14.5px; color: var(--gray-600); line-height: 1.75; margin-bottom: 14px; }
.legal-body ul { margin: 0 0 14px; padding-left: 20px; }
.legal-body li { font-size: 14.5px; color: var(--gray-600); line-height: 1.75; margin-bottom: 6px; }
.legal-body a { color: var(--accent-600); text-decoration: underline; }

/* ── Dashboard layout ─────────────────────────────────────────────────────── */
html.dashboard, html.dashboard body { height: 100%; }
.dashboard body { background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; }
.dashboard ::-webkit-scrollbar { width: 6px; height: 6px; }
.dashboard ::-webkit-scrollbar-track { background: transparent; }
.dashboard ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.dashboard ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

.layout { display: flex; min-height: 100vh; }
/* ── Sidebar — permanently dark, per Figma's design (this app shell has no
   light/dark toggle for it; it's a fixed identity like the topbar is fixed light). ── */
.sidebar {
  width: 254px; background: #0f0f18;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 50;
}
.main-area { margin-left: 254px; flex: 1; display: flex; flex-direction: column; min-width: 0; }

.sidebar-brand {
  padding: 15px 16px; border-bottom: none;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.sidebar-brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; color: #fff; }
.sidebar-brand-sub {
  font-size: 10.5px; color: rgba(255,255,255,.4); margin-top: 1px;
  letter-spacing: 0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sidebar-nav { padding: 4px 0 14px; flex: 1; }
.nav-section {
  padding: 15px 20px 7px; font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,.3);
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  margin: 1px 10px; padding: 8px 12px; border-radius: 999px;
  color: rgba(255,255,255,.5); font-size: 14.5px; font-weight: 500;
  transition: all .15s; cursor: pointer;
}
.nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: color-mix(in srgb, var(--nav-color, #4f46e5) 16%, transparent); font-weight: 600; }
.nav-item-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: rgba(255,255,255,.4); background: transparent; transition: all .15s;
}
.sidebar-nav .nav-item-icon svg { stroke-width: 2.1; width: 16px; height: 16px; }
.nav-item.active .nav-item-icon { color: var(--nav-color, #4f46e5); background: color-mix(in srgb, var(--nav-color, #4f46e5) 22%, transparent); }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }

/* ── Sidebar accordion groups (Finance/Bookings/Documents/Website/Contacts) ──
   Lensinfra has more sections than the flat Figma nav, so grouping stays — themed
   to match the dark pill treatment instead of the flat list the reference shows. */
.nav-group { margin: 1px 10px; }
.nav-group-toggle {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 10px; border: none; background: transparent;
  color: rgba(255,255,255,.5); font-size: 14.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-align: left; transition: background var(--transition-fast, .15s), color var(--transition-fast, .15s);
}
.nav-group-toggle:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.nav-group-toggle:focus-visible { outline: 2px solid var(--nav-color, #4f46e5); outline-offset: 1px; }
.nav-group-label { flex: 1; }
.nav-group-chevron { display: flex; color: rgba(255,255,255,.3); transition: transform var(--transition-base, .2s) cubic-bezier(.34,1.4,.64,1); }
.nav-group.open .nav-group-chevron { transform: rotate(180deg); }
.nav-group.open > .nav-group-toggle { color: #fff; font-weight: 600; }
.nav-group.open > .nav-group-toggle .nav-item-icon { color: var(--nav-color, #4f46e5); }
.nav-subitems {
  overflow: hidden; height: 0;
  margin-left: 22px; padding-left: 12px;
  position: relative;
  border-left: 2px solid transparent;
  transition: height var(--transition-base, .2s) cubic-bezier(.34,1.4,.64,1);
}
.nav-group.open .nav-subitems { border-left-color: rgba(255,255,255,.08); }
.nav-subitem {
  position: relative; display: flex; align-items: center; gap: 9px;
  margin: 2px 0; padding: 6px 8px; border-radius: 999px;
  color: rgba(255,255,255,.45); font-size: 14px; font-weight: 500;
  transition: all var(--transition-fast, .15s);
}
.nav-subitem:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.nav-subitem.active { color: #fff; background: color-mix(in srgb, var(--nav-color, #4f46e5) 16%, transparent); font-weight: 600; }
.nav-subitem.active .nav-item-icon { color: var(--nav-color, #4f46e5); }
.nav-subitem .nav-item-icon { width: 22px; height: 22px; }
.nav-subitem .nav-item-icon svg { width: 14px; height: 14px; }

/* Sidebar-bottom user block retired — moved to the topbar user menu (see .user-menu-*
   below); Settings/Profile/Logout live there now instead of at the sidebar footer. */

.trial-banner {
  background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.2); border-radius: 10px;
  padding: 9px 12px; margin: 4px 12px 10px; font-size: 11px; color: #fbbf24; line-height: 1.4;
}
.trial-banner a { color: #fff; font-weight: 700; }

/* ── Topbar — glassmorphism, per-page accent (--topbar-accent, set inline from
   current_page_color()) drives the notification bell + accent dot next to the title. ── */
.topbar {
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 0 28px; height: 58px;
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 15px; font-weight: 600; color: #111118; flex: 1; letter-spacing: -0.2px; display: flex; align-items: center; gap: 9px; }
.topbar-accent-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--gray-600);
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,18,34,.4); z-index: 45; }

.page-body { padding: 28px; flex: 1; overflow-x: hidden; }
.flash-wrap { padding: 0 28px; }

/* ── Dashboard components ─────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
/* Optional Figma-style corner blob + bottom accent line — invisible no-ops (transparent/
   0 opacity) unless a page sets --stat-grad inline, so existing stat cards are unaffected
   until they opt in during the page-by-page pass. */
.stat-card::before {
  content: ''; position: absolute; top: -16px; right: -16px; width: 80px; height: 80px;
  border-radius: 50%; background: var(--stat-grad, transparent); opacity: .06; pointer-events: none;
}
.stat-card-accent { height: 2px; border-radius: 2px; margin-top: 10px; background: var(--stat-grad, transparent); opacity: .35; }
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 8px; }
.stat-value { font-size: 27px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.6px; }
.stat-value.accent { color: var(--indigo); }
.stat-sub { font-size: 11.5px; color: var(--gray-400); margin-top: 3px; }

/* ── Icon chips ────────────────────────────────────────────────────────────
   A small pastel-tinted icon badge, rotating through --chip-* colors so a
   row of stat cards or quick-action tiles reads as visually distinct at a
   glance without any of them being semantically "success/warning/etc" —
   these are purely decorative categorization, never used for status. */
.icon-chip {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-bottom: 12px;
}
.icon-chip svg { width: 18px; height: 18px; }
.icon-chip.blue { background: var(--chip-blue-bg); color: var(--chip-blue); }
.icon-chip.teal { background: var(--chip-teal-bg); color: var(--chip-teal); }
.icon-chip.violet { background: var(--chip-violet-bg); color: var(--chip-violet); }
.icon-chip.green { background: var(--chip-green-bg); color: var(--chip-green); }
.icon-chip.orange { background: var(--chip-orange-bg); color: var(--chip-orange); }
.icon-chip.pink { background: var(--chip-pink-bg); color: var(--chip-pink); }
.stat-card-head { display: flex; align-items: flex-start; justify-content: space-between; }

/* Gradient icon badge for stat cards — ports Figma's StatCard icon treatment (solid
   gradient + colored shadow + white icon), distinct from the flat pastel .icon-chip
   used for quick actions. Set --stat-grad/--stat-shadow inline per card to opt in. */
.stat-card-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--stat-grad, var(--chip-blue-bg)); box-shadow: 0 4px 10px var(--stat-shadow, transparent);
  color: #fff; margin-bottom: 12px;
}
.stat-card-icon svg { width: 16px; height: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card-header { padding: 17px 20px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.1px; }
.card-body { padding: 20px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 11px 16px; font-size: 11px; font-weight: 700;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; color: var(--gray-700); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--page-accent-bg, var(--gray-50)); }
.table-wrap { overflow-x: auto; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-hint { font-size: 11.5px; color: var(--gray-400); margin-top: 4px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: 12px; font-size: 14px; color: var(--ink); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--page-accent, var(--indigo)); box-shadow: 0 0 0 3px var(--page-accent-bg, var(--focus-ring)); }
.form-input.error, .form-textarea.error { border-color: var(--danger); }
.form-input[disabled], .form-textarea[disabled], .form-select[disabled] { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.dashboard .btn { padding: 9px 18px; border-radius: 9px; font-size: 13.5px; }
.dashboard .btn-primary { box-shadow: 0 2px 10px rgba(4,120,87,.25); }
.dashboard .btn-primary:hover { box-shadow: 0 8px 18px rgba(4,120,87,.32); }
.dashboard .btn-outline { color: var(--gray-700); background: var(--surface); border: 1px solid var(--border-strong); }
.dashboard .btn-outline:hover { border-color: var(--indigo); color: var(--indigo); }
.dashboard .btn-danger { background: var(--surface); color: var(--danger); border: 1px solid var(--danger-border); }
.dashboard .btn-danger:hover { background: var(--danger-bg); }
.dashboard .btn-danger-soft { background: var(--danger-bg); color: var(--danger); border: 1px solid transparent; padding: 9px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s; }
.dashboard .btn-danger-soft:hover { background: var(--danger-border); }
.dashboard .btn-sm { padding: 6px 13px; font-size: 12px; border-radius: 7px; }
.dashboard .btn-icon { padding: 6px 8px; border-radius: 7px; }

.badge-green { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-amber { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-red { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
/* Was literally the same green as .badge-green (a real bug — "blue" rendered
   green) — now a true indigo, distinct from success, for info/neutral-
   positive states like "Default", "Draft", "Awaiting client". */
.badge-blue { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); border-color: var(--border); }
.badge-purple { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
html.dashboard[data-theme="dark"] .badge-purple {
  background: rgba(167,139,250,.14); color: #a78bfa; border-color: rgba(167,139,250,.3);
}
@media (prefers-color-scheme: dark) {
  html.dashboard:not([data-theme="light"]) .badge-purple { background: rgba(167,139,250,.14); color: #a78bfa; border-color: rgba(167,139,250,.3); }
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.dashboard .badge { gap: 5px; padding: 3px 10px 3px 8px; font-weight: 700; letter-spacing: 0.2px; }

.empty-state { text-align: center; padding: 64px 20px; }
.empty-state-icon { font-size: 40px; margin-bottom: 14px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty-state-sub { font-size: 13px; color: var(--gray-400); margin-bottom: 22px; }

/* ── Skeleton loaders ──────────────────────────────────────────────────────
   Replaces static "Loading…" text where a page fetches content async (see
   public/assets/*.js modal/panel loaders). Drop a few of these in place of
   the real content, then swap them out once the fetch resolves — same idea
   as .empty-state, just for the in-between moment. */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
  background-size: 400% 100%; animation: skeleton-shimmer 1.6s ease infinite;
  border-radius: 6px; display: block;
}
.skeleton-text { height: 13px; margin-bottom: 8px; }
.skeleton-text:last-child { margin-bottom: 0; width: 60%; }
.skeleton-title { height: 18px; width: 40%; margin-bottom: 14px; }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; }
.skeleton-block { height: 80px; border-radius: var(--radius-md); }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ── Toasts ────────────────────────────────────────────────────────────────
   Ephemeral feedback for JS-driven actions that don't reload the page (the
   existing .flash-msg stays for server-rendered redirect feedback — these
   two are complementary, not a replacement for each other). See
   public/assets/toast.js for the controller that stacks/dismisses these. */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 900; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--success);
  border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-lg);
  font-size: 13px; color: var(--gray-700); animation: toast-in var(--transition-base);
}
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.toast-close { flex-shrink: 0; background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; }
.toast-close:hover { color: var(--ink); }
.toast.leaving { animation: toast-out .18s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast.leaving { animation: none; opacity: 0; } }

/* ── Theme toggle (topbar) ─────────────────────────────────────────────────
   See public/assets/theme-toggle.js — sets html[data-theme] and persists the
   choice in localStorage; defaults to the OS preference (see the
   @media (prefers-color-scheme: dark) block at the top of this file). */
.theme-toggle { display: flex; align-items: center; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 3px; }
.theme-toggle button {
  border: none; background: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--gray-400); transition: background .15s, color .15s;
}
.theme-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.theme-toggle button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.theme-toggle svg { width: 14px; height: 14px; }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: 40px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--bg);
}
.dropzone.drag-over { border-color: var(--indigo); background: var(--grad-soft); }
.dropzone-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone-label { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.dropzone-sub { font-size: 12px; color: var(--gray-400); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery-thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; position: relative; background: var(--bg); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb-del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(15,18,34,.65); color: #fff; border: none;
  border-radius: 6px; padding: 3px 6px; font-size: 11px;
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.gallery-thumb:hover .gallery-thumb-del { opacity: 1; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-header-text h1 { font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: -0.4px; }
.page-header-text p { font-size: 13px; color: var(--gray-600); margin-top: 4px; }

/* ── Page hero — gradient banner, ports Figma's PageHero component. Rendered via
   dash_page_hero() (app/Core/helpers.php); --hero-* custom properties come from
   that call's color config, defaulting to the current route's page_color_lookup(). ── */
.page-hero {
  margin: -28px -28px 24px; padding: 24px 28px 20px;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--hero-bg, #eef2ff) 0%, var(--surface) 60%);
  border-bottom: 1px solid var(--border-soft);
}
.page-hero-blob-1 { position: absolute; top: -32px; right: -32px; width: 160px; height: 160px; border-radius: 50%; opacity: .07; background: var(--hero-grad, var(--grad)); }
.page-hero-blob-2 { position: absolute; top: 8px; right: 80px; width: 64px; height: 64px; border-radius: 50%; opacity: .05; background: var(--hero-primary, var(--accent-500)); }
.page-hero-row { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-hero-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.page-hero-bar { width: 4px; height: 20px; border-radius: 3px; background: var(--hero-grad, var(--grad)); flex-shrink: 0; }
.page-hero-title h1 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.page-hero-desc { font-size: 13px; color: var(--gray-600); margin-left: 12px; }
.page-hero-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── GradBtn — ports Figma's colored-shadow gradient button + ghost variant.
   Set --gb-primary/--gb-grad/--gb-shadow/--gb-bg inline from a page_color_lookup() result;
   falls back to the app's default brand gradient when unset. ── */
.grad-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; border: none;
  color: #fff; background: var(--gb-grad, var(--grad));
  box-shadow: 0 4px 14px var(--gb-shadow, rgba(4,120,87,.25));
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.grad-btn:hover { transform: translateY(-1px) scale(1.01); opacity: .96; }
.grad-btn:active { transform: translateY(0) scale(.98); }
.grad-btn:focus-visible { outline: none; box-shadow: var(--focus-ring), 0 4px 14px var(--gb-shadow, rgba(4,120,87,.25)); }
.grad-btn.ghost {
  color: var(--gb-primary, var(--accent-600)); background: var(--gb-bg, var(--accent-500-bg, rgba(4,120,87,.08)));
  border: 1px solid color-mix(in srgb, var(--gb-primary, var(--accent-600)) 25%, transparent);
  box-shadow: none;
}
.grad-btn.ghost:hover { transform: translateY(-1px) scale(1.01); opacity: 1; box-shadow: var(--shadow-sm); }
.grad-btn.sm { padding: 6px 13px; font-size: 12px; border-radius: 10px; }
.grad-btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,18,34,.45); backdrop-filter: blur(2px); z-index: 200; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; max-width: 520px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modal-in var(--transition-base); }
.modal-title { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 20px; letter-spacing: -0.2px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.quick-action {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: block; transition: all .15s; box-shadow: var(--shadow-sm);
}
.quick-action:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.quick-action-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad-soft); color: var(--indigo);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.quick-action-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.quick-action-desc { font-size: 11px; color: var(--gray-400); }

.settings-tabs { display: flex; gap: 2px; margin-bottom: 20px; background: var(--bg); border-radius: 9px; padding: 4px; width: fit-content; flex-wrap: wrap; }
.settings-tab-btn { padding: 8px 18px; border: none; background: none; border-radius: 7px; font-size: 13.5px; font-weight: 400; cursor: pointer; color: var(--gray-400); transition: all .15s; }
.settings-tab-btn.active { background: var(--surface); color: var(--page-accent, var(--indigo)); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.settings-tab-btn:focus-visible, .widget-tab-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.settings-pane { display: none; }
.settings-pane.active { display: block; }

/* ── Row overflow menu (⋮) ────────────────────────────────────────────────────
   Shared everywhere a table row or card has secondary/destructive actions that
   shouldn't compete inline with the primary action — e.g. Delete/Void/Reset
   next to Open/Send. position:fixed + JS-computed coordinates (see
   rowMenuInit() in lensinfra.js-equivalent inline script on each page) so the
   dropdown is never clipped by a scrolling table wrapper, and closes on
   outside click or on scroll. Originally built for Settings → Team; promoted
   here so every list can reuse the same markup/behavior. */
.row-menu { position: relative; display: inline-block; }
.row-menu summary { list-style: none; cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 19px; font-weight: 700; color: var(--gray-700); user-select: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:hover, .row-menu[open] summary { background: var(--bg); }
.row-menu-dropdown { position: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); min-width: 170px; z-index: 500; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.row-menu-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--ink); cursor: pointer; font-family: inherit; }
.row-menu-item:hover { background: var(--bg); }
.row-menu-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.row-menu-item.danger { color: var(--danger); }
.row-menu summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Notification bell (studio header) ───────────────────────────────────────
   Every event that already emails the studio also writes a row via
   Notifications::create() (see app/Core/Notifications.php); this is just the
   read/mark-read UI over that same table. */
.notif-bell { position: relative; }
.notif-bell-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--gray-600); cursor: pointer; flex-shrink: 0; transition: transform .15s, background .15s; }
.notif-bell-btn:hover { background: var(--bg); transform: scale(1.05); }
.notif-bell-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.notif-bell-btn svg { width: 18px; height: 18px; }
/* Both topbar icon buttons (notifications + suggest-a-feature) pick up the current page's
   accent, matching Figma's Topbar — kept as one matched set rather than leaving the
   lightbulb the old flat gray while the bell next to it goes colorful. */
#notif-bell .notif-bell-btn, #fsug-widget .notif-bell-btn { background: var(--topbar-accent-bg, var(--surface)); border-color: color-mix(in srgb, var(--topbar-accent, var(--accent-500)) 20%, transparent); color: var(--topbar-accent, var(--gray-600)); }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; font-variant-numeric: tabular-nums; }
.notif-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: -8px; width: min(360px, 92vw); max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 500; }
.notif-dropdown.open { display: block; }
.notif-dropdown-header { padding: 12px 16px; font-size: 13px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: var(--surface); }
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: inherit; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(4,120,87,.05); }
.notif-message { font-size: 13px; color: var(--ink); line-height: 1.45; }
.notif-when { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.notif-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--gray-400); }

/* ── User menu (topbar, top-right) — replaces the old sidebar-footer identity block.
   Reuses .notif-bell/.notif-dropdown for positioning/open-close and .row-menu-item for
   the Settings/Profile/Logout rows, so it opens/closes/styles consistently with the
   bell and feature-suggestion dropdowns right next to it. ── */
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; height: 34px;
  padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer;
  background: var(--topbar-accent-bg, var(--surface)); border: 1px solid color-mix(in srgb, var(--topbar-accent, var(--accent-500)) 20%, transparent);
  transition: transform .15s, background .15s;
}
.user-menu-btn:hover { transform: scale(1.02); }
.user-menu-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.user-menu-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.user-menu-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.user-menu-chevron { display: flex; color: var(--gray-400); flex-shrink: 0; }
.user-menu-chevron svg { width: 13px; height: 13px; }
.user-menu-dropdown { width: 230px; }
.user-menu-item { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.user-menu-item svg { width: 15px; height: 15px; color: var(--gray-400); flex-shrink: 0; }
.user-menu-item.danger:hover svg { color: var(--danger); }

/* ── Customizable widget board (Dashboard + Analytics) ───────────────────────
   Shared between /dashboard and /analytics — same edit/drag/reorder/remove
   chrome on both; each page's own widget CONTENT (chart bars, table columns,
   quick actions) stays local since that genuinely differs between the two. */
.widget-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.widget-tabs { display: flex; gap: 2px; background: var(--bg); border-radius: 9px; padding: 4px; width: fit-content; flex-wrap: wrap; }
.widget-tab-btn { padding: 7px 14px; border: none; background: none; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--gray-600); text-decoration: none; display: inline-block; }
.widget-tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.widget-actions { display: flex; gap: 8px; align-items: center; }
/* flex-grow defaults to 1 on every widget (not just stat/table) so a row with fewer
   cards than would fill the viewport stretches evenly across the full width instead of
   leaving dead space on wide screens — previously only stat/table had an explicit flex
   rule, so chart-type widgets (area_multi/bar_multi/pie) fell back to flex:0 1 auto and
   never grew past their content size.
   min-width:0 overrides the flex-item default of min-width:auto, which otherwise refuses
   to shrink a chart widget below its <canvas>'s rendered pixel size — Chart.js measures
   its container on first paint, and without this a chart's real render width becomes an
   effective floor that forces flex-wrap to give it (and only it) the whole row. */
.widget-board { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.board-widget { flex: 1 1 240px; min-width: 0; }
.board-widget[data-type="stat"] { flex: 1 1 200px; }
.board-widget[data-type="table"], .board-widget[data-type="chart"] { flex: 1 1 100%; }
.board-widget.board-hidden { opacity: .45; }
.board-widget.board-dragging { opacity: .35; }
.widget-edit-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; color: var(--gray-500); }
.widget-edit-bar .drag-handle { cursor: grab; font-size: 14px; color: var(--gray-400); }
.widget-edit-bar label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.widget-edit-bar button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 12px; padding: 0; }
.widget-row-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.widget-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); }
.widget-row:last-child { border-bottom: none; }
.widget-row-label { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink); }
.widget-row-value { font-size: 15px; font-weight: 700; color: var(--ink); }
.widget-add-panel { background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.widget-add-cat { margin-bottom: 10px; }
.widget-add-cat-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--gray-500); margin-bottom: 6px; }
.widget-add-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; margin: 0 6px 6px 0; }
.widget-add-btn:hover { border-color: var(--indigo); color: var(--indigo); }

/* ── Auth (login / register) ──────────────────────────────────────────────── */
.auth body { background: #fff; }
.split { display: flex; min-height: 100vh; border-radius: 24px; overflow: hidden; }
.split-visual { flex: 1.15; position: relative; background: var(--grad); overflow: hidden; display: none; }
.split-visual video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split-visual::after { content: ''; position: absolute; inset: 0; background: var(--grad-overlay); }
.split-visual-text { position: absolute; left: 40px; right: 40px; bottom: 40px; z-index: 1; color: #fff; }
.split-visual-text .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .4px; opacity: .85; margin-bottom: 8px; }
.split-visual-text h2 { font-family: var(--font-display); font-size: 30px; font-weight: 400; line-height: 1.25; max-width: 420px; }
.split-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.back-home { position: absolute; top: 24px; left: 24px; font-size: 13px; color: var(--gray-600); display: flex; align-items: center; gap: 6px; z-index: 2; }
.back-home:hover { color: var(--indigo); }
.auth-title { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -0.4px; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--gray-600); margin-bottom: 28px; }
.auth-sub a { color: var(--indigo); font-weight: 600; }
.auth .form-group { margin-bottom: 16px; }
.auth .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.auth .form-input {
  width: 100%; padding: 10px 13px; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .15s;
}
.auth .form-input:focus { border-color: var(--indigo); box-shadow: var(--focus-ring); }
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 40px; }
.pw-toggle {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: none; background: none;
  color: var(--gray-400); cursor: pointer; border-radius: 6px; transition: color .15s;
}
.pw-toggle:hover { color: var(--gray-600); }
.submit-btn {
  width: 100%; background: var(--grad); color: #fff;
  padding: 12px; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px;
  transition: transform .15s, box-shadow .15s;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-brand); }
.auth-footer { text-align: center; font-size: 13px; color: var(--gray-400); margin-top: 20px; }
.auth-footer a { color: var(--indigo); font-weight: 600; }
.error-box { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.success-box { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.plan-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.plan-opt { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 12px 10px; cursor: pointer; transition: all .15s; text-align: center; position: relative; }
.plan-opt:hover { border-color: #6ee7b7; }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt.selected { border-color: var(--indigo); background: #d1fae5; }
.plan-opt-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-600); margin-bottom: 4px; }
.plan-opt-price { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -0.5px; }
.plan-opt-price sup { font-size: 11px; vertical-align: top; margin-top: 4px; }
.plan-opt.selected .plan-opt-name { color: var(--indigo); }
.auth-meta { text-align: center; font-size: 12px; color: var(--gray-400); margin-top: 16px; }

/* ── Superadmin ──────────────────────────────────────────────────────────────
   Sidebar (nav) stays its original dark theme untouched below; the main content
   area (topbar + page body) is a light theme, so this block mixes both — read
   each rule's selector, not the section comment, to know which theme it's in. */
html.superadmin body { background: #F4F5F8; color: #1E293B; font-size: 14px; line-height: 1.5; }
.superadmin .sidebar { width: 220px; background: #1A1B2E; border-right: 1px solid #2D2D44; }
.superadmin .sidebar-brand { padding: 20px; border-bottom: 1px solid #2D2D44; }
.superadmin .sidebar-brand-name { font-weight: 800; font-size: 15px; color: #F0F0F5; display: flex; align-items: center; gap: 8px; }
.superadmin .sidebar-brand-sub { font-size: 10px; color: #9494A8; margin-top: 2px; font-family: monospace; }
.superadmin .sidebar-nav { padding: 12px 0; }
.superadmin .nav-section { padding: 8px 16px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #5C5C72; }
.superadmin .nav-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  color: #9494A8; font-size: 13px; font-weight: 500;
  transition: all .15s; border-left: 2px solid transparent;
}
.superadmin .nav-item:hover { color: #F0F0F5; background: #2D2D44; }
.superadmin .nav-item.active { color: var(--cyan); border-left-color: var(--cyan); background: #1A1B2E; }
.superadmin .main-area { margin-left: 220px; flex: 1; }
.superadmin .topbar { background: #FFFFFF; border-bottom: 1px solid #E2E8F0; padding: 0 24px; height: 52px; }
.superadmin .topbar-title { font-size: 15px; font-weight: 700; color: #0F172A; flex: 1; }
.superadmin .page-body { padding: 24px; }
.superadmin .stats-grid { gap: 12px; margin-bottom: 24px; }
.superadmin .stat-card { background: #FFFFFF; border: 1px solid #E2E8F0; border-radius: var(--radius-sm); padding: 16px; }
.superadmin .stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #64748B; font-family: monospace; margin-bottom: 6px; }
.superadmin .stat-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; color: #0F172A; }
.superadmin .stat-value.green { color: #16A34A; }
.superadmin .stat-value.amber { color: #D97706; }
.superadmin .stat-value.red { color: #DC2626; }
.superadmin .stat-value.blue { color: #4F46E5; }
.superadmin .card { background: #FFFFFF; border: 1px solid #E2E8F0; border-radius: var(--radius-sm); margin-bottom: 16px; }
.superadmin .card-header { padding: 14px 18px; border-bottom: 1px solid #E2E8F0; }
.superadmin .card-title { font-size: 13px; font-weight: 700; color: #0F172A; }
.superadmin .table th { padding: 10px 16px; font-size: 10px; color: #64748B; border-bottom: 1px solid #E2E8F0; text-transform: uppercase; letter-spacing: .4px; }
.superadmin .table td { padding: 11px 16px; border-bottom: 1px solid #F1F5F9; font-size: 13px; color: #1E293B; }
.superadmin .table tr:hover td { background: #F8FAFC; }
.superadmin .badge { font-family: monospace; }
.superadmin .badge-active { background: #ECFDF5; color: #047857; }
.superadmin .badge-trial { background: #FFFBEB; color: #B45309; }
.superadmin .badge-suspended { background: #FEF2F2; color: #DC2626; }
.superadmin .badge-past_due { background: #FEF2F2; color: #DC2626; }
.superadmin .badge-cancelled { background: #F1F5F9; color: #64748B; }
.superadmin .badge-starter { background: #F1F5F9; color: #64748B; }
.superadmin .badge-pro { background: #ECFDF5; color: #059669; }
.superadmin .badge-studio { background: #FFFBEB; color: #B45309; }
.superadmin .btn { padding: 7px 14px; border-radius: 6px; font-size: 12px; }
.superadmin .btn-primary { background: var(--indigo); color: #fff; }
.superadmin .btn-primary:hover { background: #065f46; }
.superadmin .btn-outline { background: #fff; border: 1px solid #CBD5E1; color: #334155; }
.superadmin .btn-outline:hover { background: #F8FAFC; border-color: #94A3B8; }
.superadmin .btn-danger { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.superadmin .btn-danger:hover { background: #FEE2E2; }
.superadmin .btn-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.superadmin .btn-success:hover { background: #D1FAE5; }
.superadmin input, .superadmin select { background: #FFFFFF; border: 1px solid #CBD5E1; color: #0F172A; padding: 7px 12px; border-radius: 6px; font-size: 13px; outline: none; }
.superadmin input:focus, .superadmin select:focus { border-color: var(--indigo); }
.superadmin .flash-msg { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.superadmin .flash-msg.success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.superadmin .flash-msg.error { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }

/* ── Client documents ─────────────────────────────────────────────────────── */
.client-doc body { background: var(--bg); margin: 0; color: var(--ink); }
.doc-toolbar { max-width: 820px; margin: 0 auto; padding: 20px 24px 0; display: flex; justify-content: flex-end; gap: 8px; }
.doc-toolbar button {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--gray-700); transition: border-color .15s;
}
.doc-toolbar button:hover { border-color: var(--indigo); color: var(--indigo); }
.doc-wrap {
  max-width: 820px; margin: 16px auto 80px; background: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.doc-top {
  padding: 40px 48px 32px; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 24px; position: relative;
}
.doc-top::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .nav-links {
    position: fixed; top: 66px; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 12px; gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 12px 24px rgba(0,0,0,.06);
    transform: translateY(-130%); opacity: 0;
    transition: transform .25s, opacity .25s; pointer-events: none;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-link, .nav-cta { width: 100%; text-align: center; margin: 0; }
  .nav-burger { display: block; }
  .footer-top { flex-direction: column; }
  .footer-links { gap: 28px; }
}

@media (max-width: 768px) {
  .dashboard .sidebar, .superadmin .sidebar { transform: translateX(-100%); transition: transform .25s; z-index: 50; }
  .dashboard .sidebar.open, .superadmin .sidebar.open { transform: none; }
  .dashboard .sidebar-overlay.open, .superadmin .sidebar-overlay.open { display: block; }
  .dashboard .main-area, .superadmin .main-area { margin-left: 0; }
  .dashboard .topbar-menu-btn, .superadmin .topbar-menu-btn { display: flex; align-items: center; justify-content: center; }
  .dashboard .form-row, .superadmin .form-row { grid-template-columns: 1fr; }
  .dashboard .stats-grid, .superadmin .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 860px) {
  .split-visual { display: block; }
}

/* ── Broad mobile pass — shared classes used across tenant/superadmin/client pages ── */
@media (max-width: 640px) {
  .page-body, .superadmin .page-body { padding: 16px; }
  .card-body { padding: 14px; }
  .card-header { padding: 13px 14px; }
  .page-header { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px; }
  .page-header > div:not(.page-header-text) { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-header-text h1 { font-size: 19px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .topbar { padding: 0 14px; }
  .topbar-title { font-size: 14.5px; }
  .modal, .modal-backdrop .modal { padding: 18px; max-width: 100%; width: 94%; }
  .table th, .table td { padding: 9px 10px; font-size: 12.5px; }
  .plan-select { grid-template-columns: 1fr; }
  .split-form { padding: 32px 18px; }
  .auth-box { max-width: 100%; }
  .inv-top, .doc-top { padding: 24px 20px; flex-direction: column; gap: 16px; }
  .inv-heading { text-align: left; }
  .inv-meta-row { padding: 18px 20px; flex-direction: column; gap: 12px; }
  .inv-body { padding: 20px; }
  .totals { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .sidebar-brand { padding: 16px; }
  .btn { padding: 9px 14px; font-size: 13.5px; }
}

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

@media (max-width: 520px) {
  .tenant-usage-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 500px) {
  .item-row, .line-items-head { min-width: 420px; }
}
