/* ============================================================
   נגב — מערכת לו״ז מגדלי · עיצוב
   Mobile-first · RTL · הדפסה
   ============================================================ */
:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --ink: #16233b;
  --ink-2: #5a6b85;
  --ink-3: #93a1b8;
  --line: #dfe6f0;
  --brand: #1d4fd7;
  --brand-ink: #ffffff;
  --brand-soft: #e6edfd;
  --ok: #148a4e;
  --ok-soft: #e2f5ea;
  --warn: #b45309;
  --warn-soft: #fdf0dd;
  --danger: #cc2b3f;
  --danger-soft: #fde8ea;
  --night: #1e2947;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(22, 35, 59, .06), 0 8px 24px -12px rgba(22, 35, 59, .18);
  --shadow-lg: 0 24px 64px -24px rgba(22, 35, 59, .35);
  --nav-h: 62px;
  --font: 'Heebo', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ---------- אייקוני SVG ---------- */
.ic-svg {
  width: 1.05em; height: 1.05em; vertical-align: -0.17em;
  flex-shrink: 0; display: inline-block;
}
.btn .ic-svg, .pill .ic-svg, .chip .ic-svg { width: 15px; height: 15px; }
.mini-tag .ic-svg { width: 11px; height: 11px; vertical-align: -0.12em; }
.g-bar .ic-svg { width: 12px; height: 12px; margin-left: 3px; }
.warn-row .w-ic .ic-svg { width: 14px; height: 14px; color: var(--warn); }
.warn-row.gap .w-ic .ic-svg { color: var(--danger); }
h2 .ic-svg, h3 .ic-svg { width: 18px; height: 18px; color: var(--brand); }
.night-card h3 .ic-svg { color: #ffd479; }
.tag .ic-svg { width: 13px; height: 13px; }
button, .chip, .pill, .nav-btn, .type-cell { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-s); padding: 9px 14px; font-size: 14px; font-weight: 600;
  transition: background .15s, border-color .15s, transform .05s;
  min-height: 40px; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #1a45bd; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger-soft); border-color: #f3c2c9; color: var(--danger); }
.btn.sm { padding: 6px 11px; min-height: 32px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  border: none; background: transparent; font-size: 18px; line-height: 1;
  padding: 8px; border-radius: 50%; color: var(--ink-2); min-width: 36px; min-height: 36px;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- שדות ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 11px; background: var(--surface); min-height: 40px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .field { flex: 1 1 130px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hint { font-size: 12.5px; color: var(--ink-2); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ---------- שער כניסה ---------- */
.login-gate {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #14264e 0%, #1d4fd7 130%); padding: 20px;
}
.login-box {
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 34px 26px; width: 100%; max-width: 360px; text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.login-logo { color: var(--brand); }
.login-logo .ic-svg { width: 46px; height: 46px; }
.login-box h1 { font-size: 20px; }
.login-box input { text-align: center; letter-spacing: .12em; font-size: 17px; }
.login-err { color: var(--danger); font-size: 13.5px; font-weight: 600; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 10px 14px calc(10px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand .logo .ic-svg { width: 22px; height: 22px; }
.brand h1 { font-size: 16px; line-height: 1.15; }
.brand .sub { font-size: 11.5px; color: var(--ink-2); }
.date-nav { display: flex; align-items: center; gap: 2px; }
.date-display {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-s);
  padding: 5px 10px; text-align: center; display: flex; flex-direction: column; min-width: 118px;
}
.date-display .wd { font-weight: 700; font-size: 13.5px; }
.date-display input[type=date] {
  border: none; background: transparent; font-size: 11.5px; color: var(--ink-2);
  text-align: center; padding: 0; font-family: inherit;
}
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; }
.sync-dot.ok { background: var(--ok); }
.sync-dot.error { background: var(--danger); }
.sync-dot.syncing { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- מבנה עמוד ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 14px 12px 30px; }
.panel { display: none; }
.panel.active { display: block; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.panel-head h2 { font-size: 19px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card h3 { font-size: 15.5px; margin-bottom: 8px; }

/* ---------- ניווט תחתון ---------- */
.bottom-nav {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-btn {
  flex: 1; border: none; background: none; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 600;
}
.nav-btn .ic .ic-svg { width: 21px; height: 21px; }
.nav-btn.active { color: var(--brand); }
.nav-btn.active .ic { transform: translateY(-1px); }

/* ---------- פס סטטוס יום ---------- */
.day-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.tag.brand { background: var(--brand-soft); border-color: #c6d6f8; color: var(--brand); }
.tag.ok { background: var(--ok-soft); border-color: #bfe6cf; color: var(--ok); }
.tag.warn { background: var(--warn-soft); border-color: #f3ddb8; color: var(--warn); }
.tag.danger { background: var(--danger-soft); border-color: #f3c2c9; color: var(--danger); }

/* ---------- סרגל פעולות הלו״ז ---------- */
.sched-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sched-toolbar .spacer { flex: 1; }
.view-toggle {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); overflow: hidden;
}
.view-toggle button {
  border: none; background: none; padding: 8px 13px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.view-toggle button.active { background: var(--brand); color: #fff; }
.more-menu {
  position: absolute; z-index: 45; margin-top: 4px; left: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: var(--shadow-lg); overflow: hidden; min-width: 230px;
}
.more-menu button {
  display: block; width: 100%; text-align: right; border: none; background: none;
  padding: 11px 15px; font-size: 14px; font-weight: 500;
}
.more-menu button:hover { background: var(--surface-2); }
.more-menu button.danger-item { color: var(--danger); }
.more-wrap { position: relative; }

/* ---------- התראות ---------- */
.warnings { margin-bottom: 12px; }
.warnings .card { border-right: 4px solid var(--warn); padding: 12px 14px; margin-bottom: 8px; }
.warn-row { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; padding: 3px 0; }
.warn-row .w-ic { flex-shrink: 0; }
.warn-row.gap { color: var(--danger); }
.warnings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-weight: 700; font-size: 14px; }

/* ---------- אירועי יום (תדריך/תחקיר) ---------- */
.events-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- תצוגת לוח קומה (בלוקים × עמדות) ---------- */
.floor-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.floor-grid { border-collapse: collapse; width: 100%; min-width: 560px; background: var(--surface); }
.floor-grid th, .floor-grid td { border: 1px solid var(--line); padding: 8px 9px; text-align: center; font-size: 13.5px; }
.floor-grid thead th { background: var(--night); color: #fff; font-size: 13px; padding: 9px; position: sticky; top: 0; }
.floor-grid .time-cell { background: var(--surface-2); font-weight: 700; white-space: nowrap; font-size: 12.5px; width: 92px; }
.floor-grid .tier-chip { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.fg-cell { cursor: pointer; min-width: 88px; transition: background .12s; position: relative; }
.fg-cell:hover { background: var(--brand-soft); }
.fg-cell .who { font-weight: 700; }
.fg-cell .who + .who { border-top: 1px dashed var(--line); margin-top: 3px; padding-top: 3px; }
.fg-cell .who .t { display: block; font-size: 11px; color: var(--ink-2); font-weight: 500; }
.fg-cell .part { display: block; font-size: 10.5px; color: var(--ink-3); }
.fg-cell.missing { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.fg-cell.idle { background: var(--surface-2); color: var(--ink-3); cursor: default; }
.fg-cell.manual::after { content: '✎'; position: absolute; top: 2px; left: 5px; font-size: 10px; color: var(--ink-3); }

/* ---------- ציר זמן אנשים (גאנט) ---------- */
.gantt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gantt { min-width: 860px; position: relative; }
.gantt-header { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.gantt-names { width: 92px; flex-shrink: 0; border-left: 1px solid var(--line); }
.gantt-scale { flex: 1; position: relative; height: 30px; }
.gantt-scale .tick { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--line); font-size: 10.5px; color: var(--ink-2); padding-right: 3px; padding-top: 7px; }
.gantt-row { display: flex; border-bottom: 1px solid var(--line); min-height: 40px; }
.gantt-row:last-child { border-bottom: none; }
.gantt-row .g-name {
  width: 92px; flex-shrink: 0; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; padding: 3px 8px;
  font-size: 13px; font-weight: 700; background: var(--surface-2);
}
.gantt-row .g-name .g-sub { font-size: 10px; color: var(--ink-3); font-weight: 500; }
.gantt-row .g-lane { flex: 1; position: relative; min-height: 40px; }
.g-bar {
  position: absolute; top: 5px; bottom: 5px; border-radius: 7px; color: #fff;
  font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; overflow: hidden; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.g-bar.hollow { background: repeating-linear-gradient(45deg, #eef1f7, #eef1f7 6px, #e3e8f2 6px, #e3e8f2 12px) !important; color: var(--ink-2); }
.g-bar.absent { background: repeating-linear-gradient(45deg, #f6e3e6, #f6e3e6 6px, #efd0d5 6px, #efd0d5 12px) !important; color: var(--danger); }
.g-grid-line { position: absolute; top: 0; bottom: 0; border-right: 1px dashed #eaeef6; }

/* ---------- רשימת אירועים ---------- */
.act-list { display: flex; flex-direction: column; gap: 8px; }
.act-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  border-right: 4px solid var(--ink-3);
}
.act-item:hover { background: var(--surface-2); }
.act-item .a-time { font-weight: 800; font-size: 13.5px; white-space: nowrap; min-width: 84px; }
.act-item .a-main { flex: 1; min-width: 0; }
.act-item .a-title { font-weight: 700; font-size: 14px; }
.act-item .a-sub { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.act-item .a-badges { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.mini-tag { font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 2px 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- לילה ---------- */
.night-card { background: var(--night); color: #dfe6f5; border: none; }
.night-card h3 { color: #fff; }
.night-card .hint { color: #9fb0d3; }
.night-slots { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.night-slot {
  flex: 1 1 140px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-s); padding: 10px 12px; cursor: pointer;
}
.night-slot .ns-pos { font-size: 12px; color: #9fb0d3; font-weight: 600; }
.night-slot .ns-who { font-size: 15px; font-weight: 700; color: #fff; }
.night-slot .ns-who.empty { color: #f0b8c0; }

/* ---------- צ׳יפים של אנשים ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none;
  transition: all .12s;
}
.chip:active { transform: scale(.97); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.busy { border-style: dashed; opacity: .8; }
.chip.disabled { opacity: .38; cursor: not-allowed; }
.chip .lv { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; }
.lv.instructor { background: var(--ok-soft); color: var(--ok); }
.lv.qualified { background: var(--brand-soft); color: var(--brand); }
.lv.trainee { background: var(--warn-soft); color: var(--warn); }
.lv.none { background: var(--danger-soft); color: var(--danger); }
.chip.on .lv { background: rgba(255,255,255,.25); color: #fff; }

/* ---------- רשימת פקחים ---------- */
.controller-list { display: grid; gap: 9px; grid-template-columns: 1fr; }
.controller-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 11px; cursor: pointer;
}
.controller-item:hover { border-color: var(--brand); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.controller-item .ci-main { flex: 1; min-width: 0; }
.controller-item .ci-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.controller-item .ci-certs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pos-badge { font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 2px 6px; color: #fff; }
.pos-badge.tr { outline: 2px dashed rgba(0,0,0,.25); outline-offset: -2px; }
.search-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.search-bar input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; min-height: 40px; }
.count-pill { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* ---------- טבלת הסמכות בטופס פקח ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cert-cell { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; background: var(--surface-2); }
.cert-cell .cc-pos { font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.cert-cell select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px; background: var(--surface); }

/* ---------- טיסות ---------- */
.flights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.flight-slot { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; text-align: center; background: var(--surface); }
.flight-slot .fs-time { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.flight-slot input { width: 100%; text-align: center; border: none; font-size: 19px; font-weight: 800; padding: 3px 0; background: transparent; }
.flight-slot .fs-tier { font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px; display: inline-block; }
.flight-slot.t-light .fs-tier { background: var(--ok-soft); color: var(--ok); }
.flight-slot.t-heavy .fs-tier { background: var(--warn-soft); color: var(--warn); }
.flight-slot.t-circuit .fs-tier { background: var(--danger-soft); color: var(--danger); }
.flights-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- אשף ---------- */
.wizard-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 50, .5);
  display: flex; align-items: flex-end; justify-content: center;
}
.wizard-box {
  background: var(--bg); width: 100%; max-width: 780px; max-height: 96dvh;
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.wizard-head { padding: 14px 18px 0; display: flex; align-items: center; justify-content: space-between; }
.wiz-steps { display: flex; gap: 5px; flex: 1; margin-left: 10px; }
.wiz-step-dot { height: 5px; flex: 1; border-radius: 3px; background: var(--line); }
.wiz-step-dot.done { background: var(--ok); }
.wiz-step-dot.now { background: var(--brand); }
.wizard-title { padding: 10px 20px 2px; }
.wizard-title h3 { font-size: 18px; }
.wizard-title .hint { margin-top: 2px; }
.wizard-body { padding: 12px 18px 18px; overflow-y: auto; flex: 1; }
.wizard-foot {
  display: flex; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
  border-radius: 0;
}
.wizard-foot .spacer { flex: 1; }
.wiz-banner {
  background: linear-gradient(135deg, var(--brand) 0%, #4472e8 100%); color: #fff;
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: var(--shadow);
}
.wiz-banner .wb-main { flex: 1; }
.wiz-banner .wb-title { font-weight: 800; font-size: 15px; }
.wiz-banner .wb-sub { font-size: 12.5px; opacity: .9; }
.wiz-banner .wb-btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 9px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* ---------- נוכחות (באשף) ---------- */
.att-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 12px; margin-bottom: 7px;
}
.att-row .att-name { font-weight: 700; flex: 1; font-size: 14.5px; }
.att-opts { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.att-opts button { border: none; background: none; padding: 7px 11px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.att-opts button.on-present { background: var(--ok); color: #fff; }
.att-opts button.on-absent { background: var(--danger); color: #fff; }
.att-opts button.on-partial { background: var(--warn); color: #fff; }
.att-range { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.att-range input { border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; }

/* ---------- מודאל ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(15, 25, 50, .5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface); width: 100%; max-width: 620px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px 8px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 6px 18px calc(20px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.seg-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.seg-actions .spacer { flex: 1; }

/* ---------- בחירת סוג אירוע ---------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
.type-cell {
  border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
  padding: 12px 6px; text-align: center; font-size: 13px; font-weight: 700; cursor: pointer;
}
.type-cell .t-ic { display: block; font-size: 21px; margin-bottom: 4px; }
.type-cell.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- פילים (אופן שעה, הרכב) ---------- */
.pills { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink-2);
}
.pill.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- הודעת טוסט ---------- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: 50%; transform: translateX(50%);
  background: var(--night); color: #fff; border-radius: 999px; padding: 11px 20px;
  font-size: 14px; font-weight: 600; z-index: 90; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
  max-width: min(92vw, 480px); text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(50%) translateY(8px); } }

/* ---------- הוגנות ---------- */
.fair-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13.5px; }
.fair-row .f-name { width: 78px; font-weight: 700; flex-shrink: 0; }
.fair-bar-wrap { flex: 1; background: var(--surface-2); border-radius: 5px; height: 14px; overflow: hidden; }
.fair-bar { height: 100%; background: var(--brand); border-radius: 5px; }
.fair-row .f-val { width: 88px; font-size: 11.5px; color: var(--ink-2); text-align: left; flex-shrink: 0; }

/* ---------- ייבוא OCR ---------- */
.imp-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.imp-row .imp-chk { width: 18px; height: 18px; margin-top: 8px; accent-color: var(--brand); flex-shrink: 0; }
.imp-row .imp-main { flex: 1; min-width: 0; }
.imp-row input[type=text] { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-size: 14px; width: 100%; }
.imp-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 5px; }
.imp-meta select, .imp-meta input[type=time] { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; }
.imp-meta input[type=time] { width: 88px; }
.mini-tag.warn-tag { background: var(--warn-soft); color: var(--warn); border-color: #f3ddb8; }
.mini-tag.blue-tag { background: var(--brand-soft); color: var(--brand); border-color: #c6d6f8; }
.imp-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--night); color: #fff;
  font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 6px;
}
.imp-row.flash { background: var(--brand-soft); border-radius: 8px; transition: background .3s; }

/* מד התקדמות הזיהוי */
.imp-progress { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.imp-bar { flex: 1; height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.imp-bar-fill { height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .3s; }

/* התמונה עם סימוני האירועים */
.ocr-stage {
  position: relative; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px;
  overflow: auto; max-height: 46vh; background: #0d1526; direction: ltr;
}
.ocr-stage img { width: 100%; display: block; }
.ocr-mark {
  position: absolute; border: 2px solid; border-radius: 5px; cursor: pointer;
  transition: box-shadow .12s, background .12s;
}
.ocr-mark.inc { border-color: #17b46a; background: rgba(23, 180, 106, .12); }
.ocr-mark.off { border-color: #9aa6ba; border-style: dashed; background: rgba(150, 160, 180, .12); }
.ocr-mark.hover, .ocr-mark:hover { box-shadow: 0 0 0 3px rgba(29, 79, 215, .35); z-index: 2; }
.ocr-mark .ocr-n {
  position: absolute; top: -9px; right: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10.5px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: #17b46a; direction: rtl;
}
.ocr-mark.off .ocr-n { background: #8a96aa; }
.modal.wide { max-width: 980px; }

/* ---------- נייד: יציבות ----------
 * שדות בגודל 16px ומעלה — מונע מ-iOS "לזום פנימה" בכל מגע בשדה,
 * שזו הסיבה העיקרית שהמסך "קופץ" בטלפון. */
@media (max-width: 759px) {
  .field input, .field select, .field textarea,
  .flight-slot input, .att-range input, .imp-row input[type=text],
  .search-bar input, .login-box input { font-size: 16px; }
  .imp-meta select, .imp-meta input[type=time] { font-size: 16px; }
  .topbar { padding: 8px 10px; }
  .brand h1 { font-size: 14.5px; }
  .date-display { min-width: 104px; }
}

/* ---------- שולחן עבודה ---------- */
@media (min-width: 760px) {
  body { padding-bottom: 0; font-size: 14.5px; }
  /* במחשב: התפריט סטטי מתחת לסרגל העליון — לא נדבק ולא עולה עליו בגלילה */
  .bottom-nav {
    position: static; height: auto; border-top: none;
    max-width: 1240px; margin: 0 auto; background: transparent; border: none;
    padding: 10px 12px 0; gap: 8px; justify-content: flex-start;
  }
  .nav-btn {
    flex: 0 0 auto; flex-direction: row; gap: 7px; font-size: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px;
  }
  .nav-btn .ic { font-size: 16px; }
  .nav-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
  .controller-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .wizard-overlay, .modal-backdrop { align-items: center; padding: 20px; }
  .wizard-box, .modal { border-radius: 20px; max-height: 88dvh; }
  .toast { bottom: 26px; }
}

/* ---------- הדפסה ---------- */
@media print {
  body { background: #fff; padding: 0; font-size: 12px; }
  .topbar, .bottom-nav, .sched-toolbar, .more-menu, .wiz-banner, .toast,
  .login-gate, .warnings, .night-slot .ns-x, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .gantt-wrap, .floor-grid-wrap { overflow: visible; }
  .print-title { display: block !important; font-size: 16px; font-weight: 800; margin-bottom: 8px; }
}
.print-title { display: none; }
