/* Day mode retains the established TUSC palette. */
:root { color-scheme: light; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; min-height: 40px; padding: 8px 10px; border: 1px solid #c9ddd8; border-radius: 7px; background: #f4faf8; color: #17665b; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.theme-toggle:hover { background: #e3f3ed; }
.theme-toggle:focus-visible { outline: 2px solid #087f6e; outline-offset: 3px; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-sun { display: none; }
.auth-theme-tools { display: flex; justify-content: flex-end; margin-bottom: 24px; }
:root[data-theme="dark"] { color-scheme: dark; background: #0c161e; color: #e4edf0; --night-bg: #0c161e; --night-surface: #15232d; --night-raised: #1c303b; --night-ink: #e4edf0; --night-muted: #a8bcc4; --night-line: #304650; --night-accent: #73dfc5; }
:root[data-theme="dark"] .workspace { --ink: var(--night-ink); --muted: var(--night-muted); --line: var(--night-line); --teal: var(--night-accent); background: var(--night-bg); }
:root[data-theme="dark"] :is(.auth-shell, .auth-panel) { background: var(--night-bg); }
:root[data-theme="dark"] :is(.topbar, .mobile-nav, .card, .metric) { background: var(--night-surface); border-color: var(--night-line); box-shadow: none; }
:root[data-theme="dark"] :is(.sidebar, .auth-intro) { background: #101f28; }
:root[data-theme="dark"] :is(.nav-item.active, .nav-item:hover) { background: #23464b; }
:root[data-theme="dark"] :is(.side-note, .form-stack.compact, .organization-folder > summary, #org-rights .check-label, .team-group-heading) { background: var(--night-raised); border-color: var(--night-line); }
:root[data-theme="dark"] :is(.muted, .subtle, .auth-help, .topbar-left, .topbar-user small, .heading-date span, .heading-date small, .metric p, .metric small, .event-info small, .review-main small, .table-toolbar span, .empty, .team-helper-details small, .roster-site, .member-permissions summary, .team-group-count) { color: var(--night-muted); }
:root[data-theme="dark"] :is(.form-stack label, .feature-form label, .feature-stack > label, .action-card label, .policy-form label, .date-fields label, .summary-controls label, .auth-mobile-brand strong, .mobile-logo strong, .team-group-heading h2, .sheet-helper) { color: var(--night-ink); }
:root[data-theme="dark"] :is(input:not([type=checkbox]), select, textarea, #behalf-site, #worker-assignment input, #worker-assignment select) { background-color: #101d26; border-color: #46616c; color: var(--night-ink); }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #91a7b1; }
:root[data-theme="dark"] input:autofill { box-shadow: 0 0 0 1000px #1c303b inset; -webkit-text-fill-color: var(--night-ink); }
:root[data-theme="dark"] :is(input, select, textarea):focus { border-color: var(--night-accent); }
:root[data-theme="dark"] :is(button, input, select, textarea, summary):focus-visible { outline-color: var(--night-accent); }
:root[data-theme="dark"] :is(.theme-toggle, .secondary-button, .review-actions button) { background: #193b38; color: #9cebd7; border-color: #427568; }
:root[data-theme="dark"] :is(.theme-toggle, .secondary-button, .review-actions button):hover:not(:disabled) { background: #25534a; }
:root[data-theme="dark"] .primary-button { background: #69d7bc; color: #092b24; border-color: #69d7bc; }
:root[data-theme="dark"] .primary-button:hover:not(:disabled) { background: #8ce6cf; }
:root[data-theme="dark"] :is(.text-button, .link-button, .eyebrow.dark, .summary-line, .team-clock-time, .team-group-heading small, .mobile-item.active) { color: var(--night-accent); }
:root[data-theme="dark"] .mobile-item.active { border-color: var(--night-accent); }
:root[data-theme="dark"] .mobile-item { color: var(--night-muted); }
:root[data-theme="dark"] :is(.avatar, .section-symbol, .event-mark, .team-helper-mark, .metric-icon.green) { background: #20483f; color: #9cebd7; }
:root[data-theme="dark"] .metric-icon.blue { background: #203e50; color: #9cd7f2; }
:root[data-theme="dark"] .metric-icon.amber { background: #493b24; color: #f3cf85; }
:root[data-theme="dark"] .badge.pending { background: #493b24; color: #f3cf85; }
:root[data-theme="dark"] .badge.approved { background: #20483f; color: #9cebd7; }
:root[data-theme="dark"] :is(.badge.rejected, .review-actions button.reject) { background: #462b2e; color: #ffb4ad; border-color: #82524f; }
:root[data-theme="dark"] :is(td, th, .event-row, .review-item, .team-helper, .pay-row, .table-toolbar, .cutoff-sheet, .organization-folder) { border-color: var(--night-line); }
:root[data-theme="dark"] th { background: var(--night-raised); color: #b9cdd4; }
:root[data-theme="dark"] :is(.registered-workers-table td:first-child, .cutoff-sheet .sheet-helper) { background: var(--night-surface); }
:root[data-theme="dark"] :is(.cutoff-sheet thead th, .cutoff-sheet .sheet-day-heading, .cutoff-sheet .sheet-week-heading, .cutoff-sheet .sheet-week-total) { background: #21413e; color: #c7ebe1; }
:root[data-theme="dark"] :is(.roster-approved, .cutoff-sheet td.sheet-approved) { background: #17372f; color: #d1eee3; }
:root[data-theme="dark"] :is(.roster-pending, .roster-in_progress, .cutoff-sheet td.sheet-pending) { background: #362e20; color: #efd39b; }
:root[data-theme="dark"] :is(.roster-rejected, .cutoff-sheet td.sheet-rejected) { background: #38272c; color: #ffb4ad; }
:root[data-theme="dark"] :is(.roster-no_attendance, .cutoff-sheet td.sheet-no_attendance) { background: #111f28; color: var(--night-muted); }
:root[data-theme="dark"] .workspace tbody tr:hover > td { background-color: #253c46; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
:root[data-theme="dark"] .topbar-separator { background: var(--night-line); }
@media (max-width: 680px) {
  .topbar .theme-toggle { width: 36px; min-height: 40px; padding: 7px; }
  .topbar [data-theme-label] { display: none; }
  .workspace .topbar-right { gap: 7px; }
  :root[data-theme="dark"] .board-card tbody tr { background: var(--night-surface); border-color: var(--night-line); }
  :root[data-theme="dark"] .board-card td::before { color: var(--night-muted); }
}

@media (max-width: 360px) { .topbar .avatar { display: none; } .topbar .mobile-logo strong { font-size: 13px; } }
