/* ============================================================
   מערכת בקרת הסעות תלמידים — ד.ר שחקים בע"מ
   ערכת עיצוב "ענבר": טופ-בר נייבי · סאב-בר זהב · סרגל צד לבן
   ============================================================ */

:root {
  --navy:        #0D2B5E;
  --navy-dark:   #071830;
  --navy-mid:    #1A3A72;
  --navy-light:  #2550A0;
  --gold:        #C9A227;
  --gold-dark:   #A8871F;
  --gold-light:  #E8C84A;
  --gold-xlight: #EEF2F8;
  --white:       #FFFFFF;
  --gray-bg:     #F2F4F8;
  --gray-light:  #F8F9FA;
  --gray-border: #DEE2E6;
  --gray-mid:    #ADB5BD;
  --gray-text:   #555;
  --text-dark:   #1A1A2E;
  --text-mid:    #555;
  --green:       #218838;
  --green-bg:    #eaf7ee;
  --red:         #C0392B;
  --red-bg:      #fff0f0;
  --orange:      #E67E22;

  --sidebar-w:   240px;
  --top-h:       52px;
  --sub-h:       34px;
  --font:        'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 2px 12px rgba(27, 58, 107, .10);
  --shadow-md:   0 4px 24px rgba(27, 58, 107, .16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--gray-bg);
  color: var(--text-dark);
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
/* גופן אחיד לכל הפלטפורמה — כולל כותרות, שדות טופס וכפתורים,
   כדי שלא ייווצר הבדל בין כותרת לטקסט רגיל */
h1, h2, h3, h4, h5, h6,
input, select, textarea, button, optgroup, option,
table, thead, tbody, tfoot, tr, th, td { font-family: var(--font); }

/* ══════════════════════════════════════════
   TOP BAR — נייבי
   ══════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.topbar-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar-burger {
  background: none; border: none; color: #fff; font-size: 18px;
  cursor: pointer; padding: 5px 7px; border-radius: 6px; line-height: 1;
}
.topbar-burger:hover { background: rgba(255, 255, 255, .12); }
.topbar-logo { height: 32px; width: auto; flex: none; }
.topbar-appname {
  font-size: 15px; font-weight: 700; color: #fff;
  letter-spacing: -.3px; line-height: 1.1; white-space: nowrap;
}
.topbar-appname span {
  display: block; color: var(--gold-light);
  font-size: 10.5px; font-weight: 400; letter-spacing: 0;
}
.topbar-center { font-size: 13px; color: rgba(255, 255, 255, .8); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 8px; color: #fff; padding: 4px 6px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  border: 2px solid rgba(255, 255, 255, .3);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}
.user-name { font-size: 12.5px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--gold-light); }
.topbar-btn {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff; padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; white-space: nowrap;
  transition: background .15s;
}
.topbar-btn:hover { background: rgba(255, 255, 255, .24); }

/* ══════════════════════════════════════════
   SUB BAR — זהב
   ══════════════════════════════════════════ */
.subbar {
  position: sticky; top: var(--top-h); z-index: 999;
  min-height: var(--sub-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 16px; font-size: 12px;
  background: var(--gold-xlight);
  border-bottom: 2px solid var(--gold);
}
.subbar-org {
  font-weight: 700; color: var(--navy);
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
}
.subbar-org span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subbar-ico { width: 17px; height: 17px; flex: none; }
.subbar-breadcrumb { color: var(--text-mid); white-space: nowrap; }
/* מעבר בין רשויות — מוצג רק לרפרנט מרחבי */
.subbar-switch {
  background: rgba(13, 43, 94, .07); border: 1px solid rgba(13, 43, 94, .16);
  color: var(--navy); font-family: var(--font); font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .13s;
}
.subbar-switch:hover { background: rgba(13, 43, 94, .14); }

/* ── מסך בחירת רשות ── */
.org-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.org-card {
  background: #fff; border: 1px solid var(--gray-border);
  border-top: 3px solid var(--gold); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.org-card.active { border-color: var(--navy); border-top-color: var(--navy); background: var(--gold-xlight); }
.org-head { display: flex; align-items: center; gap: 11px; }
.org-ico {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: var(--gold-xlight); color: var(--gold-dark);
  display: grid; place-items: center;
}
.org-card.active .org-ico { background: #fff; }
.org-ico svg { width: 21px; height: 21px; }
.org-txt { min-width: 0; }
.org-name { font-size: 14.5px; font-weight: 800; color: var(--navy); }
.org-sub { font-size: 11.5px; color: var(--gray-text); margin-top: 2px; }
.org-card .btn { width: 100%; }

/* ══════════════════════════════════════════
   שלד — סרגל צד + תוכן
   ══════════════════════════════════════════ */
.app-body { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky; top: calc(var(--top-h) + var(--sub-h));
  align-self: flex-start;
  width: var(--sidebar-w); flex: none;
  height: calc(100vh - var(--top-h) - var(--sub-h));
  background: #fff;
  border-left: 1px solid var(--gray-border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: width .2s ease;
}
.sidebar.collapsed { width: 0; overflow: hidden; border-left: none; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; cursor: pointer;
  font-size: 13.5px; color: var(--text-dark); font-weight: 600;
  border: none; border-bottom: 1px solid #dfe5ee;
  background: none; width: 100%; text-align: right;
  transition: background .12s;
}
.nav-item:hover { background: var(--gold-xlight); color: var(--navy); }
.nav-item.active {
  background: var(--gold-xlight); color: var(--navy); font-weight: 700;
  border-left: 3px solid var(--gold);
}
.nav-icon {
  width: 20px; height: 20px; flex: none;
  color: var(--gold-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { flex: 1; }
.nav-sep {
  height: 1px; margin: 6px 0; opacity: .45;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.nav-group-title {
  padding: 12px 14px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  color: var(--gold-dark); text-transform: uppercase;
}
.sidebar-copyright {
  margin-top: auto;
  padding: 14px; font-size: 10.5px; color: #9aa3b4; text-align: center;
}

.sidebar-backdrop { display: none; }

.main {
  flex: 1; min-width: 0;
  padding: 18px clamp(16px, 3vw, 40px) 40px;
  background: var(--gray-bg);
  min-height: calc(100vh - var(--top-h) - var(--sub-h));
}

/* ══════════════════════════════════════════
   כותרות עמוד
   ══════════════════════════════════════════ */
.pk-head { margin-bottom: 14px; }
.pk-h1 { color: var(--navy); font-size: 19px; font-weight: 700; }
.pk-sub { color: var(--text-mid); font-size: 12.5px; margin-top: 3px; }

/* שורת ראש עמוד: כותרת מימין, פעולות/פרטים בצד שמאל */
.page-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-bar .pk-head { margin-bottom: 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* בלוק פרטים קומפקטי בראש העמוד */
.pk-meta {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 11.5px; color: var(--gray-text);
  line-height: 1.6;
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: 10px;
}
.pk-meta b { color: var(--navy); font-weight: 700; }
.pk-section {
  display: flex; align-items: center; gap: 8px;
  color: var(--navy); font-size: 13px; font-weight: 700; margin: 20px 0 10px;
}
.pk-section::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

/* ══════════════════════════════════════════
   כרטיסים
   ══════════════════════════════════════════ */
.pk-card {
  background: #fff; border: 1px solid var(--gray-border);
  border-radius: 8px; padding: 18px 20px; margin-bottom: 16px;
}
.pk-panel {
  background: #fff; border: 1px solid var(--gray-border);
  border-radius: 8px; margin-bottom: 16px; overflow: hidden;
}
.pk-panel-head {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-bottom: 3px solid var(--gold);
  padding: 11px 16px;
  color: #fff;
}
.pk-panel-head h3 { font-size: 14px; font-weight: 700; color: #fff; flex: 1; }
/* כותרת הטופס — יושבת בראש הטופס עצמו, מעל השאלה הראשונה */
.pk-panel-head.form-title { flex-direction: column; align-items: flex-start; gap: 3px; padding: 13px 16px; }
.pk-panel-head.form-title h3 { font-size: 16px; flex: none; }
.pk-panel-head.form-title span { font-size: 11.5px; color: var(--gold-light); }
/* כפתורים ותגיות בתוך כותרת כחולה */
.pk-panel-head .btn-secondary {
  background: rgba(255, 255, 255, .14); color: #fff;
  border-color: rgba(255, 255, 255, .28);
}
.pk-panel-head .btn-secondary:hover { background: rgba(255, 255, 255, .26); }
.pk-panel-head .tag { background: rgba(255, 255, 255, .18); color: #fff; }
.pk-panel-body { padding: 16px; }
.pk-panel-body.flush { padding: 0; }
/* ── טופס המילוי: רצף אחד של שורות, בלי כותרות ביניים ──
   כל שורה — שאלת סימון או שדה מילוי — נראית אותו דבר: מספר, תווית,
   והפקד בצד שמאל, ומתחתיה קו מפריד אחיד. */
.pk-form-seg { padding: 0; }
.pk-form-seg .form-group {
  margin: 0; padding: 11px 16px;
  border-bottom: 1px solid #ccd6e6;
  gap: 6px 12px;
}
.pk-form-seg .form-group:last-child { margin-bottom: 0; }
/* הקו האחרון בטופס מיותר — המסגרת של הפאנל סוגרת ממילא */
.pk-panel-body.flush > .pk-form-seg:last-child .form-group:last-child { border-bottom: none; }
.pk-panel-body.flush > .q-row:last-child { border-bottom: none; }

/* כל הפקדים באותו רוחב בדיוק, צמודים לקצה שמאל של השורה — כך נוצר
   טור אחד ישר לאורך כל הטופס, באותו קו עם ריבועי ה-V/X של שאלות הסימון.
   (margin-inline-start: auto דוחף שמאלה ב-RTL) */
.pk-form-seg .form-group > .form-input,
.pk-form-seg .form-group > [data-slot] {
  flex: 0 0 var(--ctl-w); max-width: var(--ctl-w); margin-inline-start: auto;
}
.pk-form-seg .form-group { --ctl-w: 300px; }
/* ההערה שמתחת לשדה מיושרת לתחילת התווית ולא לשדה */
.pk-form-seg .form-group > .form-hint { padding-inline-start: calc(var(--label-w) + 46px); }

/* ══════════════════════════════════════════
   כפתורים
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: none; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .14s, box-shadow .14s, transform .1s;
  min-height: 42px; white-space: nowrap;
}
.btn:hover:not(:disabled) { box-shadow: 0 3px 8px rgba(0, 0, 0, .18); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-dark); }
.btn-secondary { background: #fff; color: var(--text-dark); border: 1.5px solid var(--gray-border); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-light); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff; }
.btn-gold:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 3px 10px rgba(201, 162, 39, .4); }
.btn-gold-outline { background: #fff; color: var(--gold-dark); border: 1.5px solid var(--gold); }
.btn-gold-outline:hover:not(:disabled) { background: var(--gold-xlight); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a02520; }
.btn-lg { padding: 12px 26px; font-size: 15px; min-height: 48px; }
.btn-sm { padding: 5px 11px; font-size: 12px; min-height: 32px; }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════
   טפסים
   ══════════════════════════════════════════ */
/* תג מספר, תווית לצידו ושדה המילוי — באותו יישור כמו שורות הסימון */
.form-group {
  --label-w: clamp(96px, 30%, 210px);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 10px; margin-bottom: 10px;
}
.form-group > .q-num { flex: none; }
.form-group > label {
  flex: 0 0 var(--label-w);
  font-size: 13px; font-weight: 700; color: var(--navy);
  line-height: 1.35;
}
.form-group > .form-input,
.form-group > [data-slot] { flex: 1 1 130px; min-width: 0; width: auto; }
.form-group > .form-hint {
  flex: 0 0 100%;
  /* הזחה של תג המספר (26) + שני רווחים (10+10) + רוחב התווית */
  padding-inline-start: calc(var(--label-w) + 46px);
  margin-top: -2px;
}
.req { color: var(--red); margin-inline-start: 2px; }
.form-hint { font-size: 11.5px; color: var(--gray-text); font-weight: 400; }

.form-input {
  width: 100%;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid #d8e0ee;
  font-size: 13.5px; background: #fff; color: var(--text-dark);
  text-align: right; min-height: 36px;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .15);
}
.form-input:disabled { background: var(--gray-light); color: var(--gray-text); }
.form-input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
textarea.form-input { min-height: 74px; resize: vertical; line-height: 1.6; flex: 1 1 100%; }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D2B5E' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 9px center; background-size: 15px;
  padding-left: 30px;
}
/* בתצוגת תווית-לצד-שדה כל שדה תופס שורה משלו */
.form-row { display: flex; flex-direction: column; gap: 0; }

/* ══════════════════════════════════════════
   התראות
   ══════════════════════════════════════════ */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 14px; line-height: 1.6;
  display: flex; gap: 9px; align-items: flex-start;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert-success { background: var(--green-bg); border: 1px solid #b7dcc0; color: #1c6b2e; }
.alert-danger  { background: var(--red-bg); border: 1px solid #f5c6cb; color: var(--red); }
.alert-warning { background: #fff8e1; border: 1px solid var(--gold); color: #7B5800; }
.alert-info    { background: #e8f4f8; border: 1px solid #90caf9; color: #0d47a1; }

/* ══════════════════════════════════════════
   אריחי סטטיסטיקה
   ══════════════════════════════════════════ */
.pk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.pk-stat {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--gray-border);
  border-top: 3px solid var(--gold); border-radius: 8px;
  padding: 13px 16px;
}
.pk-stat-label { color: var(--text-mid); font-size: 12px; font-weight: 600; }
.pk-stat-num { color: var(--navy); font-size: 22px; font-weight: 700; }
.pk-stat-ico { color: var(--gold-dark); }
.pk-stat-ico svg { width: 24px; height: 24px; }

/* ══════════════════════════════════════════
   לשוניות — שלבי הטופס
   ══════════════════════════════════════════ */
.tabs {
  display: flex; border-bottom: 2px solid var(--gold);
  margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 3px; }
.tab {
  padding: 9px 15px; cursor: pointer; font-size: 12.5px; color: var(--gray-text);
  white-space: nowrap; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; background: none; font-family: inherit;
  display: flex; align-items: center; gap: 7px; transition: color .15s;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 700; }
.tab-badge {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: #e8f6ee; color: #1F8A4C;
}
.tab-badge.bad { background: #fdeceb; color: var(--red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: pkFade .25s ease both; }
@keyframes pkFade { from { opacity: 0; transform: translateY(5px); } }

/* ══════════════════════════════════════════
   שורות שאלה עם ריבועי וי / איקס
   ══════════════════════════════════════════ */
.q-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #ccd6e6;
}
.q-row:last-child { border-bottom: none; }
.q-row:hover { background: #FAFBFD; }
.q-row.unanswered { background: #fffaf2; }
.q-num {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: var(--gold-xlight); color: var(--navy);
  border: 1px solid #dde5f2;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.q-label { flex: 1; font-size: 13.5px; font-weight: 600; line-height: 1.4; min-width: 0; }
.q-label em {
  display: block; font-style: normal; font-size: 11.5px;
  color: var(--gray-text); font-weight: 400; margin-top: 2px;
}
.q-boxes { display: flex; gap: 8px; flex: none; }
.q-box {
  width: 42px; height: 42px;
  border: 2px solid #d8e0ee; border-radius: 8px;
  background: #fff; cursor: pointer;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 700; line-height: 1; color: #b3bccb;
  transition: all .13s; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.q-box:hover { border-color: var(--gold); }
.q-box.sel-v { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.q-box.sel-x { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.q-row.unanswered .q-box { border-color: #eccf94; }

/* ══════════════════════════════════════════
   העלאת מסמך
   ══════════════════════════════════════════ */
/* כפתור צירוף מסמך — בגודל של תיבת מילוי, לא בלוק גדול */
.pk-drop {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--gold-xlight);
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  padding: 0 14px; cursor: pointer;
  height: 36px; min-height: 36px; width: 100%;
  transition: background .15s, border-color .15s;
}
.pk-drop:hover { border-color: var(--gold-dark); background: #f6eecf; }
.pk-drop .ic { display: inline-flex; flex: none; color: var(--gold-dark); }
.pk-drop .ic svg { width: 15px; height: 15px; }
.pk-drop-txt { color: var(--navy); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pk-drop input[type=file] { display: none; }

.file-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px; height: 36px; width: 100%;
  background: var(--green-bg);
  border: 1px solid #b7dcc0;
  border-radius: var(--radius-sm);
}
.file-chip > svg { width: 19px; height: 19px; color: var(--green); flex: none; }
.fc-name {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: #1c6b2e;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25;
}
.fc-size { font-size: 10.5px; color: var(--gray-text); font-weight: 400; }
.fc-del {
  background: none; border: none; cursor: pointer; color: var(--red);
  width: 30px; height: 30px; border-radius: 6px;
  display: grid; place-items: center; flex: none;
}
.fc-del:hover { background: var(--red-bg); }
.fc-del svg { width: 16px; height: 16px; }

/* ══════════════════════════════════════════
   סרגל פעולות תחתון
   ══════════════════════════════════════════ */
/* הטופס עצמו צר יותר מהעמוד */
.form-narrow { max-width: 760px; }
/* מסך צפייה בדוח — צר יותר, כדי שהעין תעבור על טור אחד ולא על רוחב המסך */
.report-narrow { max-width: 720px; }

/* כפתור בולט בעמוד הבית — מעבר מהיר לדוח חדש */
.home-cta {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin-bottom: 18px; padding: 15px 18px; cursor: pointer;
  background: #fff; border: 1px solid var(--gray-border);
  border-right: 4px solid var(--gold); border-radius: 10px;
  text-align: right; font-family: var(--font);
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
.home-cta:hover {
  border-color: var(--gold); box-shadow: 0 4px 16px rgba(201, 162, 39, .18);
  transform: translateY(-1px);
}
.cta-ico {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  background: var(--gold-xlight); color: var(--gold-dark);
  display: grid; place-items: center;
}
.cta-ico svg { width: 22px; height: 22px; }
.cta-txt { flex: 1; min-width: 0; }
.cta-title { display: block; font-size: 15px; font-weight: 800; color: var(--navy); }
.cta-sub { display: block; font-size: 12px; color: var(--gray-text); margin-top: 2px; }
.cta-arrow { flex: none; color: var(--gold-dark); display: inline-flex; }
.cta-arrow svg { width: 18px; height: 18px; }

/* הערה מתחת לכפתורי השמירה בטופס */
.form-submit-note {
  font-size: 11.5px; color: var(--gray-text);
  margin: 8px 2px 0; line-height: 1.6;
}

/* פס התקדמות דביק בראש הטופס */
.form-progress {
  position: sticky; top: calc(var(--top-h) + var(--sub-h)); z-index: 40;
  background: #fff;
  border: 1px solid var(--gray-border);
  border-bottom: 3px solid var(--gold);
  border-radius: 8px;
  padding: 9px 14px; margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(27, 58, 107, .07);
}
.form-submit { display: flex; justify-content: flex-end; margin-top: 4px; }
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-track { flex: 1; height: 5px; background: #e7ecf5; border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 99px; transition: width .25s;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}
.progress-text { font-size: 12px; font-weight: 700; color: var(--navy); flex: none; }
.progress-pct { font-size: 12px; font-weight: 700; color: var(--gold-dark); flex: none; }

/* ══════════════════════════════════════════
   רשימות
   ══════════════════════════════════════════ */
.pk-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #d5dee9;
  cursor: pointer; transition: background .12s;
  color: inherit; width: 100%; text-align: right;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit;
}
.pk-list-item:last-child { border-bottom: none; }
.pk-list-item:hover { background: #FAFBFD; }
.li-ico {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  background: var(--gold-xlight); color: var(--gold-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.li-ico svg { width: 19px; height: 19px; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 700; font-size: 13.5px; color: var(--navy); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.li-sub { font-size: 12px; color: var(--gray-text); margin-top: 3px; line-height: 1.55; }
.li-arrow { color: var(--gray-mid); flex: none; }
.li-arrow svg { width: 17px; height: 17px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--gold-xlight); color: var(--navy);
}
.tag-ok { background: #e8f6ee; color: #1F8A4C; }
.tag-bad { background: #fdeceb; color: var(--red); }
.tag-muted { background: #eef0f5; color: #7d8698; }
.tag-gold { background: rgba(201, 162, 39, .16); color: var(--gold-dark); }
.tag-warn { background: #fff8e1; color: #8a6100; }

/* רשימת סימון — שיוך רפרנט מרחבי לכמה רשויות */
.chk-list {
  flex: 1 1 100%; max-height: 190px; overflow-y: auto;
  border: 1px solid var(--gray-border); border-radius: var(--radius-sm);
  background: #fff; padding: 4px;
}
.chk-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 5px; cursor: pointer;
  font-size: 13px; color: var(--text-dark);
}
.chk-item:hover { background: var(--gold-xlight); }
.chk-item input { width: 15px; height: 15px; flex: none; cursor: pointer; }

/* ══════════════════════════════════════════
   יומן בקרה — קבוצות נפתחות (רשות ← משתמש ← רשומות)
   ══════════════════════════════════════════ */
.aud-group {
  background: #fff; border: 1px solid var(--gray-border);
  border-radius: 8px; margin-bottom: 8px; overflow: hidden;
}
.aud-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 11px 13px; background: none; border: none; cursor: pointer;
  text-align: right; font-family: var(--font); font-size: 13.5px;
  color: var(--navy); font-weight: 700;
  transition: background .12s;
}
.aud-head:hover { background: var(--gold-xlight); }
.aud-head.sub {
  font-size: 12.5px; font-weight: 600; color: var(--text-dark);
  padding: 9px 13px; border-top: 1px solid #eef1f6;
}
.aud-arrow { display: inline-flex; flex: none; color: var(--gold-dark); transition: transform .16s; }
.aud-arrow svg { width: 15px; height: 15px; }
.aud-arrow.open { transform: rotate(180deg); }
.aud-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud-pill {
  flex: none; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  background: var(--gold-xlight); color: var(--navy);
}
.aud-ago { flex: none; font-size: 11px; font-weight: 400; color: var(--gray-text); }
.aud-body { border-top: 1px solid var(--gray-border); background: var(--gray-light); }
.aud-user { background: #fff; }
.aud-rows { overflow-x: auto; border-top: 1px solid #eef1f6; }
.aud-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.aud-table thead th {
  background: var(--gray-light); color: var(--navy); font-weight: 700;
  padding: 7px 10px; text-align: right; white-space: nowrap;
  border-bottom: 2px solid var(--gold);
}
.aud-table tbody td { padding: 7px 10px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
.aud-table tbody tr:hover { background: #FAFBFD; }
.aud-day td {
  background: var(--gold-xlight) !important; color: var(--navy);
  font-weight: 700; font-size: 11.5px; padding: 5px 10px !important;
}
.aud-time { font-variant-numeric: tabular-nums; color: var(--gray-text); white-space: nowrap; }
.aud-act { font-weight: 600; color: var(--navy); }
.aud-ip { font-variant-numeric: tabular-nums; color: var(--gray-text); font-size: 11.5px; }
.aud-footer {
  margin-top: 10px; text-align: center;
  font-size: 12px; color: var(--gray-text);
}

@media (max-width: 620px) {
  .aud-head { flex-wrap: wrap; gap: 6px; }
  .aud-name { flex: 1 1 100%; }
}

.pk-empty { text-align: center; padding: 44px 20px; color: var(--gray-text); }
.pk-empty svg { width: 42px; height: 42px; opacity: .3; margin-bottom: 10px; color: var(--navy); }
.pk-empty p { font-size: 13.5px; }

.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .form-input { flex: 1; min-width: 150px; margin: 0; }

.kv { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #d5dee9; font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { flex: 1; min-width: 0; color: var(--gray-text); }
/* טור התשובות באותו רוחב לאורך כל הדוח, צמוד לקצה שמאל */
.kv .v {
  flex: 0 0 300px; max-width: 300px; margin-inline-start: auto;
  font-weight: 700; color: var(--text-dark); word-break: break-word;
}
.kv .v.ok { color: var(--green); }
.kv .v.bad { color: var(--red); }
.kv .v.muted { color: var(--gray-text); font-weight: 400; }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-xlight); color: var(--navy);
  border: 1px solid #dde5f2;
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700;
}
.chip button {
  background: none; border: none; cursor: pointer; color: var(--red);
  padding: 0; display: grid; place-items: center; opacity: .65;
}
.chip button:hover { opacity: 1; }
.chip button svg { width: 14px; height: 14px; }

.divider { height: 1px; background: var(--gray-border); margin: 16px 0; }

/* ══════════════════════════════════════════
   חלון קופץ
   ══════════════════════════════════════════ */
/* במחשב — חלון ממוקם במרכז המסך. בנייד הוא הופך ל"מגירה" נשלפת מלמטה
   (ראה ההתאמה ב-max-width: 620px), שם זו התבנית הנוחה לאגודל. */
.modal-back {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(7, 24, 48, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff; width: 100%; max-width: 560px; max-height: calc(100dvh - 48px);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(7, 24, 48, .34);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modalIn { from { transform: translateY(14px); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(26px); } }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; flex: none;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-bottom: 3px solid var(--gold);
  color: #fff;
}
.modal-head h3 { font-size: 15px; font-weight: 700; flex: 1; }
.modal-close {
  background: rgba(255, 255, 255, .14); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.modal-close:hover { background: rgba(255, 255, 255, .28); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; gap: 9px; padding: 12px 18px; flex: none;
  border-top: 1px solid var(--gray-border); background: var(--gray-light);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.modal-foot .btn { flex: 1; }

/* ══════════════════════════════════════════
   טוסט
   ══════════════════════════════════════════ */
.toast-wrap {
  position: fixed; top: calc(var(--top-h) + var(--sub-h) + 10px);
  inset-inline: 12px; z-index: 3000; pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
}
.toast {
  background: var(--navy); color: #fff;
  padding: 11px 16px; border-radius: var(--radius-sm);
  border-inline-start: 4px solid var(--gold);
  box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 600;
  margin-bottom: 8px; max-width: 480px;
  display: flex; gap: 9px; align-items: center;
  animation: slideUp .2s;
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok { border-inline-start-color: #3cd278; }
.toast.err { background: #7d1b13; border-inline-start-color: #ff7a6b; }

.spinner {
  width: 17px; height: 17px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner.dark { border-color: rgba(13, 43, 94, .2); border-top-color: var(--navy); }

/* סרגל "עלתה גרסה חדשה" — מוצג רק כשהרענון האוטומטי לא הצליח לרענן בעצמו */
.ver-update-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9500;
  background: var(--gold); color: var(--navy);
  font-weight: 700; font-size: 13px; padding: 9px 14px; text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25); cursor: pointer;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 50px; }

/* ══════════════════════════════════════════
   מסך כניסה
   ══════════════════════════════════════════ */
.auth-body { background: linear-gradient(145deg, var(--navy) 0%, #2A5298 60%, #1a6b8a 100%); min-height: 100dvh; }
.auth-split { min-height: 100dvh; display: flex; direction: rtl; }
.auth-brand {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px; color: #fff; text-align: center;
  border-left: 2px solid var(--gold);
  box-shadow: -6px 0 22px -6px rgba(201, 162, 39, .55),
              inset 7px 0 20px -12px rgba(255, 214, 120, .5);
}
.brand-inner { max-width: 360px; }
.brand-logo-img { width: 160px; height: 160px; object-fit: contain; margin-bottom: 18px; }
.brand-desc { font-size: 17px; color: #adc4e8; margin-bottom: 28px; line-height: 1.7; }
.brand-desc strong { color: #fff; }
.brand-features { text-align: right; }
.brand-feat {
  padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .10);
  font-size: 13.5px; color: #c8d8f0;
}
.brand-feat:last-child { border-bottom: none; }

.auth-form-panel {
  width: 440px; flex: none; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.auth-form-inner { width: 100%; }
.auth-logo-mobile { display: none; }
.auth-title { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: #667; margin-bottom: 18px; }
.auth-footer { margin-top: 28px; text-align: center; font-size: 11.5px; color: var(--gray-text); line-height: 1.7; }

/* ── שדות מסך הכניסה — זהים לפלטפורמת "אבטחת מוסדות חינוך" ──
   התווית יושבת מעל השדה (ולא לצידו כמו בטופסי הבקרה שבתוך המערכת),
   השדה ברוחב מלא, והמיקוד בכחול החברה. הכללים מוגבלים ל-.auth-form
   כדי שלא ישפיעו על שאר טופסי המערכת.                                  */
.auth-form .form-group {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 6px; margin-bottom: 16px;
}
.auth-form .form-group > label {
  flex: none;
  font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.4;
}
.auth-form .form-group > .form-input {
  flex: none; width: 100%;
  padding: 9px 12px; min-height: 0;
  border: 1px solid var(--gray-mid); border-radius: var(--radius-sm);
  font-size: 14px;
}
.auth-form .form-group > .form-input:focus {
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, .15);
}
.auth-form .form-group > .form-hint {
  flex: none; padding-inline-start: 0; margin-top: 0;
}
.auth-form .btn-lg { padding: 11px 30px; font-size: 15px; min-height: 0; }

/* קישור קטן בין מסלולי הכניסה — "אין לי SMS" / "חזרה לטלפון" */
.auth-links { margin-top: 14px; text-align: center; }
.auth-link {
  font-size: 12.5px; color: var(--navy-mid); text-decoration: underline;
  cursor: pointer;
}
.auth-link:hover { color: var(--navy); }

/* שדה הקוד החד-פעמי — ספרות גדולות ומרווחות, כמו בענבר */
.auth-form .form-group > .otp-input {
  text-align: center; letter-spacing: 8px;
  font-size: 22px; font-weight: 700; padding: 10px 12px;
}

/* ══════════════════════════════════════════
   מסך אישור הגשה
   ══════════════════════════════════════════ */
.success-wrap { text-align: center; padding: 32px 20px; }
.success-ico {
  width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--green-bg); color: var(--green);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px #b7dcc0;
}
.success-ico svg { width: 34px; height: 34px; }
.success-wrap h2 { font-size: 19px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.success-wrap .s-num { font-size: 13px; color: var(--gray-text); }
.success-wrap .s-file { font-size: 12px; color: var(--gray-mid); margin-bottom: 22px; word-break: break-all; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ══════════════════════════════════════════
   רספונסיב — נייד
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
  .topbar-center { display: none; }
  .user-name, .user-role { display: none; }
  .topbar-btn { padding: 6px 10px; }

  /* סרגל צד כמגירה נשלפת */
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    height: 100dvh; width: 270px; z-index: 2100;
    border-left: none; box-shadow: -4px 0 24px rgba(0, 0, 0, .28);
    transform: translateX(100%); transition: transform .22s ease;
    padding-top: env(safe-area-inset-top);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: 270px; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 2050;
    background: rgba(7, 24, 48, .5);
    opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .sidebar-mobile-head {
    display: flex !important; align-items: center; gap: 10px;
    padding: 14px 14px; color: #fff;
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    border-bottom: 3px solid var(--gold);
  }
  .main { padding: 16px 14px 40px; }
  .form-narrow { max-width: none; }

  .auth-split { flex-direction: column; }
  .auth-brand { display: none; }
  .auth-form-panel { width: 100%; flex: 1; padding: 26px 20px; justify-content: flex-start; }
  .auth-logo-mobile {
    display: block; text-align: center; padding: 22px 0 16px;
  }
  .auth-logo-mobile img { width: 96px; height: 96px; object-fit: contain; }
  .auth-logo-mobile div { color: #fff; font-size: 16px; font-weight: 700; margin-top: 8px; }
  .auth-logo-mobile span { color: var(--gold-light); font-size: 11.5px; }
  .auth-body .auth-form-panel { border-radius: 16px 16px 0 0; }
}

@media (min-width: 901px) {
  .sidebar-mobile-head { display: none; }
}

@media (max-width: 620px) {
  .form-submit { justify-content: stretch; }
  .form-submit .btn { flex: 1; min-height: 44px; }

  /* בנייד: התווית תופסת את השורה (ליד מספר השאלה) והשדה יורד מתחתיה
     ברוחב מלא — במקום תווית צרה שנשברת לשתי שורות */
  .pk-form-seg .form-group { --label-w: calc(100% - 46px); --ctl-w: 100%; }
  .pk-form-seg .form-group > .form-input,
  .pk-form-seg .form-group > [data-slot] { flex: 1 1 100%; min-height: 42px; }
  .pk-form-seg .form-group > .form-hint { padding-inline-start: 0; }
  .pk-drop, .file-chip { height: 42px; }
  .kv .v { flex: 0 0 45%; max-width: 45%; }

  /* בנייד החלון חוזר להיות מגירה נשלפת מתחתית המסך */
  .modal-back { align-items: flex-end; padding: 0; }
  .modal {
    max-height: 92dvh;
    border-radius: var(--radius) var(--radius) 0 0;
    animation: slideUp .22s cubic-bezier(.2, .8, .3, 1);
  }
}

@media (max-width: 420px) {
  .topbar { padding: 0 8px; }
  .topbar-appname { font-size: 13px; }
  .topbar-appname span { font-size: 9.5px; }
  .topbar-logo { height: 27px; }
  .q-row { gap: 9px; padding: 12px 12px; }
  .q-box { width: 42px; height: 42px; font-size: 19px; }
  .q-label { font-size: 13px; }
  .pk-stats { grid-template-columns: 1fr 1fr; }
}

/* הדפסה */
@media print {
  .topbar, .subbar, .sidebar, .form-progress, .btn, .toast-wrap { display: none !important; }
  .main { padding: 0; }
  .pk-panel, .pk-card { border: 1px solid #ccc; break-inside: avoid; }
}
