/**
* Template Name: SaaS Product
* Updated: May 30 2023 with Bootstrap v5.3.0
* Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
*/

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
:root {
  scroll-behavior: smooth;

  /* Theme Variables - Default: Cool Gray (7/10) */
  /* Background */
  --theme-body-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 50%, #f0f4f8 100%);
  /* Header rides the ramp too (2026-08-18). It was rgba(255,255,255,.85) with a
     hardcoded indigo shadow/border in EVERY light theme — a white bar over a
     themed page gradient, the most visible piece of theme-blind chrome. Now
     translucent-tinted from the card surface with the theme's own hue in the
     shadow/border. Defined AFTER the surface ramp below? No — custom properties
     resolve at use time, so declaration order within a block does not matter. */
  --theme-header-bg: color-mix(in srgb, var(--theme-surface-card) 86%, transparent);
  --theme-header-shadow: 0px 4px 24px rgba(var(--theme-primary-rgb), 0.10);
  --theme-header-border: rgba(var(--theme-primary-rgb), 0.08);
  /* Sidebar is a DELIBERATE per-theme panel colour (each theme block sets its
     own --theme-sidebar-bg — a hand-picked light accent that flows with that
     theme, not a mechanical wash of the primary). Default = Cool Gray indigo. */
  --theme-sidebar-bg: linear-gradient(180deg, #f4f6ff 0%, #eaeefb 100%);
  --theme-sidebar-shadow: 4px 0px 24px rgba(var(--theme-primary-rgb), 0.10);
  --theme-sidebar-border: rgba(var(--theme-primary-rgb), 0.14);

  /* Primary Colors — brand teal (retired the indigo #4154f1) */
  --theme-primary: #008580;
  --theme-primary-hover: #009c93;
  --theme-primary-light: rgba(0, 133, 128, 0.1);
  --theme-primary-rgb: 0, 133, 128;

  /* Text Colors */
  --theme-text-primary: #012970;
  --theme-text-secondary: #444444;
  --theme-text-muted: #899bbd;

  /* ── SURFACE RAMP (2026-08-18) ────────────────────────────────────────────
     Before this, light themes were ACCENT-ONLY: they never set --theme-card-bg,
     so every card/table in all 11 light themes rendered pure #ffffff with
     neutral black-alpha washes — themed buttons on an untinted, slightly dingy
     surface. Midnight proved the full-surface-contract model works, so light
     themes now get one too.

     The LADDER (luminance) comes from the neutral bases below; the HUE comes
     from each theme's own accent via --theme-tint. At --theme-tint: 0% a theme
     is deliberately neutral (graphite/slate) and still keeps a correct ladder.
     Adding a theme stays a ~12-line block — no hand-mixed palette.

     color-mix is Chrome-safe and already shipped here (header.component.css
     progress bar). Hand-authored per-theme surfaces can replace any rung that
     mixes badly — the token names are the contract, not the formula. */
  --theme-tint: 4%;                     /* per-theme hue strength — the ONE knob */
  --theme-tint-strong: calc(var(--theme-tint) * 1.5);   /* derived, so overriding --theme-tint alone scales the whole ramp */

  --theme-surface-raised: #ffffff;                                                    /* menus, popovers — above cards */
  --theme-surface-card: color-mix(in srgb, var(--theme-primary) var(--theme-tint), #ffffff);
  --theme-surface-sunken: color-mix(in srgb, var(--theme-primary) var(--theme-tint-strong), #f6f7f9);  /* table headers, wells, inputs */
  --theme-surface-chip: color-mix(in srgb, var(--theme-primary) var(--theme-tint-strong), #eef0f4);    /* chips, stripes, hover fills */
  --theme-hairline: color-mix(in srgb, var(--theme-primary) calc(var(--theme-tint) * 2), #e4e7ec);
  --theme-hairline-strong: color-mix(in srgb, var(--theme-primary) calc(var(--theme-tint) * 3), #d5d9e0);

  /* ── SHAPE (2026-08-18) ───────────────────────────────────────────────────
     Lets a theme carry a personality beyond colour (soft/pill vs hard/technical).
     Defaults are Bootstrap's own values, so nothing changes unless a theme opts
     in. Mapped onto --bs-border-radius* below, which is the app's de-facto shape
     system — one hook themes every Bootstrap surface (buttons, badges, cards,
     inputs, dropdowns) without touching component CSS. */
  --theme-radius: 0.375rem;             /* base control radius */
  --theme-radius-sm: 0.25rem;
  --theme-radius-lg: 0.5rem;
  --theme-radius-badge: 999px;          /* pill by default */
  --theme-radius-btn: 7px;              /* app buttons (flextable ghost chips etc.) */
  --theme-radius-card: 10px;

  --bs-border-radius: var(--theme-radius);
  --bs-border-radius-sm: var(--theme-radius-sm);
  --bs-border-radius-lg: var(--theme-radius-lg);

  /* ── ELEVATION (2026-08-18) ───────────────────────────────────────────────
     A shadow SCALE, so "raised" is a token rather than a literal re-invented
     per component. Defaults carry the theme hue (matching the existing
     --theme-card-shadow look); Daylight and Midnight override with neutral
     layered shadows. Two layers is what reads as real: a tight contact
     shadow for the edge plus a soft ambient one for the lift. */
  --theme-shadow-xs: 0 1px 2px rgba(var(--theme-primary-rgb), 0.06);
  --theme-shadow-sm: 0 1px 3px rgba(var(--theme-primary-rgb), 0.10), 0 1px 2px rgba(var(--theme-primary-rgb), 0.06);
  --theme-shadow-md: 0 4px 8px -2px rgba(var(--theme-primary-rgb), 0.12), 0 2px 4px -2px rgba(var(--theme-primary-rgb), 0.07);
  --theme-shadow-lg: 0 12px 16px -4px rgba(var(--theme-primary-rgb), 0.12), 0 4px 6px -2px rgba(var(--theme-primary-rgb), 0.05);

  /* Cards & Surfaces — now derived from the ramp so all ~67 consumers of
     --theme-card-bg follow the active theme automatically. */
  --theme-card-bg: var(--theme-surface-card);
  --theme-card-border: var(--theme-hairline);
  /* was a hardcoded BLUE shadow (rgba(1,41,112,.1)) on every light theme —
     it fought amber/rose/sage. Now carries the theme's own hue. */
  --theme-card-shadow: 0px 0px 30px rgba(var(--theme-primary-rgb), 0.10);

  /* Buttons */
  --theme-btn-primary-bg: #008580;
  --theme-btn-primary-text: #ffffff;
  --theme-btn-primary-hover: #009c93;

  /* Sidebar Navigation */
  --theme-nav-link-color: #012970;
  --theme-nav-link-active: #008580;
  --theme-nav-icon-color: #899bbd;
  --theme-nav-hover-bg: rgba(0, 133, 128, 0.08);
}

/* Theme: Soft Blue (6/10) */
[data-theme="soft-blue"] {
  --theme-tint: 4%;
  --theme-body-gradient: linear-gradient(135deg, #e8f4fc 0%, #d4e9f7 40%, #c5dff5 70%, #e0f0fa 100%);
  --theme-primary: #0284c7;
  --theme-primary-hover: #0ea5e9;
  --theme-primary-light: rgba(2, 132, 199, 0.1);
  --theme-primary-rgb: 2, 132, 199;
  --theme-text-primary: #0c4a6e;
  --theme-btn-primary-bg: #0284c7;
  --theme-btn-primary-hover: #0ea5e9;
  --theme-nav-link-active: #0284c7;
  --theme-nav-hover-bg: rgba(2, 132, 199, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #eaf5fd 0%, #d8eaf7 100%);
}

/* Theme: Slate - deeper gray with hint of blue */
[data-theme="slate"] {
  --theme-tint: 0%;  /* deliberately NEUTRAL — ladder stays grey */
  --theme-body-gradient: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 40%, #b4bfcc 70%, #e2e8f0 100%);
  --theme-primary: #475569;
  --theme-primary-hover: #64748b;
  --theme-primary-light: rgba(71, 85, 105, 0.1);
  --theme-primary-rgb: 71, 85, 105;
  --theme-text-primary: #1e293b;
  --theme-btn-primary-bg: #475569;
  --theme-btn-primary-hover: #64748b;
  --theme-nav-link-active: #475569;
  --theme-nav-hover-bg: rgba(71, 85, 105, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #eff2f6 0%, #e1e7f0 100%);
}

/* Theme: Sage - soft green/gray */
[data-theme="sage"] {
  --theme-tint: 4%;
  --theme-body-gradient: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 35%, #a7f3d0 65%, #ecfdf5 100%);
  --theme-primary: #059669;
  --theme-primary-hover: #10b981;
  --theme-primary-light: rgba(5, 150, 105, 0.1);
  --theme-primary-rgb: 5, 150, 105;
  --theme-text-primary: #064e3b;
  --theme-btn-primary-bg: #059669;
  --theme-btn-primary-hover: #10b981;
  --theme-nav-link-active: #059669;
  --theme-nav-hover-bg: rgba(5, 150, 105, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #ecfbf3 0%, #d6f2e5 100%);
}

/* Theme: Rose - soft pink */
[data-theme="rose"] {
  --theme-tint: 3%;  /* warm, highly saturated accent — muddies fast */
  --theme-body-gradient: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 35%, #fecdd3 65%, #fff1f2 100%);
  --theme-primary: #e11d48;
  --theme-primary-hover: #f43f5e;
  --theme-primary-light: rgba(225, 29, 72, 0.1);
  --theme-primary-rgb: 225, 29, 72;
  --theme-text-primary: #881337;
  --theme-btn-primary-bg: #e11d48;
  --theme-btn-primary-hover: #f43f5e;
  --theme-nav-link-active: #e11d48;
  --theme-nav-hover-bg: rgba(225, 29, 72, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #fdf0f3 0%, #fadfe6 100%);
}

/* Theme: Amber - warm golden */
[data-theme="amber"] {
  --theme-tint: 3%;  /* warm, highly saturated accent — muddies fast */
  --theme-body-gradient: linear-gradient(135deg, #fffbeb 0%, #fef3c7 35%, #fde68a 65%, #fffbeb 100%);
  --theme-primary: #d97706;
  --theme-primary-hover: #f59e0b;
  --theme-primary-light: rgba(217, 119, 6, 0.1);
  --theme-primary-rgb: 217, 119, 6;
  --theme-text-primary: #78350f;
  --theme-btn-primary-bg: #d97706;
  --theme-btn-primary-hover: #f59e0b;
  --theme-nav-link-active: #d97706;
  --theme-nav-hover-bg: rgba(217, 119, 6, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #fdf7ea 0%, #f9ebcd 100%);
}

/* Theme: Life - vibrant green, fresh and energetic */
[data-theme="life"] {
  --theme-tint: 4%;
  --theme-body-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 30%, #bbf7d0 60%, #f0fdf4 100%);
  --theme-primary: #16a34a;
  --theme-primary-hover: #22c55e;
  --theme-primary-light: rgba(22, 163, 74, 0.1);
  --theme-primary-rgb: 22, 163, 74;
  --theme-text-primary: #14532d;
  --theme-btn-primary-bg: #16a34a;
  --theme-btn-primary-hover: #22c55e;
  --theme-nav-link-active: #16a34a;
  --theme-nav-hover-bg: rgba(22, 163, 74, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #edfcf1 0%, #d8f5e1 100%);
}

/* Theme: Violet - rich royal purple */
[data-theme="violet"] {
  --theme-tint: 4%;
  --theme-body-gradient: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 35%, #ddd6fe 65%, #f5f3ff 100%);
  --theme-primary: #7c3aed;
  --theme-primary-hover: #8b5cf6;
  --theme-primary-light: rgba(124, 58, 237, 0.1);
  --theme-primary-rgb: 124, 58, 237;
  --theme-text-primary: #4c1d95;
  --theme-btn-primary-bg: #7c3aed;
  --theme-btn-primary-hover: #8b5cf6;
  --theme-nav-link-active: #7c3aed;
  --theme-nav-hover-bg: rgba(124, 58, 237, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #f4f0fe 0%, #e7defc 100%);
}

/* Theme: Teal - cool teal and seafoam */
[data-theme="teal"] {
  --theme-tint: 4%;
  --theme-body-gradient: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 35%, #99f6e4 65%, #f0fdfa 100%);
  --theme-primary: #0d9488;
  --theme-primary-hover: #14b8a6;
  --theme-primary-light: rgba(13, 148, 136, 0.1);
  --theme-primary-rgb: 13, 148, 136;
  --theme-text-primary: #134e4a;
  --theme-btn-primary-bg: #0d9488;
  --theme-btn-primary-hover: #14b8a6;
  --theme-nav-link-active: #0d9488;
  --theme-nav-hover-bg: rgba(13, 148, 136, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #e9faf6 0%, #d2f2ec 100%);
}

/* Theme: Coral - warm coral and salmon */
[data-theme="coral"] {
  --theme-tint: 3%;  /* warm, highly saturated accent — muddies fast */
  --theme-body-gradient: linear-gradient(135deg, #fff5f5 0%, #ffe8e3 35%, #ffcdc4 65%, #fff5f5 100%);
  --theme-primary: #f0563d;
  --theme-primary-hover: #fb7357;
  --theme-primary-light: rgba(240, 86, 61, 0.1);
  --theme-primary-rgb: 240, 86, 61;
  --theme-text-primary: #7c2d12;
  --theme-btn-primary-bg: #f0563d;
  --theme-btn-primary-hover: #fb7357;
  --theme-nav-link-active: #f0563d;
  --theme-nav-hover-bg: rgba(240, 86, 61, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #fdf1ed 0%, #fbded5 100%);
}

/* Theme: Graphite - minimal neutral monochrome */
[data-theme="graphite"] {
  --theme-tint: 0%;  /* deliberately NEUTRAL — ladder stays grey */
  /* Graphite also demonstrates the SHAPE axis: crisp/technical corners. */
  --theme-radius: 4px;
  --theme-radius-sm: 3px;
  --theme-radius-lg: 5px;
  --theme-radius-badge: 4px;
  --theme-radius-btn: 4px;
  --theme-radius-card: 5px;
  --theme-body-gradient: linear-gradient(135deg, #fafafa 0%, #f4f4f5 40%, #e4e4e7 70%, #fafafa 100%);
  --theme-primary: #3f3f46;
  --theme-primary-hover: #52525b;
  --theme-primary-light: rgba(63, 63, 70, 0.1);
  --theme-primary-rgb: 63, 63, 70;
  --theme-text-primary: #18181b;
  --theme-btn-primary-bg: #3f3f46;
  --theme-btn-primary-hover: #52525b;
  --theme-nav-link-active: #3f3f46;
  --theme-nav-hover-bg: rgba(63, 63, 70, 0.08);
  --theme-sidebar-bg: linear-gradient(180deg, #f5f5f7 0%, #e9e9ed 100%);
}

/* ══════════════════════════════════════════════════════════════════════════
   Theme: DAYLIGHT — the official light mode (2026-08-18)

   The other ten light themes are accent swaps over a shared neutral base:
   they change the hue and inherit whatever grey the base happened to use.
   Daylight is the light counterpart to Midnight — it overrides the FULL
   contract (surfaces, ink, hairlines, shadow, shape, and the Bootstrap
   ramp), so it owns its look outright rather than inheriting it.

   It shares Midnight's indigo (#6366f1). That is the point: Daylight and
   Midnight are one product in two modes, not two unrelated skins.

   THREE DEPARTURES from the older themes, each deliberate:

   1. NEUTRALS ARE COOL, NOT BLUE. The base ramp (#101828 → #F9FAFB) is the
      Untitled-UI/Linear family — a slightly cool grey that reads as clean
      rather than tinted. --theme-tint is 0: Daylight does NOT wash its
      surfaces with the accent. White stays white. Depth comes from shadow
      and hairline, which is what makes a SaaS UI look crisp instead of
      pastel.

   2. THE PAGE IS ALMOST FLAT. Every other theme paints a three-stop 135°
      gradient. Daylight uses a near-imperceptible vertical wash, so the
      cards floating on it are the visual event. Busy gradients are the
      single loudest "old admin template" tell.

   3. SHADOWS ARE NEUTRAL AND LAYERED. The shared default is one 30px blur
      carrying the theme hue — a coloured haze. Daylight uses the standard
      two-layer recipe (tight contact shadow + soft ambient), in neutral
      ink. This is most of why the surfaces read as elevated.
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="daylight"] {
  color-scheme: light;

  /* Page — a whisper of vertical wash, not a diagonal gradient. It has to sit
     a few steps BELOW card white or the cards stop reading as cards: white on
     near-white leaves nothing but the hairline doing the work. This is the
     classic gray-50 page / white card pairing. */
  --theme-body-gradient: linear-gradient(180deg, #f8f9fb 0%, #f4f6f9 100%);

  /* Header — near-opaque white over the wash, held by a hairline rather
     than a shadow. The blur is applied by header.component.css. */
  --theme-header-bg: rgba(255, 255, 255, 0.88);
  --theme-header-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --theme-header-border: #eaecf0;

  /* Sidebar — WHITE, divided by a hairline. Every other theme uses a
     tinted gradient panel; a white rail with a crisp edge is the modern
     shape and it lets the active-item accent actually read. */
  --theme-sidebar-bg: #ffffff;
  --theme-sidebar-shadow: none;
  --theme-sidebar-border: #eaecf0;

  /* Accent — Midnight's indigo, at light-mode weight */
  --theme-primary: #008580;
  --theme-primary-hover: #009c93;
  --theme-primary-light: rgba(0, 133, 128, 0.08);
  --theme-primary-rgb: 0, 133, 128;

  /* Ink — the cool-neutral ladder. #101828 on #ffffff is ~17:1 (AAA);
     #475467 body is ~8.6:1; #98A2B3 is reserved for non-essential text
     only (~2.9:1 — never for anything a user must read). */
  --theme-text-primary: #101828;
  --theme-text-secondary: #475467;
  --theme-text-muted: #98a2b3;

  /* Surface ramp — set OUTRIGHT (like Midnight), not tinted. tint:0 also
     guarantees any rung not listed here can't mix the accent back in. */
  --theme-tint: 0%;
  --theme-surface-raised: #ffffff;      /* menus, popovers — lifted by shadow */
  --theme-surface-card: #ffffff;
  --theme-surface-sunken: #f9fafb;      /* table headers, wells, inputs */
  --theme-surface-chip: #f2f4f7;        /* chips, stripes, hover fills */
  --theme-hairline: #eaecf0;
  --theme-hairline-strong: #d0d5dd;

  /* Shape — 8px controls / 12px cards */
  --theme-radius: 8px;
  --theme-radius-sm: 6px;
  --theme-radius-lg: 12px;
  --theme-radius-badge: 999px;
  --theme-radius-btn: 8px;
  --theme-radius-card: 12px;

  /* Elevation */
  --theme-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --theme-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.10), 0 1px 2px rgba(16, 24, 40, 0.06);
  --theme-shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.10), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --theme-shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);

  --theme-card-bg: #ffffff;
  --theme-card-border: #eaecf0;
  --theme-card-shadow: var(--theme-shadow-xs);

  --theme-btn-primary-bg: #008580;
  --theme-btn-primary-text: #ffffff;
  --theme-btn-primary-hover: #009c93;

  --theme-nav-link-color: #475467;
  --theme-nav-link-active: #008580;
  --theme-nav-icon-color: #98a2b3;
  --theme-nav-hover-bg: #f9fafb;

  /* Bootstrap ramp. Midnight harmonizes the DARK ramp because
     data-bs-theme="dark" re-tints it; light has no such switch, so these
     STATIC values are the only way vendor surfaces (modals, dropdowns,
     tables, form controls, list groups) follow Daylight instead of
     Bootstrap's stock #dee2e6 greys. Same reason the midnight sweep had to
     scope --bs-* at :host for components that use them in fallback slots. */
  --bs-body-bg: #ffffff;
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-body-color: #475467;
  --bs-body-color-rgb: 71, 84, 103;
  --bs-emphasis-color: #101828;
  --bs-emphasis-color-rgb: 16, 24, 40;
  --bs-secondary-color: rgba(71, 84, 103, 0.75);
  --bs-secondary-color-rgb: 71, 84, 103;
  --bs-secondary-bg: #f9fafb;
  --bs-secondary-bg-rgb: 249, 250, 251;
  --bs-tertiary-color: rgba(71, 84, 103, 0.5);
  --bs-tertiary-color-rgb: 71, 84, 103;
  --bs-tertiary-bg: #f2f4f7;
  --bs-tertiary-bg-rgb: 242, 244, 247;
  --bs-border-color: #eaecf0;
  --bs-border-color-translucent: rgba(16, 24, 40, 0.08);
  --bs-heading-color: #101828;
  --bs-link-color: #6366f1;
  --bs-link-color-rgb: 99, 102, 241;
  --bs-link-hover-color: #4f46e5;
  --bs-link-hover-color-rgb: 79, 70, 229;
}

/* Theme: Midnight - dark mode. Unlike the light themes (accent-only swaps)
   this overrides the FULL surface/text contract. DataService.setTheme also
   stamps data-bs-theme="dark" for this theme so vendor Bootstrap surfaces
   (modals, dropdowns, tables, form controls) flip natively. */
[data-theme="midnight"] {
  color-scheme: dark;
  --theme-body-gradient: linear-gradient(135deg, #0f1218 0%, #141926 50%, #10131b 100%);
  --theme-header-bg: rgba(19, 23, 34, 0.88);
  --theme-header-shadow: 0px 4px 24px rgba(0, 0, 0, 0.45);
  --theme-header-border: rgba(129, 140, 248, 0.16);
  --theme-sidebar-bg: linear-gradient(180deg, #161b28 0%, #10141d 100%);
  --theme-sidebar-shadow: 4px 0px 24px rgba(0, 0, 0, 0.45);
  --theme-sidebar-border: rgba(129, 140, 248, 0.18);
  --theme-primary: #00D3CB;
  --theme-primary-hover: #33ddd6;
  --theme-primary-light: rgba(0, 211, 203, 0.16);
  --theme-primary-rgb: 0, 211, 203;
  --theme-text-primary: #e7ecf5;
  --theme-text-secondary: #b8c1d1;
  --theme-text-muted: #8b95a7;
  --theme-card-bg: #1a1d24;
  --theme-card-border: rgba(255, 255, 255, 0.09);
  --theme-card-shadow: 0px 0px 30px rgba(0, 0, 0, 0.35);

  /* Surface ramp (2026-08-18) — midnight sets these OUTRIGHT rather than
     tinting, because the dark ladder is hand-tuned. --theme-tint is 0 so any
     color-mix() rung that isn't overridden here can't inject a light base. */
  --theme-tint: 0%;
  --theme-surface-raised: #20242e;      /* menus, popovers */
  --theme-surface-card: #1a1d24;
  --theme-surface-sunken: #171b23;      /* table headers, wells, inputs */
  --theme-surface-chip: #262b36;
  --theme-hairline: #2a2f3a;
  --theme-hairline-strong: #3a4150;

  /* Elevation — dark UIs need deeper, more opaque shadows than light ones
     to read at all against a dark ground. */
  --theme-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --theme-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40), 0 1px 2px rgba(0, 0, 0, 0.30);
  --theme-shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.30);
  --theme-shadow-lg: 0 12px 16px -4px rgba(0, 0, 0, 0.50), 0 4px 6px -2px rgba(0, 0, 0, 0.30);

  --theme-btn-primary-bg: #00a39c;
  --theme-btn-primary-text: #06110f;
  --theme-btn-primary-hover: #14c0b7;
  --theme-nav-link-color: #cdd5e1;
  --theme-nav-link-active: #00D3CB;
  --theme-nav-icon-color: #8b95a7;
  --theme-nav-hover-bg: rgba(0, 211, 203, 0.12);

  /* Harmonize Bootstrap's native dark mode (data-bs-theme="dark") with the
     Midnight palette — bootstrap.min.css loads before this file, so these win
     over its default dark grays and keep vendor surfaces on our surface set. */
  --bs-body-bg: #12151c;
  --bs-body-bg-rgb: 18, 21, 28;
  --bs-body-color: #b8c1d1;
  --bs-body-color-rgb: 184, 193, 209;
  --bs-emphasis-color: #e7ecf5;
  --bs-emphasis-color-rgb: 231, 236, 245;
  --bs-secondary-color: rgba(184, 193, 209, 0.75);
  --bs-secondary-color-rgb: 184, 193, 209;
  --bs-secondary-bg: #20242e;
  --bs-secondary-bg-rgb: 32, 36, 46;
  --bs-tertiary-color: rgba(184, 193, 209, 0.5);
  --bs-tertiary-color-rgb: 184, 193, 209;
  --bs-tertiary-bg: #171b23;
  --bs-tertiary-bg-rgb: 23, 27, 35;
  --bs-border-color: #2a2f3a;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.12);
  --bs-heading-color: #e7ecf5;
  --bs-link-color: #818cf8;
  --bs-link-color-rgb: 129, 140, 248;
  --bs-link-hover-color: #a5b4fc;
  --bs-link-hover-color-rgb: 165, 180, 252;
}

/* Additional themes can be added here */
/* Usage: document.documentElement.setAttribute('data-theme', 'theme-name') */

/* Bootstrap Button Overrides for Theming */
.btn-primary {
  background-color: var(--theme-btn-primary-bg) !important;
  border-color: var(--theme-btn-primary-bg) !important;
  color: var(--theme-btn-primary-text) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: var(--theme-btn-primary-hover) !important;
  border-color: var(--theme-btn-primary-hover) !important;
  color: var(--theme-btn-primary-text) !important;
}

.btn-primary:focus,
.btn-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.5) !important;
}

.btn-outline-primary {
  color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-btn-primary-text) !important;
}

.btn-outline-primary:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.5) !important;
}

/* Secondary button - uses muted theme colors */
.btn-secondary:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.25) !important;
}

/* Link buttons using theme colors */
.btn-link {
  color: var(--theme-primary) !important;
}

.btn-link:hover {
  color: var(--theme-primary-hover) !important;
}

/* Check buttons and toggle buttons */
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
  background-color: var(--theme-btn-primary-hover) !important;
  border-color: var(--theme-btn-primary-hover) !important;
}

.btn-check:focus + .btn-primary {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.5) !important;
}

/* Outline Secondary - use theme colors */
.btn-outline-secondary {
  color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  background-color: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-btn-primary-text) !important;
}

.btn-outline-secondary:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.5) !important;
}

/* Light buttons - theme-aware borders and hover */
.btn-light {
  border-color: rgba(var(--theme-primary-rgb), 0.3) !important;
}

.btn-light:hover,
.btn-light:focus {
  background-color: var(--theme-primary-light) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-primary) !important;
}

.btn-light:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.25) !important;
}

/* Info buttons - use theme colors */
.btn-info {
  background-color: var(--theme-btn-primary-bg) !important;
  border-color: var(--theme-btn-primary-bg) !important;
  color: var(--theme-btn-primary-text) !important;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
  background-color: var(--theme-btn-primary-hover) !important;
  border-color: var(--theme-btn-primary-hover) !important;
  color: var(--theme-btn-primary-text) !important;
}

.btn-info:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.5) !important;
}

/* Outline Info - use theme colors */
.btn-outline-info {
  color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-btn-primary-text) !important;
}

/* Dropdown toggles - ensure caret inherits color */
.dropdown-toggle::after {
  border-top-color: currentColor !important;
}

/* Country code selector - keep white background to match phone input */
.country-code-btn.btn-outline-secondary {
  background-color: #fff !important;
  border-color: #ced4da !important;
  color: #212529 !important;
  cursor: pointer !important;
}

.country-code-btn.btn-outline-secondary:hover,
.country-code-btn.btn-outline-secondary:focus {
  background-color: #e9ecef !important;
  border-color: #ced4da !important;
  color: #212529 !important;
}

.country-code-btn.btn-outline-secondary:focus {
  box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25) !important;
}

/* Country code dropdown menu items */
.country-code-menu .dropdown-item {
  cursor: pointer !important;
}

.country-code-dropdown {
  cursor: pointer !important;
}

/* Text color utilities using theme */
.text-primary {
  color: var(--theme-primary) !important;
}

/* Remove focus outlines globally */
*:focus,
*:active {
  outline: none !important;
  box-shadow: none !important;
}

body {
  font-family: "Open Sans", sans-serif;
  background: var(--theme-body-gradient);
  background-attachment: fixed;
  color: var(--theme-text-secondary);
  min-height: 100vh;
}

a {
  color: var(--theme-primary);
  text-decoration: none;
}

a:hover {
  color: var(--theme-primary-hover);
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Nunito", sans-serif;
}

/*--------------------------------------------------------------
# Main
--------------------------------------------------------------*/
#main {
  margin-top: 60px;
  padding: 20px 30px;
  transition: all 0.3s;
}

@media (max-width: 1199px) {
  #main {
    padding: 20px;
  }
}

/*--------------------------------------------------------------
# Page Title
--------------------------------------------------------------*/
.pagetitle {
  margin-bottom: 10px;
}

.pagetitle h1 {
  font-size: 24px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--theme-text-primary);
}

/*--------------------------------------------------------------
# Back to top button
--------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  background: var(--theme-btn-primary-bg);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: all 0.4s;
}

.back-to-top i {
  font-size: 24px;
  color: var(--theme-btn-primary-text);
  line-height: 0;
}

.back-to-top:hover {
  background: var(--theme-btn-primary-hover);
  color: var(--theme-btn-primary-text);
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/*--------------------------------------------------------------
# Override some default Bootstrap stylings
--------------------------------------------------------------*/

/* Dropdown menus */
.dropdown-menu {
  border-radius: 4px;
  padding: 10px 0;
  animation-name: dropdown-animate;
  animation-duration: 0.2s;
  animation-fill-mode: both;
  border: 0;
  box-shadow: 0 5px 30px 0 rgba(82, 63, 105, 0.2);
  /* Ensure dropdown appears on top */
  z-index: 2147483647 !important;
  position: absolute !important;
}

/* Prevent dropdown from being clipped */
body, html {
  overflow: visible !important;
}

/* Override restrictive parent elements */
.container, .wrapper, .main-content, .dropdown, .dropdown-container, .dropdown-wrapper {
  overflow: visible !important;
  position: static !important;
}

/* Override parents that might be clipping the dropdown */
.mat-drawer-container, .sidebar-container, .table-responsive {
  overflow: visible !important;
  position: static !important;
}

/* Ensure the dropdown is always on top */
.dropdown-menu {
  z-index: 2147483647 !important;
  position: absolute !important;
}

/* Fix restrictive parent elements */
.btn-group,
.mat-drawer-content {
  position: static !important;
  overflow: visible !important;
}

/* Styling for dropdown items */
.dropdown-menu .dropdown-item {
  font-size: 14px;
  padding: 10px 15px;
  transition: 0.3s;
}

.dropdown-menu .dropdown-item:hover {
  background-color: var(--theme-nav-hover-bg);
}

/* Dropdown header and footer */
.dropdown-menu .dropdown-header,
.dropdown-menu .dropdown-footer {
  text-align: center;
  font-size: 15px;
  padding: 10px 25px;
}

.dropdown-menu .dropdown-footer a {
  color: var(--theme-text-secondary);
  text-decoration: underline;
}

.dropdown-menu .dropdown-footer a:hover {
  text-decoration: none;
}

.dropdown-menu .dropdown-divider {
  color: #a5c5fe;
  margin: 0;
}

.dropdown-menu .dropdown-item {
  font-size: 14px;
  padding: 10px 15px;
  transition: 0.3s;
}

.dropdown-menu .dropdown-item i {
  margin-right: 10px;
  font-size: 18px;
  line-height: 0;
}

.dropdown-menu .dropdown-item:hover {
  background-color: var(--theme-nav-hover-bg);
}

@media (min-width: 768px) {
  .dropdown-menu-arrow::before {
    content: "";
    width: 13px;
    height: 13px;
    background: var(--bs-dropdown-bg, #fff);
    position: absolute;
    top: -7px;
    right: 20px;
    transform: rotate(45deg);
    border-top: 1px solid var(--bs-dropdown-border-color, #eaedf1);
    border-left: 1px solid var(--bs-dropdown-border-color, #eaedf1);
  }
}

@keyframes dropdown-animate {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }

  0% {
    opacity: 0;
  }
}

/* Light Backgrounds */
.bg-primary-light {
  background-color: #cfe2ff;
  border-color: #cfe2ff;
}

.bg-secondary-light {
  background-color: #e2e3e5;
  border-color: #e2e3e5;
}

.bg-success-light {
  background-color: #d1e7dd;
  border-color: #d1e7dd;
}

.bg-danger-light {
  background-color: #f8d7da;
  border-color: #f8d7da;
}

.bg-warning-light {
  background-color: #fff3cd;
  border-color: #fff3cd;
}

.bg-info-light {
  background-color: #cff4fc;
  border-color: #cff4fc;
}

.bg-dark-light {
  background-color: #d3d3d4;
  border-color: #d3d3d4;
}

/* Card */
.card {
  margin-bottom: 30px;
  border: none;
  border-radius: 5px;
  box-shadow: var(--theme-card-shadow);
  background-color: var(--theme-card-bg);
}

.card-header,
.card-footer {
  border-color: var(--theme-card-border);
  background-color: var(--theme-card-bg);
  color: var(--theme-text-muted);
  padding: 15px;
}

.card-title {
  padding: 20px 0 15px 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--theme-text-primary);
  font-family: "Poppins", sans-serif;
}

.card-title span {
  color: var(--theme-text-muted);
  font-size: 14px;
  font-weight: 400;
}

.card-body {
  padding: 0 20px 20px 20px;
}

.card-img-overlay {
  background-color: rgba(255, 255, 255, 0.6);
}

/* Alerts */
.alert-heading {
  font-weight: 500;
  font-family: "Poppins", sans-serif;
  font-size: 20px;
}

/* Close Button */
.btn-close {
  background-size: 25%;
}

.btn-close:focus {
  outline: 0;
  box-shadow: none;
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--theme-card-border);
}

.accordion-button:focus {
  outline: 0;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  color: var(--theme-text-primary);
  background-color: var(--theme-primary-light);
}

.accordion-flush .accordion-button {
  padding: 15px 0;
  background: none;
  border: 0;
}

.accordion-flush .accordion-button:not(.collapsed) {
  box-shadow: none;
  color: var(--theme-primary);
}

.accordion-flush .accordion-body {
  padding: 0 0 15px 0;
  color: var(--theme-text-secondary);
  font-size: 15px;
}

/* Breadcrumbs */
.breadcrumb {
  font-size: 14px;
  font-family: "Nunito", sans-serif;
  color: var(--theme-text-muted);
  font-weight: 600;
}

.breadcrumb a {
  color: var(--theme-text-muted);
  transition: 0.3s;
}

.breadcrumb a:hover {
  color: var(--theme-primary);
}

.breadcrumb .breadcrumb-item::before {
  color: var(--theme-text-muted);
}

.breadcrumb .active {
  color: var(--theme-text-secondary);
  font-weight: 600;
}

/* Bordered Tabs */
.nav-tabs-bordered {
  border-bottom: 2px solid var(--theme-card-border);
}

.nav-tabs-bordered .nav-link {
  margin-bottom: -2px;
  border: none;
  color: var(--theme-text-secondary);
}

.nav-tabs-bordered .nav-link:hover,
.nav-tabs-bordered .nav-link:focus {
  color: var(--theme-primary);
}

.nav-tabs-bordered .nav-link.active {
  background-color: var(--theme-card-bg);
  color: var(--theme-primary);
  border-bottom: 2px solid var(--theme-primary);
}

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
.logo {
  line-height: 1;
}

@media (min-width: 1200px) {
  .logo {
    width: 280px;
  }
}

.logo img {
  max-height: 28px;
  margin-right: 8px;
}

.logo span {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: "Nunito", sans-serif;
  letter-spacing: -0.5px;
}

.header {
  transition: all 0.5s;
  z-index: 997;
  height: 60px;
  box-shadow: var(--theme-header-shadow);
  background: var(--theme-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-left: 20px;
  border-bottom: 1px solid var(--theme-header-border);
  overflow: visible; /* Allow dropdowns to extend beyond header */
  /* Toggle Sidebar Button */
  /* Search Bar */
}

.header .toggle-sidebar-btn {
  font-size: 32px;
  padding-left: 10px;
  cursor: pointer;
  color: var(--theme-text-primary);
}

.header .search-bar {
  min-width: 360px;
  padding: 0 20px;
}

@media (max-width: 1199px) {
  .header .search-bar {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    padding: 20px;
    box-shadow: 0px 0px 15px 0px rgba(1, 41, 112, 0.1);
    background: var(--theme-card-bg);
    z-index: 9999;
    transition: 0.3s;
    visibility: hidden;
    opacity: 0;
  }

  .header .search-bar-show {
    top: 60px;
    visibility: visible;
    opacity: 1;
  }

  /* Mobile search expanded state (Angular controlled) */
  .header .search-bar.mobile-search-expanded {
    top: 0;
    visibility: visible;
    opacity: 1;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--theme-card-bg);
    padding: 10px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    width: 100%;
  }

  .header .search-bar.mobile-search-expanded .search-form {
    width: 100%;
  }

  .header .search-bar.mobile-search-expanded .search-form input {
    width: calc(100% - 50px);
    font-size: 16px;
    padding: 12px;
  }

}

.header .search-form {
  width: 100%;
}

.header .search-form input {
  border: 0;
  font-size: 14px;
  color: var(--theme-text-primary);
  border: 1px solid rgba(var(--theme-primary-rgb), 0.2);
  padding: 7px 38px 7px 8px;
  border-radius: 3px;
  transition: 0.3s;
  width: 100%;
}

.header .search-form input:focus,
.header .search-form input:hover {
  outline: none;
  box-shadow: 0 0 10px 0 rgba(var(--theme-primary-rgb), 0.15);
  border: 1px solid rgba(var(--theme-primary-rgb), 0.3);
}

.header .search-form > button {
  border: 0;
  padding: 0;
  margin-left: -30px;
  background: none;
}

.header .search-form > button i {
  color: var(--theme-text-primary);
}

/*--------------------------------------------------------------
# Header Nav
--------------------------------------------------------------*/
.header-nav ul {
  list-style: none;
}

.header-nav>ul {
  margin: 0;
  padding: 0;
}

.header-nav .nav-icon {
  font-size: 22px;
  color: var(--theme-text-primary);
  margin-right: 25px;
  position: relative;
}

.header-nav .nav-profile {
  color: var(--theme-text-primary);
}

.header-nav .nav-profile img {
  max-height: 36px;
}

.header-nav .nav-profile span {
  font-size: 14px;
  font-weight: 600;
}

.header-nav .badge-number {
  /* Anchored by its LEFT edge at the icon's upper-right, so a wide count (292, 1,204)
     grows to the right into the nav-icon's 25px margin instead of sliding left over
     the icon (it used to be right-anchored: inset -2px -5px auto auto). */
  position: absolute;
  inset: -6px auto auto 55%;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  min-width: 18px;
  border-radius: 9px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.header-nav .notifications {
  inset: 8px -15px auto auto !important;
}

.header-nav .notifications .notification-item {
  display: flex;
  align-items: center;
  padding: 15px 10px;
  transition: 0.3s;
}

.header-nav .notifications .notification-item i {
  margin: 0 20px 0 10px;
  font-size: 24px;
}

.header-nav .notifications .notification-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.header-nav .notifications .notification-item p {
  font-size: 13px;
  margin-bottom: 3px;
  color: #919191;
}

.header-nav .notifications .notification-item:hover {
  background-color: var(--theme-nav-hover-bg);
}

.header-nav .messages {
  inset: 8px -15px auto auto !important;
  max-height: 400px;
  overflow-y: auto;
}

.header-nav .messages .message-item {
  padding: 4px 10px;
  transition: 0.15s;
  list-style: none;
}

.header-nav .messages .message-item:hover {
  background-color: var(--theme-nav-hover-bg);
}

.header-nav .messages .view-all-footer {
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--theme-card-border);
}

.header-nav .messages .view-all-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary, #4361ee);
  color: white;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}

.header-nav .messages .view-all-footer a:hover {
  background: var(--primary-dark, #3651d4);
}

.header-nav .messages .view-all-footer .count {
  opacity: 0.8;
  font-weight: 400;
}

.header-nav .profile {
  min-width: 240px;
  padding-bottom: 0;
  top: 8px !important;
}

.header-nav .profile .dropdown-header h6 {
  font-size: 18px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--theme-text-secondary);
}

.header-nav .profile .dropdown-header span {
  font-size: 14px;
}

.header-nav .profile .dropdown-item {
  font-size: 14px;
  padding: 10px 15px;
  transition: 0.3s;
}

.header-nav .profile .dropdown-item i {
  margin-right: 10px;
  font-size: 18px;
  line-height: 0;
}

.header-nav .profile .dropdown-item:hover {
  background-color: var(--theme-nav-hover-bg);
}

/*--------------------------------------------------------------
# Sidebar
--------------------------------------------------------------*/
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 240px;
  z-index: 996;
  transition: all 0.3s;
  padding: 12px 10px;
  overflow-x: clip;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #aab7cf transparent;
  box-shadow: var(--theme-sidebar-shadow);
  background: var(--theme-sidebar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--theme-sidebar-border);
}

/* Sidebar accordion styles - make transparent */
.sidebar .accordion-item {
  background: transparent;
  border: none;
}

.sidebar .accordion-button {
  background: transparent;
  padding: 8px 10px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-text-primary);
  box-shadow: none;
  border-radius: 8px;
  white-space: nowrap;
  /* padding 0.3s: glide the icon to the rail center on collapse (matches the
     sidebar width transition) instead of a justify-content:center leap. */
  transition: padding 0.3s;
}

.sidebar .accordion-button .menu-label {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Folder (accordion) menu icons: match the muted leaf nav-icon colour and size
   instead of inheriting the darker accordion-button text colour. */
.sidebar .accordion-button .material-icons {
  font-size: 18px;
  color: var(--theme-nav-icon-color);
  flex: 0 0 auto;
}

.sidebar .accordion-button:not(.collapsed) {
  background: transparent;
  color: var(--theme-primary);
}

.sidebar .accordion-button:hover {
  background: var(--theme-nav-hover-bg);
}

.sidebar .accordion-body {
  background: transparent;
  padding: 0;
}

@media (max-width: 1199px) {
  .sidebar {
    left: -264px;
  }
}

.sidebar::-webkit-scrollbar {
  width: 5px;
  height: 8px;
  background-color: #fff;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #aab7cf;
}

@media (min-width: 1200px) {

  #main,
  #footer {
    margin-left: var(--app-shell-left, 240px);
  }
}

@media (max-width: 1199px) {
  .toggle-sidebar .sidebar {
    left: 0;
  }
}

/* Desktop collapsed state: a 64px icon rail (icons stay visible + clickable,
   labels hidden, native title tooltips). Main content margin follows. */
@media (min-width: 1200px) {

  .toggle-sidebar #main,
  .toggle-sidebar #footer {
    margin-left: var(--app-shell-left, 64px);
  }

  /* Rail (collapsed) presentation. This USED TO be gated :not(.dialer-open-left)
     so a pinned dialer suppressed collapse entirely — but an explicit click of
     the collapse button is a deliberate user intent and must be honored even
     while the dialer is pinned. So these rules are ungated: when collapsed, the
     sidebar becomes the 64px rail regardless of the dialer. The dialer still
     pins --app-shell-left at 315px (content clearance) via the app-shell block
     below; only the sidebar's own width follows the collapse. */
  .toggle-sidebar .sidebar {
    width: 64px;
    padding: 12px 8px;
    overflow-x: hidden;
  }

  .toggle-sidebar .sidebar-nav .nav-link span {
    display: none;
  }

  /* Center the icon in the 64px rail via PADDING, not justify-content. A
     justify-content:center flip is instant and centers against the link's
     CURRENT (still-wide, mid-transition) width, so the icon LEAPS to the
     240px-center then slides back — the visible jerk. Left padding of ~15px
     seats an 18px icon dead-center of the 48px rail content box, and padding
     is animatable (see the padding transition on the base .nav-link /
     .accordion-button), so the icon glides the ~3px from its expanded x to
     the rail center instead of jumping. */
  .toggle-sidebar .sidebar-nav .nav-link {
    padding: 9px 15px;
  }

  .toggle-sidebar .sidebar-nav .nav-link i {
    margin-right: 0;
  }

  .toggle-sidebar .sidebar .accordion-button {
    padding: 9px 15px;
  }

  .toggle-sidebar .sidebar .accordion-button .menu-label {
    display: none;
  }

  .toggle-sidebar .sidebar .accordion-button .material-icons {
    margin-right: 0 !important; /* beat bootstrap's .me-2 !important */
  }

  .toggle-sidebar .sidebar .accordion-button::after {
    display: none; /* hide the chevron in rail mode */
  }

  /* Center an expanded folder's sub-menu icons at the SAME x as the parent
     folder / top-level rail icons (15px left padding matches the .nav-link and
     .accordion-button rail rules above), instead of the expanded-mode 34px
     indent which would hard-left them in the 64px rail. Padding — not
     justify-content — so the icon glides with the width transition (see the
     centering note on the .nav-link rail rule above). */
  .toggle-sidebar .sidebar-nav .nav-link.sub-link {
    padding-left: 15px;
  }
}

.sidebar-nav {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav li {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav .nav-item {
  margin-bottom: 2px;
}

.sidebar-nav .nav-heading {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--theme-text-muted);
  font-weight: 600;
  margin: 10px 0 5px 15px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-nav-link-active);
  /* padding 0.3s matches the sidebar's width transition so the icon glides to
     the rail center on collapse instead of leaping (see the rail padding rule). */
  transition: background 0.15s, color 0.15s, padding 0.3s;
  background: transparent;
  padding: 8px 10px;
  min-height: 38px;
  border-radius: 8px;
  white-space: nowrap;
}

.sidebar-nav .nav-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav .nav-link i {
  font-size: 18px;
  margin-right: 10px;
  color: var(--theme-primary);
  flex: 0 0 auto;
}

.sidebar-nav .nav-link.collapsed {
  color: var(--theme-nav-link-color);
  background: transparent;
}

.sidebar-nav .nav-link.collapsed i {
  color: var(--theme-nav-icon-color);
}

.sidebar-nav .nav-link:hover {
  color: var(--theme-primary);
  background: var(--theme-nav-hover-bg);
}

.sidebar-nav .nav-link:hover i {
  color: var(--theme-primary);
}

/* Active route (routerLinkActive) — tinted background + accent text */
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.collapsed.active {
  color: var(--theme-primary);
  background: var(--theme-primary-light);
}

.sidebar-nav .nav-link.active i,
.sidebar-nav .nav-link.collapsed.active i {
  color: var(--theme-primary);
}

/* Submenu links: indented under their folder in expanded mode */
.sidebar-nav .nav-link.sub-link {
  padding-left: 34px;
}

.sidebar-nav .nav-link .bi-chevron-down {
  margin-right: 0;
  transition: transform 0.2s ease-in-out;
}

.sidebar-nav .nav-link:not(.collapsed) .bi-chevron-down {
  transform: rotate(180deg);
}

.sidebar-nav .nav-content {
  padding: 5px 0 0 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav .nav-content a {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-nav-link-color);
  transition: 0.3;
  padding: 10px 0 10px 40px;
  transition: 0.3s;
}

.sidebar-nav .nav-content a i {
  font-size: 6px;
  margin-right: 8px;
  line-height: 0;
  border-radius: 50%;
}

.sidebar-nav .nav-content a:hover,
.sidebar-nav .nav-content a.active {
  color: var(--theme-primary);
}

.sidebar-nav .nav-content a.active i {
  background-color: var(--theme-primary);
}

/*--------------------------------------------------------------
# Dashboard
--------------------------------------------------------------*/
/* Filter dropdown */
.dashboard .filter {
  position: absolute;
  right: 0px;
  top: 11px;
}

.dashboard .filter .icon {
  color: var(--theme-text-muted);
  padding-right: 20px;
  padding-bottom: 5px;
  transition: 0.3s;
  font-size: 16px;
}

.dashboard .filter .icon:hover,
.dashboard .filter .icon:focus {
  color: var(--theme-primary);
}

.dashboard .filter .dropdown-header {
  padding: 8px 15px;
}

.dashboard .filter .dropdown-header h6 {
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--theme-text-muted);
  margin-bottom: 0;
  padding: 0;
}

.dashboard .filter .dropdown-item {
  padding: 8px 15px;
}

/* Info Cards */
.dashboard .info-card {
  padding-bottom: 10px;
}

.dashboard .info-card h6 {
  font-size: 28px;
  color: var(--theme-text-primary);
  font-weight: 700;
  margin: 0;
  padding: 0;
}

.dashboard .card-icon {
  font-size: 32px;
  line-height: 0;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  flex-grow: 0;
}

.dashboard .sales-card .card-icon {
  color: #4154f1;
  background: #f6f6fe;
}

.dashboard .revenue-card .card-icon {
  color: #2eca6a;
  background: #e0f8e9;
}

.dashboard .customers-card .card-icon {
  color: #ff771d;
  background: #ffecdf;
}

/* Activity */
.dashboard .activity {
  font-size: 14px;
}

.dashboard .activity .activity-item .activite-label {
  /* was #888 — a grey that belongs to no theme. The dashboard activity feed
     renders ten of these, so it was the most repeated off-palette ink in the
     app. */
  color: var(--theme-text-muted, #888);
  position: relative;
  flex-shrink: 0;
  flex-grow: 0;
  min-width: 64px;
}

.dashboard .activity .activity-item .activite-label::before {
  content: "";
  position: absolute;
  right: -11px;
  width: 4px;
  top: 0;
  bottom: 0;
  background-color: #eceefe;
}

.dashboard .activity .activity-item .activity-badge {
  margin-top: 3px;
  z-index: 1;
  font-size: 11px;
  line-height: 0;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid var(--theme-card-bg);
  flex-grow: 0;
}

.dashboard .activity .activity-item .activity-content {
  padding-left: 10px;
  padding-bottom: 20px;
}

.dashboard .activity .activity-item:first-child .activite-label::before {
  top: 5px;
}

.dashboard .activity .activity-item:last-child .activity-content {
  padding-bottom: 0;
}

/* News & Updates */
.dashboard .news .post-item+.post-item {
  margin-top: 15px;
}

.dashboard .news img {
  width: 80px;
  float: left;
  border-radius: 5px;
}

.dashboard .news h4 {
  font-size: 15px;
  margin-left: 95px;
  font-weight: bold;
  margin-bottom: 5px;
}

.dashboard .news h4 a {
  color: var(--theme-text-primary);
  transition: 0.3s;
}

.dashboard .news h4 a:hover {
  color: var(--theme-primary);
}

.dashboard .news p {
  font-size: 14px;
  color: #777777;
  margin-left: 95px;
}

/* Recent Sales */
.dashboard .recent-sales {
  font-size: 14px;
}

.dashboard .recent-sales .table thead {
  background: #f6f6fe;
}

.dashboard .recent-sales .table thead th {
  border: 0;
}

.dashboard .recent-sales .dataTable-top {
  padding: 0 0 10px 0;
}

.dashboard .recent-sales .dataTable-bottom {
  padding: 10px 0 0 0;
}

/* Top Selling */
.dashboard .top-selling {
  font-size: 14px;
}

.dashboard .top-selling .table thead {
  background: #f6f6fe;
}

.dashboard .top-selling .table thead th {
  border: 0;
}

.dashboard .top-selling .table tbody td {
  vertical-align: middle;
}

.dashboard .top-selling img {
  border-radius: 5px;
  max-width: 60px;
}

/*--------------------------------------------------------------
# Icons list page
--------------------------------------------------------------*/
.iconslist {
  display: grid;
  max-width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  padding-top: 15px;
}

.iconslist .icon {
  background-color: var(--theme-card-bg);
  border-radius: 0.25rem;
  text-align: center;
  color: var(--theme-text-primary);
  padding: 15px 0;
}

.iconslist i {
  margin: 0.25rem;
  font-size: 2.5rem;
}

.iconslist .label {
  font-family: var(--bs-font-monospace);
  display: inline-block;
  width: 100%;
  overflow: hidden;
  padding: 0.25rem;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--theme-text-secondary);
}

/*--------------------------------------------------------------
# Profie Page
--------------------------------------------------------------*/
.profile .profile-card img {
  max-width: 120px;
}

.profile .profile-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--theme-text-primary);
  margin: 10px 0 0 0;
}

.profile .profile-card h3 {
  font-size: 18px;
}

.profile .profile-card .social-links a {
  font-size: 20px;
  display: inline-block;
  color: var(--theme-text-muted);
  line-height: 0;
  margin-right: 10px;
  transition: 0.3s;
}

.profile .profile-card .social-links a:hover {
  color: var(--theme-text-primary);
}

.profile .profile-overview .row {
  margin-bottom: 20px;
  font-size: 15px;
}

.profile .profile-overview .card-title {
  color: var(--theme-text-primary);
}

.profile .profile-overview .label {
  font-weight: 600;
  color: var(--theme-text-muted);
}

.profile .profile-edit label {
  font-weight: 600;
  color: var(--theme-text-muted);
}

.profile .profile-edit img {
  max-width: 120px;
}

/*--------------------------------------------------------------
# F.A.Q Page
--------------------------------------------------------------*/
.faq .basic h6 {
  font-size: 18px;
  font-weight: 600;
  color: var(--theme-primary);
}

.faq .basic p {
  color: var(--theme-text-muted);
}

/*--------------------------------------------------------------
# Contact
--------------------------------------------------------------*/
.contact .info-box {
  padding: 28px 30px;
}

.contact .info-box i {
  font-size: 38px;
  line-height: 0;
  color: #4154f1;
}

.contact .info-box h3 {
  font-size: 20px;
  color: #012970;
  font-weight: 700;
  margin: 20px 0 10px 0;
}

.contact .info-box p {
  padding: 0;
  line-height: 24px;
  font-size: 14px;
  margin-bottom: 0;
}

.contact .php-email-form .error-message {
  display: none;
  color: #fff;
  background: #ed3c0d;
  text-align: left;
  padding: 15px;
  margin-bottom: 24px;
  font-weight: 600;
}

.contact .php-email-form .sent-message {
  display: none;
  color: #fff;
  background: #18d26e;
  text-align: center;
  padding: 15px;
  margin-bottom: 24px;
  font-weight: 600;
}

.contact .php-email-form .loading {
  display: none;
  background: #fff;
  text-align: center;
  padding: 15px;
  margin-bottom: 24px;
}

.contact .php-email-form .loading:before {
  content: "";
  display: inline-block;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  margin: 0 10px -6px 0;
  border: 3px solid #18d26e;
  border-top-color: #eee;
  animation: animate-loading 1s linear infinite;
}

.contact .php-email-form input,
.contact .php-email-form textarea {
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  border-radius: 0;
}

.contact .php-email-form input:focus,
.contact .php-email-form textarea:focus {
  border-color: #4154f1;
}

.contact .php-email-form input {
  padding: 10px 15px;
}

.contact .php-email-form textarea {
  padding: 12px 15px;
}

.contact .php-email-form button[type=submit] {
  background: #4154f1;
  border: 0;
  padding: 10px 30px;
  color: #fff;
  transition: 0.4s;
  border-radius: 4px;
}

.contact .php-email-form button[type=submit]:hover {
  background: #5969f3;
}

@keyframes animate-loading {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/*--------------------------------------------------------------
# Error 404
--------------------------------------------------------------*/
.error-404 {
  padding: 30px;
}

.error-404 h1 {
  font-size: 180px;
  font-weight: 700;
  color: #4154f1;
  margin-bottom: 0;
  line-height: 150px;
}

.error-404 h2 {
  font-size: 24px;
  font-weight: 700;
  color: #012970;
  margin-bottom: 30px;
}

.error-404 .btn {
  background: #51678f;
  color: #fff;
  padding: 8px 30px;
}

.error-404 .btn:hover {
  background: #3e4f6f;
}

@media (min-width: 992px) {
  .error-404 img {
    max-width: 50%;
  }
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.footer {
  padding: 20px 0;
  font-size: 14px;
  transition: all 0.3s;
  border-top: 1px solid var(--theme-card-border);
}

.footer .copyright {
  text-align: center;
  color: var(--theme-text-primary);
}

.footer .credits {
  padding-top: 5px;
  text-align: center;
  font-size: 13px;
  color: var(--theme-text-primary);
}

@media (min-width: 768px) and (max-width: 1199px) {
  .header .search-bar {
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .ipad-hide {
    display: none !important;
  }
}

/*--------------------------------------------------------------
# Header Responsive Breakpoints
--------------------------------------------------------------*/

/* Header flex layout fix - allow middle to shrink, protect ends */
.header {
  display: flex;
  flex-wrap: nowrap;
}

.header > .d-flex:first-child {
  flex-shrink: 0; /* Logo area doesn't shrink */
}

.header .search-bar {
  flex: 1 1 auto; /* Search bar can grow and shrink */
  min-width: 150px;
}

/* Let the search chain actually shrink with its flex parent. Without min-width:0
   the inner container/input refuse to shrink below min-content and PAINT UNDER
   the call-control pills when the header is over budget (measured 83px overlap
   at 1527px viewport, 2026-08-21) — the squeeze must compress the input, never
   overlap the buttons. */
.header .search-bar .search-form,
.header .search-input-container,
.header .search-input-container input {
  min-width: 0;
}

/* Call-control buttons (Disconnect / Record / Mute) must ALWAYS be a single
   row — either all expanded (icon+label) or all collapsed (icon-only), never
   stacked. This container is otherwise a block flex-item that lets its inline
   buttons wrap. Force a non-wrapping flex row and size it to its content so the
   SEARCH input (flex:1 1 auto) absorbs any width squeeze instead of the buttons
   wrapping. Scoped to the dialer container so the real search-input .search-bar
   is untouched. */
.header .search-bar[data-feature-set="dialer"] {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}
.header .search-bar[data-feature-set="dialer"] .disconnect-button {
  flex-shrink: 0;
}

/* Add Contact button inside header-nav */
.header-nav .dropdown:has(.add-contact-button) {
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.header-nav {
  flex-shrink: 0;
  white-space: nowrap;
  padding-right: 15px; /* Ensure profile doesn't touch edge */
}

/* Below 1500px: Hide profile name, show only avatar */
@media (max-width: 1499px) {
  .header-nav .nav-profile span.dropdown-toggle {
    display: none !important;
  }
  /* Also target Bootstrap responsive class override */
  .header-nav .nav-profile .d-md-block {
    display: none !important;
  }
}

/* Mobile search toggle - consistent with other collapsed icons */
.header .search-bar-toggle {
  font-size: 1.4rem;
  padding: 0.25rem 0.5rem;
  color: var(--theme-text-primary);
}

/* Below 1600px: Add Contact and Language Select become icon-only.
   (Raised from 1499px 2026-08-21: with a full right-side nav the header is
   already over budget by ~1530px, leaving a dead zone where nothing had
   collapsed yet.) */
@media (max-width: 1599px) {
  .header .add-contact-button .badge > .ms-2,
  .header .language-select-text {
    display: none !important;
  }

  /* Language select: hide dropdown arrow and enlarge flag */
  .header app-language-select .dropdown-toggle::after {
    display: none;
  }

  .header app-language-select .dropdown-toggle {
    font-size: 1.4rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Lowest priority labels (2026-10-11): the language label and the Dark Mode label
   show only on genuinely wide screens (>=2200px); below that the header is
   icon-only for them (flag / moon) so the search input gets the freed width. */
@media (max-width: 2199px) {
  .header .language-select-text,
  .header .theme-toggle-label {
    display: none !important;
  }

  .header .theme-toggle {
    gap: 0;
  }

  .header app-language-select .dropdown-toggle::after {
    display: none;
  }

  .header app-language-select .dropdown-toggle {
    font-size: 1.4rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Below 1600px: Call control buttons become icon-only — aligned with the
   add-contact/language label-hide breakpoint (1599px) so the whole right side
   collapses together and the pills hide their labels before the header crowds
   (paired with the nowrap flex row above, this makes the group snap directly
   expanded <-> collapsed with no stacked intermediate state). */
@media (max-width: 1599px) {
  .header .disconnect-button .badge > .ms-2 {
    display: none !important;
  }
}

/* "Calling for" client control (2026-11-24): while it renders in the call-controls
   group, the call pills (Disconnect / Record / Pause / Mute / Unmute / Stop Autodial)
   are icon-only at EVERY width — their collapsed (<1600px) state. The labels give back
   ~170px, which is at least the control's width (its name is capped to fit), so adding
   the control never makes the header wider than it is without it. Before this, the group
   (flex: 0 0 auto) simply grew by the control's width while the search bar was already at
   its min-content floor and .header-nav cannot shrink, so the profile was pushed off-screen. */
.header .search-bar[data-feature-set="dialer"]:has(.cfc-control) .disconnect-button .badge > .ms-2 {
  display: none !important;
}

/* Header search focus (2026-10-03): while focus is anywhere inside the header
   search form, HeaderComponent sets .search-focused on <header>, which collapses
   the header buttons to the SAME end state the breakpoint rules above (<=1599px)
   and the theme label's `d-none d-xl-inline` (<1200px) produce — but ANIMATED
   (max-width/opacity/margin instead of display:none) so the search panel
   (flex:1 1 auto) grows smoothly into the freed width and back. The media-query
   rules above still use display:none !important, so at rest below their
   breakpoints nothing here applies. Keep the end state in sync with them. */
.header .disconnect-button .badge > .ms-2,
.header .add-contact-button .badge > .ms-2,
.header .theme-toggle-label,
.header .language-select-text {
  max-width: 15em;
  overflow: clip;           /* clip without changing baseline (unlike hidden) */
  white-space: nowrap;
  transition: max-width .2s ease, opacity .2s ease, margin .2s ease;
}
.header .language-select-text {
  display: inline-block;
}
.header.search-focused .disconnect-button .badge > .ms-2,
.header.search-focused .add-contact-button .badge > .ms-2,
.header.search-focused .theme-toggle-label,
.header.search-focused .language-select-text {
  max-width: 0;
  opacity: 0;
  margin-left: 0 !important; /* .ms-1/.ms-2 are !important */
}

/* End-state parity with display:none (CDP-measured 2026-10-03):
   - Badges: styles.css gives .badge `gap: 4px`; a max-width:0 label is still a
     flex item, so the gap would survive. Animate the gap to 0 as well.
   - Language: the whitespace between the flag and the label renders as a space
     while the label is in the box tree. Let the label actually become
     display:none at the END of the collapse (allow-discrete), and animate it
     back in from the collapsed values via @starting-style. */
.header .disconnect-button .badge,
.header .add-contact-button .badge {
  transition: all var(--transition-fast, .15s ease), gap .2s ease; /* keep styles.css .badge transition */
}
.header.search-focused .disconnect-button .badge,
.header.search-focused .add-contact-button .badge {
  gap: 0;
}
.header .language-select-text {
  transition: max-width .2s ease, opacity .2s ease, margin .2s ease, display .2s allow-discrete;
}
.header.search-focused .language-select-text {
  display: none;
}
@starting-style {
  /* Scoped to .search-was-focused (set by HeaderComponent on first search focus)
     so the label doesn't fade in on initial page render. */
  .header.search-was-focused:not(.search-focused) .language-select-text {
    max-width: 0;
    opacity: 0;
    margin-left: 0 !important;
  }
}

/* Language select: arrow hide + enlarged flag, mirroring the <=1599px rules.
   Flag size/padding switch instantly (no font-size transition): animating
   font-size rescaled the em-sized label/arrow mid-transition and made the
   button overshoot on expand. */
/* The arrow likewise ends at display:none: while it stays in the box tree the
   whitespace before it renders as a space (+~5px). */
.header app-language-select .dropdown-toggle::after {
  transition: border-width .2s ease, margin .2s ease, opacity .2s ease, display .2s allow-discrete;
}
.header.search-focused app-language-select .dropdown-toggle::after {
  border-top-width: 0;
  border-right-width: 0;
  border-left-width: 0;
  margin-left: 0;
  opacity: 0;
  display: none;
}
@starting-style {
  .header.search-was-focused:not(.search-focused) app-language-select .dropdown-toggle::after {
    border-top-width: 0;
    border-right-width: 0;
    border-left-width: 0;
    margin-left: 0;
    opacity: 0;
  }
}
.header.search-focused app-language-select .dropdown-toggle {
  font-size: 1.4rem;
  padding: 0.25rem 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .header .disconnect-button .badge > .ms-2,
  .header .add-contact-button .badge > .ms-2,
  .header .theme-toggle-label,
  .header .language-select-text,
  .header .disconnect-button .badge,
  .header .add-contact-button .badge,
  .header app-language-select .dropdown-toggle::after {
    transition: none;
  }
}

/* Below 1300px: Reduce search bar further */
@media (max-width: 1299px) {
  .header .search-bar {
    min-width: 120px;
  }
}

/* Below 1200px: Reduce spacing in header nav */
@media (max-width: 1199px) {
  .header-nav .nav-icon {
    margin-right: 15px;
  }
  .header .search-bar {
    min-width: 100px;
  }
}
/* ============================================================
   Bootstrap dropdown flicker fix (2026-08-05)
   Bootstrap shows .dropdown-menu at its static CSS position first;
   Popper positions it asynchronously one frame later — a visible
   jump on every dropdown. Popper stamps data-popper-placement once
   positioned, so keep the menu invisible until then. (Menus using
   data-bs-display="static" never get the attribute and are exempt
   via :not([data-bs-popper]) fallback-free — static menus don't
   reposition, so they never flickered.)
   ============================================================ */
.dropdown-menu.show:not([data-popper-placement]):not([data-bs-popper="static"]) {
  visibility: hidden;
}

/* ============================================================
   App-shell geometry variables (2026-08-05)
   Single source of truth for "content area under the header,
   right of the sidebar" — used by full-bleed components
   (flextable fullBleed mode; candidates: knowledge-base etc.).
   Tracks the 240px sidebar / 64px rail / mobile overlay states.
   ============================================================ */
:root {
  --app-shell-top: 60px;
  --app-shell-left: 240px;
}
@media (max-width: 1199.98px) {
  :root { --app-shell-left: 0px; }
}
@media (min-width: 1200px) {
  body.toggle-sidebar { --app-shell-left: 64px; }
}
@media (max-width: 1199.98px) {
  body.toggle-sidebar { --app-shell-left: 0px; }
}

/* When the desktop dialer is maximized and docked at bottom-left, the whole
   left track becomes 315px: content clears the dialer's width AND the sidebar
   widens to fill the track (no dead strip above the dialer). The pre-2026-08
   sidebar (314px) shadowed the dialer exactly, so this overlap could never
   happen; the 240px sidebar no longer does. Class managed by
   CallsComponent.syncDialerShellInset(). Placed after the sidebar rules above
   so it wins at equal specificity for the non-collapsed case. When the user
   ALSO collapses (body.toggle-sidebar), the 315px sidebar-fill yields (its
   selector is :not(.toggle-sidebar)) and the ungated rail rules shrink the
   sidebar to 64px — an explicit collapse is honored even while the dialer is
   pinned; --app-shell-left stays 315px so content still clears the dialer.
   Scoped to >=1200px: below that the sidebar is off-canvas
   and an inset would leave a floating dead strip — those widths keep the
   pre-existing overlap behavior. */
@media (min-width: 1200px) {
  body.dialer-open-left { --app-shell-left: 315px; }
  /* Sidebar fills the 315px track ONLY when not explicitly collapsed. If the
     user clicks the collapse button while the dialer is pinned, honor it: the
     rail rules above (no longer gated on :not(.dialer-open-left)) shrink the
     sidebar to 64px. --app-shell-left STAYS 315px so content still clears the
     pinned dialer — collapse changes the sidebar's own width, not the dialer
     clearance (a cosmetic dead strip above the dialer is the accepted price of
     honoring the user's explicit collapse). */
  body.dialer-open-left:not(.toggle-sidebar) .sidebar { width: 315px; }
  /* AI assistant docked (AssistantDockDirective). Left to right: 64px rail |
     assistant column (315px, full height under the header) | dialer (FAB or
     open) | content. The dialer is moved with !important because its left is
     an inline style; calls code is untouched. */
  body.assistant-docked-left { --app-shell-left: 379px; }
  body.assistant-docked-left.dialer-open-left { --app-shell-left: 694px; }
  body.assistant-docked-left app-calls .position-fixed.bottom-0 { left: 379px !important; }
  body.assistant-docked-left .mobile-call-fab { left: 399px; }
}

/* While a full-bleed flextable owns the viewport, the in-flow page behind it
   (mat-drawer-container min-height etc.) must not produce a dead scrollbar.
   Class managed by FlextableComponent ngOnInit/ngOnDestroy.
   Desktop only: the fixed shell exists from 768px up; below that the flextable
   is in-flow and the body must stay scrollable (mobile Safari orders page, 2026-10-16). */
@media (min-width: 768px) {
  body.ft-full-bleed-page {
    overflow: hidden !important;
  }
}

/* When the info panel (mat-drawer, position:end) is open, full-bleed shells
   must inset their right edge by the panel's width — the panel used to push
   in-flow content, which viewport-fixed shells ignore. The container
   publishes --info-panel-width (bound to main.component's maxWidth, tracks
   the 500px/1000px/custom cases). */
:root { --app-shell-right: 0px; }
/* ...but ONLY in `side` mode. The info panel's "Float" pill toggles the drawer
   between mode="over" (float above the content) and mode="side" (push it).
   This rule originally keyed on `.mat-drawer-opened` alone, so a floating panel
   ALSO inset the full-bleed shells — i.e. Float pushed the content anyway and
   the toggle looked broken. Material stamps the mode on the drawer element
   (`mat-drawer-over` / `mat-drawer-side`), so gate on that. */
mat-drawer-container:has(mat-drawer.mat-drawer-opened.mat-drawer-side) {
  --app-shell-right: var(--info-panel-width, 500px);
}
/* Call-script rail (reusable/ui/widgets/call-script-rail) — when PINNED open it
   reserves its width like the info panel does: in-flow content gets padding,
   full-bleed shells inset via --app-shell-right. When the info panel (a fixed
   end drawer) is open, the RAIL docks left of it (--csr-info-offset, set by the
   rail component), so both are visible: page | rail | info panel. The body
   class is toggled by the rail component. */
:root { --call-script-rail-width: 360px; }
body.call-script-rail-pinned #main { padding-right: calc(30px + var(--call-script-rail-width)); }
body.call-script-rail-pinned mat-drawer-container {
  --app-shell-right: var(--call-script-rail-width);
}
body.call-script-rail-pinned mat-drawer-container:has(mat-drawer.mat-drawer-opened.mat-drawer-side) {
  --app-shell-right: calc(var(--info-panel-width, 500px) + var(--call-script-rail-width));
}
/* and the panel always paints above full-bleed shells.
   The `.mat-drawer-side` selector is NOT redundant: Material ships
   `.mat-drawer.mat-drawer-side { z-index: 2 }` (specificity 0,2,0), which
   outranks a bare `mat-drawer.sidebar-sidenav` (0,1,1) — so in SIDE mode the
   panel silently dropped to z-index 2 and page chrome pinned above it (e.g.
   contacts' fixed .contacts-chrome-strip at z-index 6) painted over the panel.
   Float mode never showed it, because .mat-drawer-side doesn't match there.
   Matching Material's class back gets us to 0,2,1 and the panel wins in both. */
mat-drawer.sidebar-sidenav,
mat-drawer.sidebar-sidenav.mat-drawer-side,
mat-drawer.sidebar-sidenav.mat-drawer-over {
  z-index: 100;
}

/* "Full" pill — the panel runs the FULL height of the viewport, above every
   piece of app chrome. z-index 100 is not enough: the app header is z-index 997
   and the sidebar 996, so at top:0 the panel simply painted BEHIND the header
   and looked like it still started below it. `bottom: 0` is what actually makes
   it reach the foot of the window — the drawer sets only `top`, so without this
   its height came from content. Kept under the dialer (inline z-index 99999),
   which must stay reachable during a call. */
mat-drawer.sidebar-sidenav.info-panel-full-bleed {
  z-index: 1000;
  bottom: 0;
}

/* ============================================================
   Midnight (dark) chrome overrides — literals in this file that
   have no --theme-* token, restated for dark. Scoped so light
   themes are untouched.
   ============================================================ */

/* Light-tint utility backgrounds -> translucent semantic tints on dark */
[data-theme="midnight"] .bg-primary-light {
  background-color: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.22);
}
[data-theme="midnight"] .bg-secondary-light {
  background-color: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.2);
}
[data-theme="midnight"] .bg-success-light {
  background-color: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.2);
}
[data-theme="midnight"] .bg-danger-light {
  background-color: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.2);
}
[data-theme="midnight"] .bg-warning-light {
  background-color: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.2);
}
[data-theme="midnight"] .bg-info-light {
  background-color: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.2);
}
[data-theme="midnight"] .bg-dark-light {
  background-color: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.25);
}

/* Card image overlay: light scrim -> dark scrim */
[data-theme="midnight"] .card-img-overlay {
  background-color: rgba(16, 19, 27, 0.6);
}

/* Sidebar scrollbar track was white */
[data-theme="midnight"] .sidebar {
  scrollbar-color: #3a4150 transparent;
}
[data-theme="midnight"] .sidebar::-webkit-scrollbar {
  background-color: transparent;
}
[data-theme="midnight"] .sidebar::-webkit-scrollbar-thumb {
  background-color: #3a4150;
}

/* Dashboard tables + KPI card icons (hardcoded pastel chips in light) */
[data-theme="midnight"] .dashboard .recent-sales .table thead,
[data-theme="midnight"] .dashboard .top-selling .table thead {
  background: rgba(129, 140, 248, 0.1);
}
[data-theme="midnight"] .dashboard .sales-card .card-icon {
  color: #a5b4fc;
  background: rgba(129, 140, 248, 0.14);
}
[data-theme="midnight"] .dashboard .revenue-card .card-icon {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.14);
}
[data-theme="midnight"] .dashboard .customers-card .card-icon {
  color: #fdba74;
  background: rgba(253, 186, 116, 0.14);
}
[data-theme="midnight"] .dashboard .activity .activity-item .activite-label::before {
  background-color: #2a2f3a;
}

/* Country-code selector: matches the (now dark) phone input instead of white */
[data-theme="midnight"] .country-code-btn.btn-outline-secondary {
  background-color: #171b23 !important;
  border-color: #2a2f3a !important;
  color: #e7ecf5 !important;
}
[data-theme="midnight"] .country-code-btn.btn-outline-secondary:hover,
[data-theme="midnight"] .country-code-btn.btn-outline-secondary:focus {
  background-color: #20242e !important;
  border-color: #3a4150 !important;
  color: #e7ecf5 !important;
}

/* Bootstrap STATIC utility surfaces don't flip under data-bs-theme —
   re-tint them for Midnight (used by card headers, table headers, chips
   across the app). */
[data-theme="midnight"] .table-light {
  --bs-table-bg: #20242e;
  --bs-table-color: #e7ecf5;
  --bs-table-border-color: #2a2f3a;
  --bs-table-striped-bg: #232833;
  --bs-table-striped-color: #e7ecf5;
  --bs-table-hover-bg: #262b36;
  --bs-table-hover-color: #e7ecf5;
  color: #e7ecf5;
  border-color: #2a2f3a;
}
[data-theme="midnight"] .bg-light {
  background-color: #20242e !important;
}
[data-theme="midnight"] .bg-white {
  background-color: #1a1d24 !important;
}
[data-theme="midnight"] .text-dark {
  color: #e7ecf5 !important;
}
[data-theme="midnight"] .text-black {
  color: #e7ecf5 !important;
}
[data-theme="midnight"] .border-light {
  border-color: #2a2f3a !important;
}

/* ── Midnight: the last two NiceAdmin template sections ──
   Globally-loaded sheet, so a plain [data-theme] selector is correct here
   (component sheets need :host-context). Both sections are rare surfaces —
   the 404 page and the contact form — and were the remaining known leftovers. */
[data-theme="midnight"] .error-404 h1 {
  color: #818cf8;
}

[data-theme="midnight"] .error-404 h2 {
  color: #e7ecf5;
}

[data-theme="midnight"] .error-404 .btn {
  background: #3a4560;
}

[data-theme="midnight"] .error-404 .btn:hover {
  background: #4a5675;
}

[data-theme="midnight"] .contact .info-box {
  background: #1a1d24;
}

[data-theme="midnight"] .contact .info-box h3 {
  color: #e7ecf5;
}

[data-theme="midnight"] .contact .php-email-form .loading {
  background: #1a1d24;
}

[data-theme="midnight"] .contact .php-email-form .loading:before {
  border-top-color: #2a2f3a;
}
