/* ==========================================================================
   בדרך ישרה — עיצוב כללי RTL
   כיוון: "ספר פתוח" (נייר שנהב, דיו כחול, כותרות סריף, קווים במקום צללים)
   + "שלט כתום": צבע הפעולה הראשית במסך ומד ההתקדמות המקווקו.
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* צבעי המותג (מהלוגו) */
  --ink-blue: #1D3B5C;      /* דיו כחול - כותרות, כפתור ראשי */
  --ink-blue-deep: #152C45;
  --logo-blue: #21547F;     /* הכחול המקורי של הלוגו */
  --signal: #F4AA41;        /* כתום איתות - CTA אחד למסך */
  --on-signal: #1B1F24;     /* טקסט על כתום */
  --amber-rule: #D98E2B;    /* קו קישוט מתחת לכותרות */
  --amber-text: #8F5A12;    /* טקסט בגוון ענבר */
  --amber-tint: #FBF1DF;

  /* שמות ישנים - נשמרו לתאימות עם הקוד */
  --primary: var(--ink-blue);
  --primary-dark: var(--ink-blue-deep);
  --primary-soft: #EDF1F5;
  --accent: var(--amber-rule);
  --accent-soft: var(--amber-tint);
  --gold: var(--amber-rule);
  --gold-dark: var(--amber-text);

  /* משטחים */
  --bg: #F6F1E7;            /* נייר */
  --pearl: #F6F1E7;
  --card: #FFFDF8;
  --surface-2: #FBF8F1;

  /* טקסט וקווים */
  --text: #2A2620;
  --muted: #5E574B;
  --border: #E3DACB;
  --border-strong: #8F846F;

  /* מצבים */
  --success: #2F6B3F;
  --success-tint: #EAF2EA;
  --warning: #8F5A12;
  --danger: #A8323E;
  --danger-tint: #F9ECEC;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-cta: 12px;
  --radius-pill: 999px;

  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(29, 59, 92, .16);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  --font-head: 'Frank Ruhl Libre', 'David Libre', Georgia, serif;
  --font-body: 'Assistant', 'Heebo', 'Segoe UI', Arial, sans-serif;
}

html { background: var(--bg); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  display: flex; flex-direction: column;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; width: 100%; }
a { color: var(--logo-blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber-rule); outline-offset: 2px; }

/* ---------- כותרת עליונה ---------- */
.topbar {
  background: var(--card);
  color: var(--text);
  padding: 12px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.topbar::after {           /* קו ענבר דק בתחתית הכותרת */
  content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 2px;
  background: linear-gradient(to left, var(--ink-blue) 0 72px, transparent 72px);
}
.topbar h1 { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; color: var(--ink-blue); }
.topbar .subtitle { font-size: .85rem; color: var(--muted); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; color: var(--ink-blue); line-height: 1.1; }
.brand-sub { font-size: .82rem; color: var(--muted); font-weight: 400; }

.topbar nav { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--text); text-decoration: none; padding: 6px 0;
  font-size: .95rem; font-weight: 600;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.topbar nav a .ic { color: var(--muted); }
.topbar nav a:hover, .topbar nav a.active { color: var(--ink-blue); border-bottom-color: var(--amber-rule); }

.mode-badge {
  font-size: .78rem; padding: 3px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-2);
}

/* ---------- מבנה ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 36px 20px 64px; }
.container.narrow { max-width: 680px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 30px; margin-bottom: 24px;
}
.card h2 {
  font-family: var(--font-head);
  color: var(--ink-blue); font-size: 1.45rem; font-weight: 700; line-height: 1.3;
  margin-bottom: 14px;
}
.card h2::after {
  content: ''; display: block; height: 2px; flex-basis: 100%; margin-top: 8px;
  background: linear-gradient(to left, var(--amber-rule) 0 44px, transparent 44px);
}
.card h3 { color: var(--ink-blue); font-size: 1.05rem; font-weight: 700; margin: 18px 0 8px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---------- טפסים ---------- */
label { display: block; font-weight: 600; font-size: .86rem; margin: 14px 0 4px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9A9180; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink-blue);
  box-shadow: inset 0 -2px 0 var(--amber-rule);
}
input.invalid { border-color: var(--danger); background: var(--danger-tint); }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; min-height: 1em; font-weight: 600; }
.hint { color: var(--muted); font-size: .86rem; margin-top: 3px; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-block; padding: 11px 28px; border: 1px solid var(--ink-blue);
  border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
  background: var(--ink-blue); color: #FFFDF8;
  transition: background .15s, border-color .15s, transform .08s;
  text-decoration: none; text-align: center; letter-spacing: .01em;
}
.btn:hover { background: var(--ink-blue-deep); border-color: var(--ink-blue-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--border); border-color: var(--border); color: var(--muted); cursor: not-allowed; }

/* הפעולה הראשית במסך - כתום הלוגו */
.btn.cta {
  background: var(--signal); border-color: var(--signal); color: var(--on-signal);
  border-radius: var(--radius-cta); font-weight: 800;
}
.btn.cta:hover { background: #EE9E2E; border-color: #EE9E2E; }
.btn.cta:disabled { background: var(--border); border-color: var(--border); color: var(--muted); }

.btn.secondary { background: transparent; color: var(--ink-blue); border: 1px solid var(--ink-blue); }
.btn.secondary:hover { background: var(--primary-soft); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.big { font-size: 1.2rem; padding: 16px 40px; }
.btn.block { display: block; width: 100%; }

/* ---------- טבלאות ---------- */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink-blue); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
  background: transparent; color: var(--muted); padding: 10px 12px; text-align: right;
  white-space: nowrap; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
  border-bottom: 1px solid var(--ink-blue);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td, table tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: transparent; }
tbody tr:hover td { background: var(--surface-2); }

/* ---------- תגיות סטטוס: מסגרת דקה וטקסט, בלי מילוי ---------- */
.tag {
  display: inline-block; padding: 1px 10px; border-radius: var(--radius-pill);
  font-size: .76rem; font-weight: 700; white-space: nowrap; line-height: 1.6;
  border: 1px solid currentColor; background: transparent;
}
.tag.green { color: var(--success); }
.tag.orange { color: var(--amber-text); background: var(--amber-tint); }
.tag.red { color: var(--danger); }
.tag.blue { color: var(--ink-blue); }
.tag.gray { color: var(--muted); }
.tag.yellow { color: var(--amber-text); }
.tag.teal { color: var(--logo-blue); }

/* ---------- סטטיסטיקות ---------- */
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; text-align: right;
}
.stat .num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; color: var(--ink-blue); line-height: 1.15; }
.stat .lbl { font-size: .86rem; color: var(--muted); font-weight: 600; }

/* ---------- אשף שלבים: "הדרך" ---------- */
.steps {
  display: flex; align-items: flex-start; margin-bottom: 28px; counter-reset: none;
}
.steps .step {
  flex: 1; position: relative; text-align: center; font-size: .8rem; font-weight: 600;
  color: var(--muted); padding-top: 34px; min-width: 0;
  background: none; border: 0;
}
.steps .step::before {             /* העיגול עם המספר */
  content: attr(data-step);
  position: absolute; top: 0; right: 50%; transform: translateX(50%);
  width: 26px; height: 26px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: var(--card); border: 1px solid var(--border-strong); color: var(--muted);
}
.steps .step::after {              /* קטע הדרך אל השלב הבא */
  content: ''; position: absolute; top: 12px; right: 50%; width: 100%;
  border-top: 1px solid var(--border-strong); transform: translateX(-13px);
}
.steps .step:last-child::after { display: none; }
.steps .step.done::before, .steps .step.active::before {
  background: var(--ink-blue); border-color: var(--ink-blue); color: #FFFDF8;
}
.steps .step.done::after { border-top: 3px dashed var(--signal); top: 11px; }
.steps .step.active { color: var(--ink-blue); }
.steps .step.done { color: var(--text); }

.wizard-panel { display: none; }
.wizard-panel.visible { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.done-icon { color: var(--success); margin: 4px 0 8px; }

/* ---------- בחירת כרטיסים ---------- */
.choice-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  cursor: pointer; background: var(--card); transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--ink-blue); }
.choice.selected { border-color: var(--ink-blue); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--amber-rule); }
.choice .title { font-weight: 700; color: var(--ink-blue); }
.choice .sub { font-size: .84rem; color: var(--muted); margin-top: 2px; }

/* ---------- תקנון ---------- */
.terms-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 0; background: transparent;
}
.terms-item:hover { background: var(--surface-2); }
.terms-item input[type=checkbox] {
  width: 20px; height: 20px; margin-top: 3px; flex-shrink: 0;
  accent-color: var(--ink-blue); cursor: pointer;
}
.terms-item .txt { font-size: .92rem; }

#signature-canvas {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  width: 100%; touch-action: none; cursor: crosshair;
}

/* ---------- קיוסק ---------- */
body.kiosk {
  background: var(--bg);
  align-items: center; justify-content: center; padding: 4vh 16px 0;
}
body.kiosk > .kiosk-screen { flex: 0 0 auto; }
.kiosk-screen {
  max-width: 580px; width: 100%; margin: 0 auto; background: var(--card);
  border: 1px solid var(--border); border-top: 3px solid var(--ink-blue);
  border-radius: var(--radius); padding: 42px 38px; text-align: center;
}
.kiosk-screen h2 { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--ink-blue); margin-bottom: 10px; }
.kiosk-screen .icon { margin-bottom: 12px; }
.kiosk-screen .btn + .btn { margin-top: 10px; }
.kiosk-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 312px; margin: 20px auto; direction: ltr; }
.kiosk-keypad button {
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; padding: 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: #fff;
  cursor: pointer; color: var(--ink-blue); transition: background .12s;
}
.kiosk-keypad button:hover { background: var(--primary-soft); }
.kiosk-keypad button:active { background: var(--ink-blue); color: #fff; }
.kiosk-display {
  font-family: var(--font-head); font-size: 2.1rem; letter-spacing: 8px; font-weight: 700;
  padding: 10px; background: transparent; color: var(--ink-blue);
  border: 0; border-bottom: 2px solid var(--ink-blue); border-radius: 0;
  margin: 0 auto 8px; max-width: 320px; min-height: 64px; direction: ltr;
}

/* אנימציית פתיחת תא */
.locker-door { width: 180px; height: 180px; margin: 20px auto; perspective: 600px; }
.locker-door .door {
  width: 100%; height: 100%; background: var(--ink-blue);
  border-radius: var(--radius-sm); border: 4px solid var(--ink-blue-deep); display: flex;
  align-items: center; justify-content: center; color: #FFFDF8; font-family: var(--font-head);
  font-size: 1.6rem; font-weight: 700; transform-origin: right center; transition: transform 1.2s ease-in-out;
}
.locker-door.open .door { transform: rotateY(80deg); }
.locker-door .inside {
  position: relative; margin-top: -180px; width: 180px; height: 180px; z-index: -1;
  background: var(--amber-tint); border-radius: var(--radius-sm); display: flex;
  align-items: center; justify-content: center; color: var(--ink-blue);
}

/* ---------- הודעות ---------- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; font-size: .93rem;
  border: 1px solid; border-inline-start-width: 1px;
}
.alert.info { background: var(--primary-soft); border-color: #C9D5E2; color: var(--ink-blue); }
.alert.success { background: var(--success-tint); border-color: #C3D9C6; color: var(--success); }
.alert.warning { background: var(--amber-tint); border-color: #EBCF9F; color: var(--amber-text); }
.alert.danger, .alert.error { background: var(--danger-tint); border-color: #E7C2C5; color: var(--danger); }

.toast {
  position: fixed; bottom: -80px; right: 50%; transform: translateX(50%);
  background: var(--ink-blue); color: #FFFDF8; padding: 12px 28px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; transition: bottom .3s cubic-bezier(.16,1,.3,1);
  z-index: 999; box-shadow: var(--shadow-lg);
}
.toast.show { bottom: 24px; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ---------- דירוג כוכבים ---------- */
.stars { display: flex; gap: 8px; font-size: 2.2rem; cursor: pointer; direction: ltr; justify-content: center; }
.stars span { color: var(--border); transition: color .1s; }
.stars span.on { color: var(--signal); }

/* ---------- דף הבית ---------- */
.home-intro { margin: 8px 0 28px; }
.home-intro h1 { font-family: var(--font-head); font-size: 2.3rem; color: var(--ink-blue); line-height: 1.2; }
.home-intro p { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin-top: 6px; }
.home-cards { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 8px; border-top: 1px solid var(--ink-blue); border-bottom: 1px solid var(--ink-blue); }
.home-card {
  padding: 28px 26px 26px; text-align: right; text-decoration: none; color: var(--text);
  border-inline-start: 1px solid var(--border); background: transparent; transition: background .15s;
}
.home-card:first-child { border-inline-start: 0; }
.home-card:hover { background: var(--card); }
.home-card .icon { margin-bottom: 14px; }
.home-card h3 { font-family: var(--font-head); color: var(--ink-blue); font-size: 1.4rem; margin-bottom: 4px; }
.home-card p { font-size: .92rem; color: var(--muted); }
.home-card::after { content: 'כניסה ←'; display: inline-block; margin-top: 14px; font-weight: 700; font-size: .9rem; color: var(--ink-blue); border-bottom: 2px solid var(--amber-rule); }

@media (max-width: 600px) {
  .container { padding: 18px 14px 48px; }
  .card { padding: 18px; }
  .kiosk-screen { padding: 26px 18px; }
  .topbar { padding: 10px 14px; }
  .steps .step { font-size: 0; }
  .steps .step::before { font-size: .78rem; }
  .home-card { border-inline-start: 0; border-bottom: 1px solid var(--border); }
}

/* ==========================================================================
   לוח שנה דו-לוחי (לועזי + עברי)
   ========================================================================== */
.calendar { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: #fff; margin-bottom: 12px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { text-align: center; }
.cal-greg { font-family: var(--font-head); font-weight: 700; color: var(--ink-blue); font-size: 1.1rem; }
.cal-heb { font-size: .8rem; color: var(--muted); }
.cal-nav { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 34px; height: 34px; font-size: 1.2rem; cursor: pointer; color: var(--ink-blue); }
.cal-nav:hover { background: var(--surface-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 50px; border-radius: var(--radius-sm); }
.cal-cell.empty { background: transparent; }
.cal-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid var(--border); background: #fff; padding: 2px; overflow: hidden; transition: border-color .12s;
}
.cal-day:hover:not(.blocked):not(.past) { border-color: var(--ink-blue); }
.cal-greg-num { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.1; z-index: 1; }
.cal-heb-num { font-size: .68rem; color: var(--muted); line-height: 1.1; z-index: 1; }
.cal-tag { font-size: .55rem; color: var(--muted); line-height: 1.1; margin-top: 1px; z-index: 1; }
.cal-day.blocked { background: #EFE9DD; border-color: #E3DACB; cursor: not-allowed; }
.cal-day.blocked .cal-greg-num, .cal-day.blocked .cal-heb-num { color: #A39A88; }
.cal-day.blocked .cal-tag { color: #8A8170; font-weight: 600; }
.cal-day.partial.closes-early { background: linear-gradient(to bottom, #fff 62%, #EFE9DD 62%); }
.cal-day.partial.opens-later { background: linear-gradient(to bottom, #EFE9DD 62%, #fff 62%); }
.cal-day.partial .cal-tag { color: var(--amber-text); font-weight: 600; }
.cal-day.past { opacity: .38; cursor: not-allowed; }
.cal-day.today { border-color: var(--amber-rule); border-width: 2px; }
.cal-day.in-range { background: var(--primary-soft); border-color: #C9D5E2; }
.cal-day.selected { background: var(--ink-blue) !important; border-color: var(--ink-blue); }
.cal-day.selected .cal-greg-num, .cal-day.selected .cal-heb-num, .cal-day.selected .cal-tag { color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: .74rem; color: var(--muted); }
.cal-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-left: 4px; vertical-align: -1px; border: 1px solid var(--border-strong); }
.cal-legend .sw.free { background: #fff; }
.cal-legend .sw.partial { background: linear-gradient(to bottom, #fff 50%, #EFE9DD 50%); }
.cal-legend .sw.blocked { background: #EFE9DD; }
.cal-hint { font-size: .8rem; color: var(--amber-text); margin-top: 8px; min-height: 1em; }

/* ==========================================================================
   בוחר שעות - סרגל 24 שעות
   ========================================================================== */
.hourbar { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 6px; background: #fff; margin-bottom: 10px; }
.hb-label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: .86rem; }
.hb-label b { color: var(--ink-blue); }
.hb-value { margin-right: auto; color: var(--ink-blue); font-weight: 700; font-size: .95rem; }
.hb-track { display: flex; gap: 1px; border: 1px solid var(--border); direction: rtl; border-radius: var(--radius-sm); overflow: hidden; background: var(--border); }
.hb-cell { flex: 1; height: 34px; background: #fff; cursor: pointer; transition: background .1s; }
.hb-cell:hover:not(.off) { background: var(--primary-soft); }
.hb-cell.off { background: repeating-linear-gradient(45deg, #EFE9DD, #EFE9DD 3px, #F6F1E7 3px, #F6F1E7 6px); cursor: not-allowed; }
.hb-cell.sel { background: #5B7898; }
.hb-cell.edge.from { background: var(--ink-blue); }
.hb-cell.edge.to { background: var(--ink-blue); }
.hb-ticks { position: relative; height: 16px; direction: rtl; font-size: .66rem; color: var(--muted); margin-top: 2px; }
.hb-ticks span { position: absolute; transform: translateX(50%); }

/* ==========================================================================
   חלוניות
   ========================================================================== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(21, 44, 69, .5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-box { background: var(--card); border-radius: var(--radius-cta); width: 100%; max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); border-top: 3px solid var(--ink-blue); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--card); }
.modal-head h3 { margin: 0; font-family: var(--font-head); font-size: 1.15rem; color: var(--ink-blue); display: flex; align-items: center; gap: 8px; }
.modal-head .sub { font-size: .8rem; color: var(--muted); }
.modal-close { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 32px; height: 32px; font-size: 1rem; cursor: pointer; color: var(--muted); }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { flex: 1; min-height: 0; overflow: auto; }
.modal-body iframe { width: 100%; height: 60vh; border: 0; display: block; }
.modal-foot { padding: 10px 18px; border-top: 1px solid var(--border); text-align: left; }

.map-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; color: var(--ink-blue);
  text-decoration: none; border: 1px solid var(--border-strong); background: transparent;
  padding: 4px 12px; border-radius: var(--radius-sm); margin-top: 6px; cursor: pointer; font-family: inherit;
}
.map-link:hover { background: var(--primary-soft); }

.battery-input { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.battery-input input[type=range] { flex: 1; accent-color: var(--ink-blue); height: 28px; border: 0; }
.battery-input output { min-width: 62px; text-align: center; font-weight: 700; font-size: 1.1rem; padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid currentColor; color: var(--muted); }
.battery-input output.full { color: var(--success); background: var(--success-tint); }
.battery-input output.mid { color: var(--amber-text); background: var(--amber-tint); }
.battery-input output.low { color: var(--danger); background: var(--danger-tint); }

/* ==========================================================================
   ניווט בין לוחות הניהול
   ========================================================================== */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 26px; padding: 0; background: transparent; border: 0; border-bottom: 1px solid var(--border); }
.tab {
  background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: 0; padding: 10px 0; font-size: .92rem; font-weight: 600; font-family: inherit;
  color: var(--muted); cursor: pointer; transition: color .14s, border-color .14s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--ink-blue); border-bottom-color: var(--amber-rule); background: transparent; box-shadow: none; }
.tab-panel[hidden] { display: none; }

/* ==========================================================================
   באנר מכשיר ברשימה
   ========================================================================== */
.device-banner {
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; background: var(--card);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.device-banner:hover { border-color: var(--ink-blue); }
.db-main { min-width: 150px; }
.db-main b { font-family: var(--font-head); color: var(--ink-blue); font-size: 1.05rem; }
.db-main .hint { display: block; font-size: .74rem; }
.db-where { flex: 1; font-size: .86rem; color: var(--muted); }
.db-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.db-arrow { font-size: 1.4rem; color: var(--border-strong); }

#dev-modal-title h3, #user-modal-title h3 { margin: 0 0 3px; font-family: var(--font-head); font-size: 1.2rem; color: var(--ink-blue); }
#dev-modal-title .sub, #user-modal-title .sub { font-size: .8rem; color: var(--muted); }
#dev-modal-body h4, #user-modal-body h4 {
  margin: 20px 0 8px; font-size: .92rem; color: var(--ink-blue);
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
#dev-modal-body h4:first-of-type, #user-modal-body h4:first-of-type { margin-top: 4px; }
#dev-modal-body table, #user-modal-body table { font-size: .86rem; }

.mini-select { font-family: inherit; font-size: .8rem; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; margin-left: 6px; width: auto; display: inline-block; }

/* יומן המכשיר */
.cal-day.dev-day { cursor: default; min-height: 52px; }
.cal-day.dev-day.has-booking { cursor: pointer; }
.cal-day.dev-day.has-booking:hover { border-color: var(--ink-blue); background: var(--primary-soft); }
.bk-chip { display: inline-block; width: 16px; height: 4px; border-radius: 1px; margin: 1px 1px 0; background: #A39A88; }
.bk-chip.bk-active { background: var(--success); }
.bk-chip.bk-approved { background: var(--ink-blue); }
.bk-chip.bk-pending { background: var(--signal); }
.bk-chip.bk-done { background: var(--border); }
.cal-legend .sw.bk-active { background: var(--success); border-color: var(--success); }
.cal-legend .sw.bk-approved { background: var(--ink-blue); border-color: var(--ink-blue); }
.cal-legend .sw.bk-done { background: var(--border); }

.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter-row .chip { background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: 3px 12px; font-size: .8rem; font-family: inherit; color: var(--muted); cursor: pointer; }
.filter-row .chip.active { background: var(--ink-blue); border-color: var(--ink-blue); color: #fff; }

/* בורר סטטוס */
.status-select {
  font-family: inherit; font-size: .8rem; font-weight: 700; padding: 3px 26px 3px 10px;
  border-radius: var(--radius-pill); border: 1px solid currentColor; cursor: pointer; width: auto;
  display: inline-block; margin: 0; appearance: none; background-color: transparent;
  background-repeat: no-repeat; background-position: left 8px center; background-size: 9px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235E574B' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.status-select option { font-weight: 400; background: #fff; color: var(--text); }
.status-select.green { color: var(--success); }
.status-select.orange { color: var(--amber-text); background-color: var(--amber-tint); }
.status-select.red { color: var(--danger); }
.status-select.blue { color: var(--ink-blue); }
.status-select.gray { color: var(--muted); }
.status-select.yellow { color: var(--amber-text); }
.status-select.teal { color: var(--logo-blue); }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--primary-soft); }

.setting-input { width: 110px; display: inline-block; margin: 0; font-weight: 700; text-align: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 5px; }
td.nowrap, th.nowrap { white-space: nowrap; }

.loc-checks { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; background: #fff; }
.loc-check { display: flex; align-items: center; gap: 4px; font-size: .84rem; margin: 0; color: var(--text); }
.loc-check input { width: auto; margin: 0; }

.admin-locker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.admin-locker-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 8px; cursor: pointer; font-family: inherit; font-size: .9rem;
}
.admin-locker-btn:hover { border-color: var(--ink-blue); }
.admin-locker-btn b { font-family: var(--font-head); font-size: 1.15rem; color: var(--ink-blue); }
.admin-locker-btn .hint { font-size: .7rem; }

.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.acc-row select { width: auto; margin: 0; padding: 4px 8px; font-size: .84rem; }

.btn-staff {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 22px;
  background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0;
  padding: 14px 10px 0; font-family: inherit; font-size: .88rem; color: var(--muted); cursor: pointer;
}
.btn-staff:hover { color: var(--ink-blue); }

.kiosk-logo { max-height: 120px; width: auto; margin: 0 auto 18px; display: block; }

/* אייקונים בקו מתאר */
.ic { display: inline-block; flex: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; }
.topbar nav a { display: inline-flex; align-items: center; gap: 6px; }
.card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0 9px; }
.card h3 { display: flex; align-items: center; gap: 9px; }
.card h2 .ic { color: var(--amber-rule); }
.card h3 .ic { color: var(--ink-blue); }
.home-card [data-ic-lg] .ic, .kiosk-screen .icon .ic { color: var(--ink-blue); }
.btn .ic { vertical-align: -.15em; }
.btn.cta .ic { color: var(--on-signal); }

/* ==========================================================================
   שורת קרדיט בתחתית
   ========================================================================== */
.site-credit {
  flex-shrink: 0; width: 100%; margin-top: 40px;
  border-top: 1px solid var(--border); background: var(--bg);
}
.credit-inner {
  max-width: 1120px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; justify-content: center;
  font-size: .84rem; color: var(--muted);
}
.credit-logo { height: 64px; width: auto; display: block; }
.credit-line b { color: var(--text); font-weight: 700; }
.credit-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.credit-contact a { color: var(--muted); text-decoration: none; }
.credit-contact a:hover { color: var(--ink-blue); text-decoration: underline; }
.credit-contact .sep { color: var(--border-strong); }
body.kiosk .site-credit { margin-top: 4vh; background: rgba(255,253,248,.88); }
@media (max-width: 600px) { .credit-inner { flex-direction: column; text-align: center; gap: 6px; } .credit-contact { justify-content: center; } }


/* ==========================================================================
   חיות וצבע - עדכון: פינות מעוגלות, גוונים, אנימציות רקע
   ========================================================================== */
:root {
  --sky-tint: #E6EEF6;      /* תכלת רך מהכחול של הלוגו */
  --sun-tint: #FDEBCB;      /* כתום רך */
  --shadow-soft: 0 1px 2px rgba(29,59,92,.05), 0 8px 24px rgba(29,59,92,.07);
}

/* כרטיסים: עיגול, צל רך וקו צבע עליון */
.card, .kiosk-screen, .stat, .calendar, .hourbar, .device-banner { box-shadow: var(--shadow-soft); }
.card { position: relative; overflow: hidden; }
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(to left, var(--ink-blue) 0 55%, var(--signal) 55% 100%);
}
.kiosk-screen { border-top: 0; position: relative; overflow: hidden; }
.kiosk-screen::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: linear-gradient(to left, var(--ink-blue) 0 60%, var(--signal) 60% 100%);
}
.modal-box { border-top: 0; }

/* כפתורים */
.btn { box-shadow: 0 2px 6px rgba(29,59,92,.18); transition: background .15s, transform .12s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(29,59,92,.22); }
.btn.cta { box-shadow: 0 4px 14px rgba(244,170,65,.45); }
.btn.cta:hover { box-shadow: 0 8px 22px rgba(244,170,65,.55); }
.btn.secondary { box-shadow: none; background: #fff; }
.btn.big { border-radius: 14px; }

/* שדות */
input, select, textarea { border-color: #CFC5B3; background: #fff; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(244,170,65,.22); border-color: var(--amber-rule); }

/* כותרת עליונה - רצועה צבעונית דקה */
.topbar { box-shadow: 0 2px 12px rgba(29,59,92,.06); }
.topbar::after { height: 3px; background: linear-gradient(to left, var(--ink-blue) 0 70%, var(--signal) 70% 100%); }

/* דף הבית: כרטיסים צבעוניים */
.home-cards { gap: 20px; border: 0; }
.home-card {
  background: var(--card); border: 1px solid var(--border) !important; border-radius: 20px;
  box-shadow: var(--shadow-soft); transition: transform .2s, box-shadow .2s;
}
.home-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(29,59,92,.14); background: var(--card); }
.home-card .icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--sky-tint);
}
.home-card .icon .ic { width: 2rem !important; height: 2rem !important; }
.home-card:nth-child(2) .icon { background: var(--sun-tint); }
.home-card:nth-child(2) .icon .ic { color: var(--amber-text) !important; }
.home-card:nth-child(3) .icon { background: #E3EFE6; }
.home-card:nth-child(3) .icon .ic { color: var(--success) !important; }

/* סטטיסטיקות עם פס צבע */
.stat { position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--sky-tint); }
.stat:nth-child(2)::after { background: var(--signal); }
.stat:nth-child(3)::after { background: #A9CDB2; }
.stat:nth-child(4)::after { background: var(--ink-blue); }

/* בחירת תפקיד ובחירות */
.choice { box-shadow: var(--shadow-soft); }
.choice.selected { background: var(--sky-tint); box-shadow: 0 0 0 3px rgba(244,170,65,.35); }

/* טבלאות בכרטיס */
.table-wrap { border-radius: 12px; border: 1px solid var(--border); border-top: 3px solid var(--ink-blue); }

/* תגיות - מילוי עדין */
.tag.green { background: #E8F1EA; } .tag.red { background: var(--danger-tint); }
.tag.blue { background: var(--sky-tint); } .tag.gray { background: #F1ECE2; }

/* הודעות */
.alert { border-radius: 12px; }
.alert.info { background: var(--sky-tint); }

/* לוח שנה */
.cal-day { border-radius: 10px; }
.cal-day.selected { box-shadow: 0 4px 10px rgba(29,59,92,.25); }
.hb-track { border-radius: 10px; }
.hb-cell.sel { background: #7FA0C4; }

/* קיוסק */
.kiosk-keypad button { border-radius: 16px; box-shadow: 0 2px 0 #E3DACB; }
.kiosk-keypad button:active { transform: translateY(2px); box-shadow: none; }
.kiosk-screen .icon {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sky-tint);
  animation: bob 4s ease-in-out infinite;
}
.locker-door .door { border-radius: 14px; }
.locker-door .inside { border-radius: 14px; }
.toast { border-radius: 999px; }

/* כניסה רכה של מסכים */
.kiosk-screen, .wizard-panel.visible .card { animation: rise .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (prefers-reduced-motion: reduce) {
  .scenery *, .kiosk-screen, .kiosk-screen .icon, .wizard-panel.visible .card { animation: none !important; }
}


/* ==========================================================================
   עוד צבע: רקע עם גוון שמיים, כפתורים בגרדיאנט עדין
   ========================================================================== */
body { background: linear-gradient(180deg, #E8F0F8 0, #F3EEE4 520px, #F6F1E7 100%); background-attachment: fixed; }
.btn { background: linear-gradient(160deg, #2A5E8C 0%, #1D3B5C 100%); border-color: #1D3B5C; }
.btn:hover { background: linear-gradient(160deg, #306A9C 0%, #21456B 100%); }
.btn.cta { background: linear-gradient(160deg, #F8BE62 0%, #F2A033 100%); border-color: #F2A033; }
.btn.cta:hover { background: linear-gradient(160deg, #FAC772 0%, #F4A53C 100%); }
.btn.secondary { background: #EEF4FA; color: var(--logo-blue); border-color: #B9CDE2; }
.btn.secondary:hover { background: #E1ECF6; border-color: var(--logo-blue); }
.btn.success { background: linear-gradient(160deg, #3C8250 0%, #2F6B3F 100%); }
.btn.danger { background: linear-gradient(160deg, #BC4350 0%, #A8323E 100%); }
.btn:disabled { background: var(--border); }
.card h2 .ic { color: var(--sun, #F4AA41); }
.steps .step.done::before, .steps .step.active::before { background: linear-gradient(160deg, #2A5E8C, #1D3B5C); }
.steps .step.active::before { box-shadow: 0 0 0 5px rgba(244,170,65,.28); }
.tab.active { color: var(--logo-blue); }
.mode-badge { background: #EEF4FA; border-color: #B9CDE2; color: var(--logo-blue); }
.kiosk-keypad button { background: #fff; }
.kiosk-keypad button:hover { background: #EEF4FA; }
.site-credit { background: rgba(255,253,248,.7); backdrop-filter: blur(4px); }

body.kiosk .site-credit { background: rgba(255,253,248,.9); }
