/* Explicit light surfaces; no inversion of photographs, receipts or announcements. */
.site-theme-switch {
    position: fixed; left: 12px; bottom: 12px; z-index: 900;
    display: flex; direction: ltr; gap: 3px; padding: 4px;
    border: 1px solid #64748b; border-radius: 999px;
    background: #18202f; box-shadow: 0 3px 12px #0003;
}
.site-theme-switch button {
    display: grid; place-items: center; width: 36px; height: 36px;
    min-width: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: #e2e8f0; font: 25px/1 sans-serif; cursor: pointer;
}
.site-theme-switch button[aria-pressed="true"] { background: #f5c15c; color: #18202f; }
.site-theme-switch button:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
html[data-theme="light"] { color-scheme: light; background: #e8dfca; }
html[data-theme="light"] body { background: #e8dfca !important; color: #202d38; }
html[data-theme="light"] .site-theme-switch { background: #f5efe6; border-color: #a9c0d8; }
html[data-theme="light"] .site-theme-switch button { color: #354957; }
html[data-theme="light"] :is(.container, .dashboard-sidebar, .stat-box, .status-panel,
    .modal-box, .modal-content, .cards-modal-content, .partial-modal-box,
    .member-withdraw-panel, .member-withdraw-form, .rc-page, .rc-stat,
    .rc-settings-dialog, .public-order-card, .public-info-box, .public-shot-box,
    .jalali-datetime-picker, .card-list-toolbar, .farmer-wallet-summary,
    .card, .info-box, .card-setting-box, .card-bulk-dialog, .farmer-player-card,
    .farmer-dashboard-header, .farmer-info-item, .farmer-change-dialog,
    .admin-card-lease-box, .admin-notification-panel, .low-coin-farmer-item,
    .rules-modal-content, .rules-list, .account-summary-card,
    .auto-distribution-summary div, .continue-order-summary div, .continue-order-note,
    .member-filter, .gallery .tile, .gallery .preview, .finder-controls) {
    background: #f5efe6 !important; color: #202d38; border-color: #a9c0d8 !important;
    box-shadow: 0 4px 20px #0f172a0a;
}
html[data-theme="light"] :is(h1, h2, h3, h4, .stat-value, .rc-stat strong) { color: #202d38; }
html[data-theme="light"] :is(.form-group label, .stat-title, .toolbar-info,
    .invoice-sort-control, .partial-heading p, .partial-modal p, .partial-modal small,
    .partial-table small, .partial-email, .rc-intro p, .rc-stat small, .rc-stat p,
    .rc-stat > span, .dashboard-sidebar-section-title, .dashboard-sidebar-user small,
    .empty-state, .golden-tariff-help, .members-page-note) { color: #526471; }
html[data-theme="light"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="button"]):not([type="submit"]), textarea, select) {
    background-color: #f5efe6 !important; color: #202d38 !important;
    border-color: #6d94c5 !important; color-scheme: light;
}
html[data-theme="light"] ::placeholder { color: #526471; opacity: 1; }
html[data-theme="light"] :is(input, textarea, select):focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
html[data-theme="light"] table { background: #f5efe6; color: #202d38; }
html[data-theme="light"] :is(th, td) { border-color: #c2d2e1 !important; }
html[data-theme="light"] th { background: #cbdceb !important; color: #354957 !important; }
html[data-theme="light"] tbody tr { background: #f5efe6; color: #202d38; }
html[data-theme="light"] tbody tr:nth-child(even) { background: #e6eef6; }
html[data-theme="light"] tbody tr:hover { background: #dbe7f2; }
html[data-theme="light"] .order-row.selected { background: #cbdceb; }
html[data-theme="light"] :is(.table-wrap, .partial-table-wrap) { border-color: #a9c0d8; }
html[data-theme="light"] :is(.filter-btn, .archive-filter-btn):not(.active) {
    background: #cbdceb; color: #354957; border-color: #a9c0d8;
}
html[data-theme="light"] :is(.dashboard-sidebar-link, .dashboard-sidebar-user) { color: #202d38; }
html[data-theme="light"] .dashboard-sidebar-link { background: #e8dfca; border-color: #c2d2e1; }
html[data-theme="light"] .dashboard-sidebar-link:hover { background: #cbdceb; }
html[data-theme="light"] .partial-uuid { color: #245d86; }
html[data-theme="light"] :is(.jalali-datetime-trigger, .jalali-picker-time select) { background: #f5efe6; color: #202d38; }
html[data-theme="light"] .jalali-picker-day { color: #354957; }
html[data-theme="light"] .jalali-picker-day:hover { background: #cbdceb; }
html[data-theme="light"] .purchase-session-banner[data-active="true"] { background: #dcfce7; color: #166534; }
html[data-theme="light"] .purchase-session-banner[data-active="false"] { background: #fee2e2; color: #991b1b; }
html[data-theme="light"] :is(.purchase-session-notice, .order-card-lock-badge) { background: #fef3c7; color: #854d0e; }
html[data-theme="light"] :is(.card strong, .info-box p, .rules-paragraph, .rules-list li,
    .rules-section-title, .management-number, .card-setting-heading label,
    .farmer-info-item strong, .farmer-header-title, .account-summary-value,
    .player-name, .player-details, .low-coin-farmer-name, .low-coin-farmer-coin) { color: #354957; }
html[data-theme="light"] :is(.empty-state, .player-image, .members-page-note) { background: #e8dfca; }
html[data-theme="light"] :is(.card-setting-heading small, .card-bulk-dialog small) { color: #526471; }
html[data-theme="light"] :is(.farmer-header-secondary, .management-back-btn,
    .admin-notification-button, .farmer-notification-filter, .accounting-pagination a) {
    background: #cbdceb; color: #354957; border-color: #a9c0d8;
}
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link-primary { background: #fef3c7; color: #78350f; }
html[data-theme="light"] .dashboard-sidebar::before { background: none; }
html[data-theme="light"] select option { background: #f5efe6; color: #202d38; }
html[data-theme="light"] :is(.farmer-header-presence strong, .member-withdraw-panel > summary,
    .member-filter label, .farmer-header-coin strong) { color: #354957; }
html[data-theme="light"] :is(.low-coin-farmer-item small, .farmer-info-item > span,
    .farmer-header-title span, .farmer-header-presence div span, .gallery .filename, .gallery .hint) { color: #526471; }
html[data-theme="light"] .low-coin-ready-label { color: #166534; }
html[data-theme="light"] :is(.finder-subtitle, .finder-help, .finder-refresh-note, .finder-slot,
    .rc-pages, .rc-empty) { color: #526471; }
html[data-theme="light"] .rc-table td { background: inherit; }
html[data-theme="light"] .rc-table tr:hover td { background: #dbe7f2; }
html[data-theme="light"] :is(.rc-section-status, .rc-notice, .rc-code) { background: #fffbeb; color: #854d0e; }
html[data-theme="light"] .rc-card-code summary { color: #854d0e; }
html[data-theme="light"] .order-farmer-details-table td { color: #354957; }
html[data-theme="light"] :is(.eldorado-alert-banner, .eldorado-large-order) { background: #fffbeb; color: #78350f; }
/* Light-only palette: readable text, restrained blue accents, semantic statuses. */
html[data-theme="light"] {
    --light-ink: #202d38;
    --light-muted: #526471;
    --light-accent: #245d86;
    --light-line: #a9c0d8;
}
html[data-theme="light"] :is(.btn-normal, .btn-primary) {
    background: #245d86; color: #fff; border-color: #245d86;
}
html[data-theme="light"] :is(.btn-normal, .btn-primary):hover {
    background: #194b70; color: #fff; border-color: #194b70;
}
html[data-theme="light"] .btn-success { background: #166534; color: #fff; border-color: #166534; }
html[data-theme="light"] .btn-success:hover { background: #14532d; color: #fff; }
html[data-theme="light"] .btn-danger { background: #b91c1c; color: #fff; border-color: #b91c1c; }
html[data-theme="light"] .btn-danger:hover { background: #991b1b; color: #fff; }
html[data-theme="light"] :is(.btn-secondary, .action-btn, .copy-btn) {
    background: #cbdceb; color: #354957; border-color: #a9c0d8;
}
html[data-theme="light"] :is(.btn-secondary, .action-btn, .copy-btn):hover {
    background: #cbdceb; color: #194b70; border-color: #6d94c5; box-shadow: 0 3px 10px #0f172a12;
}
html[data-theme="light"] .delete-btn:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
html[data-theme="light"] :is(.btn-icon, i.icon) { color: #526471; }
html[data-theme="light"] .btn-icon:hover { color: #245d86; }
html[data-theme="light"] :is(.btn-primary, .btn-normal, .btn-success, .btn-danger) i.icon { color: inherit; }
html[data-theme="light"] :is(.filter-btn, .archive-filter-btn, .invoice-tab).active {
    background: #245d86; color: #fff; border-color: #245d86;
}
html[data-theme="light"] :is(.filter-btn, .archive-filter-btn, .invoice-tab):not(.active):hover {
    background: #cbdceb; color: #194b70;
}
html[data-theme="light"] .status-badge.running { color: #166534; }
html[data-theme="light"] :is(.status-badge.completed, .status-badge.partly-completed) { color: #245d86; }
html[data-theme="light"] .status-badge.error { color: #b91c1c; }
html[data-theme="light"] :is(.status-badge.starting, .status-badge.awaiting-credentials,
    .status-badge.waiting-login, .status-badge.stopping, .status-badge.paused) { color: #92400e; }
html[data-theme="light"] :is(.order-elapsed, .dashboard-sidebar-user strong,
    .status-panel b, .farmer-header-title h2) { color: #354957; }
html[data-theme="light"] .dashboard-sidebar-user {
    background: #e6eef6; border-color: #cbdceb; box-shadow: none;
}
html[data-theme="light"] :is(.dashboard-sidebar-avatar, .dashboard-sidebar-icon) {
    background: #cbdceb; color: #194b70; border-color: #a9c0d8;
}
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link {
    background: #e6eef6; color: #354957; border-color: #cbdceb;
}
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link:hover {
    background: #cbdceb; color: #194b70; border-color: #a9c0d8;
}
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link-primary {
    background: #cbdceb; color: #194b70; border-color: #a9c0d8;
}
html[data-theme="light"] .site-theme-switch button[aria-pressed="true"] {
    background: #cbdceb; color: #194b70;
}
html[data-theme="light"] :is(.stat-title, .management-section-heading p,
    .farmer-header-coin > span, .farmer-header-coin small, .card-setting-heading small,
    .low-coin-farmer-item small, .farmer-info-item > span) { color: #526471; }
html[data-theme="light"] .stat-box { border-top-color: #6d94c5 !important; }
html[data-theme="light"] .farmer-info-item { background: #e6eef6 !important; }
html[data-theme="light"] :is(.management-count, .golden-period-badge) {
    background: #fef3c7; color: #78350f; border-color: #fcd34d;
}
html[data-theme="light"] .low-coin-ready-label { background: #dcfce7; color: #166534; }
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled { background-color: #e8dfca !important; color: #526471 !important; }
/* Powder blue anchors the navigation and table headers against cream surfaces. */
html[data-theme="light"] .dashboard-sidebar { background: #cbdceb !important; }
html[data-theme="light"] th { background: #6d94c5 !important; color: #12263a !important; }
html[data-theme="light"] .dashboard-sidebar-user { background: #e6eef6; }
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link { background: #e6eef6; }
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link:hover { background: #f5efe6; }
html[data-theme="light"] .dashboard-page .dashboard-sidebar-link-primary { background: #6d94c5; color: #12263a; }
html[data-theme="light"] .stat-box { border-top: 3px solid #6d94c5 !important; }
@media print { .site-theme-switch { display: none !important; } }

/* Nested components have their own dark-theme colours. Pair each light
   surface with its text instead of relying on the table/body inheritance. */
html[data-theme="light"] { --text-color: #202d38; }
html[data-theme="light"] :is(.card-box, .management-number, .public-stat-grid > div,
    .public-checking-panel, .order-price-preview, .shop-adjustment-option span) {
    background: #e6eef6; color: #202d38; border-color: #a9c0d8;
}
html[data-theme="light"] .card-box { background: #f5efe6; }
html[data-theme="light"] .file-btn { background: #e6eef6; color: #202d38; border-color: #a9c0d8; }
html[data-theme="light"] .file-btn:hover { background: #cbdceb; border-color: #6d94c5; }
html[data-theme="light"] .file-btn .file-text { color: #354957; }
html[data-theme="light"] .file-arrow,
html[data-theme="light"] .file-btn:hover .file-arrow { color: #245d86; }
html[data-theme="light"] .partial-error { background: #fee2e2; color: #991b1b !important; border-color: #dca0a0; }
html[data-theme="light"] .card-table td:last-child { color: #202d38; }
html[data-theme="light"] #farmerPurchaseDetailsModal .management-table td,
html[data-theme="light"] .order-farmer-details-table td { color: #202d38; }
html[data-theme="light"] .card-table td.card-assignment-summary { color: #245d86 !important; }
html[data-theme="light"] :is(.management-username, .management-name, .modal-field-label,
    .auto-distribution-summary strong, .continue-order-summary strong,
    .public-stat-grid strong, .public-checking-panel strong,
    .public-order-header h1, .public-section-heading h2, .public-info-box h2,
    .public-shot-box h2, .order-price-preview strong, #orderPriorityValue) { color: #202d38; }
html[data-theme="light"] :is(.eta-value, .progress-head, #status-desc, .management-public-id,
    .order-price-preview span, .farmer-capacity-field label,
    .public-order-header p, .public-section-heading p, .public-checking-panel p,
    .public-info-box p, .public-shot-box > p, .public-stat-grid span,
    .public-progress-head, .public-form-message, .management-empty) { color: #526471; }
html[data-theme="light"] :is(.management-eyebrow, .rules-title, #progress-text, .progress-title,
    .farmer-bank-edit, .farmer-capacity-cell strong, .farmer-capacity-manual,
    .admin-notification-panel-header, .farmer-notification-group-header) { color: #245d86; }
html[data-theme="light"] .rules-list li::marker { color: #245d86; }
html[data-theme="light"] .management-table tr.inactive-row td { opacity: 1; }
html[data-theme="light"] .management-table tr.inactive-row { background: #eee5df; }
html[data-theme="light"] .management-table tr.inactive-row:hover { background: #e5dbd4; }
html[data-theme="light"] .management-table tr.inactive-row:hover td { opacity: 1; }
html[data-theme="light"] :is(.speed-green, .status-active, .public-form-message.success) { color: #166534; }
html[data-theme="light"] :is(.speed-yellow, .farmer-card-lease-paused) { color: #854d0e; }
html[data-theme="light"] :is(.speed-red, .status-inactive, .public-form-message.error,
    #card-bulk-error, #card-bulk-delete-warning, .order-priority-message[data-error="true"]) { color: #991b1b; }
html[data-theme="light"] :is(.management-status.is-active, .card-setting-status.is-success) {
    background: #dcfce7; color: #166534; border-color: #86b998;
}
html[data-theme="light"] :is(.management-status.is-inactive, .card-setting-status.is-error) {
    background: #fee2e2; color: #991b1b; border-color: #dca0a0;
}
html[data-theme="light"] :is(.auto-distribution-badge, .reassignment-pending-badge,
    .rules-warning, .farmer-auto-exemption-button) {
    background: #fef3c7; color: #78350f; border-color: #cda963;
}
html[data-theme="light"] button.auto-distribution-badge:hover { background: #fde9ab; color: #78350f; }
html[data-theme="light"] .management-toggle-btn.activate {
    background: #dcfce7; color: #166534; border-color: #86b998;
}
html[data-theme="light"] .management-toggle-btn.deactivate {
    background: #fee2e2; color: #991b1b; border-color: #dca0a0;
}
html[data-theme="light"] .management-toggle-btn.activate:hover { background: #166534; color: #fff; }
html[data-theme="light"] .management-toggle-btn.deactivate:hover { background: #991b1b; color: #fff; }
html[data-theme="light"] .shop-adjustment-option.subtract input:checked + span {
    background: #fee2e2; color: #991b1b; border-color: #b91c1c;
}
html[data-theme="light"] .shop-adjustment-option.add input:checked + span {
    background: #dcfce7; color: #166534; border-color: #166534;
}
html[data-theme="light"] .farmer-notification-filter:hover,
html[data-theme="light"] .farmer-notification-filter.active { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .farmer-notification-group-header strong { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .sf-page td small { color: #854d0e; opacity: 1; }
html[data-theme="light"] .farmer-header-secondary:hover { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .management-back-btn:hover { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .farmer-header-danger { background: #fee2e2; color: #991b1b; }
html[data-theme="light"] .farmer-header-danger:hover { background: #991b1b; color: #fff; }
html[data-theme="light"] .jalali-picker-day:hover,
html[data-theme="light"] .jalali-picker-day:focus-visible { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .jalali-picker-day.selected { background: #245d86; color: #fff; }
html[data-theme="light"] .jalali-picker-header button,
html[data-theme="light"] .jalali-picker-actions button { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .jalali-picker-actions .btn-success { background: #166534; color: #fff; }
html[data-theme="light"] .finder-state { background: #e6eef6; color: #354957; }
html[data-theme="light"] .finder-state[data-state="scanning"] { background: #dcfce7; color: #166534; }
html[data-theme="light"] .finder-state[data-state="logging_in"],
html[data-theme="light"] .finder-state[data-state="starting"] { background: #cbdceb; color: #194b70; }
html[data-theme="light"] .finder-state[data-state="cooldown"],
html[data-theme="light"] .finder-state[data-state="rotating"],
html[data-theme="light"] .finder-state[data-state="stopping"] { background: #fef3c7; color: #78350f; }
html[data-theme="light"] .finder-state[data-state="offline"],
html[data-theme="light"] #finder-error { background: #fee2e2; color: #991b1b; }
