/* ================= מתג יום/לילה ומצב כהה =================
   המתג: מסלול של שמיים עם עננים ושמש (יום), שמתגלגל לשמיים כהים עם כוכבים וירח (לילה).
   המצב הכהה: html[data-theme=dark]. כל הצבעים מוחלפים דרך משתנים, ואחריהם תיקונים נקודתיים. */

.daynight { position: relative; flex: none; width: 66px; height: 32px; padding: 0; border: 0 !important; border-radius: 999px !important; cursor: pointer;
  background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.daynight:hover { transform: none; }
.daynight:focus-visible { outline: 3px solid rgba(124, 196, 255, .8); outline-offset: 3px; }
.dn-track { position: absolute; inset: 0; border-radius: 999px; overflow: hidden;
  background: linear-gradient(180deg, #62b6ff 0%, #3a8ff0 100%);
  box-shadow: inset 0 2px 5px rgba(0, 40, 90, .35), inset 0 -1px 0 rgba(255, 255, 255, .35), 0 1px 0 rgba(255, 255, 255, .7);
  transition: background .6s ease; }
/* עננים: שלוש שכבות של עיגולים לבנים */
.dn-clouds { position: absolute; inset: 0; transition: transform .6s cubic-bezier(.6, 0, .2, 1), opacity .4s; }
.dn-clouds::before, .dn-clouds::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.dn-clouds::before { width: 30px; height: 30px; right: -6px; bottom: -12px;
  box-shadow: -14px 6px 0 2px #fff, -27px 10px 0 0 #fff, -6px -4px 0 -4px rgba(255, 255, 255, .7), -20px -2px 0 -3px rgba(255, 255, 255, .6); opacity: .95; }
.dn-clouds::after { width: 22px; height: 22px; right: 4px; bottom: -6px; background: rgba(255, 255, 255, .55); box-shadow: -18px -3px 0 -2px rgba(255, 255, 255, .45); }
/* כוכבים */
.dn-stars { position: absolute; inset: 0; opacity: 0; transform: translateY(-8px); transition: opacity .5s .1s, transform .6s cubic-bezier(.6, 0, .2, 1); }
.dn-stars::before { content: ""; position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; top: 8px; left: 12px;
  box-shadow: 9px 10px 0 0 #fff, 18px 2px 0 .3px #fff, 26px 13px 0 0 rgba(255, 255, 255, .7), 6px 16px 0 -.3px rgba(255, 255, 255, .6), 31px 4px 0 0 rgba(255, 255, 255, .8); }
/* הכדור: שמש שהופכת לירח */
.dn-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe680 0%, #ffcf2e 55%, #f5b400 100%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .22), 0 0 0 7px rgba(255, 255, 255, .12), 0 3px 6px rgba(0, 0, 0, .3), inset -2px -2px 4px rgba(200, 120, 0, .35);
  transition: transform .6s cubic-bezier(.6, 0, .2, 1), background .5s; }
.dn-knob::before, .dn-knob::after { content: ""; position: absolute; border-radius: 50%; background: rgba(120, 130, 150, .45); opacity: 0; transition: opacity .4s; }
.dn-knob::before { width: 7px; height: 7px; top: 6px; left: 12px; }
.dn-knob::after { width: 5px; height: 5px; top: 14px; left: 6px; box-shadow: 9px 3px 0 -1px rgba(120, 130, 150, .45); }
html[data-theme=dark] .dn-track { background: linear-gradient(180deg, #1d2847 0%, #0c1226 100%); }
html[data-theme=dark] .dn-clouds { transform: translateY(26px); opacity: 0; }
html[data-theme=dark] .dn-stars { opacity: 1; transform: none; }
html[data-theme=dark] .dn-knob { transform: translateX(34px); background: radial-gradient(circle at 35% 30%, #f4f6fa 0%, #d5dbe6 60%, #b4bccb 100%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08), 0 0 0 7px rgba(255, 255, 255, .05), 0 3px 6px rgba(0, 0, 0, .45), inset -2px -2px 4px rgba(60, 70, 90, .35); }
html[data-theme=dark] .dn-knob::before, html[data-theme=dark] .dn-knob::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .dn-knob, .dn-clouds, .dn-stars, .dn-track { transition: none; } }

/* ---------- מצב כהה ---------- */
html[data-theme=dark] {
  color-scheme: dark;
  --bg: #0d1220; --panel: rgba(30, 38, 54, .62); --surface: rgba(34, 43, 60, .82); --line: rgba(255, 255, 255, .1);
  --ink: #e8edf4; --ink2: #b3bfcc; --ink3: #c7d1dc; --muted: #95a2b2; --soft: rgba(143, 224, 79, .12); --accent: #9be15d;
  --gl-bg: rgba(26, 34, 50, .52); --gl-bg-strong: rgba(28, 37, 56, .82); --gl-border: 1px solid rgba(255, 255, 255, .11);
  --gl-shadow: 0 22px 50px -28px rgba(0, 0, 0, .75), 0 2px 6px -2px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(255, 255, 255, .03);
  background: #0b1020;
}
html[data-theme=dark] body { color: var(--ink); }
html[data-theme=dark] body::before {
  background: radial-gradient(900px 620px at 88% -6%, rgba(34, 181, 115, .28), transparent 68%),
    radial-gradient(820px 600px at -4% 28%, rgba(61, 139, 253, .26), transparent 68%),
    radial-gradient(760px 560px at 104% 66%, rgba(124, 92, 240, .28), transparent 68%),
    radial-gradient(760px 540px at 22% 104%, rgba(255, 138, 61, .16), transparent 68%),
    radial-gradient(520px 420px at 55% 45%, rgba(255, 92, 147, .1), transparent 70%); }
html[data-theme=dark] small:where(:not(.sd-date small)), html[data-theme=dark] .hint, html[data-theme=dark] .note, html[data-theme=dark] .empty, html[data-theme=dark] .from { color: var(--ink2); }
html[data-theme=dark] h1, html[data-theme=dark] h2, html[data-theme=dark] h3, html[data-theme=dark] b, html[data-theme=dark] th, html[data-theme=dark] td, html[data-theme=dark] label { color: inherit; }
/* פריטי רשימה ושדות */
html[data-theme=dark] :is(.tour, .cand, .sd-person, .ctr-person, .sum-row, .person, .ride, .room, .sd-iv, .opt, .card .row, .ev-row, .inv-row) {
  background: rgba(255, 255, 255, .05) !important; border-color: rgba(255, 255, 255, .09) !important; color: var(--ink); }
html[data-theme=dark] :is(.tour.on, .sd-person.here, .ctr-person.inv-in) { background: rgba(143, 224, 79, .1) !important; }
html[data-theme=dark] :is(input[type=search], input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input:not([type]), select, textarea) {
  background-color: rgba(255, 255, 255, .07) !important; border-color: rgba(255, 255, 255, .13) !important; color: var(--ink); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }
html[data-theme=dark] :is(input, select, textarea):focus { background-color: rgba(255, 255, 255, .12) !important; }
html[data-theme=dark] ::placeholder { color: #8391a2; }
html[data-theme=dark] option { background: #1b2336; color: var(--ink); }
/* כפתורים משניים */
/* :where = משקל נמוך, כדי שכפתורים צבעוניים (מתגים, IN/OUT, סינון פעיל) ישמרו את הצבע שלהם */
html[data-theme=dark] :where(button, .act.pr, .act.cx, button.ghost, a.act) { background-color: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .13); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
html[data-theme=dark] :where(button:not(.on):not(.in):not(.out):not(.yes):not(.no):hover) { background-color: rgba(255, 255, 255, .13); }
html[data-theme=dark] .act.cx { color: #ff8e8e; }
html[data-theme=dark] :is(.seg, .sd-tabs, .sd-nav) { background: rgba(255, 255, 255, .05) !important; }
html[data-theme=dark] :is(.sd-tabs button, .sd-navbtn, .seg button, .tabs button) { color: var(--ink3); }
html[data-theme=dark] .sd-fbar { background: rgba(255, 255, 255, .08); }
html[data-theme=dark] .sd-fbar i.st-placed { background: #9be15d; }
html[data-theme=dark] .sd-bar:last-child i { background: #9be15d; }
/* תגיות וגלולות */
html[data-theme=dark] :is(.pill, .tag, .ctr-warn, .sum-chip, .sd-score.none, .req.plain) { background: rgba(255, 255, 255, .08); color: var(--ink3); }
html[data-theme=dark] .req { background: rgba(240, 181, 44, .14); color: #f3cd7a; }
html[data-theme=dark] .req.match { background: rgba(143, 224, 79, .14); color: #b9ef8a; }
html[data-theme=dark] .sum-chip.in { background: rgba(240, 181, 44, .16); color: #f3cd7a; }
html[data-theme=dark] .sum-chip.accepted { background: #2f6a33; color: #fff; }
html[data-theme=dark] :is(.sum-chip.out, .sum-chip.rejected) { background: rgba(240, 82, 82, .14); color: #ff9b9b; }
html[data-theme=dark] .sum-row.o-nowhere { background: rgba(240, 82, 82, .1) !important; border-color: rgba(240, 82, 82, .55) !important; }
html[data-theme=dark] .cand-upcoming { background: rgba(240, 181, 44, .14); color: #f3cd7a; }
html[data-theme=dark] .cand-upcoming .link { color: #f3cd7a; }
html[data-theme=dark] .cand-answers, html[data-theme=dark] .room-reqbox, html[data-theme=dark] .ticket { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); }
html[data-theme=dark] .cand-timeline li { background: rgba(255, 255, 255, .05); }
html[data-theme=dark] .cand-timeline li.ev-note { background: rgba(240, 181, 44, .1); }
html[data-theme=dark] .link { color: #9be15d; }
html[data-theme=dark] .toast { background: rgba(240, 244, 250, .9) !important; color: #0f1a12; }
html[data-theme=dark] .demo { background: rgba(143, 224, 79, .14); color: #b9ef8a; }
html[data-theme=dark] .login-logo img { background: rgba(255, 255, 255, .92); border-radius: 12px; padding: 4px 8px; }
html[data-theme=dark] table { color: var(--ink); }
html[data-theme=dark] tr { border-color: var(--line); }
html[data-theme=dark] .overlay { background: rgba(0, 0, 0, .45) !important; }
html[data-theme=dark] .cand-status.st-new { background-color: rgba(61, 139, 253, .2); color: #a9cbff; }
html[data-theme=dark] .cand-status.st-contacted { background-color: rgba(124, 92, 240, .22); color: #c9bbff; }
html[data-theme=dark] .cand-status.st-interview { background-color: rgba(240, 181, 44, .18); color: #f3cd7a; }
html[data-theme=dark] .cand-status.st-interviewed { background-color: rgba(255, 138, 61, .18); color: #ffbd8f; }
html[data-theme=dark] .cand-status.st-accepted { background-color: rgba(143, 224, 79, .16); color: #b9ef8a; }
html[data-theme=dark] :is(.cand-status.st-rejected, .cand-status.st-withdrew) { background-color: rgba(255, 255, 255, .08); color: var(--ink2); }
@media (prefers-reduced-transparency: reduce) {
  html[data-theme=dark] :is(.top, .stats div, .sd-kpi, .sd-card, .sd-nav, .modal, .card, #roster, #log, #staff) { background: #1b2336 !important; }
}
html[data-theme=dark] .act.wa { background: linear-gradient(180deg, #c9f78c 0%, #8fe04f 100%); color: #0f1a12; border-color: rgba(255, 255, 255, .25); }
html[data-theme=dark] :is(button.primary, .act.mv, .act.xl, .act.lo, .tabs button.on, .sd-navbtn.on, .sd-tabs button.on, .seg button.on) { color: #fff; }
html[data-theme=dark] .qty { background: rgba(143, 224, 79, .12) !important; color: #b9ef8a !important; }
html[data-theme=dark] .qty small { color: #b9ef8a; opacity: .8; }
/* כפתורים שקופים במהותם (שורות לחיצות) נשארים שקופים */
html[data-theme=dark] :is(.sd-frow, .sd-pname, .cand-main, .ctr-open, .sd-x, .link) { background: none !important; border-color: transparent; box-shadow: none; }
html[data-theme=dark] .sd-frow.on { background: rgba(143, 224, 79, .1) !important; }
html[data-theme=dark] .ev-n.on { background: linear-gradient(180deg, #2f6a33, #1c4a1f) !important; color: #fff; }
/* שורות סיכום וכרטיסים בלשוניות החדרים וההסעות */
html[data-theme=dark] :is(.rooms-bar, .rooms-setup, .ride-tile, .ride, .rides .ride, .room-occ .occ, .rooms-summary, .waiting-title) {
  background: rgba(255, 255, 255, .06) !important; color: var(--ink) !important; border-color: rgba(255, 255, 255, .1) !important; }
html[data-theme=dark] .rooms-summary b, html[data-theme=dark] .rooms-bar p, html[data-theme=dark] .ride-tile b { color: var(--ink) !important; }
html[data-theme=dark] .rooms-bar .rooms-summary, html[data-theme=dark] .rooms-summary { color: var(--ink2); }
html[data-theme=dark] .ride-tile span, html[data-theme=dark] .ride td { color: var(--ink) !important; }
html[data-theme=dark] .ride th, html[data-theme=dark] .ride-count { color: var(--ink2); }

html[data-theme=dark] .top-actions select#festival { background-color: rgba(255, 255, 255, .09) !important; border: 1px solid rgba(255, 255, 255, .2) !important; color: var(--ink) !important; }
