* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 32px;
    margin-bottom: 8px;
    text-align: center;
    color: #2c3e50;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-card input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #e0e6ed;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #d1d8e0;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e0e6ed;
    padding: 16px 32px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-email {
    color: #7f8c8d;
    font-size: 14px;
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    border-bottom: 1px solid #e0e6ed;
    padding: 0 32px;
    display: flex;
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto;
    /* Horizontal scroll for mobile */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.nav-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-btn {
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Prevent text wrapping */
    flex-shrink: 0; /* Don't shrink tabs */
}

.tab-btn:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.badge {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.tab-btn.active .badge {
    background: #667eea;
}

/* Tab Content */
.tab-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tab-header h2 {
    font-size: 24px;
    color: #2c3e50;
}

.filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filters select, .filters input[type="text"] {
    padding: 8px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
}

.filters input[type="text"] {
    width: 250px;
}

/* Items List */
.items-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.loading {
    padding: 60px;
    text-align: center;
    color: #7f8c8d;
    font-size: 16px;
}

.item-card {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e6ed;
    cursor: pointer;
    transition: background 0.3s;
}

.item-card:hover {
    background: #f8f9fa;
}

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

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.item-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.item-subtitle {
    font-size: 14px;
    color: #7f8c8d;
}

.item-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #7f8c8d;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-verified {
    background: #d4edda;
    color: #155724;
}

.status-active {
    background: #d1ecf1;
    color: #0c5460;
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #7f8c8d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e0e6ed;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer input {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e6ed;
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    padding: 8px 0;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
}

.detail-value {
    color: #2c3e50;
}

.document-preview {
    margin-top: 8px;
}

.document-preview img {
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

.empty-state {
    padding: 60px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 18px;
    color: #7f8c8d;
}

/* Gift Card Stats */
.gift-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Large Modal */
.modal-large {
    max-width: 1000px;
}

/* Gift Card Status Badges */
.status-fully_redeemed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Support Ticket Styles */
.ticket-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.ticket-card.priority-high {
    border-left: 4px solid #ef4444;
}

.ticket-card.priority-medium {
    border-left: 4px solid #f59e0b;
}

.ticket-id {
    font-family: monospace;
    font-size: 12px;
    color: #6b7280;
}

.ticket-reason {
    color: #374151;
    font-size: 14px;
    margin-top: 8px;
}

/* Watchdog tickets: what the pro said to the check-in text (2026-09-04) */
.pro-reply {
    display: inline-block;
    font-size: 13px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.4;
}
.pro-reply-good { background: #d1fae5; color: #047857; }
.pro-reply-wait { background: #fef3c7; color: #b45309; }
.pro-reply-bad  { background: #fef2f2; color: #b91c1c; }

.priority-high {
    background: #fef2f2;
    color: #ef4444;
}

.priority-medium {
    background: #fffbeb;
    color: #f59e0b;
}

.status-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-in_progress {
    background: #fef3c7;
    color: #b45309;
}

.status-resolved {
    background: #d1fae5;
    color: #047857;
}

.status-closed {
    background: #e5e7eb;
    color: #4b5563;
}

.reason-box {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    line-height: 1.6;
}

.mono {
    font-family: monospace;
    font-size: 12px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Financial Stats */
.financial-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.profit-card {
    border-left: 4px solid #27ae60;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.profit-card .stat-value {
    color: #15803d;
}

.refund-card {
    border-left: 4px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.refund-card .stat-value {
    color: #dc2626;
}

.cancel-card {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.cancel-card .stat-value {
    color: #b45309;
}

.cancellation-stats {
    margin-top: 8px;
}

.stat-value.positive {
    color: #15803d;
}

.stat-value.negative {
    color: #dc2626;
}

/* Financial Breakdown */
.financial-breakdown {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.financial-breakdown h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 16px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown-table th,
.breakdown-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

.breakdown-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-table tr:hover {
    background: #f8f9fa;
}

.breakdown-table .profit-cell {
    font-weight: 600;
}

.breakdown-table .profit-cell.positive {
    color: #15803d;
}

.breakdown-table .profit-cell.negative {
    color: #dc2626;
}

.breakdown-table .text-right {
    text-align: right;
}

/* 1099 Year-End Report subheadings */
.report-1099-subhead {
    margin: 24px 0 8px;
    font-size: 15px;
    color: #2c3e50;
}

/* Locker-lead email/phone links — readable in both themes (white in dark mode) */
.market-lead-contact {
    color: #2563eb;
    font-weight: 600;
}
body.dark-mode .market-lead-contact {
    color: #ffffff;
}

/* Date inputs */
.date-input {
    padding: 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Loading spinner for financials */
.financial-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #7f8c8d;
}

.financial-loading::before {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #e0e6ed;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 16px;
    }

    .nav-tabs {
        padding: 0 16px;
    }

    .tab-content {
        padding: 20px 16px;
    }

    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .filters {
        width: 100%;
        flex-wrap: wrap;
    }

    .filters select,
    .filters input[type="text"] {
        flex: 1;
        min-width: 140px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Header */
    .dashboard-header {
        padding: 12px 16px;
    }

    .dashboard-header h1 {
        font-size: 20px;
    }

    .header-actions {
        gap: 8px;
    }

    .admin-email {
        display: none;
    }

    .btn-secondary {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Navigation Tabs - Swipeable */
    .nav-tabs {
        padding: 0 12px;
        gap: 4px;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
        gap: 6px;
    }

    .badge {
        padding: 2px 6px;
        font-size: 10px;
    }

    /* Tab Content */
    .tab-content {
        padding: 16px 12px;
    }

    .tab-header h2 {
        font-size: 20px;
    }

    /* Filters - Stack vertically */
    .filters {
        flex-direction: column;
        gap: 8px;
    }

    .filters select,
    .filters input[type="text"] {
        width: 100%;
    }

    .filters .btn-primary,
    .filters .btn-secondary {
        width: 100%;
    }

    /* Stats Cards */
    .gift-card-stats,
    .financial-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* Item Cards */
    .item-card {
        padding: 16px;
    }

    .item-title {
        font-size: 16px;
    }

    .item-meta {
        flex-direction: column;
        gap: 8px;
    }

    /* Tables - Horizontal scroll */
    .financial-breakdown {
        padding: 16px;
        overflow-x: auto;
    }

    .breakdown-table {
        min-width: 700px;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-height: 92dvh;
        margin: 10px;
        margin-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        flex-wrap: wrap;
        flex-shrink: 0;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-label {
        font-size: 12px;
    }

    /* Login */
    .login-card {
        padding: 24px;
        margin: 16px;
    }

    .login-card h1 {
        font-size: 26px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 18px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .gift-card-stats,
    .financial-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .cancellation-stats {
        margin-top: 8px;
    }

    .item-header {
        flex-direction: column;
        gap: 8px;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .tab-btn {
        min-height: 48px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger {
        min-height: 44px;
    }

    .item-card {
        min-height: 60px;
    }
}

/* ========================================
   TAX CENTER STYLES
   ======================================== */

.tax-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tax-section h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e6ed;
}

/* Deadline Cards */
.deadline-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.deadline-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.deadline-card.deadline-urgent {
    border-left-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.deadline-card.deadline-overdue {
    border-left-color: #991b1b;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.deadline-card.deadline-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.deadline-card.deadline-complete {
    border-left-color: #15803d;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    opacity: 0.8;
}

.deadline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.deadline-type {
    font-size: 20px;
}

.deadline-name {
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

.urgency-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.urgency-badge.urgent {
    background: #dc2626;
    color: white;
}

.urgency-badge.overdue {
    background: #991b1b;
    color: white;
    animation: pulse 1.5s infinite;
}

.urgency-badge.warning {
    background: #f59e0b;
    color: white;
}

.urgency-badge.complete {
    background: #15803d;
    color: white;
}

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

.deadline-body {
    margin-bottom: 16px;
}

.deadline-date {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.deadline-countdown {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.deadline-urgent .deadline-countdown {
    color: #dc2626;
}

.deadline-overdue .deadline-countdown {
    color: #991b1b;
}

.deadline-warning .deadline-countdown {
    color: #b45309;
}

.deadline-complete .deadline-countdown {
    color: #15803d;
    font-size: 18px;
}

.deadline-description {
    font-size: 13px;
    color: #6b7280;
}

.deadline-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Document Checklist */
.deadline-docs {
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.docs-title {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-progress {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.docs-progress.complete {
    color: #15803d;
    font-weight: 600;
}

.docs-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.doc-checkbox:hover {
    background: rgba(0, 0, 0, 0.04);
}

.doc-checkbox input[type="checkbox"] {
    display: none;
}

.doc-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #9ca3af;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.doc-checkbox .checkmark::after {
    content: '';
    width: 10px;
    height: 6px;
    border: 2px solid white;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.2s;
}

.doc-checkbox.checked .checkmark {
    background: #15803d;
    border-color: #15803d;
}

.doc-checkbox.checked .checkmark::after {
    transform: rotate(-45deg) scale(1);
}

.doc-checkbox .doc-label {
    font-size: 13px;
    color: #374151;
    line-height: 1.3;
}

.doc-checkbox.checked .doc-label {
    color: #6b7280;
    text-decoration: line-through;
}

.doc-checkbox.has-export {
    display: flex;
    align-items: center;
}

.doc-export-link {
    margin-left: auto;
    padding: 4px 8px;
    font-size: 16px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s, transform 0.2s;
}

.doc-export-link:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: scale(1.1);
}

.doc-checkbox.checked .doc-export-link {
    opacity: 0.5;
}

/* Deadline card adjustments for larger content */
.deadline-card {
    display: flex;
    flex-direction: column;
}

.deadline-card.deadline-complete .deadline-docs {
    opacity: 0.6;
}

/* Quarter Selector */
.quarter-selector {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.quarter-selector select {
    padding: 10px 16px;
    font-size: 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    background: white;
    min-width: 150px;
}

.quarter-selector .btn-primary {
    width: auto;
}

/* Tax Summary Stats */
.tax-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.tax-owed-card {
    border-left: 4px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.tax-owed-card .stat-value {
    color: #dc2626;
}

/* Filing History */
.filing-card {
    cursor: default;
}

.filing-card:hover {
    background: white;
}

/* Mobile Responsive for Tax Center */
@media (max-width: 768px) {
    .tax-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .deadline-cards {
        grid-template-columns: 1fr;
    }

    .deadline-card {
        padding: 16px;
    }

    .deadline-countdown {
        font-size: 20px;
    }

    .tax-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tax-summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .deadline-header {
        flex-wrap: wrap;
    }

    .urgency-badge {
        margin-top: 8px;
    }
}

/* Stripe Reports Section */
.section-description {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 14px;
}

.stripe-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stripe-report-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e0e6ed;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.report-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.stripe-report-card h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.stripe-report-card p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
    min-height: 40px;
}

.stripe-report-card .btn-primary {
    width: auto;
    display: inline-block;
    text-decoration: none;
}

.stripe-instructions {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
}

.stripe-instructions h4 {
    color: #0369a1;
    margin-bottom: 12px;
    font-size: 16px;
}

.stripe-instructions ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.stripe-instructions li {
    color: #334155;
    margin-bottom: 8px;
    font-size: 14px;
}

.stripe-instructions .note {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 3px solid #0ea5e9;
}

@media (max-width: 768px) {
    .stripe-reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stripe-report-card p {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .stripe-reports-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Work Orders Tab ===== */
.work-order-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.work-order-stats .stat-card {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    background: white;
    border: 2px solid #e5e7eb;
}

.work-order-stats .stat-card .stat-value {
    font-size: 28px;
    font-weight: bold;
}

.work-order-stats .wo-pending {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.work-order-stats .wo-pending .stat-value { color: #d97706; }

.work-order-stats .wo-assigned {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.work-order-stats .wo-assigned .stat-value { color: #2563eb; }

.work-order-stats .wo-en-route {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}
.work-order-stats .wo-en-route .stat-value { color: #7c3aed; }

.work-order-stats .wo-in-progress {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
}
.work-order-stats .wo-in-progress .stat-value { color: #0891b2; }

.work-order-stats .wo-completed {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.work-order-stats .wo-completed .stat-value { color: #16a34a; }

/* Heat Map Legend */
.heat-map-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.heat-map-legend .legend-title {
    font-weight: 600;
    color: #475569;
    font-size: 13px;
}

.heat-map-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.heat-map-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
}

.legend-color.heat-fresh { background: #22c55e; }
.legend-color.heat-warm { background: #eab308; }
.legend-color.heat-hot { background: #f97316; }
.legend-color.heat-critical { background: #ef4444; }

/* Map Container */
.map-container {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.work-orders-map {
    width: 100%;
    height: 500px;
    background: #e5e7eb;
}

/* Work Orders List Header */
.work-orders-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.work-orders-list-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.list-count {
    font-size: 14px;
    color: #6b7280;
}

/* Work Order Card */
.work-order-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.work-order-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.work-order-card .wo-heat-indicator {
    width: 8px;
    height: 60px;
    border-radius: 4px;
}

.work-order-card .wo-heat-indicator.heat-fresh { background: #22c55e; }
.work-order-card .wo-heat-indicator.heat-warm { background: #eab308; }
.work-order-card .wo-heat-indicator.heat-hot { background: #f97316; }
.work-order-card .wo-heat-indicator.heat-critical { background: #ef4444; }
.work-order-card .wo-heat-indicator.heat-none { background: #9ca3af; }

.work-order-card .wo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.work-order-card .wo-booking-id {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

.work-order-card .wo-services {
    font-size: 13px;
    color: #6b7280;
}

.work-order-card .wo-address {
    font-size: 12px;
    color: #9ca3af;
}

.work-order-card .wo-time {
    text-align: right;
}

.work-order-card .wo-scheduled {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.work-order-card .wo-age {
    font-size: 11px;
    color: #9ca3af;
}

.work-order-card .wo-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wo-status-badge.status-pending {
    background: #fef3c7;
    color: #d97706;
}

/* 'paid' = booked but unclaimed; safety net if a raw status slips through */
.wo-status-badge.status-paid {
    background: #fef3c7;
    color: #d97706;
}

.wo-status-badge.status-assigned {
    background: #dbeafe;
    color: #2563eb;
}

.wo-status-badge.status-en_route {
    background: #ede9fe;
    color: #7c3aed;
}

.wo-status-badge.status-in_progress {
    background: #cffafe;
    color: #0891b2;
}

.wo-status-badge.status-completed {
    background: #dcfce7;
    color: #16a34a;
}

.wo-status-badge.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

/* Work Order Status Info (badge + summary) */
.work-order-card .wo-status-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.wo-status-summary {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* Toggle label for map view */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Work Order Modal Details */
.wo-detail-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.wo-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.wo-detail-section h4 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wo-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.wo-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wo-detail-item .label {
    font-size: 12px;
    color: #9ca3af;
}

.wo-detail-item .value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.wo-services-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wo-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.wo-service-item .service-name {
    font-weight: 500;
    color: #374151;
}

.wo-service-item .service-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
}

@media (max-width: 1024px) {
    .work-order-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .work-order-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .work-order-card {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .work-order-card .wo-time,
    .work-order-card .wo-status-badge {
        grid-column: 2;
    }

    .heat-map-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .work-order-stats {
        grid-template-columns: 1fr 1fr;
    }

    .work-orders-map {
        height: 350px;
    }
}

/* ========================================
   DARK MODE STYLES
   ======================================== */

/* Dark Mode Toggle Button */
.btn-icon {
    background: none;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.btn-icon .dark-icon {
    display: none;
}

/* Dark mode active state for toggle */
body.dark-mode .btn-icon {
    border-color: #4b5563;
    background: #374151;
}

body.dark-mode .btn-icon:hover {
    background: #4b5563;
    border-color: #667eea;
}

body.dark-mode .btn-icon .light-icon {
    display: none;
}

body.dark-mode .btn-icon .dark-icon {
    display: inline;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #111827;
    color: #e5e7eb;
}

/* Header */
body.dark-mode .dashboard-header {
    background: #1f2937;
    border-bottom-color: #374151;
}

body.dark-mode .dashboard-header h1 {
    color: #f9fafb;
}

body.dark-mode .admin-email {
    color: #9ca3af;
}

/* Navigation Tabs */
body.dark-mode .nav-tabs {
    background: #1f2937;
    border-bottom-color: #374151;
}

body.dark-mode .tab-btn {
    color: #9ca3af;
}

body.dark-mode .tab-btn:hover {
    color: #e5e7eb;
    background: #374151;
}

body.dark-mode .tab-btn.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

body.dark-mode .tab-btn.active .badge {
    background: #818cf8;
}

/* Buttons */
body.dark-mode .btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

body.dark-mode .btn-secondary:hover {
    background: #4b5563;
}

body.dark-mode .btn-primary {
    background: #6366f1;
}

body.dark-mode .btn-primary:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Tab Content */
body.dark-mode .tab-header h2 {
    color: #f9fafb;
}

/* Filters */
body.dark-mode .filters select,
body.dark-mode .filters input[type="text"] {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .filters select:focus,
body.dark-mode .filters input[type="text"]:focus {
    border-color: #818cf8;
}

body.dark-mode .date-input {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .date-input:focus {
    border-color: #818cf8;
}

/* Items List / Cards */
body.dark-mode .items-list {
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .item-card {
    border-bottom-color: #374151;
}

body.dark-mode .item-card:hover {
    background: #374151;
}

body.dark-mode .item-title {
    color: #f9fafb;
}

body.dark-mode .item-subtitle,
body.dark-mode .meta-item {
    color: #9ca3af;
}

body.dark-mode .loading {
    color: #9ca3af;
}

body.dark-mode .empty-state-text {
    color: #9ca3af;
}

/* Stat Cards */
body.dark-mode .stat-card {
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border-left-color: #818cf8;
}

body.dark-mode .stat-value {
    color: #f9fafb;
}

body.dark-mode .stat-label {
    color: #9ca3af;
}

/* Colored Stat Cards (financials) */
body.dark-mode .profit-card {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-left-color: #10b981;
}

body.dark-mode .profit-card .stat-value {
    color: #34d399;
}

body.dark-mode .refund-card {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-left-color: #ef4444;
}

body.dark-mode .refund-card .stat-value {
    color: #f87171;
}

body.dark-mode .cancel-card {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-left-color: #f59e0b;
}

body.dark-mode .cancel-card .stat-value {
    color: #fbbf24;
}

/* Work Order Stats */
body.dark-mode .work-order-stats .stat-card {
    border-color: #4b5563;
}

body.dark-mode .work-order-stats .wo-pending {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: #f59e0b;
}

body.dark-mode .work-order-stats .wo-assigned {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #3b82f6;
}

body.dark-mode .work-order-stats .wo-en-route {
    background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
    border-color: #8b5cf6;
}

body.dark-mode .work-order-stats .wo-in-progress {
    background: linear-gradient(135deg, #164e63 0%, #155e75 100%);
    border-color: #06b6d4;
}

body.dark-mode .work-order-stats .wo-completed {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #22c55e;
}

/* Heat Map Legend */
body.dark-mode .heat-map-legend {
    background: #1f2937;
}

body.dark-mode .heat-map-legend .legend-title {
    color: #9ca3af;
}

body.dark-mode .heat-map-legend .legend-item {
    color: #9ca3af;
}

/* Work Order Card */
body.dark-mode .work-order-card {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .work-order-card:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.2);
}

body.dark-mode .work-order-card .wo-booking-id {
    color: #f9fafb;
}

body.dark-mode .work-order-card .wo-services {
    color: #9ca3af;
}

body.dark-mode .work-order-card .wo-address {
    color: #6b7280;
}

body.dark-mode .work-order-card .wo-scheduled {
    color: #e5e7eb;
}

body.dark-mode .wo-status-summary {
    color: #9ca3af;
}

body.dark-mode .work-orders-list-header h3 {
    color: #f9fafb;
}

body.dark-mode .list-count {
    color: #9ca3af;
}

/* Modal */
body.dark-mode .modal-content {
    background: #1f2937;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

body.dark-mode .modal-header {
    border-bottom-color: #374151;
}

body.dark-mode .modal-header h2 {
    color: #f9fafb;
}

body.dark-mode .modal-close {
    color: #9ca3af;
}

body.dark-mode .modal-close:hover {
    color: #e5e7eb;
}

body.dark-mode .modal-footer {
    border-top-color: #374151;
}

body.dark-mode .modal-footer input {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .detail-section h3 {
    color: #f9fafb;
    border-bottom-color: #374151;
}

body.dark-mode .detail-label {
    color: #9ca3af;
}

body.dark-mode .detail-value {
    color: #e5e7eb;
}

body.dark-mode .document-preview img {
    border-color: #374151;
}

/* Work Order Modal Details */
body.dark-mode .wo-detail-section {
    border-bottom-color: #374151;
}

body.dark-mode .wo-detail-section h4 {
    color: #9ca3af;
}

body.dark-mode .wo-detail-item .label {
    color: #6b7280;
}

body.dark-mode .wo-detail-item .value {
    color: #f9fafb;
}

body.dark-mode .wo-service-item {
    background: #374151;
}

body.dark-mode .wo-service-item .service-name {
    color: #e5e7eb;
}

/* Financial Breakdown Table */
body.dark-mode .financial-breakdown {
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .financial-breakdown h3 {
    color: #f9fafb;
}

body.dark-mode .breakdown-table th {
    background: #374151;
    color: #e5e7eb;
}

body.dark-mode .breakdown-table td {
    color: #e5e7eb;
    border-bottom-color: #374151;
}

body.dark-mode .breakdown-table tr:hover {
    background: #374151;
}

body.dark-mode .breakdown-table .profit-cell.positive {
    color: #34d399;
}

body.dark-mode .breakdown-table .profit-cell.negative {
    color: #f87171;
}

/* Financial Loading */
body.dark-mode .financial-loading {
    color: #9ca3af;
}

body.dark-mode .financial-loading::before {
    border-color: #374151;
    border-top-color: #818cf8;
}

/* Tax Section */
body.dark-mode .tax-section {
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .tax-section h3 {
    color: #f9fafb;
    border-bottom-color: #374151;
}

body.dark-mode .report-1099-subhead {
    color: #f9fafb;
}

/* Deadline Cards */
body.dark-mode .deadline-card {
    background: #374151;
    border-left-color: #818cf8;
}

body.dark-mode .deadline-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-mode .deadline-card.deadline-urgent {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

body.dark-mode .deadline-card.deadline-overdue {
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
}

body.dark-mode .deadline-card.deadline-warning {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

body.dark-mode .deadline-card.deadline-complete {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

body.dark-mode .deadline-name {
    color: #f9fafb;
}

body.dark-mode .deadline-date {
    color: #e5e7eb;
}

body.dark-mode .deadline-countdown {
    color: #a5b4fc;
}

body.dark-mode .deadline-description {
    color: #9ca3af;
}

body.dark-mode .deadline-docs {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .docs-title {
    color: #9ca3af;
}

body.dark-mode .doc-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .doc-checkbox .doc-label {
    color: #e5e7eb;
}

body.dark-mode .doc-checkbox.checked .doc-label {
    color: #9ca3af;
}

/* Quarter Selector */
body.dark-mode .quarter-selector select {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

/* Stripe Reports */
body.dark-mode .section-description {
    color: #9ca3af;
}

body.dark-mode .stripe-report-card {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .stripe-report-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-mode .stripe-report-card h4 {
    color: #f9fafb;
}

body.dark-mode .stripe-report-card p {
    color: #9ca3af;
}

body.dark-mode .stripe-instructions {
    background: #1e3a8a;
    border-color: #3b82f6;
}

body.dark-mode .stripe-instructions h4 {
    color: #93c5fd;
}

body.dark-mode .stripe-instructions li {
    color: #e5e7eb;
}

body.dark-mode .stripe-instructions .note {
    color: #bfdbfe;
    border-left-color: #60a5fa;
}

/* Gift Card Stats */
body.dark-mode .gift-card-stats .stat-card {
    background: #1f2937;
}

/* Support Ticket Styles */
body.dark-mode .ticket-card {
    background: #1f2937;
}

body.dark-mode .ticket-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-mode .ticket-id {
    color: #9ca3af;
}

body.dark-mode .ticket-reason {
    color: #e5e7eb;
}

body.dark-mode .pro-reply-good { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
body.dark-mode .pro-reply-wait { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
body.dark-mode .pro-reply-bad  { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

body.dark-mode .reason-box {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .mono {
    background: #4b5563;
    color: #e5e7eb;
}

/* Status Badges - slightly adjusted for dark mode contrast */
body.dark-mode .status-pending {
    background: #78350f;
    color: #fbbf24;
}

body.dark-mode .status-failed {
    background: #7f1d1d;
    color: #fca5a5;
}

body.dark-mode .status-verified {
    background: #064e3b;
    color: #6ee7b7;
}

body.dark-mode .status-active {
    background: #164e63;
    color: #67e8f9;
}

body.dark-mode .status-open {
    background: #1e3a8a;
    color: #93c5fd;
}

body.dark-mode .status-in_progress {
    background: #78350f;
    color: #fcd34d;
}

body.dark-mode .status-resolved {
    background: #064e3b;
    color: #6ee7b7;
}

body.dark-mode .status-closed {
    background: #374151;
    color: #9ca3af;
}

/* Toggle label for map view */
body.dark-mode .toggle-label {
    color: #e5e7eb;
}

/* Login screen doesn't need dark mode adjustments as it has a gradient background */

/* Scrollbar styling for dark mode */
body.dark-mode::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.dark-mode::-webkit-scrollbar-track {
    background: #1f2937;
}

body.dark-mode::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 5px;
}

body.dark-mode::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Dark mode transition for smooth toggle */
body, .dashboard-header, .nav-tabs, .tab-btn, .items-list, .item-card,
.stat-card, .modal-content, .financial-breakdown, .tax-section,
.deadline-card, .stripe-report-card, .work-order-card, .heat-map-legend {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   Market tab — sub-nav + Platform Reviews
   ======================================== */
.market-subtab-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}
.market-subtab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}
.market-subtab-btn.active {
    color: #ea580c;
    border-bottom-color: #ea580c;
}
.market-subtab-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 6px;
    margin-left: 4px;
    background: #f4f4f5;
    color: #52525b;
    font-size: 11px;
    font-weight: 700;
    border-radius: 99px;
}
.market-subtab-count.warning {
    background: #fef3c7;
    color: #92400e;
}
.market-subpane-intro {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 12px;
}
.market-review-summary {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.market-review-summary .avg-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #18181b;
}
.market-review-summary .avg-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.market-review-distribution {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: #52525b;
}
.market-review-distribution .bar-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.market-review-card {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #ffffff;
}
.market-review-feedback {
    margin: 8px 0 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
}
.market-review-feedback.empty {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}
.market-review-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

/* Dark-mode overrides */
body.dark-mode .market-subtab-nav {
    border-bottom-color: #374151;
}
body.dark-mode .market-subtab-btn {
    color: #9ca3af;
}
body.dark-mode .market-subtab-btn.active {
    color: #fb923c;
    border-bottom-color: #fb923c;
}
body.dark-mode .market-subtab-count {
    background: #374151;
    color: #d1d5db;
}
body.dark-mode .market-subtab-count.warning {
    background: #78350f;
    color: #fde68a;
}
body.dark-mode .market-subpane-intro {
    color: #9ca3af;
}
body.dark-mode .market-review-summary {
    background: #1f2937;
    border-color: #374151;
}
body.dark-mode .market-review-summary .avg-value {
    color: #f9fafb;
}
body.dark-mode .market-review-summary .avg-meta,
body.dark-mode .market-review-distribution {
    color: #9ca3af;
}
body.dark-mode .market-review-distribution .bar-track {
    background: #374151;
}
body.dark-mode .market-review-card {
    background: #1f2937;
    border-color: #374151;
}
body.dark-mode .market-review-feedback {
    color: #e5e7eb;
}
body.dark-mode .market-review-feedback.empty {
    color: #6b7280;
}
body.dark-mode .market-review-meta {
    color: #6b7280;
}

/* ========================================
   MARKET INTEREST — expansion rollup (waitlist collection)
   ======================================== */
.mi-rollup {
    margin-bottom: 18px;
}
.mi-rollup:empty {
    display: none;
}
.mi-rollup-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 8px;
}
.mi-rollup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    margin-bottom: 6px;
}
.mi-rollup-area {
    font-weight: 600;
    color: #111827;
    min-width: 190px;
}
.mi-rollup-counts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.mi-rollup-services {
    font-size: 12px;
    color: #6b7280;
}
.mi-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.mi-pill-pro {
    background: #dcfce7;
    color: #166534;
}
.mi-pill-customer {
    background: #dbeafe;
    color: #1e40af;
}

body.dark-mode .mi-rollup-title {
    color: #9ca3af;
}
body.dark-mode .mi-rollup-row {
    background: #1f2937;
    border-color: #374151;
}
body.dark-mode .mi-rollup-area {
    color: #f3f4f6;
}
body.dark-mode .mi-rollup-services {
    color: #9ca3af;
}
body.dark-mode .mi-pill-pro {
    background: #14532d;
    color: #bbf7d0;
}
body.dark-mode .mi-pill-customer {
    background: #1e3a8a;
    color: #bfdbfe;
}

/* Environment banner — staging only (app.js adds it when IS_STAGING) */
.env-banner {
    position: sticky;
    top: 0;
    z-index: 3000;
    background: repeating-linear-gradient(45deg, #f97316 0 14px, #ea580c 14px 28px);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    padding: 6px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Live-updating list indicator (Support Tickets) */
.live-dot {
    align-self: center;
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Support ticket audience chips (Pro / Customer) */
.badge.audience-pro { background: #ede9fe; color: #6d28d9; }
.badge.audience-customer { background: #e0f2fe; color: #0369a1; }
.badge.audience-other { background: #e5e7eb; color: #4b5563; }
.status-new { background: #dbeafe; color: #1d4ed8; }
body.dark-mode .badge.audience-pro { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
body.dark-mode .badge.audience-customer { background: rgba(14, 165, 233, 0.22); color: #7dd3fc; }
body.dark-mode .badge.audience-other { background: rgba(156, 163, 175, 0.22); color: #d1d5db; }


/* Nav link that opens a separate page (Recruiting) — matches .tab-btn */
.nav-tabs a.tab-link { text-decoration: none; display: inline-flex; align-items: center; }
