/* ===== Dark Theme - HR MoreTrips ===== */
:root, [data-bs-theme="dark"] {
    --bs-body-bg: #0f1117;
    --bs-body-color: #e8eaed;
    --bs-border-color: #2d3140;
    --bs-secondary-bg: #1a1d27;
    --bs-tertiary-bg: #252836;
    --bs-card-bg: #1a1d27;
    --bs-card-border-color: #2d3140;
    --bs-modal-bg: #1a1d27;
    --bs-modal-border-color: #2d3140;
    --bs-dropdown-bg: #1a1d27;
    --bs-dropdown-link-color: #e8eaed;
    --bs-dropdown-link-hover-bg: #252836;
    --bs-table-bg: transparent;
    --bs-table-color: #e8eaed;
    --bs-table-border-color: #2d3140;
    --bs-table-striped-bg: rgba(255,255,255,0.03);
    --bs-table-hover-bg: rgba(77,124,255,0.1);
    --bs-table-hover-color: #e8eaed;
    --bs-form-control-bg: #252836;
    --bs-secondary-color: #9aa0a6;
    --primary: #4d7cff;
    --bg-body: #0f1117;
    --bg-card: #1a1d27;
    --bg-input: #252836;
    --bg-navbar: #12141c;
    --text-primary: #e8eaed;
    --text-muted: #9aa0a6;
    --border: #2d3140;
}

html, body {
    background-color: #0f1117 !important;
    color: #e8eaed !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Navbar */
.navbar, .navbar-dark, nav.navbar {
    background-color: #12141c !important;
    border-bottom: 1px solid #2d3140 !important;
}
.navbar-brand, .navbar .nav-link {
    color: #e8eaed !important;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #4d7cff !important;
}
.navbar-toggler {
    border-color: #2d3140 !important;
}
.dropdown-menu {
    background-color: #1a1d27 !important;
    border-color: #2d3140 !important;
}
.dropdown-item {
    color: #e8eaed !important;
}
.dropdown-item:hover {
    background-color: #252836 !important;
    color: #4d7cff !important;
}

/* Cards */
.card {
    background-color: #1a1d27 !important;
    border: 1px solid #2d3140 !important;
    border-radius: 12px;
    color: #e8eaed !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid #2d3140 !important;
    color: #e8eaed !important;
}
.card-body {
    color: #e8eaed !important;
}

/* Stat cards */
.stat-card {
    border: none !important;
    border-radius: 12px;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .icon { font-size: 2.2rem; opacity: 0.85; }
.stat-card.bg-primary { background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important; color: #fff !important; }
.stat-card.bg-warning { background: linear-gradient(135deg, #92400e, #f59e0b) !important; color: #fff !important; }
.stat-card.bg-danger { background: linear-gradient(135deg, #7f1d1d, #ef4444) !important; color: #fff !important; }
.stat-card.bg-success { background: linear-gradient(135deg, #064e3b, #10b981) !important; color: #fff !important; }

/* Tables - CRITICAL FIX */
.table {
    --bs-table-bg: transparent !important;
    --bs-table-color: #e8eaed !important;
    --bs-table-border-color: #2d3140 !important;
    --bs-table-striped-bg: rgba(255,255,255,0.03) !important;
    --bs-table-hover-bg: rgba(77,124,255,0.1) !important;
    --bs-table-hover-color: #e8eaed !important;
    color: #e8eaed !important;
    background-color: transparent !important;
}
.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #e8eaed !important;
    border-bottom-color: #2d3140 !important;
}
.table thead th,
.table thead td,
.table > thead {
    background-color: #252836 !important;
    color: #9aa0a6 !important;
    font-weight: 600;
    border-color: #2d3140 !important;
    white-space: nowrap;
}
.table tbody tr {
    background-color: #1a1d27 !important;
    color: #e8eaed !important;
}
.table tbody tr:hover {
    background-color: rgba(77,124,255,0.1) !important;
}
.table tbody td {
    color: #e8eaed !important;
    border-color: #2d3140 !important;
    background-color: transparent !important;
}
.table-light, .table-light > th, .table-light > td,
thead.table-light, .table > thead.table-light {
    background-color: #252836 !important;
    color: #9aa0a6 !important;
}
.table-success, .table-success > td, .table-success > th {
    background-color: rgba(16,185,129,0.15) !important;
    color: #34d399 !important;
}
.table-bordered, .table-bordered th, .table-bordered td {
    border-color: #2d3140 !important;
}
.table-borderless td, .table-borderless th {
    border: none !important;
}
.table-responsive {
    background-color: #1a1d27;
    border-radius: 0 0 12px 12px;
}

/* Forms */
.form-control, .form-select, input.form-control, select.form-select {
    background-color: #252836 !important;
    border: 1px solid #2d3140 !important;
    color: #e8eaed !important;
}
.form-control:focus, .form-select:focus {
    background-color: #252836 !important;
    border-color: #4d7cff !important;
    color: #e8eaed !important;
    box-shadow: 0 0 0 0.2rem rgba(77,124,255,0.25) !important;
}
.form-control::placeholder {
    color: #6b7280 !important;
}
.form-label, label {
    color: #9aa0a6 !important;
}
.input-group-text {
    background-color: #252836 !important;
    border-color: #2d3140 !important;
    color: #9aa0a6 !important;
}

/* Buttons */
.btn { border-radius: 8px; }
.btn-primary {
    background-color: #4d7cff !important;
    border-color: #4d7cff !important;
    color: #fff !important;
}
.btn-primary:hover {
    background-color: #3b6aef !important;
    border-color: #3b6aef !important;
}
.btn-success {
    background-color: #059669 !important;
    border-color: #059669 !important;
}
.btn-outline-primary {
    color: #4d7cff !important;
    border-color: #4d7cff !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background-color: #4d7cff !important;
    color: #fff !important;
}
.btn-outline-secondary, .btn-outline-dark {
    color: #9aa0a6 !important;
    border-color: #2d3140 !important;
    background: transparent !important;
}
.btn-outline-secondary:hover, .btn-outline-dark:hover {
    background-color: #252836 !important;
    color: #e8eaed !important;
    border-color: #2d3140 !important;
}
.btn-outline-danger {
    color: #f87171 !important;
    border-color: #f87171 !important;
    background: transparent !important;
}
.btn-outline-danger:hover {
    background-color: #f87171 !important;
    color: #fff !important;
}
.btn-outline-success {
    color: #34d399 !important;
    border-color: #34d399 !important;
    background: transparent !important;
}
.btn-outline-success:hover {
    background-color: #34d399 !important;
    color: #111 !important;
}
.btn-secondary {
    background-color: #252836 !important;
    border-color: #2d3140 !important;
    color: #e8eaed !important;
}
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Modals */
.modal-content {
    background-color: #1a1d27 !important;
    border: 1px solid #2d3140 !important;
    color: #e8eaed !important;
}
.modal-header, .modal-footer {
    border-color: #2d3140 !important;
}
.modal-title { color: #e8eaed !important; }
.modal-body { color: #e8eaed !important; }

/* Alerts */
.alert-success {
    background-color: rgba(16,185,129,0.15) !important;
    border-color: rgba(16,185,129,0.3) !important;
    color: #34d399 !important;
}
.alert-danger {
    background-color: rgba(248,113,113,0.15) !important;
    border-color: rgba(248,113,113,0.3) !important;
    color: #f87171 !important;
}
.alert-warning {
    background-color: rgba(251,191,36,0.15) !important;
    border-color: rgba(251,191,36,0.3) !important;
    color: #fbbf24 !important;
}
.alert-info {
    background-color: rgba(96,165,250,0.15) !important;
    border-color: rgba(96,165,250,0.3) !important;
    color: #60a5fa !important;
}

/* Badges */
.badge.bg-success { background-color: #065f46 !important; color: #fff !important; }
.badge.bg-danger { background-color: #7f1d1d !important; color: #fff !important; }
.badge.bg-warning { background-color: #92400e !important; color: #fff !important; }
.badge.bg-info { background-color: #1e3a5f !important; color: #fff !important; }
.badge.bg-secondary { background-color: #374151 !important; color: #fff !important; }
.badge.bg-primary { background-color: #1e3a8a !important; color: #fff !important; }

/* Text */
.text-muted { color: #9aa0a6 !important; }
.text-danger { color: #f87171 !important; }
.text-success { color: #34d399 !important; }
.text-warning { color: #fbbf24 !important; }
.page-header h2 { font-weight: 700; color: #e8eaed !important; }

/* Footer */
footer {
    background-color: #12141c !important;
    border-top: 1px solid #2d3140 !important;
    color: #9aa0a6 !important;
}

/* Login */
.login-card {
    max-width: 420px;
    margin: 80px auto;
    border: 1px solid #2d3140 !important;
    border-radius: 16px;
    background: #1a1d27 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.login-card .card-header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    color: white !important;
    border-radius: 16px 16px 0 0 !important;
    text-align: center;
    padding: 1.5rem;
    border: none !important;
}

/* Install banner */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1d27;
    border: 1px solid #4d7cff;
    border-radius: 12px;
    padding: 12px 20px;
    z-index: 9999;
    display: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    max-width: 90%;
    color: #e8eaed;
}
.install-banner.show {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Payslip stays white for printing */
.payslip-paper, .payslip {
    background: white !important;
    color: #212529 !important;
}
.payslip-paper *, .payslip * {
    color: inherit;
}
@media print {
    .no-print { display: none !important; }
    body { background: white !important; color: black !important; }
    .payslip-paper, .payslip { box-shadow: none !important; }
}

/* Main content area */
main.container-fluid {
    background-color: transparent !important;
}

/* Force dark on common Bootstrap light classes that leak through */
.bg-white, .bg-light {
    background-color: #1a1d27 !important;
    color: #e8eaed !important;
}
.text-dark {
    color: #e8eaed !important;
}
