/* COMPLETE DARK THEME - SINGLE FILE SOLUTION */
/* This file overrides ALL Bootstrap and other CSS to enforce dark theme */

:root {
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-lighter: #334155;
    --cyan-primary: #22d3ee;
    --cyan-dark: #0891b2;
    --text-light: #cbd5e1;
    --text-white: #f1f5f9;
    --purple-weekend: rgba(147, 51, 234, 0.3);
    --cyan-totals: rgba(34, 211, 238, 0.3);
}

/* FORCE DARK BACKGROUND ON EVERYTHING */
body {
    background: var(--dark-bg) !important;
    color: var(--text-light) !important;
    font-family: 'Inter', sans-serif !important;
}

/* KILL ALL WHITE BACKGROUNDS */
*[style*="background: white"],
*[style*="background-color: white"],
*[style*="background: #fff"],
*[style*="background-color: #fff"],
*[style*="background: #ffffff"],
*[style*="background-color: #ffffff"],
*[style*="background-color: rgb(226, 227, 229)"],
.bg-white,
.table-light,
.bg-light,
.bg-secondary {
    background: var(--dark-card) !important;
    color: var(--text-light) !important;
}

/* FORCE ALL TABLE-SECONDARY TO PURPLE - WEEKEND ROWS */
.table-secondary,
tr.table-secondary,
tbody tr.table-secondary {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.4), rgba(168, 85, 247, 0.3)) !important;
    color: var(--text-white) !important;
}

.table-secondary td,
tr.table-secondary td,
tbody tr.table-secondary td {
    background: inherit !important;
    color: var(--text-white) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-accent-bg: linear-gradient(90deg, rgba(147, 51, 234, 0.4), rgba(168, 85, 247, 0.3)) !important;
}
/* CARDS - DARK WITH GLASS EFFECT */
.card {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(34, 211, 238, 0.2) !important;
    border-radius: 15px !important;
    backdrop-filter: blur(10px) !important;
    color: var(--text-light) !important;
}

.card-header {
    background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-lighter) 100%) !important;
    color: var(--text-white) !important;
    border-bottom: 1px solid rgba(34, 211, 238, 0.2) !important;
}

.card-body {
    background: transparent !important;
    color: var(--text-light) !important;
}

/* TABLE FIXES - MOST IMPORTANT */
.table {
    background: transparent !important;
    color: var(--text-light) !important;
}

.table thead th {
    background: var(--dark-card) !important;
    color: var(--cyan-primary) !important;
    border-color: rgba(34, 211, 238, 0.2) !important;
}

.table tbody tr {
    background: rgba(30, 41, 59, 0.4) !important;
    color: var(--text-light) !important;
}

.table tbody tr:nth-child(odd) {
    background: rgba(30, 41, 59, 0.6) !important;
}

.table tbody tr:hover {
    background: rgba(34, 211, 238, 0.1) !important;
}

.table td, .table th {
    color: var(--text-light) !important;
    border-color: rgba(34, 211, 238, 0.1) !important;
}

/* WEEKEND ROWS - CRITICAL FIX - TARGET EXACT ROWS */
/* Weekend rows are 6,7,13,14,20,21,27,28 based on screenshot */
tbody tr:nth-child(6),   /* Saturday */
tbody tr:nth-child(7),   /* Sunday */
tbody tr:nth-child(13),  /* Saturday */
tbody tr:nth-child(14),  /* Sunday */
tbody tr:nth-child(20),  /* Saturday */
tbody tr:nth-child(21),  /* Sunday */
tbody tr:nth-child(27),  /* Saturday */
tbody tr:nth-child(28),  /* Sunday */
tbody tr:nth-child(34),  /* Saturday */
tbody tr:nth-child(35),  /* Sunday */
/* More specific weekend targeting */
.timesheet-table tbody tr:nth-child(6),
.timesheet-table tbody tr:nth-child(7),
.timesheet-table tbody tr:nth-child(13),
.timesheet-table tbody tr:nth-child(14),
.timesheet-table tbody tr:nth-child(20),
.timesheet-table tbody tr:nth-child(21),
.timesheet-table tbody tr:nth-child(27),
.timesheet-table tbody tr:nth-child(28),
.table tbody tr.table-secondary,
tr.table-secondary {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.4), rgba(168, 85, 247, 0.3)) !important;
    color: var(--text-white) !important;
}

tbody tr:nth-child(6) td,
tbody tr:nth-child(7) td,
tbody tr:nth-child(13) td,
tbody tr:nth-child(14) td,
tbody tr:nth-child(20) td,
tbody tr:nth-child(21) td,
tbody tr:nth-child(27) td,
tbody tr:nth-child(28) td,
tbody tr:nth-child(34) td,
tbody tr:nth-child(35) td,
.table tbody tr.table-secondary td {
    color: var(--text-white) !important;
    background: inherit !important;
}

/* FORCE SPECIFIC ROWS 21 AND 27 TO BE PURPLE */
tbody tr:nth-child(21),
tbody tr:nth-child(27) {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.4), rgba(168, 85, 247, 0.3)) !important;
    color: var(--text-white) !important;
}

tbody tr:nth-child(21) td,
tbody tr:nth-child(27) td {
    background: inherit !important;
    color: var(--text-white) !important;
}

/* TOTALS FOOTER - CRITICAL FIX */
.table tfoot,
.table tfoot tr,
tfoot.table-secondary,
tfoot.table-secondary tr,
.text-end.fw-bold,
td.text-end.fw-bold {
    background: linear-gradient(135deg, var(--cyan-totals), rgba(8, 145, 178, 0.2)) !important;
}

.table tfoot td,
.table tfoot th,
tfoot.table-secondary td,
.text-end.fw-bold,
td.text-end.fw-bold,
.fw-bold {
    color: var(--cyan-primary) !important;
    font-weight: bold !important;
    border-color: rgba(34, 211, 238, 0.3) !important;
    background: var(--cyan-totals) !important;
}

/* KILL BOOTSTRAP LIGHT COLORS */
.text-secondary {
    background: var(--cyan-totals) !important;
    color: var(--cyan-primary) !important;
}

/* FORMS */
.form-control,
.form-select,
input,
select,
textarea {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(34, 211, 238, 0.3) !important;
    color: var(--text-white) !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: var(--cyan-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.25) !important;
    color: var(--text-white) !important;
}

.input-group-text {
    background: rgba(30, 41, 59, 0.8) !important;
    color: var(--text-white) !important;
    border: 1px solid rgba(34, 211, 238, 0.3) !important;
}

/* BUTTONS */
.btn {
    border-radius: 25px !important;
    font-weight: 600 !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-dark)) !important;
    border: none !important;
    color: white !important;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none !important;
    color: white !important;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--dark-card), var(--dark-lighter)) !important;
    border: none !important;
    color: var(--text-white) !important;
}

/* LABELS AND TEXT */
.form-label,
label {
    color: var(--cyan-primary) !important;
    font-weight: 600 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-white) !important;
}

.text-muted,
small {
    color: #94a3b8 !important;
}

.text-success {
    color: #10b981 !important;
}

.text-white {
    color: var(--text-white) !important;
}

/* NAVIGATION */
.navbar-brand {
    color: var(--text-white) !important;
}

.nav-link {
    color: var(--text-light) !important;
}

.nav-link:hover {
    color: var(--cyan-primary) !important;
}

/* ALERTS */
.alert {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(34, 211, 238, 0.3) !important;
    color: var(--text-light) !important;
}

.alert-info {
    background: rgba(34, 211, 238, 0.1) !important;
    border-color: rgba(34, 211, 238, 0.3) !important;
    color: var(--cyan-primary) !important;
}

/* REPORTS PAGE SPECIFIC FIXES */
.print-break {
    background: transparent !important;
}

/* FIX WHITE BACKGROUNDS IN REPORTS SUMMARY - ULTRA AGGRESSIVE */
.table-borderless,
.table-borderless td,
.table-borderless th,
.table-borderless tr,
.table.table-borderless,
.table.table-borderless td,
.table.table-borderless th,
.table.table-borderless tr,
table.table-borderless td,
table.table-borderless th {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-light) !important;
}

/* Target the specific summary table cells */
.card-body .table-borderless td,
.card-body .table-borderless th,
.card-body table.table-borderless td,
.card-body table td,
.card-body table th {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-light) !important;
}

/* Kill any inline styles on borderless tables */
.table-borderless td[style*="background"],
.table-borderless th[style*="background"] {
    background: transparent !important;
    background-color: transparent !important;
}

/* Override Bootstrap table variants for reports */
.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
    background: rgba(30, 41, 59, 0.6) !important;
}

.table-bordered {
    border: 1px solid rgba(34, 211, 238, 0.2) !important;
}

.table-bordered td,
.table-bordered th {
    border: 1px solid rgba(34, 211, 238, 0.1) !important;
}

/* PRINT STYLES - MAINTAIN DARK THEME */
@media print {
    body {
        background: var(--dark-bg) !important;
        color: var(--text-light) !important;
    }
    
    .card {
        background: rgba(30, 41, 59, 0.9) !important;
        border: 1px solid #333 !important;
    }
    
    .table th, .table td {
        color: var(--text-light) !important;
        border: 1px solid #333 !important;
    }
    
    .table thead th {
        background: var(--dark-card) !important;
        color: var(--cyan-primary) !important;
    }
    
    .table tbody tr.table-secondary {
        background: var(--purple-weekend) !important;
    }
    
    .table tfoot td {
        background: var(--cyan-totals) !important;
        color: var(--cyan-primary) !important;
    }
}

/* CHECKBOXES */
input[type="checkbox"] {
    accent-color: var(--cyan-primary) !important;
}

/* MONEY/CURRENCY VALUES */
.text-success,
.fw-bold.text-success,
td:contains("R") {
    color: #10b981 !important;
}

/* FORCE OVERRIDE ANY REMAINING BOOTSTRAP */
.bg-primary {
    background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-dark)) !important;
}

.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.bg-secondary {
    background: var(--dark-card) !important;
}

/* SIDEBAR - DO NOT HIDE */
.sidebar {
    background: var(--dark-bg) !important;
    display: flex !important;  /* RESTORE THE MENU */
}

/* CONTAINER */
.container,
.container-fluid {
    background: transparent !important;
}

/* MAIN CONTENT */
.main {
    background: transparent !important;
    padding-top: 100px !important; /* Fixed: Increased padding to avoid navbar overlap */
}

/* SPECIFIC FIX FOR WEEKEND AND TOTALS VISIBILITY */
tbody tr.table-secondary td,
tfoot tr td,
tfoot.table-secondary td {
    color: var(--text-white) !important;
    font-weight: 600 !important;
}

/* ENSURE NO TEXT IS HIDDEN */
* {
    color: inherit !important;
}

/* FINAL OVERRIDES */
div, span, p, td, th, label {
    color: inherit;
}

/* Make sure totals are visible */
.fw-bold {
    color: var(--text-white) !important;
}

/* NUCLEAR OPTION - FORCE ALL TDs TO NOT HAVE WHITE BG */
td {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* SPECIFIC REPORTS PAGE TABLE CELLS */
.card-body td:nth-child(2) {
    background: transparent !important;
    background-color: transparent !important;
}

/* Force transparency on all table cells in cards */
.card td, .card th {
    background: transparent !important;
    background-color: transparent !important;
}

/* AGGRESSIVE FIX FOR ANY REMAINING WHITE IN REPORTS */
.table-borderless td:not(:first-child),
.summary td:nth-child(2),
table.table-borderless td {
    background: transparent !important;
    background-color: transparent !important;
}

/* ULTRA SPECIFIC FIX FOR SUMMARY VALUE CELLS */
.table-borderless tr td:last-child,
.table-borderless tr td:nth-child(2),
td:contains("21"),
td:contains("189") {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Target specific report summary cells */
tr:has(td:contains("Total Hours")) td:last-child,
tr:has(td:contains("Total Days")) td:last-child,
tr:has(td:contains("Generated")) td:last-child {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-light) !important;
}