/* Palette shared by every screen. Screen-only: printed attendance stays light. */
@media screen{
 :root{
  color-scheme:light;
  --bg:#f4f6f5;--surface:#ffffff;--surface-soft:#f0f4f1;--hover:#e8eeea;
  --text:#24352f;--muted:#607268;--border:#dce5df;--grid-border:#d2ded6;
  --blue:#2563eb;--primary:#2563eb;--primary-hover:#1d4ed8;--on-primary:#ffffff;
  --sidebar:#f8fafc;--sidebar-text:#334155;--sidebar-muted:#596a80;--sidebar-border:#dce3ec;
  --nav-active:#e8f0fe;--nav-active-text:#1d4ed8;--nav-hover:#edf2f8;
  --sidebar-accent:#2563eb;--on-sidebar-accent:#ffffff;
  --green-bg:#e2f2e8;--green-text:#246647;--green-border:#b8d9c6;
  --red-bg:#fbecee;--red-text:#a13649;--red-border:#eac5cd;
  --yellow-bg:#fff3d6;--yellow-text:#785717;--yellow-border:#e6d39e;
  --info-bg:#e9f2ee;--info-text:#365e4c;--focus:#2563eb;--danger:#ad3344;
 }
 :root[data-theme=dark]{
  color-scheme:dark;
  --bg:#20242c;--surface:#282d36;--surface-soft:#303641;--hover:#383f4c;
  --text:#edf0f5;--muted:#b1bac9;--border:#414957;--grid-border:#4a5463;
  --blue:#60a5fa;--primary:#60a5fa;--primary-hover:#93c5fd;--on-primary:#10223b;
  --sidebar:#191d24;--sidebar-text:#cbd5e1;--sidebar-muted:#a4b1c3;--sidebar-border:#343d4c;
  --nav-active:#25344d;--nav-active-text:#93c5fd;--nav-hover:#ffffff0d;
  --sidebar-accent:#60a5fa;--on-sidebar-accent:#10223b;
  --green-bg:#233f30;--green-text:#a0deb9;--green-border:#3a644d;
  --red-bg:#422b31;--red-text:#f1a9b4;--red-border:#70414c;
  --yellow-bg:#3e3522;--yellow-text:#e7cb89;--yellow-border:#705e35;
  --info-bg:#2c303a;--info-text:#c6cfdf;--focus:#93c5fd;--danger:#f2a5b0;
 }
 body{background:var(--bg);color:var(--text)}
 a{color:var(--blue)}
 button,input,select,dialog,.panel,.stat{background:var(--surface);color:var(--text);border-color:var(--border)}
 input::placeholder{color:var(--muted);opacity:1}
 input:disabled,select:disabled{background:var(--surface-soft)}
 button:hover{background:var(--hover)}
 .primary,.offline button{background:var(--primary);color:var(--on-primary);border-color:var(--primary)}
 .primary:hover{background:var(--primary-hover);border-color:var(--primary-hover)}
 aside{background:var(--sidebar);color:var(--sidebar-text);border-right:1px solid var(--sidebar-border)}
 .brand{color:var(--sidebar-text);border-color:var(--sidebar-border)}
 .brand small,.offline p{color:var(--sidebar-muted)}
 .logo,.offline button{background:var(--sidebar-accent);color:var(--on-sidebar-accent);border-color:transparent}
 .offline button:hover{filter:brightness(1.06);background:var(--sidebar-accent)}
 nav button{background:transparent;color:var(--sidebar-text)}
 nav button:hover{background:var(--nav-hover)}
 nav button.active{background:var(--nav-active);color:var(--nav-active-text);box-shadow:none}
 nav .settings-submenu button{color:var(--sidebar-muted)}
 nav .settings-submenu button:hover{background:var(--nav-hover);color:var(--sidebar-text)}
 nav .settings-submenu button.active{background:var(--nav-active);color:var(--nav-active-text);box-shadow:inset 3px 0 var(--sidebar-accent)}
 .offline{border-color:var(--sidebar-border)}
 .settings-submenu{border-left-color:var(--sidebar-border)}
 .month-tools label{background:var(--surface);color:var(--text);border-color:var(--border)}
 .month-tools input{background:transparent}
 th,.month-grid th,.month-grid th.employee-col{background:var(--surface-soft);color:var(--muted)}
 td,.month-grid td,.month-grid th,.month-grid tr:last-child td{border-color:var(--grid-border)}
 .month-grid .employee-col{background:var(--surface);border-color:var(--grid-border)}
 .month-grid .total-col,.month-grid .summary-col{background:var(--surface-soft);color:var(--text);border-color:var(--grid-border)}
 .day-cell button{background:transparent;color:inherit;border:0}
 .day-cell button:hover{background:#80808014;outline-color:var(--focus)}
 .month-scroll{scrollbar-color:var(--border) var(--surface-soft)}
 .symbol,.eraser,.badge,.avatar{background:var(--surface-soft);color:var(--text)}
 .symbol.selected,.palette .symbol.selected{outline-color:var(--focus);background:var(--green-bg)}
 .marked,.badge.work,.settings-table .symbol{background:var(--green-bg);color:var(--green-text)}
 .month-grid .sunday,.month-grid .sunday.marked,.month-grid .holiday-day,.month-grid .holiday-day.marked{background:var(--red-bg);color:var(--red-text)}
 .month-grid .makeup-day,.month-grid .makeup-day.marked{background:var(--green-bg);color:var(--green-text)}
 .month-grid .proposed-day,.month-grid .proposed-day.marked{background:var(--yellow-bg);color:var(--yellow-text);box-shadow:inset 0 -2px var(--yellow-border)}
 .notice{background:var(--info-bg);color:var(--info-text);border-color:var(--border)}
 .holiday-notice,.badge.leave{background:var(--yellow-bg);color:var(--yellow-text);border-color:var(--yellow-border)}
 .holiday-notice.confirmed{background:var(--green-bg);color:var(--green-text);border-color:var(--green-border)}
 .badge.absent{background:var(--red-bg);color:var(--red-text)}
 .danger,.error{color:var(--danger)}
 .link{background:transparent;color:var(--blue)}
 .link.danger{color:var(--danger)}
 .link:hover{background:var(--hover)}
 fieldset,.pagination,.calendar-confirm,.symbol-list>div,.settings-editor .rule-row,.holiday-agenda article{border-color:var(--border)}
 .settings-count,.total-formula{background:var(--info-bg);color:var(--info-text);border-color:var(--border)}
 .total-formula span,.total-formula small{color:var(--info-text)}
 .section-kicker{color:var(--muted)!important}
 .settings-workspace .column-list article{background:var(--surface);border-color:var(--border)}
 .settings-workspace .column-list article.editing{background:var(--info-bg);border-color:var(--focus)}
 .settings-editor .rule-row b{color:var(--blue)}
 .settings-workspace input[readonly]{background:var(--surface-soft);color:var(--muted)}
 .calendar-weekdays{background:var(--surface-soft);border-color:var(--border)}
 .calendar-weekdays span{color:var(--muted)}
 .calendar-days,.calendar-blank,.calendar-date{border-color:var(--grid-border)}
 .calendar-blank,.calendar-date{background:var(--surface);color:var(--text)}
 .calendar-weekdays span.weekend{color:var(--red-text)}
 .calendar-date.weekend,.calendar-date.holiday,.agenda-date.holiday,.calendar-legend i.holiday{background:var(--red-bg);color:var(--red-text)}
 .calendar-date.substitute,.agenda-date.substitute,.calendar-legend i.substitute,.status-pending{background:var(--yellow-bg);color:var(--yellow-text)}
 .calendar-date.workday,.agenda-date.workday,.calendar-legend i.workday,.status-confirmed{background:var(--green-bg);color:var(--green-text)}
 .calendar-date.selected{outline-color:var(--focus);box-shadow:none}
 .calendar-date:hover{outline-color:var(--focus);filter:brightness(1.06)}
 .calendar-source a{color:var(--blue)}
 .stat:nth-child(2) strong{color:var(--blue)}
 .stat:nth-child(3) strong{color:var(--yellow-text)}
 button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,.day-cell button:focus-visible{outline-color:var(--focus)}
 dialog::backdrop{background:#09090bb3}
 #toast{background:var(--green-bg);color:var(--green-text);border:1px solid var(--green-border)}
 .theme-picker{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--sidebar-border);margin:0 0 16px;padding:0 0 16px}
 .theme-caption{display:grid;gap:3px}.theme-caption span{color:var(--sidebar-muted);font-size:11px}.theme-caption strong{color:var(--sidebar-text);font-size:13px;font-weight:600}
 .offline #themeToggle{display:grid;place-items:center;width:46px;height:46px;min-width:46px;min-height:46px;padding:0;margin:0;border-radius:50%;background:var(--nav-active);border:1px solid var(--sidebar-border);color:var(--nav-active-text);transition:background .18s,box-shadow .18s}
 .offline #themeToggle .ui-icon{width:23px;height:23px;margin:0;stroke-width:1.8}
 .offline #themeToggle:hover{background:var(--nav-hover);color:var(--sidebar-accent);filter:none;box-shadow:0 0 0 4px #ffffff08}
 .offline #themeToggle:focus-visible{outline-color:var(--sidebar-accent)}
 /* Legacy symbol colors remain distinguishable in either theme. */
 .sym-X,.sym-N,.sym-CT{background:var(--green-bg)!important;color:var(--green-text)!important}
 .sym-P,.sym-L{background:var(--info-bg)!important;color:var(--info-text)!important}
 .sym-O{background:var(--yellow-bg)!important;color:var(--yellow-text)!important}
 .sym-KP{background:var(--red-bg)!important;color:var(--red-text)!important}
}
