/* Work Order Portal - Custom Styles */

/* Global Search */
.search-result-item:hover { background: #f0f4ff; }
#globalSearch::placeholder { color: rgba(255,255,255,0.4); }
#globalSearch:focus { background: rgba(255,255,255,0.1) !important; box-shadow: none; }

:root {
    --sidebar-bg: #1b2a4a;
    --sidebar-hover: #253a5e;
    --sidebar-active: #3461a0;
    --accent: #3461a0;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar .nav-link {
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 0.92rem;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    background: var(--sidebar-active) !important;
}

#page-content-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Status badge purple for Invoiced */
.bg-purple {
    background-color: #7c3aed !important;
    color: #fff;
}

/* Dashboard Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Work Order Table */
.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

.wo-row-overdue {
    border-left: 3px solid #dc3545;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 10px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Clock-In Button */
.btn-clock {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border-radius: 12px;
}

/* Activity Feed */
.activity-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.78rem;
    color: #9ca3af;
}

/* Search box */
.search-box {
    max-width: 300px;
}

/* File upload thumbnails */
.upload-thumb {
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.upload-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Gallery image in grid */
.gallery-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

/* GPS verification badges */
.gps-verified {
    color: #10b981;
    font-weight: 600;
}

.gps-unverified {
    color: #ef4444;
    font-weight: 600;
}

/* Tech on site widget */
.tech-online {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Lightbox ── */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 15px; right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev { left: 15px; }
.lightbox-next { right: 15px; }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
    padding: 4px 14px;
    border-radius: 20px;
}

/* ── Mobile Bottom Bar ── */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s;
}

.mobile-bottom-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.mobile-bottom-item.active {
    color: var(--accent);
    font-weight: 600;
}

.mobile-bottom-item:hover {
    color: var(--accent);
}

/* ── Mobile Responsive ── */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    #page-content-wrapper {
        margin-left: 0;
        padding-bottom: 80px !important;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .container-fluid {
        padding: 1rem !important;
        padding-bottom: 5rem !important;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .search-box {
        max-width: 100%;
    }

    /* Larger touch targets */
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
        padding: 6px 10px;
    }

    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* prevents zoom on iOS */
    }

    /* Gallery on mobile: smaller thumbs, more per row */
    .gallery-img, .upload-thumb {
        height: 65px;
    }

    /* Lightbox on mobile */
    .lightbox-img {
        max-width: 95vw;
        max-height: 80vh;
    }

    .lightbox-prev, .lightbox-next {
        padding: 8px 12px;
        font-size: 1.2rem;
    }

    /* Make action buttons stack on mobile */
    .d-flex.gap-2.flex-wrap > .btn {
        font-size: 0.82rem;
        padding: 6px 10px;
    }
}

/* Print styles */
@media print {
    .sidebar, .navbar, .btn, .no-print, .mobile-bottom-bar {
        display: none !important;
    }

    #page-content-wrapper {
        margin-left: 0 !important;
    }

    .no-print { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
    body { background: #fff !important; }
    .d-print-inline { display: inline !important; }
}

/* Form styles */
.form-label {
    font-weight: 500;
    font-size: 0.88rem;
    color: #374151;
}

/* Modal improvements */
.modal-header {
    background: var(--sidebar-bg);
    color: #fff;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d4a7a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Notes/activity timeline */
.note-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.note-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* Scrollable table wrapper */
.table-wrapper {
    max-height: 500px;
    overflow-y: auto;
}

/* Invoice/Cost purple button */
.btn-purple {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}
.btn-purple:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
    color: #fff;
}

/* Message thread bubbles */
#messageThread .bg-primary {
    border-radius: 12px 12px 2px 12px;
}
#messageThread .bg-light {
    border-radius: 12px 12px 12px 2px;
}

/* Performance score card */
.progress {
    border-radius: 3px;
}

/* SLA badges */
.sla-ok { color: #10b981; font-weight: 600; }
.sla-warning { color: #f59e0b; font-weight: 600; }
.sla-breached { color: #ef4444; font-weight: 600; }

/* Recurring WO due badge animation */
.badge-pulse {
    animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* WO Detail Tabs */
.nav-tabs .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    color: #6b7280;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
}

.nav-tabs .nav-link:hover {
    color: var(--accent);
    border-bottom-color: #dee2e6;
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

/* Flag banner */
.flag-banner {
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

/* Visit card items */
.visit-item {
    transition: background 0.15s;
}
.visit-item:hover {
    background: #f9fafb;
}

/* ── Dispatch Board Dashboard ── */
.db-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    transition: transform 0.15s, box-shadow 0.15s;
}
.db-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.db-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: #1f2937;
}
.db-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 500;
}

/* Tech Panel */
.db-tech-panel {
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}
.db-tech-list {
    overflow-y: auto;
    max-height: 500px;
}
.db-tech-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.db-tech-item:hover {
    background: #f9fafb;
}
.db-tech-item:last-child {
    border-bottom: none;
}
.db-tech-active {
    background: #ecfdf5;
}
.db-tech-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 8px;
    margin-top: 2px;
}
.db-dot-pulse {
    animation: pulse 2s infinite;
}
.db-status-chip {
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Schedule List */
.db-schedule-list {
    max-height: 350px;
    overflow-y: auto;
}
.db-schedule-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    transition: background 0.15s;
}
.db-schedule-item:hover {
    background: #f9fafb;
    color: #374151;
}
.db-schedule-item:last-child {
    border-bottom: none;
}
.db-schedule-time {
    width: 60px;
    flex-shrink: 0;
    font-size: 0.78rem;
    text-align: center;
}
.db-schedule-bar {
    width: 3px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}
.db-schedule-content {
    flex: 1;
    min-width: 0;
}

/* Filter Tabs */
.db-filter-tabs {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}
.db-filter-tab {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.db-filter-tab:hover {
    background: #f3f4f6;
    color: #374151;
}
.db-filter-tab.active {
    background: var(--sidebar-bg);
    color: #fff;
}
.db-tab-count {
    font-size: 0.68rem;
    opacity: 0.7;
    font-weight: 400;
}

/* WO Table */
.db-wo-table {
    font-size: 0.85rem;
}
.db-wo-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.4rem 0.5rem;
}
.db-wo-table td {
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

/* Mini Cards (right sidebar) */
.db-mini-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.db-mini-card i {
    font-size: 1rem;
}
.db-mini-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}
.db-mini-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

/* Activity Feed */
.db-activity-feed {
    max-height: 450px;
    overflow-y: auto;
}
.db-activity-item {
    display: flex;
    gap: 8px;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.78rem;
    line-height: 1.35;
}
.db-activity-item:last-child {
    border-bottom: none;
}
.db-activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 5px;
}
.db-activity-meta {
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* ── Avatars ── */
.db-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.db-avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.db-tech-dot-sm {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* ── Timeline Grid ── */
.db-timeline-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.db-timeline {
    min-width: 600px;
}
.db-tl-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f3f4f6;
    min-height: 46px;
}
.db-tl-row:last-child {
    border-bottom: none;
}
.db-tl-header-row {
    min-height: 28px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.db-tl-tech-col {
    width: 120px;
    min-width: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-right: 1px solid #e5e7eb;
    background: #fff;
}
.db-tl-header-row .db-tl-tech-col {
    background: #f9fafb;
}
.db-tl-grid {
    flex: 1;
    position: relative;
    min-height: 40px;
}
.db-tl-hour-label {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 600;
    color: #9ca3af;
    padding-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.db-tl-gridline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f3f4f6;
}
.db-tl-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 5;
}
.db-tl-now::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}
.db-tl-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.65rem;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    z-index: 2;
    transition: opacity 0.15s, transform 0.15s;
    min-width: 40px;
}
.db-tl-block:hover {
    opacity: 0.85;
    transform: scaleY(1.08);
    z-index: 10;
    text-decoration: none;
    color: inherit;
}
.db-tl-block strong {
    font-size: 0.63rem;
    font-weight: 600;
}
.db-tl-block span {
    font-size: 0.55rem;
    opacity: 0.8;
}

/* Timeline table-based layout */
.db-tl-thead-row {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.db-tl-th-tech {
    padding: 6px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    border-right: 1px solid #e5e7eb;
}
.db-tl-th-hour {
    padding: 6px 2px;
    font-size: 0.62rem;
    font-weight: 600;
    color: #9ca3af;
    text-align: left;
    border-left: 1px solid #f3f4f6;
}
.db-tl-body-row {
    border-bottom: 1px solid #f3f4f6;
}
.db-tl-body-tech {
    padding: 4px 8px;
    border-right: 1px solid #e5e7eb;
    white-space: nowrap;
}

.db-tech-phone {
    font-size: 0.68rem;
}

/* Dashboard mobile adjustments */
@media (max-width: 767.98px) {
    .db-stat-number {
        font-size: 1.15rem;
    }
    .db-tech-list {
        max-height: 300px;
    }
    .db-schedule-list {
        max-height: 250px;
    }
    .db-filter-tabs {
        gap: 1px;
    }
    .db-filter-tab {
        padding: 3px 6px;
        font-size: 0.72rem;
    }
    .db-tl-tech-col {
        width: 90px;
        min-width: 90px;
    }
    .db-tl-block {
        font-size: 0.55rem;
    }
    .db-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.65rem;
    }
}

/* ══════════════════════════════════════
   Dark Mode — uses Bootstrap 5.3 native data-bs-theme="dark"
   Bootstrap auto-handles: body, cards, tables, forms, modals,
   dropdowns, alerts, buttons, pagination, badges, list-groups, etc.
   Below are overrides for OUR custom classes only.
   ══════════════════════════════════════ */

/* Main content area background */
[data-bs-theme="dark"] #page-content-wrapper {
    background: #1a1d23 !important;
}

/* Our custom card styles */
[data-bs-theme="dark"] .card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
[data-bs-theme="dark"] .card-header {
    background: var(--bs-card-bg);
}

/* Sidebar — deeper than default dark */
[data-bs-theme="dark"] .sidebar {
    background: #0d1525;
}
[data-bs-theme="dark"] .sidebar .nav-link:hover {
    background: #1a2744;
}
[data-bs-theme="dark"] .sidebar .nav-link.active {
    background: #1e3a6e !important;
}

/* Our custom modal header */
[data-bs-theme="dark"] .modal-header {
    background: #0d1525;
}

/* Mobile top navbar */
[data-bs-theme="dark"] nav.navbar.bg-white {
    background-color: var(--bs-body-bg) !important;
}

/* Mobile bottom bar */
[data-bs-theme="dark"] .mobile-bottom-bar {
    background: var(--bs-body-bg);
    border-top-color: var(--bs-border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}
[data-bs-theme="dark"] .mobile-bottom-item {
    color: #9ca3af;
}
[data-bs-theme="dark"] .mobile-bottom-item.active {
    color: #60a5fa;
}

/* Our custom stat cards */
[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Custom form-label color */
[data-bs-theme="dark"] .form-label {
    color: #d1d5db;
}

/* Search results dropdown */
[data-bs-theme="dark"] #searchResults {
    background: var(--bs-body-bg) !important;
}
[data-bs-theme="dark"] .search-result-item:hover {
    background: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .search-result-item {
    color: var(--bs-body-color) !important;
}

/* Visit items */
[data-bs-theme="dark"] .visit-item:hover {
    background: var(--bs-tertiary-bg);
}

/* Our custom WO table overrides */
[data-bs-theme="dark"] .table th {
    color: #9ca3af;
}

/* Dispatch board custom classes */
[data-bs-theme="dark"] .db-stat-card {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-stat-number,
[data-bs-theme="dark"] .db-mini-number {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .db-tech-item {
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tech-item:hover,
[data-bs-theme="dark"] .db-schedule-item:hover {
    background: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .db-tech-active {
    background: #1a2e3a;
}
[data-bs-theme="dark"] .db-schedule-item {
    border-bottom-color: var(--bs-border-color);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .db-filter-tab {
    color: #9ca3af;
}
[data-bs-theme="dark"] .db-filter-tab:hover {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .db-filter-tab.active {
    background: #1e3a6e;
}
[data-bs-theme="dark"] .db-wo-table th {
    color: #6b7280;
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-mini-card {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-activity-item {
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-row {
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-tech-col {
    border-right-color: var(--bs-border-color);
    background: var(--bs-body-bg);
}
[data-bs-theme="dark"] .db-tl-header-row {
    background: var(--bs-tertiary-bg);
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-header-row .db-tl-tech-col {
    background: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .db-tl-gridline {
    background: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-thead-row {
    background: var(--bs-tertiary-bg);
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-th-tech {
    color: #9ca3af;
    border-right-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-th-hour {
    color: #9ca3af;
    border-left-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-body-row {
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .db-tl-body-tech {
    border-right-color: var(--bs-border-color);
}

/* Login page */
[data-bs-theme="dark"] .login-wrapper {
    background: linear-gradient(135deg, #0d1525 0%, #1a2744 100%);
}
[data-bs-theme="dark"] .login-card {
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

/* FullCalendar dark mode */
[data-bs-theme="dark"] .fc {
    --fc-border-color: var(--bs-border-color);
    --fc-page-bg-color: var(--bs-body-bg);
    --fc-neutral-bg-color: var(--bs-tertiary-bg);
    --fc-list-event-hover-bg-color: var(--bs-tertiary-bg);
    --fc-today-bg-color: rgba(96,165,250,0.08);
}
[data-bs-theme="dark"] .fc .fc-col-header-cell,
[data-bs-theme="dark"] .fc .fc-daygrid-day-number,
[data-bs-theme="dark"] .fc .fc-list-day-cushion {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .fc .fc-button-primary {
    background-color: #374151;
    border-color: #4b5563;
}
[data-bs-theme="dark"] .fc .fc-button-primary:hover {
    background-color: #4b5563;
}
[data-bs-theme="dark"] .fc .fc-button-primary.fc-button-active {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Dark mode toggle */
.theme-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 500px;
}
.kanban-column {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    background: #f9fafb;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}
.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}
.kanban-column-body {
    flex: 1;
    padding: 0.5rem;
    min-height: 100px;
    transition: background 0.2s;
}
.kanban-drop-active {
    background: #e0e7ff !important;
}
.kanban-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.65rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: box-shadow 0.15s;
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
[data-bs-theme="dark"] .kanban-column {
    background: var(--bs-tertiary-bg);
}
[data-bs-theme="dark"] .kanban-column-header {
    border-bottom-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .kanban-card {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .kanban-drop-active {
    background: rgba(99, 102, 241, 0.15) !important;
}
@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
    }
    .kanban-column {
        max-width: 100%;
        min-width: 100%;
    }
}
