/* ==========================================================================
   Premium CRM stylesheet with Light & Dark Themes and Glassmorphism details
   Author: Antigravity AI
   ========================================================================== */

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

/* Dynamic Theme Variables */
:root {
    --font-family: 'Plus Jakarta Sans', sans-serif;
    
    /* Light Mode Slate-Navy HSL Values */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-sidebar: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    /* Primary Brand Theme: Slate-800 Deep Navy */
    --primary: #1e293b;
    --primary-rgb: 30, 41, 59;
    --primary-hover: #0f172a;
    
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);
    
    /* Lead Sentiment Ratings Color Palette (Professional light HSL backgrounds with saturated border/text) */
    --rating-cold-bg: #f1f5f9;
    --rating-cold-text: #475569;
    --rating-cold-border: #cbd5e1;
    
    --rating-warm-bg: #fef3c7;
    --rating-warm-text: #b45309;
    --rating-warm-border: #fde68a;
    
    --rating-hot-bg: #fee2e2;
    --rating-hot-text: #b91c1c;
    --rating-hot-border: #fca5a5;
}

[data-theme="dark"] {
    /* Dark Mode Slate-Navy HSL Values */
    --bg-primary: #090d16;
    --bg-secondary: #111827;
    --bg-sidebar: #0b0f19;
    --text-primary: #f3f4f6;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    /* Dark Mode Primary Brand: Google/Royal Blue */
    --primary: #3b82f6;
    --primary-rgb: 59, 130, 246;
    --primary-hover: #2563eb;
    
    --border-color: #1f2937;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    
    --sidebar-text: #9ca3af;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(59, 130, 246, 0.15);
    
    /* Lead Sentiment Ratings Dark Mode Palette */
    --rating-cold-bg: #1e293b;
    --rating-cold-text: #94a3b8;
    --rating-cold-border: #334155;
    
    --rating-warm-bg: #78350f;
    --rating-warm-text: #fef3c7;
    --rating-warm-border: #92400e;
    
    --rating-hot-bg: #7f1d1d;
    --rating-hot-text: #fee2e2;
    --rating-hot-border: #991b1b;
}

/* Global Reset & Basic Configurations */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Authentication Views Layout
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    padding: 24px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

.auth-logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    text-align: center;
}

/* Form Styling overrides */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control, .form-select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 8px 12px -2px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==========================================================================
   Dashboard & Sidebar Shell Layout
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    flex-shrink: 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 32px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    color: var(--sidebar-text-hover);
    background-color: var(--sidebar-active-bg);
    transform: translateX(4px);
}

.sidebar-link.active {
    color: #ffffff;
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-user {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: auto;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    padding: 8px 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1020; /* Below modals (1050) but above standard page content (1) */
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .top-navbar {
    background-color: rgba(17, 24, 39, 0.85) !important;
}

.page-container {
    padding: 32px;
    flex-grow: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   UI Components & Cards
   ========================================================================== */
.card-metric {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.bg-primary-soft {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}
.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}
.bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.1);
    color: #b58000;
}
.bg-danger-soft {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.card-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .card-panel {
        padding: 24px;
    }
}

/* Premium styled data tables */
.table-responsive-custom {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
}

.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 18px 20px !important;
    vertical-align: top !important;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 20px 20px !important;
    color: var(--text-primary);
    vertical-align: top !important;
    border-bottom: 1px solid var(--border-color);
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

.table-custom tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02);
}

/* Status Badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap !important;
    flex-shrink: 0;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Theme switch toggle styling */
.theme-switch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.2s ease;
}
.theme-switch:hover {
    background-color: var(--border-color);
    transform: scale(1.05);
}

/* Timeline Notes Styling */
.timeline-notes {
    position: relative;
    padding-left: 28px;
    border-left: 2px solid var(--border-color);
    margin-left: 10px;
}

.timeline-note-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-note-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid var(--bg-secondary);
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-note-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

/* ==========================================================================
   Animations & Responsive Settings
   ========================================================================== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness Rules */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .top-navbar {
        padding: 0 20px;
    }
    
    .page-container {
        padding: 20px;
    }
}

/* ==========================================================================
   Print-Friendly Media Stylesheet (PDF & Print Reports Output)
   ========================================================================== */
@media print {
    /* Hide navigation layouts, filter bars, action buttons, and page footers */
    .sidebar,
    .top-navbar,
    .card-panel form,
    .card-panel nav,
    .btn,
    button,
    form,
    th:last-child,
    td:last-child,
    .dropdown-menu,
    .d-flex.gap-2.flex-wrap {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Plus Jakarta Sans', sans-serif !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .page-container {
        padding: 0 !important;
        margin: 0 !important;
    }

    .card-panel {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Print Header Sheet */
    .card-panel::before {
        content: "Acme Lead CRM - Reports Export Sheet (System Data)";
        display: block;
        font-size: 16pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #333333;
        padding-bottom: 8px;
        color: #000000 !important;
    }

    /* Clean full-page tables */
    .table-custom {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 10px !important;
    }

    .table-custom th,
    .table-custom td {
        border: 1px solid #cccccc !important;
        padding: 8px 12px !important;
        font-size: 9pt !important;
        color: #000000 !important;
        text-align: left !important;
    }

    .table-custom th {
        background-color: #f0f0f0 !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
    }

    /* Keep table badges readable in greyscale print */
    .badge-status, .badge {
        background: transparent !important;
        color: #000000 !important;
        border: 1px solid #999999 !important;
        box-shadow: none !important;
        padding: 2px 6px !important;
        font-size: 8pt !important;
    }
}

/* ==========================================================================
   PREMIUM SELECT2 BOOTSTRAP-5 THEME OVERRIDES (High clickability & aesthetics)
   ========================================================================== */
.select2-container--bootstrap-5 {
    display: block;
}

.select2-container--bootstrap-5 .select2-selection {
    position: relative !important; /* Crucial for absolute positioning of children */
    min-height: 44px !important; /* Spacious height, matching other inputs */
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    padding: 0 12px !important;
    padding-right: 48px !important; /* Prevent text colliding with clear/arrow icons */
}

/* Hover highlights */
.select2-container--bootstrap-5 .select2-selection:hover {
    border-color: var(--primary) !important;
    background-color: var(--bg-secondary) !important;
}

/* Focus and open highlights */
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--primary) !important;
    background-color: var(--bg-secondary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
}

/* Selection Text rendering */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    padding-left: 0 !important;
    padding-right: 24px !important;
}

/* Search Box Clear Button */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear {
    position: absolute !important;
    right: 32px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    background-color: transparent !important;
    color: var(--text-secondary) !important;
    font-size: 1rem !important;
    margin: 0 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear:hover {
    color: #dc3545 !important;
}

/* Custom premium indicator arrow */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 12px !important;
    transition: transform 0.2s ease !important;
}

/* Light / Dark variable synchronization for arrow fill in dark mode */
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

/* Arrow flip on open */
.select2-container--bootstrap-5.select2-container--open .select2-selection--single .select2-selection__arrow {
    transform: translateY(-50%) rotate(180deg) !important;
}

/* Hide select2 standard design arrow */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    display: none !important;
}

/* Dropdown Panel */
.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-secondary) !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow-hover) !important;
    overflow: hidden !important;
    z-index: 1060 !important;
}

/* Search input field */
.select2-container--bootstrap-5 .select2-search__field {
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
}

.select2-container--bootstrap-5 .select2-search__field:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

/* List group options styling */
.select2-container--bootstrap-5 .select2-results__option {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

/* Hover/Focus list elements */
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Selected list element */
.select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: rgba(79, 70, 229, 0.08) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   MOBILE-FIRST PREMIUM APP EXPERIENCES (Bottom Navigation & Mobile Cards)
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Add padding to the bottom of the main content so bottom nav doesn't overlap contents */
    .page-container {
        padding-bottom: 90px !important;
    }
    
    /* Sleek bottom navigation bar */
    .mobile-bottom-nav {
        height: 68px;
        background: rgba(255, 255, 255, 0.88) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    }
    
    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(17, 24, 39, 0.88) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }
    
    .mobile-nav-link {
        color: var(--text-secondary) !important;
        opacity: 0.65;
        font-weight: 600;
        width: 60px;
    }
    
    .mobile-nav-link:hover, .mobile-nav-link.active {
        opacity: 1;
        color: var(--primary) !important;
    }
    
    .mobile-nav-link.active i {
        transform: translateY(-2px);
        filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.25));
    }
    
    .mobile-nav-link i {
        transition: transform 0.2s ease;
    }

    /* Cards styling on mobile */
    .mobile-lead-cards .card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .mobile-lead-cards .card:active {
        transform: scale(0.98);
    }
}

/* ==========================================================================
   PREMIUM DYNAMIC MOBILE BUTTONS (Wow gradients & soft shadows)
   ========================================================================== */
.btn-mobile-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-mobile-success:hover, .btn-mobile-success:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3) !important;
}

.btn-mobile-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-mobile-primary:hover, .btn-mobile-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.3) !important;
}

.btn-mobile-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.15) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-mobile-secondary:hover, .btn-mobile-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(100, 116, 139, 0.25) !important;
}

.btn-mobile-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-mobile-warning:hover, .btn-mobile-warning:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.3) !important;
}

.btn-mobile-danger-light {
    background-color: rgba(220, 53, 69, 0.08) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.15) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-mobile-danger-light:hover, .btn-mobile-danger-light:active {
    background-color: rgba(220, 53, 69, 0.15) !important;
    color: #bd2130 !important;
}

/* ==========================================================================
   RESPONSIVE KPI METRIC CARDS (Sleek 2x2 Grid details for Mobile viewports)
   ========================================================================== */
@media (max-width: 575.98px) {
    .card-metric {
        padding: 14px 12px !important;
        border-radius: 12px !important;
        gap: 6px !important;
        min-height: 94px !important;
        flex-wrap: nowrap !important;
    }
    
    .metric-value {
        font-size: 1.4rem !important;
        margin-bottom: 2px !important;
        line-height: 1.1 !important;
    }
    
    .metric-label {
        font-size: 0.68rem !important;
        line-height: 1.25 !important;
        font-weight: 500 !important;
        letter-spacing: -0.01em !important;
    }
    
    .metric-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.05rem !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
}

/* ==========================================================================
   100% GLITCH-FREE MOBILE RESPONSIVE OPTIMIZATION SYSTEM
   ========================================================================== */
html, body, .app-wrapper {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

@media (max-width: 767.98px) {
    /* Touch Target Auditing (Minimum 44x44px Clickable Area for Touchscreens) */
    .theme-switch, .dropdown button.theme-switch, #mobileSidebarToggle {
        min-width: 44px !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .btn:not(.btn-sm):not(.btn-link):not(.btn-xs), 
    .form-control:not(.form-control-sm), 
    .form-select:not(.form-select-sm) {
        min-height: 44px !important;
    }
    
    .btn-sm, .form-control-sm, .form-select-sm {
        min-height: 38px !important;
    }
    
    .dropdown-item, .list-group-item, .page-link {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .sidebar-link {
        min-height: 48px !important;
    }
    
    /* Touch target padding overrides */
    .table-custom td a, .mobile-nav-link {
        padding: 8px 12px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
}

@media (max-width: 575.98px) {
    /* Responsive Side Padding */
    .page-container {
        padding: 20px 16px 90px 16px !important;
    }
    
    .card-panel {
        padding: 16px 12px !important;
        border-radius: 12px !important;
    }
    
    /* Auto heading scaling to prevent awkward layout breaks */
    h1, .h1 { font-size: 1.65rem !important; line-height: 1.2 !important; letter-spacing: -0.02em !important; }
    h2, .h2 { font-size: 1.4rem !important; line-height: 1.2 !important; letter-spacing: -0.02em !important; }
    h3, .h3 { font-size: 1.2rem !important; line-height: 1.2 !important; }
    h4, .h4 { font-size: 1.1rem !important; line-height: 1.25 !important; }
    h5, .h5 { font-size: 1rem !important; line-height: 1.25 !important; }
    h6, .h6 { font-size: 0.88rem !important; line-height: 1.3 !important; }
    
    p, .small, .text-secondary {
        font-size: 0.82rem !important;
    }
}

/* ==========================================
   SELECT2 DOUBLE-ARROW OVERLAP FIX
   ========================================== */
.select2-container--bootstrap-5 .select2-selection {
    background-image: none !important;
}

/* ==========================================
   PREMIUM SCROLLBAR FOR FOLLOW-UP DASHBOARD
   ========================================== */
.followup-list-container::-webkit-scrollbar {
    width: 6px !important;
}
.followup-list-container::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.05) !important;
    border-radius: 10px !important;
}
.followup-list-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3) !important;
    border-radius: 10px !important;
}
.followup-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.5) !important;
}




/* Lead Action Trigger Buttons (Call & WhatsApp in lists/cards) */
.lead-action-trigger.btn-outline-primary,
.lead-action-trigger.btn-outline-success,
.lead-action-trigger.btn-outline-secondary {
    width: 2.6rem !important;
    height: 2.6rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.lead-action-trigger.btn-outline-primary i,
.lead-action-trigger.btn-outline-success i,
.lead-action-trigger.btn-outline-secondary i {
    font-size: 1rem !important;
}
