/* Source: crm-ui.css */
/*
 * PAX CRM Minimal Enterprise UI
 * Compact, responsive and accessible presentation layer.
 */
:root {
    --ui-primary: #2563eb;
    --ui-primary-hover: #1d4ed8;
    --ui-primary-soft: #eff6ff;
    --ui-accent: #0f766e;
    --ui-bg: #f5f7fa;
    --ui-surface: #ffffff;
    --ui-surface-subtle: #f8fafc;
    --ui-border: #e2e8f0;
    --ui-border-strong: #cbd5e1;
    --ui-text: #172033;
    --ui-muted: #64748b;
    --ui-muted-2: #94a3b8;
    --ui-success: #15803d;
    --ui-warning: #b45309;
    --ui-danger: #b91c1c;
    --ui-info: #0369a1;
    --ui-sidebar: #111827;
    --ui-sidebar-hover: #1f2937;
    --ui-sidebar-text: #d1d5db;
    --ui-sidebar-muted: #7f8ba0;
    --ui-radius-sm: 6px;
    --ui-radius: 9px;
    --ui-radius-lg: 12px;
    --ui-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    --ui-shadow-popover: 0 12px 32px rgba(15, 23, 42, .14);
    --ui-sidebar-width: 216px;
    --ui-sidebar-collapsed: 68px;
    --ui-topbar-height: 60px;
    --ui-control-height: 38px;
    /* Backward-compatible aliases used by existing authentication and invoice views. */
    --crm-indigo: var(--ui-primary);
    --crm-indigo-light: #3b82f6;
    --crm-indigo-soft: var(--ui-primary-soft);
    --crm-navy: #172033;
    --crm-navy-deep: #0f172a;
    --crm-gold: #c28a2c;
    --crm-gold-soft: #fff7e6;
    --crm-teal: var(--ui-accent);
    --crm-surface: var(--ui-bg);
    --crm-surface-raised: var(--ui-surface);
    --crm-border: var(--ui-border);
    --crm-border-strong: var(--ui-border-strong);
    --crm-text: var(--ui-text);
    --crm-text-muted: var(--ui-muted);
    --ui-page-gap: 16px;
}

html {
    color-scheme: light;
    font-size: 14px;
    background: var(--ui-bg);
}

html[data-crm-theme="dark"] {
    color-scheme: dark;
    --ui-bg: #0b1120;
    --ui-surface: #111827;
    --ui-surface-subtle: #172033;
    --ui-border: #263247;
    --ui-border-strong: #3a4961;
    --ui-text: #e5e7eb;
    --ui-muted: #a8b3c5;
    --ui-muted-2: #718096;
    --ui-primary-soft: rgba(37, 99, 235, .16);
    --ui-shadow: 0 1px 2px rgba(0, 0, 0, .22);
    --ui-shadow-popover: 0 18px 46px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    background: var(--ui-bg) !important;
    color: var(--ui-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }

::selection { background: #bfdbfe; color: #172033; }

:focus-visible {
    outline: 2px solid var(--ui-primary) !important;
    outline-offset: 2px !important;
}


html[data-crm-mobile-nav="open"],
html[data-crm-preferences="open"] { overflow: hidden; }
html[data-crm-mobile-nav="open"] body,
html[data-crm-preferences="open"] body { overflow: hidden; }

/* Shell */
.crm-shell {
    display: block !important;
    min-height: 100vh;
    --crm-sidebar-width: var(--ui-sidebar-width) !important;
    --crm-topbar-offset: var(--ui-topbar-height) !important;
}

html[data-crm-sidebar="collapsed"] .crm-shell {
    --crm-sidebar-width: var(--ui-sidebar-collapsed) !important;
}

.crm-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 160 !important;
    width: var(--crm-sidebar-width) !important;
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: var(--ui-sidebar) !important;
    border-right: 1px solid rgba(255,255,255,.07) !important;
    box-shadow: none !important;
    transition: width .2s ease, transform .22s ease !important;
}

.crm-sidebar-brandbar {
    min-height: var(--ui-topbar-height);
    padding: 10px 12px !important;
    display: flex;
    align-items: center;
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
}

.crm-sidebar-brandbar > div { width: 100%; }

.crm-brand-logo {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    background: var(--ui-primary) !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 11px !important;
}

.crm-brand-logo img { padding: 4px !important; }
.crm-brand-title { max-width: 142px !important; font-size: 13px !important; font-weight: 700 !important; }
.crm-brand-subtitle { max-width: 142px !important; font-size: 9px !important; color: var(--ui-sidebar-muted) !important; }

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    padding: 10px 8px !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.sidebar-section-label {
    margin: 12px 8px 5px;
    padding: 0 !important;
    color: var(--ui-sidebar-muted) !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: .12em !important;
    line-height: 16px;
}

.sidebar-link {
    min-height: 38px;
    margin: 2px 0;
    padding: 8px 10px !important;
    gap: 10px !important;
    border-radius: 7px !important;
    color: var(--ui-sidebar-text) !important;
    font-size: 11.5px !important;
    font-weight: 550 !important;
    line-height: 1.25;
    transform: none !important;
    box-shadow: none !important;
}

.sidebar-link svg {
    width: 17px !important;
    height: 17px !important;
    opacity: .8 !important;
}

.sidebar-link:hover {
    background: var(--ui-sidebar-hover) !important;
    color: #fff !important;
}

.sidebar-link.active {
    background: #26344f !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--ui-primary) !important;
}

.sidebar-link.active svg { color: #93c5fd !important; }
.sidebar-footer { padding: 8px !important; border-top: 1px solid rgba(255,255,255,.07) !important; }
.sidebar-link.logout { color: #fca5a5 !important; }

.crm-sidebar-collapse {
    width: 28px;
    height: 28px;
    margin-left: auto;
    flex: 0 0 auto;
    border: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    background: rgba(255,255,255,.055);
    cursor: pointer;
}

.crm-sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,.1); }

html[data-crm-sidebar="collapsed"] .crm-sidebar-brandbar { padding-inline: 16px 12px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar .crm-brand-copy,
html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-link-label,
html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-section-label { display: none !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-link { justify-content: center; padding-inline: 8px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-link svg { width: 18px !important; height: 18px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-collapse { position: absolute; top: 47px; right: -12px; background: var(--ui-surface); color: var(--ui-muted); border: 1px solid var(--ui-border); box-shadow: var(--ui-shadow); }

.crm-main {
    width: calc(100% - var(--crm-sidebar-width)) !important;
    min-width: 0 !important;
    margin-left: var(--crm-sidebar-width) !important;
    padding-top: var(--ui-topbar-height) !important;
    overflow: visible !important;
    transition: width .2s ease, margin-left .2s ease !important;
}

.crm-topbar {
    position: fixed !important;
    inset: 0 0 auto var(--crm-sidebar-width) !important;
    z-index: 140 !important;
    height: var(--ui-topbar-height) !important;
    width: auto !important;
    background: var(--ui-surface) !important;
    background: color-mix(in srgb, var(--ui-surface) 94%, transparent) !important;
    border-bottom: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
    backdrop-filter: blur(14px) !important;
    transition: left .2s ease !important;
}

.crm-topbar::before, .crm-topbar::after { display: none !important; }
.crm-topbar-inner {
    height: 100%;
    min-height: 0 !important;
    padding: 0 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

.crm-title-zone { min-width: 0; display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; }
.crm-page-eyebrow, .crm-eyebrow-dot, .crm-live-chip { display: none !important; }
.crm-title-row { min-width: 0; display: flex; align-items: center; gap: 8px !important; flex-wrap: nowrap !important; }
.crm-page-title {
    max-width: min(40vw, 480px);
    color: var(--ui-text) !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-scope-pill {
    min-height: 24px !important;
    max-width: 220px !important;
    padding: 0 8px !important;
    gap: 5px !important;
    border-radius: 999px !important;
    border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface-subtle) !important;
    color: var(--ui-muted) !important;
    box-shadow: none !important;
    font-size: 10px !important;
    font-weight: 650 !important;
}
.crm-scope-icon { width: auto !important; height: auto !important; background: none !important; border: 0 !important; font-size: 10px !important; }

.crm-topbar-actions { min-width: 0; display: flex; align-items: center; gap: 7px !important; }
.crm-topbar-search-wrap { position: relative; }
.crm-topbar-search {
    width: min(300px, 27vw) !important;
    height: 34px !important;
    padding: 0 12px 0 34px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 8px !important;
    background: var(--ui-surface-subtle) !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 450 !important;
    transform: none !important;
}
.crm-topbar-search:focus { border-color: var(--ui-primary) !important; background: var(--ui-surface) !important; box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important; }

.crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    padding: 0 !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 8px !important;
    background: var(--ui-surface) !important;
    color: var(--ui-muted) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    transform: none !important;
    cursor: pointer;
}
.crm-icon-button:hover, .crm-mobile-menu-button:hover, .crm-preferences-button:hover { border-color: var(--ui-border-strong) !important; color: var(--ui-text) !important; background: var(--ui-surface-subtle) !important; }
.crm-mobile-menu-button { display: none; }

.crm-user-card {
    min-height: 36px !important;
    padding: 2px 2px 2px 8px !important;
    gap: 8px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    box-shadow: none !important;
}
.crm-user-card::before { display: none !important; }
.crm-user-card:hover { background: var(--ui-surface-subtle) !important; }
.crm-user-name { color: var(--ui-text) !important; font-size: 11.5px !important; font-weight: 650 !important; }
.crm-user-detail { font-size: 10px !important; color: var(--ui-muted) !important; }
.crm-user-role-pill { min-height: 17px !important; padding: 0 6px !important; font-size: 9px !important; background: var(--ui-primary-soft) !important; color: var(--ui-primary) !important; }
.crm-user-avatar { width: 32px !important; height: 32px !important; border-radius: 8px !important; background: var(--ui-primary) !important; box-shadow: none !important; font-size: 10px !important; }

.page-wrapper, .invoice-page-padding {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 16px 18px 28px !important;
}
.crm-page-wrapper, .crm-page-content, .enterprise-no-overflow { width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; }
.crm-page-content > * { min-width: 0; }

/* Page rhythm and typography */
.crm-page-content .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: var(--ui-page-gap) !important; }
.crm-page-content h1 { color: var(--ui-text); letter-spacing: -.02em !important; }
.crm-page-content h2, .crm-page-content h3 { color: var(--ui-text); letter-spacing: -.01em !important; }
.crm-page-content p { color: var(--ui-muted); }
.crm-page-content .text-\[26px\], .crm-page-content .text-\[25px\], .crm-page-content .text-\[24px\], .crm-page-content .text-\[22px\], .crm-page-content .text-\[21px\] { font-size: 18px !important; line-height: 1.3 !important; }
.crm-page-content .text-2xl { font-size: 20px !important; }
.crm-page-content .text-\[18px\], .crm-page-content .text-\[17px\] { font-size: 14px !important; }
.crm-page-content .font-black { font-weight: 700 !important; }
.crm-page-content .tracking-\[\.18em\], .crm-page-content .tracking-\[\.16em\], .crm-page-content .tracking-\[\.15em\], .crm-page-content .tracking-\[\.14em\], .crm-page-content .tracking-\[\.12em\] { letter-spacing: .08em !important; }

/* Unified intro/header */
.ui-page-intro, .ent-hero {
    position: relative;
    overflow: hidden;
    min-height: auto;
    padding: 15px 16px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    box-shadow: var(--ui-shadow) !important;
}
.ui-page-intro::before, .ui-page-intro::after, .ent-hero::before, .ent-hero::after { display: none !important; }
.ui-page-intro .absolute, .ent-hero .absolute { display: none !important; }
.ui-page-intro .text-white, .ent-hero .text-white { color: var(--ui-text) !important; }
.ui-page-intro [class*="text-white/"], .ent-hero [class*="text-white/"] { color: var(--ui-muted) !important; }
.ui-page-intro .text-amber-200, .ent-hero .text-amber-200 { color: var(--ui-primary) !important; }
.ui-page-intro [class*="border-white"], .ent-hero [class*="border-white"] { border-color: var(--ui-border) !important; }
.ui-page-intro [class*="bg-white/"] { background: var(--ui-surface-subtle) !important; }
.ui-page-intro a.bg-white, .ent-hero a.bg-white { background: var(--ui-primary) !important; color: #fff !important; }

/* Cards and sections */
.ent-card, .ent-stat-card,
.crm-page-content section[class*="bg-white"],
.crm-page-content article[class*="bg-white"],
.crm-page-content div[class*="bg-white"][class*="border"] {
    border-color: var(--ui-border) !important;
    box-shadow: var(--ui-shadow) !important;
}
.ent-card, .ent-stat-card { border-radius: var(--ui-radius-lg) !important; }
.ent-card-hover:hover { transform: none !important; box-shadow: 0 3px 12px rgba(15,23,42,.08) !important; }
.ent-stat-card { padding: 13px 14px !important; }
.ent-stat-card::before { width: 2px !important; background: var(--ui-primary) !important; }
.crm-page-content .rounded-3xl, .crm-page-content .rounded-\[30px\], .crm-page-content .rounded-\[28px\], .crm-page-content .rounded-\[26px\], .crm-page-content .rounded-\[24px\], .crm-page-content .rounded-\[22px\] { border-radius: var(--ui-radius-lg) !important; }
.crm-page-content .rounded-2xl { border-radius: var(--ui-radius) !important; }
.crm-page-content .shadow-xl, .crm-page-content .shadow-2xl, .crm-page-content .shadow-lg { box-shadow: var(--ui-shadow) !important; }

/* Buttons and actions */
.ent-btn-primary,
.crm-page-content button,
.crm-page-content a[class*="inline-flex"] {
    min-height: 34px;
    border-radius: var(--ui-radius) !important;
    font-size: 11.5px !important;
    line-height: 1.2;
    font-weight: 650 !important;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease !important;
}
.ent-btn-primary { padding: 0 12px !important; background: var(--ui-primary) !important; border: 1px solid var(--ui-primary) !important; }
.ent-btn-primary:hover { background: var(--ui-primary-hover) !important; }
.crm-page-content .bg-indigo-600, .crm-page-content .bg-indigo-700, .crm-page-content .bg-blue-600 { background-color: var(--ui-primary) !important; }
.crm-page-content .bg-slate-950 { background-color: var(--ui-text) !important; }
.crm-page-content button:hover, .crm-page-content a[class*="inline-flex"]:hover { filter: brightness(.97); }

/* Forms */
.crm-page-content label > span:first-child,
.crm-page-content .form-label {
    color: var(--ui-muted) !important;
    font-size: 10px !important;
    font-weight: 650 !important;
    letter-spacing: .045em !important;
    text-transform: uppercase;
}
.crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.crm-page-content select,
.crm-page-content textarea {
    width: 100%;
    min-height: var(--ui-control-height) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    padding: 8px 10px !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 450 !important;
}
.crm-page-content select { padding-top: 0 !important; padding-bottom: 0 !important; }
.crm-page-content textarea { min-height: 78px !important; resize: vertical; }
.crm-page-content input::placeholder, .crm-page-content textarea::placeholder { color: var(--ui-muted-2) !important; }
.crm-page-content input:focus, .crm-page-content select:focus, .crm-page-content textarea:focus { border-color: var(--ui-primary) !important; box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important; outline: 0 !important; }
.crm-page-content input[type="checkbox"], .crm-page-content input[type="radio"] { accent-color: var(--ui-primary); }
.crm-page-content details > summary { min-height: 34px; display: flex; align-items: center; color: var(--ui-primary) !important; }

/* Filters */
.crm-filter-panel { padding: 12px !important; }
.ui-filter-toggle { display: none; }

/* Tables */
.crm-page-content .overflow-x-auto { overflow-x: auto; scrollbar-width: thin; }
.crm-page-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--ui-text);
    font-size: 10.5px !important;
}
.crm-page-content table thead { background: var(--ui-surface-subtle); }
.crm-page-content table th {
    position: relative;
    padding: 9px 11px !important;
    color: var(--ui-muted) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--ui-border);
}
.crm-page-content table td {
    padding: 10px 11px !important;
    border-bottom: 1px solid var(--ui-border) !important;
    vertical-align: middle;
}
.crm-page-content table tbody tr:last-child td { border-bottom: 0 !important; }
.crm-page-content table tbody tr:hover { background: var(--ui-surface-subtle); }
.crm-page-content table .sticky { background: inherit; }
html[data-crm-density="compact"] .crm-page-content table th { padding-block: 6px !important; }
html[data-crm-density="compact"] .crm-page-content table td { padding-block: 7px !important; }
html[data-crm-density="comfortable"] .crm-page-content table th { padding-block: 11px !important; }
html[data-crm-density="comfortable"] .crm-page-content table td { padding-block: 13px !important; }

/* Badges */
.ent-badge, .crm-page-content span[class*="rounded-full"] {
    min-height: 20px;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: .025em !important;
}

/* Alerts / flash */
.crm-page-content [role="alert"], .crm-page-content .enterprise-flash { border-radius: var(--ui-radius) !important; box-shadow: none !important; }

/* Notification popover */
.crm-notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-popover);
    z-index: 220;
}
.crm-notification-dropdown .notification-scroll { max-height: 380px; overflow-y: auto; }

/* Preferences drawer */
.crm-drawer-backdrop, .crm-mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 230;
    background: rgba(15, 23, 42, .36);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}
.crm-preferences-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 240;
    width: min(360px, 100vw);
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--ui-surface);
    color: var(--ui-text);
    border-left: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-popover);
    transform: translateX(100%);
    transition: transform .2s ease;
}
html[data-crm-preferences="open"] .crm-drawer-backdrop { opacity: 1; visibility: visible; }
html[data-crm-preferences="open"] .crm-preferences-drawer { transform: translateX(0); }
.crm-drawer-header { min-height: 60px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ui-border); }
.crm-drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.crm-setting-group { padding: 14px 0; border-bottom: 1px solid var(--ui-border); }
.crm-setting-group:first-child { padding-top: 0; }
.crm-setting-title { margin: 0 0 8px; font-size: 10px; font-weight: 700; color: var(--ui-text); }
.crm-setting-description { margin: -4px 0 10px; font-size: 9.5px; color: var(--ui-muted); }
.crm-segmented { display: grid; grid-template-columns: repeat(var(--segments, 2), minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface-subtle); }
.crm-segmented button { min-height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--ui-muted); font-size: 9.5px; font-weight: 600; cursor: pointer; }
.crm-segmented button[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-primary); box-shadow: var(--ui-shadow); }
.crm-switch-row { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10.5px; color: var(--ui-text); }
.crm-switch { position: relative; width: 34px; height: 20px; flex: 0 0 auto; }
.crm-switch input { position: absolute; opacity: 0; }
.crm-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--ui-border-strong); transition: .15s; }
.crm-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .15s; }
.crm-switch input:checked + span { background: var(--ui-primary); }
.crm-switch input:checked + span::after { transform: translateX(14px); }

/* Dashboard */
.crm-dashboard-kpis { grid-template-columns: repeat(6, minmax(0,1fr)) !important; gap: 10px !important; }
.crm-dashboard-kpis .ent-stat-card { min-height: 104px; }
.crm-dashboard-kpis .w-11.h-11 { width: 32px !important; height: 32px !important; border-radius: 8px !important; }
.crm-dashboard-kpis .text-\[24px\] { font-size: 20px !important; }
[data-dashboard-widget][hidden] { display: none !important; }

/* Calendar */
.crm-calendar-grid { min-width: 0; }
.crm-calendar-day { min-width: 0; }

/* Dark mode utility overrides */
html[data-crm-theme="dark"] .crm-main .bg-white,
html[data-crm-theme="dark"] .crm-main .bg-slate-50,
html[data-crm-theme="dark"] .crm-main .bg-slate-50\/50,
html[data-crm-theme="dark"] .crm-main .bg-slate-50\/70,
html[data-crm-theme="dark"] .crm-main .bg-indigo-50\/30,
html[data-crm-theme="dark"] .crm-main .bg-indigo-50\/40,
html[data-crm-theme="dark"] .crm-main .bg-indigo-50\/50 { background-color: var(--ui-surface) !important; }
html[data-crm-theme="dark"] .crm-main .text-slate-950,
html[data-crm-theme="dark"] .crm-main .text-slate-900,
html[data-crm-theme="dark"] .crm-main .text-slate-800,
html[data-crm-theme="dark"] .crm-main .text-slate-700 { color: var(--ui-text) !important; }
html[data-crm-theme="dark"] .crm-main .text-slate-600,
html[data-crm-theme="dark"] .crm-main .text-slate-500,
html[data-crm-theme="dark"] .crm-main .text-slate-400 { color: var(--ui-muted) !important; }
html[data-crm-theme="dark"] .crm-main .border-slate-100,
html[data-crm-theme="dark"] .crm-main .border-slate-200,
html[data-crm-theme="dark"] .crm-main .divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: var(--ui-border) !important; }

/* Readability floor for legacy utility sizes. */
.crm-page-content .text-\[7px\],
.crm-page-content .text-\[8px\],
.crm-page-content .text-\[9px\] { font-size: 10px !important; line-height: 1.4 !important; }
.crm-page-content .text-\[10px\] { font-size: 11px !important; line-height: 1.45 !important; }
.crm-page-content .text-\[11px\] { font-size: 12px !important; line-height: 1.5 !important; }
.crm-page-content .text-\[12px\] { font-size: 12.5px !important; line-height: 1.5 !important; }

/* Restraint for recognition cards and legacy decorative gradients. */
.crm-wish-post-header {
    background: #18243a !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.crm-wish-post-header > .absolute { display: none !important; }
.crm-page-content .bg-gradient-to-br.from-white { background: var(--ui-surface-subtle) !important; }
.crm-page-content .w-10.h-10.bg-gradient-to-br { background: var(--ui-primary) !important; box-shadow: none !important; }

/* Responsive */
@media (max-width: 1280px) {
    .crm-dashboard-kpis { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
    .crm-topbar-search { width: min(250px, 25vw) !important; }
}

@media (max-width: 1024px) {
    :root { --ui-page-gap: 14px; }
    .crm-topbar-search-wrap { display: none !important; }
    .page-wrapper, .invoice-page-padding { padding-inline: 14px !important; }
    .crm-page-content .xl\:grid-cols-6 { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
}

@media (max-width: 767px) {
    :root { --ui-topbar-height: 54px; }
    .crm-shell, html[data-crm-sidebar="collapsed"] .crm-shell { --crm-sidebar-width: 0px !important; }
    .crm-sidebar {
        width: min(286px, calc(100vw - 44px)) !important;
        transform: translateX(-102%) !important;
        box-shadow: var(--ui-shadow-popover) !important;
    }
    html[data-crm-mobile-nav="open"] .crm-sidebar { transform: translateX(0) !important; }
    html[data-crm-mobile-nav="open"] .crm-mobile-backdrop { opacity: 1; visibility: visible; }
    html[data-crm-sidebar="collapsed"] .crm-sidebar .crm-brand-copy,
    html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-link-label,
    html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-section-label { display: initial !important; }
    html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-section-label { display: block !important; }
    html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-link { justify-content: flex-start !important; }
    html[data-crm-sidebar="collapsed"] .crm-sidebar-collapse { position: static; background: rgba(255,255,255,.055); border: 0; box-shadow: none; }
    .crm-sidebar-collapse { display: none; }
    .crm-main { width: 100% !important; margin-left: 0 !important; padding-top: var(--ui-topbar-height) !important; }
    .crm-topbar { left: 0 !important; height: var(--ui-topbar-height) !important; }
    .crm-topbar-inner { padding-inline: 10px !important; gap: 7px !important; }
    .crm-mobile-menu-button { display: inline-flex !important; }
    .crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button { width: 40px !important; height: 40px !important; min-width: 40px; }
    .crm-user-avatar { width: 36px !important; height: 36px !important; }
    .sidebar-link { min-height: 44px; font-size: 13px !important; }
    .crm-page-content button, .crm-page-content a[class*="inline-flex"] { min-height: 40px; }
    .crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
    .crm-page-content select { min-height: 42px !important; }
    .crm-scope-pill { display: none !important; }
    .crm-page-title { max-width: 44vw; font-size: 14px !important; }
    .crm-user-card { padding-left: 0 !important; }
    .crm-user-card > div:first-child { display: none !important; }
    .page-wrapper, .invoice-page-padding { padding: 12px 10px 24px !important; }
    .crm-dashboard-kpis { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px !important; }
    .crm-page-content .grid-cols-2, .crm-page-content .md\:grid-cols-2, .crm-page-content .lg\:grid-cols-2, .crm-page-content .xl\:grid-cols-3, .crm-page-content .xl\:grid-cols-5, .crm-page-content .xl\:grid-cols-6 { grid-template-columns: minmax(0,1fr) !important; }
    .ui-page-intro, .ent-hero { padding: 13px !important; }
    .ui-page-intro > div, .ent-hero > div { gap: 10px !important; }
    .crm-page-content .p-6 { padding: 14px !important; }
    .crm-page-content .p-5 { padding: 13px !important; }
    .crm-page-content .p-4 { padding: 11px !important; }
    .crm-page-content .px-5 { padding-left: 12px !important; padding-right: 12px !important; }
    .crm-page-content .py-4 { padding-top: 10px !important; padding-bottom: 10px !important; }
    .ui-filter-toggle { display: inline-flex; }
    .crm-filter-panel[data-collapsed="true"] > form { display: none !important; }

    /* Generic responsive table cards; labels are added by crm-ui.js. */
    .crm-responsive-table { overflow: visible !important; }
    .crm-responsive-table table, .crm-responsive-table tbody { display: block; width: 100%; }
    .crm-responsive-table thead { display: none; }
    .crm-responsive-table tr { display: block; margin: 0 0 9px; padding: 7px 10px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
    .crm-responsive-table tr:last-child { margin-bottom: 0; }
    .crm-responsive-table td { width: 100% !important; min-height: 34px; padding: 7px 0 !important; display: grid; grid-template-columns: minmax(92px, 34%) minmax(0,1fr); align-items: start; gap: 8px; border-bottom: 1px solid var(--ui-border) !important; text-align: left !important; white-space: normal !important; }
    .crm-responsive-table td:last-child { border-bottom: 0 !important; }
    .crm-responsive-table td::before { content: attr(data-label); color: var(--ui-muted); font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
    .crm-responsive-table td[data-label=""], .crm-responsive-table td:not([data-label]) { grid-template-columns: 1fr; }
    .crm-responsive-table td[data-label=""]::before, .crm-responsive-table td:not([data-label])::before { display: none; }
    .crm-responsive-table td > * { min-width: 0; }

    /* Calendar becomes an agenda-like scroll-safe grid. */
    .crm-calendar-weekdays { display: none !important; }
    .crm-calendar-grid { display: block !important; }
    .crm-calendar-grid > div { min-height: 74px !important; border: 0 !important; border-bottom: 1px solid var(--ui-border) !important; padding: 9px 10px !important; }
    .crm-calendar-grid > div:empty { display: none; }
}

@media (max-width: 420px) {
    .crm-dashboard-kpis { grid-template-columns: minmax(0,1fr) !important; }
    .crm-topbar-actions { gap: 4px !important; }
    .crm-page-title { max-width: 36vw; }
    .crm-user-avatar { width: 36px !important; height: 36px !important; }
    .crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button { width: 40px !important; height: 40px !important; min-width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
    .crm-sidebar, .crm-topbar, .crm-mobile-backdrop, .crm-preferences-drawer, .crm-drawer-backdrop { display: none !important; }
    .crm-main { width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .page-wrapper, .invoice-page-padding { max-width: none !important; padding: 0 !important; }
}

/* Task view preference */
@media (min-width: 768px) {
    [data-task-list].crm-task-card-view { padding: 12px; background: transparent !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; }
    [data-task-list].crm-task-card-view > .hidden.xl\:grid { display: none !important; }
    [data-task-list].crm-task-card-view > .divide-y { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    [data-task-list].crm-task-card-view > .divide-y > a { padding: 13px !important; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
    [data-task-list].crm-task-card-view > .divide-y > a > div { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    [data-task-list].crm-task-card-view > .divide-y > a > div > div:first-child { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
    [data-task-list].crm-task-card-view > .divide-y { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Profile hero remains structured but no longer oversized. */
.ui-page-intro img[class*="w-28"], .ui-page-intro div[class*="w-28"] { width: 76px !important; height: 76px !important; border-radius: 12px !important; border-width: 2px !important; box-shadow: none !important; }
.ui-page-intro .md\:text-\[34px\] { font-size: 20px !important; }
.ui-page-intro .md\:text-\[15px\] { font-size: 12px !important; }

/* Legacy module harmonisation: audit, permissions and settings now use the same design language. */
.audit-shell, .roles-shell, .pax-settings-page, .pax-companies-page, .pax-company-form-page {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    color: var(--ui-text) !important;
}
.audit-hero, .roles-hero, .pax-settings-hero, .pax-company-hero, .pax-form-hero {
    min-height: auto !important;
    margin: 0 0 var(--ui-page-gap) !important;
    padding: 15px 16px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    box-shadow: var(--ui-shadow) !important;
}
.pax-settings-hero::after { display: none !important; }
.audit-hero-grid, .roles-hero-grid, .pax-hero-grid, .pax-company-hero, .pax-form-hero {
    gap: 12px !important;
}
.audit-eyebrow, .roles-eyebrow, .pax-eyebrow, .pax-settings-hero small, .pax-company-hero small, .pax-form-hero small {
    color: var(--ui-primary) !important;
    font-size: 8.5px !important;
    letter-spacing: .08em !important;
}
.audit-title, .roles-title, .pax-settings-hero h1, .pax-company-hero h1, .pax-form-hero h1 {
    margin-top: 4px !important;
    color: var(--ui-text) !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
    letter-spacing: -.02em !important;
}
.audit-subtitle, .roles-subtitle, .pax-settings-hero p, .pax-company-hero p, .pax-form-hero p {
    margin-top: 4px !important;
    color: var(--ui-muted) !important;
    font-size: 10.5px !important;
    line-height: 1.55 !important;
}
.audit-stats, .pax-company-stats, .pax-hero-stats { gap: 8px !important; }
.audit-stat, .pax-company-stat, .pax-stat {
    min-height: 68px !important;
    padding: 10px 12px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface-subtle) !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
}
.audit-stat-value, .pax-company-stat strong, .pax-stat strong { font-size: 17px !important; color: var(--ui-text) !important; }
.audit-stat-label, .pax-company-stat span, .pax-stat span { font-size: 8px !important; color: var(--ui-muted) !important; }
.audit-btn, .roles-btn, .pax-btn {
    min-height: 34px !important;
    padding: 0 11px !important;
    border-radius: var(--ui-radius) !important;
    box-shadow: none !important;
    transform: none !important;
    font-size: 9.5px !important;
    font-weight: 650 !important;
}
.audit-table-card, .roles-matrix-card, .pax-section, .pax-panel, .pax-company-card, .pax-form-shell {
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: var(--ui-surface) !important;
    box-shadow: var(--ui-shadow) !important;
}
.audit-table-top, .pax-section-header, .pax-panel-header {
    padding: 12px 14px !important;
    border-color: var(--ui-border) !important;
    background: var(--ui-surface) !important;
}
.audit-table-title, .pax-section-header h2, .pax-panel-header h2 { color: var(--ui-text) !important; font-size: 12px !important; }
.audit-table-note, .pax-section-header p, .pax-panel-header p { color: var(--ui-muted) !important; font-size: 9.5px !important; }
.audit-table th, .roles-table th { padding: 8px 10px !important; background: var(--ui-surface-subtle) !important; color: var(--ui-muted) !important; font-size: 8px !important; }
.audit-table td, .roles-table td { padding: 9px 10px !important; border-color: var(--ui-border) !important; color: var(--ui-text) !important; font-size: 10px !important; }
.roles-group-row td { background: var(--ui-surface-subtle) !important; color: var(--ui-text) !important; }
.roles-note, .pax-alert, .audit-flash, .roles-flash { padding: 10px 12px !important; border-radius: var(--ui-radius) !important; box-shadow: none !important; font-size: 10px !important; }
.pax-settings-nav {
    gap: 4px !important;
    padding: 4px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface-subtle) !important;
    box-shadow: none !important;
}
.pax-settings-nav a { min-height: 31px !important; padding: 0 10px !important; border-radius: 6px !important; color: var(--ui-muted) !important; font-size: 9px !important; }
.pax-settings-nav a:hover, .pax-settings-nav a.active { background: var(--ui-surface) !important; color: var(--ui-primary) !important; box-shadow: var(--ui-shadow) !important; }
.pax-card-body, .pax-panel-body, .pax-company-edit { padding: 14px !important; }
.pax-field > span, .pax-logo-field > span, .pax-toggle > span { color: var(--ui-muted) !important; font-size: 8.5px !important; letter-spacing: .06em !important; }
.pax-field input, .pax-field select, .pax-field textarea {
    min-height: var(--ui-control-height) !important;
    padding: 8px 10px !important;
    border-color: var(--ui-border) !important;
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    font-size: 10.5px !important;
}
.pax-logo-preview, .pax-logo-box, .pax-hero-logo { border-radius: var(--ui-radius) !important; border-color: var(--ui-border) !important; background: var(--ui-surface-subtle) !important; box-shadow: none !important; }
.pax-save-bar { padding: 10px 12px !important; border: 1px solid var(--ui-border) !important; border-radius: var(--ui-radius-lg) !important; background: var(--ui-surface) !important; box-shadow: var(--ui-shadow) !important; }
.pax-company-grid { gap: 10px !important; }
.pax-company-card { padding: 12px !important; gap: 12px !important; transform: none !important; }
.pax-company-card:hover { transform: none !important; border-color: var(--ui-border-strong) !important; box-shadow: 0 3px 12px rgba(15,23,42,.07) !important; }
.pax-card-main strong, .pax-company-title strong, .pax-charge-title strong { color: var(--ui-text) !important; font-size: 11px !important; }
.pax-card-main span, .pax-company-title span, .pax-charge-title span { color: var(--ui-muted) !important; font-size: 9px !important; }

/* Leads and kanban */
.enterprise-lead-row { background: var(--ui-surface) !important; }
.enterprise-lead-row:hover { background: var(--ui-surface-subtle) !important; transform: none !important; }
.enterprise-lead-row td { padding-top: 9px !important; padding-bottom: 9px !important; }
.lead-pill { border-radius: 999px !important; font-size: 8px !important; font-weight: 650 !important; }
.kanban-board-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.kanban-board { gap: 10px !important; padding-bottom: 8px; }
.kanban-column { min-width: 270px !important; width: 270px !important; border: 1px solid var(--ui-border) !important; border-radius: var(--ui-radius-lg) !important; background: var(--ui-surface-subtle) !important; box-shadow: none !important; }
.kanban-card { border: 1px solid var(--ui-border) !important; border-radius: var(--ui-radius) !important; background: var(--ui-surface) !important; box-shadow: var(--ui-shadow) !important; }
.kanban-card:hover { transform: none !important; box-shadow: 0 3px 10px rgba(15,23,42,.07) !important; }

/* Generic modal and drawer safety. */
.crm-page-content .fixed.inset-0,
.crm-page-content [role="dialog"] {
    max-width: 100vw;
    max-height: 100dvh;
}
.crm-page-content .fixed.inset-0 > div,
.crm-page-content [role="dialog"] > div {
    max-width: min(620px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}
html[data-crm-preferences="open"] body { overflow: hidden; }
@media (max-width: 767px) {
    html[data-crm-mobile-nav="open"] body { overflow: hidden; }
    .audit-actions, .roles-actions, .pax-toolbar, .pax-save-bar { width: 100% !important; flex-direction: column !important; align-items: stretch !important; }
    .audit-btn, .roles-btn, .pax-btn { width: 100% !important; justify-content: center !important; }
    .audit-hero, .roles-hero, .pax-settings-hero, .pax-company-hero, .pax-form-hero { padding: 13px !important; }
    .audit-table-wrap, .roles-table-wrap { overflow: visible !important; }
    .crm-page-content .fixed.inset-0 > div, .crm-page-content [role="dialog"] > div { width: calc(100vw - 12px) !important; max-width: none !important; max-height: calc(100dvh - 12px) !important; border-radius: 12px !important; }
}

.crm-skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 999;
    padding: 8px 12px;
    border-radius: 7px;
    background: var(--ui-text);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    transform: translateY(-150%);
}
.crm-skip-link:focus { transform: translateY(0); }

/* Authentication screens */
.crm-auth-page {
    min-height: 100dvh !important;
    background: var(--ui-bg) !important;
    color: var(--ui-text) !important;
}
.crm-auth-page > .pointer-events-none { display: none !important; }
.crm-auth-page > .relative.w-full {
    max-width: 900px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 14px !important;
    background: var(--ui-surface) !important;
    box-shadow: 0 10px 36px rgba(15,23,42,.10) !important;
}
.crm-auth-page > .hidden.lg\:flex,
.crm-auth-page > .relative.w-full > .hidden.lg\:flex {
    width: 44% !important;
    background: var(--ui-sidebar) !important;
}
.crm-auth-page > .hidden.lg\:flex .absolute,
.crm-auth-page > .relative.w-full > .hidden.lg\:flex .absolute { display: none !important; }
.crm-auth-page > .hidden.lg\:flex > .relative,
.crm-auth-page > .relative.w-full > .hidden.lg\:flex { padding: 28px !important; }
.crm-auth-page h2.text-\[42px\], .crm-auth-page h2.text-\[32px\] { font-size: 27px !important; line-height: 1.2 !important; }
.crm-auth-page h2.text-\[25px\] { font-size: 21px !important; }
.crm-auth-page .grid.grid-cols-3 > div { padding: 12px !important; border-radius: 9px !important; }
.crm-auth-page .grid.grid-cols-3 .text-\[24px\], .crm-auth-page .grid.grid-cols-3 .text-\[18px\] { font-size: 14px !important; }
.crm-auth-page input:not([type="checkbox"]) { height: 40px !important; border-radius: 8px !important; background: var(--ui-surface-subtle) !important; }
.crm-auth-page .ent-btn-primary { height: 40px !important; border-radius: 8px !important; }
@media (max-width: 1023px) {
    .crm-auth-page { padding: 14px !important; align-items: center !important; }
    .crm-auth-page > .relative.w-full { max-width: 470px !important; grid-template-columns: 1fr !important; }
    .crm-auth-page > .flex-1 { width: 100%; padding: 14px !important; }
}

/* Compact search access for laptops, tablets and mobile. */
.crm-mobile-search-button {
    display: none;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: var(--ui-surface);
    color: var(--ui-muted);
    cursor: pointer;
}
.crm-mobile-search-button:hover { color: var(--ui-text); background: var(--ui-surface-subtle); }
.crm-mobile-search-panel {
    position: fixed;
    z-index: 135;
    top: var(--ui-topbar-height);
    right: 0;
    left: var(--crm-sidebar-width);
    min-height: 58px;
    padding: 10px 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--ui-border);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-popover);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform .16s ease, opacity .16s ease, visibility .16s ease;
}
html[data-crm-search="open"] .crm-mobile-search-panel { transform: translateY(0); opacity: 1; visibility: visible; }
.crm-mobile-search-panel > span { color: var(--ui-muted); }
.crm-mobile-search-panel input {
    width: 100%;
    height: 38px;
    min-width: 0;
    padding: 0 11px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface-subtle);
    color: var(--ui-text);
    font-size: 12px;
}
.crm-mobile-search-panel input:focus { border-color: var(--ui-primary); outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.crm-mobile-search-panel button {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ui-primary);
    border-radius: var(--ui-radius);
    background: var(--ui-primary);
    color: #fff;
    font-size: 11.5px;
    font-weight: 650;
    cursor: pointer;
}
.crm-mobile-search-panel #crmMobileSearchClose { width: 38px; padding: 0; border-color: var(--ui-border); background: var(--ui-surface); color: var(--ui-muted); }
@media (max-width: 1024px) {
    .crm-mobile-search-button { display: inline-flex; }
    .crm-mobile-search-panel { left: var(--crm-sidebar-width); }
}
@media (max-width: 767px) {
    .crm-mobile-search-button { width: 40px; height: 40px; min-width: 40px; }
    .crm-mobile-search-panel { left: 0; min-height: 62px; padding: 10px; grid-template-columns: auto minmax(0,1fr) auto; }
    .crm-mobile-search-panel > span { display: none; }
    .crm-mobile-search-panel input { height: 42px; font-size: 13px; }
    .crm-mobile-search-panel button { min-height: 42px; }
    .crm-mobile-search-panel button[type="submit"] { display: none; }
}
@media (max-width: 420px) {
    .crm-user-card { display: none !important; }
    .crm-page-title { max-width: 30vw !important; }
}

/* Source: crm-enterprise-v2.css */
/*
 * PAX CRM Enterprise Interface V2
 * Readable, consistent and responsive enhancement layer.
 * Loaded after crm-ui.css so existing workflows and module-specific layouts remain intact.
 */

:root {
    --ui-primary: #2563eb;
    --ui-primary-hover: #1d4ed8;
    --ui-primary-strong: #1e40af;
    --ui-primary-soft: #eff6ff;
    --ui-bg: #f3f6fa;
    --ui-surface: #ffffff;
    --ui-surface-subtle: #f8fafc;
    --ui-surface-muted: #f1f5f9;
    --ui-border: #e2e8f0;
    --ui-border-strong: #cbd5e1;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --ui-muted-2: #94a3b8;
    --ui-sidebar: #0b1220;
    --ui-sidebar-hover: rgba(255, 255, 255, .065);
    --ui-sidebar-text: #dbe4f0;
    --ui-sidebar-muted: #8391a7;
    --ui-radius-sm: 8px;
    --ui-radius: 10px;
    --ui-radius-lg: 14px;
    --ui-radius-xl: 18px;
    --ui-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .035);
    --ui-shadow-hover: 0 10px 28px rgba(15, 23, 42, .08);
    --ui-shadow-popover: 0 20px 50px rgba(15, 23, 42, .18);
    --ui-sidebar-width: 252px;
    --ui-sidebar-collapsed: 80px;
    --ui-topbar-height: 72px;
    --ui-control-height: 42px;
    --ui-page-gap: 20px;
}

html { font-size: 16px; }
body {
    font-size: 14px !important;
    line-height: 1.55 !important;
    letter-spacing: -.005em;
}

/* Application shell */
.crm-sidebar {
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, .16), transparent 28%),
        linear-gradient(180deg, #0b1220 0%, #101827 100%) !important;
    border-right-color: rgba(148, 163, 184, .12) !important;
}
.crm-sidebar-brandbar {
    min-height: var(--ui-topbar-height) !important;
    padding: 12px 14px !important;
    border-bottom-color: rgba(148, 163, 184, .12) !important;
}
.crm-brand-logo {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .28) !important;
    font-size: 13px !important;
}
.crm-brand-logo img { object-fit: contain; padding: 5px !important; }
.crm-brand-title { max-width: 156px !important; color: #f8fafc !important; font-size: 14px !important; font-weight: 750 !important; }
.crm-brand-subtitle { max-width: 156px !important; margin-top: 2px; font-size: 10px !important; color: #8391a7 !important; }
.crm-sidebar-collapse {
    width: 30px !important;
    height: 30px !important;
    border: 1px solid rgba(148, 163, 184, .14) !important;
    background: rgba(255, 255, 255, .055) !important;
}
.sidebar-scroll { padding: 14px 10px 18px !important; }
.sidebar-section-label {
    margin: 18px 10px 7px !important;
    color: #728197 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: .12em !important;
}
.sidebar-section-label:first-child { margin-top: 4px !important; }
.sidebar-link {
    min-height: 42px !important;
    margin: 3px 0 !important;
    padding: 9px 11px !important;
    gap: 12px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: var(--ui-sidebar-text) !important;
    font-size: 13px !important;
    font-weight: 590 !important;
}
.sidebar-link svg { width: 18px !important; height: 18px !important; opacity: .9 !important; }
.sidebar-link:hover {
    background: var(--ui-sidebar-hover) !important;
    border-color: rgba(148, 163, 184, .1) !important;
}
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, .30), rgba(37, 99, 235, .12)) !important;
    border-color: rgba(96, 165, 250, .24) !important;
    box-shadow: inset 3px 0 0 #60a5fa !important;
}
.sidebar-link.active svg { color: #93c5fd !important; }
.sidebar-footer {
    padding: 10px !important;
    border-top-color: rgba(148, 163, 184, .12) !important;
    background: rgba(2, 6, 23, .14);
}
.crm-sidebar-account {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    color: #e2e8f0;
    text-decoration: none;
}
.crm-sidebar-account:hover { background: rgba(255, 255, 255, .07); }
.crm-sidebar-account-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}
.crm-sidebar-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.crm-sidebar-account-copy { min-width: 0; flex: 1; }
.crm-sidebar-account-name { overflow: hidden; color: #f8fafc; font-size: 11.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.crm-sidebar-account-role { overflow: hidden; margin-top: 1px; color: #8391a7; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.crm-sidebar-signout {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fca5a5;
}
.crm-sidebar-signout:hover { background: rgba(239, 68, 68, .12); color: #fecaca; }
.crm-sidebar-signout svg { width: 16px; height: 16px; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-account { justify-content: center; padding: 8px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-account-copy,
html[data-crm-sidebar="collapsed"] .crm-sidebar-signout { display: none !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-brandbar { padding-inline: 18px 14px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-collapse { top: 55px !important; }

/* Top bar */
.crm-topbar {
    background: rgba(255, 255, 255, .90) !important;
    border-bottom-color: rgba(203, 213, 225, .8) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02) !important;
    backdrop-filter: blur(18px) saturate(1.3) !important;
}
.crm-topbar-inner { padding: 0 24px !important; gap: 18px !important; }
.crm-title-row { gap: 10px !important; }
.crm-page-title {
    max-width: min(42vw, 560px) !important;
    font-size: 17px !important;
    font-weight: 730 !important;
    letter-spacing: -.025em !important;
}
.crm-scope-pill {
    min-height: 28px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-size: 10.5px !important;
    font-weight: 650 !important;
}
.crm-scope-icon { color: var(--ui-primary) !important; }
.crm-topbar-actions { gap: 8px !important; }
.crm-topbar-search {
    width: min(340px, 29vw) !important;
    height: 42px !important;
    padding-left: 38px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    font-size: 12.5px !important;
}
.crm-topbar-search:hover { border-color: var(--ui-border-strong) !important; background: #fff !important; }
.crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button, .crm-mobile-search-button {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 10px !important;
}
.crm-user-card {
    min-height: 44px !important;
    padding: 4px 4px 4px 10px !important;
    gap: 10px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
}
.crm-user-card:hover { border-color: var(--ui-border) !important; background: var(--ui-surface-subtle) !important; }
.crm-user-name { font-size: 12px !important; font-weight: 700 !important; }
.crm-user-detail { max-width: 118px; font-size: 9.5px !important; }
.crm-user-role-pill { min-height: 19px !important; padding: 0 7px !important; font-size: 9px !important; }
.crm-user-avatar { width: 36px !important; height: 36px !important; border-radius: 10px !important; font-size: 11px !important; }

/* Workspace spacing and hierarchy */
.page-wrapper, .invoice-page-padding {
    max-width: 1720px !important;
    padding: 24px 26px 40px !important;
}
.crm-page-content .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: var(--ui-page-gap) !important; }
.crm-page-content h1 { font-weight: 750 !important; }
.crm-page-content h2, .crm-page-content h3 { font-weight: 700 !important; }
.crm-page-content p { line-height: 1.6 !important; }
.crm-page-content .text-\[8px\], .crm-page-content .text-\[8\.5px\], .crm-page-content .text-\[9px\], .crm-page-content .text-\[9\.5px\] { font-size: 10.5px !important; line-height: 1.45 !important; }
.crm-page-content .text-\[10px\], .crm-page-content .text-\[10\.5px\] { font-size: 11.5px !important; line-height: 1.5 !important; }
.crm-page-content .text-\[11px\], .crm-page-content .text-\[11\.5px\] { font-size: 12.5px !important; line-height: 1.5 !important; }
.crm-page-content .text-\[12px\], .crm-page-content .text-\[12\.5px\] { font-size: 13px !important; line-height: 1.55 !important; }
.crm-page-content .text-\[13px\], .crm-page-content .text-\[13\.5px\] { font-size: 13.5px !important; }
.crm-page-content .text-\[14px\], .crm-page-content .text-\[15px\] { font-size: 14px !important; }
.crm-page-content .text-\[18px\], .crm-page-content .text-\[20px\], .crm-page-content .text-\[21px\], .crm-page-content .text-\[22px\], .crm-page-content .text-\[24px\], .crm-page-content .text-\[25px\], .crm-page-content .text-\[26px\] { font-size: 22px !important; line-height: 1.25 !important; }

.ui-page-intro, .ent-hero,
.audit-hero, .roles-hero, .pax-settings-hero, .pax-company-hero, .pax-form-hero {
    position: relative;
    overflow: hidden;
    padding: 20px 22px !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-xl) !important;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, .9), rgba(255, 255, 255, .96) 52%, rgba(248, 250, 252, .96)) !important;
    color: var(--ui-text) !important;
    box-shadow: var(--ui-shadow) !important;
}
.ui-page-intro::before, .ent-hero::before,
.audit-hero::before, .roles-hero::before, .pax-settings-hero::before, .pax-company-hero::before, .pax-form-hero::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 auto 0 0 !important;
    width: 4px !important;
    display: block !important;
    background: linear-gradient(180deg, #2563eb, #60a5fa) !important;
}
.ui-page-intro .text-white, .ent-hero .text-white { color: var(--ui-text) !important; }
.ui-page-intro [class*="text-white/"], .ent-hero [class*="text-white/"] { color: var(--ui-muted) !important; }
.ui-page-intro [class*="border-white"], .ent-hero [class*="border-white"] { border-color: var(--ui-border) !important; }
.ui-page-intro [class*="bg-white/"], .ent-hero [class*="bg-white/"] { background: #fff !important; }
.ui-page-intro a.bg-white, .ent-hero a.bg-white { background: var(--ui-primary) !important; color: #fff !important; }

/* Cards, metrics and panels */
.ent-card, .ent-stat-card,
.crm-page-content section[class*="bg-white"],
.crm-page-content article[class*="bg-white"],
.crm-page-content div[class*="bg-white"][class*="border"],
.enterprise-card-list {
    border-color: var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    background: var(--ui-surface) !important;
    box-shadow: var(--ui-shadow) !important;
}
.ent-card-hover { transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease !important; }
.ent-card-hover:hover { transform: translateY(-1px) !important; border-color: var(--ui-border-strong) !important; box-shadow: var(--ui-shadow-hover) !important; }
.ent-stat-card { min-height: 116px; padding: 18px !important; }
.ent-stat-card::before { width: 3px !important; border-radius: 3px; }
.ent-stat-card .w-11.h-11 { width: 46px !important; height: 46px !important; border-radius: 13px !important; }
.crm-dashboard-kpis { gap: 14px !important; }
.crm-dashboard-kpis .text-\[24px\] { font-size: 28px !important; }
.crm-page-content .rounded-3xl, .crm-page-content .rounded-\[30px\], .crm-page-content .rounded-\[28px\], .crm-page-content .rounded-\[26px\], .crm-page-content .rounded-\[24px\], .crm-page-content .rounded-\[22px\] { border-radius: var(--ui-radius-xl) !important; }
.crm-page-content .rounded-2xl { border-radius: var(--ui-radius-lg) !important; }

/* Buttons and forms */
.ent-btn-primary,
.crm-page-content button,
.crm-page-content a[class*="inline-flex"] {
    min-height: 40px;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease !important;
}
.ent-btn-primary { min-height: 42px !important; padding: 0 16px !important; box-shadow: 0 5px 14px rgba(37, 99, 235, .18) !important; }
.ent-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(37, 99, 235, .23) !important; }
.crm-page-content label > span:first-child, .crm-page-content .form-label { font-size: 11.5px !important; font-weight: 700 !important; }
.crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.crm-page-content select,
.crm-page-content textarea,
.pax-field input, .pax-field select, .pax-field textarea {
    min-height: 42px !important;
    padding: 9px 12px !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--ui-text) !important;
    font-size: 13px !important;
}
.crm-page-content textarea, .pax-field textarea { min-height: 104px !important; }
.crm-page-content input:focus, .crm-page-content select:focus, .crm-page-content textarea:focus,
.pax-field input:focus, .pax-field select:focus, .pax-field textarea:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10) !important;
}

/* Data tables and lists */
.crm-page-content table { border-collapse: separate !important; border-spacing: 0 !important; font-size: 13px !important; }
.crm-page-content table thead { background: #f8fafc !important; }
.crm-page-content table th {
    padding: 12px 14px !important;
    color: #475569 !important;
    font-size: 10.5px !important;
    font-weight: 750 !important;
    letter-spacing: .075em !important;
}
.crm-page-content table td { padding: 13px 14px !important; color: #334155 !important; font-size: 12.5px !important; vertical-align: middle !important; }
.crm-page-content table tbody tr { transition: background-color .12s ease; }
.crm-page-content table tbody tr:hover { background: #f8fafc !important; }
.enterprise-data-head { padding-top: 13px !important; padding-bottom: 13px !important; }
.enterprise-data-row { padding-top: 16px !important; padding-bottom: 16px !important; }
.enterprise-data-row:hover { background: #f8fafc !important; }
.ent-badge, .crm-page-content span[class*="rounded-full"] { min-height: 24px !important; padding-inline: 9px !important; font-size: 10.5px !important; }

/* Dropdowns and drawers */
.crm-notification-dropdown { width: min(390px, calc(100vw - 24px)) !important; border-radius: 14px !important; box-shadow: var(--ui-shadow-popover) !important; }
.crm-preferences-drawer { width: min(390px, 100vw) !important; }
.crm-drawer-header { min-height: 70px !important; padding-inline: 20px !important; }
.crm-drawer-body { padding: 20px !important; }
.crm-setting-group { padding: 18px 0 !important; }
.crm-setting-title { font-size: 12px !important; }
.crm-setting-description { font-size: 11px !important; }
.crm-segmented button { min-height: 36px !important; font-size: 11px !important; }
.crm-mobile-search-panel { min-height: 68px !important; padding: 12px 24px !important; }
.crm-mobile-search-panel input { height: 42px !important; font-size: 13px !important; }

/* Kanban and task views */
.kanban-board { gap: 14px !important; }
.kanban-column { min-width: 300px !important; width: 300px !important; border-radius: 14px !important; }
.kanban-card { border-radius: 12px !important; }
.kanban-card:hover { transform: translateY(-1px) !important; box-shadow: var(--ui-shadow-hover) !important; }

/* Authentication */
.crm-auth-page { padding: 24px !important; background: linear-gradient(145deg, #eef3f9, #f8fafc) !important; }
.crm-auth-page > .pointer-events-none { display: block !important; }
.crm-auth-page > .relative.w-full {
    max-width: 1080px !important;
    min-height: 640px;
    border-radius: 24px !important;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .18) !important;
}
.crm-auth-page > .relative.w-full > .hidden.lg\:flex { width: auto !important; padding: 44px !important; }
.crm-auth-page > .relative.w-full > .hidden.lg\:flex .absolute { display: block !important; }
.crm-auth-page > .relative.w-full > .bg-white { padding: 48px !important; }
.crm-auth-page h2.text-\[32px\] { font-size: 34px !important; }
.crm-auth-page h2.text-\[25px\] { font-size: 27px !important; }
.crm-auth-page label { font-size: 12px !important; }
.crm-auth-page input:not([type="checkbox"]) { height: 48px !important; border-radius: 11px !important; font-size: 14px !important; }
.crm-auth-page .ent-btn-primary { height: 48px !important; font-size: 13px !important; }

/* Dark theme */
html[data-crm-theme="dark"] {
    --ui-bg: #080f1d;
    --ui-surface: #111827;
    --ui-surface-subtle: #172033;
    --ui-surface-muted: #1e293b;
    --ui-border: #29364a;
    --ui-border-strong: #3d4c63;
    --ui-text: #eef2f7;
    --ui-muted: #a5b2c4;
}
html[data-crm-theme="dark"] .crm-topbar { background: rgba(17, 24, 39, .90) !important; }
html[data-crm-theme="dark"] .crm-topbar-search,
html[data-crm-theme="dark"] .crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
html[data-crm-theme="dark"] .crm-page-content select,
html[data-crm-theme="dark"] .crm-page-content textarea,
html[data-crm-theme="dark"] .pax-field input,
html[data-crm-theme="dark"] .pax-field select,
html[data-crm-theme="dark"] .pax-field textarea { background: #111827 !important; color: #eef2f7 !important; }
html[data-crm-theme="dark"] .ui-page-intro,
html[data-crm-theme="dark"] .ent-hero,
html[data-crm-theme="dark"] .audit-hero,
html[data-crm-theme="dark"] .roles-hero,
html[data-crm-theme="dark"] .pax-settings-hero,
html[data-crm-theme="dark"] .pax-company-hero,
html[data-crm-theme="dark"] .pax-form-hero { background: linear-gradient(135deg, rgba(30, 64, 175, .17), #111827 55%, #121b2b) !important; }
html[data-crm-theme="dark"] .crm-page-content table thead,
html[data-crm-theme="dark"] .crm-page-content table tbody tr:hover,
html[data-crm-theme="dark"] .enterprise-data-row:hover { background: #172033 !important; }
html[data-crm-theme="dark"] .crm-page-content table td { color: #d7dee8 !important; }

/* Responsive system */
@media (max-width: 1365px) {
    :root { --ui-sidebar-width: 236px; }
    .crm-topbar-search { width: min(280px, 25vw) !important; }
    .crm-dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 1024px) {
    .crm-topbar-inner { padding-inline: 18px !important; }
    .page-wrapper, .invoice-page-padding { padding: 20px 18px 34px !important; }
    .crm-user-detail { display: none !important; }
}

@media (max-width: 767px) {
    :root { --ui-topbar-height: 64px; --ui-page-gap: 14px; }
    .crm-sidebar { width: min(310px, calc(100vw - 36px)) !important; }
    .crm-sidebar-brandbar { min-height: 64px !important; }
    .sidebar-scroll { padding-top: 10px !important; }
    .sidebar-link { min-height: 46px !important; font-size: 13.5px !important; }
    .crm-topbar-inner { padding-inline: 10px !important; gap: 8px !important; }
    .crm-page-title { max-width: 42vw !important; font-size: 15px !important; }
    .crm-topbar-actions { gap: 5px !important; }
    .crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button, .crm-mobile-search-button { width: 40px !important; height: 40px !important; min-width: 40px !important; }
    .crm-preferences-button { display: none !important; }
    .crm-user-avatar { width: 34px !important; height: 34px !important; }
    .page-wrapper, .invoice-page-padding { padding: 14px 10px 28px !important; }
    .ui-page-intro, .ent-hero,
    .audit-hero, .roles-hero, .pax-settings-hero, .pax-company-hero, .pax-form-hero { padding: 16px !important; border-radius: 14px !important; }
    .crm-dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .ent-stat-card { min-height: 104px; padding: 14px !important; }
    .crm-page-content .p-6 { padding: 16px !important; }
    .crm-page-content .p-5 { padding: 14px !important; }
    .crm-page-content .p-4 { padding: 13px !important; }
    .crm-page-content table td { font-size: 13px !important; }
    .crm-responsive-table tr { padding: 10px 12px !important; border-radius: 12px !important; }
    .crm-responsive-table td { grid-template-columns: minmax(98px, 34%) minmax(0, 1fr) !important; min-height: 38px !important; padding: 8px 0 !important; }
    .crm-responsive-table td::before { font-size: 10px !important; }
    .crm-mobile-search-panel { padding: 10px !important; }
    .crm-auth-page { padding: 12px !important; }
    .crm-auth-page > .relative.w-full { min-height: 0; border-radius: 18px !important; }
    .crm-auth-page > .relative.w-full > .bg-white { padding: 30px 22px !important; }
}

@media (max-width: 480px) {
    .crm-page-title { max-width: 38vw !important; }
    .crm-user-card { display: flex !important; }
    .crm-dashboard-kpis { grid-template-columns: 1fr !important; }
    .crm-page-content .flex.items-center.justify-between { align-items: flex-start !important; }
    .crm-page-content .enterprise-actions { width: 100%; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-page-content .enterprise-actions > * { width: 100%; }
    .crm-page-content .enterprise-actions a,
    .crm-page-content .enterprise-actions button { width: 100% !important; justify-content: center !important; }
}

@media (prefers-reduced-motion: reduce) {
    .ent-card-hover:hover, .ent-btn-primary:hover, .kanban-card:hover { transform: none !important; }
}

/* Legacy enterprise modules: raise the readability floor without changing workflows. */
.audit-eyebrow, .roles-eyebrow, .pax-eyebrow,
.pax-settings-hero small, .pax-company-hero small, .pax-form-hero small { font-size: 10.5px !important; }
.audit-stat-label, .pax-company-stat span, .pax-stat span { font-size: 11px !important; }
.audit-table-note, .pax-section-header p, .pax-panel-header p { font-size: 11.5px !important; }
.audit-table th, .roles-table th { padding: 12px 13px !important; font-size: 10.5px !important; }
.audit-table td, .roles-table td { padding: 13px !important; font-size: 12.5px !important; }
.roles-note, .pax-alert, .audit-flash, .roles-flash { padding: 12px 14px !important; font-size: 12px !important; }
.pax-settings-nav a { min-height: 38px !important; padding: 0 13px !important; font-size: 11.5px !important; }
.pax-field > span, .pax-logo-field > span, .pax-toggle > span { font-size: 11px !important; }
.pax-card-main strong, .pax-company-title strong, .pax-charge-title strong { font-size: 13px !important; }
.pax-card-main span, .pax-company-title span, .pax-charge-title span { font-size: 11.5px !important; }
.lead-pill { min-height: 24px !important; padding-inline: 9px !important; font-size: 10.5px !important; }
.audit-btn, .roles-btn, .pax-btn { min-height: 40px !important; border-radius: 10px !important; font-size: 12px !important; }

html[data-crm-sidebar="collapsed"] .crm-sidebar-account {
    flex-direction: column;
    gap: 6px;
}
html[data-crm-sidebar="collapsed"] .crm-sidebar-account-copy { display: none !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-signout { display: grid !important; }

@media (max-width: 480px) {
    .crm-user-card { display: none !important; }
}
@media (max-width: 380px) {
    .crm-preferences-button { display: none !important; }
    .crm-page-title { max-width: 34vw !important; }
}

/* Source: crm-enterprise-v3.css */
/*
 * PAX CRM Enterprise Interface V3
 * Structural redesign: navigation, application shell, responsive system,
 * content hierarchy, forms, cards, tables, dashboards and mobile layouts.
 */

:root {
    --ui-primary: #4f46e5;
    --ui-primary-hover: #4338ca;
    --ui-primary-strong: #3730a3;
    --ui-primary-soft: #eef2ff;
    --ui-accent: #06b6d4;
    --ui-success: #059669;
    --ui-warning: #d97706;
    --ui-danger: #dc2626;
    --ui-bg: #f4f6fb;
    --ui-surface: #ffffff;
    --ui-surface-subtle: #f8fafc;
    --ui-surface-muted: #f1f5f9;
    --ui-border: #e2e8f0;
    --ui-border-strong: #cbd5e1;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --ui-muted-2: #94a3b8;
    --ui-sidebar: #07111f;
    --ui-sidebar-2: #0b172a;
    --ui-sidebar-width: 292px;
    --ui-sidebar-collapsed: 88px;
    --ui-topbar-height: 82px;
    --ui-control-height: 44px;
    --ui-page-gap: 22px;
    --ui-radius-sm: 10px;
    --ui-radius: 13px;
    --ui-radius-lg: 18px;
    --ui-radius-xl: 22px;
    --ui-shadow: 0 1px 2px rgba(15, 23, 42, .035), 0 10px 28px rgba(15, 23, 42, .045);
    --ui-shadow-hover: 0 18px 44px rgba(15, 23, 42, .10);
    --ui-shadow-popover: 0 24px 60px rgba(15, 23, 42, .20);
}

html { font-size: 16px !important; }
body {
    background:
        radial-gradient(circle at 78% -12%, rgba(79, 70, 229, .07), transparent 26rem),
        var(--ui-bg) !important;
    color: var(--ui-text) !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
}

/* --------------------------------------------------------------------------
   APPLICATION SHELL
   -------------------------------------------------------------------------- */
.crm-shell {
    min-height: 100dvh !important;
    --crm-sidebar-width: var(--ui-sidebar-width) !important;
}

html[data-crm-sidebar="collapsed"] .crm-shell {
    --crm-sidebar-width: var(--ui-sidebar-collapsed) !important;
}

.crm-sidebar-v3 {
    width: var(--crm-sidebar-width) !important;
    background:
        radial-gradient(circle at 20% 0%, rgba(99, 102, 241, .25), transparent 18rem),
        linear-gradient(180deg, var(--ui-sidebar) 0%, var(--ui-sidebar-2) 48%, #081321 100%) !important;
    border-right: 1px solid rgba(148, 163, 184, .13) !important;
    box-shadow: 16px 0 44px rgba(2, 6, 23, .10) !important;
}

.crm-sidebar-brandbar {
    min-height: 92px !important;
    padding: 18px 16px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border-bottom: 0 !important;
    background: transparent !important;
}

.crm-brand-lockup {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.crm-brand-logo {
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px;
    border-radius: 15px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden;
    color: #fff !important;
    background: linear-gradient(145deg, #6366f1, #4338ca) !important;
    border: 1px solid rgba(255, 255, 255, .20) !important;
    box-shadow: 0 12px 28px rgba(79, 70, 229, .35), inset 0 1px 0 rgba(255,255,255,.18) !important;
    font-size: 14px !important;
    font-weight: 850 !important;
}

.crm-brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px !important; }
.crm-brand-copy { min-width: 0; flex: 1; }
.crm-brand-kicker {
    margin-bottom: 2px;
    color: #818cf8;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.crm-brand-title {
    max-width: 176px !important;
    overflow: hidden;
    color: #f8fafc !important;
    font-size: 15px !important;
    font-weight: 760 !important;
    line-height: 1.25;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-brand-subtitle { display: none !important; }

.crm-sidebar-collapse {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px;
    border: 1px solid rgba(148, 163, 184, .18) !important;
    border-radius: 10px !important;
    color: #a5b4fc !important;
    background: rgba(255, 255, 255, .055) !important;
    box-shadow: none !important;
}
.crm-sidebar-collapse:hover { color: #fff !important; background: rgba(99, 102, 241, .20) !important; border-color: rgba(129, 140, 248, .35) !important; }

.crm-sidebar-workspace {
    min-height: 66px;
    margin: 0 12px 12px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.crm-workspace-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #c7d2fe;
    background: rgba(99, 102, 241, .16);
}
.crm-workspace-mark svg { width: 17px; height: 17px; }
.crm-workspace-copy { min-width: 0; flex: 1; }
.crm-workspace-copy span {
    display: block;
    color: #718198;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
}
.crm-workspace-copy strong {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #e5e7eb;
    font-size: 11.5px;
    font-weight: 680;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-workspace-status {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 2px solid rgba(16, 185, 129, .24);
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .08);
}

.crm-sidebar-quick-actions { padding: 0 12px 8px; }
.crm-sidebar-create {
    min-height: 44px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(129, 140, 248, .30);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 10px 26px rgba(79, 70, 229, .24);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 720;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.crm-sidebar-create:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 30px rgba(79, 70, 229, .32); }
.crm-sidebar-create svg { width: 17px; height: 17px; }
.crm-sidebar-create span { min-width: 0; flex: 1; }
.crm-sidebar-create kbd {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 7px;
    color: #e0e7ff;
    background: rgba(255,255,255,.09);
    font: inherit;
    font-size: 13px;
}

.sidebar-scroll {
    padding: 4px 10px 18px !important;
    scrollbar-color: rgba(148, 163, 184, .30) transparent !important;
}
.crm-nav-group { margin-top: 12px; }
.crm-nav-group:first-child { margin-top: 4px; }
.sidebar-section-label {
    height: 26px;
    margin: 0 9px 5px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    color: #687890 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase;
}
.sidebar-section-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-nav-items { display: grid; gap: 3px; }
.sidebar-link {
    position: relative;
    min-height: 43px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    color: #b8c3d3 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 12.5px !important;
    font-weight: 590 !important;
    line-height: 1.2 !important;
    transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease !important;
}
.sidebar-link::after {
    content: "";
    position: absolute;
    right: 10px;
    width: 5px;
    height: 5px;
    border-radius: 99px;
    background: transparent;
}
.sidebar-link svg {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px;
    color: #8190a6 !important;
    opacity: 1 !important;
}
.sidebar-link:hover {
    color: #f8fafc !important;
    background: rgba(255,255,255,.055) !important;
    border-color: rgba(148, 163, 184, .10) !important;
    transform: translateX(2px) !important;
}
.sidebar-link:hover svg { color: #c7d2fe !important; }
.sidebar-link.active {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(79, 70, 229, .34), rgba(79, 70, 229, .13)) !important;
    border-color: rgba(129, 140, 248, .25) !important;
    box-shadow: inset 3px 0 0 #818cf8, 0 8px 20px rgba(2,6,23,.12) !important;
    font-weight: 700 !important;
}
.sidebar-link.active svg { color: #a5b4fc !important; }
.sidebar-link.active::after { background: #818cf8; box-shadow: 0 0 0 4px rgba(129, 140, 248, .10); }

.sidebar-footer {
    padding: 12px !important;
    border-top: 1px solid rgba(148, 163, 184, .11) !important;
    background: rgba(2, 6, 23, .18) !important;
}
.crm-sidebar-account {
    min-height: 58px;
    padding: 8px !important;
    gap: 10px !important;
    border: 1px solid rgba(148, 163, 184, .15) !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.045) !important;
}
.crm-sidebar-account:hover { background: rgba(255,255,255,.075) !important; border-color: rgba(129, 140, 248, .24) !important; }
.crm-sidebar-account-avatar {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
    border: 2px solid rgba(255,255,255,.12);
    border-radius: 11px !important;
    background: linear-gradient(145deg, #6366f1, #4338ca) !important;
    font-size: 12px !important;
}
.crm-sidebar-account-name { color: #f8fafc !important; font-size: 12px !important; font-weight: 700 !important; }
.crm-sidebar-account-role { margin-top: 2px !important; color: #7f8da1 !important; font-size: 9.5px !important; }
.crm-sidebar-signout { width: 34px !important; height: 34px !important; flex: 0 0 34px !important; border-radius: 10px !important; color: #fda4af !important; }
.crm-sidebar-signout:hover { background: rgba(244,63,94,.13) !important; color: #fecdd3 !important; }
.crm-sidebar-security {
    margin-top: 8px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #58677c;
    font-size: 8.5px;
    font-weight: 650;
    letter-spacing: .035em;
}
.crm-sidebar-security span { width: 6px; height: 6px; border-radius: 99px; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.10); }

/* Collapsed desktop navigation */
html[data-crm-sidebar="collapsed"] .crm-sidebar-brandbar { justify-content: center !important; padding: 16px 12px !important; }
html[data-crm-sidebar="collapsed"] .crm-brand-lockup { flex: 0 0 auto; }
html[data-crm-sidebar="collapsed"] .crm-brand-logo { width: 46px !important; height: 46px !important; flex-basis: 46px; }
html[data-crm-sidebar="collapsed"] .crm-brand-copy,
html[data-crm-sidebar="collapsed"] .crm-sidebar-workspace .crm-workspace-copy,
html[data-crm-sidebar="collapsed"] .crm-sidebar-workspace .crm-workspace-status,
html[data-crm-sidebar="collapsed"] .crm-sidebar-create span,
html[data-crm-sidebar="collapsed"] .crm-sidebar-create kbd,
html[data-crm-sidebar="collapsed"] .sidebar-section-label,
html[data-crm-sidebar="collapsed"] .sidebar-link-label,
html[data-crm-sidebar="collapsed"] .crm-sidebar-account-copy,
html[data-crm-sidebar="collapsed"] .crm-sidebar-security { display: none !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-collapse {
    position: absolute !important;
    top: 70px !important;
    right: -14px !important;
    color: #475569 !important;
    background: #fff !important;
    border-color: #dbe3ee !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.16) !important;
    transform: rotate(180deg);
}
html[data-crm-sidebar="collapsed"] .crm-sidebar-workspace { justify-content: center; margin-inline: 12px; padding: 10px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-quick-actions { padding-inline: 12px; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-create { justify-content: center; padding: 0 !important; }
html[data-crm-sidebar="collapsed"] .sidebar-scroll { padding-inline: 12px !important; }
html[data-crm-sidebar="collapsed"] .crm-nav-group { margin-top: 8px; }
html[data-crm-sidebar="collapsed"] .sidebar-link { justify-content: center !important; padding: 0 !important; }
html[data-crm-sidebar="collapsed"] .sidebar-link::after { right: 5px; }
html[data-crm-sidebar="collapsed"] .sidebar-link:hover { transform: none !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-account { justify-content: center !important; padding: 8px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-signout { display: none !important; }

/* --------------------------------------------------------------------------
   TOP BAR
   -------------------------------------------------------------------------- */
.crm-main {
    width: calc(100% - var(--crm-sidebar-width)) !important;
    margin-left: var(--crm-sidebar-width) !important;
    padding-top: var(--ui-topbar-height) !important;
    transition: width .22s ease, margin-left .22s ease !important;
}
.crm-topbar {
    left: var(--crm-sidebar-width) !important;
    height: var(--ui-topbar-height) !important;
    background: rgba(255,255,255,.88) !important;
    border-bottom: 1px solid rgba(203, 213, 225, .78) !important;
    box-shadow: 0 8px 28px rgba(15,23,42,.025) !important;
    backdrop-filter: blur(20px) saturate(1.25) !important;
    transition: left .22s ease !important;
}
.crm-topbar-inner {
    height: 100% !important;
    padding: 0 28px !important;
    gap: 22px !important;
}
.crm-title-zone { min-width: 0; display: flex !important; align-items: center !important; gap: 13px !important; }
.crm-page-heading { min-width: 0; }
.crm-page-breadcrumb {
    height: 18px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 9.5px;
    font-weight: 650;
    white-space: nowrap;
}
.crm-page-breadcrumb svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.crm-page-breadcrumb strong { overflow: hidden; color: #64748b; font-weight: 700; text-overflow: ellipsis; }
.crm-title-row { min-width: 0; gap: 10px !important; }
.crm-page-title {
    max-width: min(34vw, 520px) !important;
    overflow: hidden;
    color: #0f172a !important;
    font-size: 19px !important;
    font-weight: 760 !important;
    line-height: 1.25 !important;
    letter-spacing: -.03em !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-scope-pill {
    min-height: 25px !important;
    max-width: 190px;
    padding: 0 9px !important;
    gap: 7px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 999px !important;
    color: #475569 !important;
    background: #f8fafc !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
}
.crm-scope-icon { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 99px; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.11); }
.crm-topbar-actions { gap: 8px !important; }
.crm-topbar-search-wrap { position: relative; }
.crm-search-icon { position: absolute; z-index: 1; left: 14px; top: 50%; display: grid; place-items: center; color: #94a3b8; transform: translateY(-50%); pointer-events: none; }
.crm-topbar-search {
    width: min(360px, 27vw) !important;
    height: 44px !important;
    padding: 0 42px 0 42px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 12px !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    box-shadow: inset 0 1px 1px rgba(15,23,42,.015) !important;
    font-size: 12.5px !important;
    transition: border .15s ease, box-shadow .15s ease, background .15s ease !important;
}
.crm-topbar-search:focus { border-color: #818cf8 !important; background: #fff !important; box-shadow: 0 0 0 4px rgba(99,102,241,.11) !important; }
.crm-search-shortcut {
    position: absolute;
    right: 11px;
    top: 50%;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    color: #94a3b8;
    background: #fff;
    font: inherit;
    font-size: 11px;
    transform: translateY(-50%);
}
.crm-topbar-primary-action {
    height: 44px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #4338ca;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 8px 20px rgba(79,70,229,.20);
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}
.crm-topbar-primary-action:hover { filter: brightness(1.05); box-shadow: 0 12px 25px rgba(79,70,229,.27); }
.crm-topbar-primary-action span:first-child { font-size: 18px; font-weight: 400; line-height: 1; }
.crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button, .crm-mobile-search-button {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 12px !important;
    color: #64748b !important;
    background: #fff !important;
}
.crm-icon-button:hover, .crm-mobile-menu-button:hover, .crm-preferences-button:hover, .crm-mobile-search-button:hover { color: #4338ca !important; border-color: #c7d2fe !important; background: #eef2ff !important; }
.crm-user-card {
    min-width: 0;
    min-height: 48px !important;
    padding: 4px 7px 4px 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    color: #0f172a !important;
    background: #fff !important;
    text-decoration: none;
}
.crm-user-card:hover { border-color: #c7d2fe !important; background: #fafaff !important; box-shadow: 0 8px 22px rgba(15,23,42,.055) !important; }
.crm-user-avatar { width: 38px !important; height: 38px !important; flex: 0 0 38px; border-radius: 11px !important; background: linear-gradient(145deg,#6366f1,#4338ca) !important; font-size: 11px !important; }
.crm-user-copy { min-width: 0; width: 142px; }
.crm-user-name { overflow: hidden; color: #0f172a !important; font-size: 11.5px !important; font-weight: 750 !important; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.crm-user-meta { margin-top: 2px; display: flex; align-items: center; gap: 5px; overflow: hidden; color: #64748b; font-size: 9px; line-height: 1.2; }
.crm-user-meta span { flex: 0 0 auto; color: #4f46e5; font-weight: 750; }
.crm-user-meta small { min-width: 0; overflow: hidden; font-size: inherit; text-overflow: ellipsis; white-space: nowrap; }
.crm-user-chevron { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.crm-notification-dropdown { width: min(420px, calc(100vw - 24px)) !important; overflow: hidden; border: 1px solid #dbe3ee !important; border-radius: 16px !important; box-shadow: var(--ui-shadow-popover) !important; }
.crm-notification-head { min-height: 70px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.crm-notification-title { color: #0f172a; font-size: 13px; font-weight: 780; }
.crm-notification-subtitle { margin-top: 2px; color: #64748b; font-size: 10px; }
.crm-notification-readall { color: #4f46e5; font-size: 10px; font-weight: 720; }
.crm-notification-footer { padding: 11px; border-top: 1px solid #e2e8f0; background: #f8fafc; text-align: center; }
.crm-notification-footer a { color: #4f46e5; font-size: 10.5px; font-weight: 720; }

/* --------------------------------------------------------------------------
   WORKSPACE CONTENT
   -------------------------------------------------------------------------- */
.page-wrapper, .invoice-page-padding {
    width: 100% !important;
    max-width: 1760px !important;
    margin-inline: auto !important;
    padding: 28px 30px 48px !important;
}
.crm-page-wrapper, .crm-page-content { width: 100%; min-width: 0; }
.crm-page-content { color: #334155; }
.crm-page-content .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: var(--ui-page-gap) !important; }
.crm-page-content h1, .crm-page-content h2, .crm-page-content h3 { color: #0f172a; letter-spacing: -.025em; }
.crm-page-content h1 { font-weight: 780 !important; }
.crm-page-content h2, .crm-page-content h3 { font-weight: 730 !important; }
.crm-page-content p { line-height: 1.65 !important; }

/* Raise the readability floor throughout legacy screens. */
.crm-page-content .text-\[8px\], .crm-page-content .text-\[8\.5px\],
.crm-page-content .text-\[9px\], .crm-page-content .text-\[9\.5px\] { font-size: 11px !important; line-height: 1.45 !important; }
.crm-page-content .text-\[10px\], .crm-page-content .text-\[10\.5px\] { font-size: 12px !important; line-height: 1.5 !important; }
.crm-page-content .text-\[11px\], .crm-page-content .text-\[11\.5px\] { font-size: 13px !important; line-height: 1.55 !important; }
.crm-page-content .text-\[12px\], .crm-page-content .text-\[12\.5px\] { font-size: 13.5px !important; line-height: 1.55 !important; }
.crm-page-content .text-\[13px\], .crm-page-content .text-\[13\.5px\], .crm-page-content .text-\[14px\] { font-size: 14px !important; }
.crm-page-content .text-\[18px\], .crm-page-content .text-\[20px\], .crm-page-content .text-\[21px\], .crm-page-content .text-\[22px\] { font-size: 22px !important; line-height: 1.25 !important; }
.crm-page-content .text-\[24px\], .crm-page-content .text-\[25px\], .crm-page-content .text-\[26px\], .crm-page-content .text-\[28px\] { font-size: 26px !important; line-height: 1.18 !important; }

/* Enterprise page intros */
.ui-page-intro, .audit-hero, .roles-hero, .pax-settings-hero, .pax-company-hero, .pax-form-hero {
    position: relative !important;
    overflow: hidden !important;
    padding: 24px 26px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    color: #0f172a !important;
    background:
        radial-gradient(circle at 92% 10%, rgba(99,102,241,.12), transparent 17rem),
        linear-gradient(135deg, #fff, #f8faff) !important;
    box-shadow: var(--ui-shadow) !important;
}
.ui-page-intro::after, .audit-hero::after, .roles-hero::after, .pax-settings-hero::after, .pax-company-hero::after, .pax-form-hero::after {
    content: "";
    position: absolute;
    top: -34px;
    right: -30px;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(99,102,241,.11);
    border-radius: 30px;
    transform: rotate(20deg);
    pointer-events: none;
}

/* Dashboard's lead hero intentionally uses a richer dark surface. */
.crm-dashboard .ent-hero {
    min-height: 132px;
    padding: 26px 28px !important;
    border: 1px solid rgba(129,140,248,.24) !important;
    border-radius: 22px !important;
    color: #fff !important;
    background:
        radial-gradient(circle at 88% -20%, rgba(6,182,212,.30), transparent 20rem),
        radial-gradient(circle at 20% 120%, rgba(99,102,241,.28), transparent 22rem),
        linear-gradient(135deg, #101a34 0%, #172554 52%, #312e81 100%) !important;
    box-shadow: 0 18px 50px rgba(30,41,89,.18) !important;
}
.crm-dashboard .ent-hero h1 { color: #fff !important; font-size: 25px !important; }
.crm-dashboard .ent-hero p { color: rgba(255,255,255,.68) !important; }
.crm-dashboard .ent-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to left, #000, transparent 70%);
    pointer-events: none;
}

/* Cards and panels */
.ent-card, .ent-stat-card, .audit-panel, .roles-panel, .pax-panel,
.crm-page-content .bg-white.rounded-xl,
.crm-page-content .bg-white.rounded-2xl,
.crm-page-content section.bg-white,
.crm-page-content div[class*="shadow-sm"][class*="border"][class*="bg-white"] {
    border-color: #e2e8f0 !important;
    border-radius: 17px !important;
    background: #fff !important;
    box-shadow: var(--ui-shadow) !important;
}
.ent-card, .audit-panel, .roles-panel, .pax-panel { overflow: hidden; }
.ent-card-hover, .crm-page-content a.ent-card, .crm-page-content .hover\:shadow-md { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important; }
.ent-card-hover:hover, .crm-page-content a.ent-card:hover { transform: translateY(-2px) !important; border-color: #c7d2fe !important; box-shadow: var(--ui-shadow-hover) !important; }
.ent-stat-card {
    position: relative;
    min-height: 132px !important;
    padding: 19px !important;
    overflow: hidden;
}
.ent-stat-card::after {
    content: "";
    position: absolute;
    right: -25px;
    bottom: -40px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(99,102,241,.035);
    pointer-events: none;
}
.ent-stat-card > div { position: relative; z-index: 1; }
.crm-dashboard-kpis { gap: 14px !important; }
.crm-page-content .rounded-2xl { border-radius: 16px !important; }
.crm-page-content .rounded-xl { border-radius: 13px !important; }

/* Buttons */
.ent-btn-primary, .enterprise-primary, .pax-btn-primary,
.crm-page-content button[type="submit"]:not(.crm-notification-readall):not(.ui-filter-toggle),
.crm-page-content a[class*="bg-blue-600"], .crm-page-content a[class*="bg-indigo-600"] {
    min-height: 42px !important;
    padding-inline: 15px !important;
    border: 1px solid #4338ca !important;
    border-radius: 11px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    box-shadow: 0 7px 17px rgba(79,70,229,.16) !important;
    font-size: 12px !important;
    font-weight: 720 !important;
}
.ent-btn-primary:hover, .enterprise-primary:hover, .pax-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.crm-page-content button, .crm-page-content a[class*="inline-flex"], .audit-btn, .roles-btn, .pax-btn {
    border-radius: 11px !important;
}

/* Forms */
.crm-page-content label, .pax-field > span, .pax-logo-field > span, .pax-toggle > span {
    color: #334155 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
}
.crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.crm-page-content select, .crm-page-content textarea,
.pax-field input, .pax-field select, .pax-field textarea {
    min-height: 44px !important;
    border: 1px solid #d7e0eb !important;
    border-radius: 11px !important;
    color: #0f172a !important;
    background: #fff !important;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.02) !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}
.crm-page-content textarea { min-height: 112px !important; padding-top: 11px !important; }
.crm-page-content input:focus, .crm-page-content select:focus, .crm-page-content textarea:focus,
.pax-field input:focus, .pax-field select:focus, .pax-field textarea:focus {
    border-color: #818cf8 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,.11) !important;
    outline: none !important;
}
.crm-page-content input::placeholder, .crm-page-content textarea::placeholder { color: #94a3b8 !important; }
.crm-filter-panel { padding: 17px !important; border-radius: 16px !important; }
.ui-filter-toggle { min-height: 40px !important; border-radius: 10px !important; font-size: 11.5px !important; }

/* Tables */
.crm-responsive-table, .crm-page-content .overflow-x-auto {
    border-radius: 16px !important;
    scrollbar-color: #cbd5e1 transparent;
}
.crm-page-content table { width: 100%; border-collapse: separate !important; border-spacing: 0 !important; }
.crm-page-content table thead { background: #f8fafc !important; }
.crm-page-content table th {
    padding: 13px 15px !important;
    border-bottom: 1px solid #dfe7f0 !important;
    color: #64748b !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    letter-spacing: .075em !important;
    text-transform: uppercase;
}
.crm-page-content table td {
    padding: 15px !important;
    border-bottom-color: #edf1f6 !important;
    color: #334155 !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
}
.crm-page-content table tbody tr { transition: background-color .14s ease, box-shadow .14s ease; }
.crm-page-content table tbody tr:hover { background: #fafbff !important; }
.enterprise-data-head { padding: 13px 15px !important; color: #64748b !important; font-size: 10px !important; }
.enterprise-data-row { padding: 16px 15px !important; border-color: #edf1f6 !important; }
.enterprise-data-row:hover { background: #fafbff !important; }
.ent-badge, .lead-pill, .crm-page-content span[class*="rounded-full"] { min-height: 25px !important; padding-inline: 9px !important; font-size: 10.5px !important; font-weight: 700 !important; }

/* Kanban */
.kanban-board { gap: 16px !important; padding-bottom: 12px !important; }
.kanban-column { min-width: 316px !important; width: 316px !important; border: 1px solid #e2e8f0 !important; border-radius: 17px !important; background: #f8fafc !important; }
.kanban-card { border: 1px solid #e2e8f0 !important; border-radius: 14px !important; background: #fff !important; box-shadow: 0 3px 12px rgba(15,23,42,.045) !important; }
.kanban-card:hover { transform: translateY(-2px) !important; border-color: #c7d2fe !important; box-shadow: var(--ui-shadow-hover) !important; }

/* Drawers */
.crm-preferences-drawer { width: min(420px, 100vw) !important; background: #fff !important; }
.crm-drawer-header { min-height: 78px !important; padding: 0 22px !important; border-bottom-color: #e2e8f0 !important; }
.crm-drawer-body { padding: 22px !important; }
.crm-setting-group { padding: 20px 0 !important; }
.crm-setting-title { color: #0f172a !important; font-size: 13px !important; }
.crm-setting-description { color: #64748b !important; font-size: 11px !important; }
.crm-segmented { padding: 4px !important; border-radius: 12px !important; background: #f1f5f9 !important; }
.crm-segmented button { min-height: 38px !important; border-radius: 9px !important; font-size: 11px !important; }
.crm-segmented button[aria-pressed="true"] { color: #3730a3 !important; background: #fff !important; box-shadow: 0 3px 10px rgba(15,23,42,.08) !important; }

/* Authentication */
.crm-auth-page {
    padding: 28px !important;
    background:
        radial-gradient(circle at 12% 10%, rgba(79,70,229,.14), transparent 26rem),
        radial-gradient(circle at 92% 84%, rgba(6,182,212,.11), transparent 22rem),
        #eef2f8 !important;
}
.crm-auth-page > .relative.w-full {
    max-width: 1120px !important;
    min-height: 660px !important;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.7) !important;
    border-radius: 28px !important;
    box-shadow: 0 36px 90px rgba(15,23,42,.20) !important;
}
.crm-auth-page > .relative.w-full > .bg-white { padding: 54px !important; }
.crm-auth-page input:not([type="checkbox"]) { height: 50px !important; border-radius: 12px !important; font-size: 14px !important; }
.crm-auth-page .ent-btn-primary { height: 50px !important; font-size: 13px !important; }

/* --------------------------------------------------------------------------
   DARK THEME
   -------------------------------------------------------------------------- */
html[data-crm-theme="dark"] {
    --ui-bg: #07101d;
    --ui-surface: #101a2b;
    --ui-surface-subtle: #152136;
    --ui-surface-muted: #1b2940;
    --ui-border: #26364d;
    --ui-border-strong: #3a4b65;
    --ui-text: #edf2f8;
    --ui-muted: #a4b1c3;
}
html[data-crm-theme="dark"] body { background: radial-gradient(circle at 80% -10%, rgba(79,70,229,.12), transparent 30rem), #07101d !important; }
html[data-crm-theme="dark"] .crm-topbar { background: rgba(16,26,43,.90) !important; border-bottom-color: #26364d !important; }
html[data-crm-theme="dark"] .crm-page-title, html[data-crm-theme="dark"] .crm-user-name, html[data-crm-theme="dark"] .crm-page-content h1, html[data-crm-theme="dark"] .crm-page-content h2, html[data-crm-theme="dark"] .crm-page-content h3 { color: #f1f5f9 !important; }
html[data-crm-theme="dark"] .crm-page-breadcrumb strong, html[data-crm-theme="dark"] .crm-user-meta, html[data-crm-theme="dark"] .crm-page-content { color: #a4b1c3 !important; }
html[data-crm-theme="dark"] .crm-topbar-search, html[data-crm-theme="dark"] .crm-user-card, html[data-crm-theme="dark"] .crm-icon-button, html[data-crm-theme="dark"] .crm-preferences-button, html[data-crm-theme="dark"] .crm-mobile-search-button { color: #dbe6f3 !important; background: #152136 !important; border-color: #2b3b54 !important; }
html[data-crm-theme="dark"] .crm-scope-pill { color: #cbd5e1 !important; background: #152136 !important; border-color: #2b3b54 !important; }
html[data-crm-theme="dark"] .ui-page-intro, html[data-crm-theme="dark"] .audit-hero, html[data-crm-theme="dark"] .roles-hero, html[data-crm-theme="dark"] .pax-settings-hero, html[data-crm-theme="dark"] .pax-company-hero, html[data-crm-theme="dark"] .pax-form-hero,
html[data-crm-theme="dark"] .ent-card, html[data-crm-theme="dark"] .ent-stat-card, html[data-crm-theme="dark"] .audit-panel, html[data-crm-theme="dark"] .roles-panel, html[data-crm-theme="dark"] .pax-panel,
html[data-crm-theme="dark"] .crm-page-content .bg-white.rounded-xl, html[data-crm-theme="dark"] .crm-page-content .bg-white.rounded-2xl, html[data-crm-theme="dark"] .crm-page-content section.bg-white { color: #dce5ef !important; background: #101a2b !important; border-color: #26364d !important; }
html[data-crm-theme="dark"] .crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]), html[data-crm-theme="dark"] .crm-page-content select, html[data-crm-theme="dark"] .crm-page-content textarea { color: #edf2f8 !important; background: #101a2b !important; border-color: #30415a !important; }
html[data-crm-theme="dark"] .crm-page-content table thead, html[data-crm-theme="dark"] .crm-page-content table tbody tr:hover, html[data-crm-theme="dark"] .enterprise-data-row:hover { background: #152136 !important; }
html[data-crm-theme="dark"] .crm-page-content table th { color: #9fb0c5 !important; border-bottom-color: #2b3b54 !important; }
html[data-crm-theme="dark"] .crm-page-content table td { color: #d7e0eb !important; border-bottom-color: #223149 !important; }
html[data-crm-theme="dark"] .crm-notification-head, html[data-crm-theme="dark"] .crm-notification-footer, html[data-crm-theme="dark"] .crm-preferences-drawer { background: #101a2b !important; border-color: #26364d !important; }

/* --------------------------------------------------------------------------
   RESPONSIVE SYSTEM
   -------------------------------------------------------------------------- */
@media (max-width: 1450px) {
    :root { --ui-sidebar-width: 272px; }
    .crm-topbar-inner { padding-inline: 22px !important; }
    .crm-topbar-search { width: min(300px, 23vw) !important; }
    .crm-user-copy { width: 118px; }
    .crm-dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 1180px) {
    .crm-topbar-search { width: 250px !important; }
    .crm-user-copy, .crm-user-chevron { display: none !important; }
    .crm-user-card { padding: 4px !important; border-color: transparent !important; }
    .crm-topbar-primary-action { padding-inline: 12px; }
}

@media (max-width: 1023px) {
    :root { --ui-topbar-height: 74px; }
    .crm-shell { --crm-sidebar-width: 0px !important; }
    .crm-sidebar-v3 {
        width: min(326px, calc(100vw - 34px)) !important;
        transform: translateX(-104%) !important;
        box-shadow: 24px 0 60px rgba(2,6,23,.34) !important;
        transition: transform .24s ease !important;
    }
    html[data-crm-mobile-nav="open"] .crm-sidebar-v3 { transform: translateX(0) !important; }
    .crm-sidebar-collapse { display: none !important; }
    .crm-main { width: 100% !important; margin-left: 0 !important; }
    .crm-topbar { left: 0 !important; }
    .crm-mobile-menu-button { display: inline-flex !important; }
    .crm-topbar-inner { padding-inline: 18px !important; }
    .crm-topbar-search-wrap { display: none !important; }
    .crm-mobile-search-button { display: inline-flex !important; }
    .page-wrapper, .invoice-page-padding { padding: 24px 20px 40px !important; }
    .crm-mobile-search-panel { top: var(--ui-topbar-height) !important; min-height: 68px !important; padding: 11px 18px !important; border-bottom-color: #e2e8f0 !important; }
    .crm-mobile-search-panel input { height: 44px !important; border-radius: 11px !important; font-size: 13px !important; }
    .crm-mobile-backdrop { background: rgba(2,6,23,.58) !important; backdrop-filter: blur(3px); }
}

@media (max-width: 767px) {
    :root { --ui-topbar-height: 68px; --ui-page-gap: 16px; }
    .crm-sidebar-brandbar { min-height: 82px !important; }
    .crm-sidebar-v3 { width: min(318px, calc(100vw - 22px)) !important; }
    .crm-sidebar-workspace { margin-bottom: 10px; }
    .sidebar-link { min-height: 46px !important; font-size: 13px !important; }
    .crm-topbar-inner { padding-inline: 11px !important; gap: 8px !important; }
    .crm-title-zone { gap: 8px !important; }
    .crm-page-breadcrumb { display: none; }
    .crm-page-title { max-width: 34vw !important; font-size: 17px !important; }
    .crm-scope-pill { display: none !important; }
    .crm-topbar-actions { gap: 5px !important; }
    .crm-icon-button, .crm-mobile-menu-button, .crm-preferences-button, .crm-mobile-search-button { width: 40px !important; height: 40px !important; min-width: 40px !important; border-radius: 10px !important; }
    .crm-preferences-button { display: none !important; }
    .crm-topbar-primary-action { height: 40px; padding: 0 11px; border-radius: 10px; }
    .crm-topbar-primary-action span:last-child { display: none; }
    .crm-topbar-primary-action span:first-child { font-size: 20px; }
    .crm-user-card { min-height: 40px !important; padding: 2px !important; display: flex !important; border-color: transparent !important; background: transparent !important; }
    .crm-user-avatar { width: 36px !important; height: 36px !important; flex-basis: 36px; }
    .page-wrapper, .invoice-page-padding { padding: 16px 11px 32px !important; }
    .ui-page-intro, .audit-hero, .roles-hero, .pax-settings-hero, .pax-company-hero, .pax-form-hero { padding: 18px !important; border-radius: 16px !important; }
    .crm-dashboard .ent-hero { min-height: 0; padding: 20px !important; border-radius: 18px !important; }
    .crm-dashboard .ent-hero h1 { font-size: 22px !important; }
    .crm-dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .ent-stat-card { min-height: 118px !important; padding: 15px !important; }
    .crm-page-content .p-6 { padding: 18px !important; }
    .crm-page-content .p-5 { padding: 16px !important; }
    .crm-page-content .p-4 { padding: 14px !important; }
    .crm-responsive-table tr { padding: 11px 13px !important; border: 1px solid #e2e8f0 !important; border-radius: 14px !important; background: #fff !important; box-shadow: 0 4px 14px rgba(15,23,42,.035); }
    .crm-responsive-table td { grid-template-columns: minmax(105px, 34%) minmax(0, 1fr) !important; min-height: 40px !important; padding: 8px 0 !important; font-size: 12.5px !important; }
    .crm-responsive-table td::before { font-size: 9.5px !important; font-weight: 800 !important; letter-spacing: .04em; }
    .kanban-column { min-width: min(304px, calc(100vw - 42px)) !important; width: min(304px, calc(100vw - 42px)) !important; }
    .crm-notification-dropdown { position: fixed !important; top: 62px !important; right: 8px !important; left: 8px !important; width: auto !important; }
    .crm-auth-page { padding: 12px !important; }
    .crm-auth-page > .relative.w-full { min-height: 0 !important; border-radius: 20px !important; }
    .crm-auth-page > .relative.w-full > .bg-white { padding: 32px 22px !important; }
}

@media (max-width: 520px) {
    .crm-page-title { max-width: 30vw !important; font-size: 16px !important; }
    .crm-dashboard-kpis { grid-template-columns: 1fr !important; }
    .ent-stat-card { min-height: 108px !important; }
    .crm-page-content .enterprise-actions { width: 100%; display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; }
    .crm-page-content .enterprise-actions > * { width: 100% !important; justify-content: center !important; }
    .crm-page-content .flex.items-center.justify-between { align-items: flex-start !important; }
}

@media (max-width: 390px) {
    .crm-page-title { max-width: 27vw !important; }
    .crm-topbar-primary-action { display: none !important; }
    .crm-user-card { display: flex !important; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-link, .crm-sidebar-create, .ent-card-hover, .kanban-card { transition: none !important; }
    .sidebar-link:hover, .crm-sidebar-create:hover, .ent-card-hover:hover, .kanban-card:hover { transform: none !important; }
}

/* Source: crm-enterprise-v4.css */
/*
 * PAX CRM Enterprise Interface V4
 * Product-level redesign: calm enterprise navigation, readable pages,
 * command centre, quick actions, responsive mobile navigation and notes.
 */
:root {
    --v4-primary: #2457d6;
    --v4-primary-hover: #1d46b5;
    --v4-primary-soft: #edf3ff;
    --v4-primary-border: #c9d9ff;
    --v4-ink: #172033;
    --v4-heading: #111827;
    --v4-muted: #667085;
    --v4-subtle: #98a2b3;
    --v4-border: #e3e8ef;
    --v4-border-strong: #d0d7e2;
    --v4-canvas: #f5f7fa;
    --v4-surface: #ffffff;
    --v4-surface-soft: #f8fafc;
    --v4-sidebar: #ffffff;
    --v4-sidebar-width: 272px;
    --v4-sidebar-collapsed: 80px;
    --v4-topbar-height: 76px;
    --v4-success: #067647;
    --v4-warning: #b54708;
    --v4-danger: #b42318;
    --v4-shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --v4-shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .03);
    --v4-shadow-md: 0 12px 32px rgba(16, 24, 40, .10);
    --v4-shadow-lg: 0 24px 70px rgba(16, 24, 40, .18);
}

html { font-size: 16px !important; background: var(--v4-canvas) !important; }
body.crm-app-body {
    background: var(--v4-canvas) !important;
    color: var(--v4-ink) !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
}
body.crm-auth-body { background: #eef2f6 !important; }

/* Remove the previous visual noise and enforce a consistent shell. */
.crm-shell { --crm-sidebar-width: var(--v4-sidebar-width) !important; min-height: 100dvh !important; }
html[data-crm-sidebar="collapsed"] .crm-shell { --crm-sidebar-width: var(--v4-sidebar-collapsed) !important; }

.crm-sidebar-v3 {
    width: var(--crm-sidebar-width) !important;
    background: var(--v4-sidebar) !important;
    border-right: 1px solid var(--v4-border) !important;
    box-shadow: none !important;
}
.crm-sidebar-brandbar {
    min-height: 84px !important;
    padding: 16px 14px !important;
    border-bottom: 1px solid var(--v4-border) !important;
    background: #fff !important;
}
.crm-brand-lockup { gap: 11px !important; }
.crm-brand-logo {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: #172033 !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 13px !important;
}
.crm-brand-logo img { padding: 5px !important; }
.crm-brand-kicker { color: #7d89a0 !important; font-size: 9px !important; letter-spacing: .13em !important; }
.crm-brand-title { max-width: 162px !important; color: var(--v4-heading) !important; font-size: 14px !important; font-weight: 750 !important; }
.crm-sidebar-collapse {
    width: 32px !important;
    height: 32px !important;
    border: 1px solid var(--v4-border) !important;
    color: #667085 !important;
    background: #fff !important;
}
.crm-sidebar-collapse:hover { color: var(--v4-primary) !important; border-color: var(--v4-primary-border) !important; background: var(--v4-primary-soft) !important; }

.crm-sidebar-workspace {
    min-height: 58px !important;
    margin: 12px 12px 8px !important;
    padding: 10px 11px !important;
    border: 1px solid var(--v4-border) !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
}
.crm-workspace-mark { color: #344054 !important; background: #fff !important; border: 1px solid var(--v4-border) !important; }
.crm-workspace-copy span { color: #98a2b3 !important; font-size: 9px !important; }
.crm-workspace-copy strong { color: #344054 !important; font-size: 11.5px !important; }
.crm-workspace-status { border-color: #d1fadf !important; background: #12b76a !important; box-shadow: 0 0 0 3px #ecfdf3 !important; }

.crm-sidebar-quick-actions { padding: 4px 12px 7px !important; }
.crm-sidebar-create {
    min-height: 42px !important;
    border: 0 !important;
    border-radius: 10px !important;
    color: #fff !important;
    background: #172033 !important;
    box-shadow: none !important;
    font-size: 12px !important;
}
.crm-sidebar-create:hover { transform: none !important; background: #263249 !important; box-shadow: none !important; }
.crm-sidebar-create kbd { background: rgba(255,255,255,.12) !important; border-color: rgba(255,255,255,.12) !important; }

.sidebar-scroll { padding: 8px 10px 16px !important; scrollbar-color: #d0d5dd transparent !important; }
.crm-nav-group { margin-top: 15px !important; }
.crm-nav-group:first-child { margin-top: 2px !important; }
.sidebar-section-label {
    height: 25px !important;
    margin: 0 10px 5px !important;
    color: #98a2b3 !important;
    font-size: 9px !important;
    font-weight: 750 !important;
    letter-spacing: .12em !important;
}
.crm-nav-items { gap: 2px !important; }
.sidebar-link {
    min-height: 41px !important;
    padding: 0 11px !important;
    gap: 11px !important;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    color: #475467 !important;
    background: transparent !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
}
.sidebar-link svg { width: 18px !important; height: 18px !important; color: #7a8699 !important; opacity: 1 !important; }
.sidebar-link:hover { color: #1d2939 !important; background: #f2f4f7 !important; border-color: transparent !important; }
.sidebar-link.active {
    color: #1849a9 !important;
    background: #edf3ff !important;
    border-color: #dbe7ff !important;
    box-shadow: none !important;
}
.sidebar-link.active::before { display: none !important; }
.sidebar-link.active svg { color: var(--v4-primary) !important; }

.sidebar-footer { padding: 10px 12px 12px !important; border-top: 1px solid var(--v4-border) !important; background: #fff !important; }
.crm-sidebar-account { min-height: 54px !important; padding: 7px !important; border: 1px solid var(--v4-border) !important; border-radius: 12px !important; background: #f8fafc !important; }
.crm-sidebar-account-avatar { background: #172033 !important; color: #fff !important; }
.crm-sidebar-account-name { color: #1d2939 !important; font-size: 12px !important; }
.crm-sidebar-account-role { color: #667085 !important; font-size: 10px !important; }
.crm-sidebar-signout { color: #667085 !important; background: #fff !important; border: 1px solid var(--v4-border) !important; }
.crm-sidebar-signout:hover { color: var(--v4-danger) !important; background: #fff5f4 !important; border-color: #fecdca !important; }
.crm-sidebar-security { color: #98a2b3 !important; font-size: 9px !important; }
.crm-sidebar-security span { background: #12b76a !important; }

html[data-crm-sidebar="collapsed"] .crm-sidebar .crm-sidebar-workspace,
html[data-crm-sidebar="collapsed"] .crm-sidebar .crm-sidebar-quick-actions,
html[data-crm-sidebar="collapsed"] .crm-sidebar .crm-sidebar-security { display: none !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-brandbar { padding: 16px 18px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar-collapse { top: 25px !important; right: -14px !important; }
html[data-crm-sidebar="collapsed"] .crm-sidebar .sidebar-link { width: 44px !important; min-height: 42px !important; margin-inline: auto !important; padding: 0 !important; }

/* Main frame and top bar. */
.crm-main { margin-left: var(--crm-sidebar-width) !important; background: var(--v4-canvas) !important; }
.crm-topbar {
    min-height: var(--v4-topbar-height) !important;
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid var(--v4-border) !important;
    box-shadow: none !important;
    backdrop-filter: blur(16px);
}
.crm-topbar-inner { min-height: var(--v4-topbar-height) !important; padding: 0 26px !important; gap: 18px !important; }
.crm-page-breadcrumb { color: #98a2b3 !important; font-size: 10px !important; }
.crm-page-breadcrumb strong { color: #667085 !important; }
.crm-page-title { color: #101828 !important; font-size: 21px !important; font-weight: 760 !important; letter-spacing: -.025em !important; }
.crm-scope-pill { min-height: 25px !important; border-color: var(--v4-border) !important; color: #475467 !important; background: #f8fafc !important; font-size: 10px !important; }
.crm-scope-icon { background: #12b76a !important; box-shadow: 0 0 0 3px #ecfdf3 !important; }
.crm-topbar-actions { gap: 8px !important; }
.crm-topbar-search-wrap { width: min(25vw, 290px) !important; }
.crm-topbar-search { height: 40px !important; border-radius: 10px !important; border-color: var(--v4-border) !important; background: #f8fafc !important; color: #344054 !important; font-size: 12px !important; }
.crm-topbar-search:focus { border-color: #84adff !important; background: #fff !important; box-shadow: 0 0 0 3px #edf3ff !important; }
.crm-search-shortcut { color: #98a2b3 !important; background: #fff !important; border-color: var(--v4-border) !important; }
.crm-icon-button, .crm-preferences-button, .crm-mobile-search-button {
    width: 40px !important; height: 40px !important; border-radius: 10px !important;
    border: 1px solid var(--v4-border) !important; color: #475467 !important; background: #fff !important;
}
.crm-icon-button:hover, .crm-preferences-button:hover, .crm-mobile-search-button:hover { color: var(--v4-primary) !important; border-color: var(--v4-primary-border) !important; background: var(--v4-primary-soft) !important; }
.crm-topbar-primary-action {
    min-height: 40px !important; padding: 0 14px !important; border: 1px solid #172033 !important; border-radius: 10px !important;
    color: #fff !important; background: #172033 !important; box-shadow: none !important; font-size: 12px !important;
}
.crm-topbar-primary-action:hover { background: #263249 !important; border-color: #263249 !important; transform: none !important; }
.crm-topbar-primary-action > svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.crm-user-card { min-height: 46px !important; padding: 5px 8px 5px 5px !important; border: 1px solid var(--v4-border) !important; border-radius: 12px !important; background: #fff !important; }
.crm-user-card:hover { border-color: var(--v4-primary-border) !important; background: #f8faff !important; }
.crm-user-avatar { width: 34px !important; height: 34px !important; background: #172033 !important; }
.crm-user-name { color: #1d2939 !important; font-size: 11.5px !important; }
.crm-user-meta { color: #667085 !important; font-size: 9px !important; }
.crm-user-meta small { display: none !important; }

.crm-command-button {
    height: 40px; padding: 0 11px; display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--v4-border); border-radius: 10px; color: #475467; background: #fff;
    font-size: 11px; font-weight: 650; cursor: pointer;
}
.crm-command-button:hover { border-color: var(--v4-primary-border); color: var(--v4-primary); background: var(--v4-primary-soft); }
.crm-command-button kbd { margin-left: 2px; padding: 2px 5px; border: 1px solid var(--v4-border); border-radius: 5px; color: #98a2b3; background: #f8fafc; font: inherit; font-size: 9px; }
.crm-topbar-clock { min-width: 50px; display: grid; line-height: 1.1; text-align: right; }
.crm-topbar-clock span { color: #344054; font-size: 11px; font-weight: 750; }
.crm-topbar-clock small { margin-top: 3px; color: #98a2b3; font-size: 8.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.crm-pin-page.is-pinned { color: var(--v4-primary) !important; border-color: var(--v4-primary-border) !important; background: var(--v4-primary-soft) !important; }

.crm-quick-create { position: relative; }
.crm-quick-create-menu {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 260; width: 300px; padding: 8px;
    border: 1px solid var(--v4-border); border-radius: 14px; background: #fff; box-shadow: var(--v4-shadow-md);
}
.crm-quick-create-title { padding: 7px 9px 8px; color: #98a2b3; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.crm-quick-create-menu a { min-height: 58px; padding: 9px 10px; display: flex; align-items: center; gap: 11px; border-radius: 10px; text-decoration: none; }
.crm-quick-create-menu a:hover { background: #f8fafc; }
.crm-quick-create-menu a > svg { width: 19px; height: 19px; color: var(--v4-primary); }
.crm-quick-create-menu a span { display: grid; }
.crm-quick-create-menu strong { color: #1d2939; font-size: 12px; }
.crm-quick-create-menu small { margin-top: 2px; color: #667085; font-size: 10px; }

.page-wrapper { padding: 0 !important; }
.crm-page-wrapper { padding: 24px 26px 38px !important; }
.crm-page-content { width: 100% !important; max-width: 1680px !important; margin: 0 auto !important; }

/* Shared page components: readable, quiet and consistent. */
.crm-page-content .ent-card,
.crm-page-content section.rounded-\[24px\],
.crm-page-content section.rounded-\[22px\],
.crm-page-content section.rounded-\[26px\] {
    border-color: var(--v4-border) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: var(--v4-shadow-xs) !important;
}
.crm-page-content .ent-card:hover, .crm-page-content .ent-card-hover:hover { transform: none !important; box-shadow: var(--v4-shadow-sm) !important; }
.crm-page-content .ui-page-intro,
.crm-page-content .ent-hero {
    border: 1px solid #d9e2f0 !important;
    border-radius: 16px !important;
    color: var(--v4-heading) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%) !important;
    box-shadow: var(--v4-shadow-xs) !important;
}
.crm-page-content .ui-page-intro::before,
.crm-page-content .ui-page-intro::after,
.crm-page-content .ent-hero::before,
.crm-page-content .ent-hero::after { display: none !important; }
.crm-page-content .ui-page-intro [class*="text-white"],
.crm-page-content .ent-hero [class*="text-white"] { color: #475467 !important; }
.crm-page-content .ui-page-intro h1,
.crm-page-content .ui-page-intro h2,
.crm-page-content .ent-hero h1,
.crm-page-content .ent-hero h2 { color: #101828 !important; }
.crm-page-content .ui-page-intro .bg-white,
.crm-page-content .ent-hero .bg-white { background: #172033 !important; color: #fff !important; }
.crm-page-content .ui-page-intro [class*="border-white"],
.crm-page-content .ent-hero [class*="border-white"] { border-color: var(--v4-border) !important; }
.crm-page-content .ui-page-intro [class*="bg-white/"],
.crm-page-content .ent-hero [class*="bg-white/"] { background: #fff !important; }

.crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.crm-page-content select,
.crm-page-content textarea,
.pax-field {
    min-height: 44px !important;
    border-color: var(--v4-border-strong) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #344054 !important;
    font-size: 13px !important;
    box-shadow: none !important;
}
.crm-page-content textarea { min-height: 112px !important; }
.crm-page-content input:focus,
.crm-page-content select:focus,
.crm-page-content textarea:focus,
.pax-field:focus { border-color: #84adff !important; box-shadow: 0 0 0 3px #edf3ff !important; outline: 0 !important; }
.crm-page-content label > span:first-child,
.crm-page-content label.block,
.crm-page-content label[class*="text-"] { color: #475467; }
.crm-page-content button, .crm-page-content a { text-underline-offset: 2px; }
.crm-page-content button[class*="bg-indigo-600"],
.crm-page-content a[class*="bg-indigo-600"],
.crm-page-content .ent-btn-primary { background: var(--v4-primary) !important; border-color: var(--v4-primary) !important; color: #fff !important; box-shadow: none !important; }
.crm-page-content button[class*="bg-indigo-600"]:hover,
.crm-page-content a[class*="bg-indigo-600"]:hover,
.crm-page-content .ent-btn-primary:hover { background: var(--v4-primary-hover) !important; transform: none !important; }

.crm-page-content table { font-size: 13px !important; }
.crm-page-content thead { background: #f8fafc !important; }
.crm-page-content th { height: 42px !important; color: #667085 !important; font-size: 10px !important; font-weight: 750 !important; letter-spacing: .08em !important; }
.crm-page-content td { color: #344054; }
.crm-page-content tbody tr:hover { background: #f8faff !important; }

/* Repair extremely small legacy text utilities without changing invoice PDFs. */
.crm-page-content :where(.text-\[8px\],.text-\[9px\],.text-\[9\.5px\]) { font-size: 10.5px !important; }
.crm-page-content :where(.text-\[10px\],.text-\[10\.5px\]) { font-size: 11.5px !important; }
.crm-page-content :where(.text-\[11px\],.text-\[11\.5px\]) { font-size: 12.5px !important; }
.crm-page-content :where(.text-\[12px\],.text-\[12\.5px\]) { font-size: 13.5px !important; }
.crm-page-content :where(.text-\[13px\],.text-\[13\.5px\]) { font-size: 14px !important; }
.crm-page-content :where(.text-\[14px\]) { font-size: 15px !important; }
.crm-page-content :where(.text-\[15px\]) { font-size: 16px !important; }
.crm-page-content :where(.font-black) { font-weight: 730 !important; }

/* Notifications and drawers. */
.crm-notification-dropdown { width: min(390px, calc(100vw - 24px)) !important; border-color: var(--v4-border) !important; border-radius: 14px !important; box-shadow: var(--v4-shadow-md) !important; }
.crm-preferences-drawer { border-left-color: var(--v4-border) !important; background: #fff !important; }
.crm-drawer-header { min-height: 74px !important; border-bottom-color: var(--v4-border) !important; }
.crm-setting-title { color: #1d2939 !important; font-size: 13px !important; }
.crm-setting-description { color: #667085 !important; font-size: 11px !important; }
.crm-segmented { background: #f2f4f7 !important; }
.crm-segmented button[aria-pressed="true"] { color: #1849a9 !important; background: #fff !important; box-shadow: var(--v4-shadow-xs) !important; }

/* Command centre. */
.crm-command-palette { position: fixed; inset: 0; z-index: 520; display: none; padding: 10vh 18px 18px; }
.crm-command-palette[aria-hidden="false"] { display: block; }
.crm-command-backdrop { position: absolute; inset: 0; background: rgba(16,24,40,.48); backdrop-filter: blur(4px); }
.crm-command-dialog { position: relative; width: min(680px, 100%); max-height: min(720px, 80vh); margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: #fff; box-shadow: var(--v4-shadow-lg); }
.crm-command-searchbar { min-height: 62px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--v4-border); }
.crm-command-searchbar > svg { width: 21px; height: 21px; fill: none; stroke: #667085; stroke-width: 2; }
.crm-command-searchbar input { min-width: 0; flex: 1; border: 0; outline: 0; color: #1d2939; background: transparent; font-size: 15px; }
.crm-command-searchbar > kbd, .crm-command-dialog footer kbd, .crm-command-list > a > kbd { padding: 3px 6px; border: 1px solid var(--v4-border); border-radius: 6px; color: #667085; background: #f8fafc; font: inherit; font-size: 9px; }
.crm-command-body { min-height: 0; flex: 1; overflow-y: auto; padding: 9px; }
.crm-command-section { padding: 7px 0; }
.crm-command-section h2 { margin: 0 10px 6px; color: #98a2b3; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.crm-command-list { display: grid; gap: 2px; }
.crm-command-list > a { min-height: 54px; padding: 8px 10px; display: flex; align-items: center; gap: 12px; border-radius: 10px; text-decoration: none; }
.crm-command-list > a:hover, .crm-command-list > a.is-active { background: #edf3ff; }
.crm-command-list > a > svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #667085; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.crm-command-list > a:hover > svg, .crm-command-list > a.is-active > svg { stroke: var(--v4-primary); }
.crm-command-list > a > span { min-width: 0; flex: 1; display: grid; }
.crm-command-list strong { color: #1d2939; font-size: 12.5px; }
.crm-command-list small { margin-top: 2px; color: #667085; font-size: 10.5px; }
.crm-command-list > a > kbd { margin-left: auto; }
.crm-command-empty { padding: 38px 18px; color: #667085; text-align: center; }
.crm-command-dialog footer { min-height: 43px; padding: 0 14px; display: flex; align-items: center; gap: 18px; border-top: 1px solid var(--v4-border); color: #98a2b3; background: #f8fafc; font-size: 9px; }
html.crm-command-open { overflow: hidden; }

/* Mobile bottom navigation is intentionally limited to small phones. */
.crm-mobile-bottom-nav { display: none; }

/* V4 reusable components and Personal Notes. */
.crm-v4-stack { display: grid; gap: 18px; }
.crm-v4-page-header { min-height: 148px; padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid #d9e2f0; border-radius: 16px; background: linear-gradient(135deg,#fff,#f6f9ff); box-shadow: var(--v4-shadow-xs); }
.crm-v4-page-header h2 { margin: 7px 0 0; color: #101828; font-size: clamp(22px,2vw,28px); line-height: 1.2; letter-spacing: -.03em; }
.crm-v4-page-header p { max-width: 680px; margin: 7px 0 0; color: #667085; font-size: 13px; }
.crm-v4-eyebrow { color: #2457d6; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.crm-v4-primary,.crm-v4-secondary,.crm-v4-quiet-button { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.crm-v4-primary { border: 1px solid #172033; color: #fff; background: #172033; }
.crm-v4-primary:hover { background: #263249; }
.crm-v4-primary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.crm-v4-secondary { border: 1px solid var(--v4-primary); color: #fff; background: var(--v4-primary); }
.crm-v4-quiet-button { border: 1px solid var(--v4-border); color: #475467; background: #fff; }
.crm-v4-quiet-button:hover { background: #f8fafc; }
.crm-v4-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.crm-v4-stat-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.crm-v4-stat { padding: 18px; border: 1px solid var(--v4-border); border-radius: 14px; background: #fff; box-shadow: var(--v4-shadow-xs); }
.crm-v4-stat span { color: #667085; font-size: 11px; font-weight: 650; }
.crm-v4-stat strong { display: block; margin-top: 7px; color: #101828; font-size: 26px; line-height: 1; letter-spacing: -.035em; }
.crm-v4-stat small { display: block; margin-top: 8px; color: #98a2b3; font-size: 10.5px; }
.crm-v4-panel { border: 1px solid var(--v4-border); border-radius: 14px; background: #fff; box-shadow: var(--v4-shadow-xs); }
.crm-v4-filterbar { padding: 14px; }
.crm-v4-filterbar form { display: flex; align-items: end; gap: 10px; }
.crm-v4-field { display: grid; gap: 6px; }
.crm-v4-field-grow { min-width: 220px; flex: 1; }
.crm-v4-field > span { color: #475467; font-size: 10px; font-weight: 700; }
.crm-v4-field input,.crm-v4-field select,.crm-v4-field textarea { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--v4-border-strong); border-radius: 10px; color: #344054; background: #fff; font-size: 13px; }
.crm-v4-field textarea { padding-block: 10px; resize: vertical; }
.crm-v4-field input:focus,.crm-v4-field select:focus,.crm-v4-field textarea:focus { border-color: #84adff; outline: 0; box-shadow: 0 0 0 3px #edf3ff; }
.crm-v4-check { min-height: 42px; display: flex; align-items: center; gap: 9px; color: #475467; font-size: 12px; }
.crm-v4-empty-state { padding: 64px 24px; display: grid; justify-items: center; border: 1px dashed var(--v4-border-strong); border-radius: 16px; background: #fff; text-align: center; }
.crm-v4-empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; color: var(--v4-primary); background: var(--v4-primary-soft); }
.crm-v4-empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.crm-v4-empty-state h2 { margin: 15px 0 0; color: #1d2939; font-size: 17px; }
.crm-v4-empty-state p { margin: 5px 0 16px; color: #667085; }

.crm-note-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.crm-note-card { --note-accent:#667085; --note-bg:#f8fafc; min-height: 230px; padding: 17px; display: flex; flex-direction: column; border: 1px solid var(--v4-border); border-top: 3px solid var(--note-accent); border-radius: 14px; background: linear-gradient(180deg,var(--note-bg),#fff 70%); box-shadow: var(--v4-shadow-xs); }
.crm-note-blue { --note-accent:#2e6ee6; --note-bg:#f2f6ff; }.crm-note-emerald{--note-accent:#079455;--note-bg:#f0fdf7}.crm-note-amber{--note-accent:#dc6803;--note-bg:#fffaeb}.crm-note-rose{--note-accent:#d92d20;--note-bg:#fff5f4}.crm-note-violet{--note-accent:#7f56d9;--note-bg:#f9f5ff}
.crm-note-card-head { min-height: 30px; display: flex; align-items: center; gap: 7px; }
.crm-note-colour-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--note-accent); }
.crm-note-pinned { color: var(--note-accent); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.crm-note-actions { margin-left: auto; display: flex; gap: 3px; }
.crm-note-actions form { display: contents; }
.crm-note-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #667085; background: transparent; cursor: pointer; }
.crm-note-actions button:hover { color: var(--note-accent); background: rgba(255,255,255,.75); }
.crm-note-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.crm-note-card h2 { margin: 12px 0 0; color: #1d2939; font-size: 16px; line-height: 1.3; }
.crm-note-card > p { margin: 9px 0 0; overflow: hidden; color: #475467; font-size: 12.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; }
.crm-note-card footer { margin-top: auto; padding-top: 16px; color: #98a2b3; font-size: 10px; }
.crm-v4-modal { position: fixed; inset: 0; z-index: 600; display: none; padding: 30px 18px; align-items: center; justify-content: center; }
.crm-v4-modal[aria-hidden="false"] { display: flex; }
.crm-v4-modal-backdrop { position: absolute; inset: 0; background: rgba(16,24,40,.5); backdrop-filter: blur(4px); }
.crm-v4-modal-card { position: relative; width: min(620px,100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid rgba(255,255,255,.6); border-radius: 18px; background: #fff; box-shadow: var(--v4-shadow-lg); }
.crm-v4-modal-card > header { min-height: 76px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--v4-border); }
.crm-v4-modal-card > header h2 { margin: 3px 0 0; color: #1d2939; font-size: 18px; }
.crm-v4-icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--v4-border); border-radius: 9px; color: #667085; background: #fff; cursor: pointer; }
.crm-v4-icon-button svg { width: 16px; height: 16px; fill:none; stroke:currentColor; stroke-width:2; }
.crm-v4-modal-card form { padding: 18px; display: grid; gap: 15px; }
.crm-note-form-row { display: grid; grid-template-columns: minmax(180px,.8fr) 1fr; align-items: end; gap: 14px; }
.crm-v4-modal-card form > footer { padding-top: 2px; display: flex; justify-content: flex-end; gap: 9px; }
html.crm-v4-modal-open { overflow: hidden; }

/* Authentication redesign. */
.crm-auth-v4 { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, .92fr) minmax(520px, 1.08fr); background: #fff; }
.crm-auth-brand { position: relative; min-height: 100dvh; padding: clamp(34px,5vw,72px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #fff; background: #111827; }
.crm-auth-brand::before { content:""; position:absolute; inset:0; background: radial-gradient(circle at 15% 10%,rgba(46,110,230,.30),transparent 34rem), radial-gradient(circle at 100% 100%,rgba(255,255,255,.08),transparent 30rem); }
.crm-auth-brand-grid { position:absolute; inset:0; opacity:.12; background-image:linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px); background-size:42px 42px; mask-image:linear-gradient(to bottom,#000,transparent 88%); }
.crm-auth-brand > * { position:relative; z-index:1; }
.crm-auth-logo-row { display:flex; align-items:center; gap:13px; }
.crm-auth-logo { width:48px; height:48px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.16); border-radius:13px; color:#fff; background:rgba(255,255,255,.08); font-size:15px; font-weight:800; }
.crm-auth-logo-copy strong { display:block; font-size:15px; }.crm-auth-logo-copy span{display:block;margin-top:3px;color:#98a2b3;font-size:10px;letter-spacing:.08em;text-transform:uppercase}
.crm-auth-story { max-width: 600px; margin-block: auto; padding-block: 50px; }
.crm-auth-badge { display:inline-flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid rgba(255,255,255,.12); border-radius:999px; color:#d0d5dd; background:rgba(255,255,255,.06); font-size:9px; font-weight:750; letter-spacing:.11em; text-transform:uppercase; }
.crm-auth-badge::before { content:""; width:7px;height:7px;border-radius:50%;background:#32d583;box-shadow:0 0 0 4px rgba(50,213,131,.10); }
.crm-auth-story h1 { max-width:560px; margin:22px 0 0; color:#fff; font-size:clamp(34px,4vw,58px); line-height:1.04; letter-spacing:-.045em; }
.crm-auth-story > p { max-width:540px; margin:20px 0 0; color:#aeb7c6; font-size:15px; line-height:1.75; }
.crm-auth-capabilities { margin-top:36px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.crm-auth-capability { padding:15px; display:flex; gap:11px; border:1px solid rgba(255,255,255,.10); border-radius:13px; background:rgba(255,255,255,.045); }
.crm-auth-capability svg { width:19px;height:19px;flex:0 0 auto;fill:none;stroke:#84adff;stroke-width:1.8; }
.crm-auth-capability strong { display:block;color:#f2f4f7;font-size:12px; }.crm-auth-capability span{display:block;margin-top:4px;color:#98a2b3;font-size:10.5px;line-height:1.5}
.crm-auth-brand-footer { display:flex;align-items:center;justify-content:space-between;gap:16px;color:#667085;font-size:10px; }.crm-auth-brand-footer span{display:flex;align-items:center;gap:7px}.crm-auth-brand-footer span::before{content:"";width:7px;height:7px;border-radius:50%;background:#32d583}
.crm-auth-form-area { min-height:100dvh; padding:clamp(28px,5vw,72px); display:flex; align-items:center; justify-content:center; background:#fff; }
.crm-auth-form-shell { width:min(440px,100%); }
.crm-auth-mobile-brand { display:none; }
.crm-auth-form-head .crm-v4-eyebrow { color:#2457d6; }.crm-auth-form-head h2{margin:9px 0 0;color:#101828;font-size:30px;line-height:1.2;letter-spacing:-.035em}.crm-auth-form-head p{margin:8px 0 0;color:#667085;font-size:13px}
.crm-auth-alert { margin-top:20px; padding:12px 13px; display:flex;align-items:flex-start;gap:9px;border-radius:10px;font-size:12px;line-height:1.55; }.crm-auth-alert svg{width:17px;height:17px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:2}.crm-auth-alert-error{border:1px solid #fecdca;color:#b42318;background:#fff5f4}.crm-auth-alert-success{border:1px solid #abefc6;color:#067647;background:#ecfdf3}
.crm-auth-form { margin-top:28px; display:grid;gap:18px; }.crm-auth-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.crm-auth-label-row label,.crm-auth-field>label{color:#344054;font-size:12px;font-weight:700}.crm-auth-label-row a{color:#2457d6;font-size:11px;font-weight:700;text-decoration:none}.crm-auth-input-wrap{position:relative;margin-top:7px}.crm-auth-input-wrap>svg{position:absolute;left:14px;top:50%;width:18px;height:18px;transform:translateY(-50%);fill:none;stroke:#98a2b3;stroke-width:1.8}.crm-auth-input{width:100%;height:50px;padding:0 46px;border:1px solid #d0d5dd;border-radius:11px;color:#344054;background:#fff;font-size:14px;outline:0}.crm-auth-input:focus{border-color:#84adff;box-shadow:0 0 0 4px #edf3ff}.crm-auth-password-toggle{position:absolute;right:8px;top:50%;height:34px;padding:0 9px;transform:translateY(-50%);border:0;border-radius:8px;color:#667085;background:transparent;font-size:11px;font-weight:700;cursor:pointer}.crm-auth-password-toggle:hover{color:#2457d6;background:#edf3ff}.crm-auth-options{display:flex;align-items:center;justify-content:space-between;gap:12px}.crm-auth-remember{display:flex;align-items:center;gap:8px;color:#475467;font-size:12px}.crm-auth-remember input{width:16px;height:16px}.crm-auth-timezone{color:#98a2b3;font-size:10px}.crm-auth-submit{width:100%;height:50px;display:flex;align-items:center;justify-content:center;gap:9px;border:1px solid #172033;border-radius:11px;color:#fff;background:#172033;font-size:13px;font-weight:750;cursor:pointer}.crm-auth-submit:hover{background:#263249}.crm-auth-submit svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2}.crm-auth-security{margin-top:22px;padding:13px;display:flex;gap:10px;border:1px solid var(--v4-border);border-radius:12px;background:#f8fafc}.crm-auth-security svg{width:18px;height:18px;flex:0 0 auto;fill:none;stroke:#2457d6;stroke-width:1.8}.crm-auth-security strong{display:block;color:#344054;font-size:11px}.crm-auth-security p{margin:3px 0 0;color:#667085;font-size:10.5px;line-height:1.55}.crm-auth-form-footer{margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:12px;color:#98a2b3;font-size:10px}

/* Dark mode stays neutral and readable. */
html[data-crm-theme="dark"] {
    --v4-canvas:#0f1724; --v4-surface:#151f2f; --v4-surface-soft:#192537; --v4-sidebar:#111b2a;
    --v4-border:#29364a; --v4-border-strong:#39485f; --v4-ink:#e5e7eb; --v4-heading:#f8fafc; --v4-muted:#a6b0c0;
}
html[data-crm-theme="dark"] body.crm-app-body,html[data-crm-theme="dark"] .crm-main{background:var(--v4-canvas)!important;color:var(--v4-ink)!important}
html[data-crm-theme="dark"] .crm-sidebar-v3,html[data-crm-theme="dark"] .crm-sidebar-brandbar,html[data-crm-theme="dark"] .sidebar-footer,html[data-crm-theme="dark"] .crm-topbar,html[data-crm-theme="dark"] .crm-page-content .ent-card,html[data-crm-theme="dark"] .crm-page-content section.rounded-\[24px\],html[data-crm-theme="dark"] .crm-page-content section.rounded-\[22px\],html[data-crm-theme="dark"] .crm-page-content .ui-page-intro,html[data-crm-theme="dark"] .crm-page-content .ent-hero{background:var(--v4-surface)!important;border-color:var(--v4-border)!important}
html[data-crm-theme="dark"] .crm-brand-title,html[data-crm-theme="dark"] .crm-page-title,html[data-crm-theme="dark"] .crm-page-content h1,html[data-crm-theme="dark"] .crm-page-content h2,html[data-crm-theme="dark"] .crm-page-content h3{color:#f8fafc!important}
html[data-crm-theme="dark"] .sidebar-link{color:#b7c0cf!important}html[data-crm-theme="dark"] .sidebar-link:hover{color:#fff!important;background:#1b283a!important}html[data-crm-theme="dark"] .sidebar-link.active{color:#bfd0ff!important;background:#20365f!important;border-color:#294a84!important}
html[data-crm-theme="dark"] .crm-sidebar-workspace,html[data-crm-theme="dark"] .crm-sidebar-account,html[data-crm-theme="dark"] .crm-topbar-search,html[data-crm-theme="dark"] .crm-user-card{background:var(--v4-surface-soft)!important;border-color:var(--v4-border)!important}
html[data-crm-theme="dark"] .crm-workspace-copy strong,html[data-crm-theme="dark"] .crm-sidebar-account-name,html[data-crm-theme="dark"] .crm-user-name{color:#eef2f7!important}
html[data-crm-theme="dark"] .crm-command-dialog,html[data-crm-theme="dark"] .crm-quick-create-menu,html[data-crm-theme="dark"] .crm-preferences-drawer{background:var(--v4-surface)!important;border-color:var(--v4-border)!important}

@media (max-width: 1279px) {
    .crm-command-button span,.crm-command-button kbd,.crm-topbar-clock,.crm-user-copy { display:none !important; }
    .crm-command-button { width:40px;padding:0;justify-content:center; }
    .crm-topbar-search-wrap { width:220px !important; }
}

@media (max-width: 1023px) {
    .crm-sidebar-v3 { width: min(304px,86vw) !important; box-shadow: 22px 0 60px rgba(16,24,40,.22) !important; }
    .crm-main { margin-left:0 !important; padding-bottom:0; }
    .crm-topbar-inner { padding:0 18px !important; }
    .crm-page-wrapper { padding:20px 18px 32px !important; }
    .crm-topbar-search-wrap { display:none !important; }
    .crm-command-button { display:inline-flex !important; }
    .crm-note-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .crm-auth-v4 { grid-template-columns:minmax(360px,.82fr) minmax(480px,1.18fr); }
    .crm-auth-brand { padding:38px; }.crm-auth-story h1{font-size:40px}.crm-auth-capabilities{grid-template-columns:1fr}
}

@media (max-width: 767px) {
    .crm-topbar { min-height:64px !important; }
    .crm-topbar-inner { min-height:64px !important; padding:0 13px !important; }
    .crm-page-heading { min-width:0; }
    .crm-page-breadcrumb,.crm-scope-pill,.crm-preferences-button,.crm-pin-page,.crm-user-card,.crm-command-button { display:none !important; }
    .crm-page-title { max-width:53vw;font-size:17px !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
    .crm-topbar-primary-action { width:40px !important;padding:0 !important;justify-content:center; }
    .crm-topbar-primary-action span:last-of-type,.crm-topbar-primary-action>svg { display:none; }
    .crm-page-wrapper { padding:14px 12px 88px !important; }
    .crm-mobile-bottom-nav { position:fixed;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));z-index:230;height:62px;padding:5px;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;border:1px solid rgba(208,215,226,.9);border-radius:16px;background:rgba(255,255,255,.95);box-shadow:0 14px 38px rgba(16,24,40,.18);backdrop-filter:blur(16px); }
    .crm-mobile-bottom-nav a,.crm-mobile-bottom-nav button{display:grid;place-items:center;align-content:center;gap:3px;border:0;border-radius:11px;color:#667085;background:transparent;font-size:9px;font-weight:700;text-decoration:none}.crm-mobile-bottom-nav svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8}.crm-mobile-bottom-nav .active{color:#1849a9;background:#edf3ff}
    .crm-v4-page-header { min-height:auto;padding:20px;align-items:flex-start;flex-direction:column; }.crm-v4-page-header .crm-v4-primary{width:100%}
    .crm-v4-stat-grid,.crm-v4-stat-grid-3 { grid-template-columns:repeat(2,minmax(0,1fr)); }.crm-v4-stat{padding:15px}.crm-v4-stat strong{font-size:23px}
    .crm-v4-filterbar form { align-items:stretch;flex-direction:column; }.crm-v4-field-grow{min-width:0}.crm-v4-filterbar .crm-v4-secondary,.crm-v4-filterbar .crm-v4-quiet-button{width:100%}
    .crm-note-grid { grid-template-columns:1fr; }.crm-note-card{min-height:210px}
    .crm-note-form-row { grid-template-columns:1fr; }
    .crm-command-palette { padding:9vh 10px 78px; }.crm-command-dialog{max-height:78vh;border-radius:15px}.crm-command-dialog footer{display:none}
    .crm-auth-v4 { display:block;background:#fff; }.crm-auth-brand{display:none}.crm-auth-form-area{min-height:100dvh;padding:26px 20px}.crm-auth-mobile-brand{margin-bottom:44px;display:flex;align-items:center;gap:11px}.crm-auth-mobile-brand .crm-auth-logo{color:#fff;background:#172033;border:0}.crm-auth-mobile-brand strong{display:block;color:#101828;font-size:14px}.crm-auth-mobile-brand span{display:block;margin-top:2px;color:#667085;font-size:9px;text-transform:uppercase;letter-spacing:.08em}.crm-auth-form-head h2{font-size:27px}.crm-auth-form-footer{flex-direction:column;align-items:flex-start}
}

@media (max-width: 479px) {
    .crm-v4-stat-grid,.crm-v4-stat-grid-3 { grid-template-columns:1fr 1fr; }
    .crm-v4-stat small { display:none; }
    .crm-v4-page-header h2 { font-size:22px; }
    .crm-auth-options { align-items:flex-start;flex-direction:column; }.crm-auth-timezone{display:none}.crm-auth-form-area{padding-inline:16px}.crm-auth-mobile-brand{margin-bottom:34px}
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}

/* Executive dashboard V4. */
.crm-v4-dashboard-head { min-height: 178px; padding: 26px 28px; display:flex;align-items:center;justify-content:space-between;gap:28px;border:1px solid #d9e2f0;border-radius:16px;background:linear-gradient(135deg,#fff 0%,#f4f8ff 100%);box-shadow:var(--v4-shadow-xs); }
.crm-v4-dashboard-head-copy h2 { max-width:760px;margin:8px 0 0;color:#101828;font-size:clamp(25px,2.4vw,34px);line-height:1.16;letter-spacing:-.04em; }
.crm-v4-dashboard-head-copy>p { max-width:720px;margin:9px 0 0;color:#667085;font-size:13px;line-height:1.65; }
.crm-v4-dashboard-scope { margin-top:16px;display:flex;align-items:center;flex-wrap:wrap;gap:8px; }
.crm-v4-dashboard-scope span { min-height:26px;padding:0 9px;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--v4-border);border-radius:999px;color:#667085;background:#fff;font-size:10px;font-weight:650; }
.crm-v4-dashboard-scope i { width:7px;height:7px;border-radius:50%;background:#12b76a;box-shadow:0 0 0 3px #ecfdf3; }
.crm-v4-dashboard-actions { display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:9px; }
.crm-v4-kpi-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px; }
.crm-v4-kpi { min-height:126px;padding:18px;display:flex;align-items:flex-start;gap:14px;border:1px solid var(--v4-border);border-radius:14px;background:#fff;box-shadow:var(--v4-shadow-xs); }
.crm-v4-kpi-icon { width:42px;height:42px;flex:0 0 42px;display:grid;place-items:center;border-radius:11px;color:#2457d6;background:#edf3ff; }.crm-v4-kpi-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.crm-v4-kpi-green{color:#067647;background:#ecfdf3}.crm-v4-kpi-violet{color:#6941c6;background:#f4f3ff}.crm-v4-kpi-amber{color:#b54708;background:#fffaeb}
.crm-v4-kpi>div:last-child { min-width:0;display:grid; }.crm-v4-kpi span{color:#667085;font-size:11px;font-weight:650}.crm-v4-kpi strong{margin-top:5px;color:#101828;font-size:24px;line-height:1.05;letter-spacing:-.035em}.crm-v4-kpi small{margin-top:8px;color:#98a2b3;font-size:10.5px}
.crm-v4-focus-grid { display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:14px; }.crm-v4-focus-panel,.crm-v4-celebrations,.crm-v4-chart-card,.crm-v4-record-card,.crm-v4-activity-card{overflow:hidden}
.crm-v4-panel-head { min-height:75px;padding:17px 18px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--v4-border); }.crm-v4-panel-head h2{margin:4px 0 0;color:#101828;font-size:16px;line-height:1.25}.crm-v4-panel-head p{margin:4px 0 0;color:#667085;font-size:10.5px}.crm-v4-panel-head>a{color:#2457d6;font-size:11px;font-weight:700;text-decoration:none}.crm-v4-panel-head>strong{text-align:right;color:#101828;font-size:18px}.crm-v4-panel-head>strong small{display:block;margin-top:2px;color:#98a2b3;font-size:9px;font-weight:650;text-transform:uppercase;letter-spacing:.08em}
.crm-v4-focus-items { padding:12px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px; }.crm-v4-focus-item{min-height:120px;padding:14px;display:flex;flex-direction:column;border:1px solid var(--v4-border);border-radius:11px;color:inherit;background:#f8fafc;text-decoration:none}.crm-v4-focus-item:hover{border-color:var(--v4-primary-border);background:#f5f8ff}.crm-v4-focus-item span{color:#667085;font-size:10.5px;font-weight:650}.crm-v4-focus-item strong{margin-top:10px;color:#101828;font-size:25px;line-height:1}.crm-v4-focus-item small{margin-top:auto;padding-top:12px;color:#98a2b3;font-size:9.5px}.crm-v4-focus-danger{border-color:#fecdca;background:#fff8f7}.crm-v4-focus-danger strong{color:#b42318}
.crm-v4-celebration-list{padding:8px}.crm-v4-celebration-list>a{min-height:58px;padding:7px 8px;display:flex;align-items:center;gap:10px;border-radius:10px;text-decoration:none}.crm-v4-celebration-list>a:hover{background:#f8fafc}.crm-v4-person-avatar{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;overflow:hidden;border-radius:10px;color:#fff;background:#172033;font-size:11px;font-weight:750}.crm-v4-person-avatar img{width:100%;height:100%;object-fit:cover}.crm-v4-person-copy{min-width:0;flex:1;display:grid}.crm-v4-person-copy strong{overflow:hidden;color:#344054;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.crm-v4-person-copy small{margin-top:2px;color:#667085;font-size:9.5px}.crm-v4-celebration-list>a>b{color:#2457d6;font-size:9.5px}.crm-v4-today-event{min-height:58px;padding:7px 8px;display:flex;align-items:center;gap:10px;border-radius:10px;background:#f8fafc}.crm-v4-today-event+.crm-v4-today-event{margin-top:6px}
.crm-v4-mini-empty{padding:28px 18px;color:#667085;font-size:12px;text-align:center}
.crm-v4-dashboard-filters{overflow:hidden}.crm-v4-filter-summary{width:100%;min-height:58px;padding:0 17px;display:flex;align-items:center;justify-content:space-between;gap:15px;border:0;color:#475467;background:#fff;cursor:pointer}.crm-v4-filter-summary>span{display:flex;align-items:center;gap:9px}.crm-v4-filter-summary svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.crm-v4-filter-summary strong{color:#344054;font-size:12px}.crm-v4-filter-summary small{color:#98a2b3;font-size:10px}.crm-v4-filter-summary[aria-expanded="true"]>svg:last-child{transform:rotate(180deg)}.crm-v4-dashboard-filter-form{padding:14px 16px 16px;display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:10px;border-top:1px solid var(--v4-border);background:#f8fafc}.crm-v4-dashboard-filter-actions{display:flex;align-items:end;gap:8px}
.crm-v4-chart-grid { display:grid;grid-template-columns:minmax(300px,.9fr) minmax(0,1.6fr);gap:14px; }.crm-v4-chart-grid>.crm-v4-chart-wide:first-child{order:-1}.crm-v4-chart-card.crm-v4-chart-wide{grid-column:auto}.crm-v4-chart-wrap{height:280px;padding:15px 17px 17px}.crm-v4-chart-doughnut{height:300px}
.crm-v4-client-list>div{min-height:60px;padding:9px 18px;display:grid;grid-template-columns:30px minmax(150px,1fr) minmax(90px,.65fr) minmax(90px,.65fr) minmax(100px,.7fr);align-items:center;gap:12px;border-top:1px solid #f0f2f5}.crm-v4-client-list>div:first-child{border-top:0}.crm-v4-rank{width:25px;height:25px;display:grid;place-items:center;border-radius:8px;color:#667085;background:#f2f4f7;font-size:10px;font-weight:750}.crm-v4-client-copy{min-width:0;display:grid}.crm-v4-client-copy strong{overflow:hidden;color:#344054;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.crm-v4-client-copy small,.crm-v4-client-list>div>span:not(.crm-v4-rank):not(.crm-v4-client-copy) small{color:#98a2b3;font-size:9px}.crm-v4-client-list>div>span:not(.crm-v4-rank):not(.crm-v4-client-copy){display:grid}.crm-v4-client-list>div>span strong{margin-top:2px;color:#475467;font-size:11px}.crm-v4-client-list>div>b{color:#101828;font-size:12px;text-align:right}.crm-v4-positive{color:#067647!important}
.crm-v4-record-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px; }.crm-v4-record-list>a{min-height:65px;padding:10px 17px;display:flex;align-items:center;gap:11px;border-top:1px solid #f0f2f5;text-decoration:none}.crm-v4-record-list>a:first-child{border-top:0}.crm-v4-record-list>a:hover{background:#f8fafc}.crm-v4-record-avatar{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;border-radius:10px;color:#2457d6;background:#edf3ff;font-size:11px;font-weight:750}.crm-v4-record-invoice{color:#b54708;background:#fffaeb}.crm-v4-record-avatar svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}.crm-v4-record-copy{min-width:0;flex:1;display:grid}.crm-v4-record-copy strong{overflow:hidden;color:#344054;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.crm-v4-record-copy small{margin-top:2px;overflow:hidden;color:#667085;font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}.crm-v4-status{max-width:120px;padding:4px 7px;overflow:hidden;border:1px solid #dbe7ff;border-radius:999px;color:#1849a9;background:#edf3ff;font-size:9px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.crm-v4-record-list>a>b{min-width:86px;color:#101828;font-size:11.5px;text-align:right}
.crm-v4-activity-list>div{min-height:64px;padding:10px 18px;display:flex;align-items:flex-start;gap:11px;border-top:1px solid #f0f2f5}.crm-v4-activity-list>div:first-child{border-top:0}.crm-v4-activity-dot{width:8px;height:8px;margin-top:6px;flex:0 0 8px;border-radius:50%;background:#2457d6;box-shadow:0 0 0 4px #edf3ff}.crm-v4-activity-list>div>span:nth-child(2){min-width:0;flex:1;display:grid}.crm-v4-activity-list strong{color:#344054;font-size:11.5px}.crm-v4-activity-list small{margin-top:3px;color:#667085;font-size:10px;line-height:1.5}.crm-v4-activity-list time{color:#98a2b3;font-size:9.5px;white-space:nowrap}

@media(max-width:1279px){.crm-v4-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-v4-focus-grid{grid-template-columns:1fr}.crm-v4-chart-grid{grid-template-columns:1fr 1fr}.crm-v4-record-grid{grid-template-columns:1fr}.crm-v4-dashboard-filter-form{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){.crm-v4-dashboard-head{min-height:auto;padding:20px;align-items:flex-start;flex-direction:column}.crm-v4-dashboard-actions{width:100%;justify-content:flex-start}.crm-v4-dashboard-actions>a{flex:1}.crm-v4-kpi-grid{grid-template-columns:1fr 1fr}.crm-v4-kpi{min-height:112px;padding:14px;gap:10px}.crm-v4-kpi-icon{width:36px;height:36px;flex-basis:36px}.crm-v4-kpi strong{font-size:20px}.crm-v4-kpi small{display:none}.crm-v4-focus-items{grid-template-columns:1fr 1fr}.crm-v4-dashboard-filter-form{grid-template-columns:1fr 1fr}.crm-v4-chart-grid{grid-template-columns:1fr}.crm-v4-chart-wrap{height:250px}.crm-v4-client-list>div{grid-template-columns:28px minmax(0,1fr) auto}.crm-v4-client-list>div>span:not(.crm-v4-client-copy):not(.crm-v4-rank){display:none}.crm-v4-record-list>a{padding-inline:12px}.crm-v4-status{display:none}.crm-v4-record-list>a>b{min-width:auto}.crm-v4-activity-list time{display:none}}
@media(max-width:479px){.crm-v4-dashboard-head-copy h2{font-size:25px}.crm-v4-dashboard-actions{display:grid;grid-template-columns:1fr 1fr}.crm-v4-dashboard-actions .crm-v4-primary{grid-column:1/-1}.crm-v4-kpi-grid{grid-template-columns:1fr}.crm-v4-kpi{min-height:102px}.crm-v4-focus-items{grid-template-columns:1fr 1fr}.crm-v4-focus-item{min-height:108px}.crm-v4-dashboard-filter-form{grid-template-columns:1fr}.crm-v4-dashboard-filter-actions{display:grid;grid-template-columns:1fr 1fr}.crm-v4-filter-summary small{display:none}}
.crm-auth-capabilities-single{grid-template-columns:1fr}.crm-auth-back-link{justify-self:center;color:#475467;font-size:12px;font-weight:650;text-decoration:none}.crm-auth-back-link:hover{color:#2457d6}.crm-auth-password-rules{margin-top:30px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.crm-auth-password-rules span{padding:11px 12px;border:1px solid rgba(255,255,255,.1);border-radius:10px;color:#cbd5e1;background:rgba(255,255,255,.045);font-size:10.5px}.crm-auth-password-rules span::before{content:'✓';margin-right:8px;color:#32d583;font-weight:800}.crm-auth-strength{height:6px;margin-top:9px;overflow:hidden;border-radius:999px;background:#f2f4f7}.crm-auth-strength span{display:block;width:0;height:100%;border-radius:inherit;background:#d92d20;transition:width .2s ease,background .2s ease}.crm-auth-strength span[data-score="1"]{width:25%;background:#d92d20}.crm-auth-strength span[data-score="2"]{width:50%;background:#f79009}.crm-auth-strength span[data-score="3"]{width:75%;background:#2e90fa}.crm-auth-strength span[data-score="4"]{width:100%;background:#079455}.crm-auth-field-help{display:block;margin-top:7px;color:#98a2b3;font-size:10.5px}.crm-auth-field-help[data-match="yes"]{color:#067647}.crm-auth-field-help[data-match="no"]{color:#b42318}

/* Source: crm-responsive.css */
/*
 * PAX CRM responsive hardening — August 2026
 * Applies to browser UI only. Invoice PDF views do not load this stylesheet.
 */

:root {
    --crm-mobile-gutter: clamp(12px, 3.5vw, 24px);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.crm-main,
.crm-page-wrapper,
.crm-page-content,
.crm-page-content > *,
.crm-page-content .grid > *,
.crm-page-content .flex > * {
    min-width: 0;
}

.crm-page-wrapper {
    width: 100%;
}

.crm-page-content {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.crm-page-content input,
.crm-page-content select,
.crm-page-content textarea,
.crm-page-content button {
    max-width: 100%;
}

.crm-page-content textarea {
    resize: vertical;
}

.crm-page-content pre,
.crm-page-content code {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.crm-responsive-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.crm-responsive-table:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 2px;
}

.crm-responsive-table > table {
    width: 100%;
    min-width: 720px;
    margin: 0;
}

.crm-responsive-table th,
.crm-responsive-table td {
    vertical-align: top;
}

/* CRM Mail pages */
.crm-mail-page a,
.crm-mail-page button,
.crm-mail-page input,
.crm-mail-page select,
.crm-mail-page textarea {
    min-width: 0;
}

.crm-mail-page .crm-email-message-body,
.crm-mail-page [data-email-body] {
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: anywhere;
}

.crm-mail-page .crm-email-message-body img,
.crm-mail-page [data-email-body] img {
    height: auto !important;
    max-width: 100% !important;
}

.crm-mail-page .crm-email-message-body table,
.crm-mail-page [data-email-body] table {
    max-width: 100% !important;
}

.crm-mobile-bottom-nav {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.crm-sidebar,
.crm-preferences-drawer,
.crm-command-panel,
.crm-notification-dropdown,
.crm-quick-create-menu {
    max-width: calc(100vw - 16px);
}

@media (max-width: 1023px) {
    .crm-page-wrapper {
        padding-inline: var(--crm-mobile-gutter);
    }

    .crm-page-content [class*="max-w-"] {
        max-width: 100%;
    }

    .crm-topbar-inner,
    .crm-title-zone,
    .crm-topbar-actions {
        min-width: 0;
    }

    .crm-page-title,
    .crm-title-row,
    .crm-page-breadcrumb {
        max-width: 100%;
    }

    .crm-command-panel {
        width: min(720px, calc(100vw - 24px));
    }
}

@media (max-width: 767px) {
    body.crm-app-body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    .crm-page-wrapper {
        padding-top: 14px;
        padding-bottom: 18px;
    }

    .crm-page-content {
        font-size: 14px;
    }

    .crm-page-content section.rounded-\[28px\],
    .crm-page-content form.rounded-\[28px\],
    .crm-page-content div.rounded-\[28px\] {
        border-radius: 18px;
    }

    .crm-page-content .p-6,
    .crm-page-content .lg\:p-8 {
        padding: 16px;
    }

    .crm-page-content h1.text-3xl,
    .crm-page-content .text-3xl {
        font-size: clamp(1.45rem, 7vw, 1.85rem);
        line-height: 1.15;
    }

    .crm-page-content h2.text-xl,
    .crm-page-content .text-xl {
        font-size: 1.1rem;
    }

    .crm-page-content form.flex,
    .crm-page-content .crm-mobile-stack {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .crm-page-content form.flex > input,
    .crm-page-content form.flex > select,
    .crm-page-content form.flex > textarea,
    .crm-page-content form.flex > button,
    .crm-page-content form.flex > a {
        width: 100%;
    }

    .crm-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .crm-page-content select,
    .crm-page-content textarea {
        font-size: 16px;
    }

    .crm-page-content button,
    .crm-page-content a[class*="rounded-xl"] {
        min-height: 42px;
    }

    .crm-responsive-table {
        margin-inline: -1px;
        border-radius: 12px;
    }

    .crm-responsive-table > table {
        min-width: 680px;
    }

    .crm-notification-dropdown {
        position: fixed;
        inset: 64px 8px auto 8px;
        width: auto;
        max-height: calc(100dvh - 88px);
    }

    .crm-quick-create-menu {
        position: fixed;
        inset: 64px 8px auto 8px;
        width: auto;
    }

    .crm-preferences-drawer {
        width: min(94vw, 420px);
    }

    .crm-mail-page .crm-mail-toolbar,
    .crm-mail-page .crm-mail-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
}

@media (max-width: 479px) {
    :root {
        --crm-mobile-gutter: 10px;
    }

    .crm-page-wrapper {
        padding-top: 10px;
    }

    .crm-page-content section,
    .crm-page-content form {
        max-width: 100%;
    }

    .crm-page-content .grid.sm\:grid-cols-3,
    .crm-page-content .grid.md\:grid-cols-2,
    .crm-page-content .grid.md\:grid-cols-3,
    .crm-page-content .grid.md\:grid-cols-4,
    .crm-page-content .grid.lg\:grid-cols-2,
    .crm-page-content .grid.xl\:grid-cols-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .crm-page-content .flex.flex-wrap > a,
    .crm-page-content .flex.flex-wrap > button,
    .crm-page-content .flex.flex-wrap > form {
        flex: 1 1 100%;
    }

    .crm-page-content .flex.flex-wrap > form > button,
    .crm-page-content .flex.flex-wrap > form > select {
        width: 100%;
    }

    .crm-responsive-table > table {
        min-width: 620px;
    }

    .crm-command-panel {
        width: calc(100vw - 12px);
        max-height: calc(100dvh - 16px);
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .crm-sidebar,
    .crm-preferences-drawer,
    .crm-command-panel {
        max-height: calc(100dvh - 8px);
        overflow-y: auto;
    }

    .crm-mobile-bottom-nav {
        min-height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Source: crm-meridian.css */
/* ==========================================================================
   PAX CRM — "MERIDIAN" DESIGN SYSTEM
   A precision instrument for packaging sales teams.
   --------------------------------------------------------------------------
   Loaded LAST. Owns every visible surface of the application shell.
   Does not touch: resources/views/invoices/pdf.php, invoices/template.php
   (both are self-contained documents with inline styles — the printed
   invoice design is untouched by this file.)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   Palette: Graphite / Paper / Mist / Hairline / Cobalt / Brass
   Colour is reserved for action and state. Everything else is neutral.
   -------------------------------------------------------------------------- */

:root {
    /* -- Brand ---------------------------------------------------------- */
    --mx-cobalt-50:  #EEF1FE;
    --mx-cobalt-100: #DDE3FD;
    --mx-cobalt-200: #BCC7FB;
    --mx-cobalt-300: #92A4F7;
    --mx-cobalt-400: #6076F2;
    --mx-cobalt-500: #2B50EC;
    --mx-cobalt-600: #1E3ED4;
    --mx-cobalt-700: #1930AB;
    --mx-cobalt-800: #172A88;
    --mx-cobalt-900: #16276D;

    --mx-brass-50:  #FBF7EC;
    --mx-brass-100: #F5ECD3;
    --mx-brass-300: #DFC078;
    --mx-brass-500: #B98A2E;
    --mx-brass-600: #9A7025;
    --mx-brass-700: #7A581E;

    /* -- Neutral (Graphite ramp) ---------------------------------------- */
    --mx-n-0:   #FFFFFF;
    --mx-n-25:  #FBFCFD;
    --mx-n-50:  #F4F6F8;
    --mx-n-100: #EDF0F4;
    --mx-n-150: #E4E8EE;
    --mx-n-200: #D8DDE6;
    --mx-n-300: #BFC7D4;
    --mx-n-400: #98A2B3;
    --mx-n-500: #6B7686;
    --mx-n-600: #4E5765;
    --mx-n-700: #39404C;
    --mx-n-800: #262B34;
    --mx-n-900: #14161B;
    --mx-n-950: #0B0D11;

    /* -- State ---------------------------------------------------------- */
    --mx-verdant:   #12805C;
    --mx-verdant-s: #E6F5F0;
    --mx-amber:     #B4690E;
    --mx-amber-s:   #FDF3E4;
    --mx-crimson:   #C6273A;
    --mx-crimson-s: #FCEDEF;
    --mx-info:      #1E6FB8;
    --mx-info-s:    #E9F2FB;

    /* -- Semantic surfaces (light) -------------------------------------- */
    --mx-canvas:        var(--mx-n-50);
    --mx-surface:       var(--mx-n-0);
    --mx-surface-2:     var(--mx-n-25);
    --mx-surface-3:     var(--mx-n-100);
    --mx-surface-inset: var(--mx-n-50);
    --mx-border:        var(--mx-n-150);
    --mx-border-soft:   var(--mx-n-100);
    --mx-border-strong: var(--mx-n-200);

    --mx-text:      var(--mx-n-900);
    --mx-text-2:    var(--mx-n-600);
    --mx-text-3:    var(--mx-n-500);
    --mx-text-4:    var(--mx-n-400);
    --mx-text-inv:  #FFFFFF;

    --mx-accent:       var(--mx-cobalt-500);
    --mx-accent-hover: var(--mx-cobalt-600);
    --mx-accent-soft:  var(--mx-cobalt-50);
    --mx-accent-line:  var(--mx-cobalt-200);
    --mx-accent-ring:  rgba(43, 80, 236, .16);

    /* -- Elevation ------------------------------------------------------ */
    --mx-shadow-xs: 0 1px 2px rgba(16, 22, 34, .04);
    --mx-shadow-sm: 0 1px 2px rgba(16, 22, 34, .05), 0 2px 6px -2px rgba(16, 22, 34, .06);
    --mx-shadow-md: 0 4px 10px -3px rgba(16, 22, 34, .07), 0 12px 28px -10px rgba(16, 22, 34, .12);
    --mx-shadow-lg: 0 10px 22px -8px rgba(16, 22, 34, .12), 0 30px 60px -20px rgba(16, 22, 34, .20);
    --mx-shadow-xl: 0 24px 48px -12px rgba(16, 22, 34, .22), 0 48px 96px -32px rgba(16, 22, 34, .28);
    --mx-shadow-focus: 0 0 0 3px var(--mx-accent-ring);

    /* -- Geometry ------------------------------------------------------- */
    --mx-r-xs:  6px;
    --mx-r-sm:  8px;
    --mx-r-md:  11px;
    --mx-r-lg:  14px;
    --mx-r-xl:  18px;
    --mx-r-2xl: 24px;
    --mx-r-pill: 999px;

    --mx-rail: 3px;                 /* signature: the live rail */

    /* -- Rhythm --------------------------------------------------------- */
    --mx-gap:        20px;
    --mx-gap-tight:  12px;
    --mx-pad-card:   18px;
    --mx-control-h:  38px;
    --mx-control-h-sm: 32px;

    --mx-sidebar-w:  248px;
    --mx-sidebar-collapsed-w: 76px;
    --mx-topbar-h:   62px;

    /* -- Type ----------------------------------------------------------- */
    --mx-font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
    --mx-font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mx-font-data:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* -- Motion --------------------------------------------------------- */
    --mx-ease:        cubic-bezier(.22, 1, .36, 1);
    --mx-ease-in-out: cubic-bezier(.65, .05, .36, 1);
    --mx-spring:      cubic-bezier(.34, 1.46, .64, 1);
    --mx-t-fast:   120ms;
    --mx-t-base:   220ms;
    --mx-t-slow:   360ms;
    --mx-t-slower: 560ms;
}

/* -- Dark theme ---------------------------------------------------------- */
html[data-crm-theme="dark"] {
    --mx-canvas:        #0B0D11;
    --mx-surface:       #12151C;
    --mx-surface-2:     #161A22;
    --mx-surface-3:     #1C212B;
    --mx-surface-inset: #0E1116;
    --mx-border:        #242A36;
    --mx-border-soft:   #1C212B;
    --mx-border-strong: #333B4B;

    --mx-text:     #E9ECF2;
    --mx-text-2:   #A9B2C1;
    --mx-text-3:   #838D9C;
    --mx-text-4:   #667080;
    --mx-text-inv: #0B0D11;

    --mx-accent:       #7C93FF;
    --mx-accent-hover: #93A6FF;
    --mx-accent-soft:  rgba(124, 147, 255, .12);
    --mx-accent-line:  rgba(124, 147, 255, .32);
    --mx-accent-ring:  rgba(124, 147, 255, .24);

    --mx-verdant:   #34C99A;
    --mx-verdant-s: rgba(52, 201, 154, .12);
    --mx-amber:     #E0A45C;
    --mx-amber-s:   rgba(224, 164, 92, .12);
    --mx-crimson:   #F0788A;
    --mx-crimson-s: rgba(240, 120, 138, .12);
    --mx-info:      #5FA8E8;
    --mx-info-s:    rgba(95, 168, 232, .12);

    --mx-brass-500: #DFC078;
    --mx-brass-50:  rgba(223, 192, 120, .10);
    --mx-brass-100: rgba(223, 192, 120, .18);

    --mx-shadow-xs: 0 1px 2px rgba(0, 0, 0, .40);
    --mx-shadow-sm: 0 1px 2px rgba(0, 0, 0, .44), 0 2px 6px -2px rgba(0, 0, 0, .50);
    --mx-shadow-md: 0 4px 10px -3px rgba(0, 0, 0, .50), 0 12px 28px -10px rgba(0, 0, 0, .62);
    --mx-shadow-lg: 0 10px 22px -8px rgba(0, 0, 0, .58), 0 30px 60px -20px rgba(0, 0, 0, .70);
    --mx-shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, .66), 0 48px 96px -32px rgba(0, 0, 0, .78);
}

/* -- Density ------------------------------------------------------------- */
html[data-crm-density="compact"] {
    --mx-gap: 14px;
    --mx-pad-card: 14px;
    --mx-control-h: 34px;
    --mx-topbar-h: 56px;
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body.crm-app-body,
body.crm-auth-body {
    background: var(--mx-canvas);
    color: var(--mx-text);
    font-family: var(--mx-font-body);
    font-feature-settings: 'cv05' 1, 'cv08' 1, 'ss03' 1, 'calt' 1;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--mx-t-slow) var(--mx-ease),
                color var(--mx-t-slow) var(--mx-ease);
}

/* Headings take the display face — used with restraint, headings only. */
body.crm-app-body h1,
body.crm-app-body h2,
body.crm-app-body h3,
.crm-page-title,
.mx-display {
    font-family: var(--mx-font-display);
    font-weight: 700;
    letter-spacing: -0.022em;
    color: var(--mx-text);
}

/* Numerals in data contexts align. Money and reference numbers must scan
   vertically — that's why the utility face exists in this system. */
.mx-num,
.enterprise-leads-table td:nth-last-child(-n+3),
td[data-mx-num],
.mx-kpi-value,
.crm-v4-stat strong {
    font-family: var(--mx-font-data);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

::selection { background: var(--mx-accent-soft); color: var(--mx-accent-hover); }

/* Scrollbars — thin, neutral, appear on hover of their container. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--mx-n-300) transparent;
}
html[data-crm-theme="dark"] * { scrollbar-color: #333B4B transparent; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--mx-n-200);
    border-radius: var(--mx-r-pill);
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background-color var(--mx-t-base) var(--mx-ease);
}
::-webkit-scrollbar-thumb:hover { background: var(--mx-n-400); background-clip: content-box; }
html[data-crm-theme="dark"] ::-webkit-scrollbar-thumb { background: #2A303D; background-clip: content-box; }
html[data-crm-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3D465A; background-clip: content-box; }

/* Focus — one visible, animated ring for the whole product. */
:focus-visible {
    outline: 2px solid var(--mx-accent);
    outline-offset: 2px;
    border-radius: var(--mx-r-xs);
}
.crm-app-body a:focus-visible,
.crm-app-body button:focus-visible {
    animation: mx-focus-in 260ms var(--mx-spring);
}

.crm-skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: var(--mx-r-md);
    background: var(--mx-n-900);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--mx-shadow-lg);
    transform: translateY(-160%);
    transition: transform var(--mx-t-base) var(--mx-spring);
}
.crm-skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   3. LEGACY TOKEN BRIDGE
   The previous stylesheets are driven entirely by --ui-* / --crm-* variables.
   Re-pointing those at the Meridian palette re-skins every rule they own in
   one move — including layout maths — with no risk of structural breakage.
   -------------------------------------------------------------------------- */

:root {
    --ui-primary:        var(--mx-accent);
    --ui-primary-hover:  var(--mx-accent-hover);
    --ui-primary-soft:   var(--mx-accent-soft);
    --ui-accent:         var(--mx-brass-500);
    --ui-bg:             var(--mx-canvas);
    --ui-surface:        var(--mx-surface);
    --ui-surface-subtle: var(--mx-surface-2);
    --ui-border:         var(--mx-border);
    --ui-border-strong:  var(--mx-border-strong);
    --ui-text:           var(--mx-text);
    --ui-muted:          var(--mx-text-3);
    --ui-muted-2:        var(--mx-text-4);
    --ui-success:        var(--mx-verdant);
    --ui-warning:        var(--mx-amber);
    --ui-danger:         var(--mx-crimson);
    --ui-info:           var(--mx-info);

    /* The sidebar is now a paper surface, not a slab of navy. */
    --ui-sidebar:        var(--mx-surface);
    --ui-sidebar-hover:  var(--mx-surface-3);
    --ui-sidebar-text:   var(--mx-text-2);
    --ui-sidebar-muted:  var(--mx-text-4);

    --ui-radius-sm: var(--mx-r-sm);
    --ui-radius:    var(--mx-r-md);
    --ui-radius-lg: var(--mx-r-lg);

    --ui-shadow:         var(--mx-shadow-sm);
    --ui-shadow-popover: var(--mx-shadow-lg);

    --ui-sidebar-width:     var(--mx-sidebar-w);
    --ui-sidebar-collapsed: var(--mx-sidebar-collapsed-w);
    --ui-topbar-height:     var(--mx-topbar-h);
    --ui-control-height:    var(--mx-control-h);
    --ui-page-gap:          var(--mx-gap);

    --crm-indigo:       var(--mx-accent);
    --crm-indigo-light: var(--mx-cobalt-400);
    --crm-indigo-soft:  var(--mx-accent-soft);
    --crm-navy:         var(--mx-n-900);
    --crm-navy-deep:    var(--mx-n-950);
    --crm-gold:         var(--mx-brass-500);
    --crm-gold-soft:    var(--mx-brass-50);
    --crm-teal:         var(--mx-verdant);
    --crm-surface:        var(--mx-canvas);
    --crm-surface-raised: var(--mx-surface);
    --crm-border:         var(--mx-border);
    --crm-border-strong:  var(--mx-border-strong);
    --crm-text:           var(--mx-text);
    --crm-text-muted:     var(--mx-text-3);
}

html[data-crm-sidebar="collapsed"] .crm-shell {
    --crm-sidebar-width: var(--mx-sidebar-collapsed-w) !important;
}

/* --------------------------------------------------------------------------
   4. SHELL — SIDEBAR
   Paper surface, hairline separation, and the signature live rail.
   -------------------------------------------------------------------------- */

.crm-sidebar {
    background: var(--mx-surface) !important;
    border-right: 1px solid var(--mx-border) !important;
    box-shadow: none !important;
    transition: width var(--mx-t-base) var(--mx-ease),
                transform var(--mx-t-base) var(--mx-ease),
                background-color var(--mx-t-slow) var(--mx-ease),
                border-color var(--mx-t-slow) var(--mx-ease) !important;
}

/* A whisper of depth against the canvas, without a drop shadow. */
.crm-sidebar::after {
    content: '';
    position: absolute;
    inset: 0 -24px 0 auto;
    width: 24px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(16, 22, 34, .035), transparent);
    opacity: 0;
    transition: opacity var(--mx-t-slow) var(--mx-ease);
}
html[data-crm-sidebar="expanded"] .crm-sidebar::after { opacity: 1; }

/* -- Brand lockup -------------------------------------------------------- */
.crm-sidebar-brandbar {
    height: var(--mx-topbar-h) !important;
    padding: 0 14px 0 18px !important;
    border-bottom: 1px solid var(--mx-border-soft) !important;
    background: transparent !important;
}

.crm-brand-lockup {
    gap: 11px !important;
    border-radius: var(--mx-r-md);
    transition: opacity var(--mx-t-base) var(--mx-ease);
}
.crm-brand-lockup:hover { opacity: .82; }

.crm-brand-logo {
    width: 34px !important;
    height: 34px !important;
    border-radius: var(--mx-r-sm) !important;
    background: var(--mx-n-900) !important;
    color: #fff !important;
    font-family: var(--mx-font-display) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    box-shadow: var(--mx-shadow-xs) !important;
    overflow: hidden;
    transition: transform var(--mx-t-base) var(--mx-spring),
                border-radius var(--mx-t-base) var(--mx-ease);
}
.crm-brand-lockup:hover .crm-brand-logo {
    transform: rotate(-4deg) scale(1.06);
    border-radius: var(--mx-r-md) !important;
}
html[data-crm-theme="dark"] .crm-brand-logo { background: var(--mx-n-0) !important; color: var(--mx-n-900) !important; }

.crm-brand-kicker {
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}
.crm-brand-title,
.crm-brand-title-dark {
    color: var(--mx-text) !important;
    font-family: var(--mx-font-display) !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

.crm-sidebar-collapse {
    width: 28px !important;
    height: 28px !important;
    border-radius: var(--mx-r-sm) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    color: var(--mx-text-3) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-sidebar-collapse:hover {
    background: var(--mx-surface-3) !important;
    color: var(--mx-text) !important;
    border-color: var(--mx-border-strong) !important;
}
.crm-sidebar-collapse svg { transition: transform var(--mx-t-base) var(--mx-spring); }
html[data-crm-sidebar="collapsed"] .crm-sidebar-collapse svg { transform: rotate(180deg); }

/* -- Workspace chip ------------------------------------------------------ */
.crm-sidebar-workspace {
    margin: 14px 14px 10px !important;
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface-2) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-sidebar-workspace:hover {
    border-color: var(--mx-accent-line) !important;
    background: var(--mx-accent-soft) !important;
}
.crm-workspace-mark {
    width: 28px !important;
    height: 28px !important;
    border-radius: var(--mx-r-xs) !important;
    background: var(--mx-surface) !important;
    border: 1px solid var(--mx-border) !important;
    color: var(--mx-text-2) !important;
}
.crm-workspace-mark svg { width: 15px; height: 15px; }
.crm-workspace-copy span {
    color: var(--mx-text-4) !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
}
.crm-workspace-copy strong {
    color: var(--mx-text) !important;
    font-size: 11.5px !important;
    font-weight: 650 !important;
}
.crm-workspace-status {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: var(--mx-verdant) !important;
    box-shadow: 0 0 0 0 rgba(18, 128, 92, .45) !important;
    animation: mx-pulse-ring 2.6s var(--mx-ease-in-out) infinite;
}

/* -- Primary create action ---------------------------------------------- */
.crm-sidebar-quick-actions { padding: 0 14px 12px !important; }
.crm-sidebar-create {
    position: relative;
    overflow: hidden;
    height: 38px !important;
    gap: 9px !important;
    padding: 0 12px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid transparent !important;
    background: var(--mx-n-900) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: var(--mx-shadow-sm) !important;
    transition: transform var(--mx-t-fast) var(--mx-ease),
                box-shadow var(--mx-t-base) var(--mx-ease),
                background-color var(--mx-t-base) var(--mx-ease) !important;
}
.crm-sidebar-create::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.16) 48%, transparent 76%);
    transform: translateX(-120%);
    transition: transform var(--mx-t-slower) var(--mx-ease);
}
.crm-sidebar-create:hover::before { transform: translateX(120%); }
.crm-sidebar-create:hover {
    background: var(--mx-accent) !important;
    box-shadow: var(--mx-shadow-md) !important;
    transform: translateY(-1px);
}
.crm-sidebar-create:active { transform: translateY(0) scale(.985); }
.crm-sidebar-create svg { width: 16px; height: 16px; }
.crm-sidebar-create kbd {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: var(--mx-r-xs);
    background: rgba(255,255,255,.14);
    font-family: var(--mx-font-data);
    font-size: 9px;
}
html[data-crm-theme="dark"] .crm-sidebar-create { background: var(--mx-accent) !important; }

/* -- Navigation groups --------------------------------------------------- */
.sidebar-scroll { padding: 2px 14px 14px !important; }
.crm-nav-group { margin-bottom: 18px !important; }

.sidebar-section-label {
    padding: 0 8px 7px !important;
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .17em !important;
    text-transform: uppercase !important;
}
.crm-nav-items { display: flex; flex-direction: column; gap: 1px; }

/* -- SIGNATURE: the live rail ------------------------------------------- */
.sidebar-link,
.crm-nav-items > a {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    height: 36px !important;
    padding: 0 10px 0 12px !important;
    border-radius: var(--mx-r-sm) !important;
    background: transparent !important;
    color: var(--mx-text-2) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    letter-spacing: -0.008em !important;
    isolation: isolate;
    transition: color var(--mx-t-fast) var(--mx-ease),
                background-color var(--mx-t-fast) var(--mx-ease),
                padding-left var(--mx-t-base) var(--mx-ease) !important;
}

.sidebar-link::before,
.crm-nav-items > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: var(--mx-rail);
    height: 0;
    border-radius: 0 var(--mx-r-pill) var(--mx-r-pill) 0;
    background: var(--mx-accent);
    transform: translateY(-50%);
    transition: height var(--mx-t-base) var(--mx-spring);
}

.sidebar-link:hover,
.crm-nav-items > a:hover {
    background: var(--mx-surface-3) !important;
    color: var(--mx-text) !important;
    padding-left: 15px !important;
}
.sidebar-link:hover::before,
.crm-nav-items > a:hover::before { height: 14px; }

.sidebar-link.active,
.sidebar-link[aria-current="page"],
.crm-nav-items > a.active,
.crm-nav-items > a[aria-current="page"] {
    background: var(--mx-accent-soft) !important;
    color: var(--mx-accent-hover) !important;
    font-weight: 650 !important;
    padding-left: 15px !important;
}
.sidebar-link.active::before,
.sidebar-link[aria-current="page"]::before,
.crm-nav-items > a.active::before,
.crm-nav-items > a[aria-current="page"]::before { height: 20px; }

.sidebar-link svg,
.crm-nav-items > a svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    stroke-width: 1.7;
    opacity: .78;
    transition: opacity var(--mx-t-fast) var(--mx-ease),
                transform var(--mx-t-base) var(--mx-spring);
}
.sidebar-link:hover svg,
.crm-nav-items > a:hover svg { opacity: 1; transform: scale(1.08); }
.sidebar-link.active svg,
.crm-nav-items > a.active svg { opacity: 1; }

/* Collapsed rail: icons centred, labels tucked away, tooltip on hover. */
html[data-crm-sidebar="collapsed"] .sidebar-link,
html[data-crm-sidebar="collapsed"] .crm-nav-items > a {
    justify-content: center !important;
    padding: 0 !important;
}
html[data-crm-sidebar="collapsed"] .sidebar-link span,
html[data-crm-sidebar="collapsed"] .crm-nav-items > a span { display: none !important; }
html[data-crm-sidebar="collapsed"] .sidebar-section-label { text-align: center; opacity: .5; }

/* -- Sidebar footer ------------------------------------------------------ */
.sidebar-footer {
    padding: 12px 14px !important;
    border-top: 1px solid var(--mx-border-soft) !important;
    background: var(--mx-surface) !important;
}
.crm-sidebar-account {
    gap: 10px !important;
    padding: 8px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid transparent !important;
    background: var(--mx-surface-2) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-sidebar-account:hover {
    background: var(--mx-surface-3) !important;
    border-color: var(--mx-border) !important;
}
.crm-sidebar-account-avatar {
    width: 30px !important;
    height: 30px !important;
    border-radius: var(--mx-r-sm) !important;
    background: var(--mx-accent) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
.crm-sidebar-account-name { color: var(--mx-text) !important; font-size: 11.5px !important; font-weight: 650 !important; }
.crm-sidebar-account-role { color: var(--mx-text-4) !important; font-size: 9.5px !important; }
.crm-sidebar-signout {
    width: 28px !important;
    height: 28px !important;
    border-radius: var(--mx-r-sm) !important;
    color: var(--mx-text-4) !important;
    background: transparent !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-sidebar-signout:hover {
    background: var(--mx-crimson-s) !important;
    color: var(--mx-crimson) !important;
}
.crm-sidebar-security {
    margin-top: 9px !important;
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    letter-spacing: .04em !important;
    display: flex; align-items: center; gap: 6px;
}
.crm-sidebar-security span {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--mx-verdant);
    animation: mx-blink 3s var(--mx-ease-in-out) infinite;
}

/* --------------------------------------------------------------------------
   5. SHELL — TOPBAR
   Flat at rest; lifts into a glass bar once the page scrolls.
   -------------------------------------------------------------------------- */

.crm-topbar {
    height: var(--mx-topbar-h) !important;
    background: color-mix(in srgb, var(--mx-surface) 82%, transparent) !important;
    border-bottom: 1px solid var(--mx-border-soft) !important;
    box-shadow: none !important;
    backdrop-filter: saturate(180%) blur(16px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(16px) !important;
    transition: box-shadow var(--mx-t-slow) var(--mx-ease),
                border-color var(--mx-t-slow) var(--mx-ease),
                background-color var(--mx-t-slow) var(--mx-ease),
                left var(--mx-t-base) var(--mx-ease) !important;
}
body[data-mx-scrolled="true"] .crm-topbar {
    border-bottom-color: var(--mx-border) !important;
    box-shadow: 0 1px 0 var(--mx-border), 0 8px 24px -18px rgba(16, 22, 34, .40) !important;
}

.crm-topbar-inner {
    height: 100% !important;
    padding: 0 var(--mx-gap) !important;
    gap: 14px !important;
    display: flex !important;
    align-items: center !important;
}

/* -- Page heading -------------------------------------------------------- */
.crm-page-breadcrumb {
    display: flex; align-items: center; gap: 5px;
    color: var(--mx-text-4) !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
}
.crm-page-breadcrumb svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; }
.crm-page-breadcrumb strong { color: var(--mx-text-2) !important; font-weight: 700 !important; }

.crm-title-row { display: flex; align-items: center; gap: 10px; margin-top: 1px; }
.crm-page-title {
    font-family: var(--mx-font-display) !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.028em !important;
    color: var(--mx-text) !important;
    line-height: 1.15 !important;
}

.crm-scope-pill {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 190px;
    height: 22px;
    padding: 0 9px !important;
    border-radius: var(--mx-r-pill) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface-2) !important;
    color: var(--mx-text-3) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-scope-pill:hover { border-color: var(--mx-accent-line) !important; color: var(--mx-text-2) !important; }
.crm-scope-icon {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--mx-brass-500) !important;
}

/* -- Search -------------------------------------------------------------- */
.crm-topbar-search-wrap { position: relative; }
.crm-topbar-search {
    width: 260px !important;
    height: 36px !important;
    padding: 0 34px 0 34px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface-2) !important;
    color: var(--mx-text) !important;
    font-size: 12px !important;
    transition: width var(--mx-t-slow) var(--mx-ease),
                border-color var(--mx-t-base) var(--mx-ease),
                background-color var(--mx-t-base) var(--mx-ease),
                box-shadow var(--mx-t-base) var(--mx-ease) !important;
}
.crm-topbar-search::placeholder { color: var(--mx-text-4) !important; }
.crm-topbar-search:focus {
    width: 320px !important;
    outline: none !important;
    background: var(--mx-surface) !important;
    border-color: var(--mx-accent) !important;
    box-shadow: var(--mx-shadow-focus) !important;
}
.crm-search-icon {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--mx-text-4);
    pointer-events: none;
    transition: color var(--mx-t-base) var(--mx-ease);
}
.crm-topbar-search-wrap:focus-within .crm-search-icon { color: var(--mx-accent); }
.crm-search-shortcut {
    position: absolute; right: 9px; top: 50%;
    transform: translateY(-50%);
    min-width: 18px; height: 18px;
    display: grid; place-items: center;
    border-radius: var(--mx-r-xs);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface);
    color: var(--mx-text-4);
    font-family: var(--mx-font-data);
    font-size: 9px;
    transition: opacity var(--mx-t-fast) var(--mx-ease);
}
.crm-topbar-search-wrap:focus-within .crm-search-shortcut { opacity: 0; }

/* -- Topbar controls ----------------------------------------------------- */
.crm-command-button {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px !important;
    padding: 0 10px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface-2) !important;
    color: var(--mx-text-3) !important;
    font-size: 11.5px !important;
    font-weight: 550 !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-command-button:hover {
    background: var(--mx-surface) !important;
    border-color: var(--mx-border-strong) !important;
    color: var(--mx-text) !important;
    box-shadow: var(--mx-shadow-xs) !important;
}
.crm-command-button kbd {
    padding: 2px 5px;
    border-radius: var(--mx-r-xs);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface);
    font-family: var(--mx-font-data);
    font-size: 9px;
    color: var(--mx-text-4);
}

.crm-icon-button {
    width: 36px !important;
    height: 36px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--mx-text-3) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-icon-button:hover {
    background: var(--mx-surface-3) !important;
    border-color: var(--mx-border) !important;
    color: var(--mx-text) !important;
}
.crm-icon-button:active { transform: scale(.94); }
.crm-icon-button svg { transition: transform var(--mx-t-base) var(--mx-spring); }
#notificationButton:hover svg { animation: mx-bell 700ms var(--mx-ease); transform-origin: 50% 15%; }
.crm-pin-page:hover svg { transform: rotate(-18deg) scale(1.08); }
.crm-pin-page.is-pinned {
    background: var(--mx-brass-50) !important;
    border-color: var(--mx-brass-300) !important;
    color: var(--mx-brass-600) !important;
}

.crm-preferences-button {
    width: 36px !important; height: 36px !important;
    display: inline-grid !important; place-items: center !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface-2) !important;
    color: var(--mx-text-3) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-preferences-button:hover {
    color: var(--mx-text) !important;
    border-color: var(--mx-border-strong) !important;
}
.crm-preferences-button:hover svg { transform: rotate(90deg); }
.crm-preferences-button svg { transition: transform var(--mx-t-slow) var(--mx-ease); }

#notificationCount {
    background: var(--mx-crimson) !important;
    border: 2px solid var(--mx-surface) !important;
    font-family: var(--mx-font-data) !important;
    font-size: 9px !important;
    animation: mx-pop-in var(--mx-t-base) var(--mx-spring);
}

/* -- Quick create -------------------------------------------------------- */
.crm-topbar-primary-action {
    position: relative;
    overflow: hidden;
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px !important;
    padding: 0 13px !important;
    border-radius: var(--mx-r-md) !important;
    border: none !important;
    background: var(--mx-n-900) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: var(--mx-shadow-sm) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-topbar-primary-action:hover {
    background: var(--mx-accent) !important;
    box-shadow: var(--mx-shadow-md) !important;
    transform: translateY(-1px);
}
.crm-topbar-primary-action:active { transform: translateY(0) scale(.98); }
.crm-topbar-primary-action svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; transition: transform var(--mx-t-base) var(--mx-ease); }
.crm-quick-create[data-open="true"] .crm-topbar-primary-action svg { transform: rotate(180deg); }
html[data-crm-theme="dark"] .crm-topbar-primary-action { background: var(--mx-accent) !important; }

.crm-quick-create-menu,
.crm-notification-dropdown {
    border-radius: var(--mx-r-lg) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    box-shadow: var(--mx-shadow-lg) !important;
    overflow: hidden;
    transform-origin: top right;
    animation: mx-menu-in 240ms var(--mx-spring);
}
.crm-quick-create-title {
    padding: 11px 14px 7px !important;
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}
.crm-quick-create-menu a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 14px !important;
    color: var(--mx-text) !important;
    transition: background-color var(--mx-t-fast) var(--mx-ease),
                padding-left var(--mx-t-base) var(--mx-ease) !important;
}
.crm-quick-create-menu a:hover { background: var(--mx-surface-3) !important; padding-left: 18px !important; }
.crm-quick-create-menu a svg { width: 16px; height: 16px; color: var(--mx-text-3); }
.crm-quick-create-menu a strong { display: block; font-size: 12px; font-weight: 600; }
.crm-quick-create-menu a small { display: block; margin-top: 1px; color: var(--mx-text-4); font-size: 10px; }

/* -- Clock --------------------------------------------------------------- */
.crm-topbar-clock {
    display: flex; flex-direction: column; align-items: flex-end;
    padding: 0 4px;
    line-height: 1.1;
}
.crm-topbar-clock #crmUkTime {
    font-family: var(--mx-font-data) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: var(--mx-text) !important;
    font-variant-numeric: tabular-nums;
}
.crm-topbar-clock small {
    color: var(--mx-text-4) !important;
    font-size: 8px !important;
    font-weight: 600 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
}

/* -- User card ----------------------------------------------------------- */
.crm-user-card {
    display: flex; align-items: center; gap: 9px;
    height: 40px !important;
    padding: 0 9px 0 5px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid transparent !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-user-card:hover {
    background: var(--mx-surface-3) !important;
    border-color: var(--mx-border) !important;
}
.crm-user-avatar {
    width: 30px !important; height: 30px !important;
    display: grid; place-items: center;
    border-radius: var(--mx-r-sm) !important;
    background: var(--mx-accent) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    overflow: hidden;
    transition: transform var(--mx-t-base) var(--mx-spring);
}
.crm-user-card:hover .crm-user-avatar { transform: scale(1.06); }
.crm-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.crm-user-name { color: var(--mx-text) !important; font-size: 11.5px !important; font-weight: 650 !important; line-height: 1.2; }
.crm-user-meta span { color: var(--mx-text-4) !important; font-size: 9.5px !important; }
.crm-user-meta small { display: none; }
.crm-user-chevron { width: 13px; height: 13px; stroke: var(--mx-text-4); fill: none; stroke-width: 2; transition: transform var(--mx-t-base) var(--mx-ease); }
.crm-user-card:hover .crm-user-chevron { transform: translateY(1px); }

/* -- Notifications dropdown --------------------------------------------- */
.crm-notification-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    padding: 14px !important;
    border-bottom: 1px solid var(--mx-border-soft) !important;
    background: var(--mx-surface-2) !important;
}
.crm-notification-title { font-family: var(--mx-font-display); font-size: 13px; font-weight: 700; color: var(--mx-text); }
.crm-notification-subtitle { margin-top: 2px; font-size: 10px; color: var(--mx-text-4); }
.crm-notification-readall {
    padding: 5px 9px;
    border-radius: var(--mx-r-sm);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface);
    color: var(--mx-text-2);
    font-size: 10px;
    font-weight: 600;
    transition: all var(--mx-t-base) var(--mx-ease);
}
.crm-notification-readall:hover { border-color: var(--mx-accent); color: var(--mx-accent); }
.crm-notification-footer {
    padding: 10px 14px !important;
    border-top: 1px solid var(--mx-border-soft) !important;
    background: var(--mx-surface-2) !important;
    text-align: center;
}
.crm-notification-footer a { color: var(--mx-accent) !important; font-size: 11px; font-weight: 650; }
#notificationList > a { transition: background-color var(--mx-t-fast) var(--mx-ease), padding-left var(--mx-t-base) var(--mx-ease); }
#notificationList > a:hover { background: var(--mx-surface-2) !important; padding-left: 20px !important; }

/* --------------------------------------------------------------------------
   6. CONTENT CANVAS
   -------------------------------------------------------------------------- */

.crm-main { background: var(--mx-canvas) !important; }

.page-wrapper,
.invoice-page-padding {
    padding: var(--mx-gap) !important;
}
.crm-page-wrapper { max-width: 1560px !important; margin: 0 auto !important; }
.crm-page-content { display: block; }

/* --------------------------------------------------------------------------
   7. SURFACES — the card is the atom of this interface
   Targets both the Tailwind combos used across the views and the crm-* panels.
   -------------------------------------------------------------------------- */

.crm-app-body .bg-white,
.crm-app-body .crm-v4-panel,
.crm-app-body .crm-v4-chart-card,
.crm-app-body .crm-card,
.crm-app-body .mx-card {
    background: var(--mx-surface) !important;
    color: var(--mx-text);
}

.crm-app-body .rounded-2xl,
.crm-app-body .rounded-xl {
    border-radius: var(--mx-r-lg) !important;
}
.crm-app-body .rounded-3xl { border-radius: var(--mx-r-2xl) !important; }
.crm-app-body .rounded-lg { border-radius: var(--mx-r-md) !important; }

.crm-app-body .border-slate-200 { border-color: var(--mx-border) !important; }
.crm-app-body .border-slate-100 { border-color: var(--mx-border-soft) !important; }
.crm-app-body .border-slate-300 { border-color: var(--mx-border-strong) !important; }

.crm-app-body .shadow-sm { box-shadow: var(--mx-shadow-xs) !important; }
.crm-app-body .shadow,
.crm-app-body .shadow-md { box-shadow: var(--mx-shadow-sm) !important; }
.crm-app-body .shadow-lg { box-shadow: var(--mx-shadow-md) !important; }
.crm-app-body .shadow-xl,
.crm-app-body .shadow-2xl { box-shadow: var(--mx-shadow-lg) !important; }

/* The panel: hairline border, no ambient shadow at rest, lift on hover. */
.crm-app-body .bg-white.rounded-2xl,
.crm-app-body .bg-white.rounded-xl,
.crm-app-body .crm-v4-panel,
.crm-app-body .crm-v4-chart-card {
    border: 1px solid var(--mx-border) !important;
    box-shadow: var(--mx-shadow-xs) !important;
    transition: box-shadow var(--mx-t-base) var(--mx-ease),
                border-color var(--mx-t-base) var(--mx-ease),
                transform var(--mx-t-base) var(--mx-ease) !important;
}
.crm-app-body .crm-v4-panel:hover,
.crm-app-body .crm-v4-chart-card:hover {
    box-shadow: var(--mx-shadow-md) !important;
    border-color: var(--mx-border-strong) !important;
}

.crm-v4-panel-head {
    padding: 15px 18px !important;
    border-bottom: 1px solid var(--mx-border-soft) !important;
    background: transparent !important;
}
.crm-v4-eyebrow {
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .17em !important;
    text-transform: uppercase !important;
}

/* --------------------------------------------------------------------------
   8. KPI / STAT BLOCKS
   The number is the content. Everything else steps back.
   -------------------------------------------------------------------------- */

.crm-v4-kpi {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--mx-border) !important;
    border-radius: var(--mx-r-lg) !important;
    background: var(--mx-surface) !important;
    box-shadow: var(--mx-shadow-xs) !important;
    transition: transform var(--mx-t-base) var(--mx-ease),
                box-shadow var(--mx-t-base) var(--mx-ease),
                border-color var(--mx-t-base) var(--mx-ease) !important;
}
/* Echo of the sidebar rail — same motif, same meaning. */
.crm-v4-kpi::before {
    content: '';
    position: absolute;
    left: 0; top: 18%;
    width: var(--mx-rail);
    height: 0;
    border-radius: 0 var(--mx-r-pill) var(--mx-r-pill) 0;
    background: var(--mx-accent);
    transition: height var(--mx-t-slow) var(--mx-spring);
}
.crm-v4-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--mx-shadow-md) !important;
    border-color: var(--mx-border-strong) !important;
}
.crm-v4-kpi:hover::before { height: 64%; }

.crm-v4-kpi-icon {
    width: 34px !important; height: 34px !important;
    display: grid; place-items: center;
    border-radius: var(--mx-r-sm) !important;
    background: var(--mx-surface-3) !important;
    border: 1px solid var(--mx-border-soft) !important;
    color: var(--mx-text-2) !important;
    transition: all var(--mx-t-base) var(--mx-spring);
}
.crm-v4-kpi:hover .crm-v4-kpi-icon {
    background: var(--mx-accent-soft) !important;
    border-color: var(--mx-accent-line) !important;
    color: var(--mx-accent) !important;
    transform: scale(1.06) rotate(-3deg);
}

.crm-v4-stat strong,
.mx-kpi-value {
    font-family: var(--mx-font-data) !important;
    font-variant-numeric: tabular-nums;
    font-weight: 600 !important;
    letter-spacing: -0.035em !important;
    color: var(--mx-text) !important;
}

/* --------------------------------------------------------------------------
   9. TABLES — dense, scannable, quietly interactive
   -------------------------------------------------------------------------- */

.crm-app-body table { border-collapse: separate !important; border-spacing: 0 !important; }

.crm-app-body thead th,
.crm-app-body .bg-slate-50 th {
    background: var(--mx-surface-2) !important;
    border-bottom: 1px solid var(--mx-border) !important;
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .15em !important;
    text-transform: uppercase !important;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.crm-app-body tbody tr {
    position: relative;
    transition: background-color var(--mx-t-fast) var(--mx-ease) !important;
}
.crm-app-body tbody tr + tr { border-top: 1px solid var(--mx-border-soft); }
.crm-app-body tbody tr:hover { background: var(--mx-surface-2) !important; }

/* Row-level echo of the rail: a hovered row announces itself on its edge. */
.crm-app-body tbody tr td:first-child { position: relative; }
.crm-app-body tbody tr td:first-child::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: var(--mx-rail);
    border-radius: var(--mx-r-pill);
    background: var(--mx-accent);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform var(--mx-t-base) var(--mx-spring);
}
.crm-app-body tbody tr:hover td:first-child::before { transform: scaleY(1); }

.crm-app-body tbody td {
    color: var(--mx-text-2) !important;
    font-size: 11.5px !important;
    vertical-align: middle;
}

.crm-responsive-table,
.overflow-x-auto {
    border-radius: var(--mx-r-lg);
    scrollbar-width: thin;
}

/* --------------------------------------------------------------------------
   10. BUTTONS
   Three tiers only: solid (one per view), quiet, and ghost.
   -------------------------------------------------------------------------- */

.crm-app-body button,
.crm-app-body a[class*="bg-indigo"],
.crm-app-body a[class*="bg-slate-9"] {
    transition: background-color var(--mx-t-base) var(--mx-ease),
                border-color var(--mx-t-base) var(--mx-ease),
                color var(--mx-t-base) var(--mx-ease),
                box-shadow var(--mx-t-base) var(--mx-ease),
                transform var(--mx-t-fast) var(--mx-ease) !important;
}

.crm-app-body .bg-indigo-600,
.crm-app-body .bg-indigo-700,
.crm-app-body .bg-slate-900,
.crm-app-body .bg-slate-950,
.crm-app-body .crm-v4-primary {
    background: var(--mx-n-900) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: var(--mx-shadow-xs) !important;
}
html[data-crm-theme="dark"] .crm-app-body .bg-indigo-600,
html[data-crm-theme="dark"] .crm-app-body .bg-indigo-700,
html[data-crm-theme="dark"] .crm-app-body .bg-slate-900,
html[data-crm-theme="dark"] .crm-app-body .bg-slate-950,
html[data-crm-theme="dark"] .crm-app-body .crm-v4-primary {
    background: var(--mx-accent) !important;
}

.crm-app-body button.bg-indigo-600:hover,
.crm-app-body button.bg-indigo-700:hover,
.crm-app-body button.bg-slate-900:hover,
.crm-app-body button.bg-slate-950:hover,
.crm-app-body a.bg-indigo-600:hover,
.crm-app-body a.bg-indigo-700:hover,
.crm-app-body a.bg-slate-900:hover,
.crm-app-body a.bg-slate-950:hover,
.crm-app-body .crm-v4-primary:hover {
    background: var(--mx-accent) !important;
    box-shadow: var(--mx-shadow-md) !important;
    transform: translateY(-1px);
}
.crm-app-body button:active,
.crm-app-body .crm-v4-primary:active { transform: translateY(0) scale(.985); }

.crm-v4-secondary,
.crm-v4-quiet-button {
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    color: var(--mx-text-2) !important;
    border-radius: var(--mx-r-md) !important;
    font-weight: 600 !important;
}
.crm-v4-secondary:hover,
.crm-v4-quiet-button:hover {
    background: var(--mx-surface-3) !important;
    border-color: var(--mx-border-strong) !important;
    color: var(--mx-text) !important;
}

/* Ripple origin for pointer feedback (coordinates set by JS). */
.mx-ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: .18;
    transform: scale(0);
    pointer-events: none;
    animation: mx-ripple 620ms var(--mx-ease) forwards;
}

/* --------------------------------------------------------------------------
   11. FORMS
   -------------------------------------------------------------------------- */

.crm-app-body input[type="text"],
.crm-app-body input[type="email"],
.crm-app-body input[type="password"],
.crm-app-body input[type="number"],
.crm-app-body input[type="search"],
.crm-app-body input[type="tel"],
.crm-app-body input[type="url"],
.crm-app-body input[type="date"],
.crm-app-body input[type="time"],
.crm-app-body input[type="datetime-local"],
.crm-app-body select,
.crm-app-body textarea,
.crm-v4-field {
    border: 1px solid var(--mx-border) !important;
    border-radius: var(--mx-r-md) !important;
    background: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    transition: border-color var(--mx-t-base) var(--mx-ease),
                box-shadow var(--mx-t-base) var(--mx-ease),
                background-color var(--mx-t-base) var(--mx-ease) !important;
}
.crm-app-body input::placeholder,
.crm-app-body textarea::placeholder { color: var(--mx-text-4) !important; }

.crm-app-body input:hover:not(:focus),
.crm-app-body select:hover:not(:focus),
.crm-app-body textarea:hover:not(:focus) { border-color: var(--mx-border-strong) !important; }

.crm-app-body input:focus,
.crm-app-body select:focus,
.crm-app-body textarea:focus,
.crm-v4-field:focus {
    outline: none !important;
    border-color: var(--mx-accent) !important;
    box-shadow: var(--mx-shadow-focus) !important;
}

.crm-app-body label {
    color: var(--mx-text-2) !important;
    font-weight: 600 !important;
}

/* Number inputs holding money read as data, not prose. */
.crm-app-body input[type="number"] {
    font-family: var(--mx-font-data) !important;
    font-variant-numeric: tabular-nums;
}

/* Toggle switch */
.crm-switch input:checked + span { background: var(--mx-accent) !important; }
.crm-switch span { transition: background-color var(--mx-t-base) var(--mx-ease) !important; }
.crm-switch span::after { transition: transform var(--mx-t-base) var(--mx-spring) !important; }

/* Segmented control */
.crm-segmented {
    border: 1px solid var(--mx-border) !important;
    border-radius: var(--mx-r-md) !important;
    background: var(--mx-surface-3) !important;
    padding: 3px !important;
}
.crm-segmented button {
    border-radius: var(--mx-r-sm) !important;
    color: var(--mx-text-3) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-segmented button[aria-pressed="true"],
.crm-segmented button.active {
    background: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    box-shadow: var(--mx-shadow-xs) !important;
}

/* --------------------------------------------------------------------------
   12. BADGES & STATUS
   Status colour is the only decorative colour in the table body.
   -------------------------------------------------------------------------- */

.crm-app-body .rounded-full[class*="bg-"],
.crm-v4-status {
    border-radius: var(--mx-r-pill) !important;
    font-weight: 650 !important;
    letter-spacing: .02em !important;
    transition: transform var(--mx-t-fast) var(--mx-ease),
                box-shadow var(--mx-t-base) var(--mx-ease) !important;
}
.crm-app-body .rounded-full[class*="bg-"]:hover { transform: translateY(-1px); }

.crm-app-body .bg-emerald-50 { background: var(--mx-verdant-s) !important; }
.crm-app-body .text-emerald-700,
.crm-app-body .text-emerald-800 { color: var(--mx-verdant) !important; }
.crm-app-body .bg-rose-50 { background: var(--mx-crimson-s) !important; }
.crm-app-body .text-rose-700,
.crm-app-body .text-rose-800 { color: var(--mx-crimson) !important; }
.crm-app-body .bg-amber-50 { background: var(--mx-amber-s) !important; }
.crm-app-body .text-amber-700,
.crm-app-body .text-amber-800 { color: var(--mx-amber) !important; }
.crm-app-body .bg-indigo-50 { background: var(--mx-accent-soft) !important; }
.crm-app-body .text-indigo-600,
.crm-app-body .text-indigo-700 { color: var(--mx-accent) !important; }
.crm-app-body .border-indigo-200 { border-color: var(--mx-accent-line) !important; }
.crm-app-body .bg-slate-50 { background: var(--mx-surface-2) !important; }
.crm-app-body .bg-slate-100 { background: var(--mx-surface-3) !important; }
.crm-app-body .text-slate-400 { color: var(--mx-text-4) !important; }
.crm-app-body .text-slate-500 { color: var(--mx-text-3) !important; }
.crm-app-body .text-slate-600 { color: var(--mx-text-3) !important; }
.crm-app-body .text-slate-700 { color: var(--mx-text-2) !important; }
.crm-app-body .text-slate-800,
.crm-app-body .text-slate-900,
.crm-app-body .text-slate-950 { color: var(--mx-text) !important; }

/* --------------------------------------------------------------------------
   13. COMMAND CENTRE
   -------------------------------------------------------------------------- */

.crm-command-backdrop {
    background: rgba(11, 13, 17, .40) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    animation: mx-fade-in var(--mx-t-base) var(--mx-ease);
}
.crm-command-dialog {
    border-radius: var(--mx-r-xl) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    box-shadow: var(--mx-shadow-xl) !important;
    overflow: hidden;
    animation: mx-dialog-in 320ms var(--mx-spring);
}
.crm-command-searchbar {
    display: flex; align-items: center; gap: 11px;
    padding: 15px 18px !important;
    border-bottom: 1px solid var(--mx-border-soft) !important;
}
.crm-command-searchbar svg { width: 17px; height: 17px; stroke: var(--mx-text-4); fill: none; stroke-width: 2; }
#crmCommandInput {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--mx-text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}
#crmCommandInput:focus { outline: none !important; box-shadow: none !important; }
.crm-command-searchbar kbd,
.crm-command-dialog footer kbd {
    padding: 3px 6px;
    border-radius: var(--mx-r-xs);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface-2);
    color: var(--mx-text-4);
    font-family: var(--mx-font-data);
    font-size: 9.5px;
}
.crm-command-section { padding: 8px 8px 4px; }
.crm-command-section h2 {
    padding: 6px 10px !important;
    color: var(--mx-text-4) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}
.crm-command-list > a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px !important;
    border-radius: var(--mx-r-sm) !important;
    color: var(--mx-text) !important;
    transition: background-color var(--mx-t-fast) var(--mx-ease),
                padding-left var(--mx-t-base) var(--mx-ease) !important;
}
.crm-command-list > a:hover,
.crm-command-list > a.is-active,
.crm-command-list > a[data-active="true"] {
    background: var(--mx-accent-soft) !important;
    padding-left: 14px !important;
}
.crm-command-list > a svg { width: 16px; height: 16px; color: var(--mx-text-3); flex-shrink: 0; }
.crm-command-list > a strong { display: block; font-size: 12.5px; font-weight: 600; }
.crm-command-list > a small { display: block; margin-top: 1px; color: var(--mx-text-4); font-size: 10px; }
.crm-command-list > a kbd { margin-left: auto; }
.crm-command-dialog footer {
    display: flex; gap: 16px;
    padding: 10px 18px !important;
    border-top: 1px solid var(--mx-border-soft) !important;
    background: var(--mx-surface-2) !important;
    color: var(--mx-text-4) !important;
    font-size: 10px !important;
}
.crm-command-empty { padding: 28px; text-align: center; color: var(--mx-text-4); font-size: 12px; }

/* --------------------------------------------------------------------------
   14. DRAWER, BACKDROPS, MOBILE
   -------------------------------------------------------------------------- */

.crm-preferences-drawer {
    border-left: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    box-shadow: var(--mx-shadow-xl) !important;
    transition: transform var(--mx-t-slow) var(--mx-ease) !important;
}
.crm-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px !important;
    border-bottom: 1px solid var(--mx-border-soft) !important;
}
.crm-drawer-body { padding: 18px !important; }
.crm-setting-group + .crm-setting-group {
    margin-top: 22px; padding-top: 22px;
    border-top: 1px solid var(--mx-border-soft);
}
.crm-setting-title {
    font-family: var(--mx-font-display) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: var(--mx-text) !important;
}
.crm-setting-description { margin: 3px 0 10px; color: var(--mx-text-4) !important; font-size: 10.5px !important; line-height: 1.5; }
.crm-switch-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0;
    font-size: 11.5px;
    color: var(--mx-text-2);
    border-bottom: 1px solid var(--mx-border-soft);
}

.crm-drawer-backdrop,
.crm-mobile-backdrop {
    background: rgba(11, 13, 17, .38) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    transition: opacity var(--mx-t-slow) var(--mx-ease) !important;
}

.crm-mobile-bottom-nav {
    background: color-mix(in srgb, var(--mx-surface) 88%, transparent) !important;
    border-top: 1px solid var(--mx-border) !important;
    backdrop-filter: saturate(180%) blur(18px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(18px) !important;
    box-shadow: 0 -1px 0 var(--mx-border) !important;
}
.crm-mobile-bottom-nav a,
.crm-mobile-bottom-nav button {
    color: var(--mx-text-4) !important;
    transition: color var(--mx-t-base) var(--mx-ease) !important;
}
.crm-mobile-bottom-nav a.active { color: var(--mx-accent) !important; }
.crm-mobile-bottom-nav a.active svg { transform: translateY(-1px) scale(1.06); }
.crm-mobile-bottom-nav svg { transition: transform var(--mx-t-base) var(--mx-spring); }

.crm-mobile-menu-button,
.crm-mobile-search-button {
    width: 36px !important; height: 36px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    color: var(--mx-text-2) !important;
}
.crm-mobile-search-panel {
    border-bottom: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
}

/* --------------------------------------------------------------------------
   15. AUTHENTICATION
   Two panes: a graphite brand wall and a paper form. The wall carries a
   slow, ambient rail-grid — the same motif, at architectural scale.
   -------------------------------------------------------------------------- */

body.crm-auth-body { background: var(--mx-n-950); }

.crm-auth-v4 {
    min-height: 100dvh;
    display: grid !important;
    grid-template-columns: 1.05fr .95fr;
    background: var(--mx-canvas) !important;
}
@media (max-width: 1024px) { .crm-auth-v4 { grid-template-columns: 1fr; } }

.crm-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 44px !important;
    background: var(--mx-n-950) !important;
    color: #fff !important;
}
.crm-auth-brand-grid {
    position: absolute !important;
    inset: -40% !important;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 10%, transparent 70%);
    animation: mx-drift 42s linear infinite;
}
.crm-auth-brand::after {
    content: '';
    position: absolute;
    left: -10%; bottom: -30%;
    width: 60%; aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43, 80, 236, .34), transparent 62%);
    filter: blur(20px);
    animation: mx-breathe 12s var(--mx-ease-in-out) infinite;
    pointer-events: none;
}
.crm-auth-brand > * { position: relative; z-index: 1; }

.crm-auth-logo {
    width: 44px !important; height: 44px !important;
    display: grid; place-items: center;
    border-radius: var(--mx-r-md) !important;
    background: #fff !important;
    color: var(--mx-n-950) !important;
    font-family: var(--mx-font-display) !important;
    font-size: 19px !important;
    font-weight: 700 !important;
}
.crm-auth-logo-copy strong,
.crm-auth-logo-copy > *:first-child {
    font-family: var(--mx-font-display);
    letter-spacing: -0.02em;
}
.crm-auth-badge {
    display: inline-flex; align-items: center;
    padding: 5px 11px !important;
    border-radius: var(--mx-r-pill) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    background: rgba(255,255,255,.06) !important;
    color: rgba(255,255,255,.72) !important;
    font-size: 9.5px !important;
    font-weight: 600 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
}
.crm-auth-story h1,
.crm-auth-story h2 {
    font-family: var(--mx-font-display) !important;
    font-size: clamp(28px, 3.2vw, 42px) !important;
    font-weight: 700 !important;
    letter-spacing: -0.035em !important;
    line-height: 1.08 !important;
    color: #fff !important;
}
.crm-auth-capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crm-auth-capability {
    padding: 13px 14px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    background: rgba(255,255,255,.035) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-auth-capability:hover {
    background: rgba(255,255,255,.07) !important;
    border-color: rgba(255,255,255,.20) !important;
    transform: translateY(-2px);
}
.crm-auth-capability strong { color: #fff; font-size: 12px; font-weight: 650; }
.crm-auth-capability span,
.crm-auth-capability p { color: rgba(255,255,255,.55); font-size: 10.5px; line-height: 1.5; }
.crm-auth-brand-footer { color: rgba(255,255,255,.40) !important; font-size: 10px !important; }

.crm-auth-form-area {
    display: grid !important;
    place-items: center !important;
    padding: 40px 28px !important;
    background: var(--mx-canvas) !important;
}
.crm-auth-form-shell {
    width: 100%;
    max-width: 392px;
    animation: mx-rise-in 620ms var(--mx-ease) both;
}
.crm-auth-form-head h1,
.crm-auth-form-head h2 {
    font-family: var(--mx-font-display) !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    color: var(--mx-text) !important;
}
.crm-auth-form-head p { color: var(--mx-text-3) !important; font-size: 12.5px !important; margin-top: 5px; }
.crm-auth-form { display: grid; gap: 15px; margin-top: 24px; }
.crm-auth-field { display: grid; gap: 6px; }
.crm-auth-field label {
    color: var(--mx-text-2) !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    letter-spacing: .01em;
}
.crm-auth-input-wrap { position: relative; display: flex; align-items: center; }
.crm-auth-input {
    width: 100%;
    height: 44px !important;
    padding: 0 14px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    font-size: 13px !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-auth-input:focus {
    outline: none !important;
    border-color: var(--mx-accent) !important;
    box-shadow: var(--mx-shadow-focus) !important;
}
.crm-auth-password-toggle {
    position: absolute; right: 6px;
    padding: 6px 9px;
    border-radius: var(--mx-r-sm);
    color: var(--mx-text-3) !important;
    font-size: 10.5px !important;
    font-weight: 650 !important;
    transition: all var(--mx-t-base) var(--mx-ease);
}
.crm-auth-password-toggle:hover { background: var(--mx-surface-3); color: var(--mx-text); }
.crm-auth-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 44px !important;
    border-radius: var(--mx-r-md) !important;
    border: none !important;
    background: var(--mx-n-900) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    box-shadow: var(--mx-shadow-sm) !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-auth-submit::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.20) 48%, transparent 76%);
    transform: translateX(-120%);
    transition: transform var(--mx-t-slower) var(--mx-ease);
}
.crm-auth-submit:hover::before { transform: translateX(120%); }
.crm-auth-submit:hover { background: var(--mx-accent) !important; box-shadow: var(--mx-shadow-md) !important; transform: translateY(-1px); }
.crm-auth-submit:active { transform: translateY(0) scale(.99); }

.crm-auth-alert {
    padding: 11px 13px !important;
    border-radius: var(--mx-r-md) !important;
    font-size: 12px !important;
    font-weight: 550 !important;
    animation: mx-shake-in 420ms var(--mx-ease);
}
.crm-auth-alert-error { border: 1px solid var(--mx-crimson) !important; background: var(--mx-crimson-s) !important; color: var(--mx-crimson) !important; }
.crm-auth-alert-success { border: 1px solid var(--mx-verdant) !important; background: var(--mx-verdant-s) !important; color: var(--mx-verdant) !important; }
.crm-auth-form-footer { margin-top: 20px; color: var(--mx-text-4) !important; font-size: 11px !important; }
.crm-auth-mobile-brand { display: none; }
@media (max-width: 1024px) {
    .crm-auth-brand { display: none !important; }
    .crm-auth-mobile-brand { display: flex !important; align-items: center; gap: 11px; margin-bottom: 26px; }
    .crm-auth-mobile-brand .crm-auth-logo { background: var(--mx-n-900) !important; color: #fff !important; }
}

/* --------------------------------------------------------------------------
   16. MAIL MODULE
   -------------------------------------------------------------------------- */

.crm-mail-page { color: var(--mx-text); }
.crm-mail-tabs {
    display: flex; gap: 3px;
    padding: 4px !important;
    border-radius: var(--mx-r-md) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface-3) !important;
}
.crm-mail-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px !important;
    border-radius: var(--mx-r-sm) !important;
    color: var(--mx-text-3) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    transition: all var(--mx-t-base) var(--mx-ease) !important;
}
.crm-mail-tab:hover { color: var(--mx-text) !important; background: var(--mx-surface-2) !important; }
.crm-mail-tab.active,
.crm-mail-tab[aria-selected="true"] {
    background: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    box-shadow: var(--mx-shadow-xs) !important;
}
.crm-mail-tab-count {
    padding: 1px 6px;
    border-radius: var(--mx-r-pill);
    background: var(--mx-surface-3);
    color: var(--mx-text-3);
    font-family: var(--mx-font-data);
    font-size: 9.5px;
}
.crm-mail-direction {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px !important;
    border-radius: var(--mx-r-pill) !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Source: crm-motion.css */
/* ==========================================================================
   PAX CRM — MERIDIAN MOTION LAYER
   --------------------------------------------------------------------------
   Motion here does one of three jobs: it orients (where am I), it confirms
   (that worked), or it explains (this came from there). Anything that does
   none of those was cut.
   Every effect below is disabled under prefers-reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. KEYFRAMES
   -------------------------------------------------------------------------- */

@keyframes mx-fade-in     { from { opacity: 0; } to { opacity: 1; } }

@keyframes mx-rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes mx-rise-in-sm {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
}

@keyframes mx-slide-in-left {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: none; }
}

@keyframes mx-pop-in {
    0%   { opacity: 0; transform: scale(.72); }
    60%  { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes mx-menu-in {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

@keyframes mx-dialog-in {
    from { opacity: 0; transform: translateY(-18px) scale(.975); }
    to   { opacity: 1; transform: none; }
}

@keyframes mx-focus-in {
    from { outline-offset: 6px; }
    to   { outline-offset: 2px; }
}

@keyframes mx-ripple {
    to { transform: scale(2.6); opacity: 0; }
}

@keyframes mx-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(18, 128, 92, .45); }
    70%  { box-shadow: 0 0 0 6px rgba(18, 128, 92, 0); }
    100% { box-shadow: 0 0 0 0 rgba(18, 128, 92, 0); }
}

@keyframes mx-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

@keyframes mx-bell {
    0%, 100% { transform: rotate(0); }
    20%      { transform: rotate(13deg); }
    40%      { transform: rotate(-11deg); }
    60%      { transform: rotate(7deg); }
    80%      { transform: rotate(-4deg); }
}

@keyframes mx-shake-in {
    0%   { opacity: 0; transform: translateX(-9px); }
    45%  { opacity: 1; transform: translateX(5px); }
    70%  { transform: translateX(-3px); }
    100% { opacity: 1; transform: none; }
}

@keyframes mx-shimmer {
    100% { transform: translateX(100%); }
}

@keyframes mx-drift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(52px, 52px, 0); }
}

@keyframes mx-breathe {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: .85; transform: scale(1.14); }
}

@keyframes mx-spin { to { transform: rotate(360deg); } }

@keyframes mx-progress-indeterminate {
    0%   { transform: translateX(-100%) scaleX(.30); }
    50%  { transform: translateX(0%)    scaleX(.55); }
    100% { transform: translateX(100%)  scaleX(.35); }
}

@keyframes mx-toast-in {
    from { opacity: 0; transform: translateX(24px) scale(.96); }
    to   { opacity: 1; transform: none; }
}

@keyframes mx-toast-out {
    from { opacity: 1; transform: none; max-height: 120px; }
    to   { opacity: 0; transform: translateX(24px) scale(.96); max-height: 0; margin-bottom: 0; }
}

@keyframes mx-count-flip {
    from { opacity: .35; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   2. PAGE-LOAD ORCHESTRATION
   The shell arrives first, then navigation, then content. One sequence,
   ~500ms total, so the interface feels assembled rather than dumped.
   -------------------------------------------------------------------------- */

.crm-app-body .crm-topbar { animation: mx-rise-in-sm 380ms var(--mx-ease) both; }
.crm-app-body .crm-sidebar { animation: mx-fade-in 300ms var(--mx-ease) both; }

.crm-app-body .crm-nav-group { animation: mx-slide-in-left 420ms var(--mx-ease) both; }
.crm-app-body .crm-nav-group:nth-of-type(1) { animation-delay: 60ms; }
.crm-app-body .crm-nav-group:nth-of-type(2) { animation-delay: 110ms; }
.crm-app-body .crm-nav-group:nth-of-type(3) { animation-delay: 160ms; }
.crm-app-body .crm-nav-group:nth-of-type(4) { animation-delay: 210ms; }
.crm-app-body .crm-nav-group:nth-of-type(5) { animation-delay: 260ms; }

.crm-app-body .crm-sidebar-workspace { animation: mx-rise-in-sm 420ms var(--mx-ease) 40ms both; }
.crm-app-body .crm-sidebar-quick-actions { animation: mx-rise-in-sm 420ms var(--mx-ease) 90ms both; }

/* Every view wraps its body in a single container, so the sections that
   actually stagger are one level down. Depth 1 of the real content only —
   nesting the cascade makes long pages feel slow rather than considered. */
.crm-app-body .crm-page-content > * > * {
    animation: mx-rise-in 480ms var(--mx-ease) both;
}
.crm-app-body .crm-page-content > * > *:nth-child(1) { animation-delay: 100ms; }
.crm-app-body .crm-page-content > * > *:nth-child(2) { animation-delay: 150ms; }
.crm-app-body .crm-page-content > * > *:nth-child(3) { animation-delay: 195ms; }
.crm-app-body .crm-page-content > * > *:nth-child(4) { animation-delay: 235ms; }
.crm-app-body .crm-page-content > * > *:nth-child(5) { animation-delay: 270ms; }
.crm-app-body .crm-page-content > * > *:nth-child(n+6) { animation-delay: 300ms; }

/* Table rows deal in a fast, short cascade — long lists must not crawl. */
.crm-app-body tbody tr[data-mx-row] {
    animation: mx-rise-in-sm 340ms var(--mx-ease) both;
    animation-delay: calc(var(--mx-row-i, 0) * 26ms);
}

/* KPI tiles land together with a tiny offset. */
.crm-app-body .crm-v4-kpi {
    animation: mx-rise-in 460ms var(--mx-ease) both;
    animation-delay: calc(120ms + var(--mx-kpi-i, 0) * 55ms);
}

/* --------------------------------------------------------------------------
   3. SCROLL REVEAL
   Applied by JS to elements below the fold only, so nothing above the fold
   waits on an observer.
   -------------------------------------------------------------------------- */

.mx-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 620ms var(--mx-ease), transform 620ms var(--mx-ease);
    will-change: opacity, transform;
}
.mx-reveal.mx-in {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* --------------------------------------------------------------------------
   4. NAVIGATION PROGRESS RAIL
   The sidebar rail, stretched across the top of the app. Same motif:
   "something is moving."
   -------------------------------------------------------------------------- */

.mx-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 9998;
    height: var(--mx-rail);
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms var(--mx-ease);
}
.mx-progress.is-active { opacity: 1; }
.mx-progress__bar {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    background: linear-gradient(90deg, var(--mx-accent), var(--mx-brass-500), var(--mx-accent));
    box-shadow: 0 0 12px rgba(43, 80, 236, .55);
    animation: mx-progress-indeterminate 1.15s var(--mx-ease-in-out) infinite;
}

/* --------------------------------------------------------------------------
   5. TOASTS
   Flash messages become dismissible toasts; the page keeps its inline copy
   for anyone without JS.
   -------------------------------------------------------------------------- */

.mx-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}
@media (max-width: 640px) {
    .mx-toasts { right: 12px; left: 12px; bottom: 78px; width: auto; }
}

.mx-toast {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border-radius: var(--mx-r-lg);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface);
    box-shadow: var(--mx-shadow-lg);
    pointer-events: auto;
    animation: mx-toast-in 380ms var(--mx-spring) both;
}
.mx-toast.is-leaving { animation: mx-toast-out 300ms var(--mx-ease) forwards; }

.mx-toast__rail {
    position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: var(--mx-rail);
    border-radius: 0 var(--mx-r-pill) var(--mx-r-pill) 0;
    background: var(--mx-accent);
}
.mx-toast--success .mx-toast__rail { background: var(--mx-verdant); }
.mx-toast--error   .mx-toast__rail { background: var(--mx-crimson); }
.mx-toast--warning .mx-toast__rail { background: var(--mx-amber); }

.mx-toast__icon {
    flex-shrink: 0;
    width: 20px; height: 20px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}
.mx-toast--success .mx-toast__icon { background: var(--mx-verdant-s); color: var(--mx-verdant); }
.mx-toast--error   .mx-toast__icon { background: var(--mx-crimson-s); color: var(--mx-crimson); }
.mx-toast--warning .mx-toast__icon { background: var(--mx-amber-s);   color: var(--mx-amber); }
.mx-toast--info    .mx-toast__icon { background: var(--mx-accent-soft); color: var(--mx-accent); }

.mx-toast__body { flex: 1; min-width: 0; }
.mx-toast__title { font-size: 12px; font-weight: 650; color: var(--mx-text); line-height: 1.35; }
.mx-toast__text  { margin-top: 2px; font-size: 11.5px; color: var(--mx-text-3); line-height: 1.45; }

.mx-toast__close {
    flex-shrink: 0;
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: var(--mx-r-xs);
    border: none;
    background: transparent;
    color: var(--mx-text-4);
    cursor: pointer;
    transition: background-color var(--mx-t-fast) var(--mx-ease), color var(--mx-t-fast) var(--mx-ease);
}
.mx-toast__close:hover { background: var(--mx-surface-3); color: var(--mx-text); }

.mx-toast__timer {
    position: absolute;
    left: 0; bottom: 0;
    height: 2px;
    width: 100%;
    transform-origin: left center;
    background: var(--mx-border-strong);
    opacity: .7;
}

/* --------------------------------------------------------------------------
   6. TABLE TOOLBAR — filter + sort, added to long tables
   -------------------------------------------------------------------------- */

.mx-table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--mx-border);
    border-bottom: none;
    border-radius: var(--mx-r-lg) var(--mx-r-lg) 0 0;
    background: var(--mx-surface-2);
}
.mx-table-filter {
    position: relative;
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 340px;
}
.mx-table-filter input {
    width: 100%;
    height: 32px !important;
    padding: 0 30px 0 30px !important;
    border-radius: var(--mx-r-sm) !important;
    border: 1px solid var(--mx-border) !important;
    background: var(--mx-surface) !important;
    color: var(--mx-text) !important;
    font-size: 11.5px !important;
}
.mx-table-filter svg {
    position: absolute; left: 9px; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    stroke: var(--mx-text-4); fill: none; stroke-width: 2;
    pointer-events: none;
}
.mx-table-filter__clear {
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    display: none; place-items: center;
    border: none; border-radius: var(--mx-r-xs);
    background: var(--mx-surface-3);
    color: var(--mx-text-3);
    cursor: pointer;
    font-size: 12px; line-height: 1;
}
.mx-table-filter[data-filled="true"] .mx-table-filter__clear { display: grid; }

.mx-table-count {
    margin-left: auto;
    font-family: var(--mx-font-data);
    font-size: 10.5px;
    color: var(--mx-text-4);
    font-variant-numeric: tabular-nums;
    transition: color var(--mx-t-base) var(--mx-ease);
}
.mx-table-count strong { color: var(--mx-text-2); font-weight: 600; }

/* Sortable headers */
.crm-app-body th[data-mx-sortable] {
    cursor: pointer;
    user-select: none;
    transition: color var(--mx-t-fast) var(--mx-ease), background-color var(--mx-t-fast) var(--mx-ease);
}
.crm-app-body th[data-mx-sortable]:hover { color: var(--mx-text-2) !important; background: var(--mx-surface-3) !important; }
.crm-app-body th[data-mx-sortable]::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
    width: 0; height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-bottom: 4.5px solid currentColor;
    opacity: 0;
    transform: translateY(-1px);
    transition: opacity var(--mx-t-fast) var(--mx-ease), transform var(--mx-t-base) var(--mx-spring);
}
.crm-app-body th[data-mx-sortable]:hover::after { opacity: .35; }
.crm-app-body th[data-mx-sort="asc"]::after  { opacity: 1; }
.crm-app-body th[data-mx-sort="desc"]::after { opacity: 1; transform: rotate(180deg); }
.crm-app-body th[data-mx-sort]:not([data-mx-sort=""]) { color: var(--mx-accent) !important; }

.mx-row-hidden { display: none !important; }

.mx-no-results {
    padding: 34px 20px;
    text-align: center;
    color: var(--mx-text-3);
    font-size: 12px;
    animation: mx-rise-in-sm 300ms var(--mx-ease) both;
}
.mx-no-results strong { display: block; margin-bottom: 4px; color: var(--mx-text); font-size: 13px; font-weight: 650; }

/* --------------------------------------------------------------------------
   7. SKELETONS
   -------------------------------------------------------------------------- */

.mx-skeleton {
    position: relative;
    overflow: hidden;
    border-radius: var(--mx-r-sm);
    background: var(--mx-surface-3);
}
.mx-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    animation: mx-shimmer 1.35s var(--mx-ease-in-out) infinite;
}
html[data-crm-theme="dark"] .mx-skeleton::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
}

.mx-spinner {
    width: 15px; height: 15px;
    border: 2px solid var(--mx-border-strong);
    border-top-color: var(--mx-accent);
    border-radius: 50%;
    animation: mx-spin 700ms linear infinite;
}

/* Buttons entering a pending state say so. */
.crm-app-body button[data-mx-pending="true"] {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.crm-app-body button[data-mx-pending="true"]::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mx-spin 640ms linear infinite;
}

/* --------------------------------------------------------------------------
   8. BACK TO TOP
   -------------------------------------------------------------------------- */

.mx-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9990;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: var(--mx-r-md);
    border: 1px solid var(--mx-border);
    background: color-mix(in srgb, var(--mx-surface) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--mx-text-2);
    box-shadow: var(--mx-shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.9);
    transition: opacity var(--mx-t-base) var(--mx-ease),
                transform var(--mx-t-base) var(--mx-spring),
                visibility var(--mx-t-base),
                border-color var(--mx-t-base) var(--mx-ease),
                color var(--mx-t-base) var(--mx-ease);
}
.mx-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.mx-to-top:hover { border-color: var(--mx-accent); color: var(--mx-accent); transform: translateY(-2px); }
.mx-to-top svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }
@media (max-width: 1023px) { .mx-to-top { bottom: 78px; } }

/* --------------------------------------------------------------------------
   9. KEYBOARD SHORTCUT SHEET  (press ?)
   -------------------------------------------------------------------------- */

.mx-keys {
    position: fixed;
    inset: 0;
    z-index: 9996;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(11, 13, 17, .42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mx-t-base) var(--mx-ease), visibility var(--mx-t-base);
}
.mx-keys.is-open { opacity: 1; visibility: visible; }
.mx-keys__panel {
    width: min(520px, 100%);
    max-height: 80vh;
    overflow: auto;
    padding: 22px;
    border-radius: var(--mx-r-xl);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface);
    box-shadow: var(--mx-shadow-xl);
    transform: translateY(-14px) scale(.98);
    transition: transform var(--mx-t-slow) var(--mx-spring);
}
.mx-keys.is-open .mx-keys__panel { transform: none; }
.mx-keys__title {
    font-family: var(--mx-font-display);
    font-size: 16px; font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--mx-text);
}
.mx-keys__hint { margin-top: 3px; margin-bottom: 16px; font-size: 11.5px; color: var(--mx-text-4); }
.mx-keys__row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--mx-border-soft);
    font-size: 12px;
    color: var(--mx-text-2);
}
.mx-keys__row:last-child { border-bottom: none; }
.mx-keys__row kbd {
    padding: 3px 7px;
    border-radius: var(--mx-r-xs);
    border: 1px solid var(--mx-border);
    background: var(--mx-surface-2);
    color: var(--mx-text);
    font-family: var(--mx-font-data);
    font-size: 10px;
}

/* --------------------------------------------------------------------------
   10. COPY-TO-CLIPBOARD affordance on contact details
   -------------------------------------------------------------------------- */

.mx-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    margin-left: 5px;
    vertical-align: -3px;
    border: none;
    border-radius: var(--mx-r-xs);
    background: transparent;
    color: var(--mx-text-4);
    cursor: pointer;
    opacity: 0;
    transform: scale(.86);
    transition: all var(--mx-t-base) var(--mx-ease);
}
td:hover .mx-copy,
.mx-copy:focus-visible { opacity: 1; transform: none; }
.mx-copy:hover { background: var(--mx-surface-3); color: var(--mx-accent); }
.mx-copy.is-done { color: var(--mx-verdant); opacity: 1; }
.mx-copy svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; }

/* --------------------------------------------------------------------------
   11. HOVER LIFT UTILITY (opt-in, applied by JS to card grids)
   -------------------------------------------------------------------------- */

.mx-lift { transition: transform var(--mx-t-base) var(--mx-ease), box-shadow var(--mx-t-base) var(--mx-ease); }
.mx-lift:hover { transform: translateY(-3px); box-shadow: var(--mx-shadow-md); }

/* Links get an underline that grows from the leading edge. */
.crm-app-body .crm-page-content a:not([class*="bg-"]):not([class*="block"]):not([class*="flex"]):not([class*="grid"]):not([class*="rounded"]):not([class*="border"]):not(.mx-no-underline) {
    background-image: linear-gradient(var(--mx-accent), var(--mx-accent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: background-size var(--mx-t-base) var(--mx-ease), color var(--mx-t-fast) var(--mx-ease);
}
.crm-app-body .crm-page-content a:not([class*="bg-"]):not([class*="block"]):not([class*="flex"]):not([class*="grid"]):not([class*="rounded"]):not([class*="border"]):not(.mx-no-underline):hover {
    background-size: 100% 1px;
}

/* --------------------------------------------------------------------------
   12. THEME TRANSITION
   Switching light/dark cross-fades surfaces instead of snapping.
   -------------------------------------------------------------------------- */

html.mx-theme-switching,
html.mx-theme-switching *,
html.mx-theme-switching *::before,
html.mx-theme-switching *::after {
    transition: background-color 320ms var(--mx-ease),
                border-color 320ms var(--mx-ease),
                color 320ms var(--mx-ease),
                fill 320ms var(--mx-ease),
                box-shadow 320ms var(--mx-ease) !important;
}

/* --------------------------------------------------------------------------
   13. REDUCED MOTION
   Nothing above is load-bearing. If the person asked for stillness, they get
   stillness — every element remains at its final, visible state.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .mx-reveal { opacity: 1 !important; transform: none !important; }
    .crm-app-body .crm-page-content > * > *,
    .crm-app-body .crm-v4-kpi,
    .crm-app-body tbody tr[data-mx-row],
    .crm-app-body .crm-nav-group { animation: none !important; opacity: 1 !important; transform: none !important; }
    .crm-auth-brand-grid,
    .crm-auth-brand::after,
    .crm-workspace-status,
    .crm-sidebar-security span { animation: none !important; }
    .mx-progress__bar { animation: none !important; transform: scaleX(.6); }
}

/* Source: crm-responsive-v2.css */
/* PAX CRM 2026-08-12 responsive + authentication polish.
   This file intentionally loads after Meridian/motion so mobile rules win. */

html, body { max-width: 100%; }
body { overflow-x: hidden; }
.crm-main, .crm-page-wrapper, .crm-page-content, .crm-topbar, .crm-topbar-inner { min-width: 0 !important; }
.crm-page-wrapper, .crm-page-content { width: 100% !important; }
img, svg, video, canvas { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }

@media (max-width: 1023px) {
  .crm-sidebar-v3 {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(320px, 88vw) !important;
    max-width: 88vw !important;
    height: 100dvh !important;
    transform: translateX(-105%) !important;
    z-index: 1200 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    transition: transform .24s cubic-bezier(.2,.8,.2,1) !important;
  }
  html[data-crm-mobile-nav="open"] .crm-sidebar-v3 { transform: translateX(0) !important; }
  .crm-mobile-backdrop { position: fixed !important; inset: 0 !important; z-index: 1190 !important; background: rgba(15,23,42,.44) !important; backdrop-filter: blur(2px); }
  html[data-crm-mobile-nav="open"] .crm-mobile-backdrop { opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; }
  .crm-main { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; }
  .crm-topbar { position: sticky !important; top: 0 !important; width: 100% !important; z-index: 800 !important; }
  .crm-topbar-inner { width: 100% !important; padding-inline: 14px !important; gap: 10px !important; }
  .crm-mobile-menu-button { display: inline-flex !important; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .crm-topbar-search-wrap { min-width: 0 !important; flex: 1 1 220px !important; }
  .crm-page-wrapper { max-width: none !important; padding-inline: 16px !important; }
  .crm-page-content { overflow: visible !important; }
  .crm-shell { width: 100% !important; min-width: 0 !important; }
}

@media (max-width: 767px) {
  .crm-page-wrapper { padding-inline: 10px !important; }
  .crm-page-content { padding-bottom: 24px !important; }
  .crm-topbar-inner { min-height: 62px !important; padding-inline: 10px !important; }
  .crm-topbar-search-wrap { display: none !important; }
  .crm-topbar-clock, .crm-command-button, .crm-topbar-secondary-label { display: none !important; }
  .crm-topbar-title, .crm-topbar-page-title { max-width: 42vw !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
  .crm-topbar-actions { margin-left: auto !important; gap: 6px !important; min-width: 0 !important; }
  .crm-topbar-actions > *, .crm-icon-button, .crm-topbar-primary-action { min-height: 44px; }
  .crm-topbar-primary-action { padding-inline: 12px !important; }

  /* Tailwind-generated page grids must collapse even though Meridian loads later. */
  .crm-page-content .md\:grid-cols-2,
  .crm-page-content .md\:grid-cols-3,
  .crm-page-content .lg\:grid-cols-2,
  .crm-page-content .lg\:grid-cols-3,
  .crm-page-content .lg\:grid-cols-4,
  .crm-page-content .xl\:grid-cols-2,
  .crm-page-content .xl\:grid-cols-3,
  .crm-page-content .xl\:grid-cols-4,
  .crm-v4-dashboard-head,
  .crm-v4-focus-grid,
  .crm-v4-focus-items { grid-template-columns: minmax(0,1fr) !important; }
  .crm-v4-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }

  .crm-page-content .sm\:flex-row,
  .crm-page-content .md\:flex-row,
  .crm-page-content .lg\:flex-row,
  .crm-page-content .xl\:flex-row { flex-direction: column !important; align-items: stretch !important; }
  .crm-page-content .sm\:items-center,
  .crm-page-content .md\:items-center,
  .crm-page-content .lg\:items-center,
  .crm-page-content .xl\:items-center { align-items: stretch !important; }
  .crm-page-content form > button:only-child,
  .crm-page-content .crm-mobile-full-button { width: 100% !important; justify-content: center !important; }

  .crm-responsive-table { overflow: visible !important; width: 100% !important; }
  .crm-responsive-table table,
  .crm-responsive-table tbody { display: block !important; width: 100% !important; min-width: 0 !important; }
  .crm-responsive-table thead { display: none !important; }
  .crm-responsive-table tr { display: block !important; width: 100% !important; margin: 0 0 12px !important; padding: 8px 12px !important; border: 1px solid #e2e8f0 !important; border-radius: 16px !important; background: #fff !important; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
  .crm-responsive-table td { display: grid !important; grid-template-columns: minmax(92px,34%) minmax(0,1fr) !important; gap: 10px !important; align-items: start !important; width: 100% !important; min-width: 0 !important; padding: 9px 0 !important; border: 0 !important; border-bottom: 1px solid #f1f5f9 !important; white-space: normal !important; overflow-wrap: anywhere !important; }
  .crm-responsive-table td:last-child { border-bottom: 0 !important; }
  .crm-responsive-table td::before { content: attr(data-label); font-size: 10px; line-height: 1.4; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
  .overflow-x-auto:not(.crm-responsive-table) { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .overflow-x-auto:not(.crm-responsive-table) table { min-width: 680px; }

  .crm-mail-page { width: 100% !important; max-width: 100% !important; }
  .crm-mail-tabs, [role="tablist"] { max-width: 100%; overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: thin; }
  dialog, .crm-modal, .crm-modal-panel, .crm-drawer { max-width: calc(100vw - 20px) !important; max-height: calc(100dvh - 20px) !important; }
  [class*="rounded-[28px]"], [class*="rounded-[24px]"] { border-radius: 20px !important; }
  button, a[role="button"], input, select { min-height: 44px; }
}

@media (max-width: 479px) {
  .crm-v4-kpi-grid { grid-template-columns: minmax(0,1fr) !important; }
  .crm-page-wrapper { padding-inline: 8px !important; }
  .crm-topbar-primary-action span { display: none !important; }
}

/* ---------- Login: animated, accessible, mobile-first ---------- */
.crm-auth-v4 { position: relative; isolation: isolate; overflow: hidden; }
.crm-auth-brand { position: relative; overflow: hidden; }
.crm-auth-brand::before,
.crm-auth-brand::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
  opacity: .22;
  z-index: 0;
}
.crm-auth-brand::before { top: -220px; right: -160px; background: radial-gradient(circle, rgba(99,102,241,.62), rgba(99,102,241,0) 68%); animation: crmAuthOrbOne 10s ease-in-out infinite alternate; }
.crm-auth-brand::after { bottom: -250px; left: -180px; background: radial-gradient(circle, rgba(14,165,233,.48), rgba(14,165,233,0) 68%); animation: crmAuthOrbTwo 12s ease-in-out infinite alternate; }
.crm-auth-brand > * { position: relative; z-index: 1; }
.crm-auth-brand-grid { animation: crmAuthGrid 20s linear infinite; }
.crm-auth-logo-row { animation: crmAuthEnter .7s cubic-bezier(.2,.8,.2,1) both; }
.crm-auth-story > .crm-auth-badge { animation: crmAuthEnter .7s .08s cubic-bezier(.2,.8,.2,1) both, crmAuthBadgePulse 3.5s 1.2s ease-in-out infinite; }
.crm-auth-story > h1 { animation: crmAuthEnter .72s .14s cubic-bezier(.2,.8,.2,1) both; }
.crm-auth-story > p { animation: crmAuthEnter .72s .2s cubic-bezier(.2,.8,.2,1) both; }
.crm-auth-capability { animation: crmAuthCapability .62s cubic-bezier(.2,.8,.2,1) both; transition: transform .22s ease, border-color .22s ease, background .22s ease; }
.crm-auth-capability:nth-child(1){animation-delay:.26s}.crm-auth-capability:nth-child(2){animation-delay:.34s}.crm-auth-capability:nth-child(3){animation-delay:.42s}.crm-auth-capability:nth-child(4){animation-delay:.50s}
.crm-auth-capability:hover { transform: translateY(-3px); }
.crm-auth-form-shell { animation: crmAuthPanel .72s .12s cubic-bezier(.2,.8,.2,1) both; }
.crm-auth-field { animation: crmAuthEnter .55s cubic-bezier(.2,.8,.2,1) both; }
.crm-auth-field:nth-of-type(1){animation-delay:.3s}.crm-auth-field:nth-of-type(2){animation-delay:.38s}
.crm-auth-input-wrap { transition: transform .2s ease, box-shadow .2s ease; }
.crm-auth-input-wrap:focus-within { transform: translateY(-1px); }
.crm-auth-submit { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.crm-auth-submit:hover { transform: translateY(-1px); }
.crm-auth-submit::after { content:""; position:absolute; inset:-100% auto -100% -35%; width:28%; transform:rotate(18deg); background:linear-gradient(90deg,transparent,rgba(255,255,255,.32),transparent); animation:crmAuthShine 4.6s 1.2s ease-in-out infinite; }
.crm-auth-submit[data-loading="true"] { cursor: wait; opacity: .86; }
.crm-auth-submit[data-loading="true"] svg { display: none; }
.crm-auth-spinner { width:18px; height:18px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; animation:crmAuthSpin .7s linear infinite; display:none; }
.crm-auth-submit[data-loading="true"] .crm-auth-spinner { display:inline-block; }
.crm-auth-caps { display:none; margin-top:7px; color:#b45309; font-size:11px; font-weight:700; }
.crm-auth-caps[data-visible="true"] { display:block; animation:crmAuthEnter .2s ease both; }
.crm-auth-alert { animation: crmAuthAlert .42s cubic-bezier(.2,.8,.2,1) both; }

@keyframes crmAuthEnter { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes crmAuthPanel { from { opacity:0; transform:translateY(18px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes crmAuthCapability { from { opacity:0; transform:translateX(-14px); } to { opacity:1; transform:translateX(0); } }
@keyframes crmAuthOrbOne { to { transform:translate(-48px,62px) scale(1.12); } }
@keyframes crmAuthOrbTwo { to { transform:translate(62px,-48px) scale(1.08); } }
@keyframes crmAuthGrid { to { background-position: 48px 48px; } }
@keyframes crmAuthBadgePulse { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-2px); } }
@keyframes crmAuthShine { 0%,72% { left:-35%; opacity:0; } 76% { opacity:1; } 88%,100% { left:120%; opacity:0; } }
@keyframes crmAuthSpin { to { transform:rotate(360deg); } }
@keyframes crmAuthAlert { 0% { opacity:0; transform:translateX(10px); } 60% { transform:translateX(-3px); } 100% { opacity:1; transform:translateX(0); } }

@media (max-width: 900px) {
  .crm-auth-v4 { min-height: 100dvh !important; display:block !important; }
  .crm-auth-brand { display:none !important; }
  .crm-auth-form-area { width:100% !important; min-height:100dvh !important; padding:22px 16px !important; display:flex !important; align-items:center !important; justify-content:center !important; }
  .crm-auth-form-shell { width:min(100%,520px) !important; max-width:520px !important; margin:0 auto !important; }
  .crm-auth-mobile-brand { display:flex !important; }
}
@media (max-width: 480px) {
  .crm-auth-form-area { padding:12px !important; align-items:flex-start !important; }
  .crm-auth-form-shell { margin-top:10px !important; padding:22px 18px !important; border-radius:22px !important; }
  .crm-auth-form-head h2 { font-size:28px !important; }
  .crm-auth-options { align-items:flex-start !important; gap:12px !important; }
  .crm-auth-timezone { display:none !important; }
  .crm-auth-form-footer { flex-direction:column !important; gap:4px !important; align-items:flex-start !important; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-auth-brand::before,.crm-auth-brand::after,.crm-auth-brand-grid,.crm-auth-logo-row,.crm-auth-story > *,.crm-auth-capability,.crm-auth-form-shell,.crm-auth-field,.crm-auth-submit::after,.crm-auth-alert { animation:none !important; }
  .crm-sidebar-v3 { transition:none !important; }
}
