/* ================================================================
   DEALTITAN — UNIFIED DESIGN SYSTEM
   Single source of truth for all theming (light + dark mode).
   Earthy, boutique wealth-management aesthetic.
   ================================================================ */

/* ================ TYPOGRAPHY ================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    color-scheme: dark;

    /* Brand Colors — Modern Fiduciary palette */
    --brand-green: #2C4234;           /* Deep Forest (anchor) */
    --brand-green-light: #3A4F41;     /* Forest light */
    --brand-green-dark: #1E2E24;      /* Forest dark */
    --brand-green-hover: #1E2E24;
    --brand-cta: #C9A656;             /* Gold (conversion pop) */

    /* Dark/Hero Colors */
    --hero-dark: #1E2518;
    --hero-overlay: rgba(15, 22, 16, 0.85);
    --charcoal: #1E2518;
    --slate-dark: #1A2114;

    /* Flat Colors */
    --gradient-green-primary: #2C4234;
    --gradient-green-hover: #1E2E24;
    --gradient-green-header: rgba(44, 66, 52, 0.12);
    --gradient-green-modal: #2C4234;
    --gradient-hero: #1E2518;

    /* Accent Colors — sage & gold */
    --purple-primary: #8A9A86;        /* Sage */
    --purple-hover: #6B7E67;
    --blue-primary: #A3B19B;          /* Muted Moss */
    --blue-hover: #8A9A86;

    /* Neutral Colors — dark-first warm scale */
    --gray-50: #1A2114;
    --gray-100: #232B1E;
    --gray-200: #2C3626;
    --gray-300: #3A4634;
    --gray-400: #8A9A86;
    --gray-500: #A3B19B;
    --gray-600: #C1CEBE;
    --gray-700: #DDD8C6;
    --gray-900: #F5F0E5;

    /* Shadows — deep dark */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-dark: 0 2px 8px rgba(0, 0, 0, 0.5);

    /* Border Radius — subtle rounding for boutique feel */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-full: 9999px;

    /* Semantic Surface Tokens — dark olive default */
    --surface-primary: #232B1E;
    --surface-secondary: #2C3626;
    --surface-tertiary: #343F2E;
    --surface-elevated: #3A4634;
    --text-primary: #F5F0E5;
    --text-secondary: #DDD8C6;
    --text-tertiary: #A39D88;
    --text-gold: #C9A656;
    --border-primary: #3A4634;
    --border-secondary: #4A5A42;
    --shell-dark: #1A2114;
    --shell-dark-soft: #232B1E;
    --shell-panel: rgba(35, 43, 30, 0.85);
    --shell-panel-strong: rgba(35, 43, 30, 0.95);
    --shell-panel-muted: rgba(35, 43, 30, 0.7);
    --shell-border: rgba(163, 177, 155, 0.14);
    --shell-glow: rgba(201, 166, 86, 0.12);
    --shell-shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
}

/* ================ BASE STYLES ================ */
body.site-body {
    min-height: 100vh;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 12% 10%, rgba(201, 166, 86, 0.06), transparent 24%),
        radial-gradient(circle at 88% 14%, rgba(44, 66, 52, 0.1), transparent 28%),
        linear-gradient(180deg, #1E2518 0%, #232B1E 42%, #2C3626 100%);
}

.site-app-shell {
    position: relative;
    display: flex;
    min-height: 100vh;
    width: 100%;
    isolation: isolate;
}

.site-main-shell {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.site-main-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, var(--shell-glow), transparent 30%);
    pointer-events: none;
}

.site-main-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 120px 120px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 85%);
    opacity: 0.08;
    pointer-events: none;
}

.site-main-scroll {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    overflow-y: auto;
}

.site-main-scroll-auth {
    background: transparent;
}

/* Dark-only theme — no light mode overrides needed */

.site-public-shell {
    position: relative;
    min-height: 100vh;
}

.site-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(10, 16, 12, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #F5F3E9;
}

.site-mobile-brand-mark {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.08);
    color: #C19A6B;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.site-mobile-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 1.25rem 1rem;
    background: rgba(10, 16, 12, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-mobile-nav a {
    white-space: nowrap;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(245, 243, 233, 0.82);
    background: rgba(255, 255, 255, 0.04);
}

.site-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, #2A3324 0%, #2E3829 50%, #323D2C 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    color: #F5F0E5;
    overflow: hidden;
}

.site-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.035' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.75;
    pointer-events: none;
}

.site-sidebar > * {
    position: relative;
    z-index: 1;
}

.site-sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
}

.site-sidebar-brand-mark {
    display: inline-flex;
    width: 2.875rem;
    height: 2.875rem;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #C19A6B;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.site-sidebar-kicker {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(201, 166, 86, 0.7);
    margin-bottom: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.site-sidebar-kicker::after {
    content: '';
    display: inline-block;
    width: 0.875rem;
    height: 0.875rem;
    background: rgba(201, 166, 86, 0.7);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.site-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    color: rgba(245, 240, 229, 0.72);
    font-size: 0.9375rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
}

/* Bullet point before each link */
.site-sidebar-link::before {
    content: '\2022';
    font-size: 1.1em;
    color: rgba(245, 240, 229, 0.3);
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.site-sidebar-link svg {
    display: none;
}

.site-sidebar-utility svg,
.site-sidebar-admin-link svg {
    color: rgba(201, 166, 86, 0.7);
    transition: color 0.15s ease;
}

.site-sidebar-link:hover,
.site-sidebar-utility:hover,
.site-sidebar-admin-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #F5F0E5;
}

.site-sidebar-link.active,
.site-sidebar-admin-link.active {
    background: rgba(201, 166, 86, 0.12);
    color: #F5F0E5;
    border-left: 3px solid #C9A656;
    padding-left: calc(0.75rem - 3px);
}

.site-sidebar-link.active::before {
    color: #C9A656;
}

.site-sidebar-link:hover svg,
.site-sidebar-link.active svg,
.site-sidebar-utility:hover svg,
.site-sidebar-admin-link:hover svg,
.site-sidebar-admin-link.active svg {
    color: #F5F0E5;
}

.site-sidebar-section {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(201, 166, 86, 0.65);
}

.site-sidebar-admin-panel {
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.35rem;
}

.site-sidebar-admin-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.875rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: rgba(245, 243, 233, 0.7);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.site-sidebar-utility {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    color: rgba(245, 243, 233, 0.72);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.site-sidebar-user-card {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.site-sidebar-user-avatar {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #6B7E67;
    color: #F5F0E5;
    font-weight: 700;
    font-size: 0.8125rem;
}

.site-sidebar-user-email {
    color: rgba(245, 243, 233, 0.58);
}

.site-sidebar-logout {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #F5F3E9;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-sidebar-logout:hover {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.18);
    transform: translateY(-1px);
}

.public-auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-auth-frame,
.auth-hero {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #0A100C 0%, #1E2E24 42%, #2C4234 72%, #1E2E24 100%);
}

.public-auth-frame::before,
.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.public-auth-frame::after,
.auth-hero::after {
    content: '';
    position: absolute;
    inset: -10% -15% auto auto;
    width: 70%;
    height: 140%;
    background:
        radial-gradient(ellipse at 30% 35%, rgba(193, 154, 107, 0.12), transparent 48%),
        radial-gradient(ellipse at 60% 60%, rgba(245, 243, 233, 0.08), transparent 52%);
    pointer-events: none;
}

.public-auth-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 2rem;
    align-items: center;
    min-height: 100%;
}

.public-auth-intro {
    color: #F5F3E9;
}

.public-auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(193, 154, 107, 0.82);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.public-auth-title {
    margin-top: 1rem;
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(2.4rem, 5vw, 4.1rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.public-auth-copy {
    margin-top: 1.25rem;
    max-width: 34rem;
    color: rgba(245, 243, 233, 0.72);
    font-size: 1.05rem;
    line-height: 1.8;
}

.public-auth-list {
    margin-top: 1.75rem;
    display: grid;
    gap: 0.85rem;
}

.public-auth-list-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-radius: 1.125rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.95rem 1rem;
    color: rgba(245, 243, 233, 0.84);
}

.public-auth-list-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(193, 154, 107, 0.18);
    color: #F5F3E9;
    flex-shrink: 0;
}

.public-auth-banner {
    border-radius: 1.25rem;
    border: 1px solid rgba(193, 154, 107, 0.22);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 1rem 1.125rem;
    color: rgba(245, 243, 233, 0.9);
}

.public-auth-card {
    border-radius: 1.75rem;
    border: 1px solid var(--shell-border);
    background: var(--shell-panel-strong);
    box-shadow: var(--shell-shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.public-auth-card-header {
    border-bottom: 1px solid var(--border-primary);
    padding: 1.5rem 2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.22));
}

.public-auth-card-body {
    padding: 2rem;
}

.public-auth-muted {
    color: var(--text-tertiary);
}

.public-auth-footer-link {
    color: var(--brand-green);
    font-weight: 600;
    transition: color 0.2s ease;
}

.public-auth-footer-link:hover {
    color: var(--brand-green-dark);
}

:is(.xce-page, .dealtitan-page) {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(201, 166, 86, 0.05), transparent 28%),
        linear-gradient(180deg, rgba(26, 33, 20, 0.42), transparent 16%);
    min-height: 100vh;
}

:is(.xce-page, .dealtitan-page) .mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Serif display font — Lora for headings */
:is(.xce-serif, .dealtitan-serif) {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
}

/* ================ HERO SECTIONS ================ */
.xce-hero {
    background: var(--hero-dark);
    background-size: cover;
    background-position: center;
    position: relative;
}

.xce-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
}

.xce-hero-content {
    position: relative;
    z-index: 1;
}

.xce-hero-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    letter-spacing: -0.01em;
}

.xce-hero-subtitle {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    line-height: 1.7;
}

/* ================ BUTTONS ================ */
:is(.xce-btn-hero, .dealtitan-btn-hero) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--brand-cta);
    color: #FFFFFF;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    border-radius: 9999px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(166, 124, 74, 0.18);
}

:is(.xce-btn-hero, .dealtitan-btn-hero):hover {
    background: #A67C4A;
    transform: translateY(-2px);
    box-shadow: var(--shadow-dark);
}

.xce-btn-outline-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: transparent;
    color: white;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid white;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.xce-btn-outline-white:hover {
    background: white;
    color: var(--hero-dark);
}

/* ================ SECTION HEADINGS ================ */
.xce-section-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-green);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.xce-section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    line-height: 1.7;
    max-width: 600px;
}

/* ================ PAGE HEADER ================ */
:is(.xce-page-header, .dealtitan-page-header) {
    position: relative;
    overflow: visible;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

:is(.xce-page-header, .dealtitan-page-header)::before {
    content: none;
}

:is(.xce-page-title, .dealtitan-page-title) {
    position: relative;
    z-index: 1;
    font-family: 'Playfair Display', 'Lora', Georgia, serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #F5F0E5;
}

:is(.xce-page-subtitle, .dealtitan-page-subtitle) {
    position: relative;
    z-index: 1;
    color: #C9A656;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* ================ PAGE SPACING ================ */
/* Standardized page-level spacing for consistent padding across all app pages */

:is(.xce-page-header, .dealtitan-page-header) {
    padding-top: 2rem;     /* py-8 equivalent */
    padding-bottom: 2rem;
    margin-bottom: 1.5rem; /* consistent gap between header and page body */
}

.dealtitan-page-container {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;   /* px-6 */
    padding-right: 1.5rem;
}

.dealtitan-page-body {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1.5rem 3rem;  /* py-8 px-6 pb-12 */
}

/* Mobile spacing: tighter padding on small screens */
@media (max-width: 640px) {
    :is(.xce-page-header, .dealtitan-page-header) {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        margin-bottom: 1rem;
    }

    .dealtitan-page-container,
    .dealtitan-page-body {
        padding-left: 1rem;    /* px-4 on mobile */
        padding-right: 1rem;
    }

    .dealtitan-page-body {
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }
}

/* ================ STAT CARDS ================ */
:is(.xce-stat-card, .dealtitan-stat-card) {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

:is(.xce-stat-card, .dealtitan-stat-card)::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

:is(.xce-stat-card, .dealtitan-stat-card):hover {
    transform: translateY(-4px);
}

:is(.xce-stat-card, .dealtitan-stat-card):hover::before {
    opacity: 1;
}

/* Primary Card — Deep Forest */
:is(.xce-stat-card-primary, .dealtitan-stat-card-primary) {
    background: var(--brand-green);
    color: white;
    box-shadow: var(--shadow-lg);
}

:is(.xce-stat-card-primary, .dealtitan-stat-card-primary)::before {
    background: var(--brand-green-hover);
}

:is(.xce-stat-card-primary, .dealtitan-stat-card-primary):hover {
    box-shadow: var(--shadow-xl);
}

/* Neutral Card — Warm Sand */
:is(.xce-stat-card-neutral, .dealtitan-stat-card-neutral) {
    background: var(--shell-panel-strong);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shell-shadow);
    backdrop-filter: blur(16px);
}

:is(.xce-stat-card-neutral, .dealtitan-stat-card-neutral)::before {
    background: rgba(44, 66, 52, 0.03);
}

:is(.xce-stat-card-neutral, .dealtitan-stat-card-neutral):hover {
    border-color: var(--brand-green);
    box-shadow: var(--shadow-md);
}

/* Dark Card */
:is(.xce-stat-card-dark, .dealtitan-stat-card-dark) {
    background: var(--charcoal);
    color: white;
    box-shadow: var(--shadow-dark);
}

:is(.xce-stat-card-dark, .dealtitan-stat-card-dark):hover {
    box-shadow: var(--shadow-xl);
}

/* Action Card — Sage */
:is(.xce-stat-card-purple, .dealtitan-stat-card-purple) {
    background: #3A4F41;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

:is(.xce-stat-card-purple, .dealtitan-stat-card-purple)::before {
    background: #2C4234;
}

:is(.xce-stat-card-purple, .dealtitan-stat-card-purple):hover {
    box-shadow: var(--shadow-md);
}

/* Info Card — Muted Moss */
:is(.xce-stat-card-blue, .dealtitan-stat-card-blue) {
    background: #5A7460;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

:is(.xce-stat-card-blue, .dealtitan-stat-card-blue)::before {
    background: #3A4F41;
}

:is(.xce-stat-card-blue, .dealtitan-stat-card-blue):hover {
    box-shadow: var(--shadow-md);
}

/* Stat Card Content */
:is(.xce-stat-number, .dealtitan-stat-number) {
    font-family: 'Playfair Display', 'Lora', Georgia, serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

:is(.xce-stat-label, .dealtitan-stat-label) {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-cta);
    margin-top: 0.375rem;
}

:is(.xce-stat-sublabel, .dealtitan-stat-sublabel) {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

:is(.xce-stat-icon-wrap, .dealtitan-stat-icon-wrap) {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

/* Compact stat card variant */
:is(.xce-stat-card-sm, .dealtitan-stat-card-sm) {
    padding: 0.75rem 1rem;
}

:is(.xce-stat-card-sm, .dealtitan-stat-card-sm) :is(.xce-stat-number, .dealtitan-stat-number) {
    font-size: 1.625rem;
    margin-bottom: 0;
}

:is(.xce-stat-card-sm, .dealtitan-stat-card-sm) :is(.xce-stat-label, .dealtitan-stat-label) {
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

:is(.xce-stat-card-sm, .dealtitan-stat-card-sm) :is(.xce-stat-icon-wrap, .dealtitan-stat-icon-wrap) {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
}

:is(.xce-stat-card-neutral, .dealtitan-stat-card-neutral) :is(.xce-stat-icon-wrap, .dealtitan-stat-icon-wrap) {
    background: #F0F4F1;
}

:is(.xce-stat-card-neutral, .dealtitan-stat-card-neutral) :is(.xce-stat-icon-wrap, .dealtitan-stat-icon-wrap) svg {
    color: var(--brand-green);
}

/* ================ FEATURE CARDS ================ */
.xce-feature-card {
    background: var(--surface-primary);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
}

.xce-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.xce-feature-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F0F4F1;
    border-radius: var(--radius-lg);
}

.xce-feature-icon svg {
    width: 2rem;
    height: 2rem;
    color: var(--brand-green);
}

.xce-feature-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.xce-feature-description {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* ================ TOOLBAR ================ */
.xce-toolbar,
.dealtitan-toolbar {
    background: var(--shell-panel-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shell-shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* ================ SEARCH & FILTERS ================ */
:is(.xce-search-box, .dealtitan-search-box) {
    position: relative;
}

:is(.xce-search-box, .dealtitan-search-box) input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

:is(.xce-search-box, .dealtitan-search-box) input:focus {
    outline: none;
    border-color: var(--brand-cta);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(201, 166, 86, 0.1);
}

:is(.xce-search-box, .dealtitan-search-box) input::placeholder {
    color: var(--gray-400);
}

:is(.xce-search-box, .dealtitan-search-box) :is(.xce-search-icon, .dealtitan-search-icon) {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    transition: color 0.2s ease;
}

:is(.xce-search-box, .dealtitan-search-box) input:focus + :is(.xce-search-icon, .dealtitan-search-icon),
:is(.xce-search-box, .dealtitan-search-box):focus-within :is(.xce-search-icon, .dealtitan-search-icon) {
    color: var(--brand-green);
}

:is(.xce-filter-select, .dealtitan-filter-select) {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23A39D88'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") right 0.5rem center/1.25rem no-repeat;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

:is(.xce-filter-select, .dealtitan-filter-select):focus {
    outline: none;
    border-color: var(--brand-cta);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(201, 166, 86, 0.1);
}

:is(.xce-filter-select, .dealtitan-filter-select):hover {
    border-color: var(--gray-400);
}

/* ================ BUTTONS ================ */
:is(.xce-btn-primary, .dealtitan-btn-primary) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    background: var(--brand-cta);
    color: #1A2114;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    border: none;
    box-shadow: none;
    cursor: pointer;
}

:is(.xce-btn-primary, .dealtitan-btn-primary):hover {
    background: #D4B060;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 166, 86, 0.25);
}

:is(.xce-btn-secondary, .dealtitan-btn-secondary) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    cursor: pointer;
}

:is(.xce-btn-secondary, .dealtitan-btn-secondary):hover {
    background: rgba(255, 255, 255, 0.14);
    color: #F5F0E5;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ================ TABLE ================ */
:is(.xce-table-container, .dealtitan-table-container) {
    background: var(--shell-panel-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shell-shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

:is(.xce-table, .dealtitan-table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

:is(.xce-table, .dealtitan-table) th {
    padding: 1rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(163, 177, 155, 0.75);
    background: rgba(26, 33, 20, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: left;
}

:is(.xce-table, .dealtitan-table) td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

:is(.xce-table, .dealtitan-table) tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
    cursor: pointer;
}

:is(.xce-table, .dealtitan-table) tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

:is(.xce-table, .dealtitan-table) tbody tr:last-child {
    border-bottom: none;
}

/* ================ AVATARS ================ */
:is(.xce-avatar, .dealtitan-avatar) {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

:is(.xce-avatar-square, .dealtitan-avatar-square) {
    border-radius: var(--radius-lg);
}

/* ================ BADGES ================ */
:is(.xce-badge, .dealtitan-badge) {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

:is(.xce-badge, .dealtitan-badge)::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Confidence Badges */
:is(.xce-badge-high, .dealtitan-badge-high) {
    background: #F0F4F1;
    color: #2C4234;
}
:is(.xce-badge-high, .dealtitan-badge-high)::before { background: #3A4F41; }

:is(.xce-badge-medium, .dealtitan-badge-medium) {
    background: #F5F3E9;
    color: #5C5850;
}
:is(.xce-badge-medium, .dealtitan-badge-medium)::before { background: #A39D88; }

:is(.xce-badge-low, .dealtitan-badge-low) {
    background: #EBE7D9;
    color: #3D3A35;
}
:is(.xce-badge-low, .dealtitan-badge-low)::before { background: #A39D88; }

/* Status Badges */
:is(.xce-badge-success, .dealtitan-badge-success) {
    background: #F0F4F1;
    color: #2C4234;
}
:is(.xce-badge-success, .dealtitan-badge-success)::before { background: #3A4F41; }

:is(.xce-badge-warning, .dealtitan-badge-warning) {
    background: #FBF6EF;
    color: #A67C4A;
}
:is(.xce-badge-warning, .dealtitan-badge-warning)::before { background: #C19A6B; }

:is(.xce-badge-error, .dealtitan-badge-error) {
    background: #FEF2F2;
    color: #991B1B;
}
:is(.xce-badge-error, .dealtitan-badge-error)::before { background: #DC2626; }

:is(.xce-badge-processing, .dealtitan-badge-processing) {
    background: #F0F4F1;
    color: #2C4234;
    animation: pulse-badge 2s ease-in-out infinite;
}
:is(.xce-badge-processing, .dealtitan-badge-processing)::before { background: #3A4F41; animation: pulse-dot 2s ease-in-out infinite; }

:is(.xce-badge-danger, .dealtitan-badge-danger) {
    background: #FEF2F2;
    color: #DC2626;
}
:is(.xce-badge-danger, .dealtitan-badge-danger)::before { background: #EF4444; }

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

tr.processing-row {
    background: #F0F4F1;
    border-left: 3px solid #2C4234;
}
tr.processing-row:hover {
    background: #E0E7E0;
}

:is(.xce-badge-info, .dealtitan-badge-info) {
    background: #F5F3E9;
    color: #3D3A35;
}
:is(.xce-badge-info, .dealtitan-badge-info)::before { background: #A39D88; }

:is(.xce-badge-purple, .dealtitan-badge-purple) {
    background: #F0F4F1;
    color: #3A4F41;
}
:is(.xce-badge-purple, .dealtitan-badge-purple)::before { background: #8A9A86; }

:is(.xce-badge-secondary, .dealtitan-badge-secondary) {
    background: var(--gray-100);
    color: var(--gray-600);
}

:is(.xce-badge-secondary, .dealtitan-badge-secondary)::before {
    background: var(--gray-400);
}

/* Stage Badges */
.xce-stage-pre-seed { background: #F5F3E9; color: #5C5850; }
.xce-stage-pre-seed::before { background: #A39D88; }

.xce-stage-seed { background: #F0F4F1; color: #2C4234; }
.xce-stage-seed::before { background: #3A4F41; }

.xce-stage-series-a { background: #EBE7D9; color: #3D3A35; }
.xce-stage-series-a::before { background: #7A7568; }

.xce-stage-series-b { background: #FBF6EF; color: #A67C4A; }
.xce-stage-series-b::before { background: #C19A6B; }

/* Simple Tag */
:is(.xce-tag, .dealtitan-tag) {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================ PAGINATION ================ */
:is(.xce-pagination, .dealtitan-pagination) {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    background: var(--surface-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

:is(.xce-pagination-info, .dealtitan-pagination-info) {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

:is(.xce-pagination-btn, .dealtitan-pagination-btn) {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    background: rgba(255, 255, 255, 0.76);
    transition: all 0.2s ease;
    cursor: pointer;
}

:is(.xce-pagination-btn, .dealtitan-pagination-btn):hover:not(:disabled) {
    border-color: var(--brand-green);
    color: var(--brand-green);
}

html:not(.dark) :is(.xce-pagination-btn, .dealtitan-pagination-btn):hover:not(:disabled) {
    background: #F0F4F1;
}

html.dark :is(.xce-pagination-btn, .dealtitan-pagination-btn):hover:not(:disabled) {
    background: rgba(44, 66, 52, 0.2);
}

:is(.xce-pagination-btn, .dealtitan-pagination-btn):disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================ CARDS ================ */
.xce-card,
.dealtitan-card {
    background: var(--shell-panel-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shell-shadow);
    border: 1px solid rgba(255, 255, 255, 0.48);
    transition: all 0.2s ease;
    backdrop-filter: blur(18px);
}

.xce-card:hover,
.dealtitan-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

:is(.xce-card-header, .dealtitan-card-header) {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

:is(.xce-card-body, .dealtitan-card-body) {
    padding: 1.5rem;
}

/* ================ EMPTY STATE ================ */
:is(.xce-empty-state, .dealtitan-empty-state) {
    padding: 4rem 2rem;
    text-align: center;
}

:is(.xce-empty-state-icon, .dealtitan-empty-state-icon) {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

:is(.xce-empty-state, .dealtitan-empty-state) h3 {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

:is(.xce-empty-state, .dealtitan-empty-state) p {
    font-size: 0.9375rem;
    color: var(--gray-600);
}

/* ================ MODAL ================ */
:is(.xce-modal-backdrop, .dealtitan-modal-backdrop) {
    background: rgba(15, 22, 16, 0.5);
    backdrop-filter: blur(4px);
}

:is(.xce-modal-enter, .dealtitan-modal-enter) {
    animation: xceModalFadeIn 0.2s ease-out;
}

@keyframes xceModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

:is(.xce-modal-header, .dealtitan-modal-header) {
    background: var(--brand-green);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.xce-modal-section {
    border-radius: var(--radius-md);
    background: var(--gray-50);
    padding: 1rem;
    margin-bottom: 1rem;
}

.xce-modal-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

/* ================ SKELETON LOADING ================ */
@keyframes xceShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

:is(.xce-skeleton, .dealtitan-skeleton) {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: xceShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ================ FORM INPUTS ================ */
:is(.xce-input, .dealtitan-input) {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-secondary);
    border-radius: 1rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

:is(.xce-input, .dealtitan-input):focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(44, 66, 52, 0.1);
}

:is(.xce-input, .dealtitan-input)::placeholder {
    color: var(--gray-400);
}

:is(.xce-label, .dealtitan-label) {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

/* ================ PLACEHOLDER ================ */
:is(.xce-placeholder, .dealtitan-placeholder) {
    color: var(--gray-400);
    font-size: 1rem;
    font-weight: 500;
}

/* ================ BREADCRUMB ================ */
.xce-breadcrumb {
    background: var(--surface-primary);
    border-bottom: 1px solid var(--border-primary);
}

.xce-breadcrumb nav {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.xce-breadcrumb a:hover {
    color: var(--brand-green);
}

/* ================ SIDEBAR LINK ACTIVE STATE ================ */
.xce-sidebar-link.active,
.xce-sidebar-link:hover {
    background: rgba(44, 66, 52, 0.08);
    color: var(--brand-green);
}

.xce-sidebar-link.active {
    border-left: 3px solid var(--brand-green);
}

/* ================ SCORE DISPLAYS ================ */
.xce-score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: #F0F4F1;
}

.xce-score-circle-value {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C4234;
}

/* Score bar */
.xce-score-bar {
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.xce-score-bar-fill {
    height: 100%;
    background: var(--brand-green);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ================ FILE UPLOAD ================ */
:is(.xce-upload-zone, .dealtitan-upload-zone) {
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(12px);
}

:is(.xce-upload-zone, .dealtitan-upload-zone):hover,
:is(.xce-upload-zone, .dealtitan-upload-zone).dragover {
    border-color: var(--brand-green);
    background: #F0F4F1;
}

:is(.xce-upload-icon, .dealtitan-upload-icon) {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
}

:is(.xce-upload-zone, .dealtitan-upload-zone):hover :is(.xce-upload-icon, .dealtitan-upload-icon),
:is(.xce-upload-zone, .dealtitan-upload-zone).dragover :is(.xce-upload-icon, .dealtitan-upload-icon) {
    background: #D8E2DB;
}

:is(.xce-upload-icon, .dealtitan-upload-icon) svg {
    width: 2rem;
    height: 2rem;
    color: var(--gray-400);
    transition: color 0.3s ease;
}

:is(.xce-upload-zone, .dealtitan-upload-zone):hover :is(.xce-upload-icon, .dealtitan-upload-icon) svg,
:is(.xce-upload-zone, .dealtitan-upload-zone).dragover :is(.xce-upload-icon, .dealtitan-upload-icon) svg {
    color: var(--brand-green);
}

/* ================ UTILITIES ================ */
.xce-text-brand {
    color: var(--brand-green);
}

.xce-bg-brand {
    background-color: var(--brand-green);
}

.xce-border-brand {
    border-color: var(--brand-green);
}

.xce-hover-brand:hover {
    color: var(--brand-green);
}

/* Animation utilities */
.xce-fade-in {
    animation: xceFadeIn 0.3s ease-out;
}

@keyframes xceFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.xce-slide-up {
    animation: xceSlideUp 0.3s ease-out;
}

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

/* ================ DARK MODE COMPONENT OVERRIDES ================ */
/* Badges — confidence */
html.dark :is(.xce-badge-high, .dealtitan-badge-high) {
    background: rgba(44, 66, 52, 0.35);
    color: #A3C9AE;
}
html.dark :is(.xce-badge-high, .dealtitan-badge-high)::before { background: #6BA882; }

html.dark :is(.xce-badge-medium, .dealtitan-badge-medium) {
    background: rgba(163, 157, 136, 0.15);
    color: #DDD8C6;
}
html.dark :is(.xce-badge-medium, .dealtitan-badge-medium)::before { background: #A39D88; }

html.dark :is(.xce-badge-low, .dealtitan-badge-low) {
    background: rgba(163, 157, 136, 0.1);
    color: #C1CEBE;
}
html.dark :is(.xce-badge-low, .dealtitan-badge-low)::before { background: #8A9A86; }

/* Badges — status */
html.dark :is(.xce-badge-success, .dealtitan-badge-success) {
    background: rgba(44, 66, 52, 0.35);
    color: #A3C9AE;
}
html.dark :is(.xce-badge-success, .dealtitan-badge-success)::before { background: #6BA882; }

html.dark :is(.xce-badge-warning, .dealtitan-badge-warning) {
    background: rgba(193, 154, 107, 0.15);
    color: #E5CCA3;
}
html.dark :is(.xce-badge-warning, .dealtitan-badge-warning)::before { background: #C19A6B; }

html.dark :is(.xce-badge-error, .dealtitan-badge-error) {
    background: rgba(220, 38, 38, 0.15);
    color: #FCA5A5;
}
html.dark :is(.xce-badge-error, .dealtitan-badge-error)::before { background: #EF4444; }

html.dark :is(.xce-badge-processing, .dealtitan-badge-processing) {
    background: rgba(44, 66, 52, 0.3);
    color: #A3C9AE;
}
html.dark :is(.xce-badge-processing, .dealtitan-badge-processing)::before { background: #6BA882; }

html.dark :is(.xce-badge-danger, .dealtitan-badge-danger) {
    background: rgba(220, 38, 38, 0.15);
    color: #FCA5A5;
}
html.dark :is(.xce-badge-danger, .dealtitan-badge-danger)::before { background: #EF4444; }

html.dark :is(.xce-badge-info, .dealtitan-badge-info) {
    background: rgba(163, 157, 136, 0.12);
    color: #C1CEBE;
}
html.dark :is(.xce-badge-info, .dealtitan-badge-info)::before { background: #8A9A86; }

html.dark :is(.xce-badge-purple, .dealtitan-badge-purple) {
    background: rgba(124, 58, 237, 0.15);
    color: #c4b5fd;
}
html.dark :is(.xce-badge-purple, .dealtitan-badge-purple)::before { background: #8b5cf6; }

/* Stage badges */
html.dark .xce-stage-pre-seed {
    background: rgba(163, 157, 136, 0.12);
    color: #C1CEBE;
}
html.dark .xce-stage-pre-seed::before { background: #8A9A86; }

html.dark .xce-stage-seed {
    background: rgba(44, 66, 52, 0.3);
    color: #A3C9AE;
}
html.dark .xce-stage-seed::before { background: #6BA882; }

html.dark .xce-stage-series-a {
    background: rgba(163, 157, 136, 0.1);
    color: #DDD8C6;
}
html.dark .xce-stage-series-a::before { background: #A39D88; }

html.dark .xce-stage-series-b {
    background: rgba(193, 154, 107, 0.15);
    color: #E5CCA3;
}
html.dark .xce-stage-series-b::before { background: #C19A6B; }

/* Processing row */
html.dark tr.processing-row {
    background: rgba(44, 66, 52, 0.2);
    border-left-color: #6BA882;
}
html.dark tr.processing-row:hover {
    background: rgba(44, 66, 52, 0.3);
}

/* Score circle */
html.dark .xce-score-circle {
    background: rgba(44, 66, 52, 0.35);
}
html.dark .xce-score-circle-value {
    color: #A3C9AE;
}

/* Upload zone */
html.dark :is(.xce-upload-zone, .dealtitan-upload-zone) {
    background: rgba(20, 31, 24, 0.6);
}
html.dark :is(.xce-upload-zone, .dealtitan-upload-zone):hover,
html.dark :is(.xce-upload-zone, .dealtitan-upload-zone).dragover {
    background: rgba(44, 66, 52, 0.3);
}
html.dark :is(.xce-upload-zone, .dealtitan-upload-zone):hover :is(.xce-upload-icon, .dealtitan-upload-icon),
html.dark :is(.xce-upload-zone, .dealtitan-upload-zone).dragover :is(.xce-upload-icon, .dealtitan-upload-icon) {
    background: rgba(44, 66, 52, 0.5);
}

/* Form inputs */
html.dark :is(.xce-input, .dealtitan-input) {
    background: rgba(20, 31, 24, 0.8);
    color: #DDD8C6;
}
html.dark :is(.xce-input, .dealtitan-input):focus {
    background: rgba(20, 31, 24, 0.95);
    box-shadow: 0 0 0 3px rgba(44, 66, 52, 0.25);
}
html.dark :is(.xce-label, .dealtitan-label) {
    color: #C1CEBE;
}

/* Pagination button background */
html.dark :is(.xce-pagination-btn, .dealtitan-pagination-btn) {
    background: rgba(20, 31, 24, 0.8);
    color: #C1CEBE;
}

/* Modal section */
html.dark .xce-modal-section {
    background: rgba(15, 22, 16, 0.6);
}
html.dark .xce-modal-section-title {
    color: #8A9A86;
}

/* Sidebar link */
html.dark .xce-sidebar-link.active,
html.dark .xce-sidebar-link:hover {
    background: rgba(44, 66, 52, 0.25);
}

/* ================ RESPONSIVE UTILITIES ================ */
@media (max-width: 768px) {
    .xce-stat-number {
        font-size: 2rem;
    }

    .xce-page-title {
        font-size: 1.5rem;
    }

    .xce-hero-title {
        font-size: 2rem;
    }

    .xce-section-title {
        font-size: 1.75rem;
    }
}

/* ================ ADMIN DASHBOARD ================ */
/* Stat card gradients - forest/sand palette */
.stat-gradient-1 { background: linear-gradient(135deg, #F0F4F1 0%, #D8E2DB 100%); }
.stat-gradient-2 { background: linear-gradient(135deg, #FAF8F5 0%, #F5F3E9 100%); }
.stat-gradient-3 { background: linear-gradient(135deg, #FAF8F5 0%, #EBE7D9 100%); }
.stat-gradient-4 { background: linear-gradient(135deg, #F5F3E9 0%, #EBE7D9 100%); }
.stat-gradient-5 { background: linear-gradient(135deg, #FBF6EF 0%, #F3E6D0 100%); }

/* Status badges - forest/sage palette */
.status-healthy { background: #F0F4F1; color: #2C4234; }
.status-degraded { background: #EBE7D9; color: #3D3A35; }
.status-unhealthy { background: #DDD8C6; color: #2D2D2D; }
.status-pending { background: #F5F3E9; color: #5C5850; }
.status-running { background: #F0F4F1; color: #2C4234; }
.status-complete { background: #F0F4F1; color: #2C4234; }
.status-error { background: #FEF2F2; color: #991B1B; }

/* Admin-specific table styles */
.admin-table th {
    background: #f9fafb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.admin-table tr:hover {
    background: #f9fafb;
}

/* Card hover effect */
.card-hover {
    transition: all 0.2s ease-in-out;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Admin dark mode */
html.dark .stat-gradient-1 { background: linear-gradient(135deg, rgba(44,66,52,0.35) 0%, rgba(44,66,52,0.2) 100%); }
html.dark .stat-gradient-2 { background: linear-gradient(135deg, rgba(20,31,24,0.7) 0%, rgba(15,22,16,0.8) 100%); }
html.dark .stat-gradient-3 { background: linear-gradient(135deg, rgba(20,31,24,0.7) 0%, rgba(26,42,31,0.8) 100%); }
html.dark .stat-gradient-4 { background: linear-gradient(135deg, rgba(26,42,31,0.7) 0%, rgba(44,66,52,0.25) 100%); }
html.dark .stat-gradient-5 { background: linear-gradient(135deg, rgba(193,154,107,0.12) 0%, rgba(166,124,74,0.15) 100%); }

html.dark .status-healthy { background: rgba(44,66,52,0.3); color: #A3C9AE; }
html.dark .status-degraded { background: rgba(193,154,107,0.15); color: #E5CCA3; }
html.dark .status-unhealthy { background: rgba(163,157,136,0.15); color: #C1CEBE; }
html.dark .status-pending { background: rgba(163,157,136,0.1); color: #A39D88; }
html.dark .status-running { background: rgba(44,66,52,0.3); color: #A3C9AE; }
html.dark .status-complete { background: rgba(44,66,52,0.3); color: #A3C9AE; }
html.dark .status-error { background: rgba(220,38,38,0.15); color: #FCA5A5; }

html.dark .admin-table th {
    background: rgba(15,22,16,0.6);
    color: #8A9A86;
}
html.dark .admin-table tr:hover {
    background: rgba(44,66,52,0.15);
}

/* ================ DEAL DETAIL PAGE ================ */
/* Dealum section dark overrides (extracted from deal_detail.html) */
html.dark #dealum-full-section .bg-blue-50 {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.12);
}
html.dark #dealum-full-section .bg-blue-50 .text-blue-600 { color: #93c5fd; }
html.dark #dealum-full-section .bg-blue-50 .text-blue-800 { color: #bfdbfe; }
html.dark #dealum-full-section .bg-amber-50 {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.12);
}
html.dark #dealum-full-section .bg-red-50 {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.12);
}
html.dark #dealum-full-section .bg-green-50,
html.dark #dealum-full-section .bg-brand-green\/10 {
    background: rgba(5, 150, 105, 0.08) !important;
}
/* Dealum section text colors */
html.dark #dealum-full-section .text-gray-900 { color: var(--text-primary); }
html.dark #dealum-full-section .text-gray-700 { color: var(--text-secondary); }
html.dark #dealum-full-section .text-gray-600 { color: var(--text-secondary); }
html.dark #dealum-full-section .text-gray-500 { color: var(--text-tertiary); }
html.dark #dealum-full-section .text-gray-400 { color: rgba(148, 163, 184, 0.6); }
/* Dealum table borders */
html.dark #dealum-full-section .divide-gray-200 > * + * { border-color: rgba(255,255,255,0.06); }
html.dark #dealum-full-section .border-gray-200 { border-color: rgba(255,255,255,0.06); }
html.dark #dealum-full-section thead.bg-gray-50 { background: rgba(255,255,255,0.03) !important; }
/* Dealum risk/highlight badge colors */
html.dark #dealum-full-section .text-amber-800 { color: #fcd34d; }
html.dark #dealum-full-section .text-amber-700 { color: #fbbf24; }
html.dark #dealum-full-section .text-amber-600 { color: #f59e0b; }
html.dark #dealum-full-section .text-red-800 { color: #fca5a5; }
html.dark #dealum-full-section .text-red-700 { color: #f87171; }
html.dark #dealum-full-section .text-green-700 { color: #6ee7b7; }
html.dark #dealum-full-section .text-blue-700 { color: #93c5fd; }
html.dark #dealum-full-section .text-purple-700 { color: #c4b5fd; }
html.dark #dealum-full-section .border-amber-100 { border-color: rgba(245,158,11,0.15); }
html.dark #dealum-full-section .border-red-100,
html.dark #dealum-full-section .border-red-200 { border-color: rgba(239,68,68,0.15); }
/* Re-sync button */
html.dark #resync-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
}
html.dark #resync-btn:hover {
    background: rgba(139, 92, 246, 0.18);
}
/* Outcome banner */
html.dark .deal-hero [class*="from-green-50"] {
    background: rgba(5, 150, 105, 0.1) !important;
    border-color: rgba(5, 150, 105, 0.2) !important;
}
html.dark .deal-hero [class*="from-red-50"] {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* ================================================================
   DARK MODE TAILWIND UTILITY OVERRIDES
   Remaps Tailwind CDN utility classes for html.dark.
   Keep !important — CDN Tailwind ships all utilities at high specificity.
   (Merged from former dark-mode-overrides.css)
   ================================================================ */

/* ================ BACKGROUNDS ================ */

/* bg-white (231 uses) */
html.dark .bg-white {
    background-color: var(--surface-primary) !important;
}

/* bg-gray-50 (125 uses) */
html.dark .bg-gray-50 {
    background-color: var(--surface-secondary) !important;
}
html.dark .bg-gray-50\/50 {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* bg-gray-100 (53 uses) */
html.dark .bg-gray-100 {
    background-color: var(--surface-tertiary) !important;
}

/* bg-gray-200 (22 uses) */
html.dark .bg-gray-200 {
    background-color: var(--surface-elevated) !important;
}

/* bg-gray-300 */
html.dark .bg-gray-300 {
    background-color: #2a2a2a !important;
}

/* bg-gray-500 */
html.dark .bg-gray-500 {
    background-color: #999999 !important;
}

/* bg-gray-600 */
html.dark .bg-gray-600 {
    background-color: #999999 !important;
}

/* bg-gray-900 */
html.dark .bg-gray-900 {
    background-color: #e0e0e0 !important;
}

/* ================ TEXT COLORS ================ */

/* text-gray-900 (391 uses) */
html.dark .text-gray-900 {
    color: var(--text-primary) !important;
}

/* text-gray-800 (20 uses) */
html.dark .text-gray-800 {
    color: var(--text-primary) !important;
}

/* text-gray-700 (192 uses) */
html.dark .text-gray-700 {
    color: var(--text-secondary) !important;
}

/* text-gray-600 (309 uses) */
html.dark .text-gray-600 {
    color: var(--text-tertiary) !important;
}

/* text-gray-500 (455 uses) — emails, secondary labels */
html.dark .text-gray-500 {
    color: var(--text-tertiary) !important;
}

/* text-gray-400 — icons, muted text */
html.dark .text-gray-400 {
    color: #d1d5db !important;
}

/* text-gray-300 */
html.dark .text-gray-300 {
    color: #9ca3af !important;
}

/* text-white — keep white in dark mode (already correct for colored backgrounds) */

/* ================ BORDERS ================ */

/* border-gray-50 */
html.dark .border-gray-50 {
    border-color: #1a1a1a !important;
}

/* border-gray-100 (106 uses) — sidebar dividers, card borders */
html.dark .border-gray-100 {
    border-color: var(--border-primary) !important;
}

/* border-gray-200 (48 uses) */
html.dark .border-gray-200 {
    border-color: var(--border-secondary) !important;
}

/* border-gray-300 */
html.dark .border-gray-300 {
    border-color: var(--border-secondary) !important;
}

/* border-gray-400 */
html.dark .border-gray-400 {
    border-color: #3a3a3a !important;
}

/* ================ DIVIDE COLORS ================ */
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--border-primary) !important;
}

html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--border-secondary) !important;
}

/* ================ RING / OUTLINE ================ */
html.dark .ring-gray-100 {
    --tw-ring-color: var(--border-primary) !important;
}

html.dark .ring-gray-200 {
    --tw-ring-color: var(--border-secondary) !important;
}

/* ================ GREEN ACCENTS (keep vibrant) ================ */

/* Green backgrounds — slightly adjust for dark contrast */
html.dark .bg-green-50 {
    background-color: rgba(44, 66, 52, 0.1) !important;
}
html.dark .bg-green-50\/50 {
    background-color: rgba(44, 66, 52, 0.06) !important;
}

html.dark .bg-green-100 {
    background-color: rgba(44, 66, 52, 0.15) !important;
}

html.dark .bg-green-500 {
    background-color: #3A4F41 !important;
}

/* Green text — bump brightness for dark backgrounds */
html.dark .text-green-600 {
    color: #A3B19B !important;
}

html.dark .text-green-700 {
    color: #8A9A86 !important;
}

html.dark .text-green-800 {
    color: #6B7E67 !important;
}

/* Green borders */
html.dark .border-green-100 {
    border-color: rgba(44, 66, 52, 0.2) !important;
}

html.dark .border-green-200 {
    border-color: rgba(44, 66, 52, 0.3) !important;
}

html.dark .border-green-500 {
    border-color: #3A4F41 !important;
}

/* ================ BRAND GREEN ON DARK BACKGROUNDS ================ */

/* --brand-green is #2C4234 (very dark) — invisible on dark surfaces.
   Lift to sage green so text/borders remain legible. */
html.dark .text-brand-green {
    color: #C8D4C2 !important;
}

/* --brand-green-dark is #1E2E24 (near-black) — equally invisible on dark surfaces. */
html.dark .text-brand-green-dark {
    color: #C8D4C2 !important;
}

html.dark .hover\:text-brand-green:hover {
    color: #dce5d8 !important;
}

html.dark .hover\:text-brand-green-dark:hover {
    color: #8A9A86 !important;
}

/* border-brand-green — use a translucent sage so it reads as a border, not void */
html.dark .border-brand-green {
    border-color: rgba(200, 212, 194, 0.6) !important;
}

/* hover:bg-brand-green fill — shift to lighter forest so it contrasts with white text */
html.dark .hover\:bg-brand-green:hover {
    background-color: #3A4F41 !important;
}

/* ================ HOVER STATE OVERRIDES ================ */

html.dark .hover\:bg-gray-50:hover {
    background-color: var(--surface-secondary) !important;
}

html.dark .hover\:bg-gray-100:hover {
    background-color: var(--surface-tertiary) !important;
}

html.dark .hover\:bg-green-50:hover {
    background-color: rgba(44, 66, 52, 0.1) !important;
}

html.dark .hover\:bg-green-50\/50:hover {
    background-color: rgba(44, 66, 52, 0.08) !important;
}

html.dark .hover\:bg-white:hover {
    background-color: var(--surface-elevated) !important;
}

html.dark .hover\:text-gray-600:hover {
    color: var(--text-primary) !important;
}

html.dark .hover\:text-gray-700:hover {
    color: var(--text-secondary) !important;
}

html.dark .hover\:text-gray-900:hover {
    color: var(--text-primary) !important;
}

html.dark .hover\:border-gray-300:hover {
    border-color: var(--border-secondary) !important;
}

/* ================ RED / DESTRUCTIVE ================ */
html.dark .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

html.dark .text-red-600 {
    color: #f87171 !important;
}

html.dark .text-red-700 {
    color: #ef4444 !important;
}

html.dark .border-red-200 {
    border-color: rgba(239, 68, 68, 0.25) !important;
}

html.dark .hover\:bg-red-50:hover {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

html.dark .hover\:border-red-200:hover {
    border-color: rgba(239, 68, 68, 0.35) !important;
}

html.dark .hover\:text-red-700:hover {
    color: #f87171 !important;
}

/* ================ YELLOW / WARNING ================ */
html.dark .bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

html.dark .text-yellow-600 {
    color: #fbbf24 !important;
}

html.dark .text-yellow-800 {
    color: #fbbf24 !important;
}

html.dark .border-yellow-200 {
    border-color: rgba(245, 158, 11, 0.25) !important;
}

/* ================ BLUE / INFO ================ */
html.dark .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

html.dark .text-blue-600 {
    color: #60a5fa !important;
}

html.dark .text-blue-700 {
    color: #3b82f6 !important;
}

html.dark .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.25) !important;
}

/* ================ PURPLE ================ */
html.dark .bg-purple-50 {
    background-color: rgba(124, 58, 237, 0.1) !important;
}

html.dark .text-purple-600 {
    color: #a78bfa !important;
}

html.dark .text-purple-700 {
    color: #8b5cf6 !important;
}

html.dark .border-purple-200 {
    border-color: rgba(124, 58, 237, 0.25) !important;
}

/* ================ AMBER (impersonation banner, etc.) ================ */
html.dark .bg-amber-500 {
    background-color: #d97706 !important;
}

/* ================ BRAND GREEN OPACITY VARIANTS ================ */
html.dark .bg-brand-green\/10 {
    background-color: rgba(44, 66, 52, 0.15) !important;
}

/* ================ SHADOW ADJUSTMENTS ================ */
html.dark .shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html.dark .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3) !important;
}

html.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3) !important;
}

html.dark .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3) !important;
}

/* ================ PLACEHOLDER TEXT ================ */
html.dark .placeholder-gray-400::placeholder {
    color: #999999 !important;
}

html.dark .placeholder-gray-500::placeholder {
    color: #bbbbbb !important;
}

/* ================================================================
   INLINE STYLE OVERRIDES

   Many templates have inline <style> blocks with hardcoded hex
   colors. These overrides catch those class names so the entire
   page goes dark, not just the sidebar and Tailwind utilities.
   ================================================================ */

/* ---- Page backgrounds ---- */
html.dark .xce-page,
html.dark .crm-page {
    background: var(--surface-secondary) !important;
}

/* ---- Page header ---- */
html.dark .xce-page-header,
html.dark .page-header {
    background: var(--gradient-green-header) !important;
    border-bottom-color: rgba(44, 66, 52, 0.15) !important;
}

html.dark .page-title {
    color: var(--text-primary) !important;
}

html.dark .page-subtitle {
    color: var(--text-tertiary) !important;
}

/* ---- Stat cards ---- */
html.dark .stat-card-neutral {
    background: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .stat-card-neutral .stat-icon-wrap {
    background: rgba(44, 66, 52, 0.12) !important;
}

/* ---- Toolbar ---- */
html.dark .toolbar-container {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

/* ---- Search & filter inputs ---- */
html.dark .search-box input {
    background: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

html.dark .search-box input:focus {
    background: var(--surface-primary) !important;
}

html.dark .search-box input::placeholder {
    color: var(--text-tertiary) !important;
}

html.dark .search-box .search-icon {
    color: var(--text-tertiary) !important;
}

html.dark .filter-select {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-secondary) !important;
}

html.dark .filter-select:focus {
    background-color: var(--surface-primary) !important;
}

html.dark .filter-select:hover {
    border-color: var(--border-secondary) !important;
}

/* ---- Table ---- */
html.dark .table-container {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

html.dark .crm-table th {
    color: var(--text-tertiary) !important;
    background: var(--surface-secondary) !important;
    border-bottom-color: var(--border-secondary) !important;
}

html.dark .crm-table td {
    color: var(--text-secondary) !important;
}

html.dark .crm-table tbody tr {
    border-bottom-color: var(--border-secondary) !important;
}

/* ---- Person / entity names ---- */
html.dark .person-name,
html.dark .company-name,
html.dark .entity-name {
    color: var(--text-primary) !important;
}

/* ---- Tags ---- */
html.dark .role-tag,
html.dark .industry-tag,
html.dark .meta-tag {
    background: var(--surface-tertiary) !important;
    color: var(--text-tertiary) !important;
}

/* ---- Pagination ---- */
html.dark .pagination-bar {
    background: var(--surface-secondary) !important;
    border-top-color: var(--border-primary) !important;
}

html.dark .pagination-info {
    color: var(--text-tertiary) !important;
}

html.dark .pagination-btn {
    background: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-secondary) !important;
}

html.dark .pagination-btn:hover:not(:disabled) {
    background: rgba(44, 66, 52, 0.1) !important;
}

/* ---- Empty state ---- */
html.dark .empty-state-icon {
    background: var(--surface-tertiary) !important;
}

html.dark .empty-state h3 {
    color: var(--text-primary) !important;
}

html.dark .empty-state p {
    color: var(--text-tertiary) !important;
}

/* ---- Modal ---- */
html.dark .modal-section {
    background: var(--surface-secondary) !important;
}

html.dark .modal-section-title {
    color: var(--text-tertiary) !important;
}

/* ---- View toggle (companies page) ---- */
html.dark .view-toggle {
    background: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .view-toggle-btn {
    color: var(--text-secondary) !important;
}

/* ---- Tab bar ---- */
html.dark .tab-bar {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

html.dark .tab-btn {
    color: var(--text-secondary) !important;
}

/* ---- Section cards ---- */
html.dark .section-card {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

html.dark .section-header {
    color: var(--text-primary) !important;
}

/* ---- Skeleton loaders ---- */
html.dark .skeleton {
    background: var(--surface-tertiary) !important;
    background-size: 200% 100% !important;
}

/* ---- Placeholder dashes ---- */
html.dark .placeholder-dash {
    color: var(--text-tertiary) !important;
}

/* ---- Quick chips (investor detail, etc.) ---- */
html.dark .quick-chip-purple,
html.dark .quick-chip-orange,
html.dark .quick-chip-green {
    border-color: var(--border-secondary) !important;
}

/* ---- Health messages ---- */
html.dark .health-message {
    background: var(--surface-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* ---- Intel tooltip ---- */
html.dark .intel-tooltip {
    background: var(--surface-elevated) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

/* ---- Investor rows ---- */
html.dark .investor-row:hover {
    background: rgba(44, 66, 52, 0.04) !important;
}

/* ================================================================
   VIEWABILITY ENHANCEMENTS

   Fine-tuned overrides for form controls, badges, toggles, and
   other interactive elements that need extra attention in dark mode.
   ================================================================ */

/* ---- Checkboxes & radio buttons ---- */
html.dark input[type="checkbox"],
html.dark input[type="radio"] {
    background-color: var(--surface-tertiary) !important;
    border-color: #3a3a3a !important;
    color-scheme: dark;
}

html.dark input[type="checkbox"]:checked,
html.dark input[type="radio"]:checked {
    background-color: #3A4F41 !important;
    border-color: #3A4F41 !important;
}

/* ---- View toggle (People / Companies switcher) ---- */
html.dark .view-toggle-btn:hover:not(.active) {
    color: var(--text-primary) !important;
    background: var(--surface-tertiary) !important;
}

html.dark .view-toggle-btn.active {
    background: var(--surface-elevated) !important;
    color: #3A4F41 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* ---- Tab buttons ---- */
html.dark .tab-btn:hover:not(.active) {
    color: var(--text-primary) !important;
}

html.dark .tab-btn.active {
    color: #3A4F41 !important;
    background: var(--surface-primary) !important;
}

html.dark .tab-badge {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ---- Stat card neutral — improve number/label contrast ---- */
html.dark .stat-card-neutral .stat-number {
    color: var(--text-primary) !important;
}

html.dark .stat-card-neutral .stat-label {
    color: var(--text-secondary) !important;
    opacity: 1 !important;
}

/* ---- Action pills (Review Duplicates, Deal Pipeline, etc.) ---- */
html.dark .action-pill-purple {
    background: var(--surface-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .action-pill-purple:hover {
    background: var(--surface-elevated) !important;
    border-color: #3a3a3a !important;
}

html.dark .action-pill-green {
    background: rgba(44, 66, 52, 0.1) !important;
    color: #A3B19B !important;
    border-color: rgba(44, 66, 52, 0.25) !important;
}

html.dark .action-pill-green:hover {
    background: rgba(44, 66, 52, 0.15) !important;
    border-color: rgba(44, 66, 52, 0.35) !important;
}

/* ---- Entity / person meta text (emails, secondary info) ---- */
html.dark .entity-meta,
html.dark .person-meta {
    color: var(--text-tertiary) !important;
}

html.dark .entity-meta .meta-tag {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ---- Table row hover (CRM inline styles) ---- */
html.dark .crm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ---- Confidence & stage badges — subtle dark backgrounds ---- */
html.dark .confidence-high {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #A3B19B !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.dark .confidence-medium {
    background: rgba(202, 138, 4, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(202, 138, 4, 0.3) !important;
}

html.dark .confidence-low {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
}

html.dark .stage-pre_seed {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .stage-seed {
    background: rgba(202, 138, 4, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(202, 138, 4, 0.3) !important;
}

html.dark .stage-series_a {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #A3B19B !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.dark .stage-series_b {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #A3B19B !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

html.dark .stage-series_c_plus {
    background: rgba(4, 120, 87, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(4, 120, 87, 0.3) !important;
}

/* ---- Status badges ---- */
html.dark .status-review {
    background: rgba(185, 28, 28, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(185, 28, 28, 0.3) !important;
}

html.dark .status-healthcare {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #A3B19B !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.dark .review-badge {
    background: rgba(180, 83, 9, 0.2) !important;
    color: #fbbf24 !important;
}

/* ---- Submission badge ---- */
html.dark .submission-badge-single {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ---- Repeat submitters badge (inline Tailwind on people page) ---- */
html.dark .bg-white.border.border-gray-200 {
    background-color: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
}

/* ---- Select / dropdown styling ---- */
html.dark select {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

/* ---- Generic input/textarea ---- */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
html.dark textarea {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

html.dark input:focus:not([type="checkbox"]):not([type="radio"]),
html.dark textarea:focus,
html.dark select:focus {
    background-color: var(--surface-primary) !important;
}

/* ---- Links in table cells ---- */
html.dark .crm-table a {
    color: #A3B19B !important;
}

html.dark .crm-table a:hover {
    color: #8A9A86 !important;
}

/* ---- Stat card action/alert (dark gray cards) — brighten in dark mode ---- */
html.dark .stat-card-action {
    background: #111111 !important;
    box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.4) !important;
}

html.dark .stat-card-alert {
    background: #111111 !important;
}

html.dark .stat-card-alert:hover {
    background: #1a1a1a !important;
}

/* ================ SCROLLBAR STYLING ================ */
html.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html.dark ::-webkit-scrollbar-track {
    background: var(--surface-primary);
}

html.dark ::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 0px;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* ================================================================
   DEALS PAGE — DARK MODE OVERRIDES

   Covers stage badges, priority badges, source badges, action
   buttons, deck/report indicators, analysis badges, fit scores,
   company avatars, and modals rendered by deals.css / deals.js.
   ================================================================ */

/* ---- Stage badges ---- */
html.dark .stage-sourced {
    background: rgba(156, 163, 175, 0.12);
    color: #cccccc;
    border-color: rgba(156, 163, 175, 0.25);
}
html.dark .stage-sourced::before { background: #999999; }

html.dark .stage-deck_analyzing {
    background: rgba(148, 163, 184, 0.12);
    color: #f0f0f0;
    border-color: rgba(148, 163, 184, 0.25);
}
html.dark .stage-deck_analyzing::before { background: #cccccc; }

html.dark .stage-deck_reviewed {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
    border-color: rgba(5, 150, 105, 0.3);
}
html.dark .stage-deck_reviewed::before { background: #10b981; }

html.dark .stage-questionnaire_sent {
    background: rgba(202, 138, 4, 0.15);
    color: #fbbf24;
    border-color: rgba(202, 138, 4, 0.3);
}
html.dark .stage-questionnaire_sent::before { background: #d97706; }

html.dark .stage-questionnaire_received {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}
html.dark .stage-questionnaire_received::before { background: #f59e0b; }

html.dark .stage-qa_analyzed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
html.dark .stage-qa_analyzed::before { background: #10b981; }

html.dark .stage-followup_sent {
    background: rgba(202, 138, 4, 0.15);
    color: #fbbf24;
    border-color: rgba(202, 138, 4, 0.3);
}
html.dark .stage-followup_sent::before { background: #ca8a04; }

html.dark .stage-followup_received {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}
html.dark .stage-followup_received::before { background: #d97706; }

html.dark .stage-partner_review {
    background: rgba(148, 163, 184, 0.12);
    color: #f0f0f0;
    border-color: rgba(148, 163, 184, 0.25);
}
html.dark .stage-partner_review::before { background: #cccccc; }

html.dark .stage-term_sheet {
    background: rgba(4, 120, 87, 0.15);
    color: #34d399;
    border-color: rgba(4, 120, 87, 0.3);
}
html.dark .stage-term_sheet::before { background: #059669; }

html.dark .stage-passed {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}
html.dark .stage-passed::before { background: #ef4444; }

html.dark .stage-invested {
    background: #3A4F41;
    color: white;
}

/* ---- Priority badges ---- */
html.dark .priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

html.dark .priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

html.dark .priority-low {
    background: rgba(148, 163, 184, 0.1);
    color: #cccccc;
    border-color: rgba(148, 163, 184, 0.2);
}

/* ---- Source badges (DEALUM, New, Days) ---- */
html.dark .source-badge-dealum {
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-secondary);
}

html.dark .source-badge-new {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
    border-color: rgba(5, 150, 105, 0.3);
}

html.dark .source-badge-days {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* ---- Industry tag ---- */
html.dark .industry-tag {
    background: var(--surface-tertiary);
    color: var(--text-tertiary);
}

/* ---- Deck / Report indicators ---- */
html.dark .deck-indicator.deck-yes {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
}

html.dark .deck-indicator.deck-no {
    background: rgba(148, 163, 184, 0.08);
    color: #3a3a3a;
}

/* ---- Analysis badges ---- */
html.dark .analysis-complete {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
    border-color: rgba(5, 150, 105, 0.3);
}

html.dark .analysis-complete:hover {
    background: rgba(5, 150, 105, 0.22);
}

html.dark .analysis-pending {
    background: rgba(148, 163, 184, 0.1);
    color: #cccccc;
    border-color: rgba(148, 163, 184, 0.2);
}

html.dark .analysis-error {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}

html.dark .analysis-progress {
    background: rgba(148, 163, 184, 0.1);
    color: #f0f0f0;
    border-color: rgba(148, 163, 184, 0.2);
}

/* ---- Fit score badges ---- */
html.dark .fit-high {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
    border-color: rgba(5, 150, 105, 0.3);
}

html.dark .fit-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

html.dark .fit-low {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}

/* ---- Action buttons ---- */
html.dark .action-btn-report {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
    border-color: rgba(5, 150, 105, 0.3);
}
html.dark .action-btn-report:hover {
    background: rgba(5, 150, 105, 0.25);
}

html.dark .action-btn-analyze {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border-color: rgba(124, 58, 237, 0.3);
}
html.dark .action-btn-analyze:hover {
    background: rgba(124, 58, 237, 0.25);
}

html.dark .action-btn-primary {
    /* Keep green button vibrant — just darken slightly */
    background: #3A4F41;
    color: white;
}
html.dark .action-btn-primary:hover {
    background: #028a30;
}

html.dark .action-btn-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}
html.dark .action-btn-danger:hover {
    background: rgba(220, 38, 38, 0.2);
}

html.dark .action-btn-success {
    background: rgba(5, 150, 105, 0.15);
    color: #A3B19B;
    border-color: rgba(5, 150, 105, 0.3);
}
html.dark .action-btn-success:hover {
    background: rgba(5, 150, 105, 0.25);
}

/* ---- Company avatar — darken light backgrounds ---- */
html.dark .company-avatar {
    filter: brightness(0.7) saturate(1.2);
}

/* ---- User name in assigned column ---- */
html.dark .user-name {
    color: var(--text-secondary);
}

/* ---- Deals table specifics ---- */
html.dark .deals-table th {
    color: var(--text-tertiary);
    background: var(--surface-secondary);
    border-bottom-color: var(--border-secondary);
}

html.dark .deals-table td {
    color: var(--text-secondary);
}

html.dark .deals-table tbody tr {
    border-bottom-color: var(--border-primary);
}

html.dark .deals-table tbody tr:hover {
    background: rgba(44, 66, 52, 0.04);
}

html.dark .sortable-header:hover {
    color: var(--text-primary);
}

html.dark .sortable-header.sort-active {
    color: #A3B19B;
}

/* ---- Row actions — increase idle opacity for visibility ---- */
html.dark .row-actions {
    opacity: 0.7;
}

/* ---- Quick chips ---- */
html.dark .quick-chip-purple {
    background: var(--surface-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}
html.dark .quick-chip-purple:hover {
    background: var(--surface-elevated);
    border-color: #3a3a3a;
}

html.dark .quick-chip-orange {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.25);
}
html.dark .quick-chip-orange:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.35);
}

html.dark .quick-chip-green {
    background: rgba(44, 66, 52, 0.1);
    color: #A3B19B;
    border-color: rgba(44, 66, 52, 0.25);
}
html.dark .quick-chip-green:hover {
    background: rgba(44, 66, 52, 0.15);
    border-color: rgba(44, 66, 52, 0.35);
}

/* ---- Modals ---- */
html.dark .modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

html.dark .modal-enter {
    background: var(--surface-primary) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---- Toggle switch — improve inactive state visibility ---- */
html.dark .toggle-switch:not(.active) {
    background: #2a2a2a;
}

/* ---- Stat card neutral ---- */
html.dark .stat-card.stat-card-neutral {
    background: var(--surface-primary);
    border-color: var(--border-secondary);
}

/* ---- Bulk action bar — already dark, just tweak ---- */
html.dark #bulk-action-bar {
    background: var(--surface-elevated) !important;
    border: 1px solid var(--border-secondary);
}

/* ================================================================
   XCE STAT CARDS — DARK MODE REDESIGN

   Core philosophy: dark-mode cards should use dark backgrounds with
   a *hint* of their colour identity, not the same bright gradients
   from light mode. Each coloured card goes to a very dark version of
   its hue, with a coloured border and coloured ambient glow so the
   hue is still clear without the "light mode pasted on dark" look.

   Neutral card gets a slightly elevated dark surface with a subtle
   green accent border so it looks intentional, not broken.
   ================================================================ */

/* ---- Neutral card ("Awaiting Response") ---- */
html.dark .xce-stat-card-neutral {
    background: #050505 !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 4px 20px -4px rgba(0, 0, 0, 0.6) !important;
}

html.dark .xce-stat-card-neutral:hover {
    border-color: rgba(44, 66, 52, 0.3) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 8px 28px -6px rgba(0, 0, 0, 0.6),
        0 0 18px -6px rgba(44, 66, 52, 0.2) !important;
}

/* Fix the hardcoded light-green icon wrap */
html.dark .xce-stat-card-neutral .xce-stat-icon-wrap {
    background: rgba(44, 66, 52, 0.14) !important;
    border: 1px solid rgba(44, 66, 52, 0.18) !important;
}

html.dark .xce-stat-card-neutral .xce-stat-icon-wrap svg {
    color: #A3B19B !important;
}

html.dark .xce-stat-card-neutral .xce-stat-number {
    color: #e0e0e0 !important;
}

html.dark .xce-stat-card-neutral .xce-stat-label {
    color: #cccccc !important;
    opacity: 1 !important;
}

/* ---- Primary green card — dark forest green ---- */
html.dark .xce-stat-card-primary {
    background: #032b12 !important;
    border: 1px solid rgba(4, 200, 70, 0.3) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 4px 24px -6px rgba(44, 66, 52, 0.5),
        0 2px 10px -4px rgba(0, 0, 0, 0.55) !important;
}

html.dark .xce-stat-card-primary:hover {
    background: #022309 !important;
    border-color: rgba(4, 200, 70, 0.45) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 8px 36px -6px rgba(44, 66, 52, 0.65),
        0 4px 12px -4px rgba(0, 0, 0, 0.6) !important;
}

/* ---- Blue card — dark navy ---- */
html.dark .xce-stat-card-blue {
    background: #0a1628 !important;
    border: 1px solid rgba(96, 165, 250, 0.28) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 4px 24px -6px rgba(37, 99, 235, 0.5),
        0 2px 10px -4px rgba(0, 0, 0, 0.55) !important;
}

html.dark .xce-stat-card-blue:hover {
    background: #080f1e !important;
    border-color: rgba(96, 165, 250, 0.42) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 8px 36px -6px rgba(37, 99, 235, 0.65),
        0 4px 12px -4px rgba(0, 0, 0, 0.6) !important;
}

/* ---- Purple card — dark indigo ---- */
html.dark .xce-stat-card-purple {
    background: #130929 !important;
    border: 1px solid rgba(167, 139, 250, 0.28) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 4px 24px -6px rgba(109, 40, 217, 0.5),
        0 2px 10px -4px rgba(0, 0, 0, 0.55) !important;
}

html.dark .xce-stat-card-purple:hover {
    background: #0e0620 !important;
    border-color: rgba(167, 139, 250, 0.42) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 8px 36px -6px rgba(109, 40, 217, 0.65),
        0 4px 12px -4px rgba(0, 0, 0, 0.6) !important;
}

/* ================================================================
   VIOLET — Personality assessment, AI-driven features
   ================================================================ */
html.dark .bg-violet-50 {
    background-color: rgba(139, 92, 246, 0.1) !important;
}
html.dark .bg-violet-50\/30 {
    background-color: rgba(139, 92, 246, 0.06) !important;
}
html.dark .bg-violet-100 {
    background-color: rgba(139, 92, 246, 0.15) !important;
}
html.dark .bg-violet-600 {
    background-color: #7c3aed !important;
}
html.dark .text-violet-500 {
    color: #a78bfa !important;
}
html.dark .text-violet-600 {
    color: #a78bfa !important;
}
html.dark .text-violet-700 {
    color: #8b5cf6 !important;
}
html.dark .text-violet-800 {
    color: #a78bfa !important;
}
html.dark .border-violet-200 {
    border-color: rgba(139, 92, 246, 0.25) !important;
}
html.dark .border-violet-300 {
    border-color: rgba(139, 92, 246, 0.35) !important;
}
html.dark .border-violet-400 {
    border-color: rgba(139, 92, 246, 0.45) !important;
}
html.dark .border-violet-600 {
    border-color: #8b5cf6 !important;
}
html.dark .hover\:border-violet-300:hover {
    border-color: rgba(139, 92, 246, 0.4) !important;
}
html.dark .hover\:border-violet-400:hover {
    border-color: rgba(139, 92, 246, 0.55) !important;
}
html.dark .hover\:text-violet-700:hover {
    color: #a78bfa !important;
}
html.dark .hover\:bg-violet-100:hover {
    background-color: rgba(139, 92, 246, 0.18) !important;
}
html.dark .hover\:bg-violet-700:hover {
    background-color: #6d28d9 !important;
}
html.dark .focus\:ring-violet-500:focus {
    --tw-ring-color: #8b5cf6 !important;
}

/* ================ EMERALD ================ */
html.dark .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}
html.dark .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.15) !important;
}
html.dark .text-emerald-500 {
    color: #34d399 !important;
}
html.dark .text-emerald-600 {
    color: #34d399 !important;
}
html.dark .text-emerald-700 {
    color: #10b981 !important;
}
html.dark .border-emerald-200 {
    border-color: rgba(16, 185, 129, 0.25) !important;
}
html.dark .hover\:bg-emerald-100:hover {
    background-color: rgba(16, 185, 129, 0.18) !important;
}
html.dark .hover\:border-emerald-400:hover {
    border-color: rgba(16, 185, 129, 0.5) !important;
}

/* ================ AMBER ================ */
html.dark .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}
html.dark .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.15) !important;
}
html.dark .text-amber-600 {
    color: #fbbf24 !important;
}
html.dark .text-amber-700 {
    color: #f59e0b !important;
}
html.dark .border-amber-200 {
    border-color: rgba(245, 158, 11, 0.25) !important;
}

/* ================ WHITE OPACITY VARIANTS ================ */
html.dark .bg-white\/80 {
    background-color: rgba(0, 0, 0, 0.85) !important;
}
html.dark .bg-white\/95 {
    background-color: rgba(0, 0, 0, 0.95) !important;
}

/* ================ PERSONALITY QUESTIONNAIRE PAGE ================ */
html.dark .pq-fw-card {
    background: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .pq-fw-card:hover {
    background: var(--surface-secondary) !important;
}

html.dark .pq-fw-card:has(input:checked) {
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3) !important;
}

html.dark .pq-founder-card {
    background: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .pq-founder-card .pq-card-body {
    background: var(--surface-primary) !important;
}

html.dark .pq-founder-card details {
    border-color: var(--border-secondary) !important;
}

html.dark .pq-founder-card details:hover {
    border-color: #2a2a2a !important;
}

html.dark .pq-founder-card details[open] > div {
    border-top-color: var(--border-primary) !important;
}

html.dark .pq-sticky-bar {
    background: rgba(0, 0, 0, 0.95) !important;
    border-top-color: var(--border-secondary) !important;
}

/* ================ CUSTOM SAND/GOLD COLOR PALETTE ================ */
/* sand-50 = #FAF8F5, sand-100 = #F5F3E9, sand-200 = #EBE7D9 */
html.dark .bg-sand-50 { background-color: rgba(163, 157, 136, 0.06) !important; }
html.dark .bg-sand-100 { background-color: rgba(163, 157, 136, 0.1) !important; }
html.dark .bg-sand-200 { background-color: rgba(163, 157, 136, 0.15) !important; }
html.dark .text-sand-500 { color: #C5BFA8 !important; }
html.dark .text-sand-600 { color: #A39D88 !important; }
html.dark .border-sand-200 { border-color: rgba(163, 157, 136, 0.2) !important; }
/* gold */
html.dark .bg-gold-50 { background-color: rgba(193, 154, 107, 0.08) !important; }
html.dark .bg-gold-100 { background-color: rgba(193, 154, 107, 0.12) !important; }
html.dark .text-gold-500 { color: #E5CCA3 !important; }
html.dark .text-gold-600 { color: #C19A6B !important; }
/* sage */
html.dark .bg-sage-50 { background-color: rgba(138, 154, 134, 0.1) !important; }
html.dark .bg-sage-100 { background-color: rgba(138, 154, 134, 0.15) !important; }
html.dark .text-sage-500 { color: #A3B19B !important; }
html.dark .text-sage-600 { color: #8A9A86 !important; }
/* forest */
html.dark .bg-forest-50 { background-color: rgba(44, 66, 52, 0.2) !important; }
html.dark .bg-forest-100 { background-color: rgba(44, 66, 52, 0.3) !important; }

/* ================ GRADIENT HERO SECTIONS ================ */
/* Catch arbitrary gradient classes and from-green-50/to-white hero patterns */
html.dark .from-\[\#F0F4F1\] {
    --tw-gradient-from: #0a100c !important;
}
html.dark .via-white {
    --tw-gradient-via: #0f1610 !important;
}
html.dark .to-\[\#FAF8F5\] {
    --tw-gradient-to: #141f18 !important;
}
html.dark .from-green-50 {
    --tw-gradient-from: rgba(44, 66, 52, 0.3) !important;
}
html.dark .to-white:not([class*="text-"]) {
    --tw-gradient-to: #0f1610 !important;
}

/* Tab scroll fade buttons in report */
html.dark .from-white.via-white {
    --tw-gradient-from: var(--surface-primary) !important;
    --tw-gradient-via: var(--surface-primary) !important;
}
html.dark .from-gray-50 {
    --tw-gradient-from: var(--surface-secondary) !important;
}

/* ================================================================
   NEW DESIGN SYSTEM COMPONENTS — Dark Olive Theme
   Stats bars, data tables, status badges, score displays
   ================================================================ */

/* Stats Bar — 4-column layout with dividers */
.dt-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.dt-stats-bar > div {
    padding: 1.25rem 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.dt-stats-bar > div:last-child {
    border-right: none;
}

.dt-stat-number {
    font-family: 'Playfair Display', 'Lora', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.dt-stat-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-cta);
    margin-top: 0.375rem;
}

.dt-stat-sublabel {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

/* Search + Filters Bar */
.dt-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.dt-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.dt-search-input::placeholder {
    color: var(--text-tertiary);
}

.dt-search-input:focus {
    outline: none;
    border-color: var(--brand-cta);
    box-shadow: 0 0 0 3px rgba(201, 166, 86, 0.1);
}

.dt-filter-select {
    padding: 0.75rem 2.25rem 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23A39D88'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") right 0.625rem center/1.25rem no-repeat;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.dt-filter-select:hover,
.dt-filter-select:focus {
    border-color: var(--brand-cta);
    outline: none;
}

/* Data Table */
.dt-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dt-data-table th {
    padding: 0.875rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dt-data-table td {
    padding: 0.875rem 1.25rem;
    vertical-align: middle;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dt-data-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.dt-data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Score Display */
.dt-score {
    font-family: 'Playfair Display', 'Lora', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.dt-score-label {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    text-align: center;
}

.dt-score-strong { color: #7CB97E; }
.dt-score-strong + .dt-score-label { color: #7CB97E; }
.dt-score-consider { color: var(--brand-cta); }
.dt-score-consider + .dt-score-label { color: var(--brand-cta); }
.dt-score-pass { color: #E87C6E; }
.dt-score-pass + .dt-score-label { color: #E87C6E; }

/* Status Badges */
.dt-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid;
}

.dt-badge-active {
    background: rgba(124, 185, 126, 0.15);
    color: #7CB97E;
    border-color: rgba(124, 185, 126, 0.3);
}

.dt-badge-review {
    background: rgba(201, 166, 86, 0.12);
    color: var(--brand-cta);
    border-color: rgba(201, 166, 86, 0.25);
}

.dt-badge-decision {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.15);
}

.dt-badge-questionnaire {
    background: rgba(163, 177, 155, 0.12);
    color: #A3B19B;
    border-color: rgba(163, 177, 155, 0.25);
}

.dt-badge-completed {
    background: rgba(124, 185, 126, 0.15);
    color: #7CB97E;
    border-color: rgba(124, 185, 126, 0.3);
}

.dt-badge-sent {
    background: rgba(201, 166, 86, 0.12);
    color: var(--brand-cta);
    border-color: rgba(201, 166, 86, 0.25);
}

.dt-badge-opened {
    background: rgba(163, 177, 155, 0.12);
    color: #A3B19B;
    border-color: rgba(163, 177, 155, 0.25);
}

/* Sector Tags */
.dt-sector-tag {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dt-tag-healthcare {
    background: rgba(44, 66, 52, 0.4);
    color: #8DB990;
}

.dt-tag-aiml {
    background: rgba(201, 166, 86, 0.15);
    color: var(--brand-cta);
}

.dt-tag-cloud {
    background: rgba(163, 177, 155, 0.15);
    color: #A3B19B;
}

.dt-tag-robotics {
    background: rgba(232, 124, 110, 0.12);
    color: #E87C6E;
}

/* Contact Avatar */
.dt-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #6B7E67;
    color: #F5F0E5;
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.dt-avatar-sm { width: 2rem; height: 2rem; font-size: 0.6875rem; }
.dt-avatar-md { width: 2.5rem; height: 2.5rem; }
.dt-avatar-lg { width: 3rem; height: 3rem; font-size: 0.9375rem; }

/* Contact Card */
.dt-contact-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: background 0.15s ease;
}

.dt-contact-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Contact Tags */
.dt-contact-tag {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

/* Pagination */
.dt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.dt-pagination a {
    color: var(--text-tertiary);
    font-weight: 600;
    transition: color 0.15s ease;
}

.dt-pagination a:hover {
    color: var(--brand-cta);
}

.dt-pagination .active {
    color: var(--brand-cta);
    font-weight: 700;
}

/* Action Buttons (outline style for tables) */
.dt-btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dt-btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-primary);
}

.dt-btn-outline-gold {
    border-color: rgba(201, 166, 86, 0.3);
    color: var(--brand-cta);
}

.dt-btn-outline-gold:hover {
    background: rgba(201, 166, 86, 0.1);
    border-color: rgba(201, 166, 86, 0.5);
}

/* Entrepreneur mode link */
.dt-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--brand-cta);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: opacity 0.15s ease;
}

.dt-mode-switch:hover {
    opacity: 0.8;
}

