@font-face {
  font-family: "Inter";
  src: url("inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Validation must remain unmistakable above the legacy !important control
   borders, in both light and dark modes. */
html body .form-control.is-invalid,
html body .form-select.is-invalid,
html body .form-check-input.is-invalid,
html body [aria-invalid="true"] {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 18%, transparent) !important;
}

html body .form-control.is-invalid:focus,
html body .form-select.is-invalid:focus,
html body [aria-invalid="true"]:focus {
  outline: 2px solid var(--destructive) !important;
  outline-offset: 2px;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("noto-sans-arabic-arabic-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Per-user CRM alerts use the same restrained Ignorre surfaces as the shell.
   Messages are inserted with textContent, remain keyboard dismissible, and do
   not depend on an external toast or missing audio asset. */
.crm-notification-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10050;
  display: grid;
  width: min(390px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.crm-notification-toast {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: start;
  padding: 16px;
  color: var(--foreground, #0f172a);
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

.crm-notification-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: #1769ff;
  border-radius: 10px;
}

.crm-notification-icon .crm-lucide-icon,
.crm-notification-dismiss .crm-lucide-icon {
  width: 18px;
  height: 18px;
}

.crm-notification-copy strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 0.92rem;
}

.crm-notification-copy p {
  margin: 0;
  color: var(--muted-foreground, #536071);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.crm-notification-dismiss {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted-foreground, #536071);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.crm-notification-dismiss:hover,
.crm-notification-dismiss:focus-visible {
  color: var(--foreground, #0f172a);
  background: var(--muted, #f1f5f9);
  outline: none;
}

@media (max-width: 575.98px) {
  .crm-notification-region {
    right: 16px;
    bottom: 16px;
  }
}

/*
 * TRAAN CRM — Ignorre Layout21 application shell
 * Source-parity target: authenticated Ignorre applications, not the public
 * marketing site. Presentation only; CRM authorization and write paths remain
 * server-owned. CX24 assets occupy Ignorre's mark/wordmark geometry.
 */

:root {
  --background: #f3f6f8;
  --foreground: #111827;
  --card: #ffffff;
  --card-foreground: #111827;
  --popover: #ffffff;
  --popover-foreground: #111827;
  --primary: #0e7490;
  --primary-foreground: #ffffff;
  --secondary: #eaf0f3;
  --secondary-foreground: #172033;
  --muted: #edf2f4;
  --muted-foreground: #647184;
  --accent: #e2f7fa;
  --accent-foreground: #155e75;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --chart-1: #0891b2;
  --chart-2: #10b981;
  --chart-3: #8b5cf6;
  --chart-4: #f59e0b;
  --chart-5: #e11d48;
  --border: rgba(15, 23, 42, .12);
  --input: rgba(15, 23, 42, .16);
  --ring: #06b6d4;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 8px 22px -18px rgba(15, 23, 42, .30);
  --shadow-md: 0 18px 42px -22px rgba(15, 23, 42, .30);
  --shadow-lg: 0 28px 70px -30px rgba(15, 23, 42, .44);
  --sidebar-collapsed-width: 72px;
  --sidebar-width: 320px;
  --sidebar-panel-width: 248px;
  --sidebar-header-height: 76px;
  --header-height: 76px;
  --header-height-mobile: 56px;

  /* Compatibility aliases consumed by the existing CRM feature pages. */
  --ig-background: var(--background);
  --ig-workspace: #f5f7f8;
  --ig-foreground: var(--foreground);
  --ig-card: var(--card);
  --ig-card-foreground: var(--card-foreground);
  --ig-popover: var(--popover);
  --ig-primary: var(--primary);
  --ig-primary-foreground: var(--primary-foreground);
  --ig-secondary: var(--secondary);
  --ig-muted: var(--muted);
  --ig-muted-foreground: var(--muted-foreground);
  --ig-accent: var(--accent);
  --ig-accent-foreground: var(--accent-foreground);
  --ig-border: var(--border);
  --ig-input: var(--input);
  --ig-ring: var(--ring);
  --ig-success: var(--success);
  --ig-warning: var(--warning);
  --ig-danger: var(--destructive);
  --ig-radius-sm: var(--radius-sm);
  --ig-radius-md: var(--radius-md);
  --ig-radius-lg: var(--radius);
  --ig-radius-xl: var(--radius-xl);
  --ig-shadow-xs: var(--shadow-xs);
  --ig-shadow-md: var(--shadow-md);
  --ig-shadow-lg: var(--shadow-lg);
  --traan-blue: var(--primary);
  --traan-blue-deep: #0b6178;
  --traan-cyan: #22d3ee;
  --traan-canvas: var(--background);
  --traan-surface: var(--card);
  --traan-surface-raised: var(--card);
  --traan-surface-soft: var(--muted);
  --traan-surface-blue: var(--accent);
  --traan-ink: var(--foreground);
  --traan-copy: #334155;
  --traan-muted: var(--muted-foreground);
  --traan-line: var(--border);
  --crm-font: "Inter", "Noto Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Retire every legacy red/Manrope token while older PHP templates still
     load their structural styles ahead of this authoritative theme layer. */
  --portal-font: var(--crm-font);
  --portal-font-ar: "Noto Sans Arabic", var(--crm-font);
  --portal-ink: var(--foreground);
  --portal-black: var(--foreground);
  --portal-muted: var(--muted-foreground);
  --portal-line: var(--border);
  --portal-canvas: var(--ig-workspace);
  --portal-cyan: var(--primary);
  --portal-rose: var(--primary);
  --portal-rose-dark: var(--primary);
  --portal-sidebar: var(--sidebar-collapsed-width);
  --portal-pad: clamp(20px, 2.25vw, 32px);
  --portal-radius: var(--radius);
  --portal-control: var(--radius-sm);
  --portal-shadow: var(--shadow-sm);
  --portal-shadow-lg: var(--shadow-md);
  --crm-ink: var(--foreground);
  --crm-muted: var(--muted-foreground);
  --crm-line: var(--border);
  --crm-canvas: var(--ig-workspace);
  --crm-surface: var(--card);
  --crm-green: var(--primary);
  --crm-green-2: var(--accent-foreground);
  --crm-mint: var(--accent);
  --crm-gold: var(--primary);
  --crm-cyan: var(--primary);
  --crm-rose: var(--primary);
  --crm-danger: var(--destructive);
  --crm-shadow: var(--shadow-sm);
  --crm-radius: var(--radius);
  --crm-sidebar-width: var(--sidebar-collapsed-width);
  --crm-content-pad: clamp(20px, 2.25vw, 32px);
  --crm-panel-radius: var(--radius);
  --crm-control-radius: var(--radius-sm);
}

html[data-theme="dark"],
html.dark {
  --background: #060b12;
  --foreground: #f1f5f9;
  --card: #0b121c;
  --card-foreground: #f1f5f9;
  --popover: #0b121c;
  --popover-foreground: #f1f5f9;
  --primary: #67e8f9;
  --primary-foreground: #06212a;
  --secondary: #151f2d;
  --secondary-foreground: #e2e8f0;
  --muted: #111a27;
  --muted-foreground: #91a0b5;
  --accent: #102b36;
  --accent-foreground: #a5f3fc;
  --destructive: #ef4444;
  --success: #34d399;
  --warning: #fbbf24;
  --chart-1: #22d3ee;
  --chart-2: #34d399;
  --chart-3: #a78bfa;
  --chart-4: #fbbf24;
  --chart-5: #fb7185;
  --border: rgba(148, 163, 184, .18);
  --input: rgba(148, 163, 184, .24);
  --ring: #22d3ee;
  --ig-workspace: #090c10;
  --traan-copy: #cbd5e1;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .30);
  --shadow-sm: 0 8px 22px -18px rgba(0, 0, 0, .75);
  --shadow-md: 0 18px 42px -22px rgba(0, 0, 0, .85);
  --shadow-lg: 0 28px 70px -30px rgba(0, 0, 0, .92);
}

html {
  min-height: 100%;
  background: var(--background);
  color-scheme: light;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"],
html.dark { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

body,
button,
input,
select,
textarea {
  font-family: var(--crm-font) !important;
}

body {
  min-height: 100dvh;
  margin: 0;
  background-color: var(--background) !important;
  color: var(--foreground) !important;
  font-size: 16px !important;
  line-height: 1.5;
}

body::before,
body::after { pointer-events: none; }

body.crm-ignorre-shell #main-content h1,
body.crm-ignorre-shell #main-content h2,
body.crm-ignorre-shell #main-content h3,
body.crm-ignorre-shell #main-content h4,
body.crm-ignorre-shell #main-content h5,
body.crm-ignorre-shell #main-content h6,
body.crm-ignorre-shell .content-wrapper h1,
body.crm-ignorre-shell .content-wrapper h2,
body.crm-ignorre-shell .content-wrapper h3,
body.crm-ignorre-shell .content-wrapper h4,
body.crm-ignorre-shell .content-wrapper h5,
body.crm-ignorre-shell .content-wrapper h6 {
  color: var(--foreground) !important;
  font-family: var(--crm-font) !important;
}

::selection { background: rgba(34, 211, 238, .26); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 5px; background: var(--input); }
* { scrollbar-width: thin; scrollbar-color: var(--input) transparent; }

:focus-visible {
  outline: 2px solid var(--ring) !important;
  outline-offset: 3px !important;
}

a { color: var(--primary); }
a:hover { color: var(--accent-foreground); }

.crm-lucide-icon {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  overflow: visible;
  pointer-events: none;
}

.crm-icon-holder,
.crm-search-icon,
.crm-personal-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Ignorre Layout21 rail: 72px primary rail + icon-specific 248px panel.
   -------------------------------------------------------------------------- */

body.crm-ignorre-shell {
  overflow-x: hidden !important;
  background: #080b0f !important;
}

body.crm-ignorre-shell > .d-flex,
body.crm-ignorre-shell > .container-fluid,
body.crm-ignorre-shell > .container {
  min-height: 100dvh;
}

body.crm-ignorre-shell .sidebar.crm-sidebar-layout21 {
  --crm-rail-index: 0;
  position: fixed !important;
  z-index: 1040 !important;
  inset: 0 auto 0 0 !important;
  display: flex !important;
  flex-direction: row !important;
  width: var(--sidebar-collapsed-width) !important;
  min-width: var(--sidebar-collapsed-width) !important;
  height: 100dvh !important;
  padding: 0 !important;
  align-items: stretch !important;
  overflow: hidden !important;
  border: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, .08) !important;
  border-radius: 0 !important;
  background: #080b0f !important;
  color: #f4f4f5 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: width 200ms ease-out, box-shadow 200ms ease-out !important;
}

body.crm-ignorre-shell .sidebar.crm-sidebar-layout21.is-expanded,
body.crm-menu-open .sidebar.crm-sidebar-layout21 {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  box-shadow: 28px 0 70px -34px rgba(0, 0, 0, .62) !important;
}

.crm-rail-primary {
  position: relative;
  z-index: 2;
  display: flex;
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  height: 100%;
  flex: 0 0 var(--sidebar-collapsed-width);
  flex-direction: column;
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, .07);
  background: #080b0f;
}

.crm-rail-brand-wrap {
  display: flex;
  width: 100%;
  height: var(--sidebar-header-height);
  min-height: var(--sidebar-header-height);
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.crm-rail-brand {
  display: grid !important;
  width: 44px !important;
  height: 44px !important;
  place-items: center;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .05) !important;
  border-radius: 12px !important;
  background: #0f141b !important;
  box-shadow: 5px 5px 12px #020407, -4px -4px 10px rgba(255, 255, 255, .035) !important;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.crm-rail-brand:hover {
  border-color: rgba(103, 232, 249, .20) !important;
  background: #111820 !important;
}

.crm-rail-brand img {
  display: block !important;
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
}

.crm-rail-nav {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 0;
  padding: 16px 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
}

.crm-rail-indicator {
  position: absolute;
  z-index: 3;
  top: 28px;
  left: 0;
  width: 2px;
  height: 16px;
  border-radius: 0 999px 999px 0;
  background: #67e8f9;
  box-shadow: 0 0 12px rgba(103, 232, 249, .65);
  transform: translateY(calc(var(--crm-rail-index) * 50px));
  transition: transform 200ms cubic-bezier(.2, .8, .2, 1);
}

.crm-rail-button {
  position: relative;
  display: inline-flex !important;
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .04) !important;
  border-radius: 12px !important;
  background: #0f141b !important;
  color: #71717a !important;
  text-decoration: none !important;
  box-shadow: 5px 5px 12px #020407, -4px -4px 10px rgba(255, 255, 255, .035) !important;
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 100ms ease !important;
}

.crm-rail-button > i,
.crm-rail-button > .crm-lucide-icon {
  font-size: 16px !important;
  line-height: 1;
}

.crm-rail-button:hover,
.crm-rail-button:focus-visible,
.crm-rail-button.is-preview {
  border-color: rgba(103, 232, 249, .15) !important;
  background: #111820 !important;
  color: #cffafe !important;
  box-shadow: inset 3px 3px 7px #030609, inset -3px -3px 7px rgba(255, 255, 255, .025) !important;
}

.crm-rail-button.is-active {
  border-color: rgba(103, 232, 249, .20) !important;
  background: #111a21 !important;
  color: #a5f3fc !important;
  box-shadow: inset 3px 3px 8px #030609, inset -3px -3px 8px rgba(103, 232, 249, .055), 0 0 18px rgba(34, 211, 238, .08) !important;
}

.crm-rail-button:active { transform: scale(.97); }

.crm-rail-tooltip {
  position: fixed;
  z-index: 1200;
  left: 64px;
  min-width: max-content;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: #0d1117;
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  transition: opacity 120ms ease, transform 120ms ease;
}

.sidebar:not(.is-expanded) .crm-rail-button:hover .crm-rail-tooltip,
.sidebar:not(.is-expanded) .crm-rail-button:focus-visible .crm-rail-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.crm-rail-account {
  display: inline-flex !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 12px 0 !important;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(103, 232, 249, .16) !important;
  border-radius: 999px !important;
  background: #67e8f9 !important;
  color: #06212a !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .03em;
  text-decoration: none !important;
  box-shadow: 0 0 0 3px rgba(103, 232, 249, .05);
}

.crm-rail-secondary {
  position: relative;
  z-index: 1;
  width: var(--sidebar-panel-width);
  min-width: var(--sidebar-panel-width);
  height: 100%;
  flex: 0 0 var(--sidebar-panel-width);
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, .07);
  background: #0d1117;
  color: #f4f4f5;
  box-shadow: inset 18px 0 30px -30px rgba(0, 0, 0, .90);
}

.crm-rail-secondary-header {
  display: flex;
  height: var(--sidebar-header-height);
  min-height: var(--sidebar-header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.crm-rail-secondary-header img {
  display: block;
  width: auto;
  max-width: 160px;
  height: 24px;
  object-fit: contain;
}

.crm-sidebar-mobile-close {
  display: none;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: #111820;
  color: #d4d4d8;
  font-size: 15px;
}

.crm-sidebar-mobile-close:hover,
.crm-sidebar-mobile-close:focus-visible {
  border-color: rgba(103, 232, 249, .25);
  color: #cffafe;
}

.crm-rail-secondary-scroll {
  height: calc(100dvh - var(--sidebar-header-height));
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 28px;
}

.crm-rail-panel[hidden] { display: none !important; }
.crm-rail-panel { padding: 20px 14px 24px; }

.crm-rail-panel-intro {
  margin-bottom: 12px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.crm-rail-panel-eyebrow,
.crm-rail-direct-label {
  margin: 0 !important;
  color: rgba(103, 232, 249, .70) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 9px !important;
  font-weight: 750 !important;
  letter-spacing: .18em;
  line-height: 14px;
  text-transform: uppercase;
}

.crm-rail-panel-eyebrow { display: flex; align-items: center; gap: 8px; }

.crm-rail-panel h2 {
  margin: 14px 0 0 !important;
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 650 !important;
  letter-spacing: -.025em;
  line-height: 26px;
}

.crm-rail-panel-tagline {
  margin: 4px 0 0 !important;
  color: rgba(165, 243, 252, .76) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 18px;
}

.crm-rail-panel-description {
  margin: 9px 0 0 !important;
  color: #8d949f !important;
  font-size: 13px !important;
  line-height: 20px;
}

.crm-rail-open {
  display: flex !important;
  width: 100%;
  min-height: 40px;
  margin: 0 0 20px;
  padding: 0 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(103, 232, 249, .15) !important;
  border-radius: 9px !important;
  background: rgba(103, 232, 249, .07) !important;
  color: #cffafe !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  text-decoration: none !important;
}

.crm-rail-open:hover {
  border-color: rgba(103, 232, 249, .25) !important;
  background: rgba(103, 232, 249, .11) !important;
}

.crm-rail-direct-label {
  margin: 0 8px 7px !important;
  color: #52525b !important;
  font-size: 8px !important;
}

.crm-rail-panel-links { display: grid; gap: 3px; }

.crm-rail-panel-links > a {
  display: flex !important;
  min-height: 40px;
  padding: 8px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #a1a1aa !important;
  font-size: 14px !important;
  font-weight: 550 !important;
  text-decoration: none !important;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.crm-rail-panel-links > a > span { display: flex; min-width: 0; align-items: center; gap: 10px; }
.crm-rail-panel-links > a > span > i,
.crm-rail-panel-links > a > span > .crm-lucide-icon { width: 16px; color: #71717a; font-size: 15px; text-align: center; }
.crm-rail-panel-links > a > i,
.crm-rail-panel-links > a > .crm-lucide-icon { color: #3f3f46; font-size: 12px; transition: transform 160ms ease, color 160ms ease; }

.crm-rail-panel-links > a:hover,
.crm-rail-panel-links > a:focus-visible,
.crm-rail-panel-links > a.is-current {
  border-color: rgba(255, 255, 255, .06) !important;
  background: rgba(255, 255, 255, .035) !important;
  color: #ffffff !important;
}

.crm-rail-panel-links > a.is-current {
  border-color: rgba(103, 232, 249, .12) !important;
  background: rgba(103, 232, 249, .07) !important;
  color: #cffafe !important;
}

.crm-rail-panel-links > a:hover > i,
.crm-rail-panel-links > a:hover > .crm-lucide-icon { color: rgba(103, 232, 249, .72); transform: translateX(2px); }
.crm-rail-panel-links > a.is-current > span > i,
.crm-rail-panel-links > a.is-current > span > .crm-lucide-icon { color: #67e8f9; }

.crm-agent-dashboard-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.crm-agent-dashboard-tiles > a {
  min-height: 104px !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 11px !important;
  border: 1px solid rgba(148, 163, 184, .15) !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, rgba(30, 41, 59, .72), rgba(15, 23, 42, .86)) !important;
}

.crm-agent-dashboard-tiles > a > span { align-items: flex-start; flex-direction: column; gap: 8px; }
.crm-agent-dashboard-tiles > a > span > .crm-lucide-icon { width: 20px; height: 20px; color: #67e8f9; }
.crm-agent-dashboard-tiles > a > .crm-lucide-icon { align-self: flex-end; color: rgba(165, 243, 252, .7); }
.crm-agent-dashboard-tiles > a.is-current { border-color: rgba(34, 211, 238, .45) !important; background: linear-gradient(145deg, rgba(8, 145, 178, .33), rgba(30, 41, 59, .92)) !important; }

/* Dashboard applications stay visually distinct in the icon rail, while the
   expanded app menu deliberately uses the same compact icon-and-text links as
   every other workspace section. */
.crm-agent-dashboard-application { display: grid; gap: 3px; }
.crm-agent-dashboard-application > a > span { flex-direction: row; align-items: center; gap: 10px; }
.crm-agent-dashboard-application > a > span > .crm-lucide-icon { width: 16px; color: #67e8f9; }

.crm-rail-button.crm-agent-dashboard-tile { margin: 3px 7px; border: 1px solid rgba(103, 232, 249, .12); border-radius: 12px; background: rgba(103, 232, 249, .045); }
.crm-rail-button.crm-agent-dashboard-tile.is-active { border-color: rgba(103, 232, 249, .38); background: rgba(103, 232, 249, .13); }

/* --------------------------------------------------------------------------
   Workspace command bar and content frame.
   -------------------------------------------------------------------------- */

body.crm-ignorre-shell #main-content,
body.crm-ignorre-shell .content-wrapper,
body.crm-ignorre-shell > .d-flex > .flex-grow-1 {
  position: relative !important;
  width: calc(100% - var(--sidebar-collapsed-width)) !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: calc(100dvh - var(--header-height)) !important;
  margin: var(--header-height) 0 0 var(--sidebar-collapsed-width) !important;
  padding: 24px clamp(20px, 2.25vw, 32px) 48px !important;
  overflow-x: clip !important;
  background-color: var(--ig-workspace) !important;
  color: var(--foreground) !important;
  transition: none !important;
}

/* Agents work from Operations overview instead of a left navigation rail.
   Their personal menu, theme control, search, and help stay in the top bar. */
body.crm-agent-no-sidebar .sidebar { display: none !important; }
body.crm-agent-no-sidebar #main-content,
body.crm-agent-no-sidebar .content-wrapper,
body.crm-agent-no-sidebar > .d-flex > .flex-grow-1 {
  width: 100% !important;
  margin-left: 0 !important;
}
body.crm-agent-no-sidebar .crm-topbar { left: 0 !important; }

body.crm-ignorre-shell #main-content::before,
body.crm-ignorre-shell .content-wrapper::before,
body.crm-ignorre-shell > .d-flex > .flex-grow-1::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 55%);
  mask-image: linear-gradient(to bottom, #000, transparent 55%);
}

html[data-theme="dark"] body.crm-ignorre-shell #main-content::before,
html[data-theme="dark"] body.crm-ignorre-shell .content-wrapper::before,
html[data-theme="dark"] body.crm-ignorre-shell > .d-flex > .flex-grow-1::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
}

body.crm-ignorre-shell #main-content > :not(.crm-topbar),
body.crm-ignorre-shell .content-wrapper > :not(.crm-topbar),
body.crm-ignorre-shell > .d-flex > .flex-grow-1 > :not(.crm-topbar) {
  position: relative;
  z-index: 1;
}

.crm-topbar {
  position: fixed !important;
  z-index: 1025 !important;
  top: 0 !important;
  right: 0 !important;
  left: var(--sidebar-collapsed-width) !important;
  display: flex !important;
  width: auto !important;
  height: var(--header-height) !important;
  min-height: var(--header-height) !important;
  margin: 0 !important;
  padding: 0 clamp(16px, 2vw, 24px) !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(15, 23, 42, .10) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, .82) !important;
  color: #0f172a !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

html[data-theme="dark"] .crm-topbar {
  border-bottom-color: rgba(255, 255, 255, .07) !important;
  background: rgba(9, 12, 16, .88) !important;
  color: #f4f4f5 !important;
}

.crm-topbar-left,
.crm-topbar-right {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
}

.crm-topbar-left { flex: 1 1 auto !important; gap: 12px !important; }
.crm-topbar-right { margin-left: auto !important; flex: 0 1 auto !important; gap: 9px !important; }

.crm-menu-toggle,
.crm-theme-toggle,
.crm-alert-link,
.crm-personal-trigger {
  border: 1px solid var(--input) !important;
  background: var(--card) !important;
  color: var(--foreground) !important;
  box-shadow: var(--shadow-xs) !important;
}

.crm-menu-toggle {
  display: inline-flex !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
  font-size: 19px;
}

.crm-page-heading { min-width: 0; }
.crm-page-heading strong {
  display: block;
  overflow: hidden;
  color: var(--foreground) !important;
  font-size: 16px !important;
  font-weight: 650 !important;
  letter-spacing: -.015em;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-global-search {
  position: relative;
  display: flex;
  width: clamp(240px, 27vw, 420px);
  min-width: 200px;
  height: 40px;
  align-items: center;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted-foreground);
  box-shadow: var(--shadow-xs);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.crm-global-search:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}

.crm-global-search > i,
.crm-global-search > .crm-search-icon { margin-left: 12px; font-size: 15px; }
.crm-global-search > input {
  width: 100%;
  min-width: 0;
  height: 38px !important;
  min-height: 38px !important;
  padding: 7px 8px !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--foreground) !important;
  box-shadow: none !important;
  font-size: 15px !important;
}

.crm-global-search > kbd {
  margin-right: 8px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.crm-global-results {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  min-width: min(460px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--popover);
  box-shadow: var(--shadow-lg);
}

.crm-global-result {
  display: flex !important;
  min-height: 62px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: var(--radius-md);
  color: var(--foreground) !important;
  text-decoration: none !important;
}

.crm-global-result:hover,
.crm-global-result:focus-visible { background: var(--accent); }
.crm-global-result > span { display: grid; min-width: 0; }
.crm-global-result strong { overflow: hidden; font-size: 14px !important; text-overflow: ellipsis; white-space: nowrap; }
.crm-global-result small { overflow: hidden; color: var(--muted-foreground); font-size: 12px !important; text-overflow: ellipsis; white-space: nowrap; }
.crm-global-result em { padding: 4px 8px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); font-size: 11px; font-style: normal; white-space: nowrap; }
.crm-global-result-state { padding: 20px; color: var(--muted-foreground); font-size: 13px; text-align: center; }

.crm-theme-toggle {
  display: inline-flex !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  gap: 0 !important;
  border-radius: var(--radius-sm) !important;
  font-size: 17px !important;
}
.crm-theme-toggle span { display: none !important; }

.crm-menu-toggle:hover,
.crm-theme-toggle:hover,
.crm-alert-link:hover,
.crm-personal-trigger:hover,
.crm-personal-trigger[aria-expanded="true"] {
  border-color: var(--ring) !important;
  background: var(--accent) !important;
  color: var(--accent-foreground) !important;
}

.crm-personal-menu { position: relative; display: flex; align-items: center; gap: 9px; }

.crm-alert-link,
.crm-personal-trigger {
  display: inline-flex !important;
  height: 40px !important;
  min-height: 40px !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
  text-decoration: none !important;
}

.crm-alert-link { position: relative; width: 40px; min-width: 40px; padding: 0 !important; font-size: 17px; }
.crm-alert-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--card); border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }

.crm-personal-trigger { gap: 0 !important; width: 40px !important; min-width: 40px !important; padding: 3px !important; }
.crm-personal-trigger-copy,
.crm-personal-trigger > .bi-chevron-down,
.crm-personal-trigger > .crm-personal-chevron { display: none !important; }

.crm-personal-avatar {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}

.crm-personal-avatar-large { width: 44px; height: 44px; flex-basis: 44px; font-size: 14px; }

.crm-personal-dropdown {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 10px);
  right: 0;
  width: min(350px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: var(--shadow-lg);
}

.crm-personal-identity { display: flex; gap: 12px; padding: 18px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 55%, var(--card)); }
.crm-personal-identity > span:last-child { display: grid; min-width: 0; }
.crm-personal-identity strong { font-size: 15px !important; }
.crm-personal-identity small { overflow: hidden; color: var(--muted-foreground); font-size: 12px !important; text-overflow: ellipsis; white-space: nowrap; }
.crm-personal-roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.crm-personal-roles span { padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted-foreground); font-size: 10px; font-weight: 650; }
.crm-personal-links { display: grid; gap: 2px; padding: 8px; }
.crm-personal-links > a { display: flex !important; min-height: 56px; padding: 9px 11px; align-items: center; gap: 12px; border-radius: var(--radius-md); color: var(--foreground) !important; text-decoration: none !important; }
.crm-personal-links > a:hover,
.crm-personal-links > a:focus-visible { background: var(--accent); }
.crm-personal-links > a > i,
.crm-personal-links > a > .crm-lucide-icon { width: 30px; color: var(--primary); font-size: 17px; text-align: center; }
.crm-personal-links > a > span { display: grid; }
.crm-personal-links strong { font-size: 13px !important; }
.crm-personal-links small { color: var(--muted-foreground); font-size: 11px !important; }
.crm-personal-signout { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md) !important; }
.crm-personal-signout i,
.crm-personal-signout .crm-lucide-icon,
.crm-personal-signout strong { color: var(--destructive) !important; }

.crm-sidebar-backdrop {
  position: fixed;
  z-index: 1035;
  inset: 0;
  display: none;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .30);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* --------------------------------------------------------------------------
   Ignorre cards, analytics, forms and operational typography.
   -------------------------------------------------------------------------- */

.crm-content-shell,
.crm-feature-content { min-width: 0; }

.crm-profile-strip { display: none !important; }

.card,
.crm-panel,
.crm-feature-panel,
.crm-analytics-card,
.crm-kpi-card,
.crm-quick-card,
.crm-client-profile,
.crm-detail,
.table-wrapper,
.form-wrapper,
.chart-container,
.crm-filter-bar,
.crm-workflow-content,
.tab-content.client-tab-content,
#wizardForm > .tab-content {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  color: var(--card-foreground) !important;
  box-shadow: var(--shadow-xs) !important;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer,
.crm-feature-panel-head {
  min-height: 56px;
  padding: 14px 20px !important;
  border-color: var(--border) !important;
  background: transparent !important;
  color: var(--card-foreground) !important;
}

.card-body,
.crm-feature-panel-body { padding: 20px !important; }
.crm-no-pad { padding: 0 !important; }

.crm-feature-content { display: grid; gap: 24px; }

.crm-feature-hero,
.crm-profile-hero {
  position: relative;
  display: flex;
  min-height: 150px;
  padding: clamp(24px, 3vw, 32px) !important;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, .12) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 88% -10%, rgba(34, 211, 238, .17), transparent 20rem),
    radial-gradient(circle at 20% 120%, rgba(59, 130, 246, .13), transparent 19rem),
    #080d13 !important;
  color: #f8fafc !important;
  box-shadow: 0 26px 80px -48px rgba(6, 182, 212, .50) !important;
}

.crm-feature-hero > div:first-child { max-width: 760px; }
.crm-feature-kicker,
.crm-eyebrow { color: rgba(103, 232, 249, .88) !important; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important; font-size: 11.5px !important; font-weight: 760 !important; letter-spacing: .12em; line-height: 18px; text-transform: uppercase; }
.crm-feature-hero .crm-feature-kicker,
.crm-profile-hero .crm-feature-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  margin: 0 !important;
  padding: 5px 10px;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  border: 1px solid rgba(103, 232, 249, .18);
  border-radius: 999px;
  background: rgba(103, 232, 249, .07);
}
.crm-feature-hero h1,
.crm-feature-hero h2,
.crm-profile-hero h1,
.crm-profile-hero h2 { margin: 8px 0 0 !important; color: #ffffff !important; font-size: clamp(24px, 2.6vw, 34px) !important; font-weight: 680 !important; letter-spacing: -.035em; line-height: 1.15; }
body.crm-ignorre-shell #main-content .crm-feature-hero h1,
body.crm-ignorre-shell #main-content .crm-feature-hero h2,
body.crm-ignorre-shell #main-content .crm-profile-hero h1,
body.crm-ignorre-shell #main-content .crm-profile-hero h2,
body.crm-ignorre-shell .content-wrapper .crm-feature-hero h1,
body.crm-ignorre-shell .content-wrapper .crm-feature-hero h2,
body.crm-ignorre-shell .content-wrapper .crm-profile-hero h1,
body.crm-ignorre-shell .content-wrapper .crm-profile-hero h2 { color: #ffffff !important; }
.crm-feature-hero p,
.crm-profile-hero p { max-width: 720px; margin: 10px 0 0 !important; color: #94a3b8 !important; font-size: 15px !important; line-height: 24px; }
.crm-feature-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.crm-feature-actions .btn { border-color: rgba(255,255,255,.18) !important; background: rgba(255,255,255,.06) !important; color: #f8fafc !important; }
.crm-feature-actions .btn:hover { border-color: rgba(103,232,249,.40) !important; background: rgba(103,232,249,.12) !important; color: #cffafe !important; }
.crm-feature-actions .crm-action-count { display: inline-grid; min-width: 1.45rem; height: 1.45rem; margin-left: .25rem; place-items: center; border-radius: 999px; background: rgba(103,232,249,.18); color: #cffafe; font-size: .75rem; font-variant-numeric: tabular-nums; font-weight: 800; }

.crm-metric-grid,
.crm-kpi-grid,
.crm-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.crm-metric,
.crm-kpi-card,
.crm-quick-card {
  position: relative;
  min-width: 0;
  min-height: 134px;
  padding: 18px 20px !important;
  overflow: hidden;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  background: var(--card) !important;
  color: var(--card-foreground) !important;
  box-shadow: var(--shadow-xs) !important;
}

.crm-metric-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crm-metric-label,
.crm-kpi-label { color: var(--muted-foreground) !important; font-size: 13px !important; font-weight: 650 !important; }
.crm-metric-icon,
.crm-kpi-icon,
.crm-quick-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-foreground); font-size: 17px; }
.crm-metric-value,
.crm-kpi-card strong { display: block; margin-top: 14px; color: var(--card-foreground) !important; font-size: clamp(25px, 2.5vw, 32px) !important; font-weight: 720 !important; letter-spacing: -.035em; line-height: 1; }
.crm-metric-note,
.crm-kpi-card small { display: block; margin-top: 8px; color: var(--muted-foreground) !important; font-size: 12px !important; line-height: 18px; }

.crm-feature-panel { overflow: hidden; }
.crm-feature-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.crm-feature-panel-head h3,
.card-header h3,
.card-header h4 { margin: 0 !important; color: var(--card-foreground) !important; font-size: 17px !important; font-weight: 650 !important; letter-spacing: -.015em; }
.crm-feature-panel-head p { margin: 3px 0 0 !important; color: var(--muted-foreground) !important; font-size: 13px !important; line-height: 19px; }

.crm-chip,
.badge,
.crm-status-pill { display: inline-flex; min-height: 30px; padding: 5px 10px; align-items: center; border: 1px solid var(--border); border-radius: 999px !important; background: var(--muted); color: var(--muted-foreground); font-size: 14px !important; font-weight: 650 !important; line-height: 19px; }
.crm-status-pill[data-tone="success"] { border-color: color-mix(in srgb, var(--success) 28%, transparent); background: color-mix(in srgb, var(--success) 11%, transparent); color: var(--success); }
.crm-status-pill[data-tone="warning"] { border-color: color-mix(in srgb, var(--warning) 30%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); color: #b96d00; }
.crm-status-pill[data-tone="danger"] { border-color: color-mix(in srgb, var(--destructive) 28%, transparent); background: color-mix(in srgb, var(--destructive) 9%, transparent); color: var(--destructive); }
.crm-status-pill[data-tone="blue"],
.crm-status-pill[data-tone="info"] { border-color: color-mix(in srgb, var(--primary) 28%, transparent); background: color-mix(in srgb, var(--primary) 9%, transparent); color: var(--primary); }
.crm-period-badge,
.crm-rate-pill { display: inline-flex; min-height: 30px; padding: 5px 10px; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--muted); color: var(--muted-foreground); font-size: 14px !important; font-weight: 650; line-height: 19px; white-space: nowrap; }
.crm-rate-pill { border-color: color-mix(in srgb, var(--success) 28%, transparent); background: color-mix(in srgb, var(--success) 11%, transparent); color: var(--success); }

body .form-label,
body label:not(.form-check-label) { color: var(--card-foreground) !important; font-size: 15px !important; font-weight: 600 !important; letter-spacing: 0 !important; }
.form-text,
.text-muted,
small { color: var(--muted-foreground); }

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="tel"],
input[type="search"],
textarea,
select {
  min-height: 42px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--input) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--card) !important;
  color: var(--card-foreground) !important;
  font-size: 15px !important;
  line-height: 22px !important;
  box-shadow: none !important;
}

textarea { min-height: 100px !important; }
.form-control-sm,
.form-select-sm { min-height: 36px !important; padding: 6px 10px !important; font-size: 14px !important; }
.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus { border-color: var(--ring) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent) !important; }
.form-control::placeholder,
input::placeholder,
textarea::placeholder { color: var(--muted-foreground) !important; opacity: .78; }
.form-control[readonly],
.form-control:disabled,
.form-select:disabled { background: var(--muted) !important; color: var(--muted-foreground) !important; opacity: .88; }
.form-check-input { border-color: var(--input) !important; background-color: var(--card) !important; }
.form-check-input:checked { border-color: var(--primary) !important; background-color: var(--primary) !important; }

.btn {
  display: inline-flex;
  min-height: 40px;
  padding: 8px 14px !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 20px;
  box-shadow: var(--shadow-xs);
}
.btn-sm { min-height: 34px; padding: 6px 10px !important; font-size: 13px !important; }
.btn-primary,
.btn-info,
.btn-success { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-foreground) !important; }
.btn-primary:hover,
.btn-info:hover,
.btn-success:hover { filter: brightness(.94); }
.btn-secondary,
.btn-outline-primary,
.btn-outline-secondary,
.btn-light { border-color: var(--input) !important; background: var(--card) !important; color: var(--accent-foreground) !important; }
.btn-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-light:hover { border-color: var(--ring) !important; background: var(--accent) !important; color: var(--accent-foreground) !important; }
.btn-danger { border-color: var(--destructive) !important; background: var(--destructive) !important; color: var(--destructive-foreground) !important; }

/* Legacy customer/document hard-delete controls remain hidden until the CRM
   has an audited archive-and-restore workflow. Server handlers fail closed too. */
body.crm-ignorre-shell form:has(input[name="delete_customer"]),
body.crm-ignorre-shell form:has(button[name="delete_lead"]),
body.crm-ignorre-shell button[onclick*="deleteIndividualFile"],
body.crm-ignorre-shell a[onclick*="deleteIndividualFile"] { display: none !important; }
.btn-warning { border-color: var(--warning) !important; background: var(--warning) !important; color: #271704 !important; }

.alert { border: 1px solid var(--border) !important; border-radius: var(--radius-md) !important; background: var(--muted) !important; color: var(--foreground) !important; }
.alert-success { border-color: color-mix(in srgb, var(--success) 28%, var(--border)) !important; background: color-mix(in srgb, var(--success) 10%, var(--card)) !important; }
.alert-danger { border-color: color-mix(in srgb, var(--destructive) 28%, var(--border)) !important; background: color-mix(in srgb, var(--destructive) 9%, var(--card)) !important; }
.alert-warning { border-color: color-mix(in srgb, var(--warning) 30%, var(--border)) !important; background: color-mix(in srgb, var(--warning) 10%, var(--card)) !important; }

/* --------------------------------------------------------------------------
   Ignorre data grids, instant search, resizable cells and compact pagination.
   -------------------------------------------------------------------------- */

.table-responsive,
.crm-table-shell {
  display: block;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  box-shadow: var(--shadow-xs) !important;
  -webkit-overflow-scrolling: touch;
}

.table,
.table1,
.crm-data-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--card-foreground);
  --bs-table-border-color: var(--border);
  width: 100%;
  margin: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  color: var(--card-foreground) !important;
  font-size: 15px !important;
}

.table thead th,
.table1 thead th,
.crm-data-table thead th {
  position: relative;
  min-height: 48px;
  padding: 13px 16px !important;
  border-color: var(--border) !important;
  background: var(--muted) !important;
  color: var(--muted-foreground) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .035em;
  line-height: 18px;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.table tbody td,
.table1 tbody td,
.crm-data-table tbody td {
  padding: 12px 16px !important;
  border-color: var(--border) !important;
  background: transparent !important;
  color: var(--card-foreground) !important;
  font-size: 15px !important;
  line-height: 22px;
  vertical-align: middle;
}

.table tbody tr:hover td,
.table1 tbody tr:hover td,
.crm-data-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 55%, transparent) !important; }
.table-light { --bs-table-bg: var(--muted) !important; --bs-table-color: var(--muted-foreground) !important; }

.crm-table-controls {
  display: flex;
  min-height: 58px;
  padding: 9px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--card);
}

.crm-table-controls + .table-responsive,
.crm-table-controls + .crm-table-shell { border-radius: 0 0 var(--radius) var(--radius) !important; }
.crm-table-search { position: relative; display: flex; max-width: 460px; margin: 0 !important; flex: 1 1 280px; align-items: center; }
.crm-table-search > i,
.crm-table-search > .crm-search-icon { position: absolute; z-index: 1; left: 12px; color: var(--muted-foreground); font-size: 14px; }
.crm-table-search > input { width: 100%; height: 40px !important; min-height: 40px !important; padding: 8px 12px 8px 36px !important; font-size: 15px !important; }
.crm-table-result-count { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; }
.crm-table-width-controls { display: inline-flex; margin-left: auto; align-items: center; gap: 5px; }
.crm-table-width-controls > span { margin-right: 3px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
.crm-icon-button,
.crm-width-reset { display: inline-flex; height: 36px; min-height: 36px !important; align-items: center; justify-content: center; border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); color: var(--foreground); }
.crm-icon-button { width: 36px; padding: 0 !important; }
.crm-width-reset { min-width: 80px; padding: 0 10px !important; font-size: 12px !important; }
.crm-icon-button:hover:not(:disabled),
.crm-width-reset:hover { border-color: var(--ring); background: var(--accent); }
.crm-icon-button:disabled { opacity: .4; }

.crm-data-table[data-crm-width="normal"] { min-width: 100%; }
.crm-data-table[data-crm-width="wide"] { min-width: max(125%, 1050px); }
.crm-data-table[data-crm-width="extra"] { min-width: max(160%, 1320px); }
.crm-column-resizer { position: absolute; z-index: 3; top: 0; right: -8px; bottom: 0; width: 16px; cursor: col-resize; touch-action: none; }
.crm-column-resizer::after { position: absolute; top: 18%; right: 7px; bottom: 18%; width: 1px; background: var(--border); content: ""; opacity: 0; transition: opacity 150ms ease, background 150ms ease; }
.crm-data-table thead th:hover .crm-column-resizer::after,
.crm-column-resizer:focus-visible::after,
.crm-column-resizing .crm-column-resizer::after { background: var(--ring); opacity: 1; }
body.crm-column-resizing,
body.crm-column-resizing * { cursor: col-resize !important; user-select: none !important; }

.pagination,
.crm-pagination {
  display: flex !important;
  max-width: 100% !important;
  margin: 14px 0 0 !important;
  padding: 0 !important;
  flex-wrap: wrap !important;
  justify-content: center;
  gap: 5px;
  overflow: visible !important;
}
.crm-pagination .page-item,
.crm-pagination .page-link { flex: 0 0 auto; }
.pagination .page-link,
.crm-pagination .page-link { display: inline-flex; min-width: 34px; min-height: 34px; padding: 5px 9px !important; align-items: center; justify-content: center; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; background: var(--card) !important; color: var(--foreground) !important; font-size: 13px; }
.pagination .active .page-link,
.crm-pagination .active .page-link { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-foreground) !important; }
.pagination .disabled .page-link { opacity: .48; }
.crm-page-ellipsis .page-link { border-color: transparent !important; background: transparent !important; color: var(--muted-foreground) !important; }
tr[hidden],
.crm-pagination > li[hidden] { display: none !important; }

.crm-filter-loading { position: relative; opacity: .72; pointer-events: none; }
.crm-filter-loading::after { position: absolute; z-index: 2; top: 12px; right: 12px; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 999px; content: ""; animation: crm-spin .7s linear infinite; }
@keyframes crm-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Tabs, wizards, permissions and CRM-specific intelligence surfaces.
   -------------------------------------------------------------------------- */

.nav-tabs,
.crm-workflow-tabs { display: flex; max-width: 100%; padding: 6px !important; flex-wrap: wrap; gap: 5px; overflow-x: auto; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; background: var(--muted) !important; }
.nav-tabs .nav-link,
.crm-workflow-tabs .nav-link { min-height: 38px; padding: 7px 12px !important; border: 1px solid transparent !important; border-radius: var(--radius-sm) !important; color: var(--muted-foreground) !important; font-size: 14px !important; font-weight: 600 !important; white-space: nowrap; }
.nav-tabs .nav-link:hover { color: var(--foreground) !important; }
.nav-tabs .nav-link.active,
.crm-workflow-tabs .nav-link.active { border-color: var(--border) !important; background: var(--card) !important; color: var(--foreground) !important; box-shadow: var(--shadow-xs); }
.tab-content { color: var(--foreground); }

#wizardTabs,
#clientWizardTabs,
.crm-wizard .nav-tabs,
.crm-wizard-steps { direction: ltr; }
#wizardTabs .nav-link,
#clientWizardTabs .nav-link,
.crm-wizard .nav-tabs .nav-link { display: inline-flex; align-items: center; gap: 7px; }
#wizardTabs .nav-link::before,
#clientWizardTabs .nav-link::before,
.crm-wizard .nav-tabs .nav-link::before { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: 999px; content: attr(data-step-number); font-size: 11px; font-weight: 750; opacity: .82; }
.crm-operational-wizard { direction: ltr; }
.crm-wizard-steps { display: grid; margin: 0 0 24px; padding: 0; grid-template-columns: repeat(3, 1fr); gap: 8px; list-style: none; }
.crm-wizard-steps li { min-height: 54px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); color: var(--muted-foreground); font-size: 14px; font-weight: 700; text-align: center; cursor: pointer; }
.crm-wizard-steps li.is-active { border-color: var(--primary); background: var(--accent); color: var(--accent-foreground); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 16%, transparent); }
.crm-wizard-steps li.is-complete::after { margin-left: 7px; color: var(--success); content: "✓"; }
.crm-wizard-stage { display: none; min-height: 220px; animation: crm-stage-in 180ms ease both; }
.crm-wizard-stage.is-active { display: block; }
@keyframes crm-stage-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.crm-wizard-actions { display: flex; margin-top: 24px; padding-top: 18px; align-items: center; gap: 10px; border-top: 1px solid var(--border); }
.crm-wizard-actions [data-wizard-status] { margin-right: auto; color: var(--muted-foreground); font-size: 12px; font-weight: 650; }

.crm-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.crm-permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.crm-check-card { display: flex !important; min-height: 82px; margin: 0 !important; padding: 14px !important; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); cursor: pointer; }
.crm-check-card:has(input:checked) { border-color: var(--primary); background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent); }
.crm-check-card input { width: 17px; height: 17px; margin-top: 2px; flex: 0 0 17px; accent-color: var(--primary); }
.crm-check-card > span { display: grid; min-width: 0; }
.crm-check-card strong { font-size: 14px !important; }
.crm-check-card small { color: var(--muted-foreground); font-size: 12px !important; }
.crm-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crm-row-actions form { margin: 0 !important; }

.crm-intelligence-notice { display: grid; margin-bottom: 18px; padding: 16px 18px; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--border)); border-radius: var(--radius); background: var(--accent); color: var(--accent-foreground) !important; text-decoration: none !important; }
.crm-intelligence-notice-icon { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); font-size: 18px; }
.crm-intelligence-notice > span:nth-child(2) { display: grid; }
.crm-intelligence-notice strong { font-size: 14px !important; }
.crm-intelligence-notice small { color: var(--muted-foreground); font-size: 12px !important; }

.crm-profile-avatar { display: inline-flex; width: 88px; height: 88px; flex: 0 0 88px; align-items: center; justify-content: center; border: 1px solid rgba(103,232,249,.22); border-radius: 24px; background: #67e8f9; color: #06212a; font-size: 25px; font-weight: 850; box-shadow: 0 14px 32px rgba(8,145,178,.24); }
.crm-chip-row { display: flex; margin-top: 14px; flex-wrap: wrap; gap: 7px; }
.crm-definition-list { display: grid; gap: 0; margin: 0; }
.crm-definition-list > div { display: flex; padding: 12px 0; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.crm-definition-list dt,
.crm-definition-list dd { margin: 0; font-size: 14px; }
.crm-definition-list dt { color: var(--muted-foreground); }
.crm-definition-list dd { color: var(--foreground); font-weight: 700; text-align: right; }

/* Feature primitives retained from the earlier CRM modules, rebuilt on the
   same Layout21 tokens so the obsolete 7,000-line theme layer is unnecessary. */
.crm-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  align-items: start;
  gap: 18px;
}

.crm-grid-equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.crm-toolbar {
  display: flex;
  margin: 0 0 18px;
  padding: 16px;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.crm-toolbar .form-group { min-width: 170px; flex: 1 1 190px; }
.crm-toolbar label { display: block; margin-bottom: 6px; font-size: 15px !important; }
.crm-toolbar .form-control,
.crm-toolbar .form-select,
.crm-toolbar .btn { min-height: 42px !important; font-size: 15px !important; }

.crm-score {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 3px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  color: var(--foreground);
  font-size: 13px !important;
  font-weight: 750;
}
.crm-score.crm-score-hot { border-top-color: var(--success); border-right-color: var(--success); }
.crm-score.crm-score-warm { border-top-color: var(--warning); }

.crm-reason-list,
.crm-mini-list,
.crm-timeline { margin: 0; padding: 0; list-style: none; }
.crm-reason-list { margin-top: 7px; }
.crm-reason-list li { margin-top: 4px; color: var(--muted-foreground); font-size: 13px !important; line-height: 1.5; }
.crm-mini-list li { display: flex; padding: 15px 0; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.crm-mini-list li:first-child { padding-top: 0; }
.crm-mini-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.crm-mini-list strong,
.crm-stage-meta strong { color: var(--foreground); font-size: 14px !important; line-height: 1.4; }
.crm-mini-list small,
.crm-stage-meta span { display: block; margin-top: 3px; color: var(--muted-foreground); font-size: 12.5px !important; line-height: 1.5; }

.crm-progress-track,
.crm-mini-progress { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--muted); }
.crm-mini-progress { height: 5px; margin-top: 7px; }
.crm-progress-fill,
.crm-mini-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #22d3ee); }
.crm-progress-value { display: flex; min-width: 120px; justify-content: space-between; gap: 12px; }
.crm-progress-value span { color: var(--muted-foreground); font-size: 12px; }

.crm-stage-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.crm-stage-row:last-child { border-bottom: 0; }
.crm-stage-meta { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; gap: 10px; }

.crm-client-profile {
  display: grid;
  padding: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.crm-client-title { display: flex; align-items: center; gap: 13px; }
.crm-client-avatar { display: grid; width: 50px; min-width: 50px; height: 50px; place-items: center; border-radius: var(--radius-md); background: var(--primary); color: var(--primary-foreground); font-size: 16px; font-weight: 750; }
body.crm-ignorre-shell #main-content .crm-client-title h2,
body.crm-ignorre-shell .content-wrapper .crm-client-title h2 { margin: 0 !important; font-size: 24px !important; }
.crm-client-title p { margin: 4px 0 0 !important; color: var(--muted-foreground) !important; font-size: 13px !important; }

.crm-detail-grid { display: grid; margin-top: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.crm-detail { min-height: 82px; padding: 15px; border: 1px solid var(--border) !important; border-radius: var(--radius-md) !important; background: var(--muted) !important; box-shadow: none !important; }
.crm-detail span { display: block; color: var(--muted-foreground); font-size: 11px !important; font-weight: 650; letter-spacing: .08em; line-height: 16px; text-transform: uppercase; }
.crm-detail strong { display: block; margin-top: 8px; overflow: hidden; color: var(--foreground); font-size: 14px !important; font-weight: 650; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }

.crm-timeline { position: relative; }
.crm-timeline::before { position: absolute; top: 9px; bottom: 9px; left: 6px; width: 1px; background: var(--border); content: ""; }
.crm-timeline li { position: relative; padding: 0 0 22px 27px; }
.crm-timeline li:last-child { padding-bottom: 0; }
.crm-timeline-dot { position: absolute; top: 5px; left: 2px; width: 9px; height: 9px; border: 2px solid var(--card); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent); }
.crm-timeline strong { color: var(--foreground); font-size: 14px !important; }
.crm-timeline p { margin: 3px 0 0 !important; color: var(--muted-foreground) !important; font-size: 13px !important; line-height: 1.5; }
.crm-timeline time { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: 12px !important; }

.crm-session-panel .crm-feature-panel-body { display: grid; min-height: 230px; align-content: space-between; }
.crm-role-list { display: grid; gap: 8px; }
.crm-role-list > article { display: flex; min-height: 70px; padding: 12px 14px; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); }
.crm-role-list > article > div:first-child { display: grid; }
.crm-role-list strong { font-size: 14px !important; }
.crm-role-list small { color: var(--muted-foreground); font-size: 12px !important; }

.crm-bank-route { display: inline-flex; margin-bottom: 5px; align-items: center; gap: 8px; white-space: nowrap; }
.crm-bank-route b { padding: 5px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-foreground); font-size: 12px; }
.crm-bank-route i { color: var(--primary); transform: rotate(180deg); }

.crm-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.crm-rule-card { display: grid; padding: 18px; gap: 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); }
.crm-rule-card > strong { font-size: 15px !important; }
.crm-rule-card > small { color: var(--muted-foreground); }
.crm-rule-card .form-label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.crm-rule-card .form-label .form-control { grid-column: 1; }
.crm-rule-card .form-label > span { grid-column: 2; grid-row: 2; }

.crm-count-link { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-foreground) !important; font-size: 13px; font-weight: 800; text-decoration: none !important; }
.crm-explainer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.crm-explainer-grid article { display: grid; min-height: 160px; padding: 18px; align-content: start; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); }
.crm-explainer-grid i { margin-bottom: 14px; color: var(--primary); font-size: 22px; }
.crm-explainer-grid strong { font-size: 14px !important; }
.crm-explainer-grid p { margin: 7px 0 0 !important; color: var(--muted-foreground); font-size: 13px !important; }

.modal-content,
.dropdown-menu,
.popover { border: 1px solid var(--border) !important; border-radius: var(--radius) !important; background: var(--popover) !important; color: var(--popover-foreground) !important; box-shadow: var(--shadow-lg) !important; }
.modal-body { color: var(--foreground); }
.dropdown-item { color: var(--foreground) !important; }
.dropdown-item:hover,
.dropdown-item:focus { background: var(--accent) !important; color: var(--accent-foreground) !important; }
.btn-close { filter: none; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

.crm-shortcut-hint { position: fixed; z-index: 1000; right: 16px; bottom: 16px; display: none; }
.crm-empty { padding: 42px 20px; color: var(--muted-foreground); text-align: center; }
.crm-client-cell { display: grid; min-width: 0; }
.crm-client-cell strong { color: var(--foreground); font-size: 14px !important; }
.crm-client-cell small { color: var(--muted-foreground); font-size: 12px !important; }

.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--destructive) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.bg-light { background-color: var(--muted) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-danger { background-color: var(--destructive) !important; }

/* --------------------------------------------------------------------------
   Authentication and standalone utility pages.
   -------------------------------------------------------------------------- */

body.auth-page {
  display: grid !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  place-items: stretch !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
}

body.auth-page::before,
body.auth-page::after {
  display: none !important;
  content: none !important;
}

.auth-page #app > .container {
  grid-column: 1;
  grid-row: 1;
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 40px !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.crm-auth-form-brand { display: inline-flex; min-height: 44px; padding: 6px 8px; align-items: center; border-radius: var(--radius-sm); background: #080b0f; }
.crm-auth-form-brand img { display: block; width: auto; max-width: 180px; height: 31px; object-fit: contain; }
.crm-auth-status { width: 100%; max-width: 430px; margin: 0 !important; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--success) 36%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--success) 10%, var(--card)); color: var(--foreground) !important; font-size: 14px !important; line-height: 21px; }
.auth-page .card { width: 100% !important; max-width: 430px !important; margin: 0 !important; }
.auth-page .card-header { padding: 28px 32px 8px !important; border: 0 !important; background: transparent !important; }
.auth-page .card-header h3 { margin: 0 !important; color: var(--card-foreground) !important; font-size: 25px !important; font-weight: 650 !important; letter-spacing: -.03em; }
.auth-page .card-body { padding: 20px 32px 32px !important; }
.auth-page .login-kicker { color: var(--muted-foreground) !important; font-size: 14px !important; }
.auth-page .btn-primary { width: 100%; min-height: 44px; }

.crm-auth-story {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: flex !important;
  min-height: calc(100dvh - 40px);
  margin: 20px !important;
  padding: clamp(36px, 5vw, 68px) !important;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  overflow: hidden;
  border: 1px solid rgba(103,232,249,.12) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 82% 8%, rgba(34, 211, 238, .18), transparent 22rem),
    radial-gradient(circle at 18% 110%, rgba(59, 130, 246, .16), transparent 22rem),
    #080d13 !important;
  color: #ffffff !important;
  box-shadow: 0 26px 80px -48px rgba(6, 182, 212, .50) !important;
}

.crm-auth-story-brand img { display: block !important; width: auto !important; max-width: 220px !important; height: 36px !important; object-fit: contain !important; }
.crm-auth-story-copy { max-width: 620px; }
.crm-auth-story-copy h3 { margin: 0 !important; color: #ffffff !important; font-size: clamp(30px, 3vw, 42px) !important; font-weight: 680 !important; letter-spacing: -.04em; line-height: 1.12; }
.crm-auth-story-copy > p { margin: 16px 0 0 !important; color: #94a3b8 !important; font-size: 17px !important; line-height: 28px; }
.crm-auth-story-copy > p strong { color: #e0f2fe !important; }
.crm-auth-story-copy ul { display: grid; margin: 28px 0 0; padding: 0; gap: 12px; list-style: none; }
.crm-auth-story-copy li { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 15px; }
.crm-auth-story-copy li i { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(103,232,249,.12); color: #67e8f9; }
.crm-auth-theme-toggle { position: fixed !important; z-index: 1100; top: 32px; right: 32px; border-color: rgba(255,255,255,.20) !important; background: rgba(8,13,19,.72) !important; color: #f8fafc !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

body.crm-standalone-page,
body.crm-access-denied { min-height: 100dvh; padding: 32px; background: var(--background) !important; color: var(--foreground) !important; }
.crm-access-denied main { width: min(560px, 100%); margin: 10vh auto 0; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-md); }
.crm-standalone-theme-toggle { position: fixed; z-index: 1000; top: 18px; right: 18px; }

/* --------------------------------------------------------------------------
   Responsive Layout21 sheet and dense-data safeguards.
   -------------------------------------------------------------------------- */

@media (max-width: 1199px) {
  .crm-metric-grid,
  .crm-kpi-grid,
  .crm-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-global-search { width: clamp(220px, 31vw, 350px); }
  .crm-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  body.crm-ignorre-shell .sidebar.crm-sidebar-layout21,
  body.crm-ignorre-shell .sidebar.crm-sidebar-layout21.is-expanded {
    width: min(92vw, var(--sidebar-width)) !important;
    min-width: min(92vw, var(--sidebar-width)) !important;
    transform: translateX(-105%) !important;
    box-shadow: 28px 0 70px -34px rgba(0, 0, 0, .72) !important;
    transition: transform 300ms ease-out !important;
  }

  body.crm-menu-open .sidebar.crm-sidebar-layout21,
  body.crm-menu-open .sidebar.crm-sidebar-layout21.is-expanded { transform: translateX(0) !important; }

  .crm-rail-secondary {
    width: calc(min(92vw, var(--sidebar-width)) - var(--sidebar-collapsed-width));
    min-width: calc(min(92vw, var(--sidebar-width)) - var(--sidebar-collapsed-width));
    flex-basis: calc(min(92vw, var(--sidebar-width)) - var(--sidebar-collapsed-width));
  }

  .crm-topbar {
    left: 0 !important;
    height: var(--header-height-mobile) !important;
    min-height: var(--header-height-mobile) !important;
    padding: 0 14px !important;
    gap: 10px !important;
  }

  body.crm-ignorre-shell #main-content,
  body.crm-ignorre-shell .content-wrapper,
  body.crm-ignorre-shell > .d-flex > .flex-grow-1 {
    width: 100% !important;
    min-height: calc(100dvh - var(--header-height-mobile)) !important;
    margin: var(--header-height-mobile) 0 0 !important;
    padding: 20px 16px 40px !important;
  }

  .crm-page-heading { display: none; }
  .crm-sidebar-mobile-close { display: inline-flex; }
  .crm-topbar-left { flex: 0 0 auto !important; }
  .crm-topbar-right { width: 100%; }
  .crm-global-search { width: 100%; min-width: 0; }
  .crm-global-search > kbd { display: none; }
  .crm-sidebar-backdrop { display: block; opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 200ms ease; }
  body.crm-menu-open .crm-sidebar-backdrop { opacity: 1; visibility: visible; }
  body.crm-menu-open { overflow: hidden !important; }

  .crm-feature-hero,
  .crm-profile-hero { min-height: 0; border-radius: 20px !important; }
  .crm-feature-actions { justify-content: flex-start; }
  .crm-settings-grid { grid-template-columns: 1fr; }
  .crm-grid-2,
  .crm-grid-equal { grid-template-columns: 1fr; }
  .crm-rule-grid { grid-template-columns: 1fr; }

  body.auth-page { display: block !important; }
  .auth-page #app > .container { min-height: 100dvh !important; padding: 74px 24px 34px !important; }
  .crm-auth-story { display: none !important; }
  .crm-auth-theme-toggle { top: 16px; right: 16px; border-color: var(--input) !important; background: var(--card) !important; color: var(--foreground) !important; }
}

@media (min-width: 1024px) {
  .crm-menu-toggle { display: none !important; }
}

@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea { font-size: 16px !important; }

  .crm-feature-hero,
  .crm-profile-hero { padding: 22px !important; flex-direction: column; align-items: flex-start; }
  .crm-feature-hero p { font-size: 14px !important; line-height: 22px; }
  .crm-metric-grid,
  .crm-kpi-grid,
  .crm-quick-grid { grid-template-columns: 1fr; }
  .crm-metric,
  .crm-kpi-card,
  .crm-quick-card { min-height: 122px; }
  .crm-permission-grid { grid-template-columns: 1fr; }
  .crm-detail-grid,
  .crm-explainer-grid { grid-template-columns: 1fr; }
  .crm-client-profile { grid-template-columns: 1fr; }
  .crm-role-list > article { align-items: flex-start; flex-direction: column; }
  .crm-feature-panel-head { align-items: flex-start; flex-direction: column; }

  .crm-table-controls { align-items: stretch; flex-direction: column; }
  .crm-table-search { width: 100%; max-width: none; flex-basis: auto; }
  .crm-table-width-controls { margin-left: 0; justify-content: space-between; }
  .crm-table-result-count { align-self: flex-start; }

  .pagination,
  .crm-pagination { gap: 4px; }
  .pagination .page-link,
  .crm-pagination .page-link { min-width: 32px; min-height: 32px; padding: 4px 8px !important; }

  .crm-wizard-steps { grid-template-columns: 1fr; direction: ltr; }
  .crm-wizard-actions { flex-wrap: wrap; }
  .crm-intelligence-notice { grid-template-columns: auto 1fr; }
  .crm-intelligence-notice > span:last-child { grid-column: 2; }

  body.crm-standalone-page,
  body.crm-access-denied { padding: 20px 14px; }
}

@media (max-width: 575px) {
  .crm-topbar { padding: 0 10px !important; }
  .crm-topbar-right { gap: 6px !important; }
  .crm-global-search > i,
  .crm-global-search > .crm-search-icon { margin-left: 10px; }
  .crm-theme-toggle,
  .crm-menu-toggle,
  .crm-alert-link,
  .crm-personal-trigger { width: 38px !important; min-width: 38px !important; height: 38px !important; min-height: 38px !important; }
  .crm-personal-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .crm-global-search { min-width: 90px; flex: 1 1 120px; }
  .crm-global-search > input { min-width: 0; padding-right: 8px !important; }
  .crm-auth-status { font-size: 13px !important; }
  .auth-page #app > .container { padding: 70px 16px 28px !important; }
  .auth-page .card-header { padding: 24px 22px 8px !important; }
  .auth-page .card-body { padding: 18px 22px 24px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
}

@media print {
  .sidebar,
  .crm-topbar,
  .crm-sidebar-backdrop,
  .crm-table-controls,
  .crm-shortcut-hint { display: none !important; }
  body.crm-ignorre-shell #main-content,
  body.crm-ignorre-shell .content-wrapper,
  body.crm-ignorre-shell > .d-flex > .flex-grow-1 { width: 100% !important; margin: 0 !important; padding: 0 !important; background: #ffffff !important; color: #000000 !important; }
}

/* 20260829r — employee legibility layer.
   The Ignorre geometry and color tokens stay unchanged; operational text is
   deliberately larger for long CRM shifts and dense customer records. */
body.crm-ignorre-shell,
body.auth-page,
body.crm-standalone-page,
body.crm-access-denied { font-size: 16px !important; line-height: 1.55 !important; }

body.crm-ignorre-shell p,
body.crm-ignorre-shell li,
body.crm-ignorre-shell td,
body.crm-ignorre-shell dd,
body.crm-ignorre-shell .form-text,
body.auth-page p { font-size: 15px !important; line-height: 1.55 !important; }

body.crm-ignorre-shell label:not(.form-check-label),
body.crm-ignorre-shell input:not([type="checkbox"]):not([type="radio"]),
body.crm-ignorre-shell select,
body.crm-ignorre-shell textarea,
body.crm-ignorre-shell .btn,
body.auth-page label,
body.auth-page input,
body.auth-page select,
body.auth-page textarea,
body.auth-page .btn { font-size: 16px !important; }

body.crm-ignorre-shell table th { font-size: 14px !important; line-height: 1.45 !important; }
body.crm-ignorre-shell table td { min-height: 48px; vertical-align: middle; }
body.crm-ignorre-shell small,
body.crm-ignorre-shell .small,
body.crm-ignorre-shell .crm-feature-panel-head p,
body.crm-ignorre-shell .crm-kpi-card small,
body.crm-ignorre-shell .crm-quick-card small,
body.crm-ignorre-shell .crm-client-cell small,
body.crm-ignorre-shell .crm-timeline time,
body.crm-ignorre-shell .crm-personal-links small { font-size: 14px !important; line-height: 1.5 !important; }

body.crm-ignorre-shell .crm-nav-label,
body.crm-ignorre-shell .crm-rail-panel-links strong,
body.crm-ignorre-shell .crm-personal-links strong { font-size: 15px !important; }

body.crm-ignorre-shell .crm-pagination .page-link,
body.crm-ignorre-shell .pagination .page-link { min-width: 38px; min-height: 38px; font-size: 15px !important; }

@media (max-width: 575px) {
  body.crm-ignorre-shell,
  body.auth-page { font-size: 15px !important; }
  body.crm-ignorre-shell p,
  body.crm-ignorre-shell li,
  body.crm-ignorre-shell td,
  body.crm-ignorre-shell dd,
  body.auth-page p { font-size: 14.5px !important; }
}

/* 20260830r4 — permission-aware slim shell and personal data-sheet controls.
   The shared layer applies to Admin, Reviewer/Quality and Agent portals while
   leaving route authorization and CRM records server-owned. */
:root {
  --sidebar-collapsed-width: 64px;
  --sidebar-width: 288px;
  --sidebar-panel-width: 224px;
  --sidebar-header-height: 64px;
  --header-height: 64px;
}

.crm-rail-brand {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
}

.crm-rail-brand img {
  width: 26px !important;
  height: 26px !important;
}

.crm-rail-nav {
  padding: 10px 0 !important;
  gap: 6px !important;
}

.crm-rail-indicator {
  top: 21px !important;
  height: 15px !important;
  transform: translateY(calc(var(--crm-rail-index) * 44px)) !important;
}

.crm-rail-button {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  flex-basis: 38px !important;
  border-radius: 10px !important;
}

.crm-rail-button > i,
.crm-rail-button > .crm-lucide-icon {
  font-size: 15px !important;
}

.crm-rail-tooltip { left: 57px !important; }

.crm-rail-account {
  width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  margin: 10px 0 !important;
  flex-basis: 30px !important;
}

.crm-rail-secondary-header { padding: 0 16px !important; }
.crm-rail-secondary-header img { max-width: 144px !important; height: 22px !important; }
.crm-rail-panel { padding: 14px 12px 20px !important; }
.crm-rail-panel-intro { margin-bottom: 9px !important; padding: 0 4px 12px !important; }
.crm-rail-panel h2 { margin: 0 !important; font-size: 18px !important; line-height: 24px !important; }
.crm-rail-panel-tagline { margin-top: 3px !important; font-size: 12.5px !important; line-height: 18px !important; }
.crm-rail-panel-description,
.crm-rail-open,
.crm-rail-panel-eyebrow { display: none !important; }
.crm-rail-direct-label { margin: 0 8px 5px !important; font-size: 8px !important; }
.crm-rail-panel-links { gap: 2px !important; }
.crm-rail-panel-links > a {
  min-height: 36px !important;
  padding: 7px 9px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
}

.crm-topbar {
  height: var(--header-height) !important;
  min-height: var(--header-height) !important;
  padding: 0 16px !important;
}

body.crm-ignorre-shell #main-content,
body.crm-ignorre-shell .content-wrapper,
body.crm-ignorre-shell > .d-flex > .flex-grow-1 {
  padding: 22px clamp(18px, 2vw, 28px) 40px !important;
}

/* Sharp Excel-like data surfaces: readable text, reliable horizontal scroll,
   and no fixed-layout collisions from the legacy page-level styles. */
.crm-data-table {
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-variant-numeric: tabular-nums;
}

.crm-data-table thead th {
  min-width: 96px;
  padding: 9px 10px !important;
  white-space: nowrap !important;
  vertical-align: top !important;
  background: color-mix(in srgb, var(--muted) 88%, var(--card)) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .005em !important;
}

.crm-data-table tbody td,
.crm-data-table tfoot td {
  height: 44px;
  max-width: 340px;
  padding: 9px 10px !important;
  overflow: hidden;
  color: var(--foreground) !important;
  font-size: 14.5px !important;
  line-height: 1.45 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle !important;
}

.crm-data-table[data-crm-density="compact"] tbody td,
.crm-data-table[data-crm-density="compact"] tfoot td {
  height: 36px;
  padding: 6px 9px !important;
  font-size: 14px !important;
}

.crm-data-table[data-crm-density="compact"] thead th { padding: 7px 9px !important; }

.crm-data-table[data-crm-wrap="true"] tbody td,
.crm-data-table[data-crm-wrap="true"] tfoot td {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.crm-data-table[data-crm-striped="true"] tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--muted) 45%, transparent) !important;
}

.crm-data-table th[hidden],
.crm-data-table td[hidden],
.crm-data-table [data-crm-column-hidden="true"] { display: none !important; }

.crm-data-table .crm-sticky-column {
  position: sticky !important;
  left: 0;
  z-index: 2;
  background: var(--card) !important;
  box-shadow: 1px 0 0 var(--border), 12px 0 20px -20px rgba(15, 23, 42, .45);
}

.crm-data-table thead .crm-sticky-column {
  z-index: 4;
  background: color-mix(in srgb, var(--muted) 88%, var(--card)) !important;
}

.crm-data-table thead th .form-control,
.crm-data-table thead th .form-select {
  min-width: 104px;
  min-height: 34px !important;
  height: 34px;
  margin-top: 5px;
  padding: 5px 8px !important;
  font-size: 14px !important;
}

.crm-data-table textarea.form-control {
  min-width: 180px;
  max-height: 112px;
  resize: vertical;
}

.crm-grid-toolbar {
  position: relative;
  z-index: 12;
  min-height: 56px;
  padding: 9px 10px !important;
  flex-wrap: wrap;
  gap: 8px !important;
  overflow: visible !important;
  border-color: var(--border) !important;
  background: var(--card) !important;
}

.crm-grid-toolbar-spacer { flex: 1 1 12px; }

.crm-tool-button,
.crm-grid-menu > summary,
.crm-search-clear,
.crm-grid-move,
.crm-grid-reset-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--input);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-family: var(--crm-font);
  font-weight: 650;
}

.crm-tool-button,
.crm-grid-menu > summary {
  min-height: 36px;
  padding: 0 10px;
  gap: 7px;
  font-size: 13.5px;
  cursor: pointer;
  list-style: none;
}

.crm-grid-menu > summary::-webkit-details-marker { display: none; }
.crm-tool-button:hover,
.crm-tool-button.is-active,
.crm-grid-menu[open] > summary,
.crm-grid-menu > summary:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--input));
  background: var(--accent);
  color: var(--accent-foreground);
}

.crm-tool-button .crm-lucide-icon,
.crm-grid-menu > summary .crm-lucide-icon,
.crm-grid-reset-view .crm-lucide-icon { width: 16px; height: 16px; }

.crm-grid-menu > summary em {
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
  text-align: center;
}

.crm-table-search-area {
  display: flex;
  min-width: min(100%, 430px);
  flex: 1 1 430px;
  align-items: center;
  gap: 7px;
}

.crm-table-search-area[hidden] { display: none !important; }

.crm-grid-toolbar .crm-table-search {
  width: min(100%, 340px);
  min-width: 190px;
  height: 36px;
  flex: 1 1 240px;
}

.crm-grid-toolbar .crm-table-search input {
  height: 34px !important;
  padding-right: 34px !important;
  font-size: 14.5px !important;
}

.crm-search-clear {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
}

.crm-search-clear[hidden] { display: none !important; }
.crm-search-clear .crm-lucide-icon { width: 14px; height: 14px; }

.crm-grid-select {
  min-width: 108px;
  height: 36px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--input);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-family: var(--crm-font);
  font-size: 13px;
}

.crm-grid-menu { position: relative; }

.crm-grid-menu:not([open]) > .crm-grid-menu-panel,
.crm-alert-link[hidden],
.crm-personal-links [hidden] { display: none !important; }

.crm-grid-menu-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(340px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  padding: 9px;
  gap: 5px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: var(--shadow-lg);
}

.crm-grid-menu-heading {
  display: grid;
  padding: 7px 8px 9px;
  border-bottom: 1px solid var(--border);
}

.crm-grid-menu-heading strong { font-size: 14px; }
.crm-grid-menu-heading small { color: var(--muted-foreground); font-size: 12px !important; }

.crm-grid-field-row,
.crm-grid-view-row {
  display: flex;
  min-height: 42px;
  padding: 6px 7px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
}

.crm-grid-field-row:hover,
.crm-grid-view-row:hover { background: var(--muted); }

.crm-grid-field-check {
  display: flex;
  min-width: 0;
  margin: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.crm-grid-field-check input,
.crm-grid-view-row > input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
}

.crm-grid-field-check span {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-grid-field-actions { display: flex; gap: 3px; }
.crm-grid-move {
  width: 30px;
  height: 30px;
  padding: 0;
}
.crm-grid-move:disabled { opacity: .35; }
.crm-grid-move .crm-lucide-icon { width: 14px; height: 14px; }
.crm-grid-move.is-left .crm-lucide-icon { transform: rotate(180deg); }

.crm-grid-view-row > span { display: grid; min-width: 0; }
.crm-grid-view-row > span strong { font-size: 13.5px; }
.crm-grid-view-row > span small { color: var(--muted-foreground); font-size: 11.5px !important; }
.crm-grid-view-row > .crm-grid-select { min-width: 104px; }

.crm-grid-reset-view {
  min-height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.crm-grid-reset-view:hover {
  border-color: color-mix(in srgb, var(--destructive) 35%, var(--input));
  background: color-mix(in srgb, var(--destructive) 8%, var(--card));
  color: var(--destructive);
}

.crm-grid-toolbar .crm-table-result-count {
  min-width: max-content;
  padding: 0 3px;
  font-size: 12.5px !important;
}

.crm-grid-toolbar .crm-table-width-controls {
  margin-left: 0;
  gap: 4px;
}

.crm-grid-toolbar .crm-table-width-controls > span { font-size: 11.5px; }
.crm-grid-toolbar .crm-icon-button,
.crm-grid-toolbar .crm-width-reset { height: 36px; min-height: 36px !important; }

@media (max-width: 1023px) {
  :root {
    --sidebar-width: 288px;
    --sidebar-panel-width: 224px;
  }
}

@media (max-width: 820px) {
  .crm-grid-toolbar {
    align-items: center !important;
    flex-direction: row !important;
  }

  .crm-table-search-area {
    width: 100%;
    flex-basis: 100%;
    order: -1;
  }

  .crm-grid-toolbar-spacer { display: none; }
}

@media (max-width: 575px) {
  .crm-grid-toolbar { padding: 8px !important; }
  .crm-table-search-area { flex-wrap: wrap; }
  .crm-grid-toolbar .crm-table-search { width: 100%; max-width: none; flex-basis: 100%; }
  .crm-grid-select { flex: 1 1 130px; }
  .crm-tool-button > span,
  .crm-grid-menu > summary > span,
  .crm-grid-toolbar .crm-table-width-controls > span { display: none; }
  .crm-tool-button,
  .crm-grid-menu > summary { width: 38px; padding: 0; }
  .crm-grid-menu > summary em { display: none; }
  .crm-grid-toolbar .crm-table-result-count { margin-right: auto; }
  .crm-grid-menu-panel { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; max-height: min(70vh, 520px); }
}

/* 20260904r14 — contextual knowledge base, non-reloading row search, and
   document-integrity presentation. These surfaces are shared by Agent,
   Reviewer, Administrator, and Super Administrator workspaces. */
.crm-help-launcher {
  display: inline-flex;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
  font-family: var(--crm-font);
  font-size: 17px;
  font-weight: 780;
  cursor: pointer;
}

.crm-help-launcher:hover,
.crm-help-launcher:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--input));
  background: var(--accent);
  color: var(--accent-foreground);
}

.crm-help-launcher em { display: none; font-style: normal; }
.crm-help-launcher-floating {
  position: fixed;
  z-index: 1030;
  top: 18px;
  right: 76px;
}

.crm-help-marker {
  position: fixed;
  z-index: 1055;
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 2px solid var(--card);
  border-radius: 999px;
  background: linear-gradient(145deg, #1769ff, #06cbe0);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(23, 105, 255, .30);
  font-family: var(--crm-font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  animation: crm-help-arrive 150ms ease-out both;
}

.crm-help-marker[hidden],
.crm-help-backdrop[hidden],
.crm-help-drawer[hidden] { display: none !important; }

@keyframes crm-help-arrive {
  from { opacity: 0; transform: translateY(4px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.crm-help-backdrop {
  position: fixed;
  z-index: 1060;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(3, 8, 18, .34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.crm-help-drawer {
  position: fixed;
  z-index: 1065;
  top: 0;
  right: 0;
  display: grid;
  width: min(460px, 94vw);
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--border);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: -30px 0 80px -45px rgba(2, 8, 23, .65);
  animation: crm-help-slide-in 190ms ease-out both;
}

@keyframes crm-help-slide-in {
  from { opacity: .7; transform: translateX(34px); }
  to { opacity: 1; transform: translateX(0); }
}

.crm-help-drawer-header {
  display: flex;
  min-height: 78px;
  padding: 16px 18px 14px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
}

.crm-help-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.crm-help-drawer-header h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.crm-help-close {
  display: inline-grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--input);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
}

.crm-help-close .crm-lucide-icon { width: 17px; height: 17px; }
.crm-help-drawer-body { padding: 22px; overflow: auto; }
.crm-help-meta { display: flex; margin-bottom: 16px; flex-wrap: wrap; gap: 7px; }
.crm-help-meta span {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 680;
}

.crm-help-block {
  padding: 17px 0;
  border-top: 1px solid var(--border);
}

.crm-help-block:first-child { padding-top: 0; border-top: 0; }
.crm-help-block h3 {
  margin: 0 0 6px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 720;
}

.crm-help-block p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 15px !important;
  line-height: 1.65 !important;
}

.crm-help-search { display: grid; margin: 8px 0 14px; gap: 7px; }
.crm-help-search > span { color: var(--foreground); font-size: 14px; font-weight: 680; }
.crm-help-search input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--input);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
}

.crm-help-topic-list { display: grid; gap: 8px; }
.crm-help-topic-item {
  display: grid;
  width: 100%;
  padding: 13px 14px;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  color: var(--foreground);
  text-align: left;
}

.crm-help-topic-item:hover,
.crm-help-topic-item:focus-visible { border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); background: var(--accent); }
.crm-help-topic-item strong { font-size: 14px; font-weight: 700; }
.crm-help-topic-item small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.crm-help-drawer-footer {
  display: flex;
  min-height: 68px;
  padding: 12px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 42%, var(--popover));
}

.crm-help-browse {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--input);
  border-radius: 9px;
  background: var(--card);
  color: var(--foreground);
  font-weight: 680;
}

.crm-help-drawer-footer small { max-width: 210px; color: var(--muted-foreground); font-size: 11.5px !important; text-align: right; }
.crm-instant-filter-status {
  margin: -12px 0 14px;
  padding: 0 3px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.45;
}

.crm-document-download-row {
  display: flex;
  min-height: 38px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-document-download-row > small { color: var(--muted-foreground); font-size: 12px !important; }
.crm-document-download-row.is-new {
  margin: 2px 0 6px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--success) 28%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 7%, var(--card));
}

/* Focused performance-home layout. */
.crm-performance-dashboard { display: grid; min-width: 0; gap: 18px; }
.crm-dashboard-hero { min-height: 164px; }
.crm-dashboard-hero-copy { max-width: 760px; }
.crm-dashboard-role {
  display: inline-flex;
  min-height: 30px;
  padding: 5px 10px;
  align-items: center;
  border: 1px solid rgba(103, 232, 249, .22);
  border-radius: 999px;
  background: rgba(103, 232, 249, .08);
  color: #a5f3fc;
  font-size: 13px;
  font-weight: 680;
}

.crm-dashboard-filter-card,
.crm-dashboard-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-xs);
}

.crm-dashboard-filter-card { padding: 16px 18px; background: color-mix(in srgb, var(--muted) 22%, var(--card)); }
.crm-dashboard-filter-head,
.crm-dashboard-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.crm-dashboard-filter-head { margin-bottom: 14px; }
.crm-dashboard-filter-head h2,
.crm-dashboard-card > header h2 { margin: 0; color: var(--foreground); font-size: 17px; font-weight: 710; letter-spacing: -.018em; }
.crm-dashboard-filter-head p,
.crm-dashboard-card > header p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 13px !important; line-height: 1.5 !important; }
.crm-dashboard-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.crm-dashboard-filter-grid > [class*="col-"] { width: auto; max-width: none; padding: 0; }
.crm-dashboard-filter-grid .form-label { margin-bottom: 5px; }
.crm-dashboard-status-menu { width: 100%; }
.crm-dashboard-status-menu .dropdown-toggle { min-height: 42px; }
.crm-dashboard-filter-actions { display: flex; gap: 8px; }
.crm-dashboard-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.crm-dashboard-kpis .crm-kpi-card { min-height: 126px; }
.crm-kpi-card-position { position: relative; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)) !important; background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 16%, var(--card)), var(--card)) !important; box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 17%, transparent); }
.crm-kpi-card-position::after { position: absolute; top: 12px; right: 13px; width: 10px; height: 10px; border-radius: 999px; content: ''; background: var(--primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 13%, transparent); animation: crm-position-pulse 1.8s ease-in-out infinite; }
.crm-kpi-card-position strong { color: var(--primary) !important; }
@keyframes crm-position-pulse { 50% { transform: scale(.72); opacity: .58; } }
.crm-kpi-value-link {
  display: inline-block;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
}
.crm-kpi-value-link:hover strong { color: var(--primary) !important; }
.crm-kpi-value-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ring) 32%, transparent);
  outline-offset: 4px;
}
.crm-dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .8fr); gap: 14px; align-items: stretch; }
.crm-dashboard-card { padding: 18px; overflow: hidden; }
.crm-dashboard-card > header { margin-bottom: 14px; }
.crm-dashboard-card > header > span { color: var(--muted-foreground); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.crm-dashboard-chart { position: relative; width: 100%; height: 310px; }
.crm-dashboard-chart.is-tall { height: max(360px, calc(var(--crm-agent-count, 8) * 42px)); max-height: 680px; }
.crm-dashboard-chart canvas { width: 100% !important; height: 100% !important; }
.crm-dashboard-agent-name { display: inline-flex; min-height: 36px; padding: 7px 11px; align-items: center; gap: 7px; border: 1px solid color-mix(in srgb, var(--primary) 44%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-foreground); }
.crm-dashboard-agent-name > i { color: #a5f3fc; font-size: 16px; }
.crm-dashboard-agent-name > span { opacity: .78; font-size: 12px; font-weight: 700; }
.crm-dashboard-agent-name > strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.crm-outcome-volume { position: relative; min-height: 0; }
.crm-outcome-volume::before { position: absolute; inset: 0 0 auto; height: 160px; content: ''; pointer-events: none; background: radial-gradient(circle at 10% 0, color-mix(in srgb, var(--primary) 12%, transparent), transparent 45%), radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--success) 10%, transparent), transparent 42%); }
.crm-outcome-volume > * { position: relative; z-index: 1; }
.crm-outcome-canvas-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: color-mix(in srgb, var(--card) 90%, var(--muted)); }
.crm-outcome-canvas-summary > span { display: grid; min-height: 72px; padding: 11px 13px; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: 9px; align-items: center; border-right: 1px solid var(--border); }
.crm-outcome-canvas-summary > span:last-child { border-right: 0; }
.crm-outcome-canvas-summary i { grid-row: 1 / span 2; color: var(--primary); font-size: 18px; }
.crm-outcome-canvas-summary small { color: var(--muted-foreground); font-size: 11px; font-weight: 720; }
.crm-outcome-canvas-summary strong { color: var(--foreground); font-size: 21px; line-height: 1; }
.crm-outcome-volume-controls { display: flex; margin: 0 0 14px; padding: 10px 12px; align-items: end; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--muted) 30%, var(--card)); }
.crm-outcome-volume-controls .crm-dashboard-status-menu { max-width: 290px; }
.crm-outcome-volume-controls .dropdown { width: 100%; }
.crm-outcome-volume-controls .dropdown-toggle {
  display: flex;
  width: 100%;
  min-width: 240px;
  min-height: 44px;
  padding: 9px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: var(--border) !important;
  border-radius: 10px;
  background: var(--card) !important;
  color: var(--foreground) !important;
  font-weight: 680;
  box-shadow: var(--shadow-xs);
}
.crm-outcome-volume-controls .dropdown-toggle::after { flex: 0 0 auto; margin-left: auto; }
.crm-outcome-volume-controls .dropdown-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--border)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 17%, transparent) !important;
}
.crm-outcome-selector {
  width: min(360px, calc(100vw - 32px));
  max-height: min(410px, calc(100vh - 96px));
  margin-top: 7px !important;
  padding: 10px !important;
  overflow-x: hidden;
  overflow-y: auto;
}
.crm-outcome-volume { overflow: visible; }
.crm-outcome-volume:has(.crm-outcome-selector.show) { z-index: 40; }
.crm-outcome-selector-heading { display: grid; padding: 7px 10px 10px; gap: 2px; }
.crm-outcome-selector-heading > span { color: var(--foreground); font-size: 13px; font-weight: 780; }
.crm-outcome-selector-heading > small { color: var(--muted-foreground); font-size: 11.5px; }
.crm-outcome-selector .dropdown-divider { margin: 6px 5px; border-color: var(--border); }
.crm-outcome-option {
  display: grid;
  min-height: 42px;
  margin: 2px 0;
  padding: 8px 10px;
  grid-template-columns: 20px 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: var(--foreground);
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
  transition: background-color .16s ease, color .16s ease;
}
.crm-outcome-option:hover { background: var(--accent); color: var(--accent-foreground); }
.crm-outcome-option.is-all { grid-template-columns: 20px minmax(0, 1fr) auto; background: color-mix(in srgb, var(--primary) 8%, var(--card)); font-weight: 760; }
.crm-outcome-option .form-check-input { width: 17px; height: 17px; margin: 0; }
.crm-outcome-option > strong { min-width: 28px; color: var(--muted-foreground); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.crm-outcome-swatch { display: block; width: 8px; height: 8px; border-radius: 999px; background: var(--muted-foreground); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted-foreground) 12%, transparent); }
.crm-outcome-swatch[data-outcome="pending"], .crm-selected-outcome-list [data-outcome="pending"] > i { background: var(--secondary); }
.crm-outcome-swatch[data-outcome="loggedin"], .crm-selected-outcome-list [data-outcome="loggedin"] > i { background: var(--chart-3); }
.crm-outcome-swatch[data-outcome="rework"], .crm-selected-outcome-list [data-outcome="rework"] > i { background: var(--chart-4); }
.crm-outcome-swatch[data-outcome="approved"], .crm-selected-outcome-list [data-outcome="approved"] > i { background: var(--chart-2); }
.crm-outcome-swatch[data-outcome="booked"], .crm-selected-outcome-list [data-outcome="booked"] > i { background: var(--chart-1); }
.crm-outcome-swatch[data-outcome="s-reject"], .crm-selected-outcome-list [data-outcome="s-reject"] > i { background: var(--chart-5); }
.crm-outcome-swatch[data-outcome="reject"], .crm-selected-outcome-list [data-outcome="reject"] > i { background: var(--destructive); }
.crm-outcome-swatch[data-outcome="backout"], .crm-selected-outcome-list [data-outcome="backout"] > i { background: var(--muted-foreground); }
.crm-outcome-option:has(.form-check-input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--ring) 24%, transparent); outline-offset: 1px; }
.crm-selected-outcomes { display: grid; margin: 0 0 14px; padding: 12px; gap: 10px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--muted) 18%, var(--card)); }
.crm-selected-outcomes > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.crm-selected-outcomes > div:first-child > strong { color: var(--foreground); font-size: 13px; }
.crm-selected-outcomes > div:first-child > small { color: var(--muted-foreground); font-size: 11.5px; }
.crm-selected-outcome-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 7px; }
.crm-selected-outcome-list > span { display: grid; min-height: 44px; padding: 8px 9px; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); }
.crm-selected-outcome-list > span > i { display: block; width: 8px; height: 8px; border-radius: 999px; }
.crm-selected-outcome-list > span > small { overflow: hidden; color: var(--muted-foreground); font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.crm-selected-outcome-list > span > strong { color: var(--foreground); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Pipeline release: server-backed lead search, Booked-only success and
   compact journey visibility. */
.crm-nav-alert-badge {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 5px;
  place-items: center;
  border: 2px solid var(--sidebar);
  border-radius: 999px;
  background: var(--destructive);
  color: var(--destructive-foreground);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.crm-server-search-status {
  display: flex;
  min-height: 28px;
  margin: -8px 0 12px;
  padding: 0 2px;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 620;
}

.crm-server-search-status.is-loading::before {
  width: 14px;
  height: 14px;
  content: '';
  border: 2px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: crm-search-spin .65s linear infinite;
}

@keyframes crm-search-spin { to { transform: rotate(360deg); } }

.crm-pipeline-ribbon {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 8px;
  scrollbar-width: thin;
}

.crm-pipeline-ribbon.has-lead-pipeline { grid-template-columns: repeat(9, minmax(112px, 1fr)); }

.crm-journey-lanes { display: grid; gap: 14px; }
.crm-journey-lane { padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--card) 94%, var(--primary)); }
.crm-journey-lane > header { display: flex; margin: 0 0 10px; padding: 0; border: 0; align-items: flex-start; justify-content: space-between; }
.crm-journey-lane > header h3 { margin: 0; color: var(--foreground); font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.crm-journey-lane > header p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 12px; line-height: 1.45; }
.crm-journey-lane-exceptions { border-color: color-mix(in srgb, var(--destructive) 22%, var(--border)); background: color-mix(in srgb, var(--card) 97%, var(--destructive)); }
.crm-journey-lane .crm-pipeline-ribbon { grid-template-columns: repeat(5, minmax(112px, 1fr)); }
.crm-journey-lane .crm-pipeline-ribbon.has-lead-pipeline { grid-template-columns: repeat(6, minmax(112px, 1fr)); }
.crm-journey-lane-exceptions .crm-pipeline-ribbon { grid-template-columns: repeat(3, minmax(132px, 1fr)); }
.crm-pipeline-stage.is-lead-pipeline {
  border-color: color-mix(in srgb, var(--primary) 33%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--card));
}

.crm-pipeline-stage.is-lead-pipeline b { color: var(--primary); }

.crm-pipeline-stage {
  position: relative;
  display: block;
  min-width: 112px;
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--muted) 42%, var(--card));
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.crm-pipeline-stage::after {
  position: absolute;
  top: 50%;
  right: -9px;
  width: 9px;
  height: 1px;
  content: '';
  background: var(--border);
}

.crm-pipeline-stage:last-child::after { display: none; }
.crm-pipeline-stage strong { display: block; color: var(--foreground); font-size: 15px; }
.crm-pipeline-stage b { display: block; margin-top: 7px; color: var(--primary); font-size: 22px; line-height: 1; }
.crm-pipeline-stage small { display: block; margin-top: 5px; color: var(--muted-foreground); font-size: 11.5px !important; }
.crm-pipeline-stage.is-booked {
  border-color: color-mix(in srgb, var(--success) 38%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--card));
}
.crm-pipeline-stage.is-booked b { color: var(--success); }
a.crm-pipeline-stage:hover,
a.crm-pipeline-stage:focus-visible {
  z-index: 1;
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 10%, transparent);
  transform: translateY(-2px);
}
a.crm-pipeline-stage:focus-visible { outline: 3px solid color-mix(in srgb, var(--ring) 28%, transparent); outline-offset: 2px; }
a.crm-pipeline-stage.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 11%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 36%, transparent);
}

.crm-journey-total-link {
  display: inline-flex;
  min-height: 34px;
  padding: 6px 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--foreground);
  font-size: 12.5px;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
}
.crm-journey-total-link:hover { border-color: var(--primary); color: var(--primary); }

.crm-journey-drilldown {
  scroll-margin-top: 82px;
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--primary) 8%, transparent);
}
.crm-journey-search { margin: 0 0 14px; box-shadow: none; }
.crm-journey-search .form-group { min-width: min(100%, 320px); }
.crm-journey-pagination-summary {
  margin-top: 14px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-weight: 620;
  text-align: center;
}

.crm-work-hub { scroll-margin-top: 82px; }
.crm-work-metrics { margin: 0 0 14px; }
.crm-work-metrics .crm-metric { min-height: 132px; }
.crm-metric-value-link { color: var(--foreground); text-decoration: none; }
.crm-metric-value-link:hover { color: var(--primary); }
.crm-work-filter { margin-bottom: 14px; box-shadow: none; }
.crm-work-grid { margin-top: 0; }
.crm-work-grid .crm-feature-panel { margin: 0 !important; }
.crm-task-actions { display: flex; align-items: center; gap: 5px; }
.crm-task-actions form { margin: 0; }
.crm-scoring-note {
  display: flex;
  margin: 12px 0 0;
  padding: 12px 14px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--muted) 32%, var(--card));
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.5;
}
.crm-scoring-note i { margin-top: 2px; color: var(--primary); }
.crm-scoring-note strong { color: var(--foreground); }

.crm-team-rank {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--muted);
  color: var(--foreground);
  font-size: 12px;
  font-weight: 780;
}

.crm-team-rank.is-top { background: color-mix(in srgb, var(--success) 13%, var(--card)); color: var(--success); }
.crm-team-member-current { background: color-mix(in srgb, var(--primary) 5%, var(--card)); }

.crm-booking-race-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.crm-booking-race-card { --race-progress: 56%; position: relative; display: grid; min-height: 174px; gap: 4px; align-content: end; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--card) 92%, var(--primary)), var(--card)); overflow: hidden; }
.crm-booking-race-card::after { content: ''; position: absolute; inset: auto -18px -28px auto; width: 94px; height: 94px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 11%, transparent); }
.crm-booking-race-card.is-place-1 { --race-progress: 77%; border-color: color-mix(in srgb, #d4a72c 48%, var(--border)); background: linear-gradient(145deg, color-mix(in srgb, #f5c84b 16%, var(--card)), var(--card)); }
.crm-booking-race-card.is-place-2 { --race-progress: 60%; border-color: color-mix(in srgb, #94a3b8 42%, var(--border)); }
.crm-booking-race-card.is-place-3 { --race-progress: 43%; border-color: color-mix(in srgb, #c47b4d 43%, var(--border)); }
.crm-booking-race-card.is-current-agent { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }
.crm-race-month-progress { display: grid; margin: 0 0 13px; padding: 11px 13px; gap: 7px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.crm-race-month-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.crm-race-month-progress strong { color: var(--foreground); font-size: 13px; font-weight: 800; }
.crm-race-month-progress span,
.crm-race-month-progress small { color: var(--muted-foreground); font-size: 11.5px; font-weight: 620; }
.crm-race-month-track { height: 7px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--muted) 72%, var(--card)); }
.crm-race-month-track > i { display: block; width: var(--crm-month-progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #22d3ee); box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 45%, transparent); transition: width 600ms ease; }
.crm-booking-race-place { position: absolute; top: 12px; right: 13px; color: var(--muted-foreground); font-size: 12px; font-weight: 800; }
.crm-race-track { position: relative; height: 58px; margin: 1px 0 10px; border-bottom: 3px dashed color-mix(in srgb, var(--primary) 28%, var(--border)); }
.crm-race-start { position: absolute; bottom: 5px; left: 0; color: var(--muted-foreground); font-size: 8px; font-weight: 850; letter-spacing: .06em; }
.crm-race-finish { position: absolute; right: 0; bottom: 1px; color: var(--success); font-size: 20px; }
.crm-race-runner { position: absolute; bottom: 6px; left: calc(var(--race-progress) - 10px); display: grid; width: 28px; height: 32px; place-items: center; color: var(--primary); font-size: 26px; filter: drop-shadow(0 5px 6px color-mix(in srgb, var(--primary) 22%, transparent)); animation: crm-race-run 760ms ease-in-out infinite alternate; }
.crm-booking-race-card.is-place-1 .crm-race-runner { color: #c68a00; animation-duration: 620ms; }
.crm-booking-race-card.is-place-2 .crm-race-runner { color: #64748b; animation-delay: -220ms; }
.crm-booking-race-card.is-place-3 .crm-race-runner { color: #a75625; animation-delay: -430ms; }
@keyframes crm-race-run { to { transform: translateY(-5px) rotate(-4deg); } }
.crm-booking-race-card strong { max-width: calc(100% - 28px); color: var(--foreground); font-size: 16px; line-height: 1.25; }
.crm-booking-race-card b { color: var(--primary); font-size: 26px; line-height: 1; }
.crm-booking-race-card small { color: var(--muted-foreground); font-size: 12px; font-weight: 650; }

.crm-journey-list { display: grid; gap: 10px; }
.crm-journey-card {
  display: grid;
  grid-template-columns: minmax(175px, .7fr) minmax(480px, 1.8fr) auto;
  min-width: 0;
  padding: 14px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--muted) 20%, var(--card));
}

.crm-journey-client strong,
.crm-journey-client small { display: block; }
.crm-journey-client strong { color: var(--foreground); font-size: 14px; }
.crm-journey-client small { margin-top: 4px; color: var(--muted-foreground); font-size: 12px !important; }
.crm-journey-track { display: grid; grid-template-columns: repeat(8, minmax(72px, 1fr)); gap: 5px; min-width: 480px; }
.crm-journey-step {
  min-height: 34px;
  padding: 8px 5px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 680;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-journey-step.is-current {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
  color: var(--primary);
}
.crm-journey-step.is-booked.is-current {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--card));
  color: var(--success);
}

@media (max-width: 1180px) {
  .crm-dashboard-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-dashboard-status-menu { grid-column: span 2; }
  .crm-dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-outcome-canvas-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-outcome-canvas-summary > span:nth-child(2) { border-right: 0; }
  .crm-outcome-canvas-summary > span:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 900px) {
  .crm-dashboard-layout { grid-template-columns: 1fr; }
  .crm-booking-race-podium { grid-template-columns: repeat(3, minmax(145px, 1fr)); overflow-x: auto; }
  .crm-dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-work-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-journey-card { grid-template-columns: 1fr auto; }
  .crm-journey-track { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
}

@media (max-width: 680px) {
  .crm-outcome-selector { max-height: min(360px, calc(100vh - 80px)); }
  .crm-dashboard-filter-grid { grid-template-columns: 1fr; }
  .crm-dashboard-status-menu { grid-column: auto; }
  .crm-dashboard-filter-actions { width: 100%; }
  .crm-dashboard-filter-actions > * { flex: 1 1 0; }
  .crm-dashboard-kpis { grid-template-columns: 1fr; }
  .crm-outcome-canvas-summary { grid-template-columns: 1fr; }
  .crm-outcome-canvas-summary > span,
  .crm-outcome-canvas-summary > span:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--border); }
  .crm-outcome-canvas-summary > span:last-child { border-bottom: 0; }
  .crm-work-metrics { grid-template-columns: 1fr; }
  .crm-dashboard-card { padding: 14px; }
  .crm-dashboard-card > header { flex-direction: column; }
  .crm-journey-total-link { width: 100%; justify-content: space-between; }
  .crm-dashboard-chart,
  .crm-dashboard-chart.is-tall { height: 340px; }
  .crm-outcome-volume-controls { align-items: stretch; flex-direction: column; }
  .crm-outcome-volume-controls .crm-dashboard-status-menu { max-width: none; }
  .crm-outcome-volume-controls .dropdown-toggle { min-width: 0; }
  .crm-selected-outcomes > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .crm-help-drawer-footer { align-items: flex-start; flex-direction: column; }
  .crm-help-drawer-footer small { max-width: none; text-align: left; }
  .crm-journey-card { grid-template-columns: 1fr; }
  .crm-journey-track { grid-column: auto; grid-row: auto; }
  .crm-race-month-progress > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-help-marker,
  .crm-help-drawer,
  .crm-kpi-card-position::after,
  .crm-race-runner { animation: none; }
}

/* 20260904r27 — left-rail account control, immersive creation workflows,
   scoped Agent reminders, and a clearer personal performance identity. */
.crm-personal-menu-rail {
  position: relative;
  z-index: 8;
  display: flex;
  width: 100%;
  min-height: 52px;
  margin-top: auto;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: #080b0f;
}

.crm-personal-menu-rail .crm-personal-trigger.crm-rail-account {
  display: inline-flex !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 9px 0 !important;
  padding: 1px !important;
  border: 1px solid rgba(103, 232, 249, .25) !important;
  border-radius: 999px !important;
  background: #111a21 !important;
  color: #cffafe !important;
  box-shadow: 0 0 0 3px rgba(103, 232, 249, .055) !important;
}

.crm-personal-menu-rail .crm-personal-trigger.crm-rail-account:hover,
.crm-personal-menu-rail .crm-personal-trigger.crm-rail-account[aria-expanded="true"] {
  border-color: rgba(103, 232, 249, .65) !important;
  background: #17232c !important;
  box-shadow: 0 0 18px rgba(34, 211, 238, .16) !important;
}

.crm-personal-menu-rail .crm-personal-avatar { width: 28px; height: 28px; flex-basis: 28px; }
.crm-personal-menu-rail .crm-personal-trigger-copy,
.crm-personal-menu-rail .crm-personal-chevron { display: none !important; }
.crm-personal-menu-rail .crm-personal-dropdown {
  position: absolute;
  z-index: 15;
  top: auto;
  right: auto;
  bottom: 9px;
  left: 56px;
  width: 220px;
  max-height: calc(100dvh - 82px);
  overflow: auto;
  border-color: rgba(255, 255, 255, .10);
  background: #0d1117;
  color: #f4f4f5;
  box-shadow: 18px 18px 44px rgba(0, 0, 0, .46);
}
.crm-personal-menu-rail .crm-personal-identity { padding: 14px; background: #101820; border-color: rgba(255, 255, 255, .08); }
.crm-personal-menu-rail .crm-personal-identity strong,
.crm-personal-menu-rail .crm-personal-links strong { color: #f4f4f5 !important; }
.crm-personal-menu-rail .crm-personal-identity small,
.crm-personal-menu-rail .crm-personal-links small { color: #a1a1aa !important; }
.crm-personal-menu-rail .crm-personal-roles span { border-color: rgba(255, 255, 255, .09); background: #111820; color: #a5f3fc; }
.crm-personal-menu-rail .crm-personal-links > a { color: #e4e4e7 !important; }
.crm-personal-menu-rail .crm-personal-links > a:hover,
.crm-personal-menu-rail .crm-personal-links > a:focus-visible { background: #151d25; }

.crm-nav-alert-badge.crm-reminder-nav-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #080b0f;
  border-radius: 999px;
  background: #22d3ee;
  color: #06212a;
  font-size: 9px;
  font-weight: 850;
  line-height: 14px;
  text-align: center;
}

body.crm-workflow-open { overflow: hidden !important; }
.crm-workflow-overlay {
  position: fixed;
  z-index: 1600;
  inset: 0;
  padding: 10px;
  background: rgba(3, 7, 12, .78);
  backdrop-filter: blur(12px);
}
.crm-workflow-overlay[hidden] { display: none !important; }
.crm-workflow-shell {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: 64px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 16px;
  background: var(--background);
  box-shadow: 0 38px 100px rgba(0, 0, 0, .52);
}
.crm-workflow-header {
  display: flex;
  padding: 0 16px 0 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: #080b0f;
  color: #f4f4f5;
}
.crm-workflow-header > div { display: grid; gap: 1px; }
.crm-workflow-kicker { color: #67e8f9; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.crm-workflow-header strong { color: #fff; font-size: 17px; font-weight: 760; }
.crm-workflow-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  background: #111820;
  color: #e4e4e7;
}
.crm-workflow-close:hover { border-color: rgba(103, 232, 249, .35); background: #17212a; color: #a5f3fc; }
.crm-workflow-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--background); }
.crm-workflow-frame[hidden] { display: none !important; }
.crm-workflow-confirm { position:absolute;inset:0;z-index:5;display:grid;place-items:center;background:rgba(5,12,20,.62);padding:20px; }
.crm-workflow-confirm[hidden] { display:none!important; }
.crm-workflow-confirm-card { width:min(460px,100%);padding:24px;border:1px solid #33505d;border-radius:16px;background:#0f1923;color:#f1f5f9;box-shadow:0 24px 70px #0008; }
.crm-workflow-confirm-card h2 { font-size:22px!important;margin:0 0 12px; }
.crm-workflow-confirm-card p { color:#cbd5e1;font-size:16px!important;line-height:1.5; }
.crm-workflow-confirm-actions { display:flex;gap:12px;flex-wrap:wrap;margin-top:18px; }
.crm-workflow-discard { border:1px solid #667889;border-radius:9px;background:#1c2c3a;color:#fff;padding:9px 14px;min-height:42px;font-size:15px; }
.crm-workflow-header .crm-workflow-header-actions { display:flex;align-items:center;gap:10px;flex-shrink:0; }
.crm-workflow-pipeline { border:1px solid #67e8f9;border-radius:10px;background:#102b34;color:#cffafe;padding:9px 14px;font:inherit;font-weight:700; }
.crm-workflow-pipeline:hover,.crm-workflow-pipeline:focus-visible { background:#164454;outline:2px solid #67e8f9;outline-offset:2px; }
@media(max-width:600px) {
  .crm-workflow-shell { grid-template-rows:auto minmax(0,1fr); }
  .crm-workflow-header { min-height:72px;gap:8px;flex-wrap:wrap;padding:10px !important; }
  .crm-workflow-header .crm-workflow-header-actions { margin-left:auto; }
  .crm-workflow-pipeline { padding:8px 10px;font-size:14px; }
}

body.crm-embedded-workflow { min-width: 0 !important; overflow-x: hidden !important; background: var(--background) !important; }
body.crm-embedded-workflow .sidebar,
body.crm-embedded-workflow .crm-topbar,
body.crm-embedded-workflow .crm-standalone-theme-toggle,
body.crm-embedded-workflow .crm-help-marker,
body.crm-embedded-workflow .crm-help-drawer,
body.crm-embedded-workflow .crm-help-backdrop { display: none !important; }
body.crm-embedded-workflow > .d-flex { display: block !important; min-height: 100%; }
body.crm-embedded-workflow #main-content,
body.crm-embedded-workflow .content-wrapper,
body.crm-embedded-workflow > .d-flex > .flex-grow-1 {
  width: 100% !important;
  max-width: none !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: clamp(14px, 2vw, 28px) !important;
}
body.crm-embedded-workflow .crm-lead-hero { margin-top: 0 !important; }

.crm-dashboard-kicker { align-items: center; gap: 7px; color: #a5f3fc !important; }
.crm-dashboard-kicker > i { font-size: 13px; }
.crm-dashboard-kicker-separator { color: rgba(226, 232, 240, .45); }

.crm-notification-action {
  display: inline-flex;
  margin-top: 7px;
  color: var(--primary) !important;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.crm-reminder-hero { min-height: 178px; }
.crm-reminder-timezone {
  display: inline-flex;
  min-height: 30px;
  padding: 5px 9px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 680;
  white-space: nowrap;
}
.crm-reminder-stats { display: grid; margin: 18px 0; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.crm-reminder-stat {
  display: flex;
  min-height: 78px;
  padding: 13px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card);
  color: var(--foreground) !important;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.crm-reminder-stat:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.crm-reminder-stat.is-active { border-color: color-mix(in srgb, var(--primary) 48%, var(--border)); background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.crm-reminder-stat > span { display: grid; gap: 5px; color: var(--muted-foreground); font-size: 12px; font-weight: 680; }
.crm-reminder-stat > span i { color: var(--primary); font-size: 16px; }
.crm-reminder-stat strong { color: var(--foreground); font-size: 25px; line-height: 1; }

.crm-reminder-workspace { display: grid; grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); gap: 18px; align-items: start; }
.crm-reminder-composer { position: sticky; top: calc(var(--header-height) + 16px); margin: 0 !important; }
.crm-reminder-list-panel { min-width: 0; margin: 0 !important; }
.crm-reminder-record-picker { position: relative; margin-bottom: 15px; }
.crm-reminder-searchbox { position: relative; }
.crm-reminder-searchbox > i { position: absolute; z-index: 2; top: 50%; left: 12px; color: var(--muted-foreground); transform: translateY(-50%); }
.crm-reminder-searchbox .form-control { padding-left: 38px !important; }
.crm-reminder-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% - 17px);
  right: 0;
  left: 0;
  max-height: 360px;
  padding: 7px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--popover);
  box-shadow: var(--shadow-lg);
}
.crm-reminder-search-result {
  display: grid;
  width: 100%;
  min-height: 78px;
  padding: 10px 11px;
  gap: 3px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--foreground);
  text-align: left;
}
.crm-reminder-search-result:hover,
.crm-reminder-search-result:focus-visible { background: var(--accent); }
.crm-reminder-search-result > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crm-reminder-search-result em { color: var(--primary); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.crm-reminder-search-result small,
.crm-reminder-search-result > span:last-child { color: var(--muted-foreground); font-size: 11.5px; }
.crm-reminder-search-result strong { font-size: 14px; }
.crm-reminder-search-empty { padding: 18px 12px; color: var(--muted-foreground); font-size: 12.5px; text-align: center; }
.crm-reminder-selected-record {
  position: relative;
  display: grid;
  margin-top: 8px;
  padding: 11px 38px 11px 12px;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--border));
  border-radius: 11px;
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
}
.crm-reminder-selected-record[hidden] { display: none !important; }
.crm-reminder-selected-record > span { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.crm-reminder-selected-record > strong { color: var(--foreground); font-size: 14px; }
.crm-reminder-selected-record > small { color: var(--muted-foreground); font-size: 11.5px !important; }
.crm-reminder-selected-record > button { position: absolute; top: 9px; right: 9px; display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted-foreground); }
.crm-reminder-selected-record > button:hover { background: var(--accent); color: var(--foreground); }
.crm-reminder-template-fieldset { margin: 0 0 14px; padding: 0; border: 0; }
.crm-reminder-template-fieldset legend { margin: 0 0 6px; color: var(--foreground); font-size: 13px; font-weight: 680; }
.crm-reminder-templates { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-reminder-templates button { min-height: 30px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted-foreground); font-size: 11px; font-weight: 680; }
.crm-reminder-templates button:hover { border-color: var(--primary); color: var(--primary); }
.crm-reminder-form-status { min-height: 20px; margin-top: 10px; color: var(--destructive); font-size: 12.5px; }
.crm-reminder-form-status.is-success { color: var(--success); }

.crm-reminder-filters { display: grid; margin-bottom: 12px; grid-template-columns: minmax(220px, 1fr) 150px 150px; gap: 10px; align-items: end; }
.crm-reminder-list-status { min-height: 20px; margin-bottom: 5px; color: var(--muted-foreground); font-size: 12px; }
.crm-reminder-list { display: grid; gap: 10px; transition: opacity 150ms ease; }
.crm-reminder-list[aria-busy="true"] { opacity: .58; pointer-events: none; }
.crm-reminder-item { overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--card); }
.crm-reminder-item.is-overdue { border-color: color-mix(in srgb, var(--destructive) 35%, var(--border)); }
.crm-reminder-item > header { display: flex; min-height: 42px; padding: 8px 12px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 35%, var(--card)); }
.crm-reminder-item > header time { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 11.5px; font-weight: 680; }
.crm-reminder-item-flags { display: flex; align-items: center; gap: 6px; }
.crm-reminder-priority { padding: 4px 7px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.crm-reminder-priority.is-high { background: color-mix(in srgb, #f59e0b 14%, var(--card)); color: #b76b00; }
.crm-reminder-priority.is-urgent { background: color-mix(in srgb, var(--destructive) 12%, var(--card)); color: var(--destructive); }
.crm-reminder-item-main { display: grid; padding: 14px; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.crm-reminder-item h3 { margin: 0 0 8px; color: var(--foreground); font-size: 16px; font-weight: 740; }
.crm-reminder-record { display: inline-flex; max-width: 100%; align-items: center; gap: 7px; color: var(--foreground) !important; text-decoration: none; }
.crm-reminder-record > span { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.crm-reminder-record > strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.crm-reminder-record > i { color: var(--muted-foreground); font-size: 11px; }
.crm-reminder-record-meta { display: flex; margin: 6px 0 0; flex-wrap: wrap; gap: 5px; }
.crm-reminder-record-meta > span { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted-foreground); font-size: 10.5px; }
.crm-reminder-notes { max-width: 680px; margin: 9px 0 0; color: var(--muted-foreground); font-size: 12.5px !important; line-height: 1.5 !important; }
.crm-reminder-actions { display: flex; max-width: 300px; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.crm-reminder-actions form { margin: 0; }
.crm-reminder-snooze { display: flex; align-items: center; gap: 5px; }
.crm-reminder-snooze select { width: 116px; min-height: 34px !important; font-size: 11px !important; }
.crm-reminder-cancelled-link { color: var(--muted-foreground); font-size: 12px; font-weight: 700; }
.crm-reminder-empty { display: grid; min-height: 280px; place-items: center; align-content: center; gap: 7px; color: var(--muted-foreground); text-align: center; }
.crm-reminder-empty > span { display: grid; width: 52px; height: 52px; margin-bottom: 5px; place-items: center; border-radius: 15px; background: var(--muted); color: var(--primary); font-size: 22px; }
.crm-reminder-empty strong { color: var(--foreground); font-size: 15px; }
.crm-reminder-empty p { max-width: 360px; margin: 0; font-size: 12.5px !important; }
.crm-reminder-pagination { display: flex; margin-top: 14px; justify-content: center; }

@media (max-width: 1180px) {
  .crm-reminder-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-reminder-workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .crm-reminder-item-main { grid-template-columns: 1fr; }
  .crm-reminder-actions { max-width: none; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .crm-reminder-workspace { grid-template-columns: 1fr; }
  .crm-reminder-composer { position: static; }
  .crm-reminder-filters { grid-template-columns: 1fr 1fr; }
  .crm-reminder-filters > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .crm-workflow-overlay { padding: 0; }
  .crm-workflow-shell { border: 0; border-radius: 0; }
  .crm-workflow-header { padding: 0 10px 0 14px; }
  .crm-reminder-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-reminder-stat { min-height: 68px; }
  .crm-reminder-filters { grid-template-columns: 1fr; }
  .crm-reminder-filters > div:first-child { grid-column: auto; }
  .crm-reminder-item > header { align-items: flex-start; flex-direction: column; }
  .crm-reminder-item-main { padding: 12px; }
  .crm-reminder-actions,
  .crm-reminder-snooze { width: 100%; }
  .crm-reminder-actions > form:not(.crm-reminder-snooze) { flex: 1 1 120px; }
  .crm-reminder-actions button { width: 100%; }
  .crm-reminder-snooze select { flex: 1 1 auto; width: auto; }
}

/* r29 — explicit dashboard reporting boundary and unified Quality workspace. */
.crm-reporting-scope {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 16px;
  gap: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
  border-radius: calc(var(--radius-xl) + 4px);
  background: color-mix(in srgb, var(--primary) 2.5%, var(--background));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 72%, transparent);
}
.crm-reporting-scope-head {
  display: grid;
  min-width: 0;
  padding: 12px 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 7%, var(--card));
}
.crm-reporting-scope-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--primary) 75%, transparent);
}
.crm-reporting-scope-head > div { min-width: 0; }
.crm-reporting-scope-head > div > span {
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 820;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.crm-reporting-scope-head h2 { margin: 2px 0 0; color: var(--foreground); font-size: 15px; font-weight: 760; letter-spacing: -.015em; }
.crm-reporting-scope-head p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 12px !important; line-height: 1.45 !important; }
.crm-reporting-scope-end {
  display: inline-flex;
  min-height: 30px;
  padding: 5px 9px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 720;
  white-space: nowrap;
}
.crm-quality-scope-note {
  display: inline-flex;
  min-height: 30px;
  padding: 5px 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 650;
}
.crm-quality-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.crm-quality-metrics .crm-metric { text-decoration: none; transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.crm-quality-metrics .crm-metric:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)) !important; transform: translateY(-2px); box-shadow: var(--shadow-md) !important; }
.crm-quality-metrics .crm-metric.is-success { border-color: color-mix(in srgb, var(--success) 30%, var(--border)) !important; }
.crm-quality-metrics .crm-metric.is-success .crm-metric-icon { background: color-mix(in srgb, var(--success) 15%, var(--card)); color: var(--success); }
.crm-quality-metrics .crm-metric.is-attention { border-color: color-mix(in srgb, var(--destructive) 22%, var(--border)) !important; }
.crm-quality-metrics .crm-metric.is-attention .crm-metric-icon { background: color-mix(in srgb, var(--destructive) 12%, var(--card)); color: var(--destructive); }
.crm-quality-journey { padding: 18px; }
.crm-quality-journey > header { margin-bottom: 14px; }
.crm-quality-journey .crm-journey-lane-progress .crm-pipeline-ribbon { grid-template-columns: repeat(6, minmax(112px, 1fr)); }
.crm-quality-journey .crm-journey-lane-exceptions .crm-pipeline-ribbon { grid-template-columns: repeat(3, minmax(132px, 1fr)); }

.crm-quality-filters {
  display: grid !important;
  padding: 16px !important;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, .65fr));
  align-items: end;
  gap: 12px;
}
.crm-quality-filters .form-group { min-width: 0; }
.crm-quality-filters label,
.crm-quality-advanced label { color: var(--foreground); font-size: 12px; font-weight: 680; }
.crm-quality-advanced { grid-column: 1 / -1; border-top: 1px solid var(--border); }
.crm-quality-advanced > summary {
  display: inline-flex;
  margin-top: 11px;
  padding: 5px 0;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}
.crm-quality-advanced > summary::-webkit-details-marker { display: none; }
.crm-quality-advanced > div { display: grid; padding-top: 9px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.crm-quality-advanced label { display: grid; gap: 5px; }
.crm-quality-filter-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.crm-quality-queue { min-width: 0; overflow: hidden; }
.crm-quality-queue .crm-feature-panel-head h2 { margin: 0; color: var(--foreground); font-size: 17px; font-weight: 740; }
.crm-quality-queue .crm-feature-panel-head p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 12.5px !important; }
.crm-quality-queue .crm-chip { flex: 0 0 auto; }
.crm-quality-queue table { min-width: 1480px; table-layout: auto; }
.crm-quality-queue th { white-space: nowrap; }
.crm-quality-queue td { min-width: 112px; vertical-align: top; }
.crm-quality-queue td:nth-child(2) { min-width: 210px; }
.crm-quality-queue td:nth-child(4) { min-width: 150px; }
.crm-quality-queue td:nth-child(8) { min-width: 190px; max-width: 280px; white-space: normal; }
.crm-quality-queue td:last-child { min-width: 260px; }
.crm-record-id { color: var(--primary) !important; text-decoration: none; }
.crm-quality-evidence { display: flex; min-height: 24px; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 11.5px; }
.crm-quality-evidence b { min-width: 34px; color: var(--foreground); font-size: 10px; letter-spacing: .04em; }
.crm-quality-row-actions { justify-content: flex-start; }
.crm-quality-row-actions .btn { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.crm-quality-next-actions { display: flex; margin-top: 8px; align-items: center; flex-wrap: wrap; gap: 4px; }
.crm-quality-next-actions > span { color: var(--muted-foreground); font-size: 10.5px; font-weight: 680; }
.crm-quality-next-actions > em { padding: 3px 6px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: var(--primary); font-size: 9.5px; font-style: normal; font-weight: 760; }
.crm-quality-pagination { display: flex; min-height: 62px; padding: 11px 16px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 42%, var(--card)); }
.crm-quality-pagination > span { color: var(--muted-foreground); font-size: 11.5px; font-weight: 650; }

.crm-quality-note-dialog {
  width: min(560px, calc(100vw - 30px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-lg);
}
.crm-quality-note-dialog::backdrop { background: rgba(2, 6, 12, .72); backdrop-filter: blur(5px); }
.crm-quality-note-dialog form { display: grid; }
.crm-quality-note-dialog header { display: flex; padding: 16px 18px; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.crm-quality-note-dialog header span { color: var(--primary); font-size: 10px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.crm-quality-note-dialog h2 { margin: 3px 0 0; color: var(--foreground); font-size: 19px; font-weight: 760; }
.crm-quality-note-dialog header p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 12px !important; }
.crm-quality-note-dialog header button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); }
.crm-quality-note-dialog form > div { display: grid; padding: 18px; }
.crm-quality-note-dialog form > div small { margin-top: 7px; color: var(--muted-foreground); font-size: 11px; }
.crm-quality-note-dialog footer { display: flex; padding: 12px 18px; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); background: var(--muted); }

@media (max-width: 1180px) {
  .crm-quality-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-quality-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .crm-reporting-scope { padding: 10px; }
  .crm-reporting-scope-head { grid-template-columns: auto minmax(0, 1fr); }
  .crm-reporting-scope-end { grid-column: 1 / -1; justify-self: start; white-space: normal; }
  .crm-quality-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-quality-journey { padding: 13px; }
  .crm-quality-journey .crm-journey-lane-progress .crm-pipeline-ribbon,
  .crm-quality-journey .crm-journey-lane-exceptions .crm-pipeline-ribbon { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .crm-quality-filters { grid-template-columns: 1fr; }
  .crm-quality-advanced > div { grid-template-columns: 1fr 1fr; }
  .crm-quality-filter-actions { justify-content: stretch; }
  .crm-quality-filter-actions .btn { flex: 1 1 130px; }
  .crm-quality-pagination { align-items: flex-start; flex-direction: column; }
  .crm-quality-pagination nav { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 480px) {
  .crm-quality-metrics,
  .crm-quality-advanced > div { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-reminder-stat,
  .crm-reminder-list,
  .crm-workflow-overlay { transition: none !important; backdrop-filter: none; }
}

/* r35: one color language for the journey, chart key, and outcome filter. */
.crm-pipeline-stage {
  --journey-color: #64748b;
  border-color: color-mix(in srgb, var(--journey-color) 24%, var(--border));
  box-shadow: inset 0 3px 0 var(--journey-color);
}
.crm-pipeline-stage[data-journey-stage="leads"] { --journey-color: var(--primary); }
.crm-pipeline-stage[data-journey-stage="pending"] { --journey-color: #64748b; }
.crm-pipeline-stage[data-journey-stage="loggedin"] { --journey-color: var(--chart-3); }
.crm-pipeline-stage[data-journey-stage="rework"] { --journey-color: var(--chart-4); }
.crm-pipeline-stage[data-journey-stage="approved"] { --journey-color: var(--chart-2); }
.crm-pipeline-stage[data-journey-stage="booked"] { --journey-color: var(--chart-1); }
.crm-pipeline-stage[data-journey-stage="s-reject"] { --journey-color: var(--chart-5); }
.crm-pipeline-stage[data-journey-stage="reject"] { --journey-color: var(--destructive); }
.crm-pipeline-stage[data-journey-stage="backout"] { --journey-color: #7c8799; }
.crm-pipeline-stage b,
.crm-pipeline-stage.is-booked b,
.crm-pipeline-stage.is-lead-pipeline b { color: var(--journey-color); }
.crm-pipeline-stage.is-booked { border-color: color-mix(in srgb, var(--journey-color) 34%, var(--border)); background: color-mix(in srgb, var(--journey-color) 8%, var(--card)); }
.crm-pipeline-stage::after { background: color-mix(in srgb, var(--journey-color) 28%, var(--border)); }
.crm-journey-lane-progress .crm-pipeline-stage[data-journey-stage="booked"] { box-shadow: inset 0 3px 0 var(--journey-color), 0 8px 24px color-mix(in srgb, var(--journey-color) 11%, transparent); }
.crm-outcome-filter {
  display: grid;
  margin: 18px -18px -18px;
  padding: 18px;
  gap: 16px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: color-mix(in srgb, var(--muted) 34%, var(--card));
}
.crm-outcome-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.crm-outcome-filter-head > div { min-width: 0; }
.crm-outcome-filter-head span { display: block; margin-bottom: 3px; color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
.crm-outcome-filter-head h3 { margin: 0; color: var(--foreground); font-size: 17px; font-weight: 790; }
.crm-outcome-filter-head p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 12px; }
.crm-outcome-filter-head > strong { flex: 0 0 auto; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: var(--primary); font-size: 11.5px; }
.crm-outcome-filter-groups { display: grid; grid-template-columns: minmax(0, 5fr) minmax(270px, 3fr); gap: 12px; }
.crm-outcome-filter-groups > section { min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); }
.crm-outcome-filter-group-head { display: flex; min-height: 29px; margin-bottom: 8px; align-items: center; justify-content: space-between; gap: 10px; }
.crm-outcome-filter-group-head h4 { margin: 0; color: var(--muted-foreground); font-size: 10.5px; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.crm-outcome-filter-all { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 10.5px; font-weight: 720; cursor: pointer; }
.crm-outcome-filter-all .form-check-input { width: 15px; height: 15px; margin: 0; }
.crm-outcome-filter-all > strong { min-width: 24px; color: var(--foreground); text-align: right; }
.crm-outcome-filter-ribbon { display: grid; grid-template-columns: repeat(5, minmax(92px, 1fr)); gap: 7px; }
.crm-outcome-filter-ribbon.is-exceptions { grid-template-columns: repeat(3, minmax(92px, 1fr)); }
.crm-outcome-filter-chip {
  --outcome-color: var(--muted-foreground);
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 58px;
  padding: 9px 9px 8px;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.crm-outcome-filter-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.crm-outcome-filter-chip > i { width: 8px; height: 8px; border-radius: 999px; background: var(--outcome-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--outcome-color) 13%, transparent); }
.crm-outcome-filter-chip > span { overflow-wrap: anywhere; font-size: 11px; font-weight: 720; line-height: 1.18; }
.crm-outcome-filter-chip > strong { color: var(--foreground); font-size: 14px; font-variant-numeric: tabular-nums; }
.crm-outcome-filter-chip:hover { border-color: color-mix(in srgb, var(--outcome-color) 45%, var(--border)); transform: translateY(-1px); }
.crm-outcome-filter-chip:has(input:checked) { border-color: color-mix(in srgb, var(--outcome-color) 56%, var(--border)); background: color-mix(in srgb, var(--outcome-color) 10%, var(--card)); color: var(--foreground); box-shadow: inset 0 3px 0 var(--outcome-color); }
.crm-outcome-filter-chip:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--outcome-color) 25%, transparent); outline-offset: 2px; }
.crm-outcome-filter-chip[data-outcome="pending"] { --outcome-color: #64748b; }
.crm-outcome-filter-chip[data-outcome="loggedin"] { --outcome-color: var(--chart-3); }
.crm-outcome-filter-chip[data-outcome="rework"] { --outcome-color: var(--chart-4); }
.crm-outcome-filter-chip[data-outcome="approved"] { --outcome-color: var(--chart-2); }
.crm-outcome-filter-chip[data-outcome="booked"] { --outcome-color: var(--chart-1); }
.crm-outcome-filter-chip[data-outcome="s-reject"] { --outcome-color: var(--chart-5); }
.crm-outcome-filter-chip[data-outcome="reject"] { --outcome-color: var(--destructive); }
.crm-outcome-filter-chip[data-outcome="backout"] { --outcome-color: #7c8799; }
.crm-outcome-filter > .btn { justify-self: end; min-width: 156px; }

/* r35: the composer is intentionally a dark action surface beside the queue. */
.crm-reminder-composer {
  overflow: hidden;
  border-color: rgba(83, 181, 255, .26) !important;
  background: linear-gradient(155deg, #06172b 0%, #0a2840 58%, #07304b 100%) !important;
  box-shadow: 0 20px 44px rgba(3, 16, 31, .24) !important;
  color: #f7fbff;
}
.crm-reminder-composer .crm-feature-panel-head { border-bottom-color: rgba(255,255,255,.12); background: rgba(255,255,255,.035); }
.crm-reminder-composer .crm-feature-panel-head h3,
.crm-reminder-composer .form-label,
.crm-reminder-composer .crm-reminder-template-fieldset legend { color: #f8fbff !important; }
.crm-reminder-composer .crm-feature-panel-head p,
.crm-reminder-composer .form-text { color: #b9c9da !important; }
.crm-reminder-composer .crm-reminder-timezone { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #d8e9f6; }
.crm-reminder-composer .crm-reminder-timezone i { color: #54d6ef; }
.crm-reminder-composer .form-control,
.crm-reminder-composer .form-select,
.crm-reminder-composer textarea { border-color: rgba(255,255,255,.18) !important; background: #f8fbfd !important; color: #102033 !important; color-scheme: light; }
.crm-reminder-composer .form-control::placeholder,
.crm-reminder-composer textarea::placeholder { color: #68778a; }
.crm-reminder-composer .crm-reminder-templates button { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.075); color: #d5e3ef; }
.crm-reminder-composer .crm-reminder-templates button:hover { border-color: #54d6ef; background: rgba(84,214,239,.13); color: #ffffff; }
.crm-reminder-composer .crm-reminder-selected-record { border-color: rgba(84,214,239,.28); background: rgba(84,214,239,.09); }
.crm-reminder-composer .crm-reminder-selected-record > strong { color: #ffffff; }
.crm-reminder-composer .crm-reminder-selected-record > small { color: #bed1df !important; }

@media (max-width: 980px) {
  .crm-outcome-filter-groups { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .crm-outcome-filter { margin: 14px -14px -14px; padding: 14px; }
  .crm-outcome-filter-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .crm-outcome-filter-ribbon,
  .crm-outcome-filter-ribbon.is-exceptions { display: flex; padding: 2px 1px 8px; overflow-x: auto; }
  .crm-outcome-filter-chip { min-width: 126px; }
  .crm-outcome-filter > .btn { width: 100%; justify-self: stretch; }
}

/* r35: device-local image preparation before any CRM upload request. */
body.crm-document-assistant-open { overflow: hidden !important; }
.crm-document-assistant { position: fixed; z-index: 5000; inset: 0; display: grid; padding: 24px; place-items: center; background: rgba(3, 13, 25, .72); backdrop-filter: blur(8px); }
.crm-document-assistant[hidden] { display: none !important; }
.crm-document-assistant-dialog { display: grid; width: min(680px, 100%); max-height: min(780px, calc(100vh - 48px)); overflow: hidden; grid-template-rows: auto minmax(0, 1fr) auto; border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)); border-radius: 20px; background: var(--card); box-shadow: 0 28px 80px rgba(2, 12, 27, .38); }
.crm-document-assistant-dialog > header { display: flex; padding: 20px 22px 17px; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--card)), var(--card)); }
.crm-document-assistant-kicker { display: block; margin-bottom: 4px; color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
.crm-document-assistant-dialog h2 { margin: 0; color: var(--foreground); font-size: 22px; font-weight: 810; }
.crm-document-assistant-dialog header p { margin: 5px 0 0; color: var(--muted-foreground); font-size: 12.5px; }
.crm-document-assistant-dialog header > button { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); }
.crm-document-assistant-dialog header > button:hover { color: var(--foreground); }
.crm-document-assistant-body { min-height: 0; padding: 18px 22px; overflow: auto; }
.crm-document-assistant-rule { display: flex; margin-bottom: 14px; padding: 12px; align-items: center; gap: 11px; border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.crm-document-assistant-rule > i { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--primary); color: var(--primary-foreground); font-size: 17px; }
.crm-document-assistant-rule div { display: grid; min-width: 0; gap: 2px; }
.crm-document-assistant-rule strong { color: var(--foreground); font-size: 13px; }
.crm-document-assistant-rule small { color: var(--muted-foreground); font-size: 11.5px; }
.crm-document-assistant-list { display: grid; gap: 8px; }
.crm-document-assistant-item { display: grid; min-width: 0; padding: 11px; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.crm-document-assistant-item > i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--muted); color: var(--muted-foreground); }
.crm-document-assistant-item.is-convert > i { background: color-mix(in srgb, var(--primary) 11%, var(--card)); color: var(--primary); }
.crm-document-assistant-item.is-ready > i { background: color-mix(in srgb, var(--success) 11%, var(--card)); color: var(--success); }
.crm-document-assistant-item.is-blocked { border-color: color-mix(in srgb, var(--destructive) 35%, var(--border)); }
.crm-document-assistant-item.is-blocked > i { background: color-mix(in srgb, var(--destructive) 10%, var(--card)); color: var(--destructive); }
.crm-document-assistant-item > div { display: grid; min-width: 0; gap: 2px; }
.crm-document-assistant-item strong { overflow: hidden; color: var(--foreground); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.crm-document-assistant-item small { color: var(--muted-foreground); font-size: 11px; }
.crm-document-assistant-item span { color: var(--muted-foreground); font-size: 10.5px; }
.crm-document-assistant-item > button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted-foreground); }
.crm-document-assistant-item > button:hover { background: color-mix(in srgb, var(--destructive) 9%, var(--card)); color: var(--destructive); }
.crm-document-assistant-status { min-height: 18px; margin: 12px 0 0; color: var(--muted-foreground); font-size: 11.5px; }
.crm-document-assistant-status.is-error { color: var(--destructive); }
.crm-document-assistant-dialog > footer { display: flex; padding: 14px 22px; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); background: var(--muted); }
.crm-document-ready { display: flex; margin-top: 7px; padding: 8px 9px; align-items: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--success) 25%, var(--border)); border-radius: 9px; background: color-mix(in srgb, var(--success) 7%, var(--card)); color: var(--success); }
.crm-document-ready > span { display: grid; gap: 1px; }
.crm-document-ready strong { font-size: 11.5px; }
.crm-document-ready small { color: var(--muted-foreground); font-size: 10.5px; }

@media (max-width: 680px) {
  .crm-document-assistant { padding: 10px; }
  .crm-document-assistant-dialog { max-height: calc(100vh - 20px); border-radius: 16px; }
  .crm-document-assistant-dialog > header,
  .crm-document-assistant-body,
  .crm-document-assistant-dialog > footer { padding-left: 14px; padding-right: 14px; }
  .crm-document-assistant-dialog > footer { flex-direction: column-reverse; }
  .crm-document-assistant-dialog > footer .btn { width: 100%; }
}

/* r36: focused Administrator team workspace and recoverable ownership flow. */
.crm-team-hero,
.crm-chat-hero {
  background:
    radial-gradient(circle at 92% 12%, color-mix(in srgb, #22d3ee 22%, transparent) 0, transparent 34%),
    linear-gradient(135deg, #06172b 0%, #0a2840 56%, #07304b 100%) !important;
  color: #f8fbff !important;
}
.crm-team-hero h1,
.crm-team-hero p,
.crm-chat-hero h1,
.crm-chat-hero p { color: inherit !important; }
.crm-team-hero p,
.crm-chat-hero p { color: #c7d8e6 !important; }
.crm-team-hero .crm-feature-kicker,
.crm-chat-hero .crm-feature-kicker { color: #67e8f9 !important; }
.crm-team-hero .btn-outline-primary,
.crm-chat-hero .btn-outline-primary { border-color: rgba(255,255,255,.28) !important; background: rgba(255,255,255,.07) !important; color: #fff !important; }
.crm-team-hero .btn-outline-primary:hover,
.crm-chat-hero .btn-outline-primary:hover { border-color: #67e8f9 !important; background: rgba(103,232,249,.12) !important; }
.crm-team-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.crm-team-metrics .crm-metric { min-height: 138px; }
.crm-transfer-selector { display: grid; grid-template-columns: minmax(210px, 1fr) 38px minmax(210px, 1fr) auto; align-items: end; gap: 14px; }
.crm-transfer-selector .form-group { min-width: 0; }
.crm-transfer-selector label,
.crm-monitor-filters label { display: block; margin-bottom: 6px; color: var(--foreground); font-size: 12px; font-weight: 760; }
.crm-transfer-selector small { display: block; margin-top: 5px; color: var(--muted-foreground); font-size: 11px; }
.crm-transfer-arrow { display: grid; width: 38px; height: 38px; margin-bottom: 22px; place-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--muted); color: var(--primary); }
.crm-transfer-preview { display: grid; margin-top: 18px; padding: 18px; gap: 16px; border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border)); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.crm-transfer-route { display: grid; grid-template-columns: 1fr 42px 1fr; align-items: center; gap: 12px; }
.crm-transfer-route > div { display: grid; min-width: 0; padding: 13px; gap: 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.crm-transfer-route > div small { color: var(--primary); font-size: 10px; font-weight: 830; letter-spacing: .07em; text-transform: uppercase; }
.crm-transfer-route > div strong { overflow: hidden; color: var(--foreground); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.crm-transfer-route > div span { overflow: hidden; color: var(--muted-foreground); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.crm-transfer-route > i { color: var(--primary); font-size: 18px; text-align: center; }
.crm-transfer-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.crm-transfer-counts article { display: grid; padding: 12px; gap: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.crm-transfer-counts span { color: var(--muted-foreground); font-size: 10.5px; font-weight: 690; }
.crm-transfer-counts strong { color: var(--foreground); font-size: 22px; font-variant-numeric: tabular-nums; }
.crm-transfer-preserved { margin: 0; color: var(--muted-foreground); font-size: 12px; }
.crm-transfer-preserved i { margin-right: 6px; color: var(--primary); }
.crm-transfer-confirm { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 14px; padding-top: 15px; border-top: 1px solid var(--border); }
.crm-transfer-confirm label { display: block; margin-bottom: 6px; color: var(--foreground); font-size: 12px; }
.crm-transfer-confirm small { display: block; margin-top: 5px; color: var(--muted-foreground); font-size: 11px; }
.crm-transfer-panel[data-transfer-blocked="true"] { opacity: .68; }
.crm-transfer-recovery { border-color: color-mix(in srgb, var(--destructive) 36%, var(--border)) !important; }
.crm-recovery-row { display: flex; padding: 14px 0; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.crm-recovery-row:first-child { padding-top: 0; }
.crm-recovery-row:last-child { padding-bottom: 0; border-bottom: 0; }
.crm-recovery-row > div { display: grid; min-width: 0; gap: 3px; }
.crm-recovery-row strong { color: var(--foreground); font-size: 13px; }
.crm-recovery-row span,
.crm-recovery-row small { color: var(--muted-foreground); font-size: 11px; overflow-wrap: anywhere; }
.crm-team-empty { display: grid; min-height: 170px; padding: 28px; place-items: center; align-content: center; gap: 5px; color: var(--muted-foreground); text-align: center; }
.crm-team-empty > i { display: grid; width: 44px; height: 44px; margin-bottom: 5px; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--primary) 9%, var(--card)); color: var(--primary); font-size: 19px; }
.crm-team-empty strong { color: var(--foreground); font-size: 14px; }
.crm-team-empty span { font-size: 12px; }
.crm-team-pagination { display: flex; padding: 14px 18px; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 45%, var(--card)); }
.crm-team-pagination small { color: var(--muted-foreground); font-size: 11.5px; }
.crm-team-pagination nav { max-width: 100%; overflow-x: auto; }
.crm-table-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.crm-live-panel { border-color: color-mix(in srgb, var(--primary) 24%, var(--border)) !important; }
.crm-live-controls { display: flex; align-items: center; gap: 10px; }
.crm-live-status { color: var(--muted-foreground); font-size: 11.5px; font-weight: 700; }
.crm-live-status[data-tone="live"] { color: var(--success); }
.crm-live-status[data-tone="error"] { color: var(--destructive); }
.crm-live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 12%, transparent); animation: crm-live-pulse 1.8s ease-in-out infinite; }
@keyframes crm-live-pulse { 50% { opacity: .42; transform: scale(.84); } }
.crm-live-feed { display: grid; gap: 0; }
.crm-live-event { display: grid; padding: 12px 0; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); }
.crm-live-event:first-child { padding-top: 0; }
.crm-live-event:last-child { padding-bottom: 0; border-bottom: 0; }
.crm-live-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--primary) 11%, var(--card)); color: var(--primary); font-size: 13px; font-weight: 820; }
.crm-live-event-copy { display: grid; min-width: 0; gap: 2px; }
.crm-live-event-copy > div { display: flex; align-items: center; gap: 7px; }
.crm-live-event-copy strong { overflow: hidden; color: var(--foreground); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.crm-live-event-copy p { margin: 0; color: var(--foreground); font-size: 12px; }
.crm-live-event-copy small { color: var(--muted-foreground); font-size: 10.5px; }
.crm-live-event > time { color: var(--muted-foreground); font-size: 10.5px; white-space: nowrap; }
.crm-monitor-filters { display: grid; grid-template-columns: minmax(190px, 1.5fr) repeat(3, minmax(150px, 1fr)) repeat(2, minmax(130px, .8fr)) 80px auto auto; align-items: end; gap: 10px; }
.crm-monitor-filters .form-group { min-width: 0; }
.crm-activity-table { min-width: 870px; }
.crm-activity-table td { font-size: 12px; vertical-align: middle; }
.crm-activity-table td small { color: var(--muted-foreground); font-size: 10.5px; }

/* r36: role-scoped company collaboration application. */
.crm-chat-app { position: relative; display: grid; height: min(760px, calc(100vh - 250px)); min-height: 610px; margin-bottom: 24px; grid-template-columns: 260px minmax(420px, 1fr) 250px; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-md); }
.crm-chat-channels,
.crm-chat-people { display: grid; min-width: 0; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; background: color-mix(in srgb, var(--muted) 45%, var(--card)); }
.crm-chat-channels { border-right: 1px solid var(--border); }
.crm-chat-people { grid-template-rows: auto minmax(0, 1fr) auto; border-left: 1px solid var(--border); }
.crm-chat-channels > header,
.crm-chat-people > header { display: flex; min-height: 72px; padding: 16px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.crm-chat-channels > header h2,
.crm-chat-people > header h2 { margin: 1px 0 0; color: var(--foreground); font-size: 17px; font-weight: 800; }
.crm-chat-channels > header button,
.crm-chat-people > header button,
.crm-chat-head-actions button,
.crm-chat-mobile-channels { display: grid; width: 34px; height: 34px; flex: 0 0 auto; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); }
.crm-chat-channels > header button:hover,
.crm-chat-people > header button:hover,
.crm-chat-head-actions button:hover,
.crm-chat-mobile-channels:hover { border-color: color-mix(in srgb, var(--primary) 38%, var(--border)); color: var(--primary); }
.crm-chat-filter { display: flex; margin: 12px; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); }
.crm-chat-filter:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 14%, transparent); }
.crm-chat-filter > i { margin-left: 11px; }
.crm-chat-filter input { width: 100%; min-width: 0; height: 38px; padding: 0 11px 0 0; border: 0; outline: 0; background: transparent; color: var(--foreground); font-size: 12px; }
.crm-chat-channels > nav { min-height: 0; padding: 0 8px 12px; overflow-y: auto; }
.crm-chat-channel { display: grid; width: 100%; min-width: 0; padding: 9px; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 0; border-radius: 11px; background: transparent; color: var(--foreground); text-align: left; }
.crm-chat-channel:hover { background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.crm-chat-channel.is-active { background: color-mix(in srgb, var(--primary) 11%, var(--card)); color: var(--primary); }
.crm-chat-channel > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.crm-chat-channel strong,
.crm-chat-channel small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-channel strong { font-size: 12.5px; font-weight: 760; }
.crm-chat-channel small { color: var(--muted-foreground); font-size: 10.5px; }
.crm-chat-channel > b { display: grid; min-width: 21px; height: 21px; padding: 0 5px; place-items: center; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-size: 9.5px; }
.crm-chat-channel-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--primary) 9%, var(--card)); color: var(--primary); }
.crm-chat-channels > footer { display: grid; padding: 13px 15px; gap: 3px; border-top: 1px solid var(--border); }
.crm-chat-channels > footer span { color: var(--foreground); font-size: 10.5px; font-weight: 720; }
.crm-chat-channels > footer span i { margin-right: 5px; color: var(--success); }
.crm-chat-channels > footer small { color: var(--muted-foreground); font-size: 9.5px; }
.crm-chat-conversation { display: grid; min-width: 0; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--card); }
.crm-chat-conversation > * { min-width: 0; max-width: 100%; }
.crm-chat-conversation-head { display: flex; min-height: 72px; padding: 12px 16px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.crm-chat-channel-heading { display: flex; min-width: 0; align-items: center; gap: 10px; }
.crm-chat-channel-heading > div { min-width: 0; }
.crm-chat-channel-heading h2 { margin: 0; overflow: hidden; color: var(--foreground); font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-channel-heading p { margin: 2px 0 0; overflow: hidden; color: var(--muted-foreground); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-head-actions { display: flex; align-items: center; gap: 7px; }
.crm-chat-sync { display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 10.5px; font-weight: 720; }
.crm-chat-sync[data-tone="error"] { color: var(--destructive); }
.crm-chat-sync[data-tone="working"] i { animation: crm-chat-spin .8s linear infinite; }
@keyframes crm-chat-spin { to { transform: rotate(360deg); } }
.crm-chat-mobile-channels { display: none; }
.crm-chat-message-list { min-height: 0; padding: 20px 18px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; background: linear-gradient(180deg, color-mix(in srgb, var(--muted) 22%, var(--card)), var(--card) 20%); }
.crm-chat-empty { display: grid; min-height: 100%; place-items: center; align-content: center; gap: 7px; color: var(--muted-foreground); text-align: center; }
.crm-chat-empty i { display: grid; width: 54px; height: 54px; margin-bottom: 4px; place-items: center; border-radius: 17px; background: color-mix(in srgb, var(--primary) 9%, var(--card)); color: var(--primary); font-size: 23px; }
.crm-chat-empty strong { color: var(--foreground); font-size: 15px; }
.crm-chat-empty span { max-width: 340px; font-size: 11.5px; }
.crm-chat-message { position: relative; display: grid; max-width: min(78%, 680px); margin: 0 0 14px; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 9px; transition: background-color .2s ease; }
.crm-chat-message.is-own { margin-left: auto; grid-template-columns: minmax(0, 1fr) 36px; }
.crm-chat-message.is-own > .crm-chat-avatar { grid-column: 2; grid-row: 1; }
.crm-chat-message.is-own > .crm-chat-bubble { grid-column: 1; grid-row: 1; }
.crm-chat-message.is-highlighted { border-radius: 16px; background: color-mix(in srgb, var(--warning) 13%, transparent); }
.crm-chat-avatar { position: relative; display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--primary); font-size: 12px; font-weight: 830; }
.crm-chat-avatar.is-online::after { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; content: ""; border: 2px solid var(--card); border-radius: 999px; background: var(--success); }
.crm-chat-bubble { position: relative; min-width: 0; padding: 10px 12px 9px; border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; background: var(--card); box-shadow: var(--shadow-xs); }
.crm-chat-message.is-own .crm-chat-bubble { border-color: color-mix(in srgb, var(--primary) 24%, var(--border)); border-radius: 14px 4px 14px 14px; background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.crm-chat-bubble > header { display: flex; margin-bottom: 5px; align-items: center; gap: 6px; }
.crm-chat-bubble > header strong { color: var(--foreground); font-size: 11.5px; }
.crm-chat-bubble > header span { color: var(--primary); font-size: 9px; font-weight: 730; }
.crm-chat-bubble > header time,
.crm-chat-bubble > header small { margin-left: auto; color: var(--muted-foreground); font-size: 9px; }
.crm-chat-bubble > header small { margin-left: 0; }
.crm-chat-body { margin: 0; color: var(--foreground); font-size: 13px; line-height: 1.52; overflow-wrap: anywhere; }
.crm-chat-deleted-copy { margin: 0; color: var(--muted-foreground); font-size: 11.5px; font-style: italic; }
.crm-chat-reply-quote { display: grid; width: 100%; margin: 0 0 7px; padding: 7px 9px; gap: 1px; border: 0; border-left: 3px solid var(--primary); border-radius: 6px; background: color-mix(in srgb, var(--muted) 65%, var(--card)); text-align: left; }
.crm-chat-reply-quote strong { color: var(--primary); font-size: 9.5px; }
.crm-chat-reply-quote span { overflow: hidden; color: var(--muted-foreground); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-tags { display: flex; margin-top: 7px; flex-wrap: wrap; gap: 5px; }
.crm-chat-tag { display: inline-flex; max-width: 100%; min-height: 25px; padding: 3px 7px; align-items: center; gap: 4px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--primary) 7%, var(--card)); color: var(--primary); font-size: 9.5px; font-weight: 700; text-decoration: none; }
.crm-chat-tag.is-record { color: var(--primary); }
.crm-chat-tag.is-restricted { border-color: var(--border); background: var(--muted); color: var(--muted-foreground); }
.crm-chat-files { display: grid; margin-top: 8px; gap: 6px; }
.crm-chat-image { display: block; max-width: 320px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--muted); }
.crm-chat-image img { display: block; width: 100%; max-height: 230px; object-fit: cover; }
.crm-chat-file { display: flex; max-width: 350px; padding: 8px; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; background: color-mix(in srgb, var(--muted) 55%, var(--card)); color: var(--foreground); text-decoration: none; }
.crm-chat-file > i { color: var(--primary); font-size: 18px; }
.crm-chat-file > span { display: grid; min-width: 0; }
.crm-chat-file strong { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-file small { color: var(--muted-foreground); font-size: 9px; }
.crm-chat-reactions { display: flex; margin-top: 6px; flex-wrap: wrap; gap: 4px; }
.crm-chat-reactions:empty { display: none; }
.crm-chat-reactions button { min-height: 25px; padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 11px; }
.crm-chat-reactions button.is-active { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: color-mix(in srgb, var(--primary) 9%, var(--card)); }
.crm-chat-bubble > footer { position: relative; display: flex; min-height: 22px; margin: 5px -4px -3px; align-items: center; gap: 2px; opacity: 0; transition: opacity .14s ease; }
.crm-chat-message:hover .crm-chat-bubble > footer,
.crm-chat-message:focus-within .crm-chat-bubble > footer { opacity: 1; }
.crm-chat-bubble > footer > button { padding: 3px 5px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-foreground); font-size: 9.5px; }
.crm-chat-bubble > footer > button:hover { background: var(--muted); color: var(--foreground); }
.crm-chat-reaction-palette { position: absolute; z-index: 10; right: 0; bottom: 25px; display: flex; padding: 5px; gap: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--popover); box-shadow: var(--shadow-md); }
.crm-chat-reaction-palette button { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 0; border-radius: 7px; background: transparent; font-size: 15px; }
.crm-chat-reaction-palette button:hover { background: var(--muted); }
.crm-chat-typing { min-height: 18px; padding: 0 18px; color: var(--muted-foreground); font-size: 9.5px; }
.crm-chat-composer { display: grid; padding: 10px 14px 12px; gap: 7px; border-top: 1px solid var(--border); background: var(--card); }
.crm-chat-compose-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 40px; align-items: end; gap: 8px; }
.crm-chat-compose-tools { display: flex; align-items: center; gap: 3px; }
.crm-chat-compose-tools button,
.crm-chat-compose-tools label { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.crm-chat-compose-tools button:hover,
.crm-chat-compose-tools label:hover { background: var(--muted); color: var(--primary); }
.crm-chat-compose-tools input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.crm-chat-textarea { display: grid; min-width: 0; padding: 5px 10px; border: 1px solid var(--border); border-radius: 11px; background: color-mix(in srgb, var(--muted) 35%, var(--card)); }
.crm-chat-textarea:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 12%, transparent); }
.crm-chat-textarea textarea { width: 100%; min-height: 30px; max-height: 160px; padding: 5px 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--foreground); font: inherit; font-size: 12.5px; line-height: 1.45; }
.crm-chat-send { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 0; border-radius: 11px; background: var(--primary); color: var(--primary-foreground); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 26%, transparent); }
.crm-chat-send:disabled { opacity: .55; }
.crm-chat-compose-help { margin-left: 2px; color: var(--muted-foreground); font-size: 9px; }
.crm-chat-replying { display: flex; padding: 7px 9px; align-items: center; justify-content: space-between; gap: 9px; border-left: 3px solid var(--primary); border-radius: 8px; background: var(--muted); color: var(--muted-foreground); font-size: 10px; }
.crm-chat-replying > div { display: flex; align-items: center; gap: 6px; }
.crm-chat-replying button { border: 0; background: transparent; color: inherit; }
.crm-chat-selected-tags,
.crm-chat-file-preview { display: flex; flex-wrap: wrap; gap: 5px; }
.crm-chat-replying[hidden],
.crm-chat-selected-tags[hidden],
.crm-chat-file-preview[hidden],
.crm-chat-dialog [hidden] { display: none !important; }
.crm-chat-selected-tags .crm-chat-tag { cursor: pointer; }
.crm-chat-file-preview > span { display: flex; padding: 4px 7px; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 8px; color: var(--foreground); font-size: 9.5px; }
.crm-chat-file-preview > span strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-file-preview > span small { color: var(--muted-foreground); }
.crm-chat-people-list { min-height: 0; padding: 8px; overflow-y: auto; }
.crm-chat-people-list article { display: grid; padding: 8px; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; }
.crm-chat-people-list article > div { display: grid; min-width: 0; gap: 2px; }
.crm-chat-people-list strong,
.crm-chat-people-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-people-list strong { color: var(--foreground); font-size: 11.5px; }
.crm-chat-people-list small { color: var(--muted-foreground); font-size: 9.5px; }
.crm-chat-safety { display: flex; margin: 10px; padding: 11px; align-items: flex-start; gap: 9px; border: 1px solid color-mix(in srgb, var(--success) 24%, var(--border)); border-radius: 11px; background: color-mix(in srgb, var(--success) 6%, var(--card)); }
.crm-chat-safety > i { color: var(--success); }
.crm-chat-safety strong { display: block; color: var(--foreground); font-size: 10px; }
.crm-chat-safety p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 9px; line-height: 1.4; }
.crm-chat-dialog { width: min(620px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--card); color: var(--foreground); box-shadow: 0 28px 80px rgba(2,12,27,.42); }
.crm-chat-dialog::backdrop { background: rgba(3,13,25,.68); backdrop-filter: blur(7px); }
.crm-chat-small-dialog { width: min(520px, calc(100vw - 28px)); }
.crm-chat-dialog-card { display: grid; max-height: min(760px, calc(100vh - 28px)); grid-template-rows: auto minmax(0, 1fr) auto; }
.crm-chat-dialog-card > header { display: flex; padding: 18px 20px; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--card)), var(--card)); }
.crm-chat-dialog-card > header h2 { margin: 1px 0 0; color: var(--foreground); font-size: 20px; font-weight: 820; }
.crm-chat-dialog-card > header p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 11.5px; }
.crm-chat-dialog-card > header button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); }
.crm-chat-dialog-body { min-height: 0; padding: 16px 20px; overflow-y: auto; }
.crm-chat-dialog-body > .crm-chat-filter { margin: 12px 0; }
.crm-chat-dialog-card > footer { display: flex; padding: 13px 20px; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); background: var(--muted); }
.crm-chat-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crm-chat-type-switch label { position: relative; }
.crm-chat-type-switch input { position: absolute; opacity: 0; }
.crm-chat-type-switch span { display: flex; min-height: 42px; padding: 8px 12px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted-foreground); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.crm-chat-type-switch input:checked + span { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: var(--primary); }
.crm-chat-dialog .form-group { margin-top: 12px; }
.crm-chat-dialog .form-group label { margin-bottom: 5px; color: var(--foreground); font-size: 11px; font-weight: 720; }
.crm-chat-picker { display: grid; gap: 5px; }
.crm-chat-picker > label,
.crm-chat-picker > button { display: grid; width: 100%; min-width: 0; padding: 8px; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--foreground); text-align: left; cursor: pointer; }
.crm-chat-picker > label:hover,
.crm-chat-picker > button:hover { border-color: var(--border); background: var(--muted); }
.crm-chat-picker > label > input { position: absolute; opacity: 0; }
.crm-chat-picker > label > span:nth-of-type(2),
.crm-chat-picker > button > span:last-of-type { display: grid; min-width: 0; gap: 2px; }
.crm-chat-picker strong,
.crm-chat-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-chat-picker strong { color: var(--foreground); font-size: 11.5px; }
.crm-chat-picker small { color: var(--muted-foreground); font-size: 9.5px; }
.crm-chat-picker > label > i { color: transparent; }
.crm-chat-picker > label:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.crm-chat-picker > label:has(input:checked) > i { color: var(--primary); }
.crm-chat-dialog-empty { padding: 28px 12px; color: var(--muted-foreground); font-size: 11px; text-align: center; }
.crm-chat-toast { position: fixed; z-index: 10080; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--popover); color: var(--foreground); box-shadow: var(--shadow-lg); font-size: 11.5px; opacity: 0; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease; }
.crm-chat-toast.is-visible { opacity: 1; transform: translateY(0); }
.crm-chat-toast.is-danger { border-color: color-mix(in srgb, var(--destructive) 34%, var(--border)); }

@media (max-width: 1260px) {
  .crm-monitor-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crm-monitor-filters .crm-search-field { grid-column: span 2; }
  .crm-chat-app { grid-template-columns: 245px minmax(400px, 1fr); }
  .crm-chat-people { position: absolute; z-index: 20; top: 0; right: 0; bottom: 0; width: min(290px, 88%); box-shadow: -18px 0 45px rgba(3,13,25,.18); transform: translateX(105%); transition: transform .2s ease; }
  .crm-chat-app.show-people .crm-chat-people { transform: translateX(0); }
}
@media (max-width: 900px) {
  .crm-team-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-transfer-selector { grid-template-columns: 1fr; }
  .crm-transfer-arrow { margin: 0 auto; transform: rotate(90deg); }
  .crm-transfer-selector > .btn { width: 100%; }
  .crm-transfer-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-monitor-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-monitor-filters .crm-search-field { grid-column: 1 / -1; }
  .crm-chat-app { height: min(760px, calc(100vh - 210px)); min-height: 580px; grid-template-columns: 1fr; }
  .crm-chat-channels { position: absolute; z-index: 25; top: 0; bottom: 0; left: 0; width: min(290px, 88%); box-shadow: 18px 0 45px rgba(3,13,25,.18); transform: translateX(-105%); transition: transform .2s ease; }
  .crm-chat-app.show-channels .crm-chat-channels { transform: translateX(0); }
  .crm-chat-mobile-channels { display: grid; }
}
@media (max-width: 620px) {
  .crm-team-metrics { grid-template-columns: 1fr; }
  .crm-transfer-route { grid-template-columns: 1fr; }
  .crm-transfer-route > i { transform: rotate(90deg); }
  .crm-transfer-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-transfer-confirm { grid-template-columns: 1fr; }
  .crm-recovery-row { align-items: stretch; flex-direction: column; }
  .crm-recovery-row .btn { width: 100%; }
  .crm-team-pagination { align-items: flex-start; flex-direction: column; }
  .crm-monitor-filters { grid-template-columns: 1fr; }
  .crm-monitor-filters .crm-search-field { grid-column: auto; }
  .crm-monitor-filters .btn { width: 100%; }
  .crm-live-controls { width: 100%; justify-content: space-between; }
  .crm-chat-app { height: calc(100vh - 168px); min-height: 520px; margin-inline: -8px; border-radius: 14px; }
  .crm-chat-message-list { padding: 15px 10px; }
  .crm-chat-message { max-width: 92%; }
  .crm-chat-conversation-head { padding: 10px; }
  .crm-chat-channel-heading .crm-chat-channel-icon { display: none; }
  .crm-chat-sync { display: none; }
  .crm-chat-composer { padding: 8px; }
  .crm-chat-compose-row { grid-template-columns: auto minmax(0, 1fr) 38px; gap: 4px; }
  .crm-chat-compose-tools { gap: 0; }
  .crm-chat-compose-tools button,
  .crm-chat-compose-tools label { width: 29px; }
  .crm-chat-send { width: 38px; height: 38px; }
  .crm-chat-compose-help { display: none; }
  .crm-chat-bubble > footer { opacity: 1; }
  .crm-chat-dialog-card > header,
  .crm-chat-dialog-body,
  .crm-chat-dialog-card > footer { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .crm-live-dot { animation: none; }
  .crm-chat-sync[data-tone="working"] i { animation: none; }
  .crm-chat-channels,
  .crm-chat-people,
  .crm-chat-toast { transition: none; }
}

/* The reminder composer retains its dark surface in both workspace themes. */
.crm-reminder-composer .crm-feature-panel-head h3 { color: #f7fbff !important; }
