/* style.css - Premium Dashboard Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(30, 41, 59, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #a855f7; /* Purple */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --hover-bg: rgba(99, 102, 241, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

/* Auth Pages (Login & Register) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%),
                #0b0f19;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 40px;
    transition: transform 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
}

.auth-logo {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 30px;
}

.form-control {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.3s;
}

.form-control:focus {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.btn-primary-gradient {
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: opacity 0.3s, transform 0.2s;
}

.btn-primary-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.rk-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.rk-logo-light {
    display: none;
}

.rk-logo-dark {
    display: block;
}

html.light-mode .rk-logo-light {
    display: block;
}

html.light-mode .rk-logo-dark {
    display: none;
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 14px;
}

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

.menu-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 16px 10px 8px 10px;
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.menu-item i,
.menu-dropdown-header i.main-icon {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 10px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.menu-item:hover i,
.menu-dropdown-header:hover i.main-icon {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.menu-item:hover, .menu-item.active {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.menu-item.active {
    border-left: 3px solid var(--accent-primary);
}

.menu-item-submenu {
    padding-left: 42px;
    font-size: 0.9rem;
}

/* Sidebar Dropdown Menus */
.menu-dropdown {
    margin-bottom: 4px;
}

.menu-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    margin-bottom: 4px;
}

.menu-dropdown-header > div {
    display: flex;
    align-items: center;
}


.menu-dropdown-header .arrow-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.menu-dropdown-header:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

/* Toggle chevron rotation when open */
.menu-dropdown.open .menu-dropdown-header .arrow-icon {
    transform: rotate(90deg);
}

.menu-dropdown-body {
    display: none; /* Collapsed by default */
    padding-left: 8px;
    margin-top: 2px;
    margin-bottom: 8px;
    border-left: 1px solid var(--border-color);
    margin-left: 20px;
}

/* Light mode support for body border */
html.light-mode .menu-dropdown-body {
    border-left-color: #cbd5e1;
}

.menu-dropdown.open .menu-dropdown-body {
    display: block;
}

/* Submenu items inside dropdown */
.menu-dropdown .menu-item {
    font-size: 0.88rem;
    padding: 8px 12px;
    margin-bottom: 2px;
}

/* Highlight the section header when a child is active */
.menu-dropdown.active-within .menu-dropdown-header {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.05); /* subtle glow */
    border-left: 3px solid var(--accent-primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Highlight active subitem but remove the side border indicator to keep it clean */
.menu-dropdown .menu-item.active {
    border-left: none !important;
    background-color: var(--hover-bg) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
}


/* User profile section in sidebar footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
}

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

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.logout-icon {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.logout-icon:hover {
    color: var(--danger);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Premium Topbar Styling (matching screenshot) */
.top-navbar {
    height: 60px;
    background: #09090b !important; /* solid pitch black */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 999;
}

.topbar-brand-section {
    display: flex;
    align-items: center;
}

.airtel-brand-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.airtel-logo-img {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.airtel-text {
    color: #e31837;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.04em;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
    line-height: 1;
}

.topbar-divider {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.18);
    margin: 0 12px;
}

.topbar-version-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-size: 0.72rem;
    font-weight: 500;
}

.topbar-version-info .info-top {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
    letter-spacing: 0.02em;
}

.topbar-version-info .info-bottom {
    color: #a1a1aa;
    font-size: 0.65rem;
}

/* Middle Search Section */
.topbar-search-section {
    flex: 1;
    max-width: 320px;
    margin: 0 20px;
}

.topbar-search-form {
    margin: 0;
    width: 100%;
}

.topbar-search-wrapper {
    position: relative;
    width: 100%;
}

.topbar-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a1a1aa;
    font-size: 0.85rem;
    pointer-events: none;
}

.topbar-search-input {
    width: 100%;
    background: #18181b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    padding: 6px 12px 6px 34px !important;
    border-radius: 6px !important;
    font-size: 0.82rem !important;
    outline: none !important;
    transition: all 0.2s ease;
}

.topbar-search-input:focus {
    border-color: var(--accent-primary) !important;
    background: #27272a !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
}

/* Right section action items */
.topbar-actions-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-icon-btn {
    background: none;
    border: none;
    color: #a1a1aa;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.topbar-icon-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.topbar-store-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    height: 38px;
}

.topbar-store-card .store-icon {
    color: #a1a1aa;
    font-size: 0.95rem;
}

.topbar-store-card .store-details {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar-store-card .store-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #38bdf8; /* sky blue or custom matching user's shop branding */
    white-space: nowrap;
}

.topbar-store-card .store-sub {
    font-size: 0.62rem;
    color: #a1a1aa;
}

.topbar-profile-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    height: 38px;
}

.topbar-avatar-initial {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #52525b; /* neutral zinc gray */
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-profile-card .profile-details {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar-profile-card .profile-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.topbar-profile-card .profile-sub {
    font-size: 0.62rem;
    color: #38bdf8; /* sky blue accent text color */
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.page-container {
    padding: 30px;
    flex-grow: 1;
}

/* Card Metrics */
.stat-card {
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 3rem;
    opacity: 0.15;
    color: var(--accent-primary);
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0 5px 0;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--success);
}

.stat-desc.negative {
    color: var(--danger);
}

/* Modern tables styling */
.custom-table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0 8px;
}

.custom-table th {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
}

.custom-table tbody tr {
    background-color: rgba(30, 41, 59, 0.3);
    border-radius: 10px;
    transition: background-color 0.2s, transform 0.2s;
}

.custom-table tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.5);
    transform: scale(1.005);
}

.custom-table td {
    padding: 16px;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td:first-child {
    border-left: 1px solid var(--border-color);
    border-radius: 10px 0 0 10px;
}

.custom-table td:last-child {
    border-right: 1px solid var(--border-color);
    border-radius: 0 10px 10px 0;
}

/* Badges styling */
.badge-pending {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
}

/* CSV Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    background: rgba(30, 41, 59, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Sidebar Toggle for Mobile */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        left: -280px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

/* Smooth fade animation for loaded pages */
.fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Blinking warning badge for Ageing */
@keyframes warningBlink {
    0% { opacity: 1; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
    50% { opacity: 0.6; box-shadow: 0 0 2px rgba(239, 68, 68, 0.2); }
    100% { opacity: 1; box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

.warning-blink {
    animation: warningBlink 1.5s infinite ease-in-out;
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Parent Black Ribbon indicator */
.card-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 70px;
    height: 70px;
    overflow: hidden;
    pointer-events: none;
    border-top-right-radius: 16px; /* Match card radius */
}

.card-ribbon::before {
    content: 'IPTV';
    position: absolute;
    top: 12px;
    right: -20px;
    width: 90px;
    background: #000000;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    transform: rotate(45deg);
    line-height: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.cursor-pointer {
    cursor: pointer;
}

/* Daily Stock Table Custom Styling */
.daily-stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.45);
    border-radius: 12px;
    overflow: hidden;
}

.daily-stock-table th, .daily-stock-table td {
    padding: 6px 10px;
    text-align: center;
    border: 1px solid #4b5563 !important; /* Solid slate-600 gray border */
    vertical-align: middle;
}

.bg-daily-header {
    background-color: #854d0e !important; /* Brown-Orange theme color matching Daily Stock Report top header */
    color: #ffffff !important;
    font-weight: 700;
}

.bg-daily-blue-dark {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: bold;
}

.bg-daily-blue-light {
    background-color: #38bdf8 !important;
    color: #0f172a !important;
    font-weight: bold;
}

.bg-daily-orange {
    background-color: #ea580c !important;
    color: #ffffff !important;
    font-weight: bold;
}

.bg-daily-footer-dark {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    font-weight: 700;
}

.bg-daily-yellow {
    background-color: #facc15 !important;
    color: #0f172a !important;
    font-weight: bold;
}

.bg-daily-gray {
    background-color: #cbd5e1 !important;
    color: #0f172a !important;
    font-weight: bold;
}

/* Stock Cell Status Indicators (with dark/light text for readability inside cells) */
.stock-cell-green {
    background-color: #15803d !important;
    color: #ffffff !important;
}

.stock-cell-yellow {
    background-color: #eab308 !important;
    color: #0f172a !important;
    font-weight: 600;
}

.stock-cell-orange {
    background-color: #f97316 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.stock-cell-red {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Edit hover pointer */
.stock-editable-cell {
    cursor: pointer;
    transition: background-color 0.2s;
}
.stock-editable-cell:hover {
    filter: brightness(1.2);
}

/* Copyable cell utility */
.copy-click {
    cursor: pointer !important;
    transition: filter 0.2s;
}
.copy-click:hover {
    filter: brightness(1.25) !important;
}

/* Mobile responsiveness fixes */
@media (max-width: 767.98px) {
    /* 1. Page container & glass-panel padding */
    .page-container {
        padding: 12px !important;
    }
    .glass-panel.p-4 {
        padding: 1rem !important;
    }

    /* 2. Top navbar search stretch */
    .navbar-left-section {
        max-width: 85% !important;
    }

    /* 3. Pending cards layout */
    .card-item {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 15px !important;
        padding-top: 40px !important; /* leaves space for absolute label */
        gap: 12px !important;
    }
    .card-index-label {
        position: absolute !important;
        top: 12px !important;
        left: 12px !important;
        min-width: auto !important;
        text-align: left !important;
        padding: 0 !important;
        font-size: 1rem !important;
    }

    /* Stacking controls column inside .card-item */
    .card-item > div:last-child {
        width: 100% !important;
        justify-content: space-between !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .card-item > div:last-child > div:nth-child(3),
    .card-item > div:last-child > div:nth-child(4) {
        width: 100% !important;
        flex-grow: 1 !important;
    }

    .card-item select {
        width: 100% !important;
    }

    /* 4. Wide table responsively scrolling */
    .custom-table th,
    .custom-table td {
        white-space: nowrap !important;
    }
    /* Let long text wrap in the description column (usually 2nd column) of tables */
    .custom-table td:nth-child(2) {
        white-space: normal !important;
        min-width: 200px !important;
    }
}

/* DataTables & Bootstrap 5 Table Theme Overrides */
.custom-table {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    width: 100% !important;
}

.custom-table tbody tr {
    background-color: rgba(30, 41, 59, 0.45) !important;
    border-radius: 10px !important;
    transition: all 0.2s ease;
}

.custom-table tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.7) !important;
}

.custom-table td {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-top: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 16px !important;
}

.custom-table td:first-child {
    border-left: 1px solid var(--border-color) !important;
    border-radius: 10px 0 0 10px !important;
}

.custom-table td:last-child {
    border-right: 1px solid var(--border-color) !important;
    border-radius: 0 10px 10px 0 !important;
}

.custom-table th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
    padding: 10px 16px !important;
}

/* Remove vertical scrollbars from responsive containers inside reports */
.table-responsive {
    scrollbar-width: thin;
    overflow-y: hidden !important; /* Hide vertical scrollbar inside tables */
}

/* Fix DataTable pagination and length select colors */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary) !important;
    margin-top: 10px;
    margin-bottom: 10px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 6px;
    padding: 4px 8px;
}

/* Light Mode Variables Override */
html.light-mode {
    --bg-color: #f1f5f9;       /* Soft slate background */
    --sidebar-bg: #ffffff;    /* Clean white sidebar */
    --card-bg: #ffffff;       /* Clean white cards */
    --border-color: #e2e8f0;   /* Light gray border */
    --text-primary: #0f172a;   /* Premium dark slate primary text */
    --text-secondary: #475569; /* Slate secondary text */
    --hover-bg: rgba(99, 102, 241, 0.08); /* Premium soft indigo hover */
}

/* Light Mode Shadow and Elevation Overrides */
html.light-mode .sidebar {
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.03) !important;
}

html.light-mode .top-navbar {
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.02) !important;
}

/* Light Mode Custom Styling Overrides */
html.light-mode .top-navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .topbar-version-info .info-top {
    color: #09090b !important;
}

html.light-mode .topbar-version-info .info-bottom {
    color: #71717a !important;
}

html.light-mode .topbar-divider {
    background-color: #e4e4e7 !important;
}

html.light-mode .topbar-search-input {
    background: #f4f4f5 !important;
    border-color: #e4e4e7 !important;
    color: #09090b !important;
}

html.light-mode .topbar-search-input:focus {
    background: #ffffff !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
}

html.light-mode .topbar-search-wrapper .search-icon {
    color: #71717a !important;
}

html.light-mode .topbar-icon-btn {
    color: #71717a !important;
}

html.light-mode .topbar-icon-btn:hover {
    color: #09090b !important;
    background-color: #f4f4f5 !important;
}

html.light-mode .topbar-store-card {
    background: #f4f4f5 !important;
    border-color: #e4e4e7 !important;
}

html.light-mode .topbar-store-card .store-icon {
    color: #71717a !important;
}

html.light-mode .topbar-store-card .store-name {
    color: var(--accent-primary) !important;
}

html.light-mode .topbar-store-card .store-sub {
    color: #71717a !important;
}

html.light-mode .topbar-profile-card {
    background: #f4f4f5 !important;
    border-color: #e4e4e7 !important;
}

html.light-mode .topbar-profile-card .profile-name {
    color: #09090b !important;
}

html.light-mode .topbar-profile-card .profile-sub {
    color: var(--accent-primary) !important;
}

html.light-mode .topbar-avatar-initial {
    background-color: #e4e4e7 !important;
    color: #09090b !important;
    border-color: #d4d4d8 !important;
}

/* Responsive adjustments for the premium topbar */
@media (max-width: 767.98px) {
    .topbar-search-section {
        max-width: 180px;
        margin: 0 8px;
    }
}

@media (max-width: 575.98px) {
    .topbar-divider,
    .topbar-version-info,
    .topbar-store-card,
    .topbar-profile-card .profile-details {
        display: none !important;
    }
    .topbar-search-section {
        max-width: 130px;
        margin: 0 4px;
    }
    .top-navbar {
        padding: 0 10px;
    }
}

html.light-mode .custom-table tbody tr {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

html.light-mode .custom-table tbody tr:hover {
    background-color: #e2e8f0 !important;
}

html.light-mode .form-control,
html.light-mode .form-select {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #cbd5e1 !important;
}

html.light-mode .form-control:focus,
html.light-mode .form-select:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    border-color: var(--accent-primary) !important;
    color: #000000 !important;
}

html.light-mode .input-group-text {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

html.light-mode .navigate-to-page {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

html.light-mode .navigate-to-page:hover {
    background: rgba(245, 158, 11, 0.15) !important;
}

html.light-mode .global-search-container input {
    background-color: #ffffff !important;
    color: #000000 !important;
}

html.light-mode .dataTables_wrapper .dataTables_length select,
html.light-mode .dataTables_wrapper .dataTables_filter input {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #cbd5e1 !important;
}

html.light-mode .dataTables_wrapper .dataTables_length label,
html.light-mode .dataTables_wrapper .dataTables_filter label,
html.light-mode .dataTables_wrapper .dataTables_info,
html.light-mode .dataTables_wrapper .dataTables_paginate {
    color: #334155 !important;
}

html.light-mode .logout-icon:hover {
    color: #ef4444 !important;
}

html.light-mode .daily-stock-table {
    background: #ffffff !important;
    color: #000000 !important;
}

html.light-mode .daily-stock-table th,
html.light-mode .daily-stock-table td {
    border-color: #cbd5e1 !important;
}

html.light-mode .navbar-title,
html.light-mode .text-white {
    color: #000000 !important;
}

html.light-mode .text-secondary {
    color: #334155 !important;
}

/* Global Form Control & Select Dark/Default Theme Styling */
.form-control,
.form-select {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    color: var(--text-primary) !important;
}

.input-group-text {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* Light Mode Overrides for Form Elements */
html.light-mode .form-control,
html.light-mode .form-select {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #cbd5e1 !important;
}

html.light-mode .form-control:focus,
html.light-mode .form-select:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    border-color: var(--accent-primary) !important;
    color: #000000 !important;
}

html.light-mode .input-group-text {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

/* SweetAlert2 Light Mode Overrides */
html.light-mode .swal2-popup {
    background: #ffffff !important;
    color: #0f172a !important;
}

html.light-mode .swal2-title,
html.light-mode .swal2-html-container,
html.light-mode .swal2-validation-message {
    color: #0f172a !important;
}

html.light-mode .swal2-popup p,
html.light-mode .swal2-popup span,
html.light-mode .swal2-popup div:not(.swal2-icon) {
    color: #475569 !important;
}

html.light-mode .swal2-popup strong {
    color: #0f172a !important;
}

/* Outline Buttons Light Mode Overrides */
html.light-mode .btn-outline-light {
    color: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
}

html.light-mode .btn-outline-light:hover {
    color: #ffffff !important;
    background-color: var(--accent-primary) !important;
}

/* Premium Stat Cards & Target Tracker Card Light Mode Overrides */
html.light-mode .premium-stat-card {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html.light-mode .premium-stat-card:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
}

html.light-mode .badge-ratio {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    color: #475569 !important;
}

html.light-mode .target-tracker-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: #000000 !important;
}

/* Exclude colored elements from text-white class override in Light Mode */
html.light-mode .badge.text-white,
html.light-mode .btn.text-white,
html.light-mode .badge.bg-primary,
html.light-mode .badge.bg-success,
html.light-mode .badge.bg-danger,
html.light-mode .btn-primary-gradient,
html.light-mode .stock-cell-green,
html.light-mode .stock-cell-orange,
html.light-mode .stock-cell-red {
    color: #ffffff !important;
}

/* Ensure text inside dark table cells of Daily Stock remains white in Light Mode */
html.light-mode .bg-daily-orange td,
html.light-mode .bg-daily-orange th,
html.light-mode .bg-daily-footer-dark td,
html.light-mode .bg-daily-footer-dark th,
html.light-mode .bg-daily-header td,
html.light-mode .bg-daily-header th,
html.light-mode .bg-daily-blue-dark td,
html.light-mode .bg-daily-blue-dark th {
    color: #ffffff !important;
}

/* Ensure inline table selects in FWA Stock are theme-aware in Light Mode */
html.light-mode .fwa-stock-table select.table-select-issuance,
html.light-mode .fwa-stock-table select.table-select-assigned {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #cbd5e1 !important;
}

/* Ensure Daily Entry cart panel and its children are theme-aware in Light Mode */
html.light-mode .cart-panel {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}
html.light-mode .cart-item-row {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
html.light-mode .cart-item-qty-control {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}
html.light-mode .cart-qty-btn {
    color: #334155 !important;
}
html.light-mode .cart-qty-btn:hover {
    background: #cbd5e1 !important;
    color: #000000 !important;
}
html.light-mode .cart-qty-input {
    color: #000000 !important;
}
html.light-mode .cart-item-row .text-white-50 {
    color: #475569 !important;
}
html.light-mode #cartTotalVal {
    color: #000000 !important;
}

/* ==========================================
   COLORFUL CARD SCHEME SYSTEM (LIGHT & DARK)
   ========================================== */

/* 1. Stat Cards (Home & Expense Reports) */
.stat-card {
    border-left: 4px solid var(--accent-primary) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s ease, 
                background-color 0.3s ease,
                border-color 0.3s ease !important;
}

.stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Stat Cards: Dark mode color variants */
.stat-card:has(.text-warning) {
    border-left-color: var(--warning) !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.07) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.stat-card:has(.text-success) {
    border-left-color: var(--success) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.stat-card:has(.text-info) {
    border-left-color: #06b6d4 !important;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.07) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.stat-card:has(.text-primary) {
    border-left-color: var(--accent-primary) !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.07) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.stat-card:has(.text-danger) {
    border-left-color: var(--danger) !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.07) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}

/* Stat Cards: Icon color variations */
.stat-card:has(.text-warning) .stat-icon { color: var(--warning) !important; opacity: 0.18 !important; }
.stat-card:has(.text-success) .stat-icon { color: var(--success) !important; opacity: 0.18 !important; }
.stat-card:has(.text-info) .stat-icon { color: #06b6d4 !important; opacity: 0.18 !important; }
.stat-card:has(.text-primary) .stat-icon { color: var(--accent-primary) !important; opacity: 0.18 !important; }
.stat-card:has(.text-danger) .stat-icon { color: var(--danger) !important; opacity: 0.18 !important; }

/* Stat Cards: Hover effect on icons */
.stat-card:hover .stat-icon {
    opacity: 0.28 !important;
    transform: scale(1.1);
}

/* Stat Cards: Light mode overrides */
html.light-mode .stat-card {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}
html.light-mode .stat-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .stat-card:has(.text-warning) {
    border-left-color: var(--warning) !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .stat-card:has(.text-success) {
    border-left-color: var(--success) !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .stat-card:has(.text-info) {
    border-left-color: #06b6d4 !important;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .stat-card:has(.text-primary) {
    border-left-color: var(--accent-primary) !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .stat-card:has(.text-danger) {
    border-left-color: var(--danger) !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, #ffffff 100%) !important;
}


/* 2. Premium Stat Cards (Home Monthly Targets) */
/* Dark Mode background variants */
.premium-stat-card.border-left-wifi {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.premium-stat-card.border-left-iptv {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.premium-stat-card.border-left-gad {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.premium-stat-card.border-left-upgrade {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.premium-stat-card.border-left-infra {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.premium-stat-card.border-left-cpe {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}
.premium-stat-card.border-left-sla {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.05) 0%, rgba(30, 41, 59, 0.45) 100%) !important;
}

/* Light Mode Overrides for targets tracker card container itself */
html.light-mode .target-tracker-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

/* Light Mode Card Overrides for target items */
html.light-mode .premium-stat-card {
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}
html.light-mode .premium-stat-card:hover {
    border-color: #94a3b8 !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.07) !important;
}

html.light-mode .premium-stat-card.border-left-wifi {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .premium-stat-card.border-left-iptv {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .premium-stat-card.border-left-gad {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .premium-stat-card.border-left-upgrade {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .premium-stat-card.border-left-infra {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .premium-stat-card.border-left-cpe {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #ffffff 100%) !important;
}
html.light-mode .premium-stat-card.border-left-sla {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.08) 0%, #ffffff 100%) !important;
}

/* Defective Box Table Styling - Sticky Headers and Frozen Columns */
.defective-table-container {
    position: relative;
    max-height: 600px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    margin-bottom: 20px;
}

html.light-mode .defective-table-container {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

#defectiveTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

#defectiveTable th,
#defectiveTable td {
    white-space: nowrap !important;
    padding: 12px 16px !important;
    vertical-align: middle !important;
    text-align: center;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header sticky styling */
#defectiveTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f1a23a !important;
    color: #000000 !important;
    font-weight: 700;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15) !important;
    border-top: none !important;
}

/* First Column (SL) Sticky */
#defectiveTable th:nth-child(1),
#defectiveTable td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 8;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

/* Second Column (S/N) Sticky */
#defectiveTable th:nth-child(2),
#defectiveTable td:nth-child(2) {
    position: sticky;
    left: 60px; /* offset by first column width */
    z-index: 8;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

/* Z-Index for header of sticky columns must be higher */
#defectiveTable thead th:nth-child(1) {
    z-index: 12;
}
#defectiveTable thead th:nth-child(2) {
    z-index: 12;
}

/* Dark mode sticky column backgrounds */
#defectiveTable td:nth-child(1) {
    background-color: #1e293b !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}
#defectiveTable td:nth-child(2) {
    background-color: #1a2332 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Light mode sticky column backgrounds */
html.light-mode #defectiveTable td:nth-child(1) {
    background-color: #f1f5f9 !important;
    border-right: 1px solid #cbd5e1 !important;
}
html.light-mode #defectiveTable td:nth-child(2) {
    background-color: #f8fafc !important;
    border-right: 1px solid #cbd5e1 !important;
}

/* Row borders */
#defectiveTable td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}
html.light-mode #defectiveTable td {
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
}

/* Editable cells interactive styles */
.editable-cell {
    cursor: pointer;
    position: relative;
}
.editable-cell:hover {
    background-color: rgba(99, 102, 241, 0.15) !important;
}
html.light-mode .editable-cell:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

/* Subtle edit pencil icon on hover */
.editable-cell::after {
    content: "\f304";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    font-size: 0.7rem;
    color: var(--accent-primary);
    transition: opacity 0.2s;
    pointer-events: none;
}
.editable-cell:hover::after {
    opacity: 0.7;
}

/* Highlight sticky column cells on hover too */
#defectiveTable tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.05) !important;
}
#defectiveTable tbody tr:hover td:nth-child(1) {
    background-color: #27374d !important;
}
#defectiveTable tbody tr:hover td:nth-child(2) {
    background-color: #233044 !important;
}

html.light-mode #defectiveTable tbody tr:hover td {
    background-color: #f1f5f9 !important;
}
html.light-mode #defectiveTable tbody tr:hover td:nth-child(1) {
    background-color: #cbd5e1 !important;
}
html.light-mode #defectiveTable tbody tr:hover td:nth-child(2) {
    background-color: #cbd5e1 !important;
}

/* Custom non-focus stealing toast */
.custom-toast {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Card styling matching fwa_defective and other pages */
.fwa-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    min-height: 135px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.fwa-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.fwa-card-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    top: -40px;
    right: -40px;
    pointer-events: none;
}

.fwa-card-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2.8rem;
    opacity: 0.15;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.fwa-stat-card:hover .fwa-card-icon {
    opacity: 0.25;
    transform: scale(1.08);
}

.fwa-card-value {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.fwa-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.fwa-card-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.fwa-border-wifi { border-left: 4px solid #3b82f6 !important; }
.fwa-border-modem { border-left: 4px solid #a855f7 !important; }
.fwa-border-iptv { border-left: 4px solid #06b6d4 !important; }
.fwa-border-total { border-left: 4px solid #f59e0b !important; }

.fwa-color-wifi { color: #3b82f6 !important; }
.fwa-color-modem { color: #a855f7 !important; }
.fwa-color-iptv { color: #06b6d4 !important; }
.fwa-color-total { color: #f59e0b !important; }

.fwa-stat-card.fwa-border-wifi .fwa-card-icon { color: #3b82f6; }
.fwa-stat-card.fwa-border-modem .fwa-card-icon { color: #a855f7; }
.fwa-stat-card.fwa-border-iptv .fwa-card-icon { color: #06b6d4; }
.fwa-stat-card.fwa-border-total .fwa-card-icon { color: #f59e0b; }

html.light-mode .fwa-stat-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

html.light-mode .fwa-stat-card:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.table-edit-input {
    background-color: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid var(--accent-primary) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 2px 8px !important;
    width: 100% !important;
    font-size: 0.82rem !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

html.light-mode .table-edit-input {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12) !important;
}

/* DOST Reconciliation Styles */
.rec-field {
    transition: all 0.2s ease-in-out;
}

/* Reconciled Select Class styling */
.status-select.bg-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

html.light-mode .status-select:not(.bg-success) {
    color: #b45309 !important; /* amber-700 in light mode */
}

/* Defective Return Material Custom Styles */
.stat-card-custom {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card-custom:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}
.stat-title-custom {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-value-custom {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 4px;
}
.stat-desc-custom {
    position: absolute;
    bottom: 8px;
    right: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.border-left-orange {
    border-left: 4px solid var(--warning);
}
.border-left-green {
    border-left: 4px solid var(--success);
}
.border-left-blue {
    border-left: 4px solid var(--accent-primary);
}

.custom-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s;
}
.custom-tabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}
.custom-tabs .nav-link.active {
    color: var(--warning);
    background: transparent !important;
    border-bottom: 2px solid var(--warning);
}

/* Custom Dark Table Styles */
.custom-table-dark {
    border-collapse: separate;
    border-spacing: 0 8px;
    color: var(--text-primary);
}
.custom-table-dark th {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
}
.custom-table-dark tbody tr {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: transform 0.2s, background-color 0.2s;
}
.custom-table-dark tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.002);
}
.custom-table-dark td {
    border: none;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.custom-table-dark td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.custom-table-dark td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
.bg-success-glow {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

/* Light mode overrides for return materials tables */
html.light-mode .custom-table-dark th {
    color: #334155;
}
html.light-mode .custom-table-dark tbody tr {
    background: rgba(0, 0, 0, 0.02);
}
html.light-mode .custom-table-dark tbody tr:hover {
    background: rgba(0, 0, 0, 0.04);
}
html.light-mode .custom-table-dark td {
    color: #0f172a;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
html.light-mode .custom-table-dark td:first-child {
    border-left: 1px solid rgba(0, 0, 0, 0.06);
}
html.light-mode .custom-table-dark td:last-child {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

/* Modal dynamic theme styling */
.modal-content.glass-panel {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}
.modal-header, .modal-footer {
    border-color: var(--border-color) !important;
}
html.dark-mode .modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2) !important;
}

/* Modal inputs styling to match theme dynamically */
.modal-content .form-control,
.modal-content .form-select {
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.modal-content .form-control::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.7;
}
.modal-content .form-control:focus,
.modal-content .form-select:focus {
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.25) !important;
}

/* Inline editing table input overrides */
.custom-table-dark td input.form-control-sm,
.custom-table-dark td select.form-select-sm {
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
    height: auto !important;
    border-radius: 6px !important;
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.custom-table-dark td input.form-control-sm:focus,
.custom-table-dark td select.form-select-sm:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15) !important;
}
