/**
 * App-wide dark mode for custom page surfaces.
 * Theme class lives on <html class="dark-theme" data-bs-theme="dark">.
 */

/* —— Global page chrome —— */
html.dark-theme .page-wrapper,
html.dark-theme .page-content {
    background-color: #070d0e;
}

html.dark-theme .card,
html.dark-theme .modal-content,
html.dark-theme .dropdown-menu,
html.dark-theme .offcanvas {
    background-color: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

html.dark-theme .card-header,
html.dark-theme .card-footer,
html.dark-theme .modal-header,
html.dark-theme .modal-footer {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

html.dark-theme .bg-white,
html.dark-theme .bg-light,
html.dark-theme .bg-body,
html.dark-theme .bg-body-tertiary {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

html.dark-theme .text-dark {
    color: #f1f5f9 !important;
}

html.dark-theme .text-muted {
    color: #94a3b8 !important;
}

html.dark-theme .border,
html.dark-theme .border-top,
html.dark-theme .border-bottom,
html.dark-theme .border-start,
html.dark-theme .border-end {
    border-color: #334155 !important;
}

html.dark-theme .form-control,
html.dark-theme .form-select,
html.dark-theme .input-group-text {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme .form-control:focus,
html.dark-theme .form-select:focus {
    background-color: #0f172a;
    border-color: #008a5e;
    color: #f1f5f9;
    box-shadow: 0 0 0 0.2rem rgba(0, 138, 94, 0.2);
}

html.dark-theme .form-control::placeholder {
    color: #64748b;
}

html.dark-theme .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #334155;
    --bs-table-striped-bg: rgba(15, 23, 42, 0.55);
    --bs-table-hover-bg: rgba(0, 138, 94, 0.12);
    color: #e2e8f0;
}

html.dark-theme .table-light,
html.dark-theme thead.table-light,
html.dark-theme .table > thead {
    --bs-table-bg: #0f172a !important;
    --bs-table-color: #f1f5f9 !important;
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

html.dark-theme .list-group-item {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme .accordion-item,
html.dark-theme .accordion-button {
    background-color: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

html.dark-theme .accordion-button:not(.collapsed) {
    background-color: rgba(0, 138, 94, 0.16);
    color: #f1f5f9;
}

html.dark-theme .nav-tabs {
    border-bottom-color: #334155;
}

html.dark-theme .nav-tabs .nav-link {
    color: #94a3b8;
}

html.dark-theme .nav-tabs .nav-link.active {
    background-color: #1e293b;
    border-color: #334155 #334155 #1e293b;
    color: #f1f5f9;
}

html.dark-theme .btn-light,
html.dark-theme .btn-outline-secondary {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme .btn-light:hover,
html.dark-theme .btn-outline-secondary:hover {
    background-color: #334155;
    border-color: #475569;
    color: #fff;
}

html.dark-theme .page-link {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme .page-item.active .page-link {
    background-color: #008a5e;
    border-color: #008a5e;
}

html.dark-theme .page-item.disabled .page-link {
    background-color: #0f172a;
    border-color: #334155;
    color: #64748b;
}

/* DataTables */
html.dark-theme .dataTables_wrapper .dataTables_filter input,
html.dark-theme .dataTables_wrapper .dataTables_length select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme table.dataTable thead th,
html.dark-theme table.dataTable tbody td {
    border-color: #334155 !important;
    color: #e2e8f0;
}

html.dark-theme .ui-autocomplete {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme .ui-autocomplete-loading {
    background-color: #0f172a;
}

/* —— Transaction list —— */
html.dark-theme .txn-list-balance {
    background: #1e293b;
    border-color: rgba(0, 138, 94, 0.4);
    color: #e2e8f0;
}

html.dark-theme .txn-list-balance__label {
    color: #94a3b8;
}

/* —— Tax rules —— */
html.dark-theme .tax-rules-calculator,
html.dark-theme .tax-rules-result {
    background: #1e293b;
    border-color: #334155;
}

html.dark-theme .tax-rules-calculator__head {
    background: #0f172a;
    border-bottom-color: #334155;
}

html.dark-theme .tax-rules-calculator__head h2,
html.dark-theme .tax-rules-result strong {
    color: #f1f5f9;
}

html.dark-theme .tax-rules-toolbar__label {
    color: #94a3b8;
}

/* —— Housekeeping dashboard —— */
html.dark-theme .hk-alert-watch,
html.dark-theme .hk-alert-card,
html.dark-theme .hk-daily-tile {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
}

html.dark-theme .hk-alert-watch__title,
html.dark-theme .hk-alert-card__value,
html.dark-theme .hk-daily-tile__value {
    color: #f1f5f9;
}

html.dark-theme .hk-alert-watch__subtitle,
html.dark-theme .hk-alert-card__label,
html.dark-theme .hk-alert-card__hint,
html.dark-theme .hk-daily-tile__label,
html.dark-theme .hk-daily-note {
    color: #94a3b8;
}

html.dark-theme .hk-dashboard-kpi .dashboard-kpi-tile--danger {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, #1e293b 100%);
}

html.dark-theme .hk-dashboard-kpi .dashboard-kpi-tile--warning {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, #1e293b 100%);
}

html.dark-theme .hk-dashboard-kpi .dashboard-kpi-tile--success {
    border-color: rgba(0, 138, 94, 0.4);
    background: linear-gradient(135deg, rgba(0, 138, 94, 0.16) 0%, #1e293b 100%);
}

html.dark-theme .hk-dashboard-kpi .dashboard-kpi-tile--info {
    border-color: rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16) 0%, #1e293b 100%);
}

html.dark-theme .hk-dashboard-kpi .dashboard-kpi-value.is-danger { color: #fca5a5; }
html.dark-theme .hk-dashboard-kpi .dashboard-kpi-value.is-warning { color: #fcd34d; }
html.dark-theme .hk-dashboard-kpi .dashboard-kpi-value.is-success { color: #6ee7b7; }
html.dark-theme .hk-dashboard-kpi .dashboard-kpi-value.is-info { color: #7dd3fc; }

/* —— Restaurant CRUD / POS —— */
html.dark-theme .restaurant-quick-modal {
    --rcrud-text: #f1f5f9;
    --rcrud-text-muted: #94a3b8;
    --rcrud-border: #334155;
    --rcrud-surface: #0f172a;
    --rcrud-primary-light: rgba(0, 138, 94, 0.18);
}

html.dark-theme .restaurant-pos-shell {
    --rpos-text: #f1f5f9;
    --rpos-text-body: #e2e8f0;
    --rpos-text-muted: #94a3b8;
    --rpos-text-subtle: #cbd5e1;
    --rpos-border: #334155;
    --rpos-surface: #0f172a;
    --rpos-primary-light: rgba(0, 138, 94, 0.18);
    --rpos-primary-muted: rgba(0, 138, 94, 0.12);
}

html.dark-theme .restaurant-pos-terminal__menu,
html.dark-theme .restaurant-pos-terminal__ticket,
html.dark-theme .restaurant-pos-shell .card,
html.dark-theme .restaurant-quick-modal .card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}

html.dark-theme .restaurant-quick-modal-header,
html.dark-theme .restaurant-quick-modal .card-header {
    background: #0f172a;
    border-color: #334155;
}

/* —— Modern form / payment cards —— */
html.dark-theme .modern-invoice-card,
html.dark-theme .payment-summary-card,
html.dark-theme .payment-record-item {
    background: #1e293b !important;
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-theme .btn-outline-primary {
    background: transparent;
    color: #34d399;
}

/* —— Wizard —— */
html.dark-theme .wizard-step-content,
html.dark-theme .wizard-progress,
html.dark-theme .booking-wizard-modal .modal-content,
html.dark-theme .booking-wizard-modal .card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* —— Report extras —— */
html.dark-theme .arrival-toolbar,
html.dark-theme .arrival-toolbar__input-group .form-control,
html.dark-theme .arrival-toolbar__input-group .input-group-text,
html.dark-theme .arrival-filter-btn.btn-outline-success,
html.dark-theme .arrival-tab-toolbar,
html.dark-theme .booking-metrics-toolbar,
html.dark-theme .booking-metrics-toolbar__input-group .form-control,
html.dark-theme .booking-metrics-toolbar__input-group .input-group-text,
html.dark-theme .pnl-date-banner,
html.dark-theme .pnl-panel,
html.dark-theme .pnl-chart-card,
html.dark-theme .hk-report-panel {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark-theme .arrival-toolbar__label,
html.dark-theme .booking-metrics-toolbar__label,
html.dark-theme .booking-metrics-toolbar__field-label,
html.dark-theme .booking-metrics-toolbar__hint,
html.dark-theme .hk-report-note,
html.dark-theme .hk-report-empty {
    color: #94a3b8 !important;
}

html.dark-theme .pnl-chart-card__head h6,
html.dark-theme .hk-report-panel__header,
html.dark-theme .pnl-date-banner {
    color: #f1f5f9 !important;
}

html.dark-theme .pnl-table-wrap thead th,
html.dark-theme .hk-report-panel .table thead th {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html.dark-theme .pnl-table-wrap td,
html.dark-theme .hk-report-panel .table tbody td {
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

html.dark-theme .report-summary-tile--clickable.is-active {
    border-color: #008a5e;
    box-shadow: 0 0 0 1px rgba(0, 138, 94, 0.35);
}

html.dark-theme .pnl-hero-actions .btn-outline-success,
html.dark-theme .booking-metrics-btn.btn-outline-success {
    background: #0f172a;
    border-color: #008a5e;
    color: #34d399;
}

html.dark-theme .skeleton-header,
html.dark-theme .skeleton-row,
html.dark-theme .skeleton-chart,
html.dark-theme .skeleton-chart-large,
html.dark-theme .skeleton-loader {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%) !important;
    background-size: 200% 100% !important;
}

html.dark-theme #invoiceItemsTable thead {
    background-color: #0f172a;
}
