.appearance-panel { margin-bottom: 22px; }
.appearance-panel label { max-width: 320px; margin-top: 12px; }
.appearance-panel .helper { margin-top: 8px; }

/* Dark palette. The default styles continue to provide the light theme. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111b20;
  --surface: #1a282f;
  --inset: #152229;
  --hover: #22353e;
  --text: #e9f4f5;
  --muted: #aec4c8;
  --line: #30434c;
  --field-line: #557079;
  --green: #a6d6de;
  --mint: #24414b;
  --lime: #b1dfe5;
  --on-accent: #132e36;
  --amber-surface: #3e301c;
  --amber-text: #f5ce8c;
  --amber-line: #987647;
  --violet-surface: #332a3e;
  --violet-text: #e2c8f5;
  --danger-surface: #3d2529;
  --danger-hover: #512d34;
  --danger-text: #ffadb2;
  --danger-line: #a46169;
  background: var(--canvas);
  color: var(--text);
}

/* Shared surfaces, text and controls */
[data-theme="dark"] :is(.panel, .sidebar, .topbar, .stat-card, .outline-pill, dialog, .more-item,
  .home-card, .notification-template-group, .duty-entry-save, .duty-person-option, .auth-layout) {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] .active-users { background: transparent; }
@media (min-width: 601px) {
  [data-theme="dark"] .active-users { background: var(--surface); }
}
[data-theme="dark"] dialog::backdrop { background: #0b151bcc; }
[data-theme="dark"] :is(.eyebrow, .residence-label, .nav-label, .nav-link, .profile small, .topbar,
  .page-heading p, .outline-pill, .stat-card > div > span, .stat-card strong small, .news-meta > span:last-child,
  .news-card .news-body, .news-footer, .schedule-item small, .empty, .empty h3, .loading, .helper,
  label, dialog > p, .calendar-legend, .user-name, .users-table th, .users-table td, .pending-users-list .user-name small,
  .personal-settings-intro, .notification-settings-intro, .notification-template-card p, .news-audience,
  .profile-settings-panel p, .laundry-notification-panel > p, .duty-reminders-panel > p,
  .news-preferences-panel > p, .room-groups-panel > p, .more-item small, .home-card-main small,
  .home-earnings-values small, .home-card-detail, .laundry-day-view summary, .user-row-toggle small,
  .duty-slot-status) { color: var(--muted); }
[data-theme="dark"] :is(.schedule-item, .users-table td) { border-color: var(--line); }
[data-theme="dark"] :is(.brand > svg, .button), [data-theme="dark"] #toast {
  background: var(--green);
  color: var(--on-accent);
}
[data-theme="dark"] :is(.brand-dot, .wave) { color: var(--green); }
[data-theme="dark"] .button:hover { background: #bbe4e9; }
[data-theme="dark"] .button.secondary { background: var(--surface); color: var(--green); border-color: var(--field-line); }
[data-theme="dark"] .button.secondary:hover { background: var(--hover); }
[data-theme="dark"] .button.light { background: var(--lime); color: var(--on-accent); }
[data-theme="dark"] :is(.nav-link:hover, .icon-button:hover, .duty-person-option:hover) { background: var(--hover); border-color: var(--field-line); }
[data-theme="dark"] :is(.nav-link.active, .more-item[aria-current="page"], .green, .mint,
  .avatar, .date-tile, .count, .admin-tool-symbol, .admin-tool-month) { background: var(--mint); color: var(--green); }
[data-theme="dark"] .neutral { background: var(--hover); color: var(--muted); }
[data-theme="dark"] :is(.peach, .amber) { background: var(--amber-surface); color: var(--amber-text); }
[data-theme="dark"] :is(.purple, .lilac) { background: var(--violet-surface); color: var(--violet-text); }
[data-theme="dark"] :is(input, select, textarea, .duty-entry-card input, .duty-entry-card textarea, .payroll-deductions-table input) {
  background: var(--inset);
  border-color: var(--field-line);
  color: var(--text);
}
[data-theme="dark"] :is(input, textarea)::placeholder { color: #a3b9bd; }
[data-theme="dark"] :is(input, select, textarea):focus { border-color: var(--green); }
[data-theme="dark"] .laundry-reminder-time select:disabled { background: var(--surface); color: var(--muted); }
[data-theme="dark"] :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--green); }
[data-theme="dark"] :is(button, a, input, textarea, select, summary):focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
[data-theme="dark"] :is(.form-error, .danger, .deduction-error, .danger-zone h3) { color: var(--danger-text); }
[data-theme="dark"] :is(.button.secondary.booking-release, .duty-management .danger-button, .participant-remove,
  .duty-assignment-remove, .user-delete, .active-users .user-delete, .month-management-action.danger-zone),
[data-theme="dark"] #toast.error {
  background: var(--danger-surface);
  border-color: var(--danger-line);
  color: var(--danger-text);
}
[data-theme="dark"] :is(.button.secondary.booking-release, .duty-management .danger-button, .participant-remove,
  .duty-assignment-remove, .user-delete, .active-users .user-delete):hover { background: var(--danger-hover); }
[data-theme="dark"] :is(.sidebar-note, .tip-card, .welcome-banner, .news-category-choices > .checkbox, .info-strip) {
  background: var(--mint);
  border-color: var(--line);
  color: var(--text);
}
[data-theme="dark"] :is(.sidebar-note > span, .tip-card h3, .tip-card > span, .tip-card > svg, .sidebar-note svg) { color: var(--green); }
[data-theme="dark"] :is(.sidebar-note p, .tip-card p) { color: var(--muted); }

/* Pralnica */
[data-theme="dark"] .segmented { background: var(--inset); }
[data-theme="dark"] :is(.segmented button, .laundry-panel .segmented button, .duty-mobile-filter button,
  .laundry-days button, .laundry-table thead th, .laundry-table thead th strong, .laundry-table tbody th,
  .laundry-table tbody th small) { color: var(--muted); }
[data-theme="dark"] .laundry-days button { background: var(--surface); border-color: var(--field-line); }
[data-theme="dark"] :is(.segmented button.selected, .laundry-days [aria-pressed="true"],
  .duty-mobile-filter [aria-pressed="true"]) {
  background: var(--green);
  border-color: var(--green);
  color: var(--on-accent);
  box-shadow: none;
}
[data-theme="dark"] .laundry-table thead th.current-day { background: var(--mint); }
[data-theme="dark"] :is(.laundry-slot.free, .laundry-table .booking.free:not(:disabled), .laundry-panel .laundry-free-key) {
  background: var(--inset);
  border-color: #6e9ba7;
  color: var(--green);
}
[data-theme="dark"] .laundry-table .booking.free:not(:disabled):hover { background: var(--hover); }
[data-theme="dark"] :is(.laundry-slot.mine:hover, .laundry-table .booking.mine:hover) { background: var(--lime); }
[data-theme="dark"] .laundry-table .booking.occupied:not(:disabled):hover { background: #4b3820; }
[data-theme="dark"] .laundry-table .booking.occupied small { color: var(--amber-text); }
[data-theme="dark"] :is(.laundry-slot.past, .laundry-table .booking.free:disabled) { background: var(--hover); color: var(--muted); }

/* Razpored in upravljanje dežurstev */
[data-theme="dark"] .duty-fullscreen-view:fullscreen { background: var(--canvas); color: var(--text); }
[data-theme="dark"] :is(.duty-calendar th, .duty-calendar td, .duty-holidays th, .duty-holidays td) { border-color: var(--line); }
[data-theme="dark"] .duty-calendar thead th { background: var(--inset); color: var(--muted); }
[data-theme="dark"] .duty-calendar tbody .duty-weekday span { color: var(--text); }
[data-theme="dark"] .duty-calendar .weekend-day { background: #2b251c; }
[data-theme="dark"] :is(.duty-calendar .holiday-day, .duty-holidays thead th) { background: var(--violet-surface); }
[data-theme="dark"] .duty-calendar .weekend-day th span { color: var(--amber-text); }
[data-theme="dark"] :is(.duty-calendar .holiday-day th span, .duty-calendar tbody th small,
  .duty-holidays th, .duty-holidays td) { color: var(--violet-text); }
[data-theme="dark"] .duty-calendar .today-day .duty-date strong { background: var(--mint); color: var(--green); }
[data-theme="dark"] .duty-calendar td .duty-assignment.own-assignment { background: var(--mint); color: var(--green); }
[data-theme="dark"] :is(.duty-calendar td.clickable-slot:hover, .duty-calendar td.move-source, .duty-vacancy:not(:disabled):hover,
  .draft-control, .draft-control.in-progress, .duty-roster li.current-participant, .participant-restore) {
  background: var(--mint);
  border-color: var(--field-line);
  color: var(--text);
}
[data-theme="dark"] :is(.duty-content p, .applicant small, .archive summary, .entry-person small, .entry-feedback,
  .participant-list small, .duty-person-search > label, .duty-person-option small, .participant-room,
  .duty-roster li small, .removed-roster small, .roster-empty, .last-pick p, .legacy-duty-records summary,
  .legacy-duty-records p, .registration-panel p, .duty-archive-panel p, .draft-control p,
  .draft-control.in-progress p, .admin-tool-description, .month-management-action p, .rate-input-wrap > span,
  .duty-rate-history summary) { color: var(--muted); }
[data-theme="dark"] .duty-roster li.current-participant .position { color: var(--green); }

/* Knjiga, obračun in obrazci */
[data-theme="dark"] :is(.duty-book-entry, .duty-book-payroll tfoot, .payroll-rate, .payroll-totals > div) {
  background: var(--mint);
  border-color: var(--line);
}
[data-theme="dark"] :is(.duty-book-table small, .duty-book-table .section-heading p, .duty-book-payroll p,
  .duty-book-table thead th, .duty-book-payroll thead th, .payroll-totals span, .payroll-deductions-table th small,
  .duty-earnings-totals span, .duty-earnings-totals small, .duty-entry-header > div, .duty-entry-intro,
  .duty-entry-card label, .duty-entry-calls > p, .duty-entry-save > p, .duty-entry-footer, .guest-duty-fields .helper) {
  color: var(--muted);
}
[data-theme="dark"] :is(.payroll-totals strong, .duty-entry-brand > span) { color: var(--green); }
[data-theme="dark"] .payroll-saved-report { border-color: var(--line); }
[data-theme="dark"] .log-voided { background: var(--hover); color: var(--muted); }
[data-theme="dark"] :is(.payroll-deductions-table [data-deduction-hours], .duty-entry-switch) {
  background: var(--amber-surface);
  border-color: var(--amber-line);
  color: var(--amber-text);
}
[data-theme="dark"] :is(.duty-entry-switch p, .log-missing) { color: var(--amber-text); }
[data-theme="dark"] .deduction-invalid [data-deduction-hours] {
  background: var(--danger-surface);
  border-color: var(--danger-line);
  color: var(--danger-text);
}
[data-theme="dark"] .duty-entry-calls legend > span { background: var(--mint); color: var(--green); }

@media (max-width: 600px) {
  [data-theme="dark"] :is(.duty-calendar tbody td, .mobile-card-table tr) { background: var(--surface); }
  [data-theme="dark"] :is(.duty-calendar tbody td:has(.own-assignment), .duty-calendar td.clickable-slot:hover,
    .duty-calendar td.move-source) { background: var(--mint); }
  [data-theme="dark"] .duty-calendar .today-day .duty-date strong { background: transparent; color: inherit; }
  [data-theme="dark"] :is(.duty-calendar tbody td::before, .mobile-card-table td[data-label]::before) { color: var(--muted); }
  [data-theme="dark"] .user-row-toggle.mobile-only { color: var(--text); }
}
