/* ===== ADMIN DASHBOARD CSS ===== */
:root {
    --admin-btn-color: #B37812;
    --admin-btn-hover: #96600A;
    --admin-btn-text: #ffffff;
    --admin-sidebar-bg: linear-gradient(180deg, #992E00 0%, #B37812 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f0f2f8;
    color: #333;
    overflow-x: hidden;
}

/* ===== LAYOUT ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg, linear-gradient(180deg, #992E00 0%, #B37812 100%)) !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    width: auto;
    height: 64px;
    border-radius: 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.sidebar-brand-text {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand h3 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.sidebar-brand p {
    font-size: 10px;
    color: #6b7099;
    margin-top: 2px;
}

/* Nav Sections */
.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    color: #8b90c0;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 15px 14px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #d0d4f0;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 2px;
}

.nav-item i:first-child {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.nav-item.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
}

/* Sidebar Footer & White Logout Button */
.sidebar-footer {
    padding: 14px 14px 18px 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer .logout-item,
.sidebar-logout-btn {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 11px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

.sidebar-footer .logout-item i,
.sidebar-logout-btn i {
    color: #ffffff !important;
    font-size: 15px !important;
}

.sidebar-footer .logout-item:hover,
.sidebar-logout-btn:hover {
    background: #ffffff !important;
    color: #1E1510 !important;
    border-color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22) !important;
    transform: translateY(-1px);
}

.sidebar-footer .logout-item:hover i,
.sidebar-logout-btn:hover i {
    color: #1E1510 !important;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    padding-top: 68px;
}

/* Sidebar Collapsed */
/* Sidebar mini logo */
.sidebar-logo-mini {
    display: none;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.sidebar-collapsed .sidebar {
    width: 70px;
}

.sidebar-collapsed .sidebar span:not(.sidebar-logo-mini),
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-arrow {
    display: none;
}

.sidebar-collapsed .sidebar-logo-full {
    display: none;
}

.sidebar-collapsed .sidebar-logo-mini {
    display: block;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 22px 14px;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* ===== TOPBAR ===== */
.topbar {
    background: #fff;
    padding: 16px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8ecf1;
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Collapsed sidebar: topbar shifts left */
.sidebar-collapsed .topbar {
    left: 70px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: #f0f2f8;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f7fa;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 10px 18px;
    min-width: 280px;
}

.search-box i {
    color: #999;
    font-size: 14px;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #333;
    width: 100%;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: all 0.3s;
    position: relative;
}

.topbar-icon:hover {
    background: #f5f7fa;
    color: #96600A;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.admin-profile-wrap {
    position: relative;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    padding: 6px 12px 6px 16px;
    border-left: 1px solid #e8ecf1;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.admin-profile:hover {
    background: rgba(0, 0, 0, 0.04);
}

.topbar-dropdown.admin-profile-dropdown {
    top: calc(100% + 10px);
    right: 0;
    box-shadow: 0 14px 35px rgba(0,0,0,0.12);
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #96600A, #B37812);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.admin-info {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-size: 13px;
    font-weight: 600;
    color: #0d1137;
}

.admin-role {
    font-size: 11px;
    color: #6b7099;
}

/* ===== DASHBOARD CONTENT ===== */
.dashboard-content {
    padding: 30px;
}

/* Welcome Section */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.welcome-text {
    font-size: 13px;
    color: #6b7099;
}

.welcome-name {
    font-size: 26px;
    font-weight: 700;
    color: #0d1137;
}

.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 8px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.teal { background: #f0fdfa; color: #0d9488; }

.stat-label {
    font-size: 12px;
    color: #6b7099;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #0d1137;
    margin-bottom: 6px;
}

.stat-change {
    font-size: 11px;
    font-weight: 500;
}

.stat-change.positive { color: #16a34a; }
.stat-change.negative { color: #ef4444; }

/* ===== DASHBOARD ROW ===== */
.dashboard-row {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

.dashboard-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ===== DASHBOARD CARD ===== */
.dashboard-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0d1137;
}

.card-filter {
    padding: 6px 12px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    outline: none;
}

.view-all {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* Chart Placeholder */
.chart-placeholder {
    position: relative;
    height: 220px;
    display: flex;
    align-items: flex-end;
    padding-top: 30px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
    height: 100%;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #2563eb 0%, #93c5fd 100%);
    border-radius: 8px 8px 0 0;
    position: relative;
    min-height: 20px;
    transition: opacity 0.3s;
}

.chart-bar.highlight {
    background: linear-gradient(180deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 -4px 15px rgba(37, 99, 235, 0.3);
}

.chart-bar span {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

.chart-tooltip {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0d1137;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
}

/* Orders Overview */
.orders-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(
        #16a34a 0% 72%,
        #2563eb 72% 87%,
        #ea580c 87% 95%,
        #ef4444 95% 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.donut-center {
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-center h4 {
    font-size: 20px;
    font-weight: 700;
    color: #0d1137;
}

.donut-center p {
    font-size: 11px;
    color: #6b7099;
}

.order-legend {
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #555;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.green { background: #16a34a; }
.legend-dot.blue { background: #2563eb; }
.legend-dot.orange { background: #ea580c; }
.legend-dot.red { background: #ef4444; }

.legend-item strong {
    margin-left: auto;
    font-size: 12px;
    color: #333;
}

/* Top Products */
.top-products {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.product-row:hover {
    background: #f8f9fc;
}

.product-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0f2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #96600A;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-info p {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sales,
.product-revenue {
    font-size: 12px;
    font-weight: 600;
    color: #0d1137;
    white-space: nowrap;
}

/* Recent Orders Table */
.recent-orders {
    overflow-x: auto;
}

.recent-orders table {
    width: 100%;
    border-collapse: collapse;
}

.recent-orders th {
    font-size: 11px;
    font-weight: 600;
    color: #6b7099;
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-orders td {
    font-size: 12px;
    color: #333;
    padding: 12px 8px;
    border-bottom: 1px solid #f8f8f8;
}

.order-id {
    color: #2563eb;
    font-weight: 600;
}

.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status.completed { background: #ecfdf5; color: #16a34a; }
.status.processing { background: #eff6ff; color: #2563eb; }
.status.pending { background: #fff7ed; color: #ea580c; }
.status.cancelled { background: #fef2f2; color: #ef4444; }

/* Stock Alerts */
.stock-alerts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fc;
    border-radius: 10px;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #333;
}

.stock-info i {
    color: #6b7099;
}

.stock-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.stock-badge.critical { background: #fef2f2; color: #ef4444; }
.stock-badge.warning { background: #fff7ed; color: #ea580c; }

.stock-input.critical { border-color: #fecaca !important; background: #fef2f2 !important; color: #ef4444 !important; }
.stock-input.warning { border-color: #fed7aa !important; background: #fff7ed !important; color: #ea580c !important; }
.stock-input.good { border-color: #a7f3d0 !important; background: #ecfdf5 !important; color: #16a34a !important; }

/* Customers Overview */
.customers-overview {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.customer-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    transition: background 0.3s;
}

.customer-stat:hover {
    background: #f8f9fc;
}

.customer-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.customer-icon.blue { background: #eff6ff; color: #2563eb; }
.customer-icon.green { background: #ecfdf5; color: #16a34a; }
.customer-icon.orange { background: #fff7ed; color: #ea580c; }
.customer-icon.red { background: #fef2f2; color: #ef4444; }

.customer-info {
    flex: 1;
}

.customer-info span {
    font-size: 12px;
    color: #6b7099;
    display: block;
}

.customer-info strong {
    font-size: 16px;
    color: #0d1137;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0d1137;
    margin-bottom: 16px;
}

.actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.action-btn i {
    color: #2563eb;
}

/* ===== ADMIN FOOTER (FIXED) ===== */
.admin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 30px;
    border-top: 1px solid #e8ecf1;
    background: #ffffff;
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    z-index: 85;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: left 0.3s ease;
}

.sidebar-collapsed .admin-footer {
    left: 70px;
}

.admin-footer p {
    font-size: 12px;
    color: #6b7099;
    margin: 0;
}

.admin-footer .heart {
    color: #ef4444;
}

/* Bottom padding so content scrolls behind fixed footer without being hidden */
.dashboard-content {
    padding-bottom: 75px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-row.three-col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-row.three-col {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }

    .admin-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar-collapsed .sidebar {
        transform: translateX(0);
        width: 260px;
    }

    .main-content {
        margin-left: 0;
        padding-top: 0;
    }

    .sidebar-collapsed .main-content {
        margin-left: 0;
        padding-top: 0;
    }

    .dashboard-content {
        padding: 20px 15px;
    }

    .topbar {
        padding: 14px 15px;
        left: 0;
    }

    .sidebar-collapsed .topbar {
        left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .welcome-name {
        font-size: 20px;
    }

    .actions-grid {
        flex-direction: column;
    }

    .admin-footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        padding: 10px 15px;
        left: 0 !important;
    }

    .dashboard-content {
        padding-bottom: 85px !important;
    }
}


/* ===== ADMIN PAGE STYLES ===== */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8ecf1;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #0d1137;
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13px;
    color: #6b7099;
    margin-top: 4px;
}

/* Buttons */
.btn-primary,
.btn-filter,
.btn-add-admin,
.btn-variation,
.btn-invoice:not(.secondary),
.btn-action-main,
.btn-confirm-del,
.actions-grid .action-btn.primary,
button[type="submit"]:not(.btn-action):not(.btn-secondary):not(.btn-reject):not(.btn-delete-admin):not(.btn-delete-t):not(.btn-cancel-del) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--admin-btn-color, #B37812) !important;
    color: var(--admin-btn-text, #fff) !important;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.btn-primary:hover,
.btn-filter:hover,
.btn-add-admin:hover,
.btn-variation:hover,
.btn-invoice:not(.secondary):hover,
button[type="submit"]:not(.btn-action):not(.btn-secondary):not(.btn-reject):not(.btn-delete-admin):not(.btn-delete-t):not(.btn-cancel-del):hover {
    filter: brightness(0.92);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #333;
    border: 1.5px solid #e4e8f0;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: #aab0cc;
    background: #f8f9fc;
    color: #0d1137;
}

.btn-lg {
    padding: 14px 30px;
    font-size: 14px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.3s;
}

.btn-close:hover {
    color: #ef4444;
}

/* Admin Alerts - Fixed toast at bottom right */
.dashboard-content .alert {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    max-width: 380px;
    width: auto;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    animation: slideInRight 0.4s ease, fadeOutRight 0.5s ease 4s forwards;
    font-family: 'Poppins', sans-serif;
}

@keyframes slideInRight { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeOutRight { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

.dashboard-content .alert.alert-success {
    background: #fff;
    color: #16a34a;
    border: none;
    border-left: 4px solid #16a34a;
}

.dashboard-content .alert.alert-error {
    background: #fff;
    color: #dc2626;
    border: none;
    border-left: 4px solid #dc2626;
}

/* ===== FORM CARD ===== */
.form-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f8;
}

.form-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2f8;
}

.form-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0d1137;
}

.form-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0d1137;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f2f8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 2px;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #96600A;
    margin-bottom: 8px;
}

.required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e4e8f0;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #333;
    outline: none;
    transition: all 0.3s;
    background: #fafbfc;
}

.form-control:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.form-control::placeholder {
    color: #aab0cc;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7099' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

.form-control-file {
    width: 100%;
    padding: 16px;
    border: 2px dashed #e4e8f0;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    background: #fafbfc;
    transition: all 0.3s;
}

.form-control-file:hover {
    border-color: #2563eb;
    background: #f8faff;
}

.form-help {
    font-size: 11px;
    color: #8b90b3;
    margin-top: 6px;
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f2f8;
}

/* Product Form Grid */
.product-form .form-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
}

.preview-img {
    max-width: 160px;
    border-radius: 10px;
    margin-top: 10px;
    border: 2px solid #f0f2f8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.current-image {
    margin-top: 12px;
}

.checkbox-group {
    padding: 12px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    border-radius: 4px;
}

/* ===== TABLE CARD ===== */
.table-card {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f8;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: #f8f9fc;
    padding: 16px 18px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7099;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #eee;
}

.data-table tbody td {
    padding: 16px 18px;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid #f5f7fa;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8faff;
}

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

.table-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #f0f2f8;
}

.table-img-placeholder {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #f0f2f8, #e8ecf5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aab0cc;
    font-size: 18px;
}

.text-center {
    text-align: center;
    color: #6b7099;
    padding: 50px 16px !important;
    font-size: 14px;
}

.text-muted {
    color: #999;
}

.text-success {
    color: #16a34a;
}

.text-danger {
    color: #dc2626;
}

/* ===== BADGES ===== */
.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f0f2f8, #e8ecf5);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #0d1137;
}

.badge-bestseller {
    display: inline-block;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #ea580c;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stock-badge.good {
    background: #ecfdf5;
    color: #16a34a;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* Status in tables */
.data-table .status {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.data-table .status.active {
    background: #ecfdf5;
    color: #16a34a;
}

.data-table .status.inactive {
    background: #f5f5f5;
    color: #888;
}

code {
    background: #f0f2f8;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    color: #6b7099;
    font-family: monospace;
}

/* ===== ACTION BUTTONS ===== */
.actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-action.edit {
    background: #eff6ff;
    color: #2563eb;
}

.btn-action.edit:hover {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.btn-action.delete {
    background: #fef2f2;
    color: #ef4444;
}

.btn-action.delete:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
}

/* ===== RESPONSIVE FORM ===== */
@media (max-width: 992px) {
    .product-form .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .data-table {
        font-size: 12px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 12px 10px;
    }

    .table-img,
    .table-img-placeholder {
        width: 42px;
        height: 42px;
    }

    .form-card {
        padding: 20px 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
        justify-content: center;
    }
}


/* ===== GALLERY PREVIEW ===== */
.gallery-upload-area {
    margin-bottom: 12px;
}

.gallery-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.gallery-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e4e8f0;
    transition: border-color 0.2s;
}

.gallery-preview-item:hover {
    border-color: #ef4444;
}

.gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-preview-item:hover .gallery-remove-btn {
    opacity: 1;
}


/* ===== COMPREHENSIVE RESPONSIVE OVERRIDES ===== */

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS (TABLETS, PHONES & ANY SCREEN SIZE)
   ========================================================================== */

/* Universal Scroll & Viewport Protection */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.admin-layout {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

.main-content {
    min-width: 0;
    box-sizing: border-box;
}

/* Sidebar Close Button (Hidden on Desktop) */
.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    margin-left: auto;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.2s;
}
.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Universal Table Wrapper & Touch Scrolling (Applies to ALL admin tables) */
.table-card,
.table-responsive,
.dataTables_wrapper,
.recent-orders,
.variation-skus-wrap,
.shipping-rates-wrap,
div[style*="overflow-x:auto"],
div[style*="overflow-x: auto"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative;
    box-sizing: border-box;
}

/* Ensure data tables never compress into illegible vertical text */
.data-table,
.table-card table,
.table-responsive table,
.dataTables_wrapper table,
.recent-orders table,
div[style*="overflow-x:auto"] > table,
div[style*="overflow-x: auto"] > table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

/* High-column data tables require sufficient breathing room */
#productsTable {
    min-width: 1050px !important;
}
#settlementsTable {
    min-width: 920px !important;
}
#ordersTable, #waOrdersTable, #rfqTable, #complaintsTable, #courierTable, #suppliersTable, #approvalsTable, #dashboardRecentOrdersTable {
    min-width: 820px !important;
}
#categoriesTable, #subcategoriesTable, #customersTable, #smsLogTable, #subscribersTable, #reviewsTable, #couponsTable, #megaDealsTable {
    min-width: 740px !important;
}
.order-items-table {
    min-width: 480px !important;
}
.variation-skus-table, .shipping-rates-table {
    min-width: 640px !important;
}

/* Custom horizontal scrollbars for clean aesthetic */
.table-card::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.dataTables_wrapper::-webkit-scrollbar,
.recent-orders::-webkit-scrollbar,
div[style*="overflow-x:auto"]::-webkit-scrollbar {
    height: 6px;
}
.table-card::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.dataTables_wrapper::-webkit-scrollbar-thumb,
.recent-orders::-webkit-scrollbar-thumb,
div[style*="overflow-x:auto"]::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-card::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.dataTables_wrapper::-webkit-scrollbar-track,
div[style*="overflow-x:auto"]::-webkit-scrollbar-track {
    background: #f1f5f9;
}

/* ==========================================================================
   DATATABLES COMPREHENSIVE STYLING (ALL ADMIN PAGES)
   ========================================================================== */
.dataTables_wrapper {
    position: relative;
    clear: both;
    padding: 20px !important;
    background: #ffffff;
    font-family: 'Poppins', sans-serif;
    color: #334155;
    box-sizing: border-box;
    width: 100% !important;
}

.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* --- Top Controls: "Show [10] entries" (Left) & "Search:" (Right) --- */
.dataTables_wrapper .dataTables_length {
    float: left !important;
    margin-bottom: 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #475569 !important;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: #475569 !important;
    font-weight: 500 !important;
    margin: 0 !important;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 7px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: 'Poppins', sans-serif !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    outline: none !important;
    cursor: pointer !important;
    min-width: 70px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_length select:hover {
    border-color: var(--admin-btn-color, #B37812) !important;
    box-shadow: 0 0 0 3px rgba(179, 120, 18, 0.15) !important;
}

.dataTables_wrapper .dataTables_filter {
    float: right !important;
    margin-bottom: 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #475569 !important;
}

.dataTables_wrapper .dataTables_filter label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 7px 14px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    font-family: 'Poppins', sans-serif !important;
    outline: none !important;
    min-width: 240px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--admin-btn-color, #B37812) !important;
    box-shadow: 0 0 0 3px rgba(179, 120, 18, 0.15) !important;
    background-color: #ffffff !important;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: #94a3b8 !important;
    font-size: 12.5px !important;
}

/* --- Table Styles Inside Wrapper --- */
.dataTables_wrapper table.dataTable {
    clear: both !important;
    width: 100% !important;
    margin: 12px 0 18px 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.dataTables_wrapper table.dataTable thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 13px 16px !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    border-top: none !important;
    white-space: nowrap !important;
}

.dataTables_wrapper table.dataTable tbody td {
    padding: 13px 16px !important;
    font-size: 13.5px !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.dataTables_wrapper table.dataTable tbody tr:hover {
    background-color: #f8fafc !important;
}

.dataTables_wrapper table.dataTable.no-footer {
    border-bottom: 1px solid #e2e8f0 !important;
}

/* DataTables Scroll Area */
.dataTables_wrapper .dataTables_scroll {
    width: 100% !important;
    margin-bottom: 12px !important;
}

.dataTables_wrapper .dataTables_scrollHeadInner,
.dataTables_wrapper .dataTables_scrollHeadInner table {
    width: 100% !important;
}

/* --- Bottom Controls: "Showing X of Y" (Left) & Pagination (Right) --- */
.dataTables_wrapper .dataTables_info {
    float: left !important;
    padding-top: 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

.dataTables_wrapper .dataTables_paginate {
    float: right !important;
    padding-top: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    user-select: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 10px !important;
    margin: 0 2px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--admin-btn-color, #B37812) !important;
    border-color: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(179, 120, 18, 0.25) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    background: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
}

/* Sidebar active item */
.sidebar-nav .nav-item.active {
    background: var(--admin-btn-color, #B37812) !important;
    color: #fff !important;
}

/* Keep badges, action buttons and status selects intact */
.cl-badge,
.status-badge,
.badge-count,
.btn-view-order,
.btn-print-label,
.btn-action,
.admin-badge {
    white-space: nowrap !important;
}

/* ==========================================================================
   BREAKPOINTS
   ========================================================================== */

/* Tablet Landscape (< 1200px) */
@media (max-width: 1200px) {
    .order-detail-grid { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .dashboard-row.three-col { grid-template-columns: 1fr 1fr; }
}

/* Tablet Portrait (< 992px) */
@media (max-width: 992px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .order-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .product-form .form-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .dashboard-row.three-col { grid-template-columns: 1fr; }
}

/* Mobile Screens & Phablets (<= 768px) */
@media (max-width: 768px) {
    /* Show sidebar close button */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Sidebar transforms into off-canvas drawer */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 10000 !important;
        box-shadow: none;
    }

    .admin-layout.sidebar-collapsed .sidebar {
        transform: translateX(0) !important;
        box-shadow: 6px 0 30px rgba(0, 0, 0, 0.35) !important;
    }

    /* Restore text labels and full logo inside off-canvas drawer on mobile */
    .admin-layout.sidebar-collapsed .sidebar span:not(.sidebar-logo-mini) {
        display: inline !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .sidebar-brand-text {
        display: inline-block !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .nav-section-title {
        display: block !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .nav-arrow {
        display: block !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .sidebar-logo-full {
        display: block !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .sidebar-logo-mini {
        display: none !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .sidebar-header {
        justify-content: space-between !important;
        padding: 16px 18px !important;
    }
    .admin-layout.sidebar-collapsed .sidebar .nav-item {
        justify-content: flex-start !important;
        padding: 11px 16px !important;
    }

    /* Backdrop overlay when sidebar is open */
    .admin-layout.sidebar-collapsed::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 9999;
        pointer-events: auto;
    }

    /* Main content takes full screen and avoids white gap above header */
    .main-content,
    .admin-layout.sidebar-collapsed .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Topbar */
    .topbar {
        padding: 10px 14px !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin-top: 0 !important;
        width: 100% !important;
        z-index: 900 !important;
    }
    .topbar-left { gap: 10px; }
    .menu-toggle {
        padding: 8px 10px;
        font-size: 18px;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .topbar-right { gap: 6px; }
    .search-box { display: none !important; }
    .admin-info { display: none !important; }

    /* Dropdowns must never cause horizontal window scroll */
    .topbar-dropdown {
        max-width: calc(100vw - 20px) !important;
        width: 290px !important;
        right: 0 !important;
        left: auto !important;
    }

    /* Dashboard content */
    .dashboard-content {
        padding: 14px 12px 70px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Headers & welcome sections */
    .page-header,
    .page-header-flex,
    .welcome-section {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .page-title { font-size: 20px !important; }
    .page-subtitle { font-size: 12px !important; }

    /* Header action buttons wrap cleanly */
    .page-header > div:last-child,
    .page-header-flex > div:last-child,
    .page-header .btn-primary,
    .page-header a {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Export strip in index.php */
    .export-strip {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 16px !important;
        gap: 14px !important;
    }
    .export-strip-links {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        width: 100% !important;
        justify-content: space-between !important;
    }
    .export-strip-divider {
        display: none !important;
    }

    /* Formula banner in settlements.php */
    .formula-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 16px !important;
    }
    .formula-banner div[style*="monospace"] {
        word-break: break-word !important;
        font-size: 12.5px !important;
    }
    .formula-select-form {
        width: 100% !important;
    }
    .formula-select-form select {
        width: 100% !important;
    }

    /* Filter buttons on suppliers.php */
    .supplier-filters-bar {
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 6px !important;
    }
    .supplier-filters-bar .filter-btn {
        padding: 6px 12px !important;
        font-size: 11.5px !important;
        flex: 1 1 auto !important;
        text-align: center !important;
    }

    /* Product Filters Bar */
    .product-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 14px 12px !important;
    }
    .product-filters .filter-group {
        width: 100% !important;
        min-width: 0 !important;
    }
    .product-filters select {
        width: 100% !important;
        min-width: 0 !important;
    }
    .product-filters .filter-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }
    .product-filters .btn-filter,
    .product-filters .btn-filter-clear {
        flex: 1 !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Table cells */
    .data-table thead th,
    .table-card table thead th,
    div[style*="overflow-x:auto"] > table thead th {
        padding: 10px 12px !important;
        font-size: 10.5px !important;
    }
    .data-table tbody td,
    .table-card table tbody td,
    div[style*="overflow-x:auto"] > table tbody td {
        padding: 10px 12px !important;
        font-size: 12.5px !important;
    }

    .table-img,
    .table-img-placeholder {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }

    .order-status-select,
    .payment-status-select {
        font-size: 11px !important;
        padding: 5px 6px !important;
        min-width: 95px !important;
        max-width: 125px !important;
    }

    /* Cards and Forms */
    .content-card,
    .form-card,
    .dashboard-card,
    .order-card {
        padding: 18px 14px !important;
        border-radius: 12px !important;
    }

    .form-grid,
    .form-row,
    .product-form .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .form-actions,
    .form-actions-row {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .form-actions button,
    .form-actions a,
    .form-actions-row button,
    .form-actions-row a {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* DataTables Controls on Mobile */
    .dataTables_wrapper {
        padding: 12px !important;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        display: block !important;
        width: 100% !important;
        float: none !important;
        text-align: left !important;
        margin-bottom: 10px !important;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100% !important;
        margin: 4px 0 0 !important;
        box-sizing: border-box !important;
    }
    .dataTables_wrapper .dataTables_info {
        float: none !important;
        text-align: center !important;
        margin-top: 10px !important;
        font-size: 11.5px !important;
    }
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin-top: 8px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 4px !important;
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    /* All Modals on Mobile */
    div[id$="Modal"] {
        padding: 12px !important;
    }
    div[id$="Modal"] > div,
    .admin-logout-modal,
    .delete-cat-modal {
        max-width: 95vw !important;
        width: 95vw !important;
        padding: 18px 14px !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    /* Toast Notifications on Mobile */
    .admin-toast,
    .admin-live-toast {
        left: 12px !important;
        right: 12px !important;
        max-width: calc(100vw - 24px) !important;
        top: 12px !important;
        padding: 12px 14px !important;
    }
}

/* Small Phones (<= 480px, including 360px & 320px) */
@media (max-width: 480px) {
    .dashboard-content {
        padding: 10px 8px 60px !important;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .order-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .stat-card {
        padding: 12px 10px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .stat-card .stat-value,
    .stat-card h3 {
        font-size: 17px !important;
    }
    .stat-card .stat-label,
    .stat-card p {
        font-size: 10.5px !important;
    }
    .stat-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
    }

    .order-stat-card {
        padding: 12px 10px !important;
    }
    .order-stat-card h4 {
        font-size: 18px !important;
    }
    .order-stat-card p {
        font-size: 10.5px !important;
    }

    /* Topbar Icons */
    .topbar {
        padding: 8px 10px !important;
    }
    .topbar-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
    }
    .admin-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
    }

    /* Page Header */
    .page-title {
        font-size: 18px !important;
    }
    .welcome-name {
        font-size: 16px !important;
    }
    .date-filter {
        display: none !important;
    }

    /* Action Buttons */
    .btn-primary, .btn-secondary, .btn-action-main {
        font-size: 12px !important;
        padding: 9px 14px !important;
    }

    /* Quick Actions */
    .actions-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .action-btn {
        font-size: 12px !important;
        padding: 12px 14px !important;
    }

    /* Content Cards */
    .content-card,
    .form-card,
    .dashboard-card,
    .order-card {
        padding: 14px 10px !important;
    }

    /* Nested grid in site-settings social links */
    .content-card div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .customer-stat {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .stock-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
}

/* Admin toast for inline success/error messages */
.admin-toast { display: none !important; }
/* Custom button styles for admin pages */

.btn-approve {
    background: var(--admin-btn-color) !important;
    color: var(--admin-btn-text) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    cursor: pointer !important;
}

.btn-approve:hover {
    background: var(--admin-btn-hover) !important;
}

.btn-reject {
    background: #d32f2f !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    cursor: pointer !important;
}

.btn-reject:hover {
    background: #b71c1c !important;
}

/* DataTables pagination styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: #fff !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    margin: 0 2px !important;
    cursor: pointer !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f5f5f5 !important;
    color: #374151 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--admin-btn-color) !important;
    color: var(--admin-btn-text) !important;
    border-color: var(--admin-btn-color) !important;
}

/* ==========================================================================
   ADMIN COMPREHENSIVE DARK THEME SYSTEM
   ========================================================================== */
html.dark-theme,
body.dark-theme {
    background-color: #121520 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .admin-layout,
body.dark-theme .main-content,
body.dark-theme .dashboard-content,
body.dark-theme .content-wrapper {
    background: #121520 !important;
    color: #cbd5e1 !important;
}

/* Sidebar in Dark Theme */
body.dark-theme .sidebar {
    background: #161928 !important;
    border-right: 1px solid #23283e !important;
}
body.dark-theme .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
body.dark-theme .sidebar-nav .nav-item {
    color: #c8cce6 !important;
}
body.dark-theme .sidebar-nav .nav-item:hover {
    background: #23283e !important;
    color: #ffffff !important;
}
body.dark-theme .sidebar-nav .nav-item.active {
    background: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
}
body.dark-theme .nav-section-title {
    color: #64748b !important;
}

/* Topbar in Dark Theme */
body.dark-theme .topbar {
    background: #1c2033 !important;
    border-bottom: 1px solid #282e48 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}
body.dark-theme .topbar-icon {
    background: #252b44 !important;
    border-color: #343c5e !important;
    color: #a0a5c8 !important;
}
body.dark-theme .topbar-icon:hover {
    background: #31395b !important;
    color: #ffffff !important;
}
body.dark-theme .search-box {
    background: #252b44 !important;
    border-color: #343c5e !important;
}
body.dark-theme .search-box input {
    color: #f1f5f9 !important;
    background: transparent !important;
}
body.dark-theme .search-box input::placeholder {
    color: #7982a9 !important;
}
body.dark-theme .admin-name {
    color: #ffffff !important;
}
body.dark-theme .admin-role {
    color: #94a3b8 !important;
}

/* Cards, Panels, and Containers */
body.dark-theme .content-card,
body.dark-theme .table-card,
body.dark-theme .dashboard-card,
body.dark-theme .stat-card,
body.dark-theme .order-card,
body.dark-theme .ordering-card,
body.dark-theme .payment-card,
body.dark-theme .admin-card,
body.dark-theme .add-admin-form,
body.dark-theme .order-stat-card,
body.dark-theme .card,
body.dark-theme .box,
body.dark-theme .filter-card,
body.dark-theme .product-filters,
body.dark-theme .settings-card,
body.dark-theme div[style*="background:#fff"],
body.dark-theme div[style*="background: #fff"],
body.dark-theme div[style*="background:#FFF"],
body.dark-theme div[style*="background: #FFF"],
body.dark-theme div[style*="background:#ffffff"],
body.dark-theme div[style*="background: #ffffff"],
body.dark-theme div[style*="background:#FFFFFF"],
body.dark-theme div[style*="background: #FFFFFF"],
body.dark-theme div[style*="background:#fafafa"],
body.dark-theme div[style*="background: #fafafa"],
body.dark-theme div[style*="background:#f8fafc"],
body.dark-theme div[style*="background: #f8fafc"],
body.dark-theme div[style*="background:#FFFBF5"],
body.dark-theme div[style*="background: #FFFBF5"],
body.dark-theme div[style*="background:#FAF6EE"],
body.dark-theme div[style*="background: #FAF6EE"],
body.dark-theme div[style*="background:#f0f2f8"],
body.dark-theme div[style*="background: #f0f2f8"],
body.dark-theme section[style*="background:#fff"],
body.dark-theme section[style*="background: #fff"] {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}

/* Sub-wells / Nested Boxes / Info strips */
body.dark-theme .nested-well,
body.dark-theme div[id="videoBlock"],
body.dark-theme div[style*="background:#f8fafc; border:1.5px solid #e2e8f0"],
body.dark-theme div[style*="background: #f8fafc; border: 1.5px solid #e2e8f0"],
body.dark-theme div[style*="background:#f8fafc; border-radius:8px"] {
    background-color: #161928 !important;
    border-color: #282e48 !important;
}

/* Headings and Titles */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme .page-title,
body.dark-theme .card-header h3,
body.dark-theme strong,
body.dark-theme b,
body.dark-theme [style*="color:#1E1510"],
body.dark-theme [style*="color: #1E1510"],
body.dark-theme [style*="color:#0d1137"],
body.dark-theme [style*="color: #0d1137"],
body.dark-theme [style*="color:#0f2b1d"],
body.dark-theme [style*="color: #0f2b1d"],
body.dark-theme [style*="color:#1e293b"],
body.dark-theme [style*="color: #1e293b"],
body.dark-theme [style*="color:#333"],
body.dark-theme [style*="color: #333"] {
    color: #f8fafc !important;
}

/* Subtitles, labels, and muted text */
body.dark-theme .page-subtitle,
body.dark-theme .stat-card .stat-label,
body.dark-theme label,
body.dark-theme small,
body.dark-theme .text-muted,
body.dark-theme .form-group label,
body.dark-theme [style*="color:#64748b"],
body.dark-theme [style*="color: #64748b"],
body.dark-theme [style*="color:#6b7099"],
body.dark-theme [style*="color: #6b7099"],
body.dark-theme [style*="color:#475569"],
body.dark-theme [style*="color: #475569"],
body.dark-theme [style*="color:#555"],
body.dark-theme [style*="color: #555"],
body.dark-theme [style*="color:#666"],
body.dark-theme [style*="color: #666"] {
    color: #94a3b8 !important;
}

body.dark-theme p {
    color: #cbd5e1 !important;
}

/* Form inputs, select dropdowns, and textareas */
body.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="color"]):not([type="range"]),
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .form-control,
body.dark-theme .search-input,
body.dark-theme .order-status-select,
body.dark-theme .payment-status-select {
    background-color: #252b44 !important;
    border: 1.5px solid #363d5e !important;
    color: #f8fafc !important;
}
body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    border-color: var(--admin-btn-color, #B37812) !important;
    box-shadow: 0 0 0 3px rgba(179, 120, 18, 0.25) !important;
    outline: none !important;
}
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #7982a9 !important;
}
body.dark-theme select option {
    background-color: #1c2033 !important;
    color: #f8fafc !important;
}

/* Dividers & Borders */
body.dark-theme hr,
body.dark-theme [style*="border-bottom:1px solid #f0f0f0"],
body.dark-theme [style*="border-bottom: 1px solid #f0f0f0"],
body.dark-theme [style*="border-bottom:1px solid #f1f5f9"],
body.dark-theme [style*="border-bottom: 1px solid #f1f5f9"],
body.dark-theme [style*="border-bottom:1px solid #e2e8f0"],
body.dark-theme [style*="border-bottom: 1px solid #e2e8f0"],
body.dark-theme [style*="border-bottom:1px solid #eee"],
body.dark-theme [style*="border-bottom: 1px solid #eee"],
body.dark-theme [style*="border:1px solid #eee"],
body.dark-theme [style*="border: 1px solid #eee"],
body.dark-theme [style*="border:1.5px solid #e4e8f0"],
body.dark-theme [style*="border: 1.5px solid #e4e8f0"],
body.dark-theme [style*="border:1.5px solid #e2e8f0"],
body.dark-theme [style*="border: 1.5px solid #e2e8f0"],
body.dark-theme [style*="border:1px solid #cbd5e1"],
body.dark-theme [style*="border: 1px solid #cbd5e1"],
body.dark-theme [style*="border:1px solid #FFE7D9"],
body.dark-theme [style*="border:1.5px solid #F1E2CE"] {
    border-color: #282e48 !important;
}

/* Tables and DataTables */
body.dark-theme table,
body.dark-theme .data-table,
body.dark-theme table.dataTable,
body.dark-theme .table-card table {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
}
body.dark-theme table thead th,
body.dark-theme table.dataTable thead th,
body.dark-theme table.dataTable thead td,
body.dark-theme .dataTables_wrapper table.dataTable thead th,
body.dark-theme tr[style*="background:#f8fafc"],
body.dark-theme tr[style*="background: #f8fafc"] {
    background-color: #161928 !important;
    color: #94a3b8 !important;
    border-bottom: 1.5px solid #282e48 !important;
    border-top: none !important;
}
body.dark-theme table tbody td,
body.dark-theme table.dataTable tbody td,
body.dark-theme .dataTables_wrapper table.dataTable tbody td {
    background-color: transparent !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid #24293f !important;
}
body.dark-theme table tbody tr,
body.dark-theme table.dataTable tbody tr {
    background-color: #1c2033 !important;
}
body.dark-theme table tbody tr:hover,
body.dark-theme table.dataTable tbody tr:hover,
body.dark-theme .dataTables_wrapper table.dataTable tbody tr:hover {
    background-color: #252b44 !important;
}
body.dark-theme table.dataTable.no-footer,
body.dark-theme .dataTables_wrapper table.dataTable.no-footer {
    border-bottom: 1px solid #282e48 !important;
}

/* DataTables Controls & Pagination */
body.dark-theme .dataTables_wrapper {
    background: transparent !important;
    color: #94a3b8 !important;
}
body.dark-theme .dataTables_wrapper .dataTables_info,
body.dark-theme .dataTables_wrapper .dataTables_length,
body.dark-theme .dataTables_wrapper .dataTables_length label,
body.dark-theme .dataTables_wrapper .dataTables_filter,
body.dark-theme .dataTables_wrapper .dataTables_filter label {
    color: #94a3b8 !important;
}
body.dark-theme .dataTables_wrapper .dataTables_filter input {
    background-color: #252b44 !important;
    border: 1.5px solid #363d5e !important;
    color: #f8fafc !important;
}
body.dark-theme .dataTables_wrapper .dataTables_length select {
    background-color: #252b44 !important;
    border: 1.5px solid #363d5e !important;
    color: #f8fafc !important;
}
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    background-color: #252b44 !important;
    border: 1px solid #363d5e !important;
    color: #cbd5e1 !important;
    box-shadow: none !important;
}
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background-color: #31395b !important;
    color: #ffffff !important;
    border-color: #444e79 !important;
}
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--admin-btn-color, #B37812) !important;
    border-color: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
}
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background-color: #1c2033 !important;
    color: #555d7e !important;
    border-color: #282e48 !important;
}

/* Modals & Overlays */
body.dark-theme .modal-content,
body.dark-theme .delete-cat-modal,
body.dark-theme .admin-profile-modal,
body.dark-theme .admin-logout-modal,
body.dark-theme div[id*="Modal"] > div,
body.dark-theme div[id*="modal"] > div,
body.dark-theme div[id*="Overlay"] > div,
body.dark-theme div[id*="overlay"] > div {
    background-color: #1c2033 !important;
    border: 1px solid #2d3452 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7) !important;
}
body.dark-theme .admin-profile-header,
body.dark-theme .admin-logout-header {
    background: #161928 !important;
    border-bottom: 1px solid #282e48 !important;
}
body.dark-theme .admin-profile-footer,
body.dark-theme .admin-logout-actions {
    background: #161928 !important;
    border-top: 1px solid #282e48 !important;
}
body.dark-theme .admin-logout-cancel {
    background: #252b44 !important;
    color: #cbd5e1 !important;
    border: 1px solid #363d5e !important;
}
body.dark-theme .admin-logout-cancel:hover {
    background: #31395b !important;
    color: #ffffff !important;
}

/* Dropdowns & Popups */
body.dark-theme .topbar-dropdown,
body.dark-theme .date-filter-dropdown,
body.dark-theme .admin-search-results {
    background-color: #1c2033 !important;
    border-color: #2d3452 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
    color: #cbd5e1 !important;
}
body.dark-theme .topbar-dropdown-header,
body.dark-theme .topbar-dropdown-footer {
    border-color: #282e48 !important;
}
body.dark-theme .topbar-dropdown-item {
    color: #cbd5e1 !important;
}
body.dark-theme .topbar-dropdown-item:hover,
body.dark-theme .notification-item:hover,
body.dark-theme .admin-search-item:hover,
body.dark-theme .admin-search-item.highlighted {
    background-color: #252b44 !important;
    color: #ffffff !important;
}
body.dark-theme .notification-item .notif-title {
    color: #ffffff !important;
}
body.dark-theme .notification-item .notif-desc {
    color: #94a3b8 !important;
}
body.dark-theme .theme-toggle-row {
    background-color: #252b44 !important;
    border-radius: 10px !important;
}
body.dark-theme .theme-toggle-info {
    color: #ffffff !important;
}
body.dark-theme .date-preset-pill {
    background-color: #252b44 !important;
    color: #cbd5e1 !important;
    border-color: #363d5e !important;
}
body.dark-theme .date-preset-pill:hover {
    background-color: #31395b !important;
    color: #ffffff !important;
}
body.dark-theme .date-preset-pill.active {
    background: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
}

/* Secondary Buttons & Actions */
body.dark-theme .btn-secondary,
body.dark-theme .btn-light,
body.dark-theme .action-btn,
body.dark-theme .btn-print-label,
body.dark-theme button[type="button"][style*="background:#fff"],
body.dark-theme button[type="button"][style*="background: #fff"],
body.dark-theme button[type="button"][style*="background:#f1f5f9"],
body.dark-theme button[type="button"][style*="background: #f1f5f9"] {
    background-color: #252b44 !important;
    color: #cbd5e1 !important;
    border: 1px solid #363d5e !important;
}
body.dark-theme .btn-secondary:hover,
body.dark-theme .btn-light:hover,
body.dark-theme .action-btn:hover,
body.dark-theme .btn-print-label:hover,
body.dark-theme button[type="button"][style*="background:#fff"]:hover,
body.dark-theme button[type="button"][style*="background: #fff"]:hover,
body.dark-theme button[type="button"][style*="background:#f1f5f9"]:hover,
body.dark-theme button[type="button"][style*="background: #f1f5f9"]:hover {
    background-color: #31395b !important;
    color: #ffffff !important;
}
body.dark-theme .btn-view-order {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #93b5f5 !important;
}
body.dark-theme .btn-view-order:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Badges with Dark Glow / Contrast */
body.dark-theme .status-badge.pending,
body.dark-theme .cl-badge.badge-warning,
body.dark-theme span[style*="background:#fff7ed"],
body.dark-theme span[style*="background: #fff7ed"] {
    background-color: rgba(234, 88, 12, 0.22) !important;
    color: #fb923c !important;
    border: 1px solid rgba(234, 88, 12, 0.35) !important;
}
body.dark-theme .status-badge.processing,
body.dark-theme .cl-badge.badge-info,
body.dark-theme span[style*="background:#eff6ff"],
body.dark-theme span[style*="background: #eff6ff"] {
    background-color: rgba(37, 99, 235, 0.22) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(37, 99, 235, 0.35) !important;
}
body.dark-theme .status-badge.shipped,
body.dark-theme .status-badge.delivered,
body.dark-theme .status-badge.paid,
body.dark-theme .cl-badge.badge-success,
body.dark-theme span[style*="background:#ecfdf5"],
body.dark-theme span[style*="background: #ecfdf5"],
body.dark-theme span[style*="background:#f0fdf4"],
body.dark-theme span[style*="background: #f0fdf4"] {
    background-color: rgba(22, 163, 74, 0.22) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(22, 163, 74, 0.35) !important;
}
body.dark-theme .status-badge.cancelled,
body.dark-theme .status-badge.failed,
body.dark-theme .cl-badge.badge-danger,
body.dark-theme span[style*="background:#fef2f2"],
body.dark-theme span[style*="background: #fef2f2"] {
    background-color: rgba(239, 68, 68, 0.22) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

/* Support Chat in Dark Theme */
body.dark-theme .chat-page-layout {
    background-color: #121520 !important;
}
body.dark-theme .chat-panel-sidebar,
body.dark-theme .chat-panel-header,
body.dark-theme .chat-main-top,
body.dark-theme .chat-main-footer {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
}
body.dark-theme .chat-item {
    color: #cbd5e1 !important;
}
body.dark-theme .chat-item:hover {
    background-color: #252b44 !important;
}
body.dark-theme .chat-item.active {
    background-color: #2d3452 !important;
    border-left-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .chat-item-name {
    color: #ffffff !important;
}
body.dark-theme .chat-item-avatar {
    background: linear-gradient(135deg, #252b44, #363d5e) !important;
    color: #f8fafc !important;
}
body.dark-theme .chat-main-top-left h4 {
    color: #ffffff !important;
}
body.dark-theme .chat-main-top-left p {
    color: #94a3b8 !important;
}
body.dark-theme .msg-row.from-user .msg-bubble {
    background-color: #252b44 !important;
    border-color: #363d5e !important;
    color: #f8fafc !important;
}
body.dark-theme .msg-row.from-bot .msg-bubble {
    background-color: #1e243a !important;
    border-color: #2c3350 !important;
    color: #94a3b8 !important;
}

/* Flatpickr Calendar in Dark Theme */
body.dark-theme .flatpickr-calendar {
    background: #1c2033 !important;
    border: 1px solid #2d3452 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-months {
    background: #161928 !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-months .flatpickr-month,
body.dark-theme .flatpickr-calendar .flatpickr-current-month,
body.dark-theme .flatpickr-calendar .flatpickr-current-month input.cur-year,
body.dark-theme .flatpickr-calendar .flatpickr-current-month select.flatpickr-monthDropdown-months {
    color: #f8fafc !important;
    fill: #f8fafc !important;
}
body.dark-theme .flatpickr-calendar span.flatpickr-weekday {
    background: #161928 !important;
    color: #94a3b8 !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-day {
    color: #cbd5e1 !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-day:hover {
    background: #252b44 !important;
    border-color: #363d5e !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-day.selected,
body.dark-theme .flatpickr-calendar .flatpickr-day.startRange,
body.dark-theme .flatpickr-calendar .flatpickr-day.endRange {
    background: var(--admin-btn-color, #B37812) !important;
    border-color: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-day.inRange {
    background: rgba(179, 120, 18, 0.25) !important;
    border-color: transparent !important;
    color: #f8fafc !important;
}
body.dark-theme .flatpickr-calendar .flatpickr-day.prevMonthDay,
body.dark-theme .flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: #555d7e !important;
}

/* Toast Popups in Dark Theme */
body.dark-theme .cl-popup-toast {
    background-color: #1c2033 !important;
    color: #f8fafc !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px #2d3452 !important;
}
body.dark-theme .cl-popup-title {
    color: #ffffff !important;
}
body.dark-theme .cl-popup-desc {
    color: #cbd5e1 !important;
}
body.dark-theme .cl-popup-close {
    background-color: #252b44 !important;
    color: #a0a5c8 !important;
}
body.dark-theme .cl-popup-close:hover {
    background-color: #31395b !important;
    color: #ffffff !important;
}

/* Footer in Dark Theme */
body.dark-theme .admin-footer {
    background-color: #161928 !important;
    border-top: 1px solid #23283e !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4) !important;
}
body.dark-theme .admin-footer p {
    color: #94a3b8 !important;
}
body.dark-theme .admin-footer a {
    color: var(--admin-btn-color, #B37812) !important;
}

/* ==========================================================================
   SPECIFIC PAGES DARK THEME EXTENSIONS
   ========================================================================== */

/* 1. Reports & Analytics */
body.dark-theme .report-filter-panel,
body.dark-theme .report-table-card,
body.dark-theme .summary-card {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}
body.dark-theme .form-group-cl label,
body.dark-theme .summary-card .info p {
    color: #94a3b8 !important;
}
body.dark-theme .summary-card .info h4,
body.dark-theme .table-header-title h3,
body.dark-theme .page-header-content h2 {
    color: #f8fafc !important;
}
body.dark-theme .form-control-cl {
    background-color: #252b44 !important;
    border: 1.5px solid #363d5e !important;
    color: #f8fafc !important;
}
body.dark-theme .form-control-cl:focus {
    border-color: var(--admin-btn-color, #B37812) !important;
    background-color: #252b44 !important;
    box-shadow: 0 0 0 3px rgba(179, 120, 18, 0.25) !important;
}
body.dark-theme .filter-presets {
    border-top-color: #282e48 !important;
}
body.dark-theme .preset-btn {
    background-color: #252b44 !important;
    border-color: #363d5e !important;
    color: #cbd5e1 !important;
}
body.dark-theme .preset-btn:hover {
    background-color: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
    border-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .btn-reset {
    background-color: #252b44 !important;
    border-color: #363d5e !important;
    color: #94a3b8 !important;
}
body.dark-theme .btn-reset:hover {
    background-color: #31395b !important;
    color: #ffffff !important;
}
body.dark-theme .summary-card.gold .icon-box {
    background: rgba(179, 120, 18, 0.22) !important;
    color: #f59e0b !important;
}
body.dark-theme .summary-card.green .icon-box {
    background: rgba(22, 163, 74, 0.22) !important;
    color: #4ade80 !important;
}
body.dark-theme .summary-card.blue .icon-box {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #93c5fd !important;
}
body.dark-theme .summary-card.purple .icon-box {
    background: rgba(124, 58, 237, 0.22) !important;
    color: #c084fc !important;
}
body.dark-theme .summary-card.red .icon-box {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #f87171 !important;
}

/* 2. Payment Methods */
body.dark-theme .payment-card,
body.dark-theme .gateway-panel {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}
body.dark-theme .payment-card:hover,
body.dark-theme .gateway-panel:hover {
    border-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .payment-card-info h3,
body.dark-theme .gateway-panel h3,
body.dark-theme .section-title {
    color: #f8fafc !important;
}
body.dark-theme .payment-card-info p,
body.dark-theme .gateway-panel .gateway-desc,
body.dark-theme .form-help {
    color: #94a3b8 !important;
}
body.dark-theme .payment-card-icon.cod {
    background: rgba(234, 88, 12, 0.22) !important;
    color: #fb923c !important;
}
body.dark-theme .payment-card-icon.card {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #93c5fd !important;
}
body.dark-theme .payment-status.enabled {
    background: rgba(22, 163, 74, 0.22) !important;
    color: #4ade80 !important;
}
body.dark-theme .payment-status.disabled {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #f87171 !important;
}
body.dark-theme .toggle-slider {
    background-color: #363d5e !important;
}
body.dark-theme .toggle-switch input:checked + .toggle-slider {
    background-color: #16a34a !important;
}
body.dark-theme .callback-box {
    background-color: #161928 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
}
body.dark-theme .gateway-panel .form-group label {
    color: #94a3b8 !important;
}

/* 3. Ordering Process */
body.dark-theme .ordering-card,
body.dark-theme .shipping-rates-card {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}
body.dark-theme .ordering-card:hover {
    border-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .ordering-card-info h3,
body.dark-theme .shipping-rates-card h3 {
    color: #f8fafc !important;
}
body.dark-theme .ordering-card-info p,
body.dark-theme .shipping-rates-card .card-desc {
    color: #94a3b8 !important;
}
body.dark-theme .ordering-card-icon.order {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #93c5fd !important;
}
body.dark-theme .ordering-card-icon.whatsapp {
    background: rgba(37, 211, 102, 0.22) !important;
    color: #4ade80 !important;
}
body.dark-theme .ordering-note {
    background-color: rgba(180, 83, 9, 0.2) !important;
    border-color: #b45309 !important;
    color: #fde047 !important;
}
body.dark-theme .shipping-rates-table {
    color: #cbd5e1 !important;
}
body.dark-theme .shipping-rates-table th {
    color: #94a3b8 !important;
    border-bottom: 1.5px solid #282e48 !important;
}
body.dark-theme .shipping-rates-table td {
    border-bottom: 1px solid #24293f !important;
}
body.dark-theme .shipping-rates-table input[type="text"],
body.dark-theme .shipping-rates-table input[type="number"] {
    background-color: #252b44 !important;
    border: 1.5px solid #363d5e !important;
    color: #f8fafc !important;
}

/* 4. Invoice Template */
body.dark-theme .preview-frame-wrap {
    background-color: #161928 !important;
    border-color: #282e48 !important;
}
body.dark-theme .preview-toolbar {
    background-color: #1c2033 !important;
    border-bottom: 1px solid #282e48 !important;
}
body.dark-theme .preview-toolbar h4 {
    color: #f8fafc !important;
}
body.dark-theme .preview-frame {
    background-color: #161928 !important;
}
body.dark-theme .btn-preview {
    background-color: #252b44 !important;
    color: var(--admin-btn-color, #B37812) !important;
    border: 1px solid #363d5e !important;
}
body.dark-theme .btn-preview:hover {
    background-color: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
}
body.dark-theme .toggle-row {
    border-bottom-color: #282e48 !important;
}
body.dark-theme .toggle-row span {
    color: #f8fafc !important;
}
body.dark-theme .slider {
    background-color: #363d5e !important;
}
body.dark-theme .switch input:checked + .slider {
    background-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .token-hint {
    color: #94a3b8 !important;
}

/* 5. Manage Admins */
body.dark-theme .admin-card,
body.dark-theme .add-admin-form {
    background-color: #1c2033 !important;
    border-color: #282e48 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}
body.dark-theme .admin-card:hover {
    border-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .admin-card-avatar {
    background: linear-gradient(135deg, #252b44, #363d5e) !important;
    color: #f8fafc !important;
}
body.dark-theme .admin-card-info h4,
body.dark-theme .add-admin-form h3 {
    color: #f8fafc !important;
}
body.dark-theme .admin-card-info p {
    color: #94a3b8 !important;
}
body.dark-theme .admin-card-info .admin-date {
    color: #7982a9 !important;
}
body.dark-theme .btn-delete-admin {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
body.dark-theme .btn-delete-admin:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}
body.dark-theme .admin-you-badge {
    background: rgba(22, 163, 74, 0.22) !important;
    color: #4ade80 !important;
}
body.dark-theme .form-grid .form-group label {
    color: #94a3b8 !important;
}
body.dark-theme .form-grid .form-group input {
    background-color: #252b44 !important;
    border: 1.5px solid #363d5e !important;
    color: #f8fafc !important;
}
body.dark-theme .form-grid .form-group input:focus {
    border-color: var(--admin-btn-color, #B37812) !important;
}
body.dark-theme .btn-add-admin {
    background: var(--admin-btn-color, #B37812) !important;
    color: #ffffff !important;
}
body.dark-theme .btn-add-admin:hover {
    background: var(--admin-btn-hover, #96600A) !important;
}


