/* ============================================================
   MAC AI CRM — Premium UI Design System v2
   "Luxury SaaS" — Warm, Confident, Radiant
   
   Design Language:
   • Warm indigo-to-coral gradient header
   • Soft cream page backgrounds with depth
   • Glass morphism panels
   • Rich micro-interactions
   • Premium typography (Plus Jakarta Sans + DM Sans)
   • Confident color palette: Deep Indigo + Warm Coral accent
   
   Loaded via <link> in both layouts — no npm rebuild needed.
   ============================================================ */

/* ---- Google Fonts (loaded here as backup) ---- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ---- Design Tokens ---- */
:root {
    /* Primary palette — Deep Indigo */
    --mac-indigo-50: #EEF2FF;
    --mac-indigo-100: #E0E7FF;
    --mac-indigo-200: #C7D2FE;
    --mac-indigo-300: #A5B4FC;
    --mac-indigo-400: #818CF8;
    --mac-indigo-500: #6366F1;
    --mac-indigo-600: #4F46E5;
    --mac-indigo-700: #4338CA;
    --mac-indigo-800: #3730A3;
    --mac-indigo-900: #312E81;
    
    /* Accent — Warm Coral */
    --mac-coral-50: #FFF5F5;
    --mac-coral-100: #FFE4E6;
    --mac-coral-200: #FECDD3;
    --mac-coral-300: #FDA4AF;
    --mac-coral-400: #FB7185;
    --mac-coral-500: #F43F5E;
    --mac-coral-600: #E11D48;
    
    /* Success — Emerald */
    --mac-emerald: #10B981;
    --mac-emerald-light: #D1FAE5;
    
    /* Warning — Amber */
    --mac-amber: #F59E0B;
    --mac-amber-light: #FEF3C7;
    
    /* Surfaces */
    --mac-bg: #FAFAF9;
    --mac-bg-warm: #F5F3EF;
    --mac-surface: #FFFFFF;
    --mac-surface-glass: rgba(255, 255, 255, 0.72);
    --mac-surface-elevated: #FFFFFF;
    
    /* Text */
    --mac-text-primary: #1E1B4B;
    --mac-text-secondary: #4B5563;
    --mac-text-muted: #9CA3AF;
    --mac-text-on-dark: #F9FAFB;
    
    /* Borders */
    --mac-border: #E5E7EB;
    --mac-border-light: #F3F4F6;
    --mac-border-glass: rgba(255, 255, 255, 0.18);
    
    /* Shadows — layered for depth */
    --mac-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --mac-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --mac-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --mac-shadow-md: 0 8px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -4px rgba(0, 0, 0, 0.04);
    --mac-shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.1), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
    --mac-shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --mac-shadow-coral-glow: 0 0 20px rgba(244, 63, 94, 0.12);
    
    /* Radii */
    --mac-radius-sm: 8px;
    --mac-radius: 12px;
    --mac-radius-lg: 16px;
    --mac-radius-xl: 20px;
    --mac-radius-2xl: 24px;
    
    /* Motion */
    --mac-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --mac-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --mac-duration: 200ms;
    --mac-duration-slow: 350ms;
    
    /* Brand color override */
    --brand-color: #6366F1;
    
    /* Header gradient */
    --mac-header-from: #312E81;
    --mac-header-via: #3730A3;
    --mac-header-to: #1E1B4B;
}

/* ---- Dark Mode Tokens ---- */
.dark {
    --mac-bg: #0F0E1A;
    --mac-bg-warm: #13121F;
    --mac-surface: #1A1930;
    --mac-surface-glass: rgba(26, 25, 48, 0.85);
    --mac-surface-elevated: #221F3A;
    --mac-text-primary: #F1F0FF;
    --mac-text-secondary: #C4B5FD;
    --mac-text-muted: #6B7280;
    --mac-border: #2D2A4A;
    --mac-border-light: #1F1D35;
    --mac-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --mac-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --mac-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.25);
    --mac-shadow-md: 0 8px 25px -5px rgba(0, 0, 0, 0.35);
    --mac-shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}


/* ============================================================
   GLOBAL
   ============================================================ */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', 'DM Sans', 'Inter', system-ui, sans-serif !important;
    background: var(--mac-bg) !important;
    color: var(--mac-text-primary);
}

.dark body {
    background: var(--mac-bg) !important;
}

/* Beautiful custom scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--mac-indigo-300), var(--mac-indigo-400));
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--mac-indigo-400), var(--mac-indigo-500));
}
.dark ::-webkit-scrollbar-thumb {
    background: var(--mac-indigo-700);
}

/* Font family enforcement */
.font-inter { font-family: 'Plus Jakarta Sans', 'DM Sans', 'Inter', system-ui, sans-serif !important; }


/* ============================================================
   HEADER — Signature gradient with glass morphism
   ============================================================ */

header.sticky {
    background: linear-gradient(135deg, var(--mac-header-from) 0%, var(--mac-header-via) 45%, #4338CA 75%, #4F46E5 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(49, 46, 129, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    padding: 0 1.5rem !important;
    height: 64px !important;
    min-height: 64px !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* All header text → white */
header.sticky,
header.sticky *:not(.mac-tenant-dropdown *):not(.mac-tenant-dropdown) {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* Logo → Make Krayin SVG logos white */
header.sticky a img,
header.sticky a img.h-10 {
    filter: brightness(0) invert(1) !important;
    height: 30px !important;
    opacity: 0.95;
    transition: opacity var(--mac-duration) var(--mac-ease);
}
header.sticky a:hover img {
    opacity: 1;
}

/* ---- Header Search — Frosted glass ---- */
header .relative input[type="text"],
header .relative input[type="search"],
header input.peer {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-radius: var(--mac-radius-sm) !important;
    transition: all var(--mac-duration) var(--mac-ease);
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
    font-weight: 400;
}
header .relative input::placeholder,
header input.peer::placeholder {
    color: rgba(255, 255, 255, 0.45) !important;
}
header .relative input:focus,
header input.peer:focus {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 20px rgba(99, 102, 241, 0.2) !important;
    outline: none !important;
}

/* Header search icon */
header .icon-search { color: rgba(255, 255, 255, 0.5) !important; }

/* ---- Quick-Create Button — Coral accent pop ---- */
header button.bg-brandColor {
    background: linear-gradient(135deg, var(--mac-coral-400), var(--mac-coral-500)) !important;
    box-shadow: 0 2px 12px rgba(244, 63, 94, 0.3), 0 0 0 2px rgba(244, 63, 94, 0.15);
    border: none !important;
    transition: all var(--mac-duration) var(--mac-ease-bounce);
}
header button.bg-brandColor:hover {
    background: linear-gradient(135deg, var(--mac-coral-500), var(--mac-coral-600)) !important;
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4), 0 0 0 3px rgba(244, 63, 94, 0.2);
    transform: scale(1.08) rotate(90deg);
}
header button.bg-brandColor i {
    color: #fff !important;
}

/* ---- Dark Mode Toggle ---- */
header .icon-dark,
header .icon-light {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all var(--mac-duration) var(--mac-ease);
}
header .icon-dark:hover,
header .icon-light:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--mac-radius-sm);
}

/* ---- Profile Avatar ---- */
header button.rounded-full:not(.bg-brandColor) {
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    transition: all var(--mac-duration) var(--mac-ease);
}
header button.rounded-full:not(.bg-brandColor):hover {
    border-color: var(--mac-coral-400) !important;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.2);
    transform: scale(1.05);
}

/* Profile pink avatar → indigo gradient */
header button.bg-pink-400 {
    background: linear-gradient(135deg, var(--mac-indigo-400), var(--mac-coral-400)) !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
}


/* [SIDEBAR - replaced by v3 patch below] */


/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

/* Content wrapper background */
.flex.min-h-\[calc\(100vh-62px\)\] {
    background: var(--mac-bg-warm) !important;
    min-height: calc(100vh - 64px) !important;
}
.dark .flex.min-h-\[calc\(100vh-62px\)\] {
    background: var(--mac-bg) !important;
}

/* Content padding adjustment for 64px header */
.flex.min-h-\[calc\(100vh-62px\)\] > .px-4.pb-6 {
    padding-top: 6px;
}

/* Page titles — bold and confident */
.text-2xl.font-semibold,
p.text-2xl.font-semibold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    color: var(--mac-text-primary) !important;
    font-size: 1.625rem !important;
}
.dark .text-2xl.font-semibold,
.dark p.text-2xl.font-semibold {
    color: var(--mac-text-primary) !important;
}


/* ============================================================
   CARDS — Glass morphism with premium depth
   ============================================================ */

/* All white cards with borders */
.rounded-lg.border.border-gray-200.bg-white,
.box-shadow.rounded-lg,
div.rounded-lg.border.border-gray-200.bg-white {
    background: var(--mac-surface-glass) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--mac-border) !important;
    border-radius: var(--mac-radius) !important;
    box-shadow: var(--mac-shadow-sm) !important;
    transition: all var(--mac-duration-slow) var(--mac-ease);
}

/* Card hover lift — subtle and premium */
.rounded-lg.border.border-gray-200.bg-white:hover,
.box-shadow.rounded-lg:hover {
    box-shadow: var(--mac-shadow-md), var(--mac-shadow-glow) !important;
    transform: translateY(-1px);
    border-color: var(--mac-indigo-200) !important;
}
.dark .rounded-lg.border.border-gray-200.bg-white:hover {
    border-color: var(--mac-indigo-700) !important;
}

/* Dashboard cards dark mode */
.dark .rounded-lg.border.dark\:border-gray-800.dark\:bg-gray-900,
.dark .grid.gap-4 .rounded-lg.dark\:bg-gray-900 {
    background: var(--mac-surface) !important;
    border-color: var(--mac-border) !important;
}

/* Card section headers */
.rounded-lg .text-base.font-semibold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Revenue / stats cards — box shadow style */
.box-shadow {
    border-radius: var(--mac-radius) !important;
    box-shadow: var(--mac-shadow-sm) !important;
    border: 1px solid var(--mac-border);
}


/* ============================================================
   WELCOME BANNER — Stunning gradient hero
   ============================================================ */

.mac-welcome-banner {
    background: linear-gradient(135deg, var(--mac-indigo-600) 0%, var(--mac-indigo-500) 30%, var(--mac-coral-500) 70%, var(--mac-coral-400) 100%);
    border-radius: var(--mac-radius-xl);
    padding: 28px 36px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2), 0 4px 15px rgba(244, 63, 94, 0.15);
    animation: bannerFadeIn 600ms var(--mac-ease) both;
}
.mac-welcome-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.mac-welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: 15%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.mac-welcome-banner h2 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.mac-welcome-banner p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
    font-weight: 400;
}

@keyframes bannerFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   BUTTONS — Bold with micro-interactions
   ============================================================ */

/* Primary buttons — indigo gradient */
.primary-button,
button.bg-brandColor:not(header button.bg-brandColor),
a.bg-brandColor:not(header a) {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    border: none !important;
    border-radius: var(--mac-radius-sm) !important;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all var(--mac-duration) var(--mac-ease-bounce);
    color: #fff !important;
    position: relative;
    overflow: hidden;
}
.primary-button:hover,
button.bg-brandColor:not(header button.bg-brandColor):hover,
a.bg-brandColor:not(header a):hover {
    background: linear-gradient(135deg, var(--mac-indigo-600), var(--mac-indigo-700)) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.primary-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* Secondary / outline */
.secondary-button,
button.border.border-gray-200 {
    border-radius: var(--mac-radius-sm) !important;
    transition: all var(--mac-duration) var(--mac-ease);
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Danger/delete buttons → coral */
button.bg-red-500,
button.bg-red-600,
.bg-red-500,
.bg-red-600 {
    background: linear-gradient(135deg, var(--mac-coral-500), var(--mac-coral-600)) !important;
}


/* [FORMS - replaced by v3 patch below] */


/* [TABLE - replaced by v3 patch below] */


/* [KANBAN - replaced by v3 patch below] */


/* [DROPDOWN - replaced by v3 patch below] */


/* ============================================================
   TENANT SWITCHER (Enhanced)
   ============================================================ */

.mac-tenant-switcher { position: relative; display: inline-flex; align-items: center; }

.mac-tenant-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: var(--mac-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9) !important;
    cursor: pointer; font-size: 13px; font-weight: 500;
    transition: all var(--mac-duration) var(--mac-ease);
    white-space: nowrap;
    backdrop-filter: blur(10px);
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.mac-tenant-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.mac-tenant-indicator {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--mac-emerald);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    flex-shrink: 0;
    animation: indicatorPulse 3s ease-in-out infinite;
}
@keyframes indicatorPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.7); }
}

.mac-tenant-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 260px; background: var(--mac-surface);
    border: 1px solid var(--mac-border);
    border-radius: var(--mac-radius); box-shadow: var(--mac-shadow-lg);
    z-index: 99999; overflow: hidden;
    animation: dropdownReveal 200ms var(--mac-ease) both;
}
.mac-tenant-dropdown.show { display: block !important; }

.mac-tenant-dropdown-header {
    padding: 12px 16px; font-size: 0.65rem; font-weight: 700;
    color: var(--mac-text-muted); text-transform: uppercase;
    letter-spacing: 0.1em; border-bottom: 1px solid var(--mac-border-light);
}

.mac-tenant-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; text-decoration: none;
    color: var(--mac-text-primary) !important; font-size: 13px;
    transition: all var(--mac-duration) var(--mac-ease); cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.mac-tenant-option:hover { background: var(--mac-indigo-50); }
.dark .mac-tenant-option:hover { background: rgba(99, 102, 241, 0.08); }
.mac-tenant-option.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.04));
    font-weight: 600; color: var(--mac-indigo-600) !important;
    border-left: 3px solid var(--mac-indigo-500);
}

.mac-tenant-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--mac-radius-sm);
    font-size: 11px; font-weight: 700; flex-shrink: 0;
    background: var(--mac-indigo-50); color: var(--mac-indigo-600);
    transition: all var(--mac-duration) var(--mac-ease);
}
.mac-tenant-option.active .mac-tenant-avatar {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600));
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.mac-tenant-check { margin-left: auto; color: var(--mac-indigo-500); }

.mac-tenant-single {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; font-size: 13px;
    color: rgba(255, 255, 255, 0.7) !important;
}


/* ============================================================
   FOOTER — Minimal and elegant
   ============================================================ */

.mt-auto .border-t {
    background: var(--mac-surface) !important;
    border-top: 1px solid var(--mac-border) !important;
    color: var(--mac-text-muted) !important;
    font-size: 0.78rem;
    padding: 16px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}
.mt-auto .border-t a {
    color: var(--mac-indigo-500) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color var(--mac-duration) var(--mac-ease);
}
.mt-auto .border-t a:hover {
    color: var(--mac-coral-500) !important;
}

.dark .mt-auto .border-t {
    background: var(--mac-surface) !important;
    border-top-color: var(--mac-border) !important;
}


/* ============================================================
   LOGIN PAGE — Immersive branded experience
   ============================================================ */

/* Login background handled inline in blade — these style the card */
.mac-login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--mac-radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: loginCardIn 500ms var(--mac-ease) both;
    animation-delay: 200ms;
}
@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mac-login-logo {
    animation: loginLogoIn 600ms var(--mac-ease) both;
}
@keyframes loginLogoIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   TAGS & STATUS BADGES
   ============================================================ */

span[class*="rounded-full"][class*="px-"] {
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.7rem;
}

/* Won status → emerald */
.bg-green-500, .bg-green-600 {
    background: linear-gradient(135deg, var(--mac-emerald), #059669) !important;
}

/* Lost status → coral */
.bg-red-500:not(button), .bg-red-600:not(button) {
    background: linear-gradient(135deg, var(--mac-coral-500), var(--mac-coral-600)) !important;
}


/* ============================================================
   BREADCRUMBS & LINKS
   ============================================================ */

a.text-brandColor,
.text-brandColor {
    color: var(--mac-indigo-500) !important;
    transition: color var(--mac-duration) var(--mac-ease);
}
a.text-brandColor:hover {
    color: var(--mac-coral-500) !important;
}


/* ============================================================
   SHIMMER / LOADING — Warmer gradient
   ============================================================ */

.light-shimmer-bg {
    background: linear-gradient(90deg, var(--mac-bg-warm) 25%, var(--mac-indigo-50) 50%, var(--mac-bg-warm) 75%) !important;
    background-size: 200% 100% !important;
    animation: macShimmer 1.8s infinite ease-in-out;
    border-radius: var(--mac-radius-sm);
}
@keyframes macShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */

.px-4.pb-6 > * {
    animation: pageContentIn 400ms var(--mac-ease) both;
}
.px-4.pb-6 > *:nth-child(1) { animation-delay: 0ms; }
.px-4.pb-6 > *:nth-child(2) { animation-delay: 60ms; }
.px-4.pb-6 > *:nth-child(3) { animation-delay: 120ms; }
.px-4.pb-6 > *:nth-child(4) { animation-delay: 180ms; }
.px-4.pb-6 > *:nth-child(5) { animation-delay: 240ms; }

@keyframes pageContentIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   MODAL / DRAWER — Premium overlay
   ============================================================ */

.fixed[class*="bg-gray-500\/50"],
.fixed[class*="bg-black\/50"] {
    backdrop-filter: blur(4px) !important;
}

/* Modal panels */
.fixed .bg-white.rounded-lg,
.fixed .dark\:bg-gray-900.rounded-lg {
    border-radius: var(--mac-radius-lg) !important;
    box-shadow: var(--mac-shadow-lg) !important;
}


/* ============================================================
   FLASH MESSAGES — Refined
   ============================================================ */

/* Success */
[class*="bg-green"][class*="flash"],
.flash-group .bg-green-100 {
    border-left: 4px solid var(--mac-emerald);
    border-radius: var(--mac-radius-sm) !important;
}

/* Error */
[class*="bg-red"][class*="flash"],
.flash-group .bg-red-100 {
    border-left: 4px solid var(--mac-coral-500);
    border-radius: var(--mac-radius-sm) !important;
}


/* ============================================================
   QUICK-CREATE DROPDOWN — Grid refinement
   ============================================================ */

/* Quick-create item cards */
header [class*="dropdown"] .grid .rounded-lg {
    border-radius: var(--mac-radius-sm) !important;
    transition: all var(--mac-duration) var(--mac-ease);
}
header [class*="dropdown"] .grid .rounded-lg:hover {
    background: var(--mac-indigo-50) !important;
    transform: translateY(-2px);
}
header [class*="dropdown"] .grid .rounded-lg i {
    color: var(--mac-indigo-500) !important;
}


/* ============================================================
   RESPONSIVE — Mobile refinements
   ============================================================ */

@media (max-width: 768px) {
    header.sticky {
        height: 56px !important;
        min-height: 56px !important;
        padding: 0 12px !important;
    }
    
    .mac-welcome-banner {
        padding: 20px 24px;
        border-radius: var(--mac-radius);
    }
    .mac-welcome-banner h2 {
        font-size: 1.25rem;
    }
}


/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    header.sticky, div[ref="sidebar"], .mt-auto,
    .mac-tenant-switcher, .mac-welcome-banner { display: none !important; }
    body { background: #fff !important; }
    .flex.min-h-\[calc\(100vh-62px\)\] { margin: 0 !important; padding: 0 !important; }
}


/* ============================================================
   MAC AI CRM — UI Enhancement Patch v3
   Targets ACTUAL Krayin DOM structure:
   - Datagrid: .table-responsive > .row.grid (div-based, not <table>)
   - Kanban: v-lead-kanban pipeline stages
   - Sidebar: div[ref="sidebar"] .sidebar-rounded
   - Toolbar: search, filter, pagination
   
   Append this to mac-crm-custom.css
   ============================================================ */


/* ============================================================
   DATAGRID — Div-based grid tables (the REAL structure)
   ============================================================ */

/* Container — rounded with proper overflow */
.table-responsive.box-shadow {
    border-radius: var(--mac-radius) !important;
    border: 1px solid var(--mac-border) !important;
    overflow: hidden;
    box-shadow: var(--mac-shadow-sm) !important;
    background: var(--mac-surface) !important;
}
.dark .table-responsive.box-shadow {
    background: var(--mac-surface) !important;
    border-color: var(--mac-border) !important;
}

/* Header row — styled micro-label look */
.table-responsive .row.grid.bg-gray-50,
.table-responsive .row.grid[class*="bg-gray-50"],
.table-responsive > div:first-child.row.grid {
    background: var(--mac-indigo-50) !important;
    border-bottom: 2px solid var(--mac-indigo-100) !important;
    min-height: 44px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
.dark .table-responsive .row.grid.bg-gray-50,
.dark .table-responsive .row.grid[class*="bg-gray-50"] {
    background: rgba(99, 102, 241, 0.08) !important;
    border-bottom-color: var(--mac-border) !important;
}

/* Header labels — uppercase refined */
.table-responsive .row.grid.bg-gray-50 p,
.table-responsive .row.grid.bg-gray-50 div {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.68rem !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mac-indigo-600) !important;
}
.dark .table-responsive .row.grid.bg-gray-50 p,
.dark .table-responsive .row.grid.bg-gray-50 div {
    color: var(--mac-indigo-300) !important;
}

/* Body rows — clean alternating + hover */
.table-responsive .row.grid:not(.bg-gray-50):not(:first-child) {
    transition: all 180ms var(--mac-ease);
    border-bottom: 1px solid var(--mac-border-light);
    min-height: 52px;
    align-items: center;
}
.table-responsive .row.grid:not(.bg-gray-50):nth-child(even) {
    background: rgba(238, 242, 255, 0.25);
}
.dark .table-responsive .row.grid:not(.bg-gray-50):nth-child(even) {
    background: rgba(99, 102, 241, 0.03);
}

/* Row hover — indigo left accent bar */
.table-responsive .row.grid:not(.bg-gray-50):not(:first-child):hover {
    background: var(--mac-indigo-50) !important;
    box-shadow: inset 3px 0 0 var(--mac-indigo-400);
}
.dark .table-responsive .row.grid:not(.bg-gray-50):not(:first-child):hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* Row text */
.table-responsive .row.grid:not(.bg-gray-50) p,
.table-responsive .row.grid:not(.bg-gray-50) span:not([class*="icon-"]) {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
    font-size: 0.84rem;
    color: var(--mac-text-primary);
}
.dark .table-responsive .row.grid:not(.bg-gray-50) p {
    color: var(--mac-text-primary);
}

/* Action icons in rows */
.table-responsive .row.grid .icon-edit,
.table-responsive .row.grid .icon-delete,
.table-responsive .row.grid .icon-view,
.table-responsive .row.grid [class*="icon-"]:not(.icon-checkbox-outline):not(.icon-checkbox-select):not(.icon-stats-up):not(.icon-stats-down) {
    transition: all var(--mac-duration) var(--mac-ease);
    border-radius: 6px;
    padding: 4px;
}
.table-responsive .row.grid .icon-edit:hover {
    color: var(--mac-indigo-500) !important;
    background: var(--mac-indigo-50);
}
.table-responsive .row.grid .icon-delete:hover {
    color: var(--mac-coral-500) !important;
    background: var(--mac-coral-50);
}

/* Checkbox brand color fix */
.icon-checkbox-select.text-brandColor,
.peer-checked\:text-brandColor {
    color: var(--mac-indigo-500) !important;
}


/* ============================================================
   DATAGRID TOOLBAR — Search, Filter, Pagination
   ============================================================ */

/* Toolbar container */
.table-responsive + div,
div[class*="toolbarRight"] {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Filter button */
button.bg-brandColor:not(header button),
a.bg-brandColor.rounded-lg,
button[class*="bg-brandColor"]:not(header *) {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    border-radius: var(--mac-radius-sm) !important;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    transition: all var(--mac-duration) var(--mac-ease-bounce);
}

/* Primary button (Create Lead, Create Pipeline etc) */
.primary-button,
a.primary-button {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    border: none !important;
    border-radius: var(--mac-radius-sm) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all var(--mac-duration) var(--mac-ease-bounce);
    color: #fff !important;
}
.primary-button:hover,
a.primary-button:hover {
    background: linear-gradient(135deg, var(--mac-indigo-600), var(--mac-indigo-700)) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Search input in toolbar */
.table-responsive ~ div input[type="text"],
div[class*="toolbar"] input {
    border-radius: var(--mac-radius-sm) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.84rem;
}

/* Pagination */
.table-responsive ~ div select,
div[class*="toolbar"] select {
    border-radius: var(--mac-radius-sm) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Per Page & page count */
div[class*="pagination"] p,
div[class*="toolbar"] p.text-sm {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.78rem;
    color: var(--mac-text-secondary);
}


/* ============================================================
   PAGE HEADERS — Breadcrumbs, titles, action bars
   ============================================================ */

/* Page header card (leads, contacts etc) */
.flex.items-center.justify-between.rounded-lg.border.border-gray-200.bg-white.px-4.py-2 {
    border-radius: var(--mac-radius) !important;
    border: 1px solid var(--mac-border) !important;
    box-shadow: var(--mac-shadow-xs);
    background: var(--mac-surface) !important;
    padding: 14px 20px !important;
}
.dark .flex.items-center.justify-between.rounded-lg.border.border-gray-200.bg-white.px-4.py-2 {
    background: var(--mac-surface) !important;
    border-color: var(--mac-border) !important;
}

/* Breadcrumbs */
a[class*="text-brandColor"],
.text-brandColor {
    color: var(--mac-indigo-500) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 500;
    font-size: 0.82rem;
    transition: color var(--mac-duration) var(--mac-ease);
}
a[class*="text-brandColor"]:hover {
    color: var(--mac-indigo-700) !important;
}

/* Breadcrumb separator */
.text-gray-500.text-sm + .text-gray-500.text-sm,
span.text-gray-500 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Page titles inside header cards */
.text-xl.font-bold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    color: var(--mac-text-primary) !important;
}
.dark .text-xl.font-bold {
    color: var(--mac-text-primary) !important;
}


/* ============================================================
   SIDEBAR — Refined spacing & interaction
   ============================================================ */

/* Sidebar container */
div[ref="sidebar"] {
    top: 64px !important;
    background: var(--mac-surface) !important;
    border-right: 1px solid var(--mac-border) !important;
    box-shadow: 1px 0 15px rgba(0, 0, 0, 0.02);
}
.dark div[ref="sidebar"] {
    background: var(--mac-surface) !important;
    border-right-color: var(--mac-border) !important;
}

/* Nav items spacing */
div[ref="sidebar"] .sidebar-rounded.grid {
    gap: 2px;
    padding: 2px 0;
}

/* Nav item links */
div[ref="sidebar"] .px-4 a {
    border-radius: var(--mac-radius-sm) !important;
    transition: all 180ms var(--mac-ease);
    padding: 8px 10px !important;
    min-height: 38px;
}

/* Active nav item — indigo gradient */
div[ref="sidebar"] .px-4 a.bg-brandColor {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
div[ref="sidebar"] .px-4 a.bg-brandColor span,
div[ref="sidebar"] .px-4 a.bg-brandColor p {
    color: #fff !important;
}

/* Hover — subtle warm lift */
div[ref="sidebar"] .px-4 a:not(.bg-brandColor):hover {
    background: var(--mac-indigo-50) !important;
    transform: translateX(2px);
}
.dark div[ref="sidebar"] .px-4 a:not(.bg-brandColor):hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* Nav icons */
div[ref="sidebar"] .px-4 a span[class^="icon-"] {
    font-size: 22px;
    transition: transform var(--mac-duration) var(--mac-ease);
    flex-shrink: 0;
}
div[ref="sidebar"] .px-4 a:hover span[class^="icon-"] {
    transform: scale(1.08);
}

/* Nav text */
div[ref="sidebar"] .px-4 a p,
div[ref="sidebar"] .px-4 a .font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: -0.01em;
}

/* Submenu flyout panel */
div[ref="sidebar"] .sidebar-rounded.fixed {
    background: var(--mac-surface) !important;
    border-color: var(--mac-border) !important;
    box-shadow: var(--mac-shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.03) !important;
    border-radius: 0 var(--mac-radius) var(--mac-radius) 0 !important;
    overflow: hidden;
}

/* Submenu items */
div[ref="sidebar"] .sidebar-rounded.fixed a {
    border-radius: var(--mac-radius-sm) !important;
    transition: all var(--mac-duration) var(--mac-ease);
}
div[ref="sidebar"] .sidebar-rounded.fixed a p {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 500;
    font-size: 0.82rem;
}
div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
}
div[ref="sidebar"] .sidebar-rounded.fixed a:not(.bg-brandColor):hover {
    background: var(--mac-indigo-50) !important;
}
.dark div[ref="sidebar"] .sidebar-rounded.fixed a:not(.bg-brandColor):hover {
    background: rgba(99, 102, 241, 0.08) !important;
}


/* ============================================================
   MOBILE SIDEBAR DRAWER — Enhanced
   ============================================================ */

/* Drawer menu items */
.menu-item .menu-link.bg-brandColor {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.2);
    border-radius: var(--mac-radius-sm) !important;
}

/* Drawer submenu active */
.submenu .submenu-link.text-brandColor,
.submenu .submenu-link[class*="text-brandColor"] {
    color: var(--mac-indigo-600) !important;
    font-weight: 600;
}
.border-l-brandColor {
    border-left-color: var(--mac-indigo-500) !important;
}


/* ============================================================
   DASHBOARD CARDS — Enhanced visual hierarchy
   ============================================================ */

/* Revenue card (the big chart card) */
.box-shadow.rounded-lg.border.border-gray-200.bg-white.p-4 {
    border-radius: var(--mac-radius) !important;
    border: 1px solid var(--mac-border) !important;
    box-shadow: var(--mac-shadow-sm) !important;
    background: var(--mac-surface-glass) !important;
    backdrop-filter: blur(10px);
}
.box-shadow.rounded-lg.border.border-gray-200.bg-white.p-4:hover {
    box-shadow: var(--mac-shadow-md), var(--mac-shadow-glow) !important;
    transform: translateY(-1px);
}

/* Stats cards (Average Lead Value, Total Leads, etc) */
.grid.grid-cols-3 > div,
.grid-cols-3 > .rounded-lg {
    border-radius: var(--mac-radius) !important;
    transition: all 200ms var(--mac-ease);
}
.grid.grid-cols-3 > div:hover {
    transform: translateY(-2px);
    box-shadow: var(--mac-shadow-md) !important;
}

/* Stats numbers */
.grid-cols-3 .text-2xl,
.grid-cols-3 .font-bold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Stats labels */
.grid-cols-3 .text-xs,
.grid-cols-3 .text-sm.text-gray-600,
.grid-cols-3 p[class*="text-gray"] {
    font-family: 'DM Sans', sans-serif !important;
}

/* Green percentage badges */
.text-green-500,
span[class*="text-green"] {
    color: var(--mac-emerald) !important;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Red percentage badges */
.text-red-500,
span[class*="text-red"] {
    color: var(--mac-coral-500) !important;
    font-weight: 700;
}

/* Section titles in right sidebar cards */
.text-base.font-semibold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* "No Data Available" states */
p:has(+ p[class*="text-gray"]),
.text-center .text-lg.font-semibold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Open Leads By Stages — funnel/bar styling */
.bg-\[\#34D399\],
.bg-\[\#22D3EE\],
[class*="bg-[#34D399]"],
[class*="bg-[#22D3EE]"] {
    border-radius: 4px;
}


/* ============================================================
   FORMS — Polished inputs throughout
   ============================================================ */

/* All non-header inputs */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(header input),
select:not(header select),
textarea {
    border-radius: var(--mac-radius-sm) !important;
    border: 1.5px solid var(--mac-border) !important;
    transition: all var(--mac-duration) var(--mac-ease);
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.85rem;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(header input):focus,
select:not(header select):focus,
textarea:focus {
    border-color: var(--mac-indigo-400) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 0 0 1px var(--mac-indigo-400) !important;
    outline: none !important;
}


/* ============================================================
   DROPDOWNS & MODALS — Premium floating
   ============================================================ */

/* Profile dropdown content */
.mt-2.border-t-0.\!p-0 {
    border-radius: var(--mac-radius) !important;
    box-shadow: var(--mac-shadow-lg) !important;
    overflow: hidden;
    border: 1px solid var(--mac-border) !important;
    animation: dropdownReveal 150ms var(--mac-ease) both;
}

/* Dropdown menu items */
.cursor-pointer.px-5.py-2.text-base,
.cursor-pointer.px-5.py-2.text-sm {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    transition: all var(--mac-duration) var(--mac-ease);
    border-radius: 4px;
    margin: 0 4px;
}

/* Quick-create dropdown items */
.grid.grid-cols-3.gap-2.text-center .rounded-lg {
    border-radius: var(--mac-radius-sm) !important;
    transition: all var(--mac-duration) var(--mac-ease);
    padding: 10px 8px !important;
}
.grid.grid-cols-3.gap-2.text-center .rounded-lg:hover {
    background: var(--mac-indigo-50) !important;
    transform: translateY(-2px);
}
.dark .grid.grid-cols-3.gap-2.text-center .rounded-lg:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}
.grid.grid-cols-3.gap-2.text-center .rounded-lg i {
    color: var(--mac-indigo-500) !important;
    transition: transform var(--mac-duration) var(--mac-ease);
}
.grid.grid-cols-3.gap-2.text-center .rounded-lg:hover i {
    transform: scale(1.15);
}
.grid.grid-cols-3.gap-2.text-center .rounded-lg span.font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.75rem;
    font-weight: 600;
}


/* ============================================================
   FILTER BADGE & TAGS
   ============================================================ */

/* Filter chip/badge when active */
.bg-brandColor.text-white {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
}

/* Tags & badges */
span.rounded-full,
span[class*="rounded-full"][class*="px-"] {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}


/* ============================================================
   LEAD/CONTACT DETAIL VIEWS
   ============================================================ */

/* Activity timeline */
.border-l-2.border-gray-200 {
    border-color: var(--mac-indigo-100) !important;
}
.dark .border-l-2.border-gray-200 {
    border-color: var(--mac-border) !important;
}

/* Tab navigation */
.border-b-2.border-brandColor,
[class*="border-b"][class*="border-brandColor"] {
    border-bottom-color: var(--mac-indigo-500) !important;
}
.text-brandColor {
    color: var(--mac-indigo-500) !important;
}


/* ============================================================
   MICRO-INTERACTIONS & TRANSITIONS
   ============================================================ */

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea,
.rounded-lg, .cursor-pointer {
    transition-timing-function: var(--mac-ease);
}

/* Icon hover effects globally */
[class^="icon-"]:not(header *):not(div[ref="sidebar"] *) {
    transition: all var(--mac-duration) var(--mac-ease);
}

/* Focus-visible for keyboard navigation */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--mac-indigo-400);
    outline-offset: 2px;
    border-radius: var(--mac-radius-sm);
}


/* ============================================================
   SCROLLBAR REFINEMENTS
   ============================================================ */

/* Journal scroll (sidebar, drawers) */
.journal-scroll::-webkit-scrollbar {
    width: 4px;
}
.journal-scroll::-webkit-scrollbar-thumb {
    background: var(--mac-indigo-200);
    border-radius: 10px;
}
.dark .journal-scroll::-webkit-scrollbar-thumb {
    background: var(--mac-indigo-700);
}


/* ============================================================
   MAC AI CRM — KANBAN ENHANCEMENT v4
   Premium pipeline cards with visual hierarchy & polish
   
   Targets existing Krayin blade template classes — no template 
   changes needed. Append to mac-crm-custom.css, replacing the 
   old KANBAN / PIPELINE section.
   ============================================================ */


/* ---- Stage Columns — Frosted glass lanes ---- */

/* Column container */
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\].max-w-\[275px\] {
    background: var(--mac-surface-glass) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--mac-border) !important;
    border-radius: var(--mac-radius) !important;
    box-shadow: var(--mac-shadow-sm);
    transition: box-shadow var(--mac-duration-slow) var(--mac-ease);
}
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\].max-w-\[275px\]:hover {
    box-shadow: var(--mac-shadow), var(--mac-shadow-glow);
}

.dark .flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\].max-w-\[275px\] {
    background: var(--mac-surface) !important;
    border-color: var(--mac-border) !important;
}


/* ---- Stage Headers — Bold with accent bar ---- */

/* Stage header area */
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] > .flex.flex-col.px-2.py-3 {
    padding: 14px 14px 12px !important;
    border-bottom: 1px solid var(--mac-border-light);
    position: relative;
}
/* Indigo accent bar at top of each column */
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] > .flex.flex-col.px-2.py-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--mac-indigo-400), var(--mac-indigo-600));
    opacity: 0.7;
}

/* Stage name */
.flex.gap-2\.5.overflow-x-auto .text-xs.font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    letter-spacing: -0.01em;
    color: var(--mac-text-primary) !important;
}

/* Lead count badge — pill style */
.flex.gap-2\.5.overflow-x-auto .text-xs.font-medium {
    /* The count is inline, we style via the parent */
}

/* Progress bar — indigo gradient instead of green */
.flex.gap-2\.5.overflow-x-auto .h-1.w-36.overflow-hidden.rounded-full {
    background: var(--mac-indigo-50) !important;
    height: 4px !important;
    border-radius: 4px !important;
    width: 100% !important;
}
.flex.gap-2\.5.overflow-x-auto .h-1.w-36.overflow-hidden.rounded-full > .h-1 {
    background: linear-gradient(90deg, var(--mac-indigo-400), var(--mac-indigo-600)) !important;
    height: 4px !important;
    border-radius: 4px !important;
    transition: width 600ms var(--mac-ease);
}
.dark .flex.gap-2\.5.overflow-x-auto .h-1.w-36.overflow-hidden.rounded-full {
    background: var(--mac-border) !important;
}

/* Stage total amount */
.flex.gap-2\.5.overflow-x-auto .flex.items-center.justify-between.gap-2 > .text-xs.font-medium {
    color: var(--mac-indigo-600) !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    font-family: 'DM Sans', sans-serif !important;
}
.dark .flex.gap-2\.5.overflow-x-auto .flex.items-center.justify-between.gap-2 > .text-xs.font-medium {
    color: var(--mac-indigo-300) !important;
}

/* Add lead icon button in stage header */
.flex.gap-2\.5.overflow-x-auto .icon-add {
    background: var(--mac-indigo-50) !important;
    color: var(--mac-indigo-500) !important;
    border-radius: var(--mac-radius-sm) !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    transition: all var(--mac-duration) var(--mac-ease-bounce) !important;
}
.flex.gap-2\.5.overflow-x-auto .icon-add:hover {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    color: #fff !important;
    transform: scale(1.1) rotate(90deg) !important;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3) !important;
}
.dark .flex.gap-2\.5.overflow-x-auto .icon-add {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--mac-indigo-400) !important;
}


/* ---- Lead Cards — Premium elevated cards ---- */

a.lead-item {
    background: var(--mac-surface) !important;
    border: 1px solid var(--mac-border) !important;
    border-radius: var(--mac-radius) !important;
    padding: 14px !important;
    gap: 12px !important;
    box-shadow: var(--mac-shadow-xs) !important;
    transition: all var(--mac-duration) var(--mac-ease) !important;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

/* Card hover — lift with indigo glow */
a.lead-item:hover {
    border-color: var(--mac-indigo-200) !important;
    box-shadow: var(--mac-shadow-md), 0 0 0 1px rgba(99, 102, 241, 0.08) !important;
    transform: translateY(-2px) !important;
}

/* Subtle left accent bar on hover */
a.lead-item::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--mac-indigo-400), var(--mac-coral-400));
    opacity: 0;
    transition: opacity var(--mac-duration) var(--mac-ease);
}
a.lead-item:hover::before {
    opacity: 1;
}

/* Dark mode cards */
.dark a.lead-item {
    background: var(--mac-surface-elevated) !important;
    border-color: var(--mac-border) !important;
}
.dark a.lead-item:hover {
    border-color: var(--mac-indigo-700) !important;
    box-shadow: var(--mac-shadow-md), 0 0 15px rgba(99, 102, 241, 0.1) !important;
}


/* ---- Card Header — Avatar + contact info ---- */

/* Avatar — indigo gradient background */
a.lead-item .flex.items-start.justify-between .flex.items-center.gap-1 > span:first-child,
a.lead-item .flex.items-start.justify-between .flex.items-center.gap-1 > div:first-child:not(.flex.flex-col) {
    /* Targets the x-admin::avatar component */
}

/* Contact name */
a.lead-item .flex.items-start.justify-between .text-xs.font-medium:first-child {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    color: var(--mac-text-primary) !important;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.dark a.lead-item .flex.items-start.justify-between .text-xs.font-medium:first-child {
    color: var(--mac-text-primary) !important;
}

/* Organization name */
a.lead-item .text-\[10px\] {
    font-size: 0.7rem !important;
    color: var(--mac-text-muted) !important;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Rotten days indicator — pulse animation */
a.lead-item .icon-rotten {
    color: var(--mac-coral-500) !important;
    font-size: 18px !important;
    animation: rottenPulse 2s ease-in-out infinite;
}
@keyframes rottenPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* Rotten tooltip — styled */
a.lead-item .icon-rotten + div .rounded-md {
    background: linear-gradient(135deg, var(--mac-coral-600), var(--mac-coral-500)) !important;
    border-radius: var(--mac-radius-sm) !important;
    padding: 6px 12px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600;
    box-shadow: var(--mac-shadow-md);
}


/* ---- Lead Title ---- */

a.lead-item > p.text-xs.font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    color: var(--mac-text-primary) !important;
    line-height: 1.45;
    letter-spacing: -0.005em;
}
.dark a.lead-item > p.text-xs.font-medium {
    color: var(--mac-text-primary) !important;
}


/* ---- Tag Pills — Differentiated by type ---- */

/* Base pill style */
a.lead-item .flex.flex-wrap.gap-1 {
    gap: 6px !important;
    margin-top: 2px;
}

a.lead-item .flex.flex-wrap.gap-1 > div {
    border-radius: 6px !important;
    padding: 3px 8px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.01em;
    line-height: 1.4;
    transition: all var(--mac-duration) var(--mac-ease);
    border: 1px solid transparent;
}

/* Assigned user pill — indigo tint */
a.lead-item .flex.flex-wrap.gap-1 > div:has(.icon-settings-user) {
    background: var(--mac-indigo-50) !important;
    color: var(--mac-indigo-700) !important;
    border-color: var(--mac-indigo-100);
}
a.lead-item .flex.flex-wrap.gap-1 > div:has(.icon-settings-user) .icon-settings-user {
    color: var(--mac-indigo-500) !important;
    font-size: 12px !important;
}
.dark a.lead-item .flex.flex-wrap.gap-1 > div:has(.icon-settings-user) {
    background: rgba(99, 102, 241, 0.12) !important;
    color: var(--mac-indigo-300) !important;
    border-color: rgba(99, 102, 241, 0.2);
}

/* Lead value pill — emerald/money tint */
a.lead-item .flex.flex-wrap.gap-1 > div:not(:has(.icon-settings-user)):nth-child(1),
a.lead-item .flex.flex-wrap.gap-1 > div:not(:has(.icon-settings-user)):nth-of-type(2) {
    /* This targets the formatted_lead_value pill (2nd or 1st non-user pill) */
}

/* ---- Value pill special styling (always the one after user or first if no user) ---- */
/* We use a general approach since CSS can't read Vue data */

/* All non-user, non-tag pills default to warm neutral */
a.lead-item .flex.flex-wrap.gap-1 > div.rounded-xl {
    background: var(--mac-bg-warm) !important;
    color: var(--mac-text-secondary) !important;
    border-radius: 6px !important;
    border: 1px solid var(--mac-border-light) !important;
}
.dark a.lead-item .flex.flex-wrap.gap-1 > div.rounded-xl {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--mac-text-secondary) !important;
    border-color: var(--mac-border) !important;
}

/* User pill override (has icon) */
a.lead-item .flex.flex-wrap.gap-1 > div.rounded-xl:has(.icon-settings-user) {
    background: var(--mac-indigo-50) !important;
    color: var(--mac-indigo-700) !important;
    border-color: var(--mac-indigo-100) !important;
}
.dark a.lead-item .flex.flex-wrap.gap-1 > div.rounded-xl:has(.icon-settings-user) {
    background: rgba(99, 102, 241, 0.12) !important;
    color: var(--mac-indigo-300) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

/* Custom tag pills (have inline backgroundColor) — keep their custom colors but refine shape */
a.lead-item .flex.flex-wrap.gap-1 > div[style*="backgroundColor"] {
    border-radius: 6px !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: var(--mac-shadow-xs);
}


/* ---- Draggable ghost — drag preview styling ---- */

.draggable-ghost {
    opacity: 0.5 !important;
    border: 2px dashed var(--mac-indigo-300) !important;
    border-radius: var(--mac-radius) !important;
    background: var(--mac-indigo-50) !important;
    box-shadow: var(--mac-shadow-lg) !important;
    transform: rotate(1.5deg) scale(1.02) !important;
}


/* ---- Scrollable area — refined scrollbar ---- */

/* Kanban column scroll area */
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: var(--mac-indigo-200) transparent;
    padding: 8px !important;
}
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] .overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--mac-indigo-200);
    border-radius: 4px;
}
.flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: var(--mac-indigo-400);
}
.dark .flex.gap-2\.5.overflow-x-auto > .flex.min-w-\[275px\] .overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--mac-indigo-800);
}


/* ---- Horizontal scroll area (the pipeline strip) ---- */

.flex.gap-2\.5.overflow-x-auto {
    padding: 4px 2px 12px !important;
    gap: 12px !important;
    scrollbar-width: thin;
    scrollbar-color: var(--mac-indigo-200) transparent;
}
.flex.gap-2\.5.overflow-x-auto::-webkit-scrollbar {
    height: 5px;
}
.flex.gap-2\.5.overflow-x-auto::-webkit-scrollbar-track {
    background: transparent;
}
.flex.gap-2\.5.overflow-x-auto::-webkit-scrollbar-thumb {
    background: var(--mac-indigo-200);
    border-radius: 4px;
}


/* ---- Empty state — polished ---- */

.flex.gap-2\.5.overflow-x-auto .flex.flex-col.items-center.justify-center img {
    opacity: 0.4;
    max-width: 100px;
    margin-bottom: 8px;
}

.flex.gap-2\.5.overflow-x-auto .flex.flex-col.items-center.justify-center p.\!text-base {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    color: var(--mac-text-primary) !important;
}

.flex.gap-2\.5.overflow-x-auto .flex.flex-col.items-center.justify-center p.\!text-sm {
    font-size: 0.78rem !important;
    color: var(--mac-text-muted) !important;
    text-align: center;
    line-height: 1.5;
}

/* "Create Lead" button in empty state */
.flex.gap-2\.5.overflow-x-auto .secondary-button {
    border: 1.5px solid var(--mac-indigo-200) !important;
    color: var(--mac-indigo-600) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    border-radius: var(--mac-radius-sm) !important;
    padding: 8px 18px !important;
    transition: all var(--mac-duration) var(--mac-ease-bounce) !important;
}
.flex.gap-2\.5.overflow-x-auto .secondary-button:hover {
    background: linear-gradient(135deg, var(--mac-indigo-500), var(--mac-indigo-600)) !important;
    color: #fff !important;
    border-color: var(--mac-indigo-500) !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25) !important;
    transform: translateY(-2px) !important;
}


/* ---- Card entrance animation ---- */

a.lead-item {
    animation: kanbanCardIn 300ms var(--mac-ease) both;
}
@keyframes kanbanCardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger first few cards */
a.lead-item:nth-child(1) { animation-delay: 0ms; }
a.lead-item:nth-child(2) { animation-delay: 40ms; }
a.lead-item:nth-child(3) { animation-delay: 80ms; }
a.lead-item:nth-child(4) { animation-delay: 120ms; }
a.lead-item:nth-child(5) { animation-delay: 160ms; }


/* ---- Kanban toolbar area refinements ---- */

/* Pipeline selector / filter bar area */
.flex.gap-2\.5.overflow-x-auto ~ .flex,
.flex.gap-2\.5.overflow-x-auto ~ div {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}


/* ============================================================
   MAC AI CRM — LEAD DETAIL PAGE v5
   Complete lead view redesign: pipeline, panels, timeline
   
   Replaces LEAD DETAIL v4 section.
   Targets Krayin blade classes — CSS only, no template edits.
   ============================================================ */


/* ================================================================
   §1  PIPELINE STAGE BAR
   Pill-shaped stage tracker with smooth transitions
   ================================================================ */

/* Pipeline container — floating card with subtle depth */
.flex.w-full.max-w-full:has(.stage) {
    background: linear-gradient(135deg, #fafbff 0%, #f5f3ff 50%, #faf5ff 100%) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(99, 102, 241, 0.08) !important;
    box-shadow:
        0 1px 3px rgba(99, 102, 241, 0.06),
        0 4px 12px rgba(99, 102, 241, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    padding: 8px 10px !important;
    gap: 3px !important;
    animation: stageBarReveal 500ms var(--mac-ease) both;
}
.dark .flex.w-full.max-w-full:has(.stage) {
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.04) 100%) !important;
    border-color: rgba(99, 102, 241, 0.12) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

@keyframes stageBarReveal {
    from { opacity: 0; transform: translateY(-6px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Individual stage chevrons — base */
.stage {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.76rem !important;
    letter-spacing: 0.01em;
    transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    height: 34px !important;
    position: relative;
}

/* Active/completed stages — warm indigo gradient */
.stage.\!bg-green-500 {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
    color: #fff !important;
    box-shadow:
        0 2px 6px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Chevron pseudo-element matching for active stages */
.stage.\!bg-green-500::after,
.stage[class*="after:bg-green"]::after,
.stage[style*="after"].\!bg-green-500::after {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
}
.stage.\!bg-green-500::before,
.stage[class*="before:bg-green"]::before {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
}
/* RTL support */
[dir="rtl"] .stage.\!bg-green-500::before {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
}

/* Lost stage — warm coral */
.stage.\!bg-red-500 {
    background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.25) !important;
}
.stage.\!bg-red-500::after,
.stage[class*="after:bg-red"]::after {
    background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
}
.stage.\!bg-red-500::before,
.stage[class*="before:bg-red"]::before {
    background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
}

/* Inactive stages — clean and airy */
.stage:not(.\!bg-green-500):not(.\!bg-red-500) {
    background: rgba(255, 255, 255, 0.7) !important;
    color: #64748b !important;
    border: 1px solid rgba(148, 163, 184, 0.15);
}
.stage:not(.\!bg-green-500):not(.\!bg-red-500):hover {
    background: rgba(99, 102, 241, 0.06) !important;
    color: #4f46e5 !important;
    border-color: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}
.dark .stage:not(.\!bg-green-500):not(.\!bg-red-500) {
    background: rgba(30, 41, 59, 0.6) !important;
    color: #94a3b8 !important;
}

/* Stage text refinement */
.stage > span {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.74rem !important;
    letter-spacing: 0.01em;
}

/* Won/Lost dropdown end cap */
.relative.flex.h-7.min-w-24 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    height: 34px !important;
    transition: all 280ms var(--mac-ease) !important;
}
.relative.flex.h-7.min-w-24:not(.\!bg-green-500):not(.\!bg-red-500) {
    background: rgba(255, 255, 255, 0.7) !important;
}
.relative.flex.h-7.min-w-24.\!bg-green-500 {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25) !important;
}
.relative.flex.h-7.min-w-24.\!bg-green-500::after {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
}
.relative.flex.h-7.min-w-24.\!bg-red-500 {
    background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.25) !important;
}
.relative.flex.h-7.min-w-24.\!bg-red-500::after {
    background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
}

/* Dropdown arrow icon in Won/Lost */
.relative.flex.h-7.min-w-24 span[class*="icon-"] {
    font-size: 18px !important;
    transition: transform 200ms var(--mac-ease);
}


/* ================================================================
   §2  LEFT PANEL — Lead sidebar
   Refined card with premium typography & spacing
   ================================================================ */

/* Left panel container */
.relative.flex.gap-4 > div[class*="min-w-"][class*="max-w-"][class*="rounded-lg"][class*="border"][class*="bg-white"] {
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 6px 24px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden;
}
.dark .relative.flex.gap-4 > div[class*="min-w-"][class*="max-w-"][class*="rounded-lg"][class*="border"] {
    border-color: rgba(51, 65, 85, 0.6) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Breadcrumbs row */
.relative.flex.gap-4 nav[aria-label="breadcrumb"] a,
.relative.flex.gap-4 .flex.items-center.justify-between a {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}
.relative.flex.gap-4 .icon-arrow-right {
    color: var(--mac-text-muted) !important;
    font-size: 13px !important;
    opacity: 0.5;
}

/* Tags area — icon */
.relative.flex.gap-4 .icon-tag,
.relative.flex.gap-4 span[class*="icon-tag"] {
    color: #a5b4c8 !important;
    transition: color 200ms var(--mac-ease) !important;
}
.relative.flex.gap-4 .icon-tag:hover,
.relative.flex.gap-4 span[class*="icon-tag"]:hover {
    color: var(--mac-indigo-500) !important;
}

/* Lead title — hero treatment */
.relative.flex.gap-4 h3.text-lg.font-bold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.25rem !important;
    letter-spacing: -0.025em;
    color: #0f172a !important;
    line-height: 1.35;
    margin-top: 2px;
}
.dark .relative.flex.gap-4 h3.text-lg.font-bold {
    color: #f1f5f9 !important;
}


/* ================================================================
   §3  ACTION BUTTONS — Mail / File / Note / Activity
   Glassmorphic cards with icon depth
   ================================================================ */

/* Button group container */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 {
    gap: 10px !important;
    padding: 6px 0 2px !important;
}

/* Individual button card */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(span[class*="icon-"]) {
    border-radius: 12px !important;
    padding: 10px 16px !important;
    transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    cursor: pointer;
}

/* Mail button — soft indigo */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-mail) {
    background: linear-gradient(145deg, #eef2ff, #e0e7ff) !important;
    border-color: rgba(99, 102, 241, 0.12) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-mail):hover {
    background: linear-gradient(145deg, #e0e7ff, #c7d2fe) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-mail) span[class*="icon-mail"] {
    color: #4f46e5 !important;
}

/* File button — soft emerald */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-file) {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5) !important;
    border-color: rgba(16, 185, 129, 0.12) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-file):hover {
    background: linear-gradient(145deg, #d1fae5, #a7f3d0) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-file) span[class*="icon-file"] {
    color: #059669 !important;
}

/* Note button — soft amber */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-note) {
    background: linear-gradient(145deg, #fefce8, #fef3c7) !important;
    border-color: rgba(245, 158, 11, 0.12) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-note):hover {
    background: linear-gradient(145deg, #fef3c7, #fde68a) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.15) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-note) span[class*="icon-note"] {
    color: #d97706 !important;
}

/* Activity button — soft blue */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-activity) {
    background: linear-gradient(145deg, #eff6ff, #dbeafe) !important;
    border-color: rgba(59, 130, 246, 0.12) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-activity):hover {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15) !important;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(.icon-activity) span[class*="icon-activity"] {
    color: #2563eb !important;
}

/* All action button icons — consistent sizing */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div > span[class*="icon-"]:first-child {
    font-size: 24px !important;
    transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    display: block;
    margin-bottom: 2px;
}
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:hover > span[class*="icon-"]:first-child {
    transform: scale(1.12);
}

/* Action button labels */
.relative.flex.gap-4 .flex.flex-wrap.gap-2 > div .text-xs {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}


/* ================================================================
   §4  ACCORDION SECTIONS — About Lead, About Persons
   Clean dividers, refined headers, attribute rows
   ================================================================ */

/* Section dividers — softer */
.relative.flex.gap-4 .border-b.border-gray-200 {
    border-color: #f1f5f9 !important;
}
.dark .relative.flex.gap-4 .border-b.border-gray-200 {
    border-color: rgba(51, 65, 85, 0.5) !important;
}

/* Accordion header text */
.relative.flex.gap-4 h4 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    letter-spacing: -0.01em;
    color: #1e293b !important;
}
.dark .relative.flex.gap-4 h4 {
    color: #e2e8f0 !important;
}

/* Edit pencil icon — subtle until hovered */
.relative.flex.gap-4 .icon-edit {
    color: #cbd5e1 !important;
    font-size: 20px !important;
    transition: all 200ms var(--mac-ease) !important;
    border-radius: 8px !important;
    padding: 6px !important;
}
.relative.flex.gap-4 .icon-edit:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
    transform: scale(1.05);
}
.dark .relative.flex.gap-4 .icon-edit:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}

/* Accordion toggle arrow */
.relative.flex.gap-4 span[class*="icon-arrow"] {
    color: #94a3b8 !important;
    transition: all 200ms var(--mac-ease) !important;
}

/* Attribute rows — label/value pairs */
.relative.flex.gap-4 .flex.w-full.flex-col.gap-4 .text-sm {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    line-height: 1.5;
}

/* Attribute labels (left side) */
.relative.flex.gap-4 .text-gray-600 {
    color: #64748b !important;
    font-weight: 500 !important;
}

/* Attribute values (right side) */
.relative.flex.gap-4 .font-medium.dark\:text-white:not(h4):not(h3):not(p) {
    font-weight: 600 !important;
    color: #1e293b !important;
}
.dark .relative.flex.gap-4 .font-medium.dark\:text-white:not(h4):not(h3):not(p) {
    color: #e2e8f0 !important;
}


/* ================================================================
   §5  CONTACT PERSON CARD
   Premium contact display with avatar enhancement
   ================================================================ */

/* Person avatar circle — enhanced */
.relative.flex.gap-4 .flex.h-9.w-9.items-center.justify-center.rounded-full.bg-brandColor,
.relative.flex.gap-4 .flex.h-9.w-9.items-center.justify-center.rounded-full[style*="background"] {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    letter-spacing: 0.02em;
    box-shadow:
        0 2px 8px rgba(99, 102, 241, 0.2),
        0 0 0 2px rgba(255, 255, 255, 0.8) !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
}

/* Person name link */
.relative.flex.gap-4 a.font-semibold.text-brandColor {
    color: #4f46e5 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    transition: all 200ms var(--mac-ease) !important;
    text-decoration: none !important;
}
.relative.flex.gap-4 a.font-semibold.text-brandColor:hover {
    color: #7c3aed !important;
}

/* Job title / organization text */
.relative.flex.gap-4 .flex.flex-col.gap-1 > span {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.8rem !important;
    color: #64748b !important;
    font-weight: 500;
}

/* Email & phone links */
.relative.flex.gap-4 a[href^="mailto:"],
.relative.flex.gap-4 a[href^="callto:"] {
    color: #4f46e5 !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    font-family: 'DM Sans', sans-serif !important;
    transition: all 200ms var(--mac-ease) !important;
    text-decoration: none !important;
    padding: 1px 0;
    border-bottom: 1px dashed transparent;
}
.relative.flex.gap-4 a[href^="mailto:"]:hover,
.relative.flex.gap-4 a[href^="callto:"]:hover {
    color: #7c3aed !important;
    border-bottom-color: #c4b5fd;
}

/* Contact label badges (work/home) */
.relative.flex.gap-4 .flex.gap-1 > span.text-gray-500,
.relative.flex.gap-4 .flex.gap-1 > span.dark\:text-gray-300 {
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}
.dark .relative.flex.gap-4 .flex.gap-1 > span.text-gray-500 {
    background: rgba(51, 65, 85, 0.5) !important;
    color: #94a3b8 !important;
}


/* ================================================================
   §6  ACTIVITY TABS BAR
   Scrollable tab strip with indigo active indicator
   ================================================================ */

/* Activities wrapper card */
.w-full.rounded-md.border.border-gray-200.bg-white {
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 6px 24px rgba(0, 0, 0, 0.03) !important;
    overflow: hidden;
}
.dark .w-full.rounded-md.border.border-gray-200.bg-white {
    border-color: rgba(51, 65, 85, 0.6) !important;
}

/* Tab bar strip */
.w-full.rounded-md .flex.gap-2.overflow-x-auto.border-b {
    gap: 0 !important;
    padding: 0 8px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: linear-gradient(180deg, #fafbff, #fff);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.w-full.rounded-md .flex.gap-2.overflow-x-auto.border-b::-webkit-scrollbar {
    display: none;
}
.dark .w-full.rounded-md .flex.gap-2.overflow-x-auto.border-b {
    background: linear-gradient(180deg, rgba(15,23,42,0.5), transparent) !important;
    border-bottom-color: rgba(51, 65, 85, 0.5) !important;
}

/* Individual tab items */
.w-full.rounded-md .flex.gap-2.overflow-x-auto > div.cursor-pointer {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.01em;
    padding: 12px 14px !important;
    transition: all 200ms var(--mac-ease) !important;
    white-space: nowrap;
    color: #64748b !important;
    border-bottom: 2.5px solid transparent !important;
    margin-bottom: -1px;
    position: relative;
}

/* Active tab — indigo accent */
.w-full.rounded-md .flex.gap-2.overflow-x-auto > div.cursor-pointer.border-b-2,
.w-full.rounded-md .flex.gap-2.overflow-x-auto > div.cursor-pointer[class*="border-brandColor"],
.w-full.rounded-md .flex.gap-2.overflow-x-auto > div.cursor-pointer[class*="!text-brandColor"] {
    color: #4f46e5 !important;
    border-bottom-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.04);
}

/* Tab hover */
.w-full.rounded-md .flex.gap-2.overflow-x-auto > div.cursor-pointer:hover:not([class*="border-brandColor"]) {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.04);
}


/* ================================================================
   §7  ACTIVITY TIMELINE — Card-based items
   Elevated cards with type-colored accents and smooth hover
   ================================================================ */

/* Activity content area */
.w-full.rounded-md .animate-\[on-fade_0\.5s_ease-in-out\] {
    padding: 20px !important;
}

/* Activity list container */
.w-full.rounded-md .flex.flex-col.gap-4:has(.flex.gap-2 > .flex.h-9) {
    gap: 12px !important;
}

/* Individual activity items — card wrapper */
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9) {
    gap: 14px !important;
    align-items: flex-start;
}

/* Activity icon circles — refined with brand consistency */
.w-full.rounded-md .flex.h-9.min-h-9.w-9.min-w-9.items-center.justify-center.rounded-full {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 18px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    margin-top: 12px;
    transition: transform 200ms var(--mac-ease) !important;
    flex-shrink: 0;
}

/* Hovering parent lifts the icon */
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9):hover > .flex.h-9.min-h-9.w-9.min-w-9 {
    transform: scale(1.08);
}

/* Email icon — indigo tint */
.w-full.rounded-md .icon-mail.bg-green-200 {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe) !important;
    color: #4338ca !important;
}

/* Note icon — warm amber */
.w-full.rounded-md .icon-note.bg-orange-200 {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    color: #b45309 !important;
}

/* Call icon — teal */
.w-full.rounded-md .icon-call.bg-cyan-200 {
    background: linear-gradient(135deg, #cffafe, #a5f3fc) !important;
    color: #0e7490 !important;
}

/* Meeting/Activity icon — blue */
.w-full.rounded-md .icon-activity.bg-blue-200 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
    color: #1d4ed8 !important;
}

/* File icon — emerald */
.w-full.rounded-md .icon-file.bg-green-200 {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    color: #047857 !important;
}

/* System/changelog icon — slate */
.w-full.rounded-md .icon-system-generate.bg-yellow-200 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1) !important;
    color: #475569 !important;
}

/* Activity detail card — elevated surface */
.w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4 {
    background: #fff !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    transition: all 220ms var(--mac-ease) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.dark .w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4 {
    background: rgba(15, 23, 42, 0.4) !important;
    border-color: rgba(51, 65, 85, 0.4) !important;
}

/* Remove the alternating gray — we use cards now */
.w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4.bg-gray-100 {
    background: #fafbff !important;
    border-color: rgba(99, 102, 241, 0.06) !important;
}
.dark .w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4.bg-gray-100,
.dark .w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4.dark\:bg-gray-950 {
    background: rgba(99, 102, 241, 0.04) !important;
}

/* Card hover */
.w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4:hover {
    border-color: rgba(99, 102, 241, 0.12) !important;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06) !important;
    transform: translateX(2px);
}

/* Activity title text */
.w-full.rounded-md p.font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    color: #1e293b !important;
    line-height: 1.45;
}
.dark .w-full.rounded-md p.font-medium {
    color: #e2e8f0 !important;
}

/* Schedule/description text */
.w-full.rounded-md .flex.flex-col.gap-2 > .flex.flex-col.gap-1 p:not(.font-medium):not(.text-gray-500) {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.8rem !important;
    color: #475569 !important;
    line-height: 1.5;
}

/* Activity comment/description body */
.w-full.rounded-md p[class*="dark:text-white"]:not(.font-medium):not(.text-gray-500) {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    line-height: 1.55;
    color: #334155 !important;
}

/* Activity timestamp line — By User */
.w-full.rounded-md .text-gray-500.dark\:text-gray-300 {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: 0.01em;
}

/* Three-dot more options button */
.w-full.rounded-md button.icon-more {
    color: #cbd5e1 !important;
    transition: all 200ms var(--mac-ease) !important;
    border-radius: 8px !important;
    width: 32px !important;
    height: 32px !important;
}
.w-full.rounded-md button.icon-more:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
}

/* File attachment links */
.w-full.rounded-md a:has(.icon-attached-file) {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    transition: all 200ms var(--mac-ease) !important;
}
.w-full.rounded-md a:has(.icon-attached-file):hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.w-full.rounded-md a:has(.icon-attached-file) .font-medium.text-brandColor {
    color: #4f46e5 !important;
    font-size: 0.78rem !important;
    font-family: 'DM Sans', sans-serif !important;
}

/* Activity card entrance animation */
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9) {
    animation: activityCardIn 350ms var(--mac-ease) both;
}
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9):nth-child(1) { animation-delay: 0ms; }
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9):nth-child(2) { animation-delay: 60ms; }
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9):nth-child(3) { animation-delay: 120ms; }
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9):nth-child(4) { animation-delay: 180ms; }
.w-full.rounded-md .flex.gap-2:has(> .flex.h-9.min-h-9):nth-child(5) { animation-delay: 240ms; }

@keyframes activityCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ================================================================
   §8  EMPTY STATES
   Polished placeholders when no activities exist
   ================================================================ */

.w-full.rounded-md .grid.justify-center.justify-items-center.gap-3\.5.py-12 {
    padding: 48px 24px !important;
}

.w-full.rounded-md .grid.justify-center img {
    opacity: 0.35;
    max-width: 120px;
    filter: saturate(0.7);
}

.w-full.rounded-md .grid.justify-center .text-xl.font-semibold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    color: #334155 !important;
}

.w-full.rounded-md .grid.justify-center .text-gray-400 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    color: #94a3b8 !important;
    text-align: center;
    max-width: 320px;
    line-height: 1.55;
}


/* ================================================================
   §9  DROPDOWN MENUS (Won/Lost, Activity actions)
   Consistent dropdown styling
   ================================================================ */

.w-full.rounded-md .min-w-40 {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
    padding: 4px !important;
}

.w-full.rounded-md .min-w-40 li {
    border-radius: 8px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 500;
    transition: all 150ms var(--mac-ease) !important;
    margin: 1px 0;
}

.w-full.rounded-md .min-w-40 li:hover {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}


/* ================================================================
   §10  PAGE LAYOUT & ANIMATIONS
   Entrance transitions, responsive adjustments
   ================================================================ */

/* Main container spacing */
.relative.flex.gap-4.max-lg\:flex-wrap {
    gap: 20px !important;
}

/* Left panel entrance */
.relative.flex.gap-4 > div:first-child {
    animation: panelSlideUp 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Right panel entrance (slightly delayed) */
.relative.flex.gap-4 > div:nth-child(2):not(:first-child),
.relative.flex.gap-4 > div.flex.w-full.flex-col.gap-4 {
    animation: panelSlideUp 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 100ms;
}

@keyframes panelSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Right panel gap between stages and activities */
.flex.w-full.flex-col.gap-4.rounded-lg {
    gap: 16px !important;
}


/* ================================================================
   §11  RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
    .relative.flex.gap-4 > div[class*="min-w-[394px]"] {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .flex.w-full.max-w-full:has(.stage) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px !important;
        padding: 6px !important;
    }

    .stage {
        font-size: 0.7rem !important;
        height: 30px !important;
    }

    .relative.flex.gap-4.max-lg\:flex-wrap {
        gap: 12px !important;
    }
}

@media (max-width: 640px) {
    .relative.flex.gap-4 .flex.flex-wrap.gap-2 {
        gap: 6px !important;
    }

    .relative.flex.gap-4 .flex.flex-wrap.gap-2 > div:has(span[class*="icon-"]) {
        padding: 8px 12px !important;
    }

    .w-full.rounded-md .flex.gap-2.overflow-x-auto > div.cursor-pointer {
        padding: 10px 10px !important;
        font-size: 0.72rem !important;
    }
}


/* ============================================================
   MAC AI CRM — LEAD DETAIL v5 PATCH (v5.1)
   Fixes action buttons, attribute rows, and remaining polish
   ============================================================ */


/* ================================================================
   PATCH §A  ACTION BUTTONS — Actual <button> elements
   ================================================================ */

/* All four action buttons — shared base */
.flex.flex-wrap.gap-2 > div > button[class*="h-[74px]"][class*="w-[84px]"],
button.flex.h-\[74px\].w-\[84px\] {
    width: 90px !important;
    height: 80px !important;
    border-radius: 14px !important;
    border: 1.5px solid transparent !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative;
    overflow: hidden;
    gap: 6px !important;
    cursor: pointer;
}

/* Hover lift — all buttons */
.flex.flex-wrap.gap-2 > div > button[class*="h-[74px]"]:hover,
button.flex.h-\[74px\].w-\[84px\]:hover {
    transform: translateY(-3px) !important;
}

/* Icon sizing inside buttons */
.flex.flex-wrap.gap-2 > div > button[class*="h-[74px]"] > span.text-2xl,
button.flex.h-\[74px\].w-\[84px\] > span.text-2xl {
    font-size: 26px !important;
    transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.flex.flex-wrap.gap-2 > div > button[class*="h-[74px]"]:hover > span.text-2xl,
button.flex.h-\[74px\].w-\[84px\]:hover > span.text-2xl {
    transform: scale(1.15) !important;
}

/* --- Mail button — indigo --- */
button.bg-green-200[class*="h-[74px]"],
.flex.flex-wrap.gap-2 > div > button.bg-green-200 {
    background: linear-gradient(150deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%) !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
    color: #4338ca !important;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
button.bg-green-200[class*="h-[74px]"]:hover,
.flex.flex-wrap.gap-2 > div > button.bg-green-200:hover {
    background: linear-gradient(150deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}
button.bg-green-200[class*="h-[74px]"] .icon-mail,
.flex.flex-wrap.gap-2 > div > button.bg-green-200 .icon-mail {
    color: #4338ca !important;
}

/* --- File button — teal/cyan --- */
button.bg-cyan-200[class*="h-[74px]"],
.flex.flex-wrap.gap-2 > div > button.bg-cyan-200 {
    background: linear-gradient(150deg, #ecfeff 0%, #cffafe 50%, #a5f3fc 100%) !important;
    border-color: rgba(14, 116, 144, 0.12) !important;
    color: #155e75 !important;
    box-shadow: 0 1px 3px rgba(14, 116, 144, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
button.bg-cyan-200[class*="h-[74px]"]:hover,
.flex.flex-wrap.gap-2 > div > button.bg-cyan-200:hover {
    background: linear-gradient(150deg, #cffafe 0%, #a5f3fc 50%, #67e8f9 100%) !important;
    border-color: rgba(14, 116, 144, 0.25) !important;
    box-shadow: 0 8px 24px rgba(14, 116, 144, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}
button.bg-cyan-200[class*="h-[74px]"] .icon-file,
.flex.flex-wrap.gap-2 > div > button.bg-cyan-200 .icon-file {
    color: #0e7490 !important;
}

/* --- Note button — warm amber --- */
button.bg-orange-200[class*="h-[74px]"],
.flex.flex-wrap.gap-2 > div > button.bg-orange-200 {
    background: linear-gradient(150deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%) !important;
    border-color: rgba(217, 119, 6, 0.12) !important;
    color: #92400e !important;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
button.bg-orange-200[class*="h-[74px]"]:hover,
.flex.flex-wrap.gap-2 > div > button.bg-orange-200:hover {
    background: linear-gradient(150deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}
button.bg-orange-200[class*="h-[74px]"] .icon-note,
.flex.flex-wrap.gap-2 > div > button.bg-orange-200 .icon-note {
    color: #b45309 !important;
}

/* --- Activity button — blue --- */
button.bg-blue-200[class*="h-[74px]"],
.flex.flex-wrap.gap-2 > div > button.bg-blue-200 {
    background: linear-gradient(150deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%) !important;
    border-color: rgba(37, 99, 235, 0.12) !important;
    color: #1e40af !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
button.bg-blue-200[class*="h-[74px]"]:hover,
.flex.flex-wrap.gap-2 > div > button.bg-blue-200:hover {
    background: linear-gradient(150deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%) !important;
    border-color: rgba(37, 99, 235, 0.25) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}
button.bg-blue-200[class*="h-[74px]"] .icon-activity,
.flex.flex-wrap.gap-2 > div > button.bg-blue-200 .icon-activity {
    color: #1d4ed8 !important;
}

/* Button group spacing */
.relative.flex.gap-4 .flex.flex-wrap.gap-2:has(button[class*="h-[74px]"]) {
    gap: 10px !important;
    padding: 4px 0 0 !important;
}


/* ================================================================
   PATCH §B  ATTRIBUTE ROWS
   ================================================================ */

/* Attribute rows container */
.relative.flex.gap-4 .flex.flex-col.gap-1:has(.grid.items-center) {
    gap: 0 !important;
}

/* Individual attribute row */
.relative.flex.gap-4 .grid.items-center.gap-1[class*="grid-cols"] {
    padding: 10px 0 !important;
    border-bottom: 1px solid #f8fafc;
    gap: 8px !important;
    transition: background 150ms ease !important;
}
.relative.flex.gap-4 .grid.items-center.gap-1[class*="grid-cols"]:last-child {
    border-bottom: none;
}
.relative.flex.gap-4 .grid.items-center.gap-1[class*="grid-cols"]:hover {
    background: #fafbff;
    border-radius: 6px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
}

/* Attribute label */
.relative.flex.gap-4 .grid.items-center .label {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
}

/* Attribute value */
.relative.flex.gap-4 .grid.items-center > .font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}


/* ================================================================
   PATCH §C  ACTIVITY ICON REFINEMENTS
   ================================================================ */

.flex.h-9.min-h-9.w-9.min-w-9.rounded-full.icon-mail.bg-green-200 {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe) !important;
    color: #4338ca !important;
}
.flex.h-9.min-h-9.w-9.min-w-9.rounded-full.icon-note.bg-orange-200 {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    color: #b45309 !important;
}
.flex.h-9.min-h-9.w-9.min-w-9.rounded-full.icon-call.bg-cyan-200 {
    background: linear-gradient(135deg, #cffafe, #a5f3fc) !important;
    color: #0e7490 !important;
}
.flex.h-9.min-h-9.w-9.min-w-9.rounded-full.icon-activity.bg-blue-200 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
    color: #1d4ed8 !important;
}
.flex.h-9.min-h-9.w-9.min-w-9.rounded-full.icon-file.bg-green-200 {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    color: #047857 !important;
}
.flex.h-9.min-h-9.w-9.min-w-9.rounded-full.icon-system-generate.bg-yellow-200 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1) !important;
    color: #475569 !important;
}


/* ================================================================
   PATCH §D  TAB ITEMS
   ================================================================ */

.w-full.rounded-md.border.border-gray-200 > .flex.gap-2.overflow-x-auto > div.cursor-pointer.px-3.py-2\.5.text-sm.font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    padding: 13px 15px !important;
    transition: all 200ms ease !important;
    color: #64748b !important;
    border-bottom: 2.5px solid transparent !important;
    margin-bottom: -1px;
}

.w-full.rounded-md.border.border-gray-200 > .flex.gap-2.overflow-x-auto > div.cursor-pointer.border-brandColor.border-b-2.\!text-brandColor,
.w-full.rounded-md.border.border-gray-200 > .flex.gap-2.overflow-x-auto > div.cursor-pointer.border-b-2[class*="border-brandColor"] {
    color: #4f46e5 !important;
    border-bottom-color: #6366f1 !important;
    border-bottom-width: 2.5px !important;
    background: rgba(99, 102, 241, 0.04) !important;
    font-weight: 700 !important;
}

.w-full.rounded-md.border.border-gray-200 > .flex.gap-2.overflow-x-auto > div.cursor-pointer:not(.border-b-2):hover {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.04) !important;
}


/* ================================================================
   PATCH §E  EDIT ICON & POLISH
   ================================================================ */

a.icon-edit.rounded-md.p-1\.5.text-2xl {
    color: #cbd5e1 !important;
    font-size: 18px !important;
    transition: all 200ms ease !important;
    border-radius: 8px !important;
    padding: 6px !important;
    width: 32px;
    height: 32px;
}
a.icon-edit.rounded-md.p-1\.5.text-2xl:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
}

/* Left panel section padding */
.relative.flex.gap-4 > div[class*="min-w-"] > .flex.w-full.flex-col.gap-4.border-b.p-4 {
    padding: 18px 20px !important;
}

/* Activity comment body styling */
.w-full.rounded-md p[class="dark:text-white"]:not(.font-medium) {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    color: #475569 !important;
    line-height: 1.55;
    margin-top: 2px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #e0e7ff;
}

/* Panel gap */
.relative.flex.gap-4.max-lg\:flex-wrap {
    gap: 20px !important;
}

/* ============================================================
   MAC AI CRM — LEAD DETAIL v5.3 COMPLETE POLISH
   Alignment, spacing, sizing, visual harmony
   ============================================================ */

/* ================================================================
   §1  PAGE LAYOUT — Panel balance & spacing
   ================================================================ */

/* Main container gap */
.relative.flex.gap-4.max-lg\:flex-wrap {
    gap: 24px !important;
    align-items: flex-start;
}

/* Left panel — fixed width, proper card */
.relative.flex.gap-4 > div[class*="min-w-"][class*="max-w-"][class*="rounded-lg"][class*="border"] {
    min-width: 380px !important;
    max-width: 380px !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02) !important;
    background: #fff !important;
}

/* Right panel — flex grow */
.relative.flex.gap-4 > .flex.w-full.flex-col.gap-4 {
    flex: 1;
    min-width: 0;
    gap: 20px !important;
}


/* ================================================================
   §2  LEFT PANEL HEADER — Title & breadcrumbs
   ================================================================ */

/* Top section with breadcrumbs, tags, title, buttons */
.relative.flex.gap-4 > div[class*="min-w-"] > .flex.w-full.flex-col.gap-2.border-b.p-4 {
    padding: 20px !important;
    gap: 8px !important;
}

/* Breadcrumbs */
.relative.flex.gap-4 nav[aria-label] a,
.relative.flex.gap-4 .flex.items-center.justify-between a {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #6366f1 !important;
}
.relative.flex.gap-4 .icon-arrow-right {
    font-size: 12px !important;
    color: #cbd5e1 !important;
}

/* Lead title */
.relative.flex.gap-4 h3.text-lg.font-bold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 4px 0 8px !important;
}


/* ================================================================
   §3  ACTION BUTTONS — Perfect 2x2 grid
   ================================================================ */

/* Button container — CSS Grid for perfect alignment */
.relative.flex.gap-4 .flex.flex-wrap.gap-2:has(button[class*="h-[74px]"]) {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 8px 0 4px !important;
    max-width: 200px;
}

/* Individual buttons — consistent sizing */
button[class*="h-[74px]"][class*="w-[84px]"] {
    width: 100% !important;
    height: 72px !important;
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.65rem !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    gap: 4px !important;
}

/* Button icons */
button[class*="h-[74px]"] > span.text-2xl {
    font-size: 22px !important;
    transition: transform 220ms ease !important;
}
button[class*="h-[74px]"]:hover > span.text-2xl {
    transform: scale(1.1) !important;
}

/* Mail — soft indigo */
button.bg-green-200[class*="h-[74px]"] {
    background: linear-gradient(145deg, #eef2ff, #e0e7ff) !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
}
button.bg-green-200[class*="h-[74px]"]:hover {
    background: linear-gradient(145deg, #e0e7ff, #c7d2fe) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

/* File — soft teal */
button.bg-cyan-200[class*="h-[74px]"] {
    background: linear-gradient(145deg, #ecfeff, #cffafe) !important;
    border-color: #a5f3fc !important;
    color: #0e7490 !important;
}
button.bg-cyan-200[class*="h-[74px]"]:hover {
    background: linear-gradient(145deg, #cffafe, #a5f3fc) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.15) !important;
}

/* Note — soft amber */
button.bg-orange-200[class*="h-[74px]"] {
    background: linear-gradient(145deg, #fffbeb, #fef3c7) !important;
    border-color: #fde68a !important;
    color: #b45309 !important;
}
button.bg-orange-200[class*="h-[74px]"]:hover {
    background: linear-gradient(145deg, #fef3c7, #fde68a) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15) !important;
}

/* Activity — soft blue */
button.bg-blue-200[class*="h-[74px]"] {
    background: linear-gradient(145deg, #eff6ff, #dbeafe) !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}
button.bg-blue-200[class*="h-[74px]"]:hover {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15) !important;
}


/* ================================================================
   §4  ATTRIBUTE SECTIONS — About Lead, About Persons
   ================================================================ */

/* Section container */
.relative.flex.gap-4 > div[class*="min-w-"] > .flex.w-full.flex-col.gap-4.border-b.p-4 {
    padding: 16px 20px !important;
}

/* Accordion header */
.relative.flex.gap-4 h4 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #334155 !important;
    letter-spacing: -0.01em;
}

/* Edit icon */
a.icon-edit.rounded-md {
    color: #cbd5e1 !important;
    font-size: 16px !important;
    padding: 4px !important;
    border-radius: 6px !important;
    transition: all 150ms ease !important;
}
a.icon-edit.rounded-md:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
}

/* Attribute rows container */
.relative.flex.gap-4 .flex.flex-col.gap-1:has(.grid) {
    gap: 0 !important;
}

/* Individual attribute row */
.relative.flex.gap-4 .grid.items-center[class*="grid-cols"] {
    padding: 10px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    gap: 12px !important;
}
.relative.flex.gap-4 .grid.items-center[class*="grid-cols"]:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Attribute label */
.relative.flex.gap-4 .grid.items-center .label {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
}

/* Attribute value */
.relative.flex.gap-4 .grid.items-center > .font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

/* Inline edit wrapper — tighter */
.relative.flex.gap-4 .grid.items-center .group.w-full {
    margin: -4px 0 !important;
}
.relative.flex.gap-4 .grid.items-center .flex.h-\[34px\] {
    height: 28px !important;
}


/* ================================================================
   §5  CONTACT PERSON CARD
   ================================================================ */

/* Avatar */
.relative.flex.gap-4 .flex.items-center.justify-center.rounded-full[style*="background"],
.relative.flex.gap-4 .flex.h-9.w-9.items-center.justify-center.rounded-full {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25) !important;
}

/* Person name */
.relative.flex.gap-4 a.font-semibold.text-brandColor {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: #4338ca !important;
}
.relative.flex.gap-4 a.font-semibold.text-brandColor:hover {
    color: #6d28d9 !important;
}

/* Job title */
.relative.flex.gap-4 .flex.flex-col.gap-1 > span.dark\:text-white {
    font-size: 0.78rem !important;
    color: #64748b !important;
}

/* Email/phone links */
.relative.flex.gap-4 a[href^="mailto:"],
.relative.flex.gap-4 a[href^="callto:"] {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: #6366f1 !important;
}
.relative.flex.gap-4 a[href^="mailto:"]:hover,
.relative.flex.gap-4 a[href^="callto:"]:hover {
    color: #8b5cf6 !important;
}

/* Work/home badge */
.relative.flex.gap-4 .flex.gap-1 > span.text-gray-500 {
    font-size: 0.62rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background: #f1f5f9 !important;
    padding: 2px 7px !important;
    border-radius: 8px !important;
    margin-left: 4px;
}


/* ================================================================
   §6  PIPELINE STAGES BAR
   ================================================================ */

/* Container */
.flex.w-full.max-w-full:has(.stage) {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 50%, #f5f3ff 100%) !important;
    border: 1px solid #e0e7ff !important;
    border-radius: 14px !important;
    padding: 8px 10px !important;
    gap: 3px !important;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.04) !important;
}

/* Active stages */
.stage.\!bg-green-500 {
    background: linear-gradient(135deg, #4f46e5, #6366f1, #818cf8) !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3) !important;
    height: 36px !important;
}
.stage.\!bg-green-500::after {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
}

/* Inactive stages */
.stage:not(.\!bg-green-500):not(.\!bg-red-500) {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #475569 !important;
    height: 36px !important;
    border: 1px solid rgba(226, 232, 240, 0.5) !important;
}
.stage:not(.\!bg-green-500):not(.\!bg-red-500):hover {
    background: #eef2ff !important;
    color: #4338ca !important;
    border-color: #c7d2fe !important;
}

/* Stage text */
.stage > span {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

/* Won/Lost dropdown */
.relative.flex.h-7.min-w-24 {
    height: 36px !important;
    font-size: 0.72rem !important;
}


/* ================================================================
   §7  ACTIVITY TABS
   ================================================================ */

/* Tab container */
.w-full.rounded-md.border.border-gray-200.bg-white {
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02) !important;
    overflow: hidden;
}

/* Tab strip */
.w-full.rounded-md > .flex.gap-2.overflow-x-auto.border-b {
    background: linear-gradient(180deg, #fafbff, #fff) !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 0 16px !important;
    gap: 0 !important;
}

/* Tab items */
.w-full.rounded-md > .flex.gap-2.overflow-x-auto > div.cursor-pointer {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    padding: 14px 12px !important;
    color: #64748b !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -1px;
    transition: all 150ms ease !important;
}

/* Active tab */
.w-full.rounded-md > .flex.gap-2.overflow-x-auto > div.cursor-pointer.border-b-2[class*="border-brandColor"],
.w-full.rounded-md > .flex.gap-2.overflow-x-auto > div.cursor-pointer[class*="!text-brandColor"] {
    color: #4338ca !important;
    font-weight: 700 !important;
    border-bottom-color: #6366f1 !important;
    border-bottom-width: 2.5px !important;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04), transparent) !important;
}

/* Tab hover */
.w-full.rounded-md > .flex.gap-2.overflow-x-auto > div.cursor-pointer:hover:not([class*="border-brandColor"]) {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.03) !important;
}


/* ================================================================
   §8  ACTIVITY TIMELINE CARDS
   ================================================================ */

/* Activity area padding */
.w-full.rounded-md .animate-\[on-fade_0\.5s_ease-in-out\] {
    padding: 20px !important;
}

/* Activity list gap */
.w-full.rounded-md .flex.flex-col.gap-4:has(.flex.gap-2) {
    gap: 14px !important;
}

/* Activity item row */
.w-full.rounded-md .flex.gap-2:has(> .flex.items-center.justify-center.rounded-full) {
    gap: 14px !important;
}

/* Activity icon */
.w-full.rounded-md .flex.h-9.min-h-9.w-9.min-w-9.items-center.justify-center.rounded-full {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 17px !important;
    margin-top: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

/* Activity card */
.w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4 {
    background: #fff !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    transition: all 180ms ease !important;
}
.w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4:hover {
    border-color: #e0e7ff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05) !important;
}

/* Alternating background */
.w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4.bg-gray-100 {
    background: #fafbff !important;
}

/* Activity title */
.w-full.rounded-md p.font-medium.dark\:text-white {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}

/* Schedule/description text */
.w-full.rounded-md .flex.flex-col.gap-2 p.dark\:text-white:not(.font-medium) {
    font-size: 0.8rem !important;
    color: #475569 !important;
    background: #f8fafc !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border-left: 3px solid #c7d2fe !important;
    margin: 4px 0 !important;
}

/* Timestamp */
.w-full.rounded-md .text-gray-500.dark\:text-gray-300 {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.7rem !important;
    color: #94a3b8 !important;
    margin-top: 8px;
}

/* More options button */
.w-full.rounded-md button.icon-more {
    color: #cbd5e1 !important;
    font-size: 18px !important;
    padding: 4px !important;
    border-radius: 6px !important;
}
.w-full.rounded-md button.icon-more:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
}


/* ================================================================
   §9  SECTION DIVIDERS
   ================================================================ */

.relative.flex.gap-4 .border-b.border-gray-200 {
    border-color: #f1f5f9 !important;
}


/* ================================================================
   §10  RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
    .relative.flex.gap-4 > div[class*="min-w-"][class*="max-w-"] {
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    .relative.flex.gap-4.max-lg\:flex-wrap {
        gap: 16px !important;
    }
}


/* ================================================================
   §11  DARK MODE
   ================================================================ */

.dark .relative.flex.gap-4 > div[class*="min-w-"][class*="rounded-lg"] {
    background: #0f172a !important;
    border-color: #1e293b !important;
}

.dark .w-full.rounded-md.border.border-gray-200.bg-white {
    background: #0f172a !important;
    border-color: #1e293b !important;
}

.dark .flex.w-full.max-w-full:has(.stage) {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05)) !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
}

.dark .stage:not(.\!bg-green-500):not(.\!bg-red-500) {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

.dark .w-full.rounded-md .flex.w-full.justify-between.gap-4.rounded-md.p-4 {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: #1e293b !important;
}


/* ============================================================
   MAC AI CRM — LEAD DETAIL v5.4 FIXES
   Button centering, section padding, avatar color
   ============================================================ */

/* §1 ACTION BUTTONS — Center in panel, fix grid */
.relative.flex.gap-4 .flex.flex-wrap.gap-2:has(button[class*="h-[74px]"]) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(90px, 110px)) !important;
    gap: 12px !important;
    justify-content: center !important;
    padding: 12px 0 8px !important;
    width: 100% !important;
    max-width: none !important;
}

/* Button sizing — ensure icons are visible */
button[class*="h-[74px]"][class*="w-[84px]"] {
    width: 100% !important;
    min-width: 90px !important;
    height: 76px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

/* Button icon — ensure visibility */
button[class*="h-[74px]"] > span[class*="icon-"] {
    font-size: 24px !important;
    line-height: 1 !important;
    display: block !important;
}


/* §2 ABOUT LEAD / ABOUT PERSONS — More left padding */

/* Accordion section container — add left padding */
.relative.flex.gap-4 > div[class*="min-w-"] > .flex.w-full.flex-col.gap-4.border-b.p-4 {
    padding: 16px 20px 16px 24px !important;
}

/* Attribute rows — indent from left */
.relative.flex.gap-4 .flex.flex-col.gap-1:has(.grid) {
    padding-left: 4px !important;
}

/* Individual row padding */
.relative.flex.gap-4 .grid.items-center[class*="grid-cols"] {
    padding: 10px 0 10px 4px !important;
}

/* Accordion header — more left space */
.relative.flex.gap-4 .flex.w-full.items-center.justify-between.gap-4 {
    padding-left: 4px !important;
}

/* Section header text (About Lead, About Persons) */
.relative.flex.gap-4 h4 {
    padding-left: 2px !important;
}

/* Contact person details — indent */
.relative.flex.gap-4 .flex.gap-2:has(.rounded-full) {
    padding-left: 4px !important;
}


/* §3 AVATAR — Force indigo gradient (override inline styles) */

/* Target the avatar by structure */
.relative.flex.gap-4 .flex.gap-2 > .flex.items-center.justify-center.rounded-full,
.relative.flex.gap-4 .flex.h-9.w-9.items-center.justify-center.rounded-full,
.relative.flex.gap-4 [class*="rounded-full"][class*="items-center"][class*="justify-center"]:not(.icon-mail):not(.icon-activity):not(.icon-note):not(.icon-file) {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
}


/* §4 TOP SECTION — More breathing room */

/* Lead title area */
.relative.flex.gap-4 > div[class*="min-w-"] > .flex.w-full.flex-col.gap-2.border-b.p-4 {
    padding: 20px 20px 16px 24px !important;
}

/* Breadcrumbs indent */
.relative.flex.gap-4 .flex.items-center.justify-between:has(nav) {
    padding-left: 0 !important;
}

/* Lead title */
.relative.flex.gap-4 h3.text-lg.font-bold {
    padding-left: 0 !important;
    margin-left: 0 !important;
}


/* §5 FIX BUTTON WRAPPER — Remove max-width constraint */

.relative.flex.gap-4 .flex.flex-wrap.gap-2 {
    max-width: 100% !important;
}


/* ============================================================
   MAC AI CRM — LEAD DETAIL v5.5 ICON FIX
   Ensure action button icons display properly
   ============================================================ */

/* Force icon font rendering in action buttons */
button[class*="h-[74px]"] > span[class*="icon-"] {
    font-family: 'icomoon' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 28px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

/* Specific icon content overrides if needed */
button[class*="h-[74px]"] > span.icon-mail:before {
    content: "" !important;
    font-size: 28px !important;
}

button[class*="h-[74px]"] > span.icon-file:before {
    content: "" !important;
    font-size: 28px !important;
}

button[class*="h-[74px]"] > span.icon-note:before {
    content: "" !important;
    font-size: 28px !important;
}

button[class*="h-[74px]"] > span.icon-activity:before {
    content: "" !important;
    font-size: 28px !important;
}

/* Remove any text-2xl sizing that might conflict */
button[class*="h-[74px]"] > span.text-2xl {
    font-size: 28px !important;
}

/* Icon colors for each button type */
button.bg-green-200 > span.icon-mail {
    color: #4338ca !important;
}

button.bg-cyan-200 > span.icon-file {
    color: #0e7490 !important;
}

button.bg-orange-200 > span.icon-note {
    color: #b45309 !important;
}

button.bg-blue-200 > span.icon-activity {
    color: #1d4ed8 !important;
}


/* ============================================================
   MAC AI CRM — SVG ICON FIX (CSS-Only)
   Replace icomoon font icons with inline SVG backgrounds
   ============================================================ */

/* Hide the broken font icon text */
button[class*="h-[74px]"] > span[class*="icon-"]::before {
    content: '' !important;
}

/* Base icon styling */
button[class*="h-[74px]"] > span[class*="icon-"] {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
}

/* MAIL icon - envelope */
button[class*="h-[74px]"] > span.icon-mail,
button.bg-green-200 > span[class*="icon-"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234338ca' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'/%3E%3C/svg%3E") !important;
}

/* FILE icon - document */
button[class*="h-[74px]"] > span.icon-file,
button.bg-cyan-200 > span[class*="icon-"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230e7490' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/%3E%3C/svg%3E") !important;
}

/* NOTE icon - pencil/edit */
button[class*="h-[74px]"] > span.icon-note,
button.bg-orange-200 > span[class*="icon-"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23b45309' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'/%3E%3C/svg%3E") !important;
}

/* ACTIVITY icon - calendar */
button[class*="h-[74px]"] > span.icon-activity,
button.bg-blue-200 > span[class*="icon-"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231d4ed8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E") !important;
}


/* ============================================================
   MAC AI CRM — ENHANCEMENT PACKAGE v7.0
   Kanban • Dashboard • Leads List • Global Polish
   Applied: $(date)
   ============================================================ */


/* ================================================================
   §1  KANBAN BOARD — Premium card experience
   ================================================================ */

/* Kanban container - horizontal scroll area */
.flex.gap-2\.5.overflow-x-auto,
.flex.gap-4.overflow-x-auto:has(.min-w-\[275px\]) {
    padding: 20px 16px 24px !important;
    gap: 16px !important;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe #f1f5f9;
}

.flex.gap-2\.5.overflow-x-auto::-webkit-scrollbar {
    height: 8px;
}
.flex.gap-2\.5.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.flex.gap-2\.5.overflow-x-auto::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #a5b4fc, #c7d2fe);
    border-radius: 4px;
}

/* Stage columns */
.flex.min-w-\[275px\].max-w-\[275px\].flex-col.rounded-lg.border.bg-white,
.min-w-\[275px\].max-w-\[275px\] {
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.015) !important;
    overflow: hidden;
    transition: box-shadow 200ms ease !important;
}

.flex.min-w-\[275px\].max-w-\[275px\]:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.06) !important;
}

/* Stage header */
.min-w-\[275px\] > .flex.items-center.justify-between.gap-2.border-b.p-2,
.min-w-\[275px\] > div:first-child {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%) !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #e0e7ff !important;
}

/* Stage title */
.min-w-\[275px\] .font-medium.text-gray-800,
.min-w-\[275px\] .text-sm.font-medium {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    letter-spacing: -0.01em;
}

/* Lead count badge */
.min-w-\[275px\] .rounded-full.bg-gray-200.px-2,
.min-w-\[275px\] span.rounded-full[class*="bg-"] {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    min-width: 26px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25) !important;
}

/* Stage value/progress */
.min-w-\[275px\] .text-xs.font-medium.text-gray-600 {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 700 !important;
    color: #6366f1 !important;
}

/* Progress bar track */
.min-w-\[275px\] .h-1.overflow-hidden.rounded-full.bg-gray-200,
.h-1.w-36.overflow-hidden.rounded-full {
    background: #e0e7ff !important;
    height: 5px !important;
    border-radius: 3px !important;
    overflow: hidden;
}

/* Progress bar fill */
.min-w-\[275px\] .h-1.overflow-hidden.rounded-full.bg-gray-200 > .h-1,
.h-1.w-36 > .h-1 {
    background: linear-gradient(90deg, #6366f1, #8b5cf6) !important;
    height: 5px !important;
    border-radius: 3px !important;
    transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Add button in stage header */
.min-w-\[275px\] .icon-add,
.min-w-\[275px\] button:has(.icon-add) {
    background: rgba(99, 102, 241, 0.08) !important;
    color: #6366f1 !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.min-w-\[275px\] .icon-add:hover,
.min-w-\[275px\] button:has(.icon-add):hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* Cards container */
.min-w-\[275px\] > .flex.flex-col.gap-2.overflow-y-auto.p-2,
.min-w-\[275px\] > div:nth-child(2) {
    padding: 12px !important;
    gap: 10px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Individual lead card */
a.lead-item,
.min-w-\[275px\] a.flex.flex-col.gap-2.rounded-lg.border.bg-white.p-2 {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    gap: 10px !important;
    cursor: grab !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    text-decoration: none !important;
}

/* Card hover state */
a.lead-item:hover,
.min-w-\[275px\] a.flex.flex-col:hover {
    border-color: #a5b4fc !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12), 0 2px 4px rgba(0,0,0,0.02) !important;
    transform: translateY(-3px) !important;
}

/* Card being dragged */
.draggable-ghost,
.sortable-ghost,
[draggable="true"].opacity-50 {
    opacity: 0.6 !important;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important;
    border: 2px dashed #6366f1 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.25) !important;
    transform: rotate(2deg) scale(1.02) !important;
}

/* Drop placeholder */
.sortable-placeholder {
    background: rgba(99, 102, 241, 0.06) !important;
    border: 2px dashed #a5b4fc !important;
    border-radius: 12px !important;
    min-height: 80px;
}

/* Card title (lead name) */
a.lead-item .font-medium,
.min-w-\[275px\] a .text-sm.font-medium.text-gray-800 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3;
}

/* Card value */
a.lead-item .text-green-600,
.min-w-\[275px\] a .text-xs.font-medium {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 700 !important;
}

/* Card person/contact */
a.lead-item .text-gray-600,
.min-w-\[275px\] a .text-xs.text-gray-600 {
    font-size: 0.76rem !important;
    color: #64748b !important;
}

/* Card tags */
a.lead-item .rounded-xl,
.min-w-\[275px\] a .flex.flex-wrap.gap-1 > div {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
}

/* Rotten indicator */
a.lead-item .icon-rotten,
.min-w-\[275px\] .icon-rotten {
    color: #ef4444 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Create Lead button at bottom of column */
.min-w-\[275px\] > button.text-brandColor,
.min-w-\[275px\] button[class*="text-brand"] {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 12px !important;
    border-radius: 10px !important;
    margin: 8px 12px 12px !important;
    background: rgba(99, 102, 241, 0.04) !important;
    color: #6366f1 !important;
    border: 1px dashed #c7d2fe !important;
    transition: all 200ms ease !important;
}

.min-w-\[275px\] > button.text-brandColor:hover {
    background: #eef2ff !important;
    border-style: solid !important;
    border-color: #a5b4fc !important;
}


/* ================================================================
   §2  DASHBOARD — Stats cards, widgets, charts
   ================================================================ */

/* Dashboard container */
.flex.flex-col.gap-4:has(.grid) {
    gap: 24px !important;
}

/* Stats cards grid */
.grid.grid-cols-4.gap-4,
.grid.grid-cols-3.gap-4,
.flex.flex-wrap.gap-4:has(.rounded-lg.border.bg-white.p-4) {
    gap: 20px !important;
}

/* Individual stat card */
.rounded-lg.border.bg-white.p-4:has(.text-3xl),
.rounded-lg.border.bg-white.p-4:has(.text-2xl),
.flex.flex-col.gap-2.rounded-lg.border.bg-white.p-4 {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 22px 26px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.015) !important;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

/* Stat card hover */
.rounded-lg.border.bg-white.p-4:has(.text-3xl):hover,
.rounded-lg.border.bg-white.p-4:has(.text-2xl):hover {
    border-color: #c7d2fe !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1), 0 4px 8px rgba(0,0,0,0.02) !important;
    transform: translateY(-4px) !important;
}

/* Stat card accent line */
.rounded-lg.border.bg-white.p-4:has(.text-3xl)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    opacity: 0;
    transition: opacity 200ms ease;
}

.rounded-lg.border.bg-white.p-4:has(.text-3xl):hover::before {
    opacity: 1;
}

/* Stat number */
.text-3xl.font-bold,
.text-2xl.font-bold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Stat label — scoped to avoid sidebar submenu collision */
.text-sm.text-gray-600:not(.submenu-link):not(div[ref="sidebar"] *):not(.fixed *),
.text-xs.text-gray-500.uppercase,
.text-xs.font-medium.uppercase {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stat icon container */
.flex.h-14.w-14.items-center.justify-center.rounded-full,
.flex.h-12.w-12.items-center.justify-center.rounded-full {
    width: 52px !important;
    height: 52px !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

/* Icon backgrounds */
.bg-orange-100 { background: linear-gradient(135deg, #fff7ed, #fed7aa) !important; }
.bg-green-100 { background: linear-gradient(135deg, #f0fdf4, #bbf7d0) !important; }
.bg-blue-100 { background: linear-gradient(135deg, #eff6ff, #bfdbfe) !important; }
.bg-purple-100 { background: linear-gradient(135deg, #faf5ff, #e9d5ff) !important; }
.bg-red-100 { background: linear-gradient(135deg, #fef2f2, #fecaca) !important; }
.bg-cyan-100 { background: linear-gradient(135deg, #ecfeff, #a5f3fc) !important; }
.bg-yellow-100 { background: linear-gradient(135deg, #fefce8, #fde047) !important; }
.bg-pink-100 { background: linear-gradient(135deg, #fdf2f8, #fbcfe8) !important; }

/* Percentage indicators */
.text-green-600.text-sm,
span.text-green-600 {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 700 !important;
    color: #059669 !important;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.text-red-600.text-sm,
span.text-red-600 {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 700 !important;
    color: #dc2626 !important;
}

/* Chart containers */
.rounded-lg.border.bg-white.p-4:has(canvas) {
    border-radius: 16px !important;
    padding: 24px !important;
}

/* Chart title */
.rounded-lg.border.bg-white h3,
.rounded-lg.border.bg-white .text-base.font-semibold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 16px;
}

/* Dashboard section titles */
.text-lg.font-bold.text-gray-800,
h2.font-bold {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em;
}

/* Activity feed widget */
.rounded-lg.border.bg-white:has(.border-l-2) {
    padding: 20px !important;
}

/* Activity item */
.rounded-lg.border.bg-white .flex.gap-3:has(.rounded-full) {
    padding: 12px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.rounded-lg.border.bg-white .flex.gap-3:has(.rounded-full):last-child {
    border-bottom: none !important;
}


/* ================================================================
   §3  LEADS LIST / DATAGRID — Table polish
   ================================================================ */

/* Datagrid container */
.table-responsive,
div[class*="overflow"]:has(table),
.rounded-lg.border.bg-white:has(table) {
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}

/* Table header */
table thead,
.table-responsive thead {
    background: linear-gradient(180deg, #f8faff 0%, #f1f5f9 100%) !important;
}

table thead th {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Sortable header hover */
table thead th.cursor-pointer:hover,
table thead th:has(.icon-up-arrow):hover,
table thead th:has(.icon-down-arrow):hover {
    background: #eef2ff !important;
    color: #4338ca !important;
}

/* Sort icons */
table thead th .icon-up-arrow,
table thead th .icon-down-arrow {
    color: #6366f1 !important;
    font-size: 12px !important;
}

/* Table rows */
table tbody tr {
    transition: all 150ms ease !important;
}

/* Alternating rows */
table tbody tr:nth-child(even) {
    background: #fafbff !important;
}

/* Row hover */
table tbody tr:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.04), rgba(139, 92, 246, 0.04)) !important;
}

/* Row hover accent */
table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 #6366f1 !important;
}

/* Table cells */
table tbody td {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.84rem !important;
    color: #334155 !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle;
}

/* Lead name link in table */
table tbody td a {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    color: #4338ca !important;
    text-decoration: none !important;
    transition: color 150ms ease !important;
}

table tbody td a:hover {
    color: #6d28d9 !important;
    text-decoration: underline !important;
}

/* Status badges */
.label-active,
.rounded-md.bg-green-100 {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0) !important;
    color: #166534 !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
}

.label-inactive,
.rounded-md.bg-red-100 {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
    color: #991b1b !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
}

/* Checkbox styling */
table input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
    border: 2px solid #cbd5e1 !important;
    cursor: pointer;
    transition: all 150ms ease !important;
}

table input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border-color: #6366f1 !important;
}

/* Action buttons in table */
table td button,
table td a.icon-edit,
table td a.icon-delete,
table td .icon-more {
    padding: 6px !important;
    border-radius: 8px !important;
    transition: all 150ms ease !important;
    color: #94a3b8 !important;
}

table td button:hover,
table td a.icon-edit:hover {
    background: #eef2ff !important;
    color: #6366f1 !important;
}

table td a.icon-delete:hover {
    background: #fef2f2 !important;
    color: #ef4444 !important;
}

/* Toolbar area */
.flex.items-center.justify-between.gap-4.p-4:has(input),
.flex.items-center.gap-4.border-b.p-4 {
    background: #fafbff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 12px 16px !important;
}

/* Search input */
input[type="search"],
input[placeholder*="Search"],
input[placeholder*="search"] {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.84rem !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 10px 14px 10px 40px !important;
    background-color: #fff !important;
    transition: all 150ms ease !important;
}

input[type="search"]:focus,
input[placeholder*="Search"]:focus {
    border-color: #a5b4fc !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* Filter button */
button.icon-filter,
button:has(.icon-filter) {
    padding: 10px 14px !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    transition: all 150ms ease !important;
}

button.icon-filter:hover,
button:has(.icon-filter):hover {
    border-color: #c7d2fe !important;
    background: #eef2ff !important;
    color: #6366f1 !important;
}

/* View toggle buttons (list/kanban) */
button.icon-list,
button.icon-kanban {
    padding: 10px 12px !important;
    border-radius: 10px !important;
    transition: all 150ms ease !important;
}

button.icon-list:hover,
button.icon-kanban:hover {
    background: #eef2ff !important;
    color: #6366f1 !important;
}

button.icon-list.bg-brandColor,
button.icon-kanban.bg-brandColor,
button.icon-list[class*="bg-brand"],
button.icon-kanban[class*="bg-brand"] {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25) !important;
}

/* Pagination container */
.flex.items-center.justify-between.p-4:has(nav),
.flex.items-center.justify-center.gap-2.p-4 {
    background: #fafbff !important;
    border-top: 1px solid #f1f5f9 !important;
    padding: 12px 16px !important;
}

/* Pagination buttons */
nav[aria-label*="Pagination"] button,
.pagination button,
.pagination a {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    transition: all 150ms ease !important;
}

nav[aria-label*="Pagination"] button:hover,
.pagination button:hover,
.pagination a:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: #6366f1 !important;
}

/* Active page */
nav[aria-label*="Pagination"] .bg-brandColor,
.pagination .active,
.pagination button[class*="bg-brand"] {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    border-color: #6366f1 !important;
    font-weight: 700 !important;
}

/* Per page dropdown */
select[name="perPage"],
.pagination select {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.84rem !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
}


/* ================================================================
   §4  GLOBAL POLISH — Buttons, forms, modals
   ================================================================ */

/* Primary button */
.primary-button,
button.bg-brandColor,
button[class*="bg-brand"]:not(.icon-list):not(.icon-kanban) {
    background: linear-gradient(135deg, #6366f1, #7c3aed) !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.84rem !important;
    padding: 10px 20px !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #fff !important;
}

.primary-button:hover,
button.bg-brandColor:hover {
    background: linear-gradient(135deg, #4f46e5, #6d28d9) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* Secondary button */
.secondary-button,
button.border-brandColor {
    border: 2px solid #6366f1 !important;
    border-radius: 10px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    color: #6366f1 !important;
    background: transparent !important;
    padding: 9px 18px !important;
    transition: all 150ms ease !important;
}

.secondary-button:hover,
button.border-brandColor:hover {
    background: #eef2ff !important;
    transform: translateY(-1px) !important;
}

/* Transparent button */
.transparent-button {
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 150ms ease !important;
}

.transparent-button:hover {
    background: #f1f5f9 !important;
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.88rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    transition: all 150ms ease !important;
    background: #fff !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #a5b4fc !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* Form labels */
label {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
}

label.required::after {
    content: ' *';
    color: #ef4444 !important;
}

/* Modal styling */
.fixed.inset-0.z-\[999\] .bg-white.rounded-lg,
[class*="modal"] .bg-white.rounded-lg {
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

/* Modal header */
.fixed.inset-0 .border-b.p-4 h3 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}


/* ================================================================
   §5  DARK MODE POLISH
   ================================================================ */

.dark .min-w-\[275px\],
.dark .flex.min-w-\[275px\] {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #334155 !important;
}

.dark .min-w-\[275px\] > div:first-child {
    background: linear-gradient(135deg, #1e293b, rgba(99, 102, 241, 0.1)) !important;
    border-color: #334155 !important;
}

.dark a.lead-item,
.dark .min-w-\[275px\] a {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark a.lead-item:hover {
    background: #334155 !important;
    border-color: #6366f1 !important;
}

.dark .rounded-lg.border.bg-white {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark table thead {
    background: linear-gradient(180deg, #1e293b, #0f172a) !important;
}

.dark table tbody tr:nth-child(even) {
    background: rgba(99, 102, 241, 0.03) !important;
}

.dark table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

.dark table td {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark input,
.dark textarea,
.dark select {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark .draggable-ghost {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: #6366f1 !important;
}


/* ============================================================
   MAC AI CRM — v7.1 VISUAL POLISH PATCH
   Enhanced effects for Leads List, Kanban, Dashboard
   ============================================================ */


/* ================================================================
   §1  LEADS LIST / DATAGRID — Enhanced table styling
   ================================================================ */

/* Table container with shadow */
.table-responsive {
    background: #fff !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.02) !important;
    overflow: hidden !important;
}

/* Header row - stronger styling */
.table-responsive .row.grid.bg-gray-50,
.table-responsive .row.grid[class*="bg-gray-50"],
.table-responsive > div:first-child.row.grid {
    background: linear-gradient(180deg, #f8faff 0%, #eef2ff 100%) !important;
    border-bottom: 2px solid #e0e7ff !important;
    padding: 14px 16px !important;
}

/* Header text */
.table-responsive .row.grid.bg-gray-50 p,
.table-responsive .row.grid.bg-gray-50 div,
.table-responsive .row.grid.bg-gray-50 span {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
}

/* Data rows */
.table-responsive .row.grid:not(.bg-gray-50):not(:first-child) {
    padding: 14px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Alternating row colors */
.table-responsive .row.grid:not(.bg-gray-50):nth-child(odd) {
    background: #fff !important;
}

.table-responsive .row.grid:not(.bg-gray-50):nth-child(even) {
    background: #fafbff !important;
}

/* Row hover - premium effect */
.table-responsive .row.grid:not(.bg-gray-50):not(:first-child):hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.04)) !important;
    box-shadow: inset 4px 0 0 #6366f1 !important;
}

/* Data cell text */
.table-responsive .row.grid:not(.bg-gray-50) p {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.84rem !important;
    color: #334155 !important;
}

/* Links in table */
.table-responsive .row.grid a {
    color: #4338ca !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 150ms ease !important;
}

.table-responsive .row.grid a:hover {
    color: #6d28d9 !important;
    text-decoration: underline !important;
}

/* Checkbox styling */
.table-responsive input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
    border: 2px solid #cbd5e1 !important;
    cursor: pointer !important;
    transition: all 150ms ease !important;
    accent-color: #6366f1 !important;
}

.table-responsive input[type="checkbox"]:hover {
    border-color: #a5b4fc !important;
}

.table-responsive input[type="checkbox"]:checked {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

/* Action icons */
.table-responsive .icon-edit,
.table-responsive .icon-delete,
.table-responsive .icon-eye {
    padding: 8px !important;
    border-radius: 8px !important;
    transition: all 150ms ease !important;
    color: #94a3b8 !important;
    font-size: 18px !important;
}

.table-responsive .icon-edit:hover,
.table-responsive .icon-eye:hover {
    background: #eef2ff !important;
    color: #6366f1 !important;
    transform: scale(1.1) !important;
}

.table-responsive .icon-delete:hover {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    transform: scale(1.1) !important;
}

/* Mass action bar */
.fixed.bottom-0 .flex.items-center.gap-4,
div[class*="fixed"][class*="bottom"]:has(button) {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    border-radius: 14px 14px 0 0 !important;
    padding: 14px 24px !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15) !important;
}

/* Mass action buttons */
.fixed.bottom-0 button,
div[class*="fixed"][class*="bottom"] button {
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    transition: all 200ms ease !important;
}


/* ================================================================
   §2  KANBAN — Stronger card effects
   ================================================================ */

/* Stage column hover */
.flex.min-w-\[275px\].max-w-\[275px\]:hover,
.min-w-\[275px\].max-w-\[275px\]:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08) !important;
}

/* Lead card - stronger shadow */
a.lead-item,
.min-w-\[275px\] a.flex.flex-col.gap-2.rounded-lg.border.bg-white.p-2 {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02) !important;
}

/* Lead card hover - more dramatic */
a.lead-item:hover,
.min-w-\[275px\] a.flex.flex-col:hover {
    border-color: #818cf8 !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15), 0 4px 8px rgba(0,0,0,0.04) !important;
    transform: translateY(-4px) scale(1.01) !important;
}

/* Card title on hover */
a.lead-item:hover .font-medium {
    color: #4338ca !important;
}

/* Lead value highlight */
a.lead-item .text-green-600,
.min-w-\[275px\] a .text-green-600 {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 0.78rem !important;
}

/* Empty state styling */
.min-w-\[275px\] .flex.flex-col.items-center.justify-center {
    padding: 40px 20px !important;
}

.min-w-\[275px\] .flex.flex-col.items-center.justify-center p {
    color: #64748b !important;
    font-size: 0.85rem !important;
}


/* ================================================================
   §3  DASHBOARD — Stats card animations
   ================================================================ */

/* Stats cards container */
.grid.grid-cols-4.gap-4,
.grid.grid-cols-3.gap-4 {
    gap: 20px !important;
}

/* Individual stat card - enhanced */
.rounded-lg.border.bg-white.p-4:has(.text-3xl),
.rounded-lg.border.bg-white.p-4:has(.text-2xl) {
    position: relative !important;
    overflow: hidden !important;
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Gradient accent on hover */
.rounded-lg.border.bg-white.p-4:has(.text-3xl)::before,
.rounded-lg.border.bg-white.p-4:has(.text-2xl)::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa) !important;
    transform: scaleX(0) !important;
    transform-origin: left !important;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.rounded-lg.border.bg-white.p-4:has(.text-3xl):hover::before,
.rounded-lg.border.bg-white.p-4:has(.text-2xl):hover::before {
    transform: scaleX(1) !important;
}

/* Stats card hover lift */
.rounded-lg.border.bg-white.p-4:has(.text-3xl):hover,
.rounded-lg.border.bg-white.p-4:has(.text-2xl):hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12), 0 6px 12px rgba(0,0,0,0.04) !important;
    border-color: #c7d2fe !important;
}

/* Stat number animation */
.text-3xl.font-bold,
.text-2xl.font-bold {
    transition: transform 200ms ease, color 200ms ease !important;
}

.rounded-lg.border.bg-white.p-4:hover .text-3xl.font-bold,
.rounded-lg.border.bg-white.p-4:hover .text-2xl.font-bold {
    transform: scale(1.05) !important;
    color: #4338ca !important;
}

/* Chart card styling */
.rounded-lg.border.bg-white:has(canvas) {
    transition: all 200ms ease !important;
}

.rounded-lg.border.bg-white:has(canvas):hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.06) !important;
}

/* Welcome banner enhancement */
.mac-welcome-banner,
.bg-gradient-to-r.from-brandColor {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #8b5cf6 100%) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3) !important;
}


/* ================================================================
   §4  FILTER & TOOLBAR — Enhanced controls
   ================================================================ */

/* Filter button */
.primary-button.bg-brandColor,
button.bg-brandColor.text-white {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
    border: none !important;
    font-weight: 700 !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.primary-button.bg-brandColor:hover,
button.bg-brandColor.text-white:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* Search input */
.relative input[type="text"][placeholder*="Search"],
input[placeholder*="search"] {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 12px 16px 12px 44px !important;
    font-size: 0.88rem !important;
    transition: all 200ms ease !important;
    background: #fff !important;
}

.relative input[type="text"]:focus {
    border-color: #a5b4fc !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

/* Per page dropdown */
select {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 10px 32px 10px 14px !important;
    font-size: 0.84rem !important;
    background-color: #fff !important;
    cursor: pointer !important;
    transition: all 150ms ease !important;
}

select:hover {
    border-color: #c7d2fe !important;
}

select:focus {
    border-color: #a5b4fc !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* Pagination enhanced */
nav[aria-label*="Pagination"] {
    display: flex !important;
    gap: 6px !important;
}

nav[aria-label*="Pagination"] button,
.pagination button {
    min-width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    transition: all 150ms ease !important;
}

nav[aria-label*="Pagination"] button:hover {
    background: #eef2ff !important;
    color: #6366f1 !important;
    transform: translateY(-1px) !important;
}


/* ================================================================
   §5  MICRO-INTERACTIONS — Smooth transitions
   ================================================================ */

/* Global smooth transitions */
a, button, input, select, textarea {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Focus ring for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #6366f1 !important;
    outline-offset: 2px !important;
}

/* Loading shimmer enhancement */
.shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite !important;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Tooltip styling */
[data-tooltip],
.tooltip {
    background: #1e293b !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 0.78rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}


/* ============================================================
   MAC AI CRM — Global Page Enhancement v1
   Comprehensive CSS for: Contacts, Organizations, Activities,
   Quotes, Settings, Dashboard Widgets
   Date: 2026-02-06
   ============================================================ */

/* ============================================================
   1. DATAGRID ENHANCEMENT — All list/index pages
   Affects: Persons, Organizations, Quotes, Activities,
   Settings (users, roles, tags, sources, types, etc.)
   ============================================================ */

/* Table header row — refined with indigo accent */
.table div[class*="grid"][class*="border-b"][class*="bg-gray-50"],
table thead tr,
.table-responsive thead tr {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%) !important;
    border-bottom: 2px solid #e0e7ff !important;
}

.dark .table div[class*="grid"][class*="border-b"][class*="bg-gray-50"],
.dark table thead tr {
    background: linear-gradient(135deg, #1e1b4b 0%, #1f2937 100%) !important;
    border-bottom: 2px solid #312e81 !important;
}

/* Column headers — uppercase micro-label style */
.table div[class*="grid"][class*="border-b"] p,
.table div[class*="grid"][class*="border-b"] span,
table thead th {
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #475569 !important;
}

.dark .table div[class*="grid"][class*="border-b"] p,
.dark table thead th {
    color: #94a3b8 !important;
}

/* Table rows — alternating warmth + hover highlight */
.table > div:not(:first-child) > div[class*="grid"][class*="border-b"],
table tbody tr {
    transition: all 0.15s ease !important;
    border-left: 3px solid transparent !important;
}

.table > div:not(:first-child) > div[class*="grid"][class*="border-b"]:nth-child(even),
table tbody tr:nth-child(even) {
    background: #fafbfc !important;
}

.dark .table > div:not(:first-child) > div[class*="grid"][class*="border-b"]:nth-child(even),
.dark table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02) !important;
}

.table > div:not(:first-child) > div[class*="grid"][class*="border-b"]:hover,
table tbody tr:hover {
    background: #eef2ff !important;
    border-left-color: #6366f1 !important;
}

.dark .table > div:not(:first-child) > div[class*="grid"][class*="border-b"]:hover,
.dark table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    border-left-color: #6366f1 !important;
}

/* Datagrid container — refined card */
.table {
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.dark .table {
    border-color: #374151 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* Datagrid toolbar / filter area */
.table > div:first-child {
    border-bottom: 1px solid #e5e7eb !important;
}

/* Pagination — refined */
.table + div,
nav[aria-label*="pagination"],
.pagination-wrapper {
    margin-top: 0.5rem !important;
}

/* Multi-row datagrid rows (Persons, Activities) — card feel */
div[class*="grid-cols"][class*="grid-rows"] {
    transition: all 0.15s ease !important;
}

/* Action buttons in datagrid rows */
.table a[class*="icon-"],
.table button[class*="icon-"],
.table span[class*="icon-edit"],
.table span[class*="icon-delete"] {
    transition: all 0.15s ease !important;
    border-radius: 6px !important;
    padding: 4px !important;
}

.table span[class*="icon-edit"]:hover,
.table a[class*="icon-edit"]:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
}

.table span[class*="icon-delete"]:hover,
.table a[class*="icon-delete"]:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* Mass action select all checkbox area */
label[for="mass_action_select_all_records"] {
    transition: all 0.15s ease !important;
}


/* ============================================================
   2. PAGE HEADERS — Unified across all sections
   ============================================================ */

/* All page header bars — subtle refinement */
.flex.items-center.justify-between.rounded-lg.border.border-gray-200.bg-white {
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    border-color: #e2e8f0 !important;
}

.dark .flex.items-center.justify-between.rounded-lg.border.border-gray-200.bg-white {
    box-shadow: none !important;
}

/* Page titles — consistent weight */
.flex.items-center.justify-between .text-xl.font-bold {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.01em !important;
}

/* Primary buttons — indigo gradient */
.primary-button,
a.primary-button,
button.primary-button {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
    border: none !important;
    color: white !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    padding: 0.5rem 1.25rem !important;
    box-shadow: 0 2px 8px -2px rgba(99, 102, 241, 0.35) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.primary-button:hover,
a.primary-button:hover,
button.primary-button:hover {
    box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.45) !important;
    transform: translateY(-1px) !important;
}

/* Secondary / outline buttons */
.secondary-button,
button.secondary-button {
    border-radius: 10px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}

/* Danger / delete buttons */
.danger-button,
button.danger-button {
    border-radius: 10px !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 2px 8px -2px rgba(239, 68, 68, 0.35) !important;
}


/* ============================================================
   3. CONTACT DETAIL VIEW — Persons & Organizations
   ============================================================ */

/* Left panel — contact info card */
.flex.gap-4 > div[class*="min-w-[394px]"],
div[class*="min-w-[394px]"][class*="max-w-[394px]"] {
    border-radius: 14px !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05) !important;
    border-color: #e2e8f0 !important;
}

.dark div[class*="min-w-[394px]"][class*="max-w-[394px]"] {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Contact name heading */
div[class*="min-w-[394px]"] h3.text-lg.font-bold {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

/* Job title / subtitle text */
div[class*="min-w-[394px]"] h3.text-lg.font-bold + p {
    color: #6366f1 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

/* Activity action buttons (mail, file, note, activity) on contact detail */
div[class*="min-w-[394px]"] .flex.flex-wrap.gap-2 button,
div[class*="min-w-[394px]"] .flex.flex-wrap.gap-2 > div > button {
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

div[class*="min-w-[394px]"] .flex.flex-wrap.gap-2 button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Tags on contact detail */
div[class*="min-w-[394px]"] span[class*="rounded-xl"],
div[class*="min-w-[394px]"] .tag {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
}

/* Right panel — activities/timeline */
.flex.gap-4 > div[class*="flex-1"][class*="flex-col"],
.flex.gap-4 > div.flex-1.flex.flex-col {
    /* Inherits the general card styling */
}

/* Contact info rows in left panel */
div[class*="min-w-[394px]"] .flex.w-full.flex-col.gap-2.border-b {
    transition: background 0.15s ease !important;
}

div[class*="min-w-[394px]"] .flex.w-full.flex-col.gap-2.border-b:hover {
    background: #fafaff !important;
}

.dark div[class*="min-w-[394px]"] .flex.w-full.flex-col.gap-2.border-b:hover {
    background: rgba(99, 102, 241, 0.04) !important;
}

/* Contact detail labels */
div[class*="min-w-[394px]"] .font-medium {
    color: #475569 !important;
    font-size: 0.8125rem !important;
}

/* Contact detail links (email, phone) */
div[class*="min-w-[394px]"] a[href*="mailto:"],
div[class*="min-w-[394px]"] a[href*="tel:"] {
    color: #6366f1 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.15s ease !important;
}

div[class*="min-w-[394px]"] a[href*="mailto:"]:hover,
div[class*="min-w-[394px]"] a[href*="tel:"]:hover {
    color: #4f46e5 !important;
    text-decoration: underline !important;
}


/* ============================================================
   4. ACTIVITIES PAGE — List + Calendar View
   ============================================================ */

/* Calendar view toggle icons */
i.icon-list,
i.icon-calendar {
    transition: all 0.15s ease !important;
    border-radius: 8px !important;
    color: #64748b !important;
}

i.icon-list:hover,
i.icon-calendar:hover {
    color: #6366f1 !important;
    background: #eef2ff !important;
}

/* Active view toggle */
i.icon-list.bg-gray-200,
i.icon-calendar.bg-gray-200 {
    background: #eef2ff !important;
    color: #6366f1 !important;
}

.dark i.icon-list.bg-gray-200,
.dark i.icon-calendar.bg-gray-200,
i.icon-list.dark\:bg-gray-800,
i.icon-calendar.dark\:bg-gray-800 {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #818cf8 !important;
}

/* Calendar cells — if calendar view is present */
.fc-daygrid-day,
.fc-timegrid-slot,
[class*="calendar"] td {
    transition: background 0.1s ease !important;
}

.fc-daygrid-day:hover,
[class*="calendar"] td:hover {
    background: #f5f3ff !important;
}

/* Calendar events */
.fc-event,
.fc-daygrid-event {
    border-radius: 6px !important;
    border: none !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    padding: 2px 6px !important;
}

/* Activity type badges */
.activity-type-badge,
span[class*="bg-"][class*="text-"][class*="rounded"] {
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.6875rem !important;
    letter-spacing: 0.02em !important;
}


/* ============================================================
   5. SETTINGS PAGES — All index pages
   ============================================================ */

/* Settings main index — card grid */
.settings-container,
div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"][class*="border"] {
    border-radius: 14px !important;
    transition: all 0.2s ease !important;
}

div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"][class*="border"]:hover {
    border-color: #c7d2fe !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08) !important;
    transform: translateY(-2px) !important;
}

.dark div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"][class*="border"]:hover {
    border-color: #4f46e5 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

/* Settings card icons */
div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"] i[class^="icon-"] {
    color: #6366f1 !important;
    transition: transform 0.2s ease !important;
}

div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"]:hover i[class^="icon-"] {
    transform: scale(1.1) !important;
}

/* Settings card titles */
div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"] p.font-semibold,
div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"] .font-bold {
    color: #0f172a !important;
    font-weight: 600 !important;
}

.dark div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"] p.font-semibold {
    color: #f1f5f9 !important;
}

/* Settings card descriptions */
div[class*="grid"][class*="gap-4"] > a[class*="rounded-lg"] p.text-gray-600 {
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
}

/* Form controls in settings pages (create/edit) */
.box-shadow.rounded-lg {
    border-radius: 14px !important;
    overflow: hidden !important;
}

/* Form inputs in settings */
input[type="text"].rounded-md,
input[type="email"].rounded-md,
input[type="number"].rounded-md,
textarea.rounded-md,
select.rounded-md,
.custom-select {
    border-radius: 10px !important;
    transition: all 0.15s ease !important;
}

input[type="text"].rounded-md:focus,
input[type="email"].rounded-md:focus,
textarea.rounded-md:focus,
select.rounded-md:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}


/* ============================================================
   6. DASHBOARD WIDGETS — Enhanced cards & stats
   ============================================================ */

/* Dashboard stat cards */
.flex.flex-1.flex-col.gap-4 > div[class*="rounded-lg"][class*="border"][class*="bg-white"],
.flex.flex-1.flex-col.gap-4 > div.box-shadow {
    border-radius: 14px !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease !important;
    overflow: hidden !important;
}

.flex.flex-1.flex-col.gap-4 > div[class*="rounded-lg"][class*="border"]:hover,
.flex.flex-1.flex-col.gap-4 > div.box-shadow:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-1px) !important;
}

.dark .flex.flex-1.flex-col.gap-4 > div[class*="rounded-lg"][class*="border"]:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

/* Dashboard card headers */
.flex.flex-1.flex-col.gap-4 .flex.items-center.justify-between p.text-base.font-semibold,
.flex.flex-1.flex-col.gap-4 p.text-base.font-semibold {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.9375rem !important;
    letter-spacing: -0.01em !important;
}

/* Revenue / stat big numbers */
.flex.flex-1.flex-col.gap-4 p.text-3xl,
.flex.flex-1.flex-col.gap-4 .text-3xl {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
}

.dark .flex.flex-1.flex-col.gap-4 p.text-3xl,
.dark .flex.flex-1.flex-col.gap-4 .text-3xl {
    color: #f1f5f9 !important;
}

/* Dashboard "over all" stat items */
.flex.flex-1.flex-col.gap-4 div[class*="border-b"] .flex.items-center.gap-2,
.over-all-item {
    padding: 0.625rem 0 !important;
    transition: all 0.15s ease !important;
}

/* Dashboard chart containers */
canvas,
.chart-container {
    border-radius: 10px !important;
}

/* Dashboard right sidebar cards (top leads, top persons, etc.) */
.flex.gap-4 > div[class*="flex"][class*="w-[380px]"] div[class*="rounded-lg"],
.flex.gap-4 > div:last-child > div[class*="rounded-lg"] {
    border-radius: 14px !important;
    border-color: #e2e8f0 !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}

/* Dashboard sidebar card headers */
.flex.gap-4 > div:last-child p.text-base.font-semibold {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 700 !important;
}

/* Dashboard "view all" links */
a[class*="text-brandColor"],
a.text-brandColor {
    color: #6366f1 !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    transition: color 0.15s ease !important;
}

a[class*="text-brandColor"]:hover,
a.text-brandColor:hover {
    color: #4f46e5 !important;
}

/* Pipeline stage progress in dashboard */
.flex.flex-1.flex-col.gap-4 div[class*="bg-brandColor"],
div[style*="background-color"][class*="rounded"] {
    border-radius: 999px !important;
}

/* Revenue chart area — gradient fill hint */
.flex.flex-1.flex-col.gap-4 > div:first-child {
    position: relative;
}

/* Dashboard top person/lead items in sidebar */
.flex.gap-4 > div:last-child a[class*="flex"][class*="gap"] {
    border-radius: 10px !important;
    padding: 0.5rem !important;
    transition: all 0.15s ease !important;
}

.flex.gap-4 > div:last-child a[class*="flex"][class*="gap"]:hover {
    background: #f5f3ff !important;
}

.dark .flex.gap-4 > div:last-child a[class*="flex"][class*="gap"]:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}


/* ============================================================
   7. MODAL & FORM ENHANCEMENTS — Global
   ============================================================ */

/* All modals */
div[class*="fixed"][class*="inset-0"][class*="z-"] > div[class*="bg-white"][class*="rounded"] {
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2) !important;
}

/* Modal backdrop */
div[class*="fixed"][class*="inset-0"][class*="bg-gray-500/50"],
.modal-overlay {
    backdrop-filter: blur(4px) !important;
}

/* Modal headers */
div[class*="fixed"] div[class*="border-b"] h3.text-lg {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 700 !important;
}

/* Form labels */
label.required::after {
    color: #ef4444 !important;
}


/* ============================================================
   8. BREADCRUMBS — Refined styling
   ============================================================ */

nav[aria-label="breadcrumb"] a,
.breadcrumb a,
a[class*="text-brandColor"][class*="font-bold"]:not(.primary-button) {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}


/* ============================================================
   9. QUOTES PAGE — Specific enhancements
   ============================================================ */

/* Quote PDF preview styling */
.quote-pdf-preview,
iframe[src*="quote"] {
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Quote totals table */
table[class*="totals"],
.quote-summary {
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* Quote items table — nicer borders */
.quote-items-table th,
.flex.flex-col.gap-4 table thead th {
    background: #f8fafc !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #475569 !important;
}


/* ============================================================
   10. EMPTY STATES — Polished empty content
   ============================================================ */

/* Empty datagrid state */
.flex.flex-col.items-center.justify-center.gap-4 img,
div[class*="empty-state"] img {
    opacity: 0.7 !important;
    filter: saturate(0.8) !important;
}

.flex.flex-col.items-center.justify-center.gap-4 p {
    font-size: 0.9375rem !important;
    color: #64748b !important;
    font-weight: 500 !important;
}


/* ============================================================
   11. TOOLTIP & DROPDOWN ENHANCEMENTS
   ============================================================ */

/* Dropdowns */
div[class*="absolute"][class*="z-"][class*="bg-white"][class*="rounded"][class*="shadow"] {
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e5e7eb !important;
}

.dark div[class*="absolute"][class*="z-"][class*="bg-white"][class*="rounded"][class*="shadow"] {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4) !important;
    border-color: #374151 !important;
}

/* Dropdown items */
div[class*="absolute"] a[class*="px-4"][class*="py-2"],
div[class*="absolute"] button[class*="px-4"][class*="py-2"] {
    transition: all 0.1s ease !important;
    border-radius: 6px !important;
    margin: 2px 4px !important;
}

div[class*="absolute"] a[class*="px-4"][class*="py-2"]:hover,
div[class*="absolute"] button[class*="px-4"][class*="py-2"]:hover {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}


/* ============================================================
   12. NOTIFICATION & FLASH MESSAGES
   ============================================================ */

/* Success flash */
div[class*="flash"][class*="success"],
.flash-group .success {
    border-radius: 12px !important;
    border-left: 4px solid #22c55e !important;
}

/* Error flash */
div[class*="flash"][class*="error"],
.flash-group .error {
    border-radius: 12px !important;
    border-left: 4px solid #ef4444 !important;
}

/* Warning flash */
div[class*="flash"][class*="warning"],
.flash-group .warning {
    border-radius: 12px !important;
    border-left: 4px solid #f59e0b !important;
}


/* ============================================================
   13. SCROLLBAR REFINEMENT — Subtle everywhere
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}


/* ============================================================
   14. ANIMATIONS — Subtle entrance
   ============================================================ */

/* Card entrance on page load */
@keyframes macFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flex.flex-col.gap-4 > div[class*="rounded-lg"][class*="border"],
.box-shadow,
.table {
    animation: macFadeUp 0.3s ease-out both;
}

.flex.flex-col.gap-4 > div:nth-child(2) { animation-delay: 0.05s; }
.flex.flex-col.gap-4 > div:nth-child(3) { animation-delay: 0.1s; }
.flex.flex-col.gap-4 > div:nth-child(4) { animation-delay: 0.15s; }


/* ============================================================
   15. EXPORT MODAL REFINEMENT
   ============================================================ */

/* Export button styling */
button[class*="secondary-button"] i.icon-export,
a[class*="secondary-button"] i.icon-export {
    color: #6366f1 !important;
}


/* ============================================================
   16. TAG STYLING — Global
   ============================================================ */

/* Tag pills everywhere */
span[class*="rounded-xl"][style*="background"],
.tag-pill {
    border-radius: 8px !important;
    padding: 0.125rem 0.5rem !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
}


/* ============================================================
   17. CHECKBOX & TOGGLE REFINEMENT
   ============================================================ */

input[type="checkbox"] {
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

input[type="checkbox"]:checked {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
}

/* Toggle switches */
button[role="switch"][aria-checked="true"],
div[class*="toggle"][class*="active"] {
    background-color: #6366f1 !important;
}
/* ============================================================
   MAC AI CRM — Web Frontend Enhancement Pack v3
   2026-02-07

   SECTIONS:
     §1  PERSON DETAIL — Premium contact view
     §2  ORGANIZATION DETAIL — List page enhancement
     §3  SETTINGS DEEP PAGES — Attributes, Warehouses, etc.
     §4  RESPONSIVE — Full mobile/tablet optimization
     §5  CHAT FAB — Global AI assistant button
     §6  PRINT — Refined print styles
   ============================================================ */


/* ============================================================
   §1  PERSON DETAIL — Premium contact view
   ============================================================ */

/* Left panel container */
.flex.gap-4 > div[class*="min-w-[394px]"] {
    border-radius: 16px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.04) !important;
    border: 1px solid #E2E8F0 !important;
    overflow: hidden !important;
    transition: box-shadow 0.25s ease !important;
}
.flex.gap-4 > div[class*="min-w-[394px]"]:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06) !important;
}
.dark .flex.gap-4 > div[class*="min-w-[394px]"] {
    border-color: #334155 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Person/Org name heading */
.flex.gap-4 > div[class*="min-w-[394px]"] h3.text-lg.font-bold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #1E293B !important;
}
.dark .flex.gap-4 > div[class*="min-w-[394px]"] h3.text-lg.font-bold {
    color: #F1F5F9 !important;
}

/* Job title — indigo accent */
.flex.gap-4 > div[class*="min-w-[394px]"] h3.text-lg.font-bold + p {
    color: #6366F1 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}
.dark .flex.gap-4 > div[class*="min-w-[394px]"] h3.text-lg.font-bold + p {
    color: #A5B4FC !important;
}

/* Activity action buttons row */
.flex.gap-4 > div[class*="min-w-[394px]"] .flex.flex-wrap.gap-2 button,
.flex.gap-4 > div[class*="min-w-[394px]"] .flex.flex-wrap.gap-2 > div > button {
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}
.flex.gap-4 > div[class*="min-w-[394px]"] .flex.flex-wrap.gap-2 button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.15) !important;
}

/* Attribute sections in left panel */
.flex.gap-4 > div[class*="min-w-[394px]"] .border-b {
    transition: background 0.15s ease !important;
}
.flex.gap-4 > div[class*="min-w-[394px]"] .border-b:hover {
    background: rgba(99, 102, 241, 0.02) !important;
}
.dark .flex.gap-4 > div[class*="min-w-[394px]"] .border-b:hover {
    background: rgba(99, 102, 241, 0.05) !important;
}

/* Contact links — email, phone */
.flex.gap-4 > div[class*="min-w-[394px]"] a[href*="mailto:"],
.flex.gap-4 > div[class*="min-w-[394px]"] a[href*="tel:"],
.flex.gap-4 > div[class*="min-w-[394px]"] a[href*="callto:"] {
    color: #6366F1 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.15s ease !important;
}
.flex.gap-4 > div[class*="min-w-[394px]"] a[href*="mailto:"]:hover,
.flex.gap-4 > div[class*="min-w-[394px]"] a[href*="tel:"]:hover,
.flex.gap-4 > div[class*="min-w-[394px]"] a[href*="callto:"]:hover {
    color: #4338CA !important;
    text-decoration: underline !important;
}

/* Tags on contact detail */
.flex.gap-4 > div[class*="min-w-[394px]"] span[class*="rounded"] {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}

/* Right panel — activities */
.flex.gap-4 > div.flex-1.flex.flex-col,
.flex.gap-4 > div[class*="flex-1"][class*="flex-col"] {
    min-width: 0 !important;
}

/* Breadcrumbs in detail views */
.flex.gap-4 > div[class*="min-w-[394px]"] nav[aria-label="breadcrumb"] a,
.flex.gap-4 > div[class*="min-w-[394px]"] .breadcrumbs a {
    color: #6366F1 !important;
    font-weight: 500 !important;
    font-size: 0.78rem !important;
}


/* ============================================================
   §2  ORGANIZATION — List + detail enhancement
   ============================================================ */

/* Org list page header bar */
.flex.flex-col.gap-4 > .flex.items-center.justify-between.rounded-lg {
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

/* Org page title */
.flex.flex-col.gap-4 > .flex.items-center.justify-between .text-xl.font-bold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #1E293B !important;
}
.dark .flex.flex-col.gap-4 > .flex.items-center.justify-between .text-xl.font-bold {
    color: #F1F5F9 !important;
}


/* ============================================================
   §3  SETTINGS DEEP PAGES — Attributes, Data Transfer,
       Email Templates, Groups, Marketing, Warehouses,
       Web Forms, Webhooks
   ============================================================ */

/* Attributes create/edit form cards */
.flex.flex-col.gap-4 > .rounded-lg.border {
    border-radius: 14px !important;
    overflow: hidden !important;
}

/* Form section headers inside settings */
.flex.flex-col.gap-4 .p-4 > .text-base.font-semibold,
.flex.flex-col.gap-4 .p-4 > .text-lg.font-bold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-weight: 700 !important;
}

/* Settings form inputs — refined focus states */
.flex.flex-col.gap-4 input[type="text"]:focus,
.flex.flex-col.gap-4 input[type="email"]:focus,
.flex.flex-col.gap-4 input[type="number"]:focus,
.flex.flex-col.gap-4 input[type="password"]:focus,
.flex.flex-col.gap-4 input[type="url"]:focus,
.flex.flex-col.gap-4 select:focus,
.flex.flex-col.gap-4 textarea:focus {
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* Warehouse view cards */
div[class*="warehouses"] .rounded-lg.border,
.flex.gap-4 .rounded-lg.border.bg-white {
    border-radius: 14px !important;
    transition: box-shadow 0.2s ease !important;
}

/* Email template preview areas */
.flex.flex-col.gap-4 .border.rounded-lg pre,
.flex.flex-col.gap-4 .border.rounded-lg code {
    font-size: 0.82rem !important;
    border-radius: 10px !important;
}

/* Web form builder elements */
.flex.flex-col.gap-4 .draggable,
.flex.flex-col.gap-4 [draggable="true"] {
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}
.flex.flex-col.gap-4 .draggable:hover,
.flex.flex-col.gap-4 [draggable="true"]:hover {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1) !important;
}

/* Marketing campaigns/events — card styling */
.flex.flex-col.gap-4 .grid > .rounded-lg,
.flex.flex-col.gap-4 .grid > div > .rounded-lg {
    border-radius: 14px !important;
    transition: all 0.2s ease !important;
}
.flex.flex-col.gap-4 .grid > .rounded-lg:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}


/* ============================================================
   §4  RESPONSIVE — Full mobile + tablet optimization
   ============================================================ */

/* ---- Tablet (≤1024px) ---- */
@media (max-width: 1024px) {
    /* Sidebar collapse — handled by Krayin, refine spacing */
    .flex.gap-4.max-lg\:flex-wrap {
        gap: 16px !important;
    }

    /* Contact detail: stack panels */
    .flex.gap-4 > div[class*="min-w-[394px]"] {
        min-width: 100% !important;
        max-width: 100% !important;
        position: static !important;
    }

    /* Lead detail left panel */
    .flex.gap-4 > div[class*="min-w-[320px]"],
    .flex.gap-4 > div.mc-left-strip {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    /* AI Analytics grid adjustments */
    .mac-ai-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .mac-ai-two-col {
        grid-template-columns: 1fr !important;
    }

    /* Kanban: horizontal scroll */
    .lead-pipeline-container,
    [class*="kanban"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Datagrid: responsive table */
    .table-responsive,
    table.datagrid {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ---- Mobile (≤768px) ---- */
@media (max-width: 768px) {
    /* Header refinements */
    header .flex.gap-2.5,
    header .flex.gap-x-2\.5 {
        gap: 6px !important;
    }

    /* Hide non-essential header items on mobile */
    header .hidden-mobile,
    header [data-hide-mobile] {
        display: none !important;
    }

    /* Page titles — smaller on mobile */
    .text-xl.font-bold,
    .text-2xl.font-bold {
        font-size: 1.15rem !important;
    }

    /* Content padding */
    .p-4, .px-4 {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Cards: full width, tighter radius */
    .rounded-lg.border {
        border-radius: 12px !important;
    }

    /* Activity action buttons — wrap nicely */
    .flex.flex-wrap.gap-2 {
        gap: 6px !important;
    }
    .flex.flex-wrap.gap-2 button {
        font-size: 0.72rem !important;
        padding: 6px 10px !important;
    }

    /* AI Analytics KPI */
    .mac-ai-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Pipeline funnel: vertical stack */
    .mac-ai-funnel-row {
        flex-direction: column !important;
    }

    /* Dashboard stats: 2-col on mobile */
    .grid.grid-cols-4,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .grid.grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Table cells — ensure readability */
    td, th {
        font-size: 0.78rem !important;
        padding: 8px 10px !important;
    }

    /* Modal / drawer — full width on mobile */
    .modal-container,
    [class*="drawer"] .max-w-lg,
    [class*="drawer"] .max-w-xl,
    [class*="drawer"] .max-w-2xl {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
    }

    /* Chat panel — full screen on mobile */
    .mac-ai-chat-panel {
        width: 100% !important;
        right: 0 !important;
        bottom: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
    }

    /* Chat FAB — bottom right, larger touch target */
    .mac-ai-fab {
        bottom: 16px !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 1.3rem !important;
    }

    /* Breadcrumbs — truncate */
    nav[aria-label="breadcrumb"],
    .breadcrumbs {
        font-size: 0.72rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Settings grid on mobile: single column */
    .grid.grid-cols-2,
    .grid.grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
}

/* ---- Small mobile (≤480px) ---- */
@media (max-width: 480px) {
    /* KPI cards: single column */
    .mac-ai-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    /* Tighter padding */
    .p-4, .px-4 {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Header search — hide on very small screens */
    header input[type="search"],
    header input[type="text"][placeholder*="Search"] {
        display: none !important;
    }

    /* Contact left panel: reduce min-width */
    .flex.gap-4 > div[class*="min-w-[394px]"] {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    /* Button text — hide labels, keep icons */
    .flex.flex-wrap.gap-2 button span.hidden-xs {
        display: none !important;
    }
}

/* ---- Touch optimization ---- */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, a.primary-button, .btn, [role="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
    }

    /* Remove hover lift effects on touch */
    .flex.gap-4 > div[class*="min-w-[394px]"]:hover,
    .rounded-lg.border:hover {
        transform: none !important;
    }

    /* Smoother scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
}


/* ============================================================
   §5  GLOBAL CHAT FAB — Available on all pages
   ============================================================ */

/* The AI chat FAB styles (shared with analytics page) */
.mac-ai-global-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    z-index: 9998;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.mac-ai-global-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
}
.mac-ai-global-fab:active {
    transform: scale(0.95);
}

/* Global chat panel (slide-in from right) */
.mac-ai-global-chat {
    position: fixed;
    right: -420px;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 100vw;
    background: #FFFFFF;
    border-left: 1px solid #E2E8F0;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}
.mac-ai-global-chat.open {
    right: 0;
}
.dark .mac-ai-global-chat {
    background: #111827;
    border-color: #1F2937;
}

/* Chat header */
.mac-ai-global-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    flex-shrink: 0;
}
.mac-ai-global-chat-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}
.mac-ai-global-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.mac-ai-global-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Chat messages */
.mac-ai-global-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mac-ai-global-chat-messages::-webkit-scrollbar { width: 5px; }
.mac-ai-global-chat-messages::-webkit-scrollbar-track { background: transparent; }
.mac-ai-global-chat-messages::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

.mac-ai-gchat-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.55;
    word-break: break-word;
}
.mac-ai-gchat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    border-bottom-right-radius: 4px;
}
.mac-ai-gchat-msg.assistant {
    align-self: flex-start;
    background: #F1F5F9;
    color: #1E293B;
    border-bottom-left-radius: 4px;
}
.dark .mac-ai-gchat-msg.assistant {
    background: #1E293B;
    color: #E2E8F0;
}

/* Chat input area */
.mac-ai-global-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #E2E8F0;
    background: #FAFBFC;
    flex-shrink: 0;
}
.dark .mac-ai-global-chat-input {
    background: #0F172A;
    border-color: #1F2937;
}
.mac-ai-global-chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 0.82rem;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: white;
    color: #1E293B;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mac-ai-global-chat-input input:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.dark .mac-ai-global-chat-input input {
    background: #1E293B;
    border-color: #374151;
    color: #E2E8F0;
}
.mac-ai-global-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.mac-ai-global-chat-input button:hover {
    background: linear-gradient(135deg, #4F46E5, #4338CA);
    transform: scale(1.05);
}
.mac-ai-global-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing indicator */
.mac-ai-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.mac-ai-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94A3B8;
    animation: macAiDotPulse 1.4s ease-in-out infinite;
}
.mac-ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.mac-ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes macAiDotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Quick suggestion chips in global chat */
.mac-ai-gchat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    border-top: 1px solid #F1F5F9;
}
.dark .mac-ai-gchat-suggestions {
    border-color: #1F2937;
}
.mac-ai-gchat-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background: white;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    white-space: nowrap;
}
.mac-ai-gchat-chip:hover {
    border-color: #6366F1;
    color: #6366F1;
    background: #EEF2FF;
}
.dark .mac-ai-gchat-chip {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}
.dark .mac-ai-gchat-chip:hover {
    border-color: #818CF8;
    color: #A5B4FC;
}


/* ============================================================
   §6  PRINT — Refined print styles
   ============================================================ */

@media print {
    /* Hide navigation, chat, FAB */
    .mac-ai-global-fab,
    .mac-ai-global-chat,
    .mac-ai-fab,
    .mac-ai-chat-panel,
    header,
    nav,
    aside,
    .sidebar {
        display: none !important;
    }

    /* Full width content */
    main, .main-content, [class*="flex-1"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Reduce shadows and borders for print */
    .rounded-lg, .rounded-xl {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    /* Ensure text is dark for print */
    * {
        color: #000 !important;
        background: white !important;
    }
}

/* ============================================================
   §7  MOBILE SIDEBAR DRAWER — Fix z-index + width
   ============================================================ */
@media (max-width: 1024px) {
    /* Ensure mobile drawer sits above everything */
    .fixed.z-\[10002\] {
        z-index: 10002 !important;
    }
    .fixed.z-\[10003\] {
        z-index: 10003 !important;
        margin: 0 !important;
        border-radius: 0 16px 16px 0 !important;
        height: 100vh !important;
        top: 0 !important;
        bottom: 0 !important;
    }

    /* Mobile sidebar: override desktop sidebar styles */
    div[ref="sidebar"] {
        display: none !important;
    }

    /* Ensure drawer content fills properly */
    .fixed.z-\[10003\] .journal-scroll {
        height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
    }

    /* Global chat: lower z-index so drawer overlays it */
    .mac-ai-global-fab {
        z-index: 9990 !important;
    }
    .mac-ai-global-chat {
        z-index: 9991 !important;
    }
}

/* ============================================================
   §8  MOBILE SIDEBAR — Light mode text fix
   ============================================================ */
@media (max-width: 1024px) {
    /* Menu items: ensure dark text in light mode */
    .fixed.z-\[10003\] .menu-link,
    .fixed.z-\[10003\] .menu-link .font-semibold,
    .fixed.z-\[10003\] .menu-link p,
    .fixed.z-\[10003\] nav a,
    .fixed.z-\[10003\] nav a p {
        color: #1E293B !important;
    }
    .fixed.z-\[10003\] .menu-link span[class^="icon-"] {
        color: #475569 !important;
    }

    /* Active menu item — white text on brand bg */
    .fixed.z-\[10003\] .menu-link.bg-brandColor,
    .fixed.z-\[10003\] .menu-link.bg-brandColor p,
    .fixed.z-\[10003\] .menu-link.bg-brandColor span {
        color: #FFFFFF !important;
    }

    /* Submenu items */
    .fixed.z-\[10003\] .submenu-link {
        color: #475569 !important;
    }
    .fixed.z-\[10003\] .submenu-link.text-brandColor {
        color: #6366F1 !important;
    }

    /* Dark mode: light text */
    .dark .fixed.z-\[10003\] .menu-link,
    .dark .fixed.z-\[10003\] .menu-link p,
    .dark .fixed.z-\[10003\] nav a,
    .dark .fixed.z-\[10003\] nav a p {
        color: #E2E8F0 !important;
    }
    .dark .fixed.z-\[10003\] .menu-link span[class^="icon-"] {
        color: #94A3B8 !important;
    }
    .dark .fixed.z-\[10003\] .submenu-link {
        color: #94A3B8 !important;
    }

    /* Profile dropdown — same fix */
    .fixed.z-\[10003\] .menu-item {
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
}

/* ============================================================
   §9  MOBILE DRAWER — Close button + profile dropdown light fix
   ============================================================ */
@media (max-width: 1024px) {
    /* Close (X) button in drawer header — dark in light mode */
    .fixed.z-\[10003\] .icon-cross-large,
    .fixed.z-\[10003\] span[class*="icon-cross"] {
        color: #1E293B !important;
    }
    .dark .fixed.z-\[10003\] .icon-cross-large,
    .dark .fixed.z-\[10003\] span[class*="icon-cross"] {
        color: #E2E8F0 !important;
    }

    /* Profile/account dropdown — fix invisible text */
    div[class*="z-[10003]"] p,
    div[class*="z-[10003]"] span,
    div[class*="z-[10003]"] a {
        color: #1E293B !important;
    }
    .dark div[class*="z-[10003]"] p,
    .dark div[class*="z-[10003]"] span,
    .dark div[class*="z-[10003]"] a {
        color: #E2E8F0 !important;
    }

    /* Active menu items still need white text */
    div[class*="z-[10003]"] .bg-brandColor p,
    div[class*="z-[10003]"] .bg-brandColor span,
    div[class*="z-[10003]"] .bg-brandColor a {
        color: #FFFFFF !important;
    }
}

/* Profile dropdown (non-mobile too) — ensure text visible in light mode */
.fixed[style*="z-index"] .bg-white p,
.fixed[style*="z-index"] .bg-white a,
header .relative .absolute p,
header .relative .absolute a {
    color: #1E293B !important;
}
.dark header .relative .absolute p,
.dark header .relative .absolute a {
    color: #E2E8F0 !important;
}

/* ============================================================
   §10  DESKTOP SIDEBAR SUBMENU + PROFILE DROPDOWN + DATAGRID
        Text visibility fixes for light mode
   ============================================================ */

/* --- Desktop sidebar submenu (flyout panel) --- */
div[ref="sidebar"] .sidebar-rounded.fixed a p {
    color: #475569 !important;
}
div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor p,
div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor span {
    color: #FFFFFF !important;
}
div[ref="sidebar"] .sidebar-rounded.fixed a:hover p {
    color: #1E293B !important;
}
.dark div[ref="sidebar"] .sidebar-rounded.fixed a p {
    color: #CBD5E1 !important;
}
.dark div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor p {
    color: #FFFFFF !important;
}
.dark div[ref="sidebar"] .sidebar-rounded.fixed a:hover p {
    color: #F1F5F9 !important;
}

/* --- Profile dropdown (header account menu) --- */
.relative > .absolute.rounded-lg p,
.relative > .absolute.rounded-lg a,
.relative > .absolute.rounded-lg span,
[class*="dropdown"] .rounded-lg p,
[class*="dropdown"] .rounded-lg a {
    color: #374151 !important;
}
.relative > .absolute.rounded-lg a:hover {
    color: #6366F1 !important;
}
.dark .relative > .absolute.rounded-lg p,
.dark .relative > .absolute.rounded-lg a,
.dark .relative > .absolute.rounded-lg span,
.dark [class*="dropdown"] .rounded-lg p,
.dark [class*="dropdown"] .rounded-lg a {
    color: #D1D5DB !important;
}

/* Specific fix: "My Account" and "Sign Out" links */
.border-b-gray-300 ~ a,
.border-b-gray-300 ~ form button,
div.px-5.py-3 ~ a,
div.px-5.py-3 ~ form button {
    color: #374151 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}
.dark .border-b-gray-300 ~ a,
.dark .border-b-gray-300 ~ form button,
.dark div.px-5.py-3 ~ a,
.dark div.px-5.py-3 ~ form button {
    color: #D1D5DB !important;
}

/* --- Datagrid / product list text visibility --- */
table td,
table td p,
table td a,
table td span,
.table-responsive td,
.table-responsive td p,
div[class*="datagrid"] td,
div[class*="datagrid"] td p {
    color: #1E293B !important;
}
.dark table td,
.dark table td p,
.dark table td a,
.dark table td span,
.dark .table-responsive td,
.dark div[class*="datagrid"] td,
.dark div[class*="datagrid"] td p {
    color: #E2E8F0 !important;
}

/* Datagrid action icons should stay subtle */
table td .icon-eye,
table td .icon-edit,
table td .icon-delete,
table td span[class^="icon-"] {
    color: #94A3B8 !important;
}
table td span[class^="icon-"]:hover {
    color: #6366F1 !important;
}

/* Product/list card items — ensure text is visible */
.flex.flex-col.gap-2 p.font-medium,
.flex.flex-col.gap-2 p.text-sm {
    color: #1E293B !important;
}
.dark .flex.flex-col.gap-2 p.font-medium,
.dark .flex.flex-col.gap-2 p.text-sm {
    color: #E2E8F0 !important;
}

/* ============================================================
   §11  CRITICAL — Sidebar + Dropdown text color overrides
   ============================================================ */

/* Desktop sidebar: ALL non-active link text must be dark in light mode */
div[ref="sidebar"] .px-4 a:not(.bg-brandColor) p,
div[ref="sidebar"] .px-4 a:not(.bg-brandColor) .font-medium,
div[ref="sidebar"] .px-4 a:not(.bg-brandColor) span.text-gray-600,
div[ref="sidebar"] .sidebar-rounded.fixed a:not(.bg-brandColor) p {
    color: #475569 !important;
}
div[ref="sidebar"] .px-4 a:not(.bg-brandColor) span[class^="icon-"] {
    color: #64748B !important;
}
.dark div[ref="sidebar"] .px-4 a:not(.bg-brandColor) p,
.dark div[ref="sidebar"] .px-4 a:not(.bg-brandColor) .font-medium,
.dark div[ref="sidebar"] .sidebar-rounded.fixed a:not(.bg-brandColor) p {
    color: #CBD5E1 !important;
}
.dark div[ref="sidebar"] .px-4 a:not(.bg-brandColor) span[class^="icon-"] {
    color: #94A3B8 !important;
}

/* Profile dropdown — absolute z-10 with shadow */
.absolute.z-10.rounded.bg-white p,
.absolute.z-10.rounded.bg-white a,
.absolute.z-10.rounded.bg-white span,
.absolute.z-10.rounded.bg-white button,
.absolute.z-10.w-max p,
.absolute.z-10.w-max a,
.absolute.z-10.w-max span,
.absolute.z-10.w-max button {
    color: #374151 !important;
}
.absolute.z-10.rounded.bg-white a:hover,
.absolute.z-10.w-max a:hover {
    color: #6366F1 !important;
}
.dark .absolute.z-10.rounded.bg-white p,
.dark .absolute.z-10.rounded.bg-white a,
.dark .absolute.z-10.rounded.bg-white span,
.dark .absolute.z-10.rounded.bg-white button,
.dark .absolute.z-10.w-max p,
.dark .absolute.z-10.w-max a,
.dark .absolute.z-10.w-max span,
.dark .absolute.z-10.w-max button,
.dark .absolute.z-10.rounded.dark\:bg-gray-900 p,
.dark .absolute.z-10.rounded.dark\:bg-gray-900 a {
    color: #D1D5DB !important;
}

/* Version label in dropdown */
.absolute.z-10 .text-xs {
    color: #6B7280 !important;
}
.dark .absolute.z-10 .text-xs {
    color: #9CA3AF !important;
}

/* ============================================================
   §12  NUCLEAR FIX — Sidebar flyout submenu text
   Maximum specificity to override anything
   ============================================================ */
html body div[ref="sidebar"] .sidebar-rounded.fixed nav p,
html body div[ref="sidebar"] .sidebar-rounded.fixed nav a p,
html body div[ref="sidebar"] .sidebar-rounded.fixed .px-4 a p,
html body div[ref="sidebar"] .sidebar-rounded.fixed p.text-gray-600,
html body div[ref="sidebar"] .sidebar-rounded.fixed p.font-medium,
html body div[ref="sidebar"] .sidebar-rounded.fixed p[class*="text-gray"] {
    color: #475569 !important;
}
html body div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor p,
html body div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor p.text-white {
    color: #FFFFFF !important;
}
html.dark body div[ref="sidebar"] .sidebar-rounded.fixed nav p,
html.dark body div[ref="sidebar"] .sidebar-rounded.fixed nav a p,
html.dark body div[ref="sidebar"] .sidebar-rounded.fixed .px-4 a p,
html.dark body div[ref="sidebar"] .sidebar-rounded.fixed p[class*="text-gray"] {
    color: #CBD5E1 !important;
}
html.dark body div[ref="sidebar"] .sidebar-rounded.fixed a.bg-brandColor p {
    color: #FFFFFF !important;
}

/* ============================================================
   §13  Sidebar flyout — z-[1000] panel text fix
   The actual flyout uses z-[1000], not z-[10003]
   ============================================================ */
.fixed.z-\[1000\] p,
.fixed.z-\[1000\] nav p,
.fixed.z-\[1000\] nav a p,
.fixed.z-\[1000\] .px-4 a p {
    color: #475569 !important;
}
.fixed.z-\[1000\] a.bg-brandColor p {
    color: #FFFFFF !important;
}
.dark .fixed.z-\[1000\] p,
.dark .fixed.z-\[1000\] nav p,
.dark .fixed.z-\[1000\] nav a p {
    color: #CBD5E1 !important;
}
.dark .fixed.z-\[1000\] a.bg-brandColor p {
    color: #FFFFFF !important;
}

/* ============================================================
   §14  MOBILE — Contacts/Products submenu text in drawer
   ============================================================ */
@media (max-width: 1024px) {
    /* Submenu links inside mobile drawer */
    .submenu-link,
    a.submenu-link,
    .submenu a,
    .fixed.z-\[10003\] .submenu-link,
    .fixed.z-\[10003\] .submenu a,
    .fixed.z-\[10003\] a.submenu-link {
        color: #475569 !important;
    }
    .dark .submenu-link,
    .dark a.submenu-link,
    .dark .submenu a,
    .dark .fixed.z-\[10003\] .submenu-link,
    .dark .fixed.z-\[10003\] a.submenu-link {
        color: #CBD5E1 !important;
    }
    /* Active submenu item */
    .submenu-link.text-brandColor,
    .submenu-link.font-medium.bg-gray-100,
    .fixed.z-\[10003\] .submenu-link.text-brandColor {
        color: #6366F1 !important;
        font-weight: 600 !important;
    }

    /* Also fix: collapsed sidebar sub-items showing below active parent */
    .sidebar-collapsed .px-4 .submenu,
    .sidebar-collapsed .px-4 a.submenu-link {
        color: #475569 !important;
    }
    .dark .sidebar-collapsed .px-4 a.submenu-link {
        color: #CBD5E1 !important;
    }
}

/* ============================================================
   §15  MOBILE CHAT — Full-screen on mobile devices
   ============================================================ */
@media (max-width: 768px) {
    .mac-ai-global-chat {
        width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        right: -100vw !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        max-height: 100vh !important;
    }
    .mac-ai-global-chat.open {
        right: 0 !important;
    }
    .mac-ai-global-chat-header {
        border-radius: 0 !important;
        padding: 12px 16px !important;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .mac-ai-global-chat-messages {
        height: calc(100vh - 130px) !important;
        max-height: none !important;
    }
    .mac-ai-global-chat-input {
        position: sticky;
        bottom: 0;
        padding: 10px 12px !important;
        border-radius: 0 !important;
        border-top: 1px solid rgba(0,0,0,0.1) !important;
        background: var(--mac-surface, #fff) !important;
    }
    .dark .mac-ai-global-chat-input {
        background: var(--mac-surface, #1A1930) !important;
        border-top-color: rgba(255,255,255,0.1) !important;
    }
    .mac-ai-gchat-suggestions {
        padding: 8px 12px !important;
        flex-wrap: wrap !important;
    }
    .mac-ai-gchat-chip {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
    }
    .mac-ai-global-fab {
        width: 52px !important;
        height: 52px !important;
        font-size: 1.4rem !important;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .mac-ai-global-chat {
        width: 420px !important;
        height: 85vh !important;
    }
}
/* ============================================================
   §16  SETTINGS DEEP PAGES — Enhanced styling for all
        settings sub-pages (users, roles, tags, sources,
        types, attributes, warehouses, email templates,
        web forms, webhooks, data transfer, marketing,
        billing, pipelines, groups)
   ============================================================ */

/* ── Header bar (shared across all settings pages) ── */
.flex.flex-col.gap-4 > .flex.items-center.justify-between.rounded-lg.border {
    border-radius: 16px !important;
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    padding: 16px 20px !important;
    transition: box-shadow 0.2s ease !important;
}
.dark .flex.flex-col.gap-4 > .flex.items-center.justify-between.rounded-lg.border {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #334155 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* ── Page titles in settings ── */
.flex.flex-col.gap-4 > .flex.items-center.justify-between .text-xl.font-bold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #1E293B !important;
}
.dark .flex.flex-col.gap-4 > .flex.items-center.justify-between .text-xl.font-bold {
    color: #F1F5F9 !important;
}

/* ── Primary action buttons (Create User, Create Role, etc.) ── */
.flex.flex-col.gap-4 .primary-button,
.flex.flex-col.gap-4 a.primary-button,
.flex.flex-col.gap-4 button.primary-button {
    border-radius: 10px !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
    padding: 8px 18px !important;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%) !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3) !important;
    transition: all 0.2s ease !important;
    color: #fff !important;
}
.flex.flex-col.gap-4 .primary-button:hover,
.flex.flex-col.gap-4 a.primary-button:hover,
.flex.flex-col.gap-4 button.primary-button:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
    transform: translateY(-1px) !important;
}

/* ── Breadcrumbs inside settings pages ── */
.flex.flex-col.gap-4 nav[aria-label="Breadcrumb"] a,
.flex.flex-col.gap-4 .breadcrumbs a,
.flex.flex-col.gap-4 a[class*="text-brandColor"]:not(.primary-button) {
    color: #6366F1 !important;
    font-weight: 500 !important;
    font-size: 0.78rem !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}
.flex.flex-col.gap-4 nav[aria-label="Breadcrumb"] span.text-gray-600,
.flex.flex-col.gap-4 .breadcrumbs span {
    color: #94A3B8 !important;
}
.dark .flex.flex-col.gap-4 nav[aria-label="Breadcrumb"] span.text-gray-600 {
    color: #64748B !important;
}

/* ── DataGrid container — the table wrapper ── */
.flex.flex-col.gap-4 > div:has(table),
.flex.flex-col.gap-4 .table-responsive,
.flex.flex-col.gap-4 > div[class*="rounded"][class*="border"][class*="bg-white"] {
    border-radius: 14px !important;
    overflow: hidden !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
.dark .flex.flex-col.gap-4 > div:has(table),
.dark .flex.flex-col.gap-4 > div[class*="rounded"][class*="border"][class*="bg-white"] {
    border-color: #334155 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* ── DataGrid table header ── */
.flex.flex-col.gap-4 table thead th,
table thead th {
    background: #f8fafc !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #64748B !important;
    padding: 10px 16px !important;
    border-bottom: 2px solid #E2E8F0 !important;
    white-space: nowrap !important;
}
.dark table thead th {
    background: #1E293B !important;
    color: #94A3B8 !important;
    border-bottom-color: #334155 !important;
}

/* ── DataGrid table rows ── */
table tbody tr {
    transition: background 0.1s ease !important;
}
table tbody tr:hover {
    background: #f8fafc !important;
}
.dark table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04) !important;
}
table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5) !important;
}
.dark table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.3) !important;
}

/* ── DataGrid table cells ── */
table tbody td {
    font-size: 0.8125rem !important;
    padding: 10px 16px !important;
    color: #334155 !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    border-bottom: 1px solid #F1F5F9 !important;
}
.dark table tbody td {
    color: #CBD5E1 !important;
    border-bottom-color: #1E293B !important;
}

/* ── Action icons in datagrid (view, edit, delete) ── */
table tbody td .icon-edit,
table tbody td .icon-delete,
table tbody td .icon-view,
table tbody td a span[class^="icon-"],
table tbody td button span[class^="icon-"] {
    font-size: 1.125rem !important;
    transition: all 0.15s ease !important;
    opacity: 0.6;
}
table tbody tr:hover td .icon-edit,
table tbody tr:hover td .icon-delete,
table tbody tr:hover td .icon-view,
table tbody tr:hover td a span[class^="icon-"],
table tbody tr:hover td button span[class^="icon-"] {
    opacity: 1;
}
table tbody td .icon-edit:hover,
table tbody td a span.icon-edit:hover {
    color: #6366F1 !important;
}
table tbody td .icon-delete:hover,
table tbody td button span.icon-delete:hover {
    color: #EF4444 !important;
}

/* ── Pagination (Per Page / X of Y) ── */
.flex.flex-col.gap-4 .flex.items-center.gap-x-2 select,
.items-center select[class*="rounded"] {
    border-radius: 8px !important;
    border-color: #e2e8f0 !important;
    font-size: 0.8125rem !important;
    padding: 4px 28px 4px 10px !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}
.flex.flex-col.gap-4 .flex.items-center.gap-x-2 p,
.pagination-info {
    font-size: 0.8125rem !important;
    color: #64748B !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
}

/* ── Filter button + bar ── */
.flex.flex-col.gap-4 button:has(.icon-filter),
button[class*="text-brandColor"]:has(.icon-filter) {
    color: #6366F1 !important;
    font-weight: 600 !important;
}

/* ── Settings main index — card grid enhancements ── */
/* The settings main page uses a different structure:
   grid > a with icon + title + description */
div.box-shadow.rounded.bg-white.p-4 a,
div[class*="box-shadow"][class*="grid-cols"] a {
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    padding: 10px !important;
}
div.box-shadow.rounded.bg-white.p-4 a:hover,
div[class*="box-shadow"][class*="grid-cols"] a:hover {
    background: #EEF2FF !important;
    transform: translateY(-1px) !important;
}
.dark div.box-shadow.rounded.bg-white.p-4 a:hover,
.dark div[class*="box-shadow"][class*="grid-cols"] a:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* Settings main index — icon containers */
div.box-shadow.rounded.bg-white.p-4 a .rounded-lg.bg-gray-100.p-3,
div[class*="box-shadow"][class*="grid-cols"] .rounded-lg.bg-gray-100 {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF) !important;
    border-radius: 12px !important;
}
.dark div.box-shadow.rounded.bg-white.p-4 a .rounded-lg.bg-gray-100.p-3,
.dark div[class*="box-shadow"][class*="grid-cols"] .rounded-lg.bg-gray-100 {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.1)) !important;
}

/* Settings main index — icons */
div.box-shadow a i[class^="icon-"] {
    color: #6366F1 !important;
    font-size: 1.75rem !important;
}
.dark div.box-shadow a i[class^="icon-"] {
    color: #A5B4FC !important;
}

/* Settings main index — card titles */
div.box-shadow a p.font-semibold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    font-size: 0.875rem !important;
}
.dark div.box-shadow a p.font-semibold {
    color: #F1F5F9 !important;
}

/* Settings main index — card descriptions */
div.box-shadow a p.text-xs {
    color: #64748B !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
}
.dark div.box-shadow a p.text-xs {
    color: #94A3B8 !important;
}

/* Settings main index — section titles */
div.grid.gap-y-8 > div > .grid.gap-1 > p.font-semibold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.9375rem !important;
    color: #1E293B !important;
    letter-spacing: -0.01em !important;
}
.dark div.grid.gap-y-8 > div > .grid.gap-1 > p.font-semibold {
    color: #E2E8F0 !important;
}

/* ── Create/Edit form pages (roles/create, users/edit, etc.) ── */
.flex.flex-col.gap-4 > .box-shadow,
.flex.flex-col.gap-4 > .rounded-lg.border.bg-white {
    border-radius: 16px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    overflow: hidden !important;
}
.dark .flex.flex-col.gap-4 > .box-shadow,
.dark .flex.flex-col.gap-4 > .rounded-lg.border.bg-white {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

/* ── Form section titles ── */
.flex.flex-col.gap-4 .p-4 .text-base.font-semibold,
.flex.flex-col.gap-4 .p-4 h3.font-semibold {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-weight: 700 !important;
    color: #1E293B !important;
}
.dark .flex.flex-col.gap-4 .p-4 .text-base.font-semibold,
.dark .flex.flex-col.gap-4 .p-4 h3.font-semibold {
    color: #E2E8F0 !important;
}

/* ── Form inputs — unified look across all settings ── */
.flex.flex-col.gap-4 input[type="text"],
.flex.flex-col.gap-4 input[type="email"],
.flex.flex-col.gap-4 input[type="number"],
.flex.flex-col.gap-4 input[type="password"],
.flex.flex-col.gap-4 input[type="url"],
.flex.flex-col.gap-4 input[type="tel"],
.flex.flex-col.gap-4 select,
.flex.flex-col.gap-4 textarea {
    border-radius: 10px !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 0.875rem !important;
    transition: all 0.15s ease !important;
}
.flex.flex-col.gap-4 input:focus,
.flex.flex-col.gap-4 select:focus,
.flex.flex-col.gap-4 textarea:focus {
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

/* ── Form labels ── */
.flex.flex-col.gap-4 label {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
}
.dark .flex.flex-col.gap-4 label {
    color: #94A3B8 !important;
}

/* ── Billing page specifics ── */
.billing-plan-card,
div[class*="rounded"][class*="border"][class*="p-6"]:has(h3) {
    border-radius: 16px !important;
    transition: all 0.2s ease !important;
}
div[class*="rounded"][class*="border"][class*="p-6"]:has(h3):hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1) !important;
}

/* ── Delete confirmation modal in settings ── */
div[class*="fixed"][class*="z-"] button.secondary-button {
    border-radius: 10px !important;
}

/* ── Empty state in data grids ── */
.flex.flex-col.gap-4 .flex.flex-col.items-center.justify-center {
    padding: 3rem 1rem !important;
}
.flex.flex-col.gap-4 .flex.flex-col.items-center.justify-center p {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    color: #64748B !important;
}



/* Fix: Lookup dropdown overflow - ensure dropdowns aren't clipped */
.mb-2\.5.w-full,
.flex.flex-col.gap-4,
.tab-panel,
[role="tabpanel"],
form,
form > div,
form > div > div {
    overflow: visible !important;
}
/* The lookup popup needs to escape all overflow containers */
.absolute.top-full {
    z-index: 9999 !important;
}


/* ═══════════════════════════════════════════════════════════════
   MAC AI CRM — Activity Enhancement CSS
   Matches Flutter mobile app design language
   ═══════════════════════════════════════════════════════════════ */

/* ── Backdrop ── */
.mac-act-backdrop {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(4px);
}

/* ── Modal Shell ── */
.mac-act-modal {
    position: fixed; z-index: 9999;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 540px; max-height: 92vh;
    background: #fff; border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.12);
    display: flex; flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
@media(min-width:768px){
    .mac-act-modal {
        top: 50%; bottom: auto; transform: translate(-50%,-50%);
        border-radius: 16px; max-height: 85vh;
    }
}

/* ── Header ── */
.mac-act-modal-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 14px; border-bottom: 1px solid #f1f5f9;
}
.mac-act-modal-hdr-left { display: flex; align-items: center; gap: 12px; }
.mac-act-hdr-icon {
    width: 42px; height: 42px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.mac-act-hdr-title { font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.mac-act-hdr-sub { font-size: .78rem; color: #64748b; margin-top: 1px; }
.mac-act-close {
    width: 34px; height: 34px; border-radius: 9px; border: none;
    background: #f1f5f9; color: #64748b; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: all .15s;
}
.mac-act-close:hover { background: #e2e8f0; color: #334155; }

/* Type backgrounds */
.mac-type-bg-call    { background: #fef3c7; }
.mac-type-bg-meeting { background: #dbeafe; }
.mac-type-bg-lunch   { background: #fce7f3; }
.mac-type-bg-note    { background: #d1fae5; }

/* ── Type Chips ── */
.mac-act-types {
    display: flex; gap: 7px; padding: 11px 22px; border-bottom: 1px solid #f1f5f9;
}
.mac-act-type-chip {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 9px 10px; border-radius: 9px; border: 2px solid #e2e8f0;
    background: #fff; color: #64748b; font-size: .8rem; font-weight: 600;
    cursor: pointer; transition: all .18s; white-space: nowrap;
}
.mac-act-type-chip:hover { border-color: #cbd5e1; }
.mac-act-type-chip.active.mac-type-call    { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.mac-act-type-chip.active.mac-type-meeting { border-color: #3b82f6; background: #eff6ff; color: #1e40af; }
.mac-act-type-chip.active.mac-type-lunch   { border-color: #ec4899; background: #fdf2f8; color: #9d174d; }
.mac-act-type-chip.active.mac-type-note    { border-color: #10b981; background: #ecfdf5; color: #065f46; }

/* ── Scrollable Form Body ── */
.mac-act-scroll {
    flex: 1; overflow-y: auto; padding: 18px 22px;
    display: flex; flex-direction: column; gap: 14px;
}

/* ── Fields ── */
.mac-fld { display: flex; flex-direction: column; gap: 5px; }
.mac-lbl { font-size: .75rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: .03em; }
.mac-lbl-sm { font-size: .72rem; font-weight: 500; color: #64748b; }
.mac-req::after { content: ' *'; color: #ef4444; }
.mac-err { font-size: .72rem; color: #ef4444; }

.mac-input-wrap {
    display: flex; align-items: center; border: 1.5px solid #e2e8f0;
    border-radius: 9px; background: #fff; transition: border-color .15s;
    overflow: hidden;
}
.mac-input-wrap:focus-within { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.mac-input-wrap.mac-input-err { border-color: #ef4444; }
.mac-input-pre { padding: 0 0 0 12px; font-size: .95rem; flex-shrink: 0; }

.mac-input {
    width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 9px; font-size: .86rem; color: #1e293b;
    background: #fff; transition: all .15s; font-family: inherit;
}
.mac-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.mac-input::placeholder { color: #94a3b8; }
.mac-input-wrap .mac-input { border: none; box-shadow: none; }
.mac-input-wrap .mac-input:focus { box-shadow: none; }

.mac-select {
    width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 9px; font-size: .86rem; color: #1e293b;
    background: #fff; cursor: pointer; font-family: inherit; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
.mac-select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.08); }

.mac-textarea {
    width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 9px; font-size: .86rem; color: #1e293b;
    background: #fff; font-family: inherit; resize: vertical; min-height: 60px;
}
.mac-textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.08); }

.mac-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mac-section-lbl { font-size: .75rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

.mac-card {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 11px;
    padding: 14px; display: flex; flex-direction: column; gap: 10px;
}

/* ── Duration Chips ── */
.mac-dur-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mac-dur-chip {
    padding: 6px 13px; border-radius: 18px; border: 1.5px solid #e2e8f0;
    background: #fff; font-size: .78rem; font-weight: 500; color: #64748b;
    cursor: pointer; transition: all .15s;
}
.mac-dur-chip:hover { background: #f8fafc; }
.mac-dur-chip.active { border-color: #6366f1; background: #eef2ff; color: #4338ca; font-weight: 600; }

/* ── Google Calendar Row ── */
.mac-gcal-row {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px;
    background: #f8fafc; border-radius: 9px; font-size: .8rem; color: #64748b;
}
.mac-gcal-badge {
    margin-left: auto; padding: 2px 7px; border-radius: 5px; font-size: .7rem; font-weight: 600;
}
.mac-gcal-badge.connected { background: #ecfdf5; color: #065f46; }
.mac-gcal-badge.disconnected { background: #fef2f2; color: #991b1b; }

/* ── Meeting Invites Section ── */
.mac-invite-section { border: 1px solid #e2e8f0; border-radius: 11px; overflow: hidden; }
.mac-invite-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 11px 14px; cursor: pointer; border: none; background: transparent;
    font-family: inherit; transition: background .15s;
}
.mac-invite-toggle:hover { background: #f8fafc; }
.mac-invite-toggle-left { display: flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: #475569; }
.mac-invite-toggle-text { }
.mac-invite-count {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; background: #6366f1; color: #fff;
    font-size: .65rem; font-weight: 700;
}
.mac-chevron { transition: transform .2s; font-size: .9rem; color: #94a3b8; }
.mac-chevron.open { transform: rotate(180deg); }

.mac-invite-body {
    padding: 12px 14px 14px; border-top: 1px solid #f1f5f9;
    display: flex; flex-direction: column; gap: 10px;
}

.mac-email-row {
    display: flex; align-items: center; gap: 6px; padding: 3px 3px 3px 10px;
    border: 1.5px solid #6366f1; border-radius: 9px; background: #fff;
}
.mac-email-input { border: none !important; padding: 7px !important; flex: 1; box-shadow: none !important; }
.mac-email-input:focus { box-shadow: none !important; }
.mac-add-btn {
    width: 30px; height: 30px; border-radius: 7px; border: none;
    background: #6366f1; color: #fff; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mac-add-btn:hover { background: #4f46e5; }
.mac-add-btn:disabled { opacity: .35; cursor: not-allowed; }

.mac-invitee-list { display: flex; flex-wrap: wrap; gap: 5px; }
.mac-invitee-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 7px 3px 3px; border-radius: 18px;
    background: #f1f5f9; border: 1px solid #e2e8f0;
}
.mac-invitee-av {
    width: 22px; height: 22px; border-radius: 50%; background: #6366f1; color: #fff;
    font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.mac-invitee-email { font-size: .76rem; color: #475569; }
.mac-invitee-rm {
    width: 16px; height: 16px; border-radius: 50%; border: none;
    background: #e2e8f0; color: #64748b; font-size: .8rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mac-invitee-rm:hover { background: #fecaca; color: #dc2626; }

/* ── Toggle Switch ── */
.mac-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mac-toggle-label { font-size: .8rem; font-weight: 600; color: #334155; }
.mac-toggle-hint { font-size: .7rem; color: #94a3b8; margin-top: 1px; }
.mac-toggle { position: relative; display: inline-block; width: 42px; height: 22px; }
.mac-toggle input { opacity: 0; width: 0; height: 0; }
.mac-toggle-track {
    position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px;
    cursor: pointer; transition: all .2s;
}
.mac-toggle-track::before {
    content: ''; position: absolute; left: 2px; top: 2px;
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.mac-toggle input:checked + .mac-toggle-track { background: #6366f1; }
.mac-toggle input:checked + .mac-toggle-track::before { transform: translateX(20px); }

/* ── Footer ── */
.mac-act-footer {
    display: flex; gap: 8px; padding: 14px 22px;
    border-top: 1px solid #f1f5f9; background: #fafbfc;
}
.mac-btn-cancel {
    flex: 1; padding: 11px; border: 1.5px solid #e2e8f0; border-radius: 9px;
    background: #fff; color: #64748b; font-size: .86rem; font-weight: 600;
    cursor: pointer; transition: all .15s; font-family: inherit;
}
.mac-btn-cancel:hover { background: #f8fafc; }
.mac-btn-save {
    flex: 2; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px; border: none; border-radius: 9px;
    background: #6366f1; color: #fff; font-size: .86rem; font-weight: 600;
    cursor: pointer; transition: all .15s; font-family: inherit;
}
.mac-btn-save:hover { background: #4f46e5; }
.mac-btn-save:disabled { opacity: .45; cursor: not-allowed; }

/* ── Create Button ── */
.mac-act-create-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 84px; height: 74px; border-radius: 12px; border: 2px solid transparent;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4338ca; font-size: .78rem; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.mac-act-create-btn:hover {
    border-color: #6366f1; background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.12);
}

/* ═══ Detail Panel ═══ */
.mac-detail-panel {
    position: fixed; z-index: 9999;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 460px; max-height: 80vh;
    background: #fff; border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.12);
    overflow-y: auto;
}
@media(min-width:768px){
    .mac-detail-panel {
        top: 50%; bottom: auto; transform: translate(-50%,-50%);
        border-radius: 16px; max-height: 85vh;
    }
}

.mac-detail-hdr {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 18px 14px; border-bottom: 1px solid #f1f5f9;
}
.mac-detail-icon {
    width: 38px; height: 38px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.mac-detail-hdr-text { flex: 1; min-width: 0; }
.mac-detail-title { font-size: .95rem; font-weight: 700; color: #1e293b; }
.mac-detail-badge {
    display: inline-block; padding: 1px 7px; border-radius: 5px;
    background: #f1f5f9; color: #6366f1; font-size: .68rem; font-weight: 600;
    text-transform: capitalize; margin-top: 3px;
}

.mac-detail-grid { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.mac-detail-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.mac-detail-row-icon { font-size: .9rem; flex-shrink: 0; width: 20px; text-align: center; }
.mac-detail-row-lbl { color: #94a3b8; min-width: 72px; font-size: .78rem; }
.mac-detail-row-val { color: #1e293b; font-weight: 500; }

.mac-detail-qa-label, .mac-detail-section-lbl {
    padding: 3px 18px; font-size: .68rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .05em;
}
.mac-detail-qa { display: flex; gap: 6px; padding: 6px 18px 14px; }
.mac-qa-btn {
    flex: 1; padding: 9px; border: 1.5px solid #e2e8f0; border-radius: 9px;
    background: #fff; color: #64748b; font-size: .8rem; font-weight: 500;
    cursor: pointer; transition: all .15s; text-align: center;
}
.mac-qa-btn:hover { background: #f8fafc; border-color: #cbd5e1; }

.mac-detail-section { padding: 8px 18px; }

/* ── Chips (Status/Priority) ── */
.mac-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.mac-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 5px 10px; border-radius: 18px; border: 1.5px solid #e2e8f0;
    background: #fff; font-size: .75rem; font-weight: 500; color: #64748b;
    cursor: pointer; transition: all .15s; white-space: nowrap;
}
.mac-chip:hover { background: #f8fafc; }

/* Status selected */
.mac-chip.selected.mac-st-pending     { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.mac-chip.selected.mac-st-in_progress { border-color: #3b82f6; background: #eff6ff; color: #1e40af; }
.mac-chip.selected.mac-st-waiting     { border-color: #8b5cf6; background: #f5f3ff; color: #5b21b6; }
.mac-chip.selected.mac-st-blocked     { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.mac-chip.selected.mac-st-completed   { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.mac-chip.selected.mac-st-cancelled   { border-color: #6b7280; background: #f9fafb; color: #374151; }

/* Priority selected */
.mac-chip.selected.mac-pri-none   { border-color: #94a3b8; background: #f8fafc; color: #475569; }
.mac-chip.selected.mac-pri-low    { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.mac-chip.selected.mac-pri-medium { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.mac-chip.selected.mac-pri-high   { border-color: #f97316; background: #fff7ed; color: #9a3412; }
.mac-chip.selected.mac-pri-urgent { border-color: #ef4444; background: #fef2f2; color: #991b1b; }

.mac-detail-footer {
    display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid #f1f5f9;
}
.mac-detail-edit, .mac-detail-delete {
    flex: 1; padding: 9px; border-radius: 9px; font-size: .82rem; font-weight: 500;
    cursor: pointer; transition: all .15s; text-align: center; font-family: inherit;
}
.mac-detail-edit { border: 1.5px solid #e2e8f0; background: #fff; color: #475569; }
.mac-detail-edit:hover { border-color: #6366f1; color: #6366f1; }
.mac-detail-delete { border: 1.5px solid #fecaca; background: #fff; color: #ef4444; }
.mac-detail-delete:hover { background: #fef2f2; border-color: #ef4444; }

/* ═══ Alerts Bell ═══ */
.mac-alerts-wrap { position: relative; }
.mac-bell {
    position: relative; width: 38px; height: 38px; border-radius: 9px;
    border: none; background: transparent; color: #64748b;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mac-bell:hover { background: #f1f5f9; }
.mac-bell-badge {
    position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px;
    padding: 0 3px; border-radius: 8px; background: #ef4444; color: #fff;
    font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.mac-bell-pulse {
    position: absolute; top: 1px; right: 1px; width: 7px; height: 7px;
    border-radius: 50%; background: #ef4444;
    animation: mac-pulse 2s infinite;
}
@keyframes mac-pulse { 0%,100%{ transform:scale(1); opacity:1 } 50%{ transform:scale(1.4); opacity:.5 } }

.mac-alerts-backdrop { position: fixed; inset: 0; z-index: 99; }
.mac-alerts-dropdown {
    position: absolute; top: 44px; right: 0; width: 340px; max-height: 400px;
    background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.1);
    border: 1px solid #e2e8f0; z-index: 100; overflow: hidden;
}
.mac-alerts-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
    font-size: .85rem;
}
.mac-alerts-hdr-count {
    padding: 1px 7px; border-radius: 8px; background: #f1f5f9;
    font-size: .72rem; font-weight: 600; color: #64748b;
}
.mac-alerts-list { overflow-y: auto; max-height: 320px; }
.mac-alert-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid #f8fafc;
    cursor: pointer; transition: background .12s;
}
.mac-alert-item:hover { background: #f8fafc; }
.mac-alert-item.overdue { background: #fef2f2; }
.mac-alert-item.overdue:hover { background: #fee2e2; }
.mac-alert-item.soon { background: #fffbeb; }
.mac-alert-emoji { font-size: 1rem; flex-shrink: 0; }
.mac-alert-body { flex: 1; min-width: 0; }
.mac-alert-title { font-size: .8rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mac-alert-meta { font-size: .7rem; color: #94a3b8; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.mac-overdue-pill { padding: 1px 5px; border-radius: 3px; background: #fecaca; color: #dc2626; font-weight: 600; font-size: .66rem; }
.mac-soon-pill { padding: 1px 5px; border-radius: 3px; background: #fef3c7; color: #92400e; font-weight: 600; font-size: .66rem; }
.mac-alerts-empty { padding: 28px 14px; text-align: center; color: #94a3b8; font-size: .8rem; }

/* ── Transitions ── */
.mac-modal-enter-active { transition: all .28s cubic-bezier(.16,1,.3,1); }
.mac-modal-leave-active { transition: all .18s ease; }
.mac-modal-enter-from { transform: translateX(-50%) translateY(30px); opacity: 0; }
.mac-modal-leave-to { transform: translateX(-50%) translateY(15px); opacity: 0; }
@media(min-width:768px){
    .mac-modal-enter-from { transform: translate(-50%,-46%); opacity: 0; }
    .mac-modal-leave-to { transform: translate(-50%,-48%); opacity: 0; }
}
.mac-dropdown-enter-active { transition: all .18s cubic-bezier(.16,1,.3,1); }
.mac-dropdown-leave-active { transition: all .12s ease; }
.mac-dropdown-enter-from { transform: translateY(-6px); opacity: 0; }
.mac-dropdown-leave-to { opacity: 0; }

/* ── Spinner ── */
.mac-spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: mac-spin .7s linear infinite;
}
@keyframes mac-spin { to { transform: rotate(360deg); } }

/* ── Overdue indicators in existing timeline ── */
.mac-timeline-overdue {
    border-left: 3px solid #ef4444 !important;
    background: rgba(254,242,242,.4) !important;
    position: relative;
}

/* ═══ Activity Item Hover (lead detail timeline) ═══ */
.act-item { transition: all .15s ease; }
.act-item:hover {
    background: rgba(99,102,241,.04);
    border-radius: 8px;
    transform: translateX(2px);
}
.act-item:active { transform: translateX(0); }

/* ═══ Activity Detail — Contact Card ═══ */
.mac-detail-contact {
    padding: 0 18px 8px;
}
.mac-detail-contact-hdr {
    font-size: .68rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.mac-detail-contact-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.mac-contact-av {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; font-size: .85rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mac-contact-info { flex: 1; min-width: 0; }
.mac-contact-name { font-size: .82rem; font-weight: 600; color: #1e293b; }
.mac-contact-detail { font-size: .75rem; color: #64748b; margin-top: 1px; }
.mac-contact-link {
    color: #6366f1; text-decoration: none; transition: color .15s;
}
.mac-contact-link:hover { color: #4f46e5; text-decoration: underline; }
.mac-contact-lead {
    font-size: .72rem; color: #94a3b8; margin-top: 5px; padding-left: 2px;
}

/* ═══ AI ANALYTICS STATS SPACING FIX ═══ */
.mac-ai-stats-grid {
    display: grid !important;
    gap: 16px !important;
    padding: 4px !important;
}
.mac-ai-stat {
    border-radius: 12px !important;
    padding: 16px 20px !important;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}
.mac-ai-stat:hover {
    border-color: rgba(99, 102, 241, 0.3) !important;
    background: rgba(99, 102, 241, 0.05) !important;
}

/* Fix: Allow product dropdown to overflow on lead forms */
#products div[class*="overflow"]:has(table),
#products .rounded-lg.border.bg-white:has(table),
.mc-edit-section#products div[class*="overflow"],
.mc-edit-section#products .rounded-lg,
[id="products"] .overflow-x-auto,
[id="products"] div[class*="overflow"] {
    overflow: visible !important;
}

/* Fix: Product lookup dropdown must not be clipped by any ancestor */
#products .relative,
#products td,
#products tr,
#products tbody,
#products table,
#products .overflow-x-auto,
#products > div,
#products div[style] {
    overflow: visible !important;
}
#products .absolute.z-50 {
    z-index: 9999 !important;
}

/* Fix: Create Lead form - product table alignment */
.mc-lead-form table {
    table-layout: auto;
    width: 100%;
    font-size: .82rem;
}
.mc-lead-form table th,
.mc-lead-form table td {
    padding: 8px 6px !important;
    white-space: nowrap;
}
.mc-lead-form table th:first-child,
.mc-lead-form table td:first-child {
    width: 40%;
    white-space: normal;
}
.mc-lead-form table th:last-child,
.mc-lead-form table td:last-child {
    width: 40px;
    text-align: center;
}

/* Fix: Lookup dropdown should not exceed form width */
.mc-lead-form .absolute.z-50 {
    z-index: 9999 !important;
    max-width: 300px;
}

/* Fix: Ensure form doesnt

/* Fix: Create Lead form - product table alignment */
.mc-lead-form table {
    table-layout: auto;
    width: 100%;
    font-size: .82rem;
}
.mc-lead-form table th,
.mc-lead-form table td {
    padding: 8px 6px !important;
    white-space: nowrap;
}
.mc-lead-form table th:first-child,
.mc-lead-form table td:first-child {
    width: 40%;
    white-space: normal;
}
.mc-lead-form table th:last-child,
.mc-lead-form table td:last-child {
    width: 40px;
    text-align: center;
}
.mc-lead-form .absolute.z-50 {
    z-index: 9999 !important;
    max-width: 300px;
}
.mc-lead-body {
    overflow-x: hidden;
    overflow-y: visible;
}
.mc-lead-section {
    overflow-x: hidden;
    overflow-y: visible;
}
#products {
    overflow: visible !important;
}
#products table,
#products td,
#products tr,
#products tbody,
#products .relative {
    overflow: visible !important;
}

/* Fix: Center the product table in the lead form */
.mc-lead-form .block.w-full {
    max-width: 100%;
}
.mc-lead-form table {
    margin: 0 auto;
}

/* Reduce product name column width so table fits better */
.mc-lead-form table th:nth-child(1),
.mc-lead-form table td:nth-child(1) {
    min-width: 180px;
    max-width: 220px;
}
.mc-lead-form table th:nth-child(2),
.mc-lead-form table td:nth-child(2),
.mc-lead-form table th:nth-child(3),
.mc-lead-form table td:nth-child(3),
.mc-lead-form table th:nth-child(4),
.mc-lead-form table td:nth-child(4) {
    width: 100px;
    text-align: center;
}
.mc-lead-form table th:nth-child(5),
.mc-lead-form table td:nth-child(5) {
    width: 50px;
    text-align: center;
}

/* Make the lead value bar match table width */
.mc-lead-value-bar {
    max-width: 100%;
}

/* Ensure the + Add More button aligns left */
.mc-lead-form .text-brandColor {
    margin-left: 0;
}
