@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* Global Typography & Smoothing */
* {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   VISAFY CRM — EXECUTIVE LUXURY DESIGN SYSTEM TOKENS
   ========================================================================== */
:root {
    /* Executive Brand Palette */
    --color-brand-navy: #0b1329;
    --color-brand-navy-light: #152243;
    --color-brand-navy-surface: #0f1a36;
    --color-brand-blue: #2563eb;
    --color-brand-blue-hover: #1d4ed8;
    --color-brand-blue-subtle: #eff6ff;
    --color-brand-blue-glow: rgba(37, 99, 235, 0.18);

    --color-brand-gold: #d97706;
    --color-brand-gold-dark: #b45309;
    --color-brand-gold-subtle: #fffbeb;
    --color-brand-gold-glow: rgba(217, 119, 6, 0.2);

    --color-brand-emerald: #059669;
    --color-brand-emerald-dark: #047857;
    --color-brand-emerald-subtle: #ecfdf5;
    --color-brand-emerald-glow: rgba(5, 150, 105, 0.2);

    --color-brand-violet: #7c3aed;
    --color-brand-violet-subtle: #faf5ff;
    --color-brand-violet-glow: rgba(124, 58, 237, 0.2);

    --color-brand-rose: #e11d48;
    --color-brand-rose-subtle: #fff1f2;
    --color-brand-rose-glow: rgba(225, 29, 72, 0.2);

    /* Surface & Background Canvas */
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #fbfcfe;
    --bg-glass-card: rgba(255, 255, 255, 0.88);
    --bg-glass-subtle: rgba(255, 255, 255, 0.72);
    --bg-glass-navy: rgba(11, 19, 41, 0.85);

    /* Luxury Diffused Ambient Shadows (Stripe / Mercury Standard) */
    --shadow-ambient-2xs: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-ambient-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.03), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --shadow-ambient-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    --shadow-ambient-md: 0 2px 4px -1px rgba(15, 23, 42, 0.03), 0 8px 24px -4px rgba(15, 23, 42, 0.06);
    --shadow-ambient-lg: 0 4px 8px -2px rgba(15, 23, 42, 0.03), 0 16px 36px -6px rgba(15, 23, 42, 0.08);
    --shadow-ambient-xl: 0 8px 16px -4px rgba(15, 23, 42, 0.03), 0 28px 56px -10px rgba(15, 23, 42, 0.11);
    --shadow-ambient-glass: 0 8px 32px 0 rgba(11, 19, 41, 0.06), 0 1px 2px 0 rgba(11, 19, 41, 0.02);

    /* Subtle Alpha Borders */
    --border-subtle: rgba(15, 23, 42, 0.07);
    --border-subtle-hover: rgba(37, 99, 235, 0.25);
    --border-card: rgba(15, 23, 42, 0.08);
    --border-glass: rgba(255, 255, 255, 0.7);

    /* Easing */
    --ease-executive: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    height: 100%;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#app {
    height: 100%;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

#sidebar-container {
    height: 100%;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: sticky;
    top: 0;
}

/* Modern Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
    transition: background-color 0.2s ease;
}

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

/* Dark-themed Scrollbar for Sidebar & Dark Panels */
.custom-scrollbar::-webkit-scrollbar-thumb,
.bg-brand-navy::-webkit-scrollbar-thumb {
    background: #334155;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.bg-brand-navy::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Card Elevation & Hover Transitions */
.card-hover {
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
}

.card-hover:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 8px 20px -4px rgba(15, 23, 42, 0.06);
    border-color: rgba(37, 99, 235, 0.22);
}

/* Status Badge Design Tokens */
.badge-status-new,
.badge-status-contacted,
.badge-status-qualified,
.badge-status-consultation,
.badge-status-won,
.badge-status-lost {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.badge-status-new {
    background-color: rgba(240, 249, 255, 0.9);
    color: #0369a1;
    border: 1px solid rgba(186, 230, 253, 0.85);
}

.badge-status-contacted {
    background-color: rgba(238, 242, 255, 0.9);
    color: #4338ca;
    border: 1px solid rgba(199, 210, 254, 0.85);
}

.badge-status-qualified {
    background-color: rgba(250, 245, 255, 0.9);
    color: #7e22ce;
    border: 1px solid rgba(233, 213, 255, 0.85);
}

.badge-status-consultation {
    background-color: rgba(255, 251, 235, 0.9);
    color: #92400e;
    border: 1px solid rgba(253, 230, 138, 0.85);
}

.badge-status-won {
    background-color: rgba(236, 253, 245, 0.9);
    color: #047857;
    border: 1px solid rgba(167, 243, 208, 0.85);
}

.badge-status-lost {
    background-color: rgba(248, 250, 252, 0.9);
    color: #64748b;
    border: 1px solid rgba(226, 232, 240, 0.85);
}

/* Micro-animations */
@keyframes pulseSubtle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.98); }
}

.pulse-subtle {
    animation: pulseSubtle 3s ease-in-out infinite;
}

/* ==========================================================================
   Typographic Contract of Engagement & Multi-Page A4 Print Engine
   ========================================================================== */

.contract-sheet-canvas {
    width: 100%;
    max-width: 210mm;
    margin: 0 auto;
    background: transparent;
    box-sizing: border-box;
}

/* Individual Discrete A4 Pages for Screen & Print */
.contract-a4-page {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff !important;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.05);
    margin: 0 auto 2.5rem auto;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.contract-watermark-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.contract-watermark-overlay .watermark-img {
    width: 500px;
    max-width: 75%;
    opacity: 0.06;
    user-select: none;
}

.contract-page-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -1.75rem auto 2.25rem auto;
    font-size: 10.5px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contract-page-indicator span {
    background: #1e293b;
    color: #cbd5e1;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid #334155;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
}

/* Print Rules for 100% Crisp Typographic Contract */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        width: 210mm !important;
        height: auto !important;
    }

    body * {
        visibility: hidden !important;
    }

    #contract-modal-container,
    #contract-print-viewport,
    #contract-sheet,
    #contract-sheet *,
    .contract-a4-page,
    .contract-a4-page * {
        visibility: visible !important;
    }

    #contract-modal-container {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        overflow: visible !important;
        z-index: 99999 !important;
    }

    #contract-print-viewport {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        display: block !important;
    }

    .contract-sheet-canvas {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .contract-a4-page {
        width: 210mm !important;
        height: 297mm !important;
        min-height: 297mm !important;
        max-height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        page-break-after: always !important;
        break-after: page !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .contract-a4-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .no-print,
    .contract-page-indicator {
        display: none !important;
    }
}

/* ==========================================================================
   VISAFY CRM — LUXURY EXECUTIVE PORTAL DESIGN TOKENS & UTILITIES
   ========================================================================== */

/* 1. Ambient Diffused Multi-Layer Shadows (Stripe / Mercury Standard) */
.shadow-2xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02) !important;
}

.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03), 0 2px 6px -1px rgba(15, 23, 42, 0.02) !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 4px 12px -2px rgba(15, 23, 42, 0.04) !important;
}

.shadow, .shadow-md {
    box-shadow: 0 2px 4px -1px rgba(15, 23, 42, 0.03), 0 8px 24px -4px rgba(15, 23, 42, 0.06) !important;
}

.shadow-lg {
    box-shadow: 0 4px 8px -2px rgba(15, 23, 42, 0.03), 0 16px 36px -6px rgba(15, 23, 42, 0.08) !important;
}

.shadow-xl {
    box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.03), 0 28px 56px -10px rgba(15, 23, 42, 0.11) !important;
}

.shadow-2xl {
    box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.05), 0 36px 72px -12px rgba(15, 23, 42, 0.14) !important;
}

/* 2. Refined Ultra-Subtle Borders */
.border-slate-200 {
    border-color: rgba(226, 232, 240, 0.85) !important;
}

.border-slate-100 {
    border-color: rgba(241, 245, 249, 0.85) !important;
}

/* 3. Executive Surface Cards & Bento Architecture */
.bento-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02), 0 4px 16px -2px rgba(15, 23, 42, 0.04);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    border-color: rgba(37, 99, 235, 0.25);
}

.card-premium {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.075);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 4px 14px -2px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.card-premium:hover {
    box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.03), 0 10px 24px -4px rgba(15, 23, 42, 0.07);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-luxury {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.96) 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.15rem;
    box-shadow: 0 2px 4px -1px rgba(15, 23, 42, 0.03), 0 8px 24px -4px rgba(15, 23, 42, 0.06);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.card-luxury:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px -2px rgba(15, 23, 42, 0.03), 0 16px 36px -6px rgba(15, 23, 42, 0.09);
    border-color: rgba(37, 99, 235, 0.28);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(11, 19, 41, 0.06), 0 1px 2px 0 rgba(11, 19, 41, 0.02);
}

.glass-panel-dark {
    background: rgba(11, 19, 41, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.35);
}

.glass-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

/* 4. Tactile Button Feedback & Micro-interactions */
button:not(:disabled):active,
.btn-tactile:active,
a[role="button"]:active,
.preset-btn:active {
    transform: scale(0.978) !important;
}

button:not(:disabled),
.btn-tactile,
a[role="button"],
.preset-btn {
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-glow-blue:hover {
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.28) !important;
}

.btn-glow-emerald:hover {
    box-shadow: 0 4px 14px 0 rgba(5, 150, 105, 0.28) !important;
}

.btn-glow-gold:hover {
    box-shadow: 0 4px 14px 0 rgba(217, 119, 6, 0.28) !important;
}

/* 5. Modern Refined Form Controls & Focus Halos */
input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
    outline: none !important;
}

input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) {
    border-color: #cbd5e1;
}

/* 6. Luxury Status Badges & Chips */
.badge-luxury {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.badge-luxury-blue {
    background: rgba(239, 246, 255, 0.88);
    color: #1d4ed8;
    border: 1px solid rgba(191, 219, 254, 0.85);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.04);
}

.badge-luxury-emerald, .badge-luxury-won {
    background: rgba(236, 253, 245, 0.88);
    color: #047857;
    border: 1px solid rgba(167, 243, 208, 0.85);
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.04);
}

.badge-luxury-amber, .badge-luxury-consultation {
    background: rgba(255, 251, 235, 0.88);
    color: #b45309;
    border: 1px solid rgba(253, 230, 138, 0.85);
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.04);
}

.badge-luxury-gold {
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.95) 0%, rgba(254, 243, 199, 0.95) 100%);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.08);
}

.badge-luxury-violet, .badge-luxury-qualified {
    background: rgba(250, 245, 255, 0.88);
    color: #6d28d9;
    border: 1px solid rgba(233, 213, 255, 0.85);
    box-shadow: 0 1px 2px rgba(109, 40, 217, 0.04);
}

.badge-luxury-rose, .badge-luxury-urgent {
    background: rgba(255, 241, 242, 0.88);
    color: #be123c;
    border: 1px solid rgba(254, 205, 211, 0.85);
    box-shadow: 0 1px 2px rgba(225, 29, 72, 0.04);
}

.badge-luxury-slate, .badge-luxury-lost {
    background: rgba(248, 250, 252, 0.88);
    color: #475569;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.badge-luxury-new {
    background: rgba(240, 249, 255, 0.88);
    color: #0284c7;
    border: 1px solid rgba(186, 230, 253, 0.85);
    box-shadow: 0 1px 2px rgba(2, 132, 199, 0.04);
}

.badge-luxury-contacted {
    background: rgba(238, 242, 255, 0.88);
    color: #4338ca;
    border: 1px solid rgba(199, 210, 254, 0.85);
    box-shadow: 0 1px 2px rgba(67, 56, 202, 0.04);
}

/* 7. Live Telephony & Agent Radar Ping */
.radar-ping {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.radar-ping .ping-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.radar-ping .ping-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    animation: radar-ping-wave 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
    opacity: 0.75;
}

@keyframes radar-ping-wave {
    75%, 100% {
        transform: scale(2.3);
        opacity: 0;
    }
}

/* 8. Executive Table Architecture */
.table-luxury {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-luxury thead th,
.table-luxury th {
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.table-luxury tbody tr {
    transition: background-color 0.12s ease;
}

.table-luxury tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.65);
}

.table-luxury tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.045);
    font-size: 12.5px;
    color: #1e293b;
}

/* Sticky Header Glass Th */
th.glass-th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

/* 9. Executive Loading Shimmer & State Utilities */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
}

/* 10. Lead Health Score Badges */
.lead-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    border: 2px solid transparent;
}

.lead-score-hot {
    background: #ecfdf5;
    color: #047857;
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.lead-score-warm {
    background: #fffbeb;
    color: #b45309;
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.lead-score-cool {
    background: #f8fafc;
    color: #64748b;
    border-color: #cbd5e1;
}

/* 11. High-Contrast Tabular Numbers & Polish */
.tabular-nums {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.text-balance {
    text-wrap: balance;
}


