/* ================================================================
   Ganesh CRM — PREMIUM DESIGN SYSTEM
   A refined, glassmorphic, animated Bootstrap 5 design layer
   ================================================================ */

/* ── CSS CUSTOM PROPERTIES ── */
:root {
    /* Primitive Colors — Raw Palette */
    --color-white: #ffffff;
    --color-black: #000000;
    
    /* Indigo (Primary) */
    --color-indigo-50: #eef2ff;
    --color-indigo-100: #e0e7ff;
    --color-indigo-200: #c7d2fe;
    --color-indigo-300: #a5b4fc;
    --color-indigo-400: #818cf8;
    --color-indigo-500: #6366f1;
    --color-indigo-600: #4f46e5;
    --color-indigo-700: #4338ca;
    --color-indigo-800: #3730a3;
    --color-indigo-900: #312e81;
    
    /* Violet/Purple (Accent) */
    --color-violet-400: #a78bfa;
    --color-violet-500: #8b5cf6;
    --color-violet-600: #7c3aed;
    --color-violet-800: #5b21b6;
    --color-fuchsia-300: #c084fc;
    --color-fuchsia-400: #e879f9;
    
    /* Emerald (Success) */
    --color-emerald-50: #ecfdf5;
    --color-emerald-100: #d1fae5;
    --color-emerald-200: #a7f3d0;
    --color-emerald-300: #6ee7b7;
    --color-emerald-400: #34d399;
    --color-emerald-500: #10b981;
    --color-emerald-600: #059669;
    --color-emerald-700: #047857;
    --color-emerald-800: #065f46;
    --color-emerald-900: #064e3b;
    
    /* Red (Danger) */
    --color-red-50: #fef2f2;
    --color-red-100: #fee2e2;
    --color-red-200: #fecaca;
    --color-red-300: #fca5a5;
    --color-red-400: #f87171;
    --color-red-500: #ef4444;
    --color-red-600: #dc2626;
    --color-red-700: #b91c1c;
    --color-red-800: #991b1b;
    --color-red-900: #7f1d1d;
    
    /* Amber (Warning) */
    --color-amber-50: #fffbeb;
    --color-amber-100: #fef3c7;
    --color-amber-200: #fde68a;
    --color-amber-300: #fcd34d;
    --color-amber-400: #fbbf24;
    --color-amber-500: #f59e0b;
    --color-amber-600: #d97706;
    --color-amber-700: #b45309;
    --color-amber-800: #92400e;
    --color-amber-900: #78350f;
    
    /* Blue (Info) */
    --color-blue-50: #eff6ff;
    --color-blue-100: #dbeafe;
    --color-blue-200: #bfdbfe;
    --color-blue-300: #93c5fd;
    --color-blue-400: #60a5fa;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-blue-800: #1e40af;
    --color-blue-900: #1e3a8a;
    
    /* Slate (Grays) */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;
    
    /* Dark Theme Specifics */
    --color-dark-900: #0b0f19;
    --color-dark-800: #1a1b3a;
    --color-dark-700: #0f1023;
    
    /* Opacity Variants — White */
    --color-white-3: rgba(255, 255, 255, 0.03);
    --color-white-4: rgba(255, 255, 255, 0.04);
    --color-white-5: rgba(255, 255, 255, 0.05);
    --color-white-8: rgba(255, 255, 255, 0.08);
    --color-white-10: rgba(255, 255, 255, 0.1);
    --color-white-12: rgba(255, 255, 255, 0.12);
    --color-white-15: rgba(255, 255, 255, 0.15);
    --color-white-20: rgba(255, 255, 255, 0.2);
    --color-white-25: rgba(255, 255, 255, 0.25);
    --color-white-30: rgba(255, 255, 255, 0.3);
    --color-white-85: rgba(255, 255, 255, 0.85);
    --color-white-90: rgba(255, 255, 255, 0.9);
    --color-white-95: rgba(255, 255, 255, 0.95);
    
    /* Opacity Variants — Black */
    --color-black-3: rgba(0, 0, 0, 0.03);
    --color-black-4: rgba(0, 0, 0, 0.04);
    --color-black-5: rgba(0, 0, 0, 0.05);
    --color-black-6: rgba(0, 0, 0, 0.06);
    --color-black-10: rgba(0, 0, 0, 0.1);
    --color-black-15: rgba(0, 0, 0, 0.15);
    --color-black-20: rgba(0, 0, 0, 0.2);
    --color-black-25: rgba(0, 0, 0, 0.25);
    --color-black-30: rgba(0, 0, 0, 0.3);
    --color-black-35: rgba(0, 0, 0, 0.35);
    --color-black-40: rgba(0, 0, 0, 0.4);
    --color-black-50: rgba(0, 0, 0, 0.5);
    --color-black-60: rgba(0, 0, 0, 0.6);
    
    /* Primary Palette - Premium Royal/Midnight Theme */
    --primary: var(--color-indigo-600);
    --primary-hover: var(--color-indigo-700);
    --primary-light: var(--color-indigo-400);
    --primary-glow: rgba(79, 70, 229, 0.35);
    --primary-bg: rgba(79, 70, 229, 0.08);
    
    /* Semantic */
    --success: var(--color-emerald-600);
    --success-light: rgba(5, 150, 105, 0.1);
    --danger: var(--color-red-600);
    --danger-light: rgba(220, 38, 38, 0.1);
    --warning: var(--color-amber-600);
    --warning-light: rgba(217, 119, 6, 0.1);
    --info: var(--color-blue-600);
    --info-light: rgba(37, 99, 235, 0.1);
    
    /* Sidebar - Deep Space */
    --sidebar-bg: var(--color-dark-900);
    --sidebar-surface: var(--color-white-4);
    --sidebar-text: var(--color-slate-400);
    --sidebar-text-active: var(--color-white);
    --sidebar-width: 280px;
    --sidebar-accent: linear-gradient(135deg, var(--color-indigo-500), var(--color-fuchsia-300));
    
    /* Surfaces - Glassmorphic Light */
    --surface: var(--color-white);
    --surface-hover: var(--color-slate-50);
    --background: var(--color-slate-100);
    --background-alt: var(--color-slate-200);
    
    /* Text */
    --text-primary: var(--color-slate-900);
    --text-secondary: var(--color-slate-700);
    --text-muted: var(--color-slate-500);
    
    /* Borders */
    --border: var(--color-slate-300);
    --border-light: var(--color-slate-200);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px var(--color-black-5);
    --shadow-sm: 0 1px 3px var(--color-black-10), 0 1px 2px var(--color-black-6);
    --shadow-md: 0 4px 6px -1px var(--color-black-10), 0 2px 4px -1px var(--color-black-6);
    --shadow-lg: 0 10px 15px -3px var(--color-black-10), 0 4px 6px -2px var(--color-black-5);
    --shadow-xl: 0 20px 25px -5px var(--color-black-10), 0 10px 10px -5px var(--color-black-4);
    --shadow-glow: 0 0 25px var(--primary-glow);
    
    /* Radii */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-slate-300);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-slate-400);
}

/* ── PAGE TRANSITIONS ── */
.page-enter {
    animation: pageSlideIn 0.4s ease-out;
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.sidebar {
    background: var(--sidebar-bg) !important;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%) !important;
    color: var(--sidebar-text);
    width: var(--sidebar-width);
    border-right: 1px solid var(--color-white-4);
}

@media (min-width: 992px) {
    .sidebar {
        min-height: 100vh;
        min-width: var(--sidebar-width);
        flex-shrink: 0;
        position: relative;
        z-index: 1040;
    }
}

/* Sidebar offcanvas overrides — preserve dark theme on mobile */
.sidebar.offcanvas-lg .offcanvas-header,
.sidebar .offcanvas-header {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.sidebar.offcanvas-lg .offcanvas-body,
.sidebar .offcanvas-body {
    background: transparent !important;
    border: none !important;
}

.sidebar.offcanvas-lg .offcanvas-body::before,
.sidebar .offcanvas-body::before {
    display: none !important;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--sidebar-accent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: -0.02em;
}

.sidebar-brand-text span {
    background: var(--sidebar-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    margin: 0.125rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 450;
    transition: all var(--transition-normal);
    position: relative;
    border: 1px solid transparent;
}

.sidebar .nav-link i {
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.7;
    transition: all var(--transition-normal);
}

.sidebar .nav-link:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-surface);
    border-color: rgba(99, 102, 241, 0.1);
    transform: translateX(3px);
}

.sidebar .nav-link:hover i {
    opacity: 1;
    color: var(--primary-light);
}

.sidebar .nav-link.active {
    color: var(--sidebar-text-active);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
    font-weight: 500;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.08);
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--sidebar-accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.sidebar .nav-link.active i {
    opacity: 1;
    color: var(--primary-light);
}

/* Sidebar SVG icon support (legacy) */
.sidebar .nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all var(--transition-normal);
}

.sidebar .nav-link:hover svg,
.sidebar .nav-link.active svg {
    opacity: 1;
}

.sidebar-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(148, 163, 184, 0.5);
    padding: 1.25rem 1.75rem 0.5rem;
    font-weight: 600;
}

.sidebar-logout {
    margin: 0.5rem 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    color: var(--color-red-400);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.12);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-red-300);
    transform: translateX(3px);
}

.sidebar-logout i {
    font-size: 1.125rem;
}

/* ══════════════════════════════════════════════
   TOP NAVBAR
   ══════════════════════════════════════════════ */
.top-navbar {
    background: var(--color-white-85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-search .input-group {
    max-width: 300px;
}

.navbar-search .input-group-text {
    background: var(--background);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.navbar-search .form-control {
    background: var(--background);
    border: 1px solid var(--border);
    border-left: none;
    box-shadow: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.navbar-search .form-control:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: none;
}

.navbar-search .form-control:focus+.input-group-text,
.navbar-search .form-control:focus~.input-group-text {
    border-color: var(--primary);
    background: var(--surface);
}

.navbar-search:focus-within .input-group-text {
    border-color: var(--primary);
    background: var(--surface);
    color: var(--primary);
}

.navbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    position: relative;
    cursor: pointer;
}

.navbar-icon-btn:hover {
    background: var(--primary-bg);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.navbar-icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: var(--color-white);
    border: 2px solid var(--color-white);
    padding: 0 4px;
    font-weight: 700;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 2px solid var(--border);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.navbar-avatar:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    transform: scale(1.05);
}

/* ══════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════ */
.card,
.premium-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border: none;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

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

.stat-card.stat-blue::before {
    background: linear-gradient(90deg, var(--color-blue-500), var(--color-indigo-500));
}

.stat-card.stat-green::before {
    background: linear-gradient(90deg, var(--color-emerald-500), var(--color-emerald-400));
}

.stat-card.stat-purple::before {
    background: linear-gradient(90deg, var(--color-violet-500), var(--color-violet-400));
}

.stat-card.stat-amber::before {
    background: linear-gradient(90deg, var(--color-amber-500), var(--color-amber-400));
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-normal);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-icon.icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-blue-500);
}

.stat-icon.icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald-500);
}

.stat-icon.icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-violet-500);
}

.stat-icon.icon-amber {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-amber-500);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Glass Card */
.glass-card {
    background: var(--color-white-70);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-white-30);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), var(--color-white-30) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn:active::after {
    opacity: 1;
    transition: opacity 0s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-indigo-500), var(--color-indigo-600));
    border: none;
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--color-indigo-600), var(--color-indigo-700));
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
    color: var(--color-white);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-emerald-500), var(--color-emerald-600));
    border: none;
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, var(--color-emerald-600), var(--color-emerald-700));
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
    color: var(--color-white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-red-500), var(--color-red-600));
    border: none;
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover,
.btn-danger:focus {
    background: linear-gradient(135deg, var(--color-red-600), var(--color-red-700));
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
    color: var(--color-white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-amber-500), var(--color-amber-600));
    border: none;
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover,
.btn-warning:focus {
    background: linear-gradient(135deg, var(--color-amber-600), var(--color-amber-700));
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
    color: var(--color-white);
}

.btn-light {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.btn-light:hover,
.btn-light:focus {
    background: var(--background);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════ */
.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--surface);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.form-label .text-danger {
    color: var(--danger) !important;
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-check-input {
    border: 1.5px solid var(--border);
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--primary-glow);
    border-color: var(--primary);
}

.form-switch .form-check-input {
    height: 1.25em;
    width: 2.25em;
}

.form-switch .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}

/* Form Section Headers (in offcanvas forms) */
.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-bottom: 0.625rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.form-section-header h5 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.form-section-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   ALERTS (Flash Messages)
   ══════════════════════════════════════════════ */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    animation: alertSlideIn 0.4s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.08));
    color: var(--color-emerald-800);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.08));
    color: var(--color-red-800);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.08));
    color: var(--color-amber-800);
    border-left: 4px solid var(--warning);
}

.alert-primary,
.alert-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(129, 140, 248, 0.08));
    color: var(--color-indigo-800);
    border-left: 4px solid var(--primary);
}

/* ══════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════ */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.badge-success,
.badge.bg-success {
    background: var(--success-light) !important;
    color: var(--color-emerald-800) !important;
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-danger,
.badge.bg-danger {
    background: var(--danger-light) !important;
    color: var(--color-red-800) !important;
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-warning,
.badge.bg-warning {
    background: var(--warning-light) !important;
    color: var(--color-amber-800) !important;
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-primary,
.badge.bg-primary {
    background: var(--primary-bg) !important;
    color: var(--color-indigo-800) !important;
    border-color: rgba(99, 102, 241, 0.2);
}

.badge-info,
.badge.bg-info {
    background: var(--info-light) !important;
    color: var(--color-blue-800) !important;
    border-color: rgba(59, 130, 246, 0.2);
}

/* ══════════════════════════════════════════════
   TABS (Navigation)
   ══════════════════════════════════════════════ */
.nav-tabs {
    border-bottom: 2px solid var(--border-light);
    gap: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    transition: all var(--transition-normal);
    position: relative;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    animation: tabUnderline 0.3s ease-out;
}

@keyframes tabUnderline {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* ══════════════════════════════════════════════
   TABLES & DATATABLES
   ══════════════════════════════════════════════ */
.table {
    --bs-table-bg: transparent;
    font-size: 0.875rem;
}

.table thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    background: var(--background);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table tbody tr {
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover {
    background: var(--primary-bg);
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    color: var(--text-secondary);
}

/* DataTables Overrides */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length {
    padding: 0.75rem 0;
}

.dataTables_wrapper .dataTables_length label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.dataTables_wrapper .dataTables_filter {
    padding: 0.75rem 0;
}

.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.875rem;
    font-size: 0.8125rem;
    outline: none;
    min-width: 200px;
    transition: all var(--transition-fast);
    background: var(--surface);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.75rem 0;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.35rem 0.75rem !important;
    margin: 0 2px !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.8125rem !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    transition: all var(--transition-fast) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: var(--color-white) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

table.dataTable.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(248, 250, 252, 0.5);
    box-shadow: none;
}

table.dataTable>thead>tr>th {
    border-bottom: 2px solid var(--border) !important;
}

div.dataTables_processing {
    background: var(--color-white-90) !important;
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1rem 2rem !important;
    font-size: 0.875rem !important;
    color: var(--primary) !important;
    font-weight: 500;
}

/* ══════════════════════════════════════════════
   MODALS & OFFCANVAS
   ══════════════════════════════════════════════ */
.offcanvas:not(.sidebar) {
    border: none !important;
    border-radius: var(--radius-2xl) 0 0 var(--radius-2xl) !important;
    box-shadow: var(--shadow-xl);
    max-height: 100dvh;
}
@media (max-width: 991.98px) {
    .offcanvas:not(.sidebar) {
        border-radius: 0 !important;
    }
}


.offcanvas-header:not(.sidebar .offcanvas-header) {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.8), var(--color-white-90));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-black-5);
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 10;
}

.offcanvas-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--text-primary);
}

.offcanvas-body:not(.sidebar .offcanvas-body) {
    padding: 2rem;
    background: var(--surface);
    position: relative;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Fix Bootstrap .row negative margins inside offcanvases causing horizontal scrollbars */
.offcanvas-body .row {
    margin-left: 0;
    margin-right: 0;
}
.offcanvas-body .row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.offcanvas-body:not(.sidebar .offcanvas-body)::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.offcanvas-body:not(.sidebar .offcanvas-body) > * {
    position: relative;
    z-index: 1;
}

.offcanvas-backdrop.show {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 60px var(--color-black-15);
    background: var(--color-white-95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-header {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.8), var(--color-white-90));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-black-5);
    padding: 1.5rem 2rem;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--text-primary);
}

.modal-backdrop.show {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
}

/* ══════════════════════════════════════════════
   DROPDOWN MENUS
   ══════════════════════════════════════════════ */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    animation: dropdownFadeIn 0.2s ease-out;
    background: var(--surface);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--primary-bg);
    color: var(--primary);
}

.dropdown-divider {
    margin: 0.375rem;
    border-color: var(--border-light);
}

/* ══════════════════════════════════════════════
   FULLCALENDAR OVERRIDES
   ══════════════════════════════════════════════ */
.fc {
    --fc-border-color: var(--border);
    --fc-today-bg-color: rgba(99, 102, 241, 0.04);
    --fc-neutral-bg-color: var(--background);
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--border);
}

.fc-toolbar-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

.fc-button-primary {
    background: var(--surface) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    font-size: 0.8125rem !important;
    box-shadow: var(--shadow-xs) !important;
    transition: all var(--transition-fast) !important;
    text-transform: capitalize !important;
}

.fc-button-primary:hover {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.fc-button-active {
    background: var(--primary) !important;
    color: var(--color-white) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
}

.fc-col-header-cell {
    background: var(--background);
    padding: 0.75rem 0 !important;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border) !important;
}

.fc-daygrid-day-number {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.5rem !important;
    text-decoration: none !important;
    transition: color var(--transition-fast);
}

.fc-daygrid-day-number:hover {
    color: var(--primary);
}

.fc-day-today .fc-daygrid-day-number {
    background: var(--primary);
    color: var(--color-white) !important;
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-daygrid-event {
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.fc-daygrid-event:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.bg-holiday {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.08)) !important;
    border-left: 3px solid var(--success) !important;
    color: var(--color-emerald-800) !important;
    font-weight: 600;
}

/* ══════════════════════════════════════════════
   SWEETALERT2 OVERRIDES
   ══════════════════════════════════════════════ */
.swal2-popup {
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-xl) !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-title {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    color: var(--text-primary) !important;
}

.swal2-html-container {
    font-size: 0.875rem !important;
    color: var(--text-secondary) !important;
}

.swal2-confirm {
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    padding: 0.5rem 1.5rem !important;
    font-size: 0.875rem !important;
}

.swal2-cancel {
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    padding: 0.5rem 1.5rem !important;
    font-size: 0.875rem !important;
}

/* ══════════════════════════════════════════════
   LOGIN / AUTH PAGES
   ══════════════════════════════════════════════ */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-dark-700) 0%, var(--color-dark-800) 50%, var(--color-dark-700) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: authFloat 8s ease-in-out infinite;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
    animation: authFloat 10s ease-in-out infinite reverse;
}

@keyframes authFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 15px) scale(0.95);
    }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-white-95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-white-20);
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 60px var(--color-black-30);
    padding: 2.5rem;
    position: relative;
    z-index: 10;
    animation: authCardIn 0.6s ease-out;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-logo {
    width: 180px;
    height: 80px;
    /* background: linear-gradient(135deg, var(--color-indigo-500), var(--color-violet-500));
    border-radius: var(--radius-xl); */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
    /* box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3); */
}

.auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.375rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* ══════════════════════════════════════════════
   WELCOME BANNER
   ══════════════════════════════════════════════ */
.welcome-banner {
    background: linear-gradient(135deg, var(--color-indigo-500), var(--color-indigo-600), var(--color-violet-600));
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    color: var(--color-white);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: var(--color-white-5);
    border-radius: 50%;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 200px;
    height: 200px;
    background: var(--color-white-3);
    border-radius: 50%;
}

.welcome-banner h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-white);
    margin-bottom: 0.375rem;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    opacity: 0.85;
    font-size: 0.875rem;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.page-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ══════════════════════════════════════════════
   SPINNER / LOADING
   ══════════════════════════════════════════════ */
.spinner-border {
    border-width: 0.2em;
}

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
}

.loading-overlay .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary);
}

/* Premium skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, #e8edf2 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

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

    100% {
        background-position: -200% 0;
    }
}

/* ══════════════════════════════════════════════
   TOOLTIP / POPOVER
   ══════════════════════════════════════════════ */
.tooltip-inner {
    background: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* ══════════════════════════════════════════════
   PAGINATION (Bootstrap)
   ══════════════════════════════════════════════ */
.page-link {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    margin: 0 2px;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ══════════════════════════════════════════════
   ANIMATIONS & UTILITIES
   ══════════════════════════════════════════════ */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated Counter */
.counter-value {
    display: inline-block;
}

/* Hover lift */
.hover-lift {
    transition: all var(--transition-normal);
}

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

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, var(--color-indigo-500), var(--color-violet-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-dot.offline {
    background: var(--text-muted);
}

/* ══════════════════════════════════════════════
   RESPONSIVE — COMPREHENSIVE OVERHAUL
   ══════════════════════════════════════════════ */

/* ── Offcanvas Responsive Utility ── */
.offcanvas-responsive {
    width: 520px;
    max-width: 100vw;
}

/* ── Large screens (≤1199px) ── */
@media (max-width: 1199.98px) {
    .offcanvas-responsive {
        width: 480px;
    }
}

/* ── Tablets / Small laptops (≤991px) ── */
@media (max-width: 991.98px) {
    .sidebar {
        border-right: none;
        z-index: 1045;
    }

    .top-navbar {
        padding: 0.5rem 1rem;
    }

    /* Non-sidebar offcanvas goes full-width below lg */
    .offcanvas:not(.sidebar) {
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .offcanvas-responsive {
        width: 100% !important;
    }

    .offcanvas-header:not(.sidebar .offcanvas-header) {
        padding: 1.25rem 1.5rem;
    }

    .offcanvas-body:not(.sidebar .offcanvas-body) {
        padding: 1.5rem;
        overflow-x: hidden !important;
    }

    /* Page header stacks on tablet */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-header > div {
        width: 100%;
    }

    /* Header action buttons scroll horizontally */
    .page-header .d-flex.gap-2,
    .page-header .d-flex.align-items-center {
        flex-wrap: wrap;
    }

    /* Card padding adjustments */
    .card-body {
        padding: 1.25rem;
    }

    .card-header {
        padding: 1rem 1.25rem;
    }

    /* Calendar toolbar stacks */
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    /* DataTables filter and length controls */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
        float: none !important;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        min-width: 100% !important;
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin-top: 0.5rem;
    }

    /* Nav tabs become scrollable */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    /* Modal fullscreen on tablets */
    .modal-dialog.modal-xl,
    .modal-dialog.modal-lg {
        max-width: 100%;
        margin: 0.5rem;
    }

    .modal-content {
        max-height: 95vh;
    }

    /* Forms inside modals — stack columns */
    .modal .row [class*="col-md-"],
    .modal .row [class*="col-lg-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Mobile landscape / Small tablets (≤767px) ── */
@media (max-width: 767.98px) {
    /* Stat cards */
    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Welcome banner */
    .welcome-banner {
        padding: 1.25rem 1.5rem;
    }

    .welcome-banner h2 {
        font-size: 1.25rem;
    }

    .welcome-banner p {
        font-size: 0.8rem;
    }

    /* Auth card */
    .auth-card {
        padding: 1.75rem;
    }

    /* Container padding reduction */
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Table font sizes */
    .table {
        font-size: 0.8rem;
    }

    .table thead th {
        font-size: 0.65rem;
        padding: 0.625rem 0.5rem;
    }

    .table tbody td {
        padding: 0.625rem 0.5rem;
    }

    /* Card body + header tighter */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
    }

    .offcanvas-body:not(.sidebar .offcanvas-body) {
        padding: 1.25rem;
        overflow-x: hidden !important;
    }

    .offcanvas-header:not(.sidebar .offcanvas-header) {
        padding: 1rem 1.25rem;
    }

    /* Buttons slightly smaller */
    .btn {
        font-size: 0.8125rem;
        padding: 0.4rem 0.875rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.3rem 0.625rem;
    }

    /* Form improvements for mobile */
    .form-control,
    .form-select {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    /* Forms inside offcanvas - ensure full-width columns */
    .offcanvas .row .col-md-4,
    .offcanvas .row .col-md-6,
    .offcanvas .row .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Calendar compact on mobile */
    .fc-toolbar-title {
        font-size: 1rem !important;
    }

    .fc-button-primary {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    .fc-daygrid-day-number {
        font-size: 0.7rem;
        padding: 0.25rem !important;
    }

    .fc-daygrid-event {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }

    .fc-col-header-cell {
        font-size: 0.6rem;
        padding: 0.5rem 0 !important;
    }

    /* SweetAlert responsive */
    .swal2-popup {
        width: 90vw !important;
        max-width: 90vw !important;
        padding: 1.25rem !important;
        font-size: 0.8125rem !important;
    }

    .swal2-title {
        font-size: 1.1rem !important;
    }

    .premium-swal-popup {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    /* Pagination compact */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    /* Dropdown menus */
    .dropdown-menu {
        font-size: 0.8125rem;
    }

    .dropdown-menu-mobile {
        width: 280px !important;
        max-width: 90vw !important;
    }

    /* Page title */
    .page-header h1 {
        font-size: 1.125rem;
    }

    /* Badges */
    .badge {
        font-size: 0.6rem;
        padding: 0.25em 0.5em;
    }

    /* Invoice / show pages responsive */
    .invoice-header,
    .invoice-details {
        flex-direction: column;
        gap: 1rem;
    }

    /* Modal responsive — fullscreen-like on mobile */
    .modal-dialog.modal-xl,
    .modal-dialog.modal-lg {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    .modal-content {
        max-height: 92vh;
    }

    .modal-body {
        padding: 1rem !important;
    }

    /* Forms inside modals — stack columns */
    .modal .row [class*="col-md-"],
    .modal .row [class*="col-lg-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Invoice show — stack columns */
    .invoice-show .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Flex-wrap helper for d-flex rows */
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Card header flex wrap */
    .card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ── Small mobile phones (≤575px) ── */
@media (max-width: 575.98px) {
    /* Ultra-compact stat cards */
    .stat-value {
        font-size: 1.25rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    /* Stack header action buttons vertically */
    .page-header .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }

    .page-header .d-flex.gap-2 .btn {
        width: 100%;
        justify-content: center;
    }

    /* Welcome banner ultra-compact */
    .welcome-banner {
        padding: 1rem 1.25rem;
        margin-bottom: 1rem;
    }

    .welcome-banner h2 {
        font-size: 1.1rem;
    }

    /* Container ultra-tight */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Card margins */
    .card.premium-card,
    .premium-card {
        margin-bottom: 0.75rem !important;
    }

    .card-body {
        padding: 0.875rem;
    }

    /* Offcanvas super tight (exclude sidebar) */
    .offcanvas-body:not(.sidebar .offcanvas-body) {
        padding: 1rem;
        overflow-x: hidden !important;
    }

    .offcanvas-header:not(.sidebar .offcanvas-header) {
        padding: 0.875rem 1rem;
    }

    .offcanvas-title {
        font-size: 0.9375rem;
    }

    /* Table ultra compact */
    .table {
        font-size: 0.75rem;
    }

    .table thead th {
        font-size: 0.6rem;
        padding: 0.5rem 0.375rem;
    }

    .table tbody td {
        padding: 0.5rem 0.375rem;
    }

    /* Forms in offcanvas - stack everything */
    .offcanvas .col-6,
    .offcanvas .col-4,
    .offcanvas .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Form section headers */
    .form-section-header h5 {
        font-size: 0.8125rem;
    }

    .form-section-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }

    /* Calendar ultra compact */
    .fc .fc-toolbar {
        gap: 0.5rem;
    }

    .fc-toolbar-title {
        font-size: 0.875rem !important;
    }

    .fc-button-primary {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.375rem !important;
    }

    .fc-daygrid-event {
        font-size: 0.55rem;
    }

    /* Calendar min-height reduction on mobile */
    #calendar {
        min-height: 400px !important;
    }

    /* Sidebar brand on mobile */
    .sidebar-brand {
        padding: 1rem 1.25rem;
    }

    .sidebar-brand-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .sidebar-brand-text {
        font-size: 1.1rem;
    }

    /* Navbar compact */
    .navbar-search .input-group {
        max-width: 200px;
    }

    .navbar-icon-btn {
        width: 34px;
        height: 34px;
    }

    .navbar-avatar {
        width: 32px;
        height: 32px;
    }

    /* Nav tabs tight */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .nav-tabs .nav-link i {
        font-size: 0.8rem;
    }

    /* Login page */
    .auth-card {
        padding: 1.5rem;
    }

    .auth-logo {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .auth-title {
        font-size: 1.25rem;
    }

    /* Alert compact */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    /* DataTables info + pagination stack */
    .dataTables_wrapper .dataTables_info {
        font-size: 0.7rem;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.2rem 0.375rem !important;
        margin: 0 1px !important;
        font-size: 0.65rem !important;
    }

    /* Loading overlay in tighter spaces */
    .loading-overlay {
        padding: 2rem;
    }

    .loading-overlay .spinner-border {
        width: 2rem;
        height: 2rem;
    }
}

/* ── Touch devices — larger tap targets ── */
@media (hover: none) and (pointer: coarse) {
    .btn-sm {
        min-height: 38px;
        padding: 0.375rem 0.75rem;
    }

    .nav-tabs .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-control,
    .form-select {
        min-height: 42px;
    }

    .dropdown-item {
        padding: 0.625rem 1rem;
    }

    .table tbody td {
        padding: 0.75rem 0.5rem;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-height: 36px !important;
        min-width: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ── Ensure form rows in offcanvas stack properly ── */
@media (max-width: 767.98px) {
    .offcanvas .row.g-3 > [class*="col-md-"],
    .offcanvas .row.g-4 > [class*="col-md-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Helper: hide text on small screens, keep icon ── */
@media (max-width: 575.98px) {
    .btn-hide-text-xs span,
    .btn-hide-text-xs .btn-text {
        display: none;
    }
}

/* ══════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════ */
@media print {

    .sidebar,
    .top-navbar,
    .btn,
    .offcanvas {
        display: none !important;
    }

    body {
        background: var(--color-white);
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}