/* Tema notturno (scuro) dell'app Turni.
   Si attiva aggiungendo la classe "tema-notte" all'elemento <html> (lo fa tema-notturno.js).
   Le prime regole sono generate dalle classi Tailwind usate nell'app; poi ci sono quelle per le classi personalizzate. */
html.tema-notte .text-slate-800{color:#e2e8f0}
html.tema-notte .bg-white\/90{background-color:rgba(30,41,59,0.9)}
html.tema-notte .border-white\/60{border-color:rgba(71,85,105,0.6)}
html.tema-notte .bg-white{background-color:rgba(30,41,59,1)}
html.tema-notte .border-slate-100{border-color:#26334a}
html.tema-notte .text-slate-900{color:#f1f5f9}
html.tema-notte .text-slate-500{color:#9aa8bc}
html.tema-notte .text-slate-700{color:#cbd5e1}
html.tema-notte .bg-emerald-100\/70{background-color:rgba(16,185,129,0.22)}
html.tema-notte .text-emerald-600{color:#6ee7b7}
html.tema-notte .border-slate-200{border-color:#33425c}
html.tema-notte .bg-slate-50\/70{background-color:rgba(22,32,51,0.7)}
html.tema-notte .placeholder-slate-400{color:#8b9ab0}
html.tema-notte .bg-rose-50{background-color:rgba(244,63,94,0.16)}
html.tema-notte .hover\:bg-rose-100:hover{background-color:rgba(244,63,94,0.22)}
html.tema-notte .text-rose-700{color:#fda4af}
html.tema-notte .border-rose-200\/80{border-color:rgba(244,63,94,.45)}
html.tema-notte .bg-white\/80{background-color:rgba(30,41,59,0.8)}
html.tema-notte .border-white\/80{border-color:rgba(71,85,105,0.8)}
html.tema-notte .text-emerald-700{color:#6ee7b7}
html.tema-notte .hover\:border-emerald-300:hover{border-color:rgba(16,185,129,.45)}
html.tema-notte .hover\:bg-emerald-50\/40:hover{background-color:rgba(16,185,129,0.16)}
html.tema-notte .bg-rose-200\/60{background-color:rgba(244,63,94,.30)}
html.tema-notte .bg-slate-200\/60{background-color:rgba(38,51,74,0.6)}
html.tema-notte .border-slate-300\/40{border-color:#3f506b}
html.tema-notte .text-emerald-950{color:#6ee7b7}
html.tema-notte .border-white{border-color:rgba(71,85,105,0.6)}
html.tema-notte .text-slate-600{color:#b4c0d1}
html.tema-notte .hover\:text-emerald-900:hover{color:#6ee7b7}
html.tema-notte .hover\:bg-white\/70:hover{background-color:rgba(30,41,59,0.7)}
html.tema-notte .hover\:text-indigo-900:hover{color:#a5b4fc}
html.tema-notte .hover\:text-amber-900:hover{color:#fcd34d}
html.tema-notte .hover\:text-sky-900:hover{color:#7dd3fc}
html.tema-notte .hover\:text-cyan-900:hover{color:#67e8f9}
html.tema-notte .hover\:text-slate-900:hover{color:#f1f5f9}
html.tema-notte .hover\:text-teal-900:hover{color:#5eead4}
html.tema-notte .bg-slate-100\/80{background-color:rgba(28,41,64,0.8)}
html.tema-notte .border-slate-200\/80{border-color:#33425c}
html.tema-notte .hover\:bg-white:hover{background-color:rgba(30,41,59,1)}
html.tema-notte .border-amber-300{border-color:rgba(245,158,11,.45)}
html.tema-notte .text-amber-700{color:#fcd34d}
html.tema-notte .hover\:bg-amber-50:hover{background-color:rgba(245,158,11,0.16)}
html.tema-notte .hover\:bg-slate-50:hover{background-color:rgba(22,32,51,1)}
html.tema-notte .bg-amber-50{background-color:rgba(245,158,11,0.16)}
html.tema-notte .border-emerald-200\/60{border-color:rgba(16,185,129,.45)}
html.tema-notte .bg-white\/20{background-color:rgba(30,41,59,0.2)}
html.tema-notte .divide-emerald-100\/60{border-color:rgba(16,185,129,.45)}
html.tema-notte .bg-indigo-100{background-color:rgba(99,102,241,0.22)}
html.tema-notte .text-indigo-600{color:#a5b4fc}
html.tema-notte .bg-slate-50\/50{background-color:rgba(22,32,51,0.5)}
html.tema-notte .divide-slate-100{border-color:#26334a}
html.tema-notte .bg-amber-100{background-color:rgba(245,158,11,0.22)}
html.tema-notte .text-amber-600{color:#fcd34d}
html.tema-notte .text-slate-400{color:#8b9ab0}
html.tema-notte .bg-slate-50\/80{background-color:rgba(22,32,51,0.8)}
html.tema-notte .border-amber-200{border-color:rgba(245,158,11,.45)}
html.tema-notte .hover\:bg-amber-100:hover{background-color:rgba(245,158,11,0.22)}
html.tema-notte .bg-sky-100{background-color:rgba(14,165,233,0.22)}
html.tema-notte .text-sky-600{color:#7dd3fc}
html.tema-notte .bg-teal-100{background-color:rgba(20,184,166,0.22)}
html.tema-notte .text-teal-600{color:#5eead4}
html.tema-notte .bg-emerald-50{background-color:rgba(16,185,129,0.16)}
html.tema-notte .border-emerald-200{border-color:rgba(16,185,129,.45)}
html.tema-notte .text-emerald-900{color:#6ee7b7}
html.tema-notte .text-emerald-800{color:#6ee7b7}
html.tema-notte .bg-slate-200{background-color:rgba(38,51,74,1)}
html.tema-notte .text-sky-700{color:#7dd3fc}
html.tema-notte .bg-sky-50{background-color:rgba(14,165,233,0.16)}
html.tema-notte .border-sky-200{border-color:rgba(14,165,233,.45)}
html.tema-notte .bg-slate-50{background-color:rgba(22,32,51,1)}
html.tema-notte .border-slate-300{border-color:#3f506b}
html.tema-notte .bg-blue-50{background-color:rgba(59,130,246,0.16)}
html.tema-notte .border-blue-300{border-color:rgba(59,130,246,.45)}
html.tema-notte .text-blue-700{color:#93c5fd}
html.tema-notte .border-rose-200{border-color:rgba(244,63,94,.45)}
html.tema-notte .bg-slate-100{background-color:rgba(28,41,64,1)}
html.tema-notte .text-rose-600{color:#fda4af}
html.tema-notte .text-blue-600{color:#93c5fd}
html.tema-notte .text-red-500{color:#fca5a5}
html.tema-notte .bg-white\/95{background-color:rgba(30,41,59,0.95)}
html.tema-notte .bg-emerald-100{background-color:rgba(16,185,129,0.22)}
html.tema-notte .hover\:text-slate-600:hover{color:#b4c0d1}
html.tema-notte .hover\:bg-slate-100:hover{background-color:rgba(28,41,64,1)}
html.tema-notte .hover\:text-slate-700:hover{color:#cbd5e1}
html.tema-notte .border-slate-200\/70{border-color:#33425c}
html.tema-notte .hover\:text-rose-700:hover{color:#fda4af}
html.tema-notte .bg-slate-300{background-color:rgba(51,66,92,1)}
html.tema-notte .text-slate-300{color:#64748b}
html.tema-notte .text-rose-500{color:#fda4af}
html.tema-notte .hover\:bg-slate-50\/80:hover{background-color:rgba(22,32,51,0.8)}
html.tema-notte .bg-blue-100{background-color:rgba(59,130,246,0.22)}
html.tema-notte .text-blue-800{color:#93c5fd}
html.tema-notte .border-blue-200{border-color:rgba(59,130,246,.45)}
html.tema-notte .hover\:bg-blue-50\/50:hover{background-color:rgba(59,130,246,0.16)}
html.tema-notte .text-amber-800{color:#fcd34d}
html.tema-notte .bg-red-100{background-color:rgba(239,68,68,0.22)}
html.tema-notte .text-red-800{color:#fca5a5}
html.tema-notte .border-red-300{border-color:rgba(239,68,68,.45)}
html.tema-notte .hover\:bg-blue-100:hover{background-color:rgba(59,130,246,0.22)}
html.tema-notte .hover\:text-blue-800:hover{color:#93c5fd}
html.tema-notte .hover\:text-red-700:hover{color:#fca5a5}
html.tema-notte .bg-indigo-50{background-color:rgba(99,102,241,0.16)}
html.tema-notte .text-indigo-700{color:#a5b4fc}
html.tema-notte .border-indigo-100{border-color:rgba(99,102,241,.45)}
html.tema-notte .hover\:bg-emerald-100:hover{background-color:rgba(16,185,129,0.22)}
html.tema-notte .text-rose-400{color:#fda4af}
html.tema-notte .bg-slate-50\/60{background-color:rgba(22,32,51,0.6)}
html.tema-notte .border-emerald-300{border-color:rgba(16,185,129,.45)}
html.tema-notte .hover\:border-emerald-400:hover{border-color:rgba(16,185,129,.45)}
html.tema-notte .hover\:bg-emerald-50:hover{background-color:rgba(16,185,129,0.16)}
html.tema-notte .text-amber-900{color:#fcd34d}
html.tema-notte .active\:bg-emerald-100:active{background-color:rgba(16,185,129,0.22)}
html.tema-notte .bg-white\/10{background-color:rgba(30,41,59,0.1)}
html.tema-notte .hover\:bg-white\/20:hover{background-color:rgba(30,41,59,0.2)}
html.tema-notte .hover\:bg-rose-50:hover{background-color:rgba(244,63,94,0.16)}
html.tema-notte .bg-emerald-50\/60{background-color:rgba(16,185,129,0.16)}
html.tema-notte .bg-emerald-50\/50{background-color:rgba(16,185,129,0.16)}
html.tema-notte .border-emerald-400{border-color:rgba(16,185,129,.45)}

/* ============ Base ============ */
html.tema-notte { color-scheme: dark; }
html.tema-notte body { background-image: none !important; background-color: #0b1220 !important; color: #e2e8f0; }
html.tema-notte ::placeholder { color: #8b9ab0; opacity: 1; }
html.tema-notte input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]),
html.tema-notte select, html.tema-notte textarea { background-color: #111c30; color: #e2e8f0; border-color: #3b4a63; }
html.tema-notte option { background-color: #111c30; color: #e2e8f0; }
html.tema-notte hr { border-color: #334155; }

/* ============ Tabella turni ============ */
html.tema-notte #table-body tr:nth-child(even) { background-color: rgba(16,185,129,.06); }
html.tema-notte #table-body tr:hover { background-color: rgba(16,185,129,.12); }
html.tema-notte #table-head th.is-weekend { background-color: #1a2538; color: #94a3b8; }
html.tema-notte #table-body td.is-weekend { background-color: rgba(148,163,184,.06); }
html.tema-notte #table-head th.is-today { color: #6ee7b7; background-color: rgba(16,185,129,.18); }
html.tema-notte #table-body td.is-today { background-color: rgba(16,185,129,.14); }
@media (min-width: 641px) {
  html.tema-notte #sec-turni .overflow-x-auto { border-color: #475569; }
  html.tema-notte #table-head th { border-right-color: #475569; border-bottom-color: #475569; }
  html.tema-notte #table-body td { border-right-color: #33425c; }
  html.tema-notte #table-body tr { border-bottom-color: #33425c; }
  html.tema-notte #table-body td.abs-cell.abs-cont { border-right-color: transparent; }
}
@media (max-width: 640px) {   /* vista a schede su smartphone */
  html.tema-notte #table-body tr, html.tema-notte #table-body tr:nth-child(even) { background: #162033; border-color: rgba(16,185,129,.35); box-shadow: none; }
  html.tema-notte #table-body td:first-child { background: rgba(16,185,129,.14) !important; border-bottom-color: rgba(16,185,129,.25); }
  html.tema-notte #table-body td:not(:first-child) { border-bottom-color: #26334a; }
  html.tema-notte #table-body td:not(:first-child)::before { color: #94a3b8; }
  html.tema-notte #table-body td.is-weekend:not(:first-child) { background-color: #1a2538; }
  html.tema-notte #table-body td.is-today:not(:first-child) { background-color: rgba(16,185,129,.16); }
  html.tema-notte #table-body td.is-today:not(:first-child)::before { color: #6ee7b7; }
}

/* ============ Pillole, avatar, assenze ============ */
html.tema-notte .shift-pill { background: rgba(59,130,246,.18); border-color: rgba(96,165,250,.45); color: #bfdbfe; }
html.tema-notte .abs-ferie { background: rgba(245,158,11,.20); color: #fcd34d; border-color: rgba(245,158,11,.5); }
html.tema-notte .abs-permesso { background: rgba(59,130,246,.20); color: #93c5fd; border-color: rgba(96,165,250,.5); }
html.tema-notte .abs-malattia { background: rgba(239,68,68,.20); color: #fca5a5; border-color: rgba(248,113,113,.5); }
html.tema-notte .abs-recupero { background: rgba(16,185,129,.20); color: #6ee7b7; border-color: rgba(52,211,153,.5); }
html.tema-notte .emp-avatar, html.tema-notte .az-avatar { border-color: #1e293b; box-shadow: 0 0 0 1px #475569, 0 2px 5px rgba(0,0,0,.4); }

/* ============ Schede, guida, statistiche ============ */
html.tema-notte .company-card { background: rgba(30,41,59,.95); border-color: #334155; box-shadow: 0 10px 25px -12px rgba(0,0,0,.6); }
html.tema-notte .company-card:hover { border-color: #34d399; }
html.tema-notte .guida-card { background: rgba(30,41,59,.92); border-color: #334155; box-shadow: 0 10px 25px -15px rgba(0,0,0,.6); }
html.tema-notte .guida-box { background: #162033; border-color: #334155; }
html.tema-notte .guida-list { color: #b4c0d1; }
html.tema-notte .stat-kpi { background: rgba(30,41,59,.95); border-color: #334155; box-shadow: 0 8px 20px -14px rgba(0,0,0,.6); }
html.tema-notte .stat-up { background: rgba(14,165,233,.2); color: #7dd3fc; }
html.tema-notte .stat-down { background: rgba(249,115,22,.2); color: #fdba74; }
html.tema-notte .stat-eq { background: #26334a; color: #94a3b8; }
html.tema-notte .stat-bar { background: #26334a; }
html.tema-notte .stat-pos { background: #26334a; color: #cbd5e1; }
html.tema-notte .stat-pos-1 { background: #fde047; color: #854d0e; }
html.tema-notte .stat-pos-2 { background: #cbd5e1; color: #1e293b; }
html.tema-notte .stat-pos-3 { background: #fdba74; color: #7c2d12; }
html.tema-notte .stat-th { background: #162033; color: #b4c0d1; border-bottom-color: #475569; }
html.tema-notte .stat-th button:hover { color: #f8fafc; }
html.tema-notte .stat-col.sel { background: rgba(16,185,129,.14); box-shadow: inset 0 0 0 1px rgba(52,211,153,.5); }
html.tema-notte .stat-v { color: #cbd5e1; }
html.tema-notte .stat-v-c { color: #8b9ab0; }

/* ============ Eccezioni ============ */
/* l'anteprima del PDF dei notturni resta un "foglio bianco" con testo scuro, come sarà stampato */
html.tema-notte #lay-prev { background-color: #fff !important; }
html.tema-notte #toast, html.tema-notte [id^="toast"] { border: 1px solid #334155; }
