/* 
 * Premium Admin CSS Stylesheet for Jayesh Solar
 * Modern Dashboard grid, control forms, sidebars, and styled CRUD interfaces
 */

:root {
    --admin-bg: #080b11; /* Matched Black */
    --admin-surface: #0F0F0F; /* Deep Onyx */
    --admin-card: #151f33; /* Dark card */
    --admin-border: rgba(255,255,255,0.06);
    --admin-primary: #D9A05F; /* Signature Gold */
    --admin-primary-hover: #C08F50; /* Rich Gold */
    
    --success: #1D6F20; /* Classic Deep Emerald */
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --text-white: #ffffff; /* White */
    --text-light: #f3f4f6; /* Light grey */
    --text-muted: #9ca3af;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--admin-bg);
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease-in-out;
}

/* 1. Admin Login Page Styling */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.08) 0%, transparent 50%), var(--admin-bg);
}

.login-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 30px;
}

.logo-img-admin-login {
    height: 60px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: #a7f3d0;
}

/* Admin Dashboard Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Navigation */
.admin-sidebar {
    background: var(--admin-surface);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    padding: 25px 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 0 25px 25px;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.35rem;
    font-weight: 800;
}

.logo-img-admin {
    height: 65px;
    width: auto;
    object-fit: contain;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: #cccccc;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--admin-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--admin-primary);
}

.sidebar-link i {
    width: 20px;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 15px 25px 0;
    border-top: 1px solid var(--admin-border);
}

/* Main content panel */
.admin-main {
    padding: 40px;
    overflow-y: auto;
    height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.admin-title-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stats-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    padding: 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-info h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-white);
}

.stats-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-blue { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.icon-purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.icon-green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.icon-gold { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

/* Control Cards / Tables */
.admin-card-box {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-card-header h3 {
    font-size: 1.25rem;
}

/* Styled Admin Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--admin-border);
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.95rem;
}

.admin-table tr:hover td {
    background-color: rgba(255,255,255,0.01);
}

.row-thumbnail {
    width: 50px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--admin-border);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-secondary { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* =========================================================
   TABLE ACTION BUTTONS & EQUAL PROPORTIONAL ALIGNMENT
   ========================================================= */
.action-buttons,
.table-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    vertical-align: middle;
}

.action-buttons form,
.table-actions form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Base Button Animation & Transition (Zero text/icon color flip on hover!) */
.btn,
.btn-icon,
.btn-primary,
.btn-secondary,
.btn-edit,
.btn-delete,
.btn-invoice,
.btn-print,
.btn-whatsapp-share,
.btn-view-website,
.btn-logout {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease !important;
    font-family: inherit;
    text-decoration: none !important;
}

/* Minimal Hover Micro-Animation (No text or icon color change!) */
.btn:hover,
.btn-icon:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-edit:hover,
.btn-delete:hover,
.btn-invoice:hover,
.btn-print:hover,
.btn-whatsapp-share:hover,
.btn-view-website:hover,
.btn-logout:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.12);
}

.btn:active,
.btn-icon:active {
    transform: translateY(0) scale(0.97) !important;
}

/* Base Icon Action Button Sizing (34px x 34px) */
.btn-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.btn-icon i,
.btn-icon span {
    font-size: 0.9rem !important;
    line-height: 1 !important;
}

/* --- 1. MAIN PRIMARY CTA (.btn-primary) - Solid Gold / White Text --- */
.btn-primary,
button.btn-primary,
a.btn-primary,
button[type="submit"].btn-primary {
    background: var(--admin-primary) !important;
    color: #ffffff !important;
    border: 1px solid var(--admin-primary) !important;
    box-shadow: 0 2px 8px rgba(217, 160, 95, 0.22);
}
.btn-primary i,
.btn-primary span,
.btn-primary svg,
.btn-primary * {
    color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:hover i,
.btn-primary:hover span,
.btn-primary:hover * {
    color: #ffffff !important; /* Stays WHITE */
    background: var(--admin-primary-hover, #c08f50) !important;
    border-color: var(--admin-primary-hover, #c08f50) !important;
}

/* --- 2. DELETE CTA (.btn-delete) - RED VARIATION --- */
.btn-delete,
.btn-icon.btn-delete,
button.btn-delete {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.btn-delete i,
.btn-icon.btn-delete i,
button.btn-delete i {
    color: #ef4444 !important;
}
.btn-delete:hover,
.btn-icon.btn-delete:hover,
button.btn-delete:hover {
    background: rgba(239, 68, 68, 0.28) !important;
    color: #ef4444 !important; /* Stays RED */
    border-color: rgba(239, 68, 68, 0.55) !important;
}
.btn-delete:hover i,
.btn-icon.btn-delete:hover i,
button.btn-delete:hover i {
    color: #ef4444 !important; /* Stays RED */
}

/* Light Theme Delete CTA */
body.light-theme .btn-delete,
body.light-theme .btn-icon.btn-delete,
body.light-theme button.btn-delete {
    background: rgba(220, 38, 38, 0.10) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
}
body.light-theme .btn-delete i,
body.light-theme .btn-icon.btn-delete i,
body.light-theme button.btn-delete i {
    color: #dc2626 !important;
}
body.light-theme .btn-delete:hover,
body.light-theme .btn-icon.btn-delete:hover,
body.light-theme button.btn-delete:hover {
    background: rgba(220, 38, 38, 0.20) !important;
    color: #dc2626 !important; /* Stays RED */
    border-color: rgba(220, 38, 38, 0.48) !important;
}
body.light-theme .btn-delete:hover i,
body.light-theme .btn-icon.btn-delete:hover i,
body.light-theme button.btn-delete:hover i {
    color: #dc2626 !important; /* Stays RED */
}

/* --- 3. EDIT CTA (.btn-edit) - GOLD / BRONZE VARIATION --- */
.btn-edit,
.btn-icon.btn-edit,
a.btn-edit {
    background: rgba(217, 160, 95, 0.15) !important;
    color: var(--admin-primary, #d9a05f) !important;
    border: 1px solid rgba(217, 160, 95, 0.35) !important;
}
.btn-edit i,
.btn-icon.btn-edit i,
a.btn-edit i {
    color: var(--admin-primary, #d9a05f) !important;
}
.btn-edit:hover,
.btn-icon.btn-edit:hover,
a.btn-edit:hover {
    background: rgba(217, 160, 95, 0.28) !important;
    color: var(--admin-primary, #d9a05f) !important; /* Stays GOLD */
    border-color: rgba(217, 160, 95, 0.55) !important;
}
.btn-edit:hover i,
.btn-icon.btn-edit:hover i,
a.btn-edit:hover i {
    color: var(--admin-primary, #d9a05f) !important; /* Stays GOLD */
}

/* Light Theme Edit CTA */
body.light-theme .btn-edit,
body.light-theme .btn-icon.btn-edit,
body.light-theme a.btn-edit {
    background: rgba(156, 106, 56, 0.12) !important;
    color: var(--admin-primary, #9c6a38) !important;
    border: 1px solid rgba(156, 106, 56, 0.3) !important;
}
body.light-theme .btn-edit i,
body.light-theme .btn-icon.btn-edit i,
body.light-theme a.btn-edit i {
    color: var(--admin-primary, #9c6a38) !important;
}
body.light-theme .btn-edit:hover,
body.light-theme .btn-icon.btn-edit:hover,
body.light-theme a.btn-edit:hover {
    background: rgba(156, 106, 56, 0.22) !important;
    color: var(--admin-primary, #9c6a38) !important; /* Stays GOLD/BRONZE */
    border-color: rgba(156, 106, 56, 0.48) !important;
}
body.light-theme .btn-edit:hover i,
body.light-theme .btn-icon.btn-edit:hover i,
body.light-theme a.btn-edit:hover i {
    color: var(--admin-primary, #9c6a38) !important; /* Stays GOLD/BRONZE */
}

/* --- 4. PRINT / INVOICE CTA (.btn-invoice, .btn-print) - BLUE VARIATION --- */
.btn-invoice,
.btn-print,
.btn-icon.btn-invoice,
.btn-icon.btn-print {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
}
.btn-invoice i,
.btn-print i,
.btn-icon.btn-invoice i,
.btn-icon.btn-print i {
    color: #3b82f6 !important;
}
.btn-invoice:hover,
.btn-print:hover,
.btn-icon.btn-invoice:hover,
.btn-icon.btn-print:hover {
    background: rgba(59, 130, 246, 0.28) !important;
    color: #3b82f6 !important; /* Stays BLUE */
    border-color: rgba(59, 130, 246, 0.55) !important;
}
.btn-invoice:hover i,
.btn-print:hover i,
.btn-icon.btn-invoice:hover i,
.btn-icon.btn-print:hover i {
    color: #3b82f6 !important; /* Stays BLUE */
}

/* Light Theme Invoice CTA */
body.light-theme .btn-invoice,
body.light-theme .btn-print,
body.light-theme .btn-icon.btn-invoice,
body.light-theme .btn-icon.btn-print {
    background: rgba(37, 99, 235, 0.12) !important;
    color: #2563eb !important;
    border: 1px solid rgba(37, 99, 235, 0.3) !important;
}
body.light-theme .btn-invoice i,
body.light-theme .btn-print i,
body.light-theme .btn-icon.btn-invoice i,
body.light-theme .btn-icon.btn-print i {
    color: #2563eb !important;
}
body.light-theme .btn-invoice:hover,
body.light-theme .btn-print:hover,
body.light-theme .btn-icon.btn-invoice:hover,
body.light-theme .btn-icon.btn-print:hover {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #2563eb !important; /* Stays BLUE */
    border-color: rgba(37, 99, 235, 0.48) !important;
}
body.light-theme .btn-invoice:hover i,
body.light-theme .btn-print:hover i,
body.light-theme .btn-icon.btn-invoice:hover i,
body.light-theme .btn-icon.btn-print:hover i {
    color: #2563eb !important; /* Stays BLUE */
}

/* --- 5. WHATSAPP CTA (.btn-whatsapp-share) - GREEN VARIATION --- */
.btn-whatsapp-share,
.btn-icon.btn-whatsapp-share {
    background: rgba(37, 211, 102, 0.15) !important;
    color: #25d366 !important;
    border: 1px solid rgba(37, 211, 102, 0.35) !important;
}
.btn-whatsapp-share i,
.btn-icon.btn-whatsapp-share i {
    color: #25d366 !important;
}
.btn-whatsapp-share:hover,
.btn-icon.btn-whatsapp-share:hover {
    background: rgba(37, 211, 102, 0.28) !important;
    color: #25d366 !important; /* Stays GREEN */
    border-color: rgba(37, 211, 102, 0.55) !important;
}
.btn-whatsapp-share:hover i,
.btn-icon.btn-whatsapp-share:hover i {
    color: #25d366 !important; /* Stays GREEN */
}

/* Light Theme WhatsApp Share CTA */
body.light-theme .btn-whatsapp-share,
body.light-theme .btn-icon.btn-whatsapp-share {
    background: rgba(21, 128, 61, 0.12) !important;
    color: #15803d !important;
    border: 1px solid rgba(21, 128, 61, 0.3) !important;
}
body.light-theme .btn-whatsapp-share i,
body.light-theme .btn-icon.btn-whatsapp-share i {
    color: #15803d !important;
}
body.light-theme .btn-whatsapp-share:hover,
body.light-theme .btn-icon.btn-whatsapp-share:hover {
    background: rgba(21, 128, 61, 0.22) !important;
    color: #15803d !important; /* Stays GREEN */
    border-color: rgba(21, 128, 61, 0.48) !important;
}
body.light-theme .btn-whatsapp-share:hover i,
body.light-theme .btn-icon.btn-whatsapp-share:hover i {
    color: #15803d !important; /* Stays GREEN */
}

/* --- 6. UNIQUE HEADER & SIGNOUT BUTTONS --- */
.btn-view-website {
    background: rgba(217, 160, 95, 0.12) !important;
    color: var(--admin-primary, #d9a05f) !important;
    border: 1px solid rgba(217, 160, 95, 0.3) !important;
    padding: 8px 16px !important;
    border-radius: 50px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
}
.btn-view-website i {
    color: var(--admin-primary, #d9a05f) !important;
}
.btn-view-website:hover {
    background: rgba(217, 160, 95, 0.24) !important;
    color: var(--admin-primary, #d9a05f) !important; /* Text color stays GOLD */
    border-color: rgba(217, 160, 95, 0.5) !important;
}
.btn-view-website:hover i {
    color: var(--admin-primary, #d9a05f) !important;
}

body.light-theme .btn-view-website {
    background: rgba(156, 106, 56, 0.10) !important;
    color: var(--admin-primary, #9c6a38) !important;
    border: 1px solid rgba(156, 106, 56, 0.28) !important;
}
body.light-theme .btn-view-website i {
    color: var(--admin-primary, #9c6a38) !important;
}
body.light-theme .btn-view-website:hover {
    background: rgba(156, 106, 56, 0.20) !important;
    color: var(--admin-primary, #9c6a38) !important; /* Text color stays GOLD/BRONZE */
    border-color: rgba(156, 106, 56, 0.45) !important;
}
body.light-theme .btn-view-website:hover i {
    color: var(--admin-primary, #9c6a38) !important;
}

/* Sign Out / Logout CTA */
.btn-logout {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.28) !important;
    padding: 8px 16px !important;
    border-radius: 50px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
}
.btn-logout i {
    color: #ef4444 !important;
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.24) !important;
    color: #ef4444 !important; /* Text color stays RED */
    border-color: rgba(239, 68, 68, 0.5) !important;
}
.btn-logout:hover i {
    color: #ef4444 !important;
}

body.light-theme .btn-logout {
    background: rgba(220, 38, 38, 0.10) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.25) !important;
}
body.light-theme .btn-logout i {
    color: #dc2626 !important;
}
body.light-theme .btn-logout:hover {
    background: rgba(220, 38, 38, 0.20) !important;
    color: #dc2626 !important; /* Text color stays RED */
    border-color: rgba(220, 38, 38, 0.45) !important;
}
body.light-theme .btn-logout:hover i {
    color: #dc2626 !important;
}

/* Admin Input Forms Layout */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #fff;
}

.admin-form-control {
    width: 100%;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.admin-form-control:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.2);
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Modals & Dialogs (For Edit inline, or just use separate add/edit page sections, which are highly reliable in PHP!) */
.modal-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        display: none;
    }
    #adminSidebarToggle {
        display: inline-flex !important;
    }
    .admin-sidebar.open {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 1010;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.9);
        background-color: var(--admin-surface) !important;
    }
    .admin-main {
        padding: 10px;
    }
    .modal-split-layout {
        grid-template-columns: 1fr;
    }
    .admin-header {
        padding: 15px 15px !important;
    }
    .admin-topbar-title h2 {
        font-size: 1.25rem;
    }
}

/* =========================================================
   LIGHT THEME COMPREHENSIVE OVERRIDES
   ========================================================= */
body.light-theme {
    background-color: #f8fafc !important;
    color: #1e2937 !important;
}

body.light-theme .admin-sidebar {
    background-color: #ffffff !important;
    border-right-color: rgba(0,0,0,0.08) !important;
}

body.light-theme .admin-header {
    background-color: #ffffff !important;
    border-bottom-color: rgba(0,0,0,0.08) !important;
}

body.light-theme .sidebar-link {
    color: #4b5563 !important;
}
body.light-theme .sidebar-link:hover {
    background: rgba(156,106,56,0.08) !important;
    color: var(--admin-primary) !important;
}
body.light-theme .sidebar-link.active {
    background: rgba(156,106,56,0.12) !important;
    color: var(--admin-primary) !important;
    border-left-color: var(--admin-primary) !important;
}
body.light-theme .sidebar-link i {
    color: inherit !important;
}

/* === ALL HEADINGS === */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
    color: #111827 !important;
}

/* === CARDS === */
body.light-theme .admin-card-box {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08) !important;
}
body.light-theme .stats-card {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08) !important;
}

/* === TABLES === */
body.light-theme .admin-table th {
    color: #6b7280 !important;
    border-bottom-color: rgba(0,0,0,0.12) !important;
    background: transparent !important;
}
body.light-theme .admin-table td {
    color: #1f2937 !important;
    border-bottom-color: rgba(0,0,0,0.07) !important;
}
body.light-theme .admin-table tr:hover td {
    background-color: rgba(0,0,0,0.02) !important;
}

body.light-theme .admin-table td strong { color: #1f2937 !important; }
body.light-theme .admin-table td span:not(.badge):not(.btn *):not(.btn) { color: #1f2937 !important; }
body.light-theme .admin-table td a:not(.btn):not(.btn *) { color: #1f2937 !important; }

/* === BADGES === */
body.light-theme .badge-success { background: rgba(16,185,129,0.15) !important; color: #065f46 !important; }
body.light-theme .badge-danger  { background: rgba(239,68,68,0.15) !important;  color: #991b1b !important; }
body.light-theme .badge-secondary { background: rgba(0,0,0,0.07) !important; color: #4b5563 !important; }

/* === FORMS & FIELD CONSISTENCY === */
body.light-theme .admin-form-label { color: #374151 !important; }
body.light-theme .admin-form-control,
body.light-theme input,
body.light-theme textarea {
    background-color: #ffffff !important;
    color: #111827 !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
}
body.light-theme .admin-form-control:focus,
body.light-theme input:focus,
body.light-theme textarea:focus,
body.light-theme select:focus {
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 2px rgba(156,106,56,0.15) !important;
}
body.light-theme input::placeholder,
body.light-theme textarea::placeholder { color: #9ca3af !important; }

body.light-theme .btn-secondary { background: rgba(0,0,0,0.06) !important; color: #374151 !important; border: 1px solid rgba(0,0,0,0.12) !important; }
body.light-theme .btn-secondary:hover { background: rgba(0,0,0,0.10) !important; color: #374151 !important; }

/* === CUSTOMER CARD & MODALS === */
body.light-theme .admin-customer-card {
    background: #ffffff !important;
}
body.light-theme .admin-customer-card h4 {
    color: #1f2937 !important;
}

/* === UNIVERSAL CATCH-ALL FOR INLINE WHITE TEXT (EXCLUDING ALL BUTTONS & BADGES) === */
body.light-theme :not(.btn):not(.btn *):not(button):not(button *):not(.badge):not(.badge *)[style*="color: #fff"],
body.light-theme :not(.btn):not(.btn *):not(button):not(button *):not(.badge):not(.badge *)[style*="color:#fff"],
body.light-theme :not(.btn):not(.btn *):not(button):not(button *):not(.badge):not(.badge *)[style*="color: #ffffff"],
body.light-theme :not(.btn):not(.btn *):not(button):not(button *):not(.badge):not(.badge *)[style*="color:#ffffff"] {
    color: #1f2937 !important;
}

/* === PROGRESS BAR & ROW BORDERS === */
body.light-theme [style*="background: rgba(255,255,255,0.06)"]   { background: rgba(0,0,0,0.08) !important; }
body.light-theme [style*="border-bottom: 1px solid rgba(255,255,255,0.02)"] { border-bottom-color: rgba(0,0,0,0.06) !important; }

/* === EMPTY STATE BACKGROUNDS === */
body.light-theme [style*="background: rgba(255, 255, 255, 0.02)"],
body.light-theme [style*="background: rgba(255,255,255,0.02)"] {
    background: #f8f9fa !important;
    border-color: rgba(0,0,0,0.08) !important;
}

/* === NOTIFICATION DROPDOWN === */
body.light-theme #adminNotifDropdown {
    background-color: #ffffff !important;
    border-color: var(--admin-primary) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}
body.light-theme #adminNotifDropdown a { color: #1f2937 !important; }

/* === DELETE MODAL === */
body.light-theme #deleteConfirmModal > div {
    background-color: #ffffff !important;
    border-color: #dc2626 !important;
}
body.light-theme #deleteConfirmModal h3 { color: #111827 !important; }
body.light-theme #deleteConfirmModal p  { color: #4b5563 !important; }

/* === ALERTS === */
body.light-theme [style*="background: rgba(37, 211, 102, 0.1)"] { background: rgba(16,185,129,0.12) !important; color: #065f46 !important; }
body.light-theme #btnAdminNotifBell { color: #374151 !important; }
body.light-theme #btnAdminNotifBell:hover { color: var(--admin-primary) !important; }
body.light-theme .profile-name { color: #111827 !important; }
body.light-theme .profile-avatar { color: var(--admin-primary) !important; }
body.light-theme .admin-title-desc { color: #4b5563 !important; }

/* === PAGINATION === */
body.light-theme .pagination .page-link { background: #ffffff !important; color: #374151 !important; border-color: rgba(0,0,0,0.12) !important; }
body.light-theme .pagination .page-item.active .page-link { background: var(--admin-primary) !important; color: #ffffff !important; border-color: var(--admin-primary) !important; }
body.light-theme .pagination .page-item.disabled .page-link { color: #9ca3af !important; background: #f3f4f6 !important; }

/* === MISC === */
body.light-theme .admin-table strong { color: #111827 !important; }
body.light-theme #adminSidebarClose { color: #dc2626 !important; }

/* =========================================================
   GLOBAL SELECT DROPDOWN ARROW (Single Right-Aligned Arrow, Zero Repeats)
   ========================================================= */
select,
select.admin-form-control,
.admin-form-control select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 36px !important;
    background-color: var(--admin-card, #151f33) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d9a05f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px 14px !important;
    cursor: pointer !important;
}

select::-ms-expand {
    display: none !important;
}

/* Light Theme Select Rules - Single Right-Aligned Bronze Chevron */
body.light-theme select,
body.light-theme select.admin-form-control,
body.light-theme .admin-form-control select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239c6a38' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px 14px !important;
    padding-right: 36px !important;
}

/* =========================================================
   LIGHT THEME MODALS & POPUPS COMPATIBILITY
   ========================================================= */
body.light-theme [id*="Modal"] > div,
body.light-theme [id*="modal"] > div,
body.light-theme .modal-content,
body.light-theme .modal-dialog {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme [id*="Modal"] h2,
body.light-theme [id*="Modal"] h3,
body.light-theme [id*="Modal"] h4,
body.light-theme [id*="Modal"] p,
body.light-theme [id*="Modal"] span:not(.badge):not(.btn *):not(.btn),
body.light-theme [id*="Modal"] label {
    color: #111827 !important;
}

body.light-theme [id*="Modal"] input,
body.light-theme [id*="Modal"] textarea,
body.light-theme [id*="Modal"] select {
    background-color: #ffffff !important;
    color: #111827 !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
}

/* Customer Directory Card Light Theme Border */
body.light-theme .admin-customer-card {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}
