/* Shared palette for the application, guest pages and Django administration. */
:root, html[data-theme="light"] {
  color-scheme:light;
  --positive-bg:#e8f8ef; --positive-text:#18744b;
  --negative-bg:#fff0f1; --negative-text:#b33247;
  --caution-bg:#fff7df; --caution-text:#89600d;
  --violet-bg:#eeedff; --violet-text:#6051b8;
  --surface:#fff; --surface-soft:#f3f8fd; --blue-soft:#e8f3ff;
  --bg:#f3f8fd; --bg-2:#eaf3fc; --bg-body:#f3f8fd; --card:#fff;
  --text:#203852; --text-muted:#5b718a; --text-light:#687f98;
  --border:#dce8f4; --border-light:#edf3f9; --border-strong:#bfd4ea;
  --primary:#2878cf; --primary-hover:#1c62ad; --primary-2:#1c62ad; --primary-3:#20598d;
  --accent:#2878cf; --accent-2:#36a3dc;
  --shadow:0 8px 30px #2b63900a; --shadow-card:0 4px 20px #2b639009;
  --shadow-lg:0 16px 48px #2b639018;
  --bg-primary:var(--surface); --bg-secondary:var(--surface-soft); --bg-card:var(--surface);
  --bg-hover:var(--blue-soft); --text-primary:var(--text); --text-secondary:var(--text-muted);
  --accent-hover:var(--primary-hover);
}
html[data-theme="dark"] {
  color-scheme:dark;
  --positive-bg:#163d35; --positive-text:#8ce4bd;
  --negative-bg:#402938; --negative-text:#ffb1ba;
  --caution-bg:#3c3424; --caution-text:#f7d68d;
  --violet-bg:#312d50; --violet-text:#c3baff;
  --surface:#17263a; --surface-soft:#111f31; --blue-soft:#203d5c;
  --bg:#0d1929; --bg-2:#111f31; --bg-body:#0d1929; --card:#17263a;
  --text:#e1ecf8; --text-muted:#adbed2; --text-light:#93a9c2;
  --border:#2b4059; --border-light:#24374d; --border-strong:#486583;
  --primary:#75baff; --primary-hover:#9dcfff; --primary-2:#75baff; --primary-3:#9dcfff;
  --accent:#75baff; --accent-2:#67c9f1;
  --shadow:0 8px 30px #0002; --shadow-card:0 4px 20px #0002; --shadow-lg:0 16px 48px #0004;
  --bs-body-color:#e1ecf8; --bs-body-bg:#0d1929; --bs-secondary-color:#adbed2;
  --bs-emphasis-color:#e1ecf8; --bs-border-color:#2b4059; --bs-tertiary-bg:#111f31;
  --bs-primary-rgb:117,186,255; --bs-secondary-rgb:173,190,210;
  --bs-success-rgb:102,218,173; --bs-danger-rgb:255,151,163; --bs-warning-rgb:245,206,121;
}
body.simple-theme { background:var(--bg); color:var(--text); line-height:1.75; }
.simple-theme .app-sidebar { background:var(--surface); color:var(--text); border-left:1px solid var(--border); box-shadow:-4px 0 24px #2b639005; }
.simple-theme .sidebar-brand { height:84px; border-bottom:1px solid var(--border); padding-inline:20px; }
.simple-theme .brand-icon { width:43px; height:43px; color:#fff; background:linear-gradient(140deg,#429ce4,#2878cf); border-radius:14px; }
.simple-theme .brand-text strong { color:var(--text); font-size:1.05rem; }
.simple-theme .brand-text span { color:var(--text-muted); margin-top:4px; }
.simple-theme .nav-section-title { display:block; color:var(--text-light); font-size:.68rem; padding:16px 14px 8px; letter-spacing:0; }
.simple-theme .sidebar-nav { padding:6px 12px 16px; }
.simple-theme .sidebar-nav .nav-link { min-height:46px; border-radius:12px; color:var(--text-muted); padding:10px 14px; gap:12px; font-weight:500; }
.simple-theme .sidebar-nav .nav-link i { color:inherit; width:22px; font-size:1rem; }
.simple-theme .sidebar-nav .nav-link:hover { background:var(--surface-soft); color:var(--primary); }
.simple-theme .sidebar-nav .nav-link.active { background:var(--blue-soft); color:var(--primary); box-shadow:inset -3px 0 var(--primary); font-weight:700; }
.simple-theme .sidebar-footer { flex-direction:column; align-items:stretch; padding:16px; border-top:1px solid var(--border); }
.simple-theme .user-mini { padding:8px 4px; }
.simple-theme .user-avatar { background:var(--blue-soft); color:var(--primary); width:40px; height:40px; border-radius:13px; object-fit:cover; }
.simple-theme .user-info strong { color:var(--text); }
.simple-theme .user-info span { display:block; color:var(--text-muted); font-size:.7rem; }
.simple-theme .btn-sidebar-logout { width:100%; min-height:40px; border:1px solid var(--border); border-radius:10px; }
.simple-theme .app-topbar { height:84px; min-height:84px; background:var(--surface); border-bottom:1px solid var(--border); padding-inline:26px; }
.simple-theme .app-content { padding:26px; }
.simple-theme .topbar-title h2 { color:var(--text); font-weight:800; font-size:1.1rem; }
.simple-theme .topbar-title p { margin-top:4px; }
.simple-theme .btn-icon,.simple-theme #notifBell,.theme-toggle { width:44px; height:44px; flex:0 0 44px; display:inline-grid; place-items:center; border:1px solid var(--border); border-radius:13px; background:var(--surface-soft); color:var(--text-muted); box-shadow:none; cursor:pointer; }
.simple-theme #notifBell:hover,.theme-toggle:hover { background:var(--blue-soft); color:var(--primary); border-color:var(--border-strong); }
.theme-toggle { font:inherit; font-size:21px; line-height:1; }
.theme-toggle svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.theme-toggle .theme-sun,html[data-theme="dark"] .theme-toggle .theme-moon { display:none; }
html[data-theme="dark"] .theme-toggle .theme-sun { display:block; }
.guest-theme-toggle { position:fixed; top:20px; inset-inline-end:20px; z-index:1100; }
.simple-theme .topbar-clock { background:var(--surface-soft); padding:6px 14px; border:1px solid var(--border); }
.simple-theme .topbar-clock .clock-time { color:var(--text); }
.simple-theme .card,.simple-theme .stat-card,.simple-theme .comment-card,.simple-theme .biometric-setup-card { background:var(--surface); border-color:var(--border); border-radius:18px; box-shadow:var(--shadow-card); }
.simple-theme .card-header { background:var(--surface); border-color:var(--border); padding:18px 20px; color:var(--text); gap:12px; }
.simple-theme .card-body { padding:20px; }
.simple-theme .stat-card { padding:20px; min-height:122px; }
.simple-theme .stat-card strong { color:var(--text); font-size:1.8rem; }
.simple-theme .stat-card-icon { top:20px; left:20px; width:42px; height:42px; border-radius:13px; background:var(--blue-soft); color:var(--primary); }
.simple-theme .page-header h1,.simple-theme .biometric-copy h1 { color:var(--text); }
.simple-theme .btn { min-height:42px; padding:9px 16px; font-weight:600; border-radius:11px; }
.simple-theme .btn-sm { min-height:36px; padding:6px 12px; }
.simple-theme .btn-primary,.simple-theme .page-header .btn-primary,.simple-theme .btn-topbar-primary { background:#2878cf; border-color:#2878cf; color:#fff; }
.simple-theme .btn-primary:hover,.simple-theme .btn-topbar-primary:hover { background:#1c62ad; border-color:#1c62ad; }
.simple-theme .btn-outline-primary { color:var(--primary); border-color:var(--border-strong); background:var(--blue-soft); }
.simple-theme .btn-outline-primary:hover { color:#fff; background:#2878cf; }
.simple-theme .btn-outline-secondary { color:var(--text-muted); border-color:var(--border-strong); }
.simple-theme .form-control,.simple-theme .form-select,.simple-theme .input-group-text { color:var(--text); background-color:var(--surface); border-color:var(--border-strong); min-height:46px; border-radius:11px; }
.simple-theme .form-control:focus,.simple-theme .form-select:focus { background-color:var(--surface); color:var(--text); border-color:var(--primary); box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 14%,transparent); }
.simple-theme .form-control::placeholder { color:var(--text-light); opacity:1; }
.simple-theme .form-control:disabled,.simple-theme .form-control[readonly] { background:var(--surface-soft); }
.simple-theme .form-label { color:var(--text); font-weight:600; }
.simple-theme .form-check-input { border-color:var(--border-strong); background-color:var(--surface); }
.simple-theme .form-check-input:checked { background-color:#2878cf; border-color:#2878cf; }
.simple-theme .table { --bs-table-bg:var(--surface); --bs-table-color:var(--text); --bs-table-hover-bg:var(--surface-soft); --bs-table-hover-color:var(--text); --bs-table-border-color:var(--border); color:var(--text); }
.simple-theme .table thead th { background:var(--surface-soft); color:var(--text-muted); font-weight:600; padding:15px 16px; }
.simple-theme .table td { padding:15px 16px; border-color:var(--border-light); }
.simple-theme .table > tbody > tr:hover { transform:none; }
.simple-theme .text-muted,.simple-theme .form-text { color:var(--text-muted)!important; }
.simple-theme .bg-light,.simple-theme .bg-white { background-color:var(--surface-soft)!important; }
.simple-theme .text-dark { color:var(--text)!important; }
.simple-theme .border { border-color:var(--border)!important; }
.simple-theme .dropdown-menu,.simple-theme .modal-content,.simple-theme .list-group-item,.simple-theme .page-link { background:var(--surface); border-color:var(--border); color:var(--text); }
.simple-theme .dropdown-item { color:var(--text); }
.simple-theme .dropdown-item:hover { background:var(--blue-soft); }
.simple-theme .page-item.active .page-link { background:#2878cf; color:#fff; }
.simple-theme .guest-wrapper { background:var(--bg); }
.simple-theme .guest-bg { background:radial-gradient(ellipse at 20% 20%,var(--blue-soft),transparent 60%),linear-gradient(145deg,var(--surface-soft),var(--bg)); }
.simple-theme .login-card { border:1px solid var(--border); box-shadow:var(--shadow-lg); border-radius:24px; }
.simple-theme .login-icon-wrap { background:var(--blue-soft); color:var(--primary); box-shadow:none; }
.simple-theme .guest-wrapper > main > .row > div > p { color:var(--text-muted)!important; }
.simple-theme .leave-form-hero,.simple-theme .biometric-visual { background:var(--blue-soft); }
.simple-theme .fingerprint-rings { border-color:var(--border-strong); box-shadow:0 0 0 18px color-mix(in srgb,var(--primary) 7%,transparent),0 0 0 38px color-mix(in srgb,var(--primary) 4%,transparent); }
.simple-theme .fingerprint-rings i { color:var(--primary); filter:none; }
.simple-theme .biometric-benefits span { color:var(--text-muted); }
.simple-theme .jalali-picker-panel { background:var(--surface); border-color:var(--border); }
.simple-theme .identity-camera { background:var(--surface); color:var(--text); }
.simple-theme .identity-camera-head button { color:var(--text); }
.simple-theme .identity-camera [data-status] { background:var(--blue-soft); }
.simple-theme .employee-dashboard .month-calendar-day { background:var(--surface-soft); border-color:var(--border); }
.simple-theme .employee-dashboard .month-calendar-day.is-today { background:var(--blue-soft); border-color:var(--primary); }
.simple-theme .employee-dashboard .month-day-number { color:var(--text); }
:where(a,button,input,select,textarea):focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
.skip-link { position:fixed; top:-80px; right:20px; padding:10px 20px; background:var(--surface); color:var(--primary); z-index:5000; border:2px solid var(--primary); border-radius:10px; }
.skip-link:focus { top:10px; }
html[data-theme="dark"] :is(.status-approved,.badge-present,.month-status.attendance,.biometric-ready,.live-dot) { background:#163d35; color:#8ce4bd; border-color:#2c6955; }
html[data-theme="dark"] :is(.status-rejected,.badge-absent,.month-status.holiday,.month-calendar-day.is-holiday) { background:#402938!important; color:#ffb1ba; border-color:#704050!important; }
html[data-theme="dark"] :is(.status-pending,.badge-pending,.biometric-required) { background:#3c3424; color:#f7d68d; border-color:#6e5a34; }
html[data-theme="dark"] :is(.alert-info,.app-alert.alert-info,.leave-mode-hint) { background:#203d5c; color:#b1d8ff; border-color:#375779; }
html[data-theme="dark"] :is(.alert-warning,.app-alert.alert-warning) { background:#3c3424; color:#f7d68d; border-color:#6e5a34; }
html[data-theme="dark"] :is(.alert-danger,.app-alert.alert-error,.biometric-toast.is-error) { background:#402938; color:#ffb1ba; border-color:#704050; }
html[data-theme="dark"] :is(.alert-success,.app-alert.alert-success,.biometric-toast) { background:#163d35; color:#8ce4bd; border-color:#2c6955; }
@media(max-width:991.98px) {
  .simple-theme .app-content { padding:20px; }
  .simple-theme .app-topbar { padding-inline:18px; height:76px; min-height:76px; }
  .simple-theme .app-sidebar { height:100dvh; }
}
@media(max-width:767.98px) {
  .simple-theme .app-content { padding:16px 12px 28px; }
  .simple-theme .app-topbar { padding:10px 12px; gap:8px; height:auto; min-height:72px; }
  .simple-theme .topbar-clock { display:none; }
  .simple-theme .topbar-left,.simple-theme .topbar-right { gap:6px; }
  .simple-theme .topbar-title h2 { max-width:none; font-size:.94rem; }
  .simple-theme .btn-topbar-primary { width:42px; height:42px; padding:0; justify-content:center; }
  .simple-theme .btn-topbar-primary span { display:none; }
  .simple-theme .card-header,.simple-theme .card-body { padding:16px; }
  .simple-theme .page-header { align-items:stretch; }
  .simple-theme .page-header > div { min-width:0; }
  .simple-theme .card-header > .d-flex { flex-wrap:wrap; gap:8px; }
  .simple-theme .form-control,.simple-theme .form-select { font-size:16px; }
  .simple-theme .stat-card { padding:16px; min-height:112px; }
  .simple-theme .stat-card strong { font-size:1.5rem; }
  .simple-theme .stat-card-icon { top:16px; left:16px; width:34px; height:34px; }
  .simple-theme .mobile-record-table td,.simple-theme .leave-list tbody td { padding:11px 0; }
  .simple-theme .mobile-record-table tbody tr,.simple-theme .leave-list tbody tr { background:var(--surface); border-color:var(--border); }
  .simple-theme .biometric-copy { padding:22px 16px; }
  .simple-theme .credential-row { grid-template-columns:32px minmax(0,1fr) auto; gap:8px; }
  .simple-theme .biometric-toast { left:12px; right:12px; bottom:16px; max-width:none; }
  .simple-theme .guest-wrapper { padding-top:65px; }
  .simple-theme .employee-calendar-body { padding:8px; }
  .simple-theme .employee-dashboard .month-calendar-day { min-height:58px; }
}
@media(max-width:380px) {
  .simple-theme .btn-icon,.simple-theme #notifBell { width:40px; height:40px; flex-basis:40px; }
  .simple-theme .app-topbar { padding-inline:8px; }
  .simple-theme .topbar-title h2 { font-size:.82rem; }
  .simple-theme .topbar-left,.simple-theme .topbar-right { gap:4px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; animation-delay:0s!important; transition-duration:.01ms!important; scroll-behavior:auto!important; }
  .reveal,.stagger > * { opacity:1!important; transform:none!important; }
}
@media print {
  .app-sidebar,.app-topbar,.theme-toggle,.pwa-install-button { display:none!important; }
  .simple-theme .app-main { margin:0; }
  body.simple-theme { background:white; color:black; }
}
/* Overlays and hover states also follow the active palette. */
.simple-theme .jalali-date-display:hover { background:var(--surface-soft)!important; }
.simple-theme .btn-icon:hover { background:var(--blue-soft); border-color:var(--border-strong); color:var(--primary); }
.simple-theme .face-capture-video-wrap { background:#101827; }
html[data-theme="dark"] .stat-card::after { display:none; }
.simple-theme .management-launcher { background:var(--surface); border-color:var(--border); }
.simple-theme .topbar-clock.guest-clock { background:var(--surface); border-color:var(--border); }
