/* ===== CARDX DESIGN SYSTEM ===== */
:root {
    --sidebar-width: 280px;
    
    /* CARDX Color Palette - Based on screenshot */
    --cardx-purple: #6b46c1;
    --cardx-purple-dark: #553c9a;
    --cardx-green: #10b981;
    --cardx-green-light: #34d399;
    --cardx-blue: #3b82f6;
    --cardx-blue-light: #60a5fa;
    --cardx-orange: #f59e0b;
    --cardx-orange-light: #fbbf24;
    --cardx-red: #ef4444;
    --cardx-gray-50: #f9fafb;
    --cardx-gray-100: #f3f4f6;
    --cardx-gray-200: #e5e7eb;
    --cardx-gray-300: #d1d5db;
    --cardx-gray-400: #9ca3af;
    --cardx-gray-500: #6b7280;
    --cardx-gray-600: #4b5563;
    --cardx-gray-700: #374151;
    --cardx-gray-800: #1f2937;
    --cardx-gray-900: #111827;
    
    /* CARDX Shadows */
    --cardx-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --cardx-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cardx-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --cardx-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* CARDX Transitions */
    --cardx-transition: all 0.2s ease-in-out;
}

/* ===== GLOBAL STYLES ===== */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--cardx-gray-50);
    color: var(--cardx-gray-700);
    overflow-x: hidden;
    position: relative;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 0;
}

/* Remove cosmic background animation */
body::before {
    display: none;
}

/* ===== LAYOUT ===== */
#wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px);
    position: relative;
    overflow: hidden;
}

/* ===== CARDX HEADER NAVIGATION ===== */
.cardx-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--cardx-purple);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1001;
    box-shadow: var(--cardx-shadow-md);
}

.cardx-header .logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

.cardx-header .logo:hover {
    color: white;
}

.cardx-header .logo img {
    height: 32px;
    margin-left: 12px;
}

.cardx-header .header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cardx-header .search-box {
    position: relative;
    width: 320px;
}

.cardx-header .search-box input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: var(--cardx-transition);
}

.cardx-header .search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.cardx-header .search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

.cardx-header .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

.cardx-header .user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.cardx-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--cardx-transition);
}

.cardx-header .user-avatar:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cardx-header .dropdown-menu {
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    box-shadow: var(--cardx-shadow-lg);
    min-width: 200px;
    direction: rtl;
    text-align: right;
}

.cardx-header .dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--cardx-gray-700);
    transition: var(--cardx-transition);
}

.cardx-header .dropdown-item:hover {
    background: var(--cardx-gray-50);
    color: var(--cardx-gray-900);
}

.cardx-header .notification-badge {
    position: relative;
    color: white;
    font-size: 18px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 50%;
    transition: var(--cardx-transition);
}

.cardx-header .notification-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cardx-header .notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--cardx-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cardx-header #notificationsDropdown {
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    box-shadow: var(--cardx-shadow-lg);
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    direction: rtl;
    text-align: right;
}

.cardx-header #notificationsDropdown .dropdown-header {
    font-weight: 600;
    color: var(--cardx-gray-700);
    font-size: 14px;
    padding: 12px 16px 8px;
}

.cardx-header #notificationsDropdown .dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--cardx-gray-600);
    border-bottom: 1px solid var(--cardx-gray-100);
}

.cardx-header #notificationsDropdown .dropdown-item:hover {
    background: var(--cardx-gray-50);
    color: var(--cardx-gray-900);
}

.cardx-header #notificationsDropdown .dropdown-item:last-child {
    border-bottom: none;
}

.notification-item {
    cursor: pointer;
    transition: var(--cardx-transition);
}

.notification-item.unread {
    background: #f0f9ff;
    border-right: 3px solid var(--cardx-blue);
}

.notification-item:hover {
    background: var(--cardx-gray-50);
}

/* ===== SIDEBAR MODERN DESIGN ===== */
#sidebar-wrapper {
    position: fixed !important;
    top: 64px !important;
    right: 0 !important;
    width: var(--sidebar-width) !important;
    height: calc(100vh - 64px) !important;
    background: white !important;
    border-left: 1px solid var(--cardx-gray-200);
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: var(--cardx-shadow-lg);
    overflow: hidden !important;
    transform: none !important;
    transition: none !important;
    margin: 0 !important;
    left: auto !important;
}

#sidebar-wrapper::before {
    display: none;
}

#sidebar-wrapper .sidebar-heading {
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--cardx-gray-200);
    position: relative;
    z-index: 2;
    color: var(--cardx-gray-700);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right;
    direction: rtl;
}

#sidebar-wrapper .list-group {
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 2;
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    background: transparent;
    color: var(--cardx-gray-600);
    transition: var(--cardx-transition);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    text-align: right;
    direction: rtl;
}

#sidebar-wrapper .list-group-item::before {
    display: none;
}

#sidebar-wrapper .list-group-item:hover {
    color: var(--cardx-gray-900) !important;
    background: var(--cardx-gray-50) !important;
    transform: none;
    box-shadow: none;
}

#sidebar-wrapper .list-group-item.active {
    background: var(--cardx-purple);
    color: white;
    box-shadow: none;
}

#sidebar-wrapper .list-group-item i {
    margin-right: 12px;
    margin-left: 0;
    transition: var(--cardx-transition);
    width: 16px;
    text-align: center;
}

#sidebar-wrapper .list-group-item:hover i {
    transform: none;
}

/* ===== MAIN CONTENT AREA ===== */
#page-content-wrapper {
    margin-right: var(--sidebar-width) !important;
    margin-top: 64px !important;
    width: calc(100% - var(--sidebar-width)) !important;
    min-width: 0 !important;
    flex: 1 !important;
    position: relative !important;
    min-height: calc(100vh - 64px) !important;
    max-width: calc(100% - var(--sidebar-width)) !important;
    overflow-x: hidden !important;
    padding: 24px 24px 50px 24px;
}

/* ===== CARDX DASHBOARD CARDS ===== */
.cardx-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--cardx-shadow-sm);
    border: 1px solid var(--cardx-gray-200);
    transition: var(--cardx-transition);
    position: relative;
    overflow: hidden;
}

.cardx-stat-card:hover {
    box-shadow: var(--cardx-shadow-md);
    transform: translateY(-2px);
}

.cardx-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    margin-bottom: 16px;
}

.cardx-stat-card .stat-icon.green {
    background: var(--cardx-green);
}

.cardx-stat-card .stat-icon.blue {
    background: var(--cardx-blue);
}

.cardx-stat-card .stat-icon.orange {
    background: var(--cardx-orange);
}

.cardx-stat-card .stat-icon.red {
    background: var(--cardx-red);
}

.cardx-stat-card .stat-icon.purple {
    background: var(--cardx-purple);
}

.cardx-stat-card .stat-icon.teal {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

.cardx-stat-card .stat-icon.info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.cardx-stat-card .stat-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.cardx-stat-card .stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.cardx-stat-card .stat-title {
    font-size: 14px;
    color: var(--cardx-gray-500);
    font-weight: 500;
    margin-bottom: 8px;
}

.cardx-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--cardx-gray-900);
    line-height: 1;
}

/* ===== CARDX CHART CARD ===== */
.cardx-chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--cardx-shadow-sm);
    border: 1px solid var(--cardx-gray-200);
    margin-top: 24px;
}

.cardx-chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--cardx-gray-900);
    margin-bottom: 16px;
}

.cardx-chart-area {
    height: 300px;
    background: linear-gradient(135deg, var(--cardx-green) 0%, var(--cardx-green-light) 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* ===== CARDX CREDIT CARD ===== */
.cardx-credit-card {
    background: linear-gradient(135deg, var(--cardx-gray-800) 0%, var(--cardx-gray-900) 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.cardx-credit-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.cardx-credit-card .card-type {
    position: absolute;
    top: 24px;
    left: 24px;
    font-size: 20px;
}

.cardx-credit-card .card-brand {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 24px;
    font-weight: 700;
}

.cardx-credit-card .card-chip {
    width: 32px;
    height: 24px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 4px;
    margin: 40px 0 20px 0;
}

.cardx-credit-card .card-number {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.cardx-credit-card .card-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    transition: var(--cardx-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn::before {
    display: none;
}

.btn:hover::before {
    display: none;
}

.btn-primary {
    background: var(--cardx-purple);
    color: white;
}

.btn-primary:hover {
    background: var(--cardx-purple-dark);
    color: white;
}

.btn-success {
    background: var(--cardx-green);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: var(--cardx-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-warning {
    background: var(--cardx-orange);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    color: white;
}

.btn-info {
    background: var(--cardx-blue);
    color: white;
}

.btn-info:hover {
    background: #2563eb;
    color: white;
}

.btn-secondary {
    background: var(--cardx-gray-500);
    color: white;
}

.btn-secondary:hover {
    background: var(--cardx-gray-600);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--cardx-purple);
    border: 1px solid var(--cardx-purple);
}

.btn-outline-primary:hover {
    background: var(--cardx-purple);
    color: white;
}

/* ===== FORMS ===== */
.form-control {
    border: 1px solid var(--cardx-gray-300);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: var(--cardx-transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--cardx-purple);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--cardx-gray-700);
    margin-bottom: 8px;
}

.form-select {
    border: 1px solid var(--cardx-gray-300);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: var(--cardx-transition);
    background: white;
}

.form-select:focus {
    outline: none;
    border-color: var(--cardx-purple);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

/* ===== TABLES ===== */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--cardx-shadow-md);
    border: none;
    margin-bottom: 0;
}

.table th {
    background: linear-gradient(135deg, var(--cardx-purple) 0%, var(--cardx-purple-dark) 100%);
    border: none;
    font-weight: 600;
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px 16px;
    position: relative;
}

.table th:first-child {
    border-top-right-radius: 12px;
}

.table th:last-child {
    border-top-left-radius: 12px;
}

.table td {
    border: none;
    border-bottom: 1px solid var(--cardx-gray-100);
    padding: 16px;
    color: var(--cardx-gray-700);
    font-weight: 500;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:last-child td:first-child {
    border-bottom-right-radius: 12px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-left-radius: 12px;
}

/* Table responsive wrapper */
.table-responsive {
    border-radius: 12px;
    box-shadow: var(--cardx-shadow-md);
    overflow: hidden;
    background: white;
}

/* Table action buttons */
.table .btn {
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.table .btn-outline-danger {
    color: var(--cardx-red);
    border-color: var(--cardx-red);
    background: rgba(239, 68, 68, 0.1);
}

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

.table .btn-outline-primary {
    color: var(--cardx-purple);
    border-color: var(--cardx-purple);
    background: rgba(107, 70, 193, 0.1);
}

.table .btn-outline-primary:hover {
    background: var(--cardx-purple);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.table .btn-outline-success {
    color: var(--cardx-green);
    border-color: var(--cardx-green);
    background: rgba(16, 185, 129, 0.1);
}

.table .btn-outline-success:hover {
    background: var(--cardx-green);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Table badges */
.table .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Table checkboxes */
.table .form-check-input {
    border-radius: 4px;
    border: 2px solid var(--cardx-gray-300);
    width: 18px;
    height: 18px;
}

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

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    font-weight: 500;
}

.alert::before {
    display: none;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border: 1px solid var(--cardx-gray-200);
    border-radius: 12px;
    box-shadow: var(--cardx-shadow-sm);
    transition: var(--cardx-transition);
}

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

.card::before {
    display: none;
}

.card:hover::before {
    display: none;
}

/* Remove cosmic animations */
@keyframes fadeInUp {
    from { opacity: 0; }
    to { opacity: 0; }
}
@keyframes slideInRight {
    from { opacity: 0; }
    to { opacity: 0; }
}
@keyframes pulse {
    from { opacity: 0; }
    to { opacity: 0; }
}

.animate-fade-in-up { animation: none; }
.animate-slide-in-right { animation: none; }
.animate-pulse { animation: none; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Hide desktop sidebar completely on mobile */
    #sidebar-wrapper {
        display: none !important;
    }
    
    /* Full width content on mobile */
    #page-content-wrapper {
        margin-right: 0 !important;
        width: 100% !important;
        margin-top: 64px !important;
        padding: 16px 16px 50px 16px;
    }
    
    .cardx-header {
        position: fixed;
        z-index: 1002;
    }
    

    
    /* Mobile dashboard improvements */
    .cardx-stat-card {
        padding: 1rem !important;
        margin-bottom: 1rem;
        border-radius: 15px;
    }
    
    .cardx-stat-card h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.5rem;
    }
    
    .cardx-stat-card .stat-value {
        font-size: 2rem !important;
    }
    
    /* Better button sizing for mobile */
    .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
        border-radius: 10px;
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Make action buttons full width on mobile */
    .btn:not(.btn-sm):not(.dropdown-toggle) {
        width: 100%;
    }
    
    /* Table improvements for mobile */
    .table-responsive {
        border: none;
        border-radius: 10px;
        overflow-x: auto;
    }
    
    .table {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
        white-space: nowrap;
    }
    
    /* Form improvements for mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    .form-select {
        font-size: 16px;
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Modal improvements for mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    /* Container padding adjustments */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Navbar improvements */
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .navbar .dropdown-toggle {
        font-size: 0.9rem;
    }
    
    .navbar .dropdown-menu {
        border-radius: 10px;
        box-shadow: var(--cardx-shadow-lg);
    }
    
    /* Alert improvements */
    .alert {
        margin-bottom: 1rem;
        border-radius: 10px;
        padding: 1rem;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 1rem;
        border-radius: 15px;
        border: none;
        box-shadow: var(--cardx-shadow-md);
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Text size adjustments */
    h1, .h1 { font-size: 1.8rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.3rem; }
    h4, .h4 { font-size: 1.1rem; }
    
    /* User dropdown improvements */
    .navbar-nav .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 200px;
        border-radius: 10px;
    }
    
    /* Mobile-specific cosmic effects */
    .cosmic-particles {
        opacity: 0.3; /* Reduce particles on mobile for better performance */
    }
    
    /* Improve touch targets */
    .list-group-item {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Better spacing for mobile */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > .col,
    .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-bottom: 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    :root {
        --sidebar-width: 250px;
    }
    
    #sidebar-wrapper {
        width: var(--sidebar-width);
    }
    
    #page-content-wrapper {
        margin-right: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
    
    .cardx-stat-card {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
    }
    
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Small mobile devices (max-width: 576px) */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .cardx-stat-card {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem;
    }
    
    .cardx-stat-card h3 {
        font-size: 1.5rem !important;
    }
    
    .cardx-stat-card .stat-value {
        font-size: 2rem !important;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
    }
    
    .form-control,
    .form-select {
        padding: 0.625rem;
        font-size: 16px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .alert {
        padding: 0.75rem;
    }
    
    .navbar {
        padding: 0.5rem 0.75rem;
    }
    
    /* Very small screen text adjustments */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.3rem; }
    h3, .h3 { font-size: 1.1rem; }
    h4, .h4 { font-size: 1rem; }
}

/* ===== MOBILE-SPECIFIC ENHANCEMENTS ===== */
@media (max-width: 768px) {
    /* Statistics cards mobile optimization */
    .row.mb-5 .col-xl-3,
    .row.mb-5 .col-md-6 {
        margin-bottom: 1rem !important;
    }
    
    .card.card-teal,
    .card.card-blue,
    .card.card-dark-blue,
    .card.card-warning {
        padding: 0.75rem !important;
    }
    
    .card-body .h3 {
        font-size: 1.5rem !important;
    }
    
    .card-body .text-xs {
        font-size: 0.75rem !important;
    }
    
    .card-body .small {
        font-size: 0.7rem !important;
    }
    
    /* Quick actions mobile optimization */
    .col-md-3,
    .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .btn.w-100.h-100 {
        padding: 1rem !important;
        min-height: 120px;
    }
    
    .btn.w-100.h-100 i {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .btn.w-100.h-100 .fw-bold {
        font-size: 0.9rem;
    }
    
    .btn.w-100.h-100 small {
        font-size: 0.7rem;
    }
    
    /* Mobile time display improvements */
    .cosmic-time-display {
        text-align: center !important;
        margin-top: 1rem;
    }
    
    .cosmic-time-display .h4 {
        font-size: 1.2rem !important;
    }
    
    /* Mobile dashboard header improvements */
    .cardx-stat-card .row.align-items-center .col-md-8,
    .cardx-stat-card .row.align-items-center .col-md-4 {
        text-align: center;
    }
    
    .cardx-stat-card .col-md-4 {
        margin-top: 1rem;
    }
    
    /* Mobile icon wrapper improvements */
    .cosmic-icon-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile glow effects */
    .cosmic-card-glow {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
        opacity: 0;
        transition: var(--cosmic-transition);
    }
    
    .card:hover .cosmic-card-glow {
        opacity: 1;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        max-height: 400px;
        overflow-y: auto;
    }
    
    /* Mobile form improvements */
    .subscriber-form .form-control {
        margin-bottom: 1rem;
    }
    
    /* Mobile button groups */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        border-radius: 10px !important;
    }
    
    /* Mobile dropdown improvements */
    .dropdown-menu {
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Mobile textarea improvements */
    textarea.form-control {
        min-height: 120px;
        resize: vertical;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Improve touch targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
        padding: 0.75rem;
    }
    
    .list-group-item {
        min-height: 48px;
        padding: 1rem;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: var(--cardx-shadow-md);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .cardx-stat-card:hover {
        transform: none;
    }
}

/* Touch device specific styles */
.touch-device .card:hover,
.touch-device .btn:hover,
.touch-device .cardx-stat-card:hover {
    transform: none !important;
}

.touch-device .cosmic-particles {
    display: none; /* Hide particles on touch devices for better performance */
}

/* PWA-like enhancements */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Mobile animations */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes mobileShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Mobile utility classes */
.mobile-device .text-mobile-center {
    text-align: center !important;
}

.mobile-device .mb-mobile-3 {
    margin-bottom: 1rem !important;
}

.mobile-device .p-mobile-2 {
    padding: 0.5rem !important;
}

/* Mobile card enhancements */
.mobile-device .card {
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.mobile-device .card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

/* Mobile form enhancements */
.mobile-device .form-floating > label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.mobile-device .form-floating > .form-control:focus ~ label,
.mobile-device .form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 1;
    color: #667eea;
}

/* Mobile alert improvements */
.mobile-notification {
    animation: slideInDown 0.3s ease;
    margin-bottom: 1rem;
}

.mobile-notification.alert-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    color: black;
}

.mobile-notification.alert-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border: none;
    color: black;
}

.mobile-notification.alert-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
    color: black;
}

/* Mobile loading states */
.mobile-device .btn.loading {
    position: relative;
    color: transparent !important;
}

.mobile-device .btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* Improved mobile focus states */
.mobile-device .form-control:focus,
.mobile-device .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Mobile-specific scrollbar (for webkit browsers) */
.mobile-device ::-webkit-scrollbar {
    width: 4px;
}

.mobile-device ::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 2px;
}

/* Safe area handling for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    .mobile-device body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .mobile-device .navbar {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }
    
    .mobile-device .mobile-indicator {
        bottom: calc(20px + env(safe-area-inset-bottom));
        left: calc(20px + env(safe-area-inset-left));
    }
}

/* ===== COSMIC SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--cosmic-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cosmic-secondary);
}

/* ===== COSMIC LOADING SPINNER ===== */
.cosmic-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== COSMIC UTILITIES ===== */
.cosmic-gradient-text {
    background: var(--cosmic-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cosmic-shadow {
    box-shadow: var(--cosmic-shadow-lg);
}

.cosmic-border {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cosmic-blur {
    backdrop-filter: blur(20px);
}

/* ===== LEGACY COMPATIBILITY ===== */
.bg-dark-blue {
    background: var(--cosmic-dark) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.container-fluid.py-4 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* ===== FORM ENHANCEMENTS ===== */
.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* ===== COSMIC BADGES ===== */
.badge {
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.7rem;
}

.badge-primary {
    background: var(--cosmic-primary);
}

.badge-success {
    background: var(--cosmic-green);
}

.badge-danger {
    background: var(--cosmic-pink);
}

.badge-warning {
    background: var(--cosmic-orange);
}

.badge-info {
    background: var(--cosmic-blue);
}

/* ===== COSMIC ENHANCEMENTS ===== */
.card-orange {
    background: var(--cosmic-orange);
    color: #000;
}

/* Cosmic Floating Particles */
.cosmic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.cosmic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.cosmic-particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.cosmic-particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.cosmic-particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.cosmic-particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.cosmic-particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.cosmic-particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.cosmic-particle:nth-child(7) { left: 70%; animation-delay: 0.5s; }
.cosmic-particle:nth-child(8) { left: 80%; animation-delay: 1.5s; }
.cosmic-particle:nth-child(9) { left: 90%; animation-delay: 2.5s; }

@keyframes float {
    0%, 100% { 
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }
}

/* Cosmic Hover Effects */
.cosmic-hover-lift {
    transition: var(--cosmic-transition);
}

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

/* Cosmic Text Effects */
.cosmic-text-glow {
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.cosmic-text-shimmer {
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

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

/* Cosmic Progress Bars */
.cosmic-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.cosmic-progress-bar {
    height: 100%;
    background: var(--cosmic-primary);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.cosmic-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Cosmic Modal Enhancements */
.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: var(--cosmic-shadow-xl);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--cosmic-primary);
    color: #000;
    border-radius: 20px 20px 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 20px 20px;
}

/* Cosmic Tooltips */
.cosmic-tooltip {
    position: relative;
    cursor: help;
}

.cosmic-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #000;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--cosmic-transition);
    z-index: 1000;
}

.cosmic-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Cosmic Loading States */
.cosmic-loading {
    position: relative;
    overflow: hidden;
}

.cosmic-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Cosmic Status Indicators */
.cosmic-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cosmic-status-online {
    background: rgba(67, 233, 123, 0.1);
    color: #22543d;
    border: 1px solid rgba(67, 233, 123, 0.3);
}

.cosmic-status-offline {
    background: rgba(240, 147, 251, 0.1);
    color: #742a2a;
    border: 1px solid rgba(240, 147, 251, 0.3);
}

.cosmic-status-pending {
    background: rgba(250, 112, 154, 0.1);
    color: #744210;
    border: 1px solid rgba(250, 112, 154, 0.3);
}

/* Cosmic Breadcrumbs */
.cosmic-breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px 20px;
    margin-bottom: 20px;
}

.cosmic-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: var(--cosmic-transition);
}

.cosmic-breadcrumb a:hover {
    color: #764ba2;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

/* Cosmic Dividers */
.cosmic-divider {
    height: 2px;
    background: var(--cosmic-primary);
    border: none;
    border-radius: 2px;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.cosmic-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: dividerShine 3s infinite;
}

@keyframes dividerShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Adjustments for the main content area */
.container-fluid.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* Card styles for dashboard elements */
.cardx-stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0.15rem 1.75rem rgba(0, 0, 0, 0.05);
}

.cardx-stat-card h3 {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.cardx-stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: #343a40;
}

/* Specific card colors as seen in the image */
.card-teal {
    background: linear-gradient(45deg, #009688, #4DB6AC);
}

.card-blue {
    background: linear-gradient(45deg, #1976D2, #42A5F5);
}

.card-light-blue {
    background: linear-gradient(45deg, #03A9F4, #4FC3F7);
}

.card-dark-blue {
    background: linear-gradient(45deg, #312f30, #4a4a4a);
}

/* Form and table styles */
.subscriber-form, .users-list, .change-password-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    color: #212529;
}

#emailsText {
    width: 100%;
    min-height: 100px;
    margin-bottom: 10px;
    color: #212529;
}

.delete-btn, .edit-btn {
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
}
.edit-btn {
    color: #0d6efd;
}
.delete-btn:hover {
    color: #c82333;
}
.edit-btn:hover {
    color: #0a58ca;
}

/* Top navigation bar text color */
.navbar-nav .nav-link {
    color: #212529 !important; /* Ensure dark text for nav links */
}

.navbar-nav .nav-link:hover {
    color: #000 !important; /* Even darker on hover */
}

.navbar-nav .dropdown-item {
    color: #212529 !important; /* Ensure dark text for dropdown items */
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa; /* Lighter background on hover */
    color: #000 !important; /* Even darker on hover */
}

/* Custom styles */
.sidebar-heading {
    padding: 15px;
    background-color: #312f30;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.list-group-item-action:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #000 !important;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    #sidebar-wrapper {
        position: fixed !important;
        right: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        width: var(--sidebar-width) !important;
        z-index: 1000 !important;
        display: flex !important;
        transform: none !important;
    }

    #page-content-wrapper {
        margin-right: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
        min-width: 0;
    }

    #wrapper.toggled #sidebar-wrapper {
        transform: translateX(100%);
    }
}

/* Table styles */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
}

/* Form styles */
.form-control:focus {
    border-color: #312f30;
    box-shadow: 0 0 0 0.2rem rgba(49, 47, 48, 0.25);
}

.btn-primary {
    background-color: #312f30;
    border-color: #312f30;
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #242223;
    border-color: #242223;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn {
    border-radius: 20px;
    padding: 6px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    border-radius: 15px;
    padding: 4px 12px;
}

.btn-success {
    border-radius: 20px;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    border-radius: 20px;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-secondary {
    border-radius: 20px;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Force sidebar to stay in place - Override any other styles */
#sidebar-wrapper {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transform: translateX(0) !important;
    transition: none !important;
    margin: 0 !important;
    left: auto !important;
}

/* Force main content to respect sidebar */
#page-content-wrapper {
    margin-right: 280px !important;
    width: calc(100% - 280px) !important;
    max-width: calc(100% - 280px) !important;
    position: relative !important;
    overflow-x: hidden !important;
}

/* Ensure wrapper doesn't cause issues */
#wrapper {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 100vh !important;
}

/* Modern Table Styles */
.modern-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 20px;
}

.modern-table thead {
    background: linear-gradient(135deg, #6b46c1 0%, #8b5cf6 100%);
}

.modern-table thead th {
    background: transparent;
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    border: none;
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.modern-table thead th:first-child {
    border-top-right-radius: 12px;
}

.modern-table thead th:last-child {
    border-top-left-radius: 12px;
}

.modern-table tbody tr {
    transition: all 0.3s ease;
    border: none;
}

.modern-table tbody tr:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-table tbody td {
    padding: 12px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    text-align: center;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.modern-table .btn {
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 2px;
}

.modern-table .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modern-table .btn-outline-primary {
    border-color: #6b46c1;
    color: #6b46c1;
}

.modern-table .btn-outline-primary:hover {
    background-color: #6b46c1;
    border-color: #6b46c1;
    color: white;
}

.modern-table .btn-outline-success {
    border-color: #10b981;
    color: #10b981;
}

.modern-table .btn-outline-success:hover {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.modern-table .btn-outline-warning {
    border-color: #f59e0b;
    color: #f59e0b;
}

.modern-table .btn-outline-warning:hover {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.modern-table .btn-outline-danger {
    border-color: #ef4444;
    color: #ef4444;
}

.modern-table .btn-outline-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
}

.modern-table .badge {
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
}

.modern-table .form-check-input {
    border-radius: 4px;
    border: 2px solid #d1d5db;
    transition: all 0.3s ease;
}

.modern-table .form-check-input:checked {
    background-color: #6b46c1;
    border-color: #6b46c1;
}

.modern-table .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
    border-color: #6b46c1;
}

/* Responsive adjustments for modern tables */
@media (max-width: 768px) {
    .modern-table {
        border-radius: 8px;
        font-size: 12px;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 8px 6px;
    }
    
    .modern-table .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* ClickSend Logo Styling */
.clicksend-logo {
    background: linear-gradient(135deg, #6b46c1 0%, #8b5cf6 50%, #a855f7 100%);
    color: white;
    text-align: center;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.clicksend-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.clicksend-logo:hover::before {
    left: 100%;
}

.clicksend-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6B46C1;
    text-shadow: 0 0 10px rgba(107, 70, 193, 0.6), 0 0 20px rgba(107, 70, 193, 0.4), 0 0 30px rgba(107, 70, 193, 0.2);
    position: relative;
    z-index: 1;
    display: inline-block;
    animation: logoGlow 3s ease-in-out infinite alternate;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes logoGlow {
    0% {
        text-shadow: 0 0 10px rgba(107, 70, 193, 0.6), 0 0 20px rgba(107, 70, 193, 0.4), 0 0 30px rgba(107, 70, 193, 0.2);
    }
    100% {
        text-shadow: 0 0 15px rgba(107, 70, 193, 0.8), 0 0 25px rgba(107, 70, 193, 0.6), 0 0 35px rgba(107, 70, 193, 0.4);
    }
}

/* Mobile adjustments for ClickSend logo */
@media (max-width: 768px) {
    .clicksend-text {
        font-size: 20px;
    }
    
    .clicksend-logo {
        padding: 15px 10px;
    }
}

/* Dashboard Specific Styles */
.border-left-primary {
    border-left: 4px solid #4e73df !important;
}

.border-left-success {
    border-left: 4px solid #1cc88a !important;
}

.border-left-info {
    border-left: 4px solid #36b9cc !important;
}

.border-left-warning {
    border-left: 4px solid #f6c23e !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.chart-area {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-pie {
    position: relative;
    height: 200px;
    width: 100%;
}

.progress-sm {
    height: 0.5rem;
}

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    border-bottom: 1px solid #e3e6f0;
    padding: 12px 0;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: #f8f9fc;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fc;
    font-size: 16px;
}

.activity-text {
    font-weight: 500;
    color: #5a5c69;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: #858796;
}

.campaign-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(78, 115, 223, 0.1);
}

/* KPI Cards Animation */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Progress bars styling */
.progress {
    background-color: #f1f3f4;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-area {
        height: 250px;
    }
    
    .chart-pie {
        height: 150px;
    }
    
    .activity-feed {
        max-height: 300px;
    }
}

/* Loading spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Custom scrollbar for activity feed */
.activity-feed::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Spinning animation for refresh button */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(359deg);
    }
}

/* ===== DARK MODE COMPATIBILITY ===== */
/* Ensure smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark mode specific overrides for CARDX components */
body[data-theme="dark"] .cardx-header {
    background: linear-gradient(135deg, #4c1d95 0%, #6b46c1 100%);
}

body[data-theme="dark"] .cardx-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

body[data-theme="dark"] .cardx-stat-card .stat-title {
    color: var(--text-secondary);
}

body[data-theme="dark"] .cardx-stat-card .stat-value {
    color: var(--text-primary);
}

body[data-theme="dark"] .modern-table {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .modern-table thead {
    background: var(--bg-secondary);
}

body[data-theme="dark"] .modern-table thead th {
    color: var(--text-primary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .modern-table tbody td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

body[data-theme="dark"] .modern-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Dark mode for activity feed */
body[data-theme="dark"] .activity-feed {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .activity-item {
    border-color: var(--border-color);
    color: var(--text-primary);
}

body[data-theme="dark"] .activity-item:hover {
    background: var(--bg-hover);
}

body[data-theme="dark"] .activity-text {
    color: var(--text-primary);
}

body[data-theme="dark"] .activity-time {
    color: var(--text-muted);
}

/* Dark mode for cosmic elements */
body[data-theme="dark"] .cosmic-particles {
    opacity: 0.3;
}

body[data-theme="dark"] .cosmic-particle {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark mode for charts */
body[data-theme="dark"] .chart-area,
body[data-theme="dark"] .chart-pie {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

/* Dark mode for progress bars */
body[data-theme="dark"] .progress {
    background: var(--bg-secondary);
}

/* Dark mode for tooltips */
body[data-theme="dark"] .cosmic-tooltip::before {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Dark mode for status indicators */
body[data-theme="dark"] .cosmic-status-online {
    background: var(--brand-success);
}

body[data-theme="dark"] .cosmic-status-offline {
    background: var(--brand-danger);
}

body[data-theme="dark"] .cosmic-status-pending {
    background: var(--brand-warning);
}

/* Dark mode for breadcrumbs */
body[data-theme="dark"] .cosmic-breadcrumb {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .cosmic-breadcrumb a {
    color: var(--brand-primary);
}

/* Dark mode for dividers */
body[data-theme="dark"] .cosmic-divider {
    background: var(--border-color);
}

/* Dark mode for loading states */
body[data-theme="dark"] .cosmic-loading::before {
    background: var(--bg-tertiary);
}

/* Dark mode for mobile elements */
body[data-theme="dark"] .mobile-indicator {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Dark mode for ClickSend branding */
body[data-theme="dark"] .clicksend-text {
    color: var(--text-primary);
}

/* Ensure icons maintain visibility in dark mode */
body[data-theme="dark"] .campaign-icon,
body[data-theme="dark"] .activity-icon {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Dark mode for text colors */
body[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

body[data-theme="dark"] .text-gray-300 {
    color: var(--text-secondary) !important;
}

/* ===== LEADS MANAGEMENT SYSTEM STYLES ===== */

/* Lead Dashboard Cards */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.border-left-danger {
    border-left: 0.25rem solid #e74a3b !important;
}

/* Text utilities for leads */
.text-xs {
    font-size: 0.7rem;
}

.fa-2x {
    font-size: 2em;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* Lead status badges */
.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Lead category cards */
.lead-category-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.lead-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Lead form improvements */
.lead-form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.lead-form-section h6 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Lead table improvements */
.leads-table {
    font-size: 0.9rem;
}

.leads-table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.leads-table td {
    vertical-align: middle;
}

/* Lead priority indicators */
.priority-low {
    color: #6c757d;
}

.priority-medium {
    color: #17a2b8;
}

.priority-high {
    color: #ffc107;
}

.priority-urgent {
    color: #dc3545;
    font-weight: bold;
}

/* Supplier cards */
.supplier-card {
    border-radius: 10px;
    transition: all 0.3s ease;
}

.supplier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Reports and payments */
.report-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.payment-status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.payment-status-paid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.payment-status-partial {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Lead statistics */
.lead-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.lead-stat-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.lead-stat-card.stat-primary {
    border-left-color: #007bff;
}

.lead-stat-card.stat-success {
    border-left-color: #28a745;
}

.lead-stat-card.stat-warning {
    border-left-color: #ffc107;
}

.lead-stat-card.stat-danger {
    border-left-color: #dc3545;
}

.lead-stat-card.stat-info {
    border-left-color: #17a2b8;
}

/* Lead action buttons */
.lead-action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 4px;
    margin: 0 2px;
}

/* Lead timeline */
.lead-timeline {
    position: relative;
    padding-left: 2rem;
}

.lead-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.lead-timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.lead-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #007bff;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e9ecef;
}

/* Responsive improvements for leads */
@media (max-width: 768px) {
    .lead-stat-card {
        margin-bottom: 1rem;
    }
    
    .leads-table {
        font-size: 0.8rem;
    }
    
    .lead-action-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .supplier-card {
        margin-bottom: 1rem;
    }
}

/* Dark mode for leads system */
body[data-theme="dark"] .lead-form-section {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body[data-theme="dark"] .leads-table th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

body[data-theme="dark"] .lead-stat-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body[data-theme="dark"] .supplier-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body[data-theme="dark"] .lead-timeline::before {
    background: var(--border-color);
}

/* Action Buttons */
.btn-group .btn {
    margin-right: 2px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.btn-sm i {
    font-size: 0.875rem;
}

/* Table Action Buttons */
.table td .btn-group {
    white-space: nowrap;
}

.table td .btn-group .btn {
    margin-right: 1px;
}

.table td .btn-group .btn:hover {
    transform: scale(1.05);
    transition: transform 0.1s ease;
} 