/* ===== CHROMEBUBBLE ADMIN - PREMIUM UI ===== */
/* CSS Variables & Theme Configuration */
:root {
    /* Brand Colors - Sophisticated Indigo/Violet Palette */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */
    --secondary: #64748b;
    /* Slate 500 */
    --success: #10b981;
    /* Emerald 500 */
    --danger: #ef4444;
    /* Red 500 */
    --warning: #f59e0b;
    /* Amber 500 */
    --info: #0ea5e9;
    /* Sky 500 */

    /* Neomorphism / Glassmorphism Bases */
    --bg-body: #f3f4f6;
    --card-bg: #ffffff;
    --sidebar-bg: #1e1e2d;
    /* Dark Sidebar for contrast */
    --sidebar-text: #a2a3b7;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #ffffff;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
}

/* ===== GLOBAL STYLES ===== */
body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: #374151;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.025em;
}

a {
    text-decoration: none;
    transition: all 0.2s;
}

/* Utility Mixins */
.shadow-soft {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.letter-spacing-1 {
    letter-spacing: 1px;
}

.shadow-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== BUTTON OVERRIDES ===== */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    border: none;
}

.btn-danger {
    background: var(--danger);
    border: none;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== CARDS & CONTAINERS ===== */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ===== SIDEBAR STYLES ===== */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #0f172a;
    /* Deep Slate */
    background: linear-gradient(180deg, #0f172a 0%, #1e1e2d 100%);
    color: #94a3b8;
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* Prevent body scrollbar, handle internal scroll */
}

/* Sidebar Scroll Area */
#sidebar .sidebar-content {
    flex: 1;
    overflow-y: auto;
    /* Force scroll */
    overflow-x: hidden;
    height: 100%;
    /* Ensure full height */
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#sidebar .sidebar-content::-webkit-scrollbar {
    width: 4px;
}

#sidebar .sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar .sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#sidebar .sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

#sidebar .sidebar-header {
    padding: 25px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
}

/* Sidebar Links */
#sidebar ul.components {
    padding: 10px 15px;
}

.sidebar-category {
    padding: 15px 15px 5px 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    font-weight: 800;
    margin-top: 10px;
}

#sidebar ul li {
    margin-bottom: 4px;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: #cbd5e1;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#sidebar ul li a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    font-weight: 600;
}

#sidebar ul li a i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
    text-align: center;
    transition: transform 0.3s;
}

#sidebar ul li a:hover i {
    transform: scale(1.1);
}



/* User Profile in Sidebar */
.sidebar-footer {
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    /* Push to bottom if content is short */
}

.user-info {
    display: flex;
    align-items: center;
    color: #fff !important;
}

.user-info img {
    border-radius: 8px;
    width: 40px;
    height: 40px;
    margin-right: 12px;
}

/* ===== MAIN CONTENT ===== */
#content {
    width: 100%;
    padding-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s;
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
    padding-bottom: 1rem;
}

/* ===== DATATABLES CUSTOMIZATION ===== */
.dataTables_wrapper {
    padding: 1.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    font-size: 0.9rem;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.9rem;
    color: #6b7280;
    padding: 0 !important;
    margin-top: 1.5rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 0 !important;
    margin-top: 1.5rem;
}

.dataTables_wrapper .pagination {
    margin: 0;
    gap: 0.25rem;
}

.dataTables_wrapper .page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.dataTables_wrapper .page-link {
    color: #4b5563;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.dataTables_wrapper .page-link:hover {
    background-color: #f9fafb;
    border-color: var(--primary);
    color: var(--primary);
}

.dataTables_wrapper .page-item.disabled .page-link {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
}

/* Mobile DataTables Fixes */
@media (max-width: 767px) {

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .row {
        flex-direction: column;
    }

    .dataTables_wrapper .col-sm-12 {
        width: 100%;
        padding: 0;
    }
}

.table tbody td {
    padding: 1rem 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* ===== FORM ELEMENTS ===== */
.form-control,
.form-select,
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* ===== STATUS BADGES ===== */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.bg-success {
    background: #dcfce7 !important;
    color: #166534;
}

.bg-primary {
    background: #e0e7ff !important;
    color: #3730a3;
}

.bg-warning {
    background: #fef3c7 !important;
    color: #92400e;
}

.bg-danger {
    background: #fee2e2 !important;
    color: #991b1b;
}

.bg-secondary {
    background: #f3f4f6 !important;
    color: #4b5563;
}

.bg-draft {
    background: #f3f4f6 !important;
    color: #6b7280;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card .icon.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.stat-card .icon.green {
    background: #ecfdf5;
    color: #10b981;
}

.stat-card .icon.yellow {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-card .icon.purple {
    background: #f5f3ff;
    color: #8b5cf6;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #sidebar.active {
        margin-left: 0;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    #content {
        padding-left: 0;
    }

    .overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mobile Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

/* ===== SELECT2 CUSTOMIZATION ===== */
.select2-container--bootstrap-5 .select2-selection--single {
    height: auto;
    padding: 0.5rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 42px;
}

/* ===== PRINT STYLES ===== */
@media print {

    /* Hide specific elements */
    #sidebar,
    #sendEmailBtn,
    .btn,
    .no-print,
    .alert,
    .modal,
    .overlay,
    .sidebar-footer,
    .navbar {
        display: none !important;
    }

    /* Remove Browser Headers and Footers */
    @page {
        margin: 0.5cm !important;
        size: auto;
    }

    body {
        background: white !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html,
    body {
        height: auto !important;
        min-height: 0 !important;
    }

    #content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Clean up form inputs for print */
    input,
    textarea,
    select {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        resize: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        font-weight: bold !important;
        color: #000 !important;
    }

    /* Hide Date Picker Icons */
    input[type="date"]::-webkit-calendar-picker-indicator,
    input[type="date"]::-webkit-inner-spin-button {
        display: none !important;
        -webkit-appearance: none !important;
    }

    /* Ensure background colors print where needed (like status badges) */
    .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border: 1px solid #ddd !important;
        /* Add border for contrast if color fails */
    }

    /* Hide URLs in print */
    a[href]:after {
        content: none !important;
    }
}