/* Shared palette. Existing light-theme colors remain unchanged. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --theme-text: #e0e8f2;
    --theme-muted: #acbbcf;
    --theme-link: #8ac6ff;
    --theme-surface: #182331;
    --theme-surface-raised: #202e3e;
    --theme-border: #3b4e63;
    --theme-success-bg: #18392e;
    --theme-success-text: #9ddfc0;
    --theme-warning-bg: #3b311b;
    --theme-warning-text: #f1d18e;
    --theme-danger-text: #ffabb3;
    background: #111a25;
}
.display-time-setting { display: block; padding: 8px 9px; color: var(--theme-muted, #687789); font-size: 12px; }
.display-time-setting select { display: block; width: 100%; margin-top: 6px; padding: 6px; color: var(--theme-text, #263b4e); background: var(--theme-surface, #fff); border: 1px solid var(--theme-border, #d9e1e8); border-radius: 4px; }
.time-zone-warning { padding: 8px 10px; border-radius: 5px; background: #fbe9e7; color: #994d49; font-size: 12px; line-height: 1.5; }
.time-zone-warning[hidden] { display: none; }
:root[data-theme="dark"] .time-zone-warning { background: #442c30; color: #edb8b3; }
.theme-toggle {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #71869e;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
}
.theme-toggle:hover { background: rgba(128, 166, 208, .16); }
.theme-toggle:focus-visible { outline: 2px solid #8ac6ff; outline-offset: 3px; }
.account-menu-popover .theme-toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 9px;
    border: 0;
    border-radius: 4px;
    text-align: left;
}
:root[data-theme="dark"] .account-menu-popover .theme-toggle { color: var(--theme-link); }
.account-menu-popover .theme-toggle:hover { color: #fff; background: #176eae; }
:root[data-theme="dark"] .account-menu-popover .theme-toggle:hover { color: #fff; }
.account-card > .theme-toggle { display: flex; margin: 0 0 20px auto; color: var(--theme-text, #263b4e); }
:root[data-theme="dark"] a { color: var(--theme-link); }
:root[data-theme="dark"] .top-bar { background: #101c2c; }
:root[data-theme="dark"] .top-actions a,
:root[data-theme="dark"] .top-actions .theme-toggle { color: #e0e8f2; }
:root[data-theme="dark"] .brand span { color: #78b8ff; }
:root[data-theme="dark"] .account-page,
:root[data-theme="dark"] .admin-page { background: #111a25; }
:root[data-theme="dark"] :is(.queue-link.selected, .queue-link:hover, .ticket-history-item.current, .ticket-history-item:hover),
:root[data-theme="dark"] .tickets-table tbody tr:hover { background: #283f57; }
:root[data-theme="dark"] :is(.ticket-tab.active, .ticket-tab.active a) { color: #fff; }
:root[data-theme="dark"] :is(input, select, textarea) { accent-color: #8ac6ff; }
:root[data-theme="dark"] ::placeholder { color: #98a9bd; opacity: 1; }
:root[data-theme="dark"] :focus-visible { outline-color: #8ac6ff; }
:root[data-theme="dark"] :is(.assign-ticket-form select, .ticket-status-control select) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.5l5-5.25' fill='none' stroke='%23acbbcf' stroke-width='1.5'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .validation-message { background: #42252f; }
:root[data-theme="dark"] .ticket-status { color: #d1d5db; background: #374151; }
:root[data-theme="dark"] .ticket-status:is([data-status=""], [data-status="NEW"]) { color: #bfdbfe; background: #1e3a5f; }
:root[data-theme="dark"] .ticket-status:is([data-status="ACTIVE"], [data-status="OPEN"]) { color: #fed7aa; background: #60351c; }
:root[data-theme="dark"] .ticket-status[data-status="PENDING"] { color: #fde68a; background: #514018; }
:root[data-theme="dark"] .ticket-status[data-status="ON_HOLD"] { color: #e9d5ff; background: #48265f; }
:root[data-theme="dark"] .ticket-status[data-status="SOLVED"] { color: #bbf7d0; background: #1b4630; }
:root[data-theme="dark"] .ticket-status[data-status="CLOSED"] { color: #cbd5e1; background: #334155; }
:root[data-theme="dark"] .original-email iframe { color-scheme: light; background: #fff; }
:root[data-theme="dark"] * { scrollbar-color: #526780 transparent; }
@media (max-width: 720px) {
    .admin-page .top-bar { height: auto; min-height: 58px; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
    .admin-page .top-actions { flex-wrap: wrap; gap: 10px; }
}
