/* Shifter — עיצוב משותף לממשק עובד ומנהל
 *
 * כל הצבעים, הגופנים, הרדיוסים והצללים מוגדרים כאן — בבלוק :root בלבד.
 * להחלפת שפה גרפית (styleguide) משנים את הערכים כאן, בלי לגעת בשאר הקובץ או בקוד.
 * ראו docs/DESIGN.md.
 */
:root {
  /* ---- גופנים */
  --font-body: 'Rubik', 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;

  /* ---- רקע העמוד (styleguide: canvas #F8FAFC) */
  --bg1: #eef5ff;
  --bg-mid: #f8fafc;
  --bg2: #ecf8fb;

  /* ---- משטחים וטקסט */
  --card: #ffffff;
  --surface: #ffffff;        /* כרטיסים, כפתורים לבנים */
  --surface-2: #f8fafc;      /* שדות, כותרות טבלה, מילוי עדין */
  --surface-3: #f0f6ff;      /* ריחוף, צ'יפים */
  --neutral-soft: #eef2f7;   /* תגיות אפורות, רקע מנוטרל */
  --glass: rgba(255, 255, 255, .86);  /* סרגלים צפים עם טשטוש */
  --stripe-a: #eef3fa;       /* פסים של משבצת לא פעילה */
  --stripe-b: #f8fafc;
  --ink: #0b2a6b;            /* טקסט ראשי (navy) */
  --ink2: #3b4f7a;           /* טקסט משני */
  --muted: #64748b;          /* טקסט חלש */
  --faint: #bfcde3;          /* מושבת / אייקון חלש */
  --disabled-ink: #94a3b8;   /* טקסט של אפשרות לא זמינה */
  --line: #e3ecfa;
  --line2: #cfdef6;

  /* ---- מותג */
  --primary: #2563eb;
  --primary-2: #3b82f6;
  --primary-soft: #eaf2ff;
  --on-primary: #ffffff;     /* טקסט על רקע ראשי / צבעוני */
  --primary-tint: rgba(37, 99, 235, .07);   /* ריחוף */
  --ring: rgba(59, 130, 246, .18);          /* מסגרת פוקוס */
  --primary-glow: rgba(37, 99, 235, .28);   /* צל כפתור ראשי */
  --brand-gradient: linear-gradient(135deg, #206ff0, #1059e8);  /* גוון אייקון האפליקציה, כהה מספיק לטקסט לבן (AA) */
  --logo-gradient: var(--brand-gradient);
  --icon-fill: #bfdbfe;      /* מילוי פנימי של אייקונים דו-גוניים בניווט */

  /* ---- סטטוסים: צבע / רקע רך / טקסט על רקע רך */
  --ok: #14b8a6;   --ok-soft: #d5f5ef;   --ok-ink: #0f766e;
  --warn: #fb923c; --warn-soft: #ffedd5; --warn-ink: #b8460c; --warn-mid: #fed7aa;
  --bad: #f87171;  --bad-soft: #fee2e2;  --bad-ink: #b91c1c;
  --note-bg: #fef9c3; --note-ink: #854d0e;  /* הערות על משמרות */
  --manual: #94a3b8;                        /* שם ידני / אורח בלי פרופיל */

  /* ---- באנרים (איורים): תמונת רקע בלי טקסט; האיור בצד שמאל */
  --banner-constraints: url('/illustrations/constraints.webp');
  --banner-vacations: url('/illustrations/vacations.webp');
  --banner-ink: #0b2a6b;
  --banner-scrim: linear-gradient(to left, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .7) 38%, rgba(255, 255, 255, 0) 60%);  /* הבהרה מאחורי הטקסט (צד ימין) */

  /* ---- צורה וצל */
  --radius: 22px;
  --radius-s: 14px;
  --shadow: 0 8px 28px rgba(11, 42, 107, .07), 0 1px 3px rgba(11, 42, 107, .05);
  --shadow-l: 0 20px 60px rgba(11, 42, 107, .22);
  --overlay: rgba(11, 42, 107, .35);
  --toast-bg: #0b2a6b;
  --shadow-xs: 0 1px 3px rgba(11, 42, 107, .07);
  --shadow-seg: 0 1px 4px rgba(11, 42, 107, .12);
  --vac-bg: linear-gradient(90deg, #e0f2fe, var(--surface-3));  /* יום חופשה בלוח */

  /* ---- צבעי משמרות (נבחרים לכל סוג משמרת בהגדרות). לפי ה-styleguide:
     בוקר = sky, אמצע = amber, ערב = coral, רדיו = violet, רילז = teal */
  --teal: #0f9488; --teal-soft: #ccfbf1;
  --amber: #d97706; --amber-soft: #fef3c7;
  --coral: #dc5269; --coral-soft: #fee2e2;
  --violet: #6d28d9; --violet-soft: #ede9fe;
  --sky: #2563eb; --sky-soft: #e0f2fe;
  --pink: #db2777; --pink-soft: #fce7f3;
  --slate: #64748b; --slate-soft: #eef2f7;
  --green: #16a34a; --green-soft: #dcfce7;
  --avail: #14b8a6;          /* סימון "זמין" בלוח האילוצים */
  --avail-ink: #0f766e;      /* טקסט וריאנט (דגימות / בוקר קצר) על משבצת זמינה */

  /* ---- לוגו Google Calendar (צבעי המותג) */
  --gcal-blue: #4285f4;
  --gcal-blue-dark: #1967d2;
  --gcal-green: #34a853;
  --gcal-yellow: #fbbc04;
  --gcal-red: #ea4335;
  --gcal-paper: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg-mid) 45%, var(--bg2) 100%) fixed;
  min-height: 100vh;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 28px; height: 28px; }
svg.i.xl { width: 40px; height: 40px; }

/* ---------- כרטיסים וכפתורים ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-weight: 500;
  transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand-gradient); color: var(--on-primary); box-shadow: 0 6px 18px var(--primary-glow); }
.btn.ghost { background: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--primary-tint); }
.btn.white { background: var(--surface); color: var(--ink2); box-shadow: var(--shadow-xs); border: 1px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad-ink); }
.btn.ok { background: var(--ok-soft); color: var(--ok-ink); }
.btn.lg { padding: 14px 20px; font-size: 17px; border-radius: 16px; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; gap: 5px; }
.btn.icon { padding: 8px; border-radius: 12px; }
.btn.block { width: 100%; }
.iconbtn { border: 0; background: transparent; padding: 6px; border-radius: 10px; cursor: pointer; color: var(--ink2); display: inline-flex; }
.iconbtn:hover { background: var(--primary-tint); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; background: var(--primary-soft); color: var(--primary); font-weight: 500; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.bad { background: var(--bad-soft); color: var(--bad-ink); }
.chip.gray { background: var(--neutral-soft); color: var(--ink2); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: var(--on-primary); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }

input[type=text], input[type=password], input[type=number], input[type=email], input[type=tel], input[type=time], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface-2); outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--ring); }
input[type=time], input[type=date], input.time24 { direction: ltr; text-align: right; }
input.time24 { max-width: 110px; font-variant-numeric: tabular-nums; }
table.tbl select { min-width: 112px; }
input[type=number] { direction: ltr; text-align: right; }
textarea { resize: vertical; min-height: 70px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink2); font-weight: 500; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 14px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 11px; cursor: pointer; color: var(--ink2); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-seg); }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--on-primary); font-weight: 600; font-size: 13px; flex: none; box-shadow: 0 0 0 2px var(--surface); }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* ---------- טוסט ומודל ---------- */
#toasts { position: fixed; z-index: 100; inset-inline: 0; bottom: 90px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--toast-bg); color: var(--on-primary); padding: 11px 18px; border-radius: 14px; box-shadow: var(--shadow-l); max-width: min(92vw, 480px); white-space: pre-line; animation: pop .2s ease-out; pointer-events: auto; font-size: 14px; }
.toast.ok { background: var(--ok-ink); }
.toast.bad { background: var(--bad-ink); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-l); width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; animation: pop .18s ease-out; }
.modal.wide { width: min(1100px, 100%); }
.modal-head { padding: 16px 20px 8px; display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 18px; flex: 1; }
.modal-body { padding: 8px 20px 16px; overflow: auto; }
.modal-foot { padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-start; border-top: 1px solid var(--line); flex-wrap: wrap; }
.share-preview { display: block; width: 100%; max-width: 440px; margin: 0 auto; aspect-ratio: 1; border-radius: var(--radius-s); box-shadow: var(--shadow); }
@media (max-width: 640px) {
  .overlay.sheet { align-items: flex-end; padding: 0; }
  .overlay.sheet .modal { border-radius: 24px 24px 0 0; width: 100%; max-height: 88vh; animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(40px); opacity: .4; } }
}

/* ---------- סמלי משמרת ---------- */
.shift-head { border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; position: relative; }
.shift-head .nm { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.shift-head .hr { font-size: 10.5px; color: var(--ink2); direction: ltr; }
.c-teal { --c: var(--teal); --cs: var(--teal-soft); }
.c-amber { --c: var(--amber); --cs: var(--amber-soft); }
.c-coral { --c: var(--coral); --cs: var(--coral-soft); }
.c-violet { --c: var(--violet); --cs: var(--violet-soft); }
.c-sky { --c: var(--sky); --cs: var(--sky-soft); }
.c-pink { --c: var(--pink); --cs: var(--pink-soft); }
.c-slate { --c: var(--slate); --cs: var(--slate-soft); }
.c-green { --c: var(--green); --cs: var(--green-soft); }
.shift-head { background: var(--cs); }
.shift-head svg.i { color: var(--c); width: 26px; height: 26px; }
.shift-ico { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--cs); color: var(--c); flex: none; }

/* ---------- רשת אילוצים (עובד) ---------- */
.cgrid { display: grid; gap: 6px; align-items: stretch; }
.cgrid .dayc { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 2px; }
.cgrid .dayc b { font-size: 16px; }
.cgrid .dayc span { font-size: 11px; color: var(--muted); }
.cgrid .cell { background: var(--surface-2); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.cgrid .cell.tap { cursor: pointer; }
.cgrid .cell.tap:hover { background: var(--surface-3); }
.cgrid .cell.off { background: repeating-linear-gradient(-45deg, var(--stripe-a), var(--stripe-a) 6px, var(--stripe-b) 6px, var(--stripe-b) 12px); color: var(--faint); }
.cgrid .cell.vac { background: var(--sky-soft); color: var(--sky); font-size: 11px; }
.circle { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line2); display: flex; align-items: center; justify-content: center; transition: transform .12s, background .12s; background: var(--surface); }
.cell.yes .circle { background: var(--avail); border-color: var(--avail); color: var(--on-primary); box-shadow: 0 3px 10px var(--ring); }
.cell.yes { background: var(--ok-soft); }
.cell.low { background: var(--warn-soft); }
.cell.low .circle { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.cell.low .circle::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); }
.cell .circle svg.i { width: 17px; height: 17px; stroke-width: 3; }
/* פס עליון במצב "צפייה כעובד" (מנהל) */
.viewas-bar { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--warn-soft); color: var(--warn-ink); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); }

/* כמה עורכים אחרים כבר פתחו את המשמרת (מוצג לפי הגדרת המנהל) */
.others { position: absolute; top: 4px; inset-inline-start: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.others.none { background: var(--bad-soft); color: var(--bad-ink); }
.others.few { background: var(--warn-soft); color: var(--warn-ink); }
.others.ok { background: var(--ok-soft); color: var(--ok-ink); }
.cell .vlabel { font-size: 10.5px; margin-top: 3px; color: var(--avail-ink); font-weight: 600; line-height: 1.1; text-align: center; direction: rtl; }
.cell.low .vlabel { color: var(--warn-ink); }
.cell.pressing .circle { transform: scale(1.18); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink2); }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-inline-end: 4px; }

/* ---------- באנר ---------- */
.hero { border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; overflow: hidden; position: relative; }
.hero h2 { font-size: 19px; }
.hero p { margin: 4px 0 0; color: var(--ink2); font-size: 13.5px; line-height: 1.45; }
.bignum { font-size: 40px; font-weight: 700; color: var(--teal); line-height: 1; }

/* ---------- ממשק עובד ---------- */
.eapp { max-width: 560px; margin: 0 auto; padding: 12px 14px 100px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 2px 12px; }
.topbar h1 { font-size: 19px; flex: 1; }
.weeknav { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.weeknav .lbl { font-weight: 600; min-width: 170px; text-align: center; direction: ltr; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; background: var(--glass); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 30; }
.tabbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); cursor: pointer; padding: 4px 12px; border-radius: 12px; position: relative; }
.tabbar button.on { color: var(--primary); }
.tabbar button.on svg.i { stroke-width: 2.4; }
.tabbar .badge { position: absolute; top: 0; inset-inline-end: 6px; }
.actions-bar { display: flex; gap: 10px; margin-top: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat b { font-size: 20px; color: var(--primary); }
.stat span { font-size: 12px; color: var(--ink2); }
.shift-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.shift-item + .shift-item { margin-top: 8px; }
.shift-item .day { width: 42px; text-align: center; flex: none; }
.shift-item .day b { display: block; font-size: 16px; }
.shift-item .day span { font-size: 11.5px; color: var(--muted); }
.shift-item.vac { background: var(--vac-bg); }
.shift-item.off { opacity: .55; box-shadow: none; background: var(--glass); }
.limits { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }

/* לוח שנה */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px 0; }
.cal-grid .dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; cursor: pointer; font-size: 14px; }
.cal-day .n { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.cal-day.past { color: var(--faint); cursor: default; }
.cal-day.today .n { box-shadow: inset 0 0 0 2px var(--primary-2); }
.cal-day.inrange::before { content: ''; position: absolute; inset: 4px 0; background: var(--teal-soft); }
.cal-day.edge .n { background: var(--teal); color: var(--on-primary); font-weight: 600; }
.cal-day.rs::before { inset-inline-start: 50%; }
.cal-day.re::before { inset-inline-end: 50%; }
.cal-day.conflict .n { background: var(--bad-soft); color: var(--bad-ink); }
.cal-day.mine .n { background: var(--violet-soft); color: var(--violet); font-weight: 600; }
.cal-day.minepending .n { background: var(--warn-soft); color: var(--warn-ink); }
.cal-day.blackout .n { text-decoration: line-through; color: var(--faint); }
.cal-day .dots { position: absolute; bottom: 1px; display: flex; gap: 2px; z-index: 2; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.vac-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vac-item:last-child { border-bottom: 0; }
.status { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 500; }
.status.pending { background: var(--warn-soft); color: var(--warn-ink); }
.status.approved { background: var(--ok-soft); color: var(--ok-ink); }
.status.rejected { background: var(--bad-soft); color: var(--bad-ink); }
.status.cancelled { background: var(--neutral-soft); color: var(--muted); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.notice { border-radius: 14px; padding: 10px 12px; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: var(--warn-ink); }
.notice.bad { background: var(--bad-soft); color: var(--bad-ink); }
.notice.ok { background: var(--ok-soft); color: var(--ok-ink); }
.notice.info { background: var(--primary-soft); color: var(--primary); }

/* מסך כניסה */
.login { max-width: 420px; margin: 8vh auto; padding: 16px; }
.login .logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.logo-mark { width: 44px; height: 44px; border-radius: 14px; background: var(--logo-gradient); color: var(--on-primary); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px var(--primary-glow); }
.card-title.center-title { justify-content: center; }
.user-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.user-pick button { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; }
.user-pick button:hover { border-color: var(--primary-2); }

/* דסקטופ — ממשק עובד */
@media (min-width: 900px) {
  .eapp { max-width: 1060px; padding-top: 18px; }
  .eapp.wide-grid .two { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
  .tabbar { position: sticky; top: 0; bottom: auto; justify-content: center; gap: 6px; border: 0; background: var(--glass); border-radius: 18px; box-shadow: var(--shadow); margin: 0 auto 14px; max-width: 1060px; padding: 6px; }
  .tabbar button { flex-direction: row; font-size: 14px; gap: 8px; padding: 8px 18px; }
  .tabbar button.on { background: var(--primary-soft); }
  #toasts { bottom: 30px; }
  .cgrid .cell { min-height: 60px; }
}

/* ---------- ממשק מנהל ---------- */
.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--glass); backdrop-filter: blur(10px); border-inline-end: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side .brand b { font-size: 16px; }
.side .brand small { display: block; color: var(--muted); font-size: 11.5px; }
.nav-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--ink2); font-weight: 500; text-align: start; width: 100%; }
.nav-btn:hover { background: var(--primary-tint); }
.nav-btn.on { background: var(--primary-soft); color: var(--primary); }
.nav-btn .badge { margin-inline-start: auto; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.main { padding: 18px 22px 40px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { font-size: 22px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mobile-top { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 40; transform: translateX(110%); transition: transform .2s; background: var(--surface); box-shadow: var(--shadow-l); }
  .side.open { transform: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; position: sticky; top: 0; background: var(--glass); backdrop-filter: blur(8px); z-index: 20; }
  .main { padding: 12px; }
  .page-head > h2 { display: none; }  /* שם העמוד כבר מופיע בסרגל העליון */
}

/* לוח שיבוץ */
.sched-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .sched-wrap { grid-template-columns: 1fr; } }
.sched-scroll { overflow-x: auto; border-radius: var(--radius); }
.sched { display: grid; gap: 6px; min-width: 640px; }
.sched .corner { display: flex; align-items: end; justify-content: center; padding-bottom: 6px; }
.sched .shift-head { cursor: pointer; padding: 10px 4px 8px; }
.sched .shift-head:hover { outline: 2px solid var(--c); }
.sched .shift-head .need { position: absolute; top: 5px; inset-inline-start: 7px; font-size: 10.5px; color: var(--ink2); }
.sched .dayh { background: var(--surface); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 2px; box-shadow: var(--shadow); }
.sched .dayh b { font-size: 17px; }
.sched .dayh span { font-size: 11.5px; color: var(--muted); }
.sched .dayh.weekend { background: var(--surface-2); }
.scell { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-height: 76px; display: flex; flex-direction: column; gap: 4px; position: relative; transition: box-shadow .12s, background .12s; }
.scell.off { background: repeating-linear-gradient(-45deg, var(--stripe-a), var(--stripe-a) 6px, var(--stripe-b) 6px, var(--stripe-b) 12px); box-shadow: none; }
.scell.closed { background: var(--neutral-soft); box-shadow: none; }
.scell.short { box-shadow: inset 0 0 0 2px var(--bad-soft), var(--shadow); }
.scell.full { box-shadow: inset 0 0 0 2px var(--ok-soft), var(--shadow); }
.scell.drop-yes { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); }
.scell.drop-low { background: var(--warn-soft); box-shadow: inset 0 0 0 2px var(--warn); }
.scell.drop-no { opacity: .45; }
.scell.drop-hover { transform: scale(1.02); }
.scell .meta { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.scell .meta .hrs { direction: ltr; background: var(--cs); color: var(--ink2); padding: 1px 6px; border-radius: 6px; }
.scell .note { font-size: 11px; background: var(--note-bg); color: var(--note-ink); border-radius: 8px; padding: 3px 6px; line-height: 1.3; }
.scell .addb { position: absolute; bottom: 5px; inset-inline-start: 5px; opacity: 0; transition: opacity .15s; }
.scell:hover .addb { opacity: 1; }
.pchip { display: flex; align-items: center; gap: 5px; background: var(--surface-3); border-radius: 10px; padding: 3px 5px 3px 4px; font-size: 12.5px; cursor: grab; position: relative; border: 1px solid transparent; }
.pchip:hover { border-color: var(--line2); }
.pchip .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pchip .sub { font-size: 10px; color: var(--ink2); direction: ltr; }
.pchip .x { opacity: 0; border: 0; background: transparent; cursor: pointer; padding: 0 2px; color: var(--muted); line-height: 1; }
.pchip:hover .x { opacity: 1; }
.pchip.low { background: var(--warn-soft); }
.pchip.warn { background: var(--bad-soft); }
.pchip.manual { background: var(--slate-soft); }
.pchip.guest { background: var(--violet-soft); }
.pchip .flag { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; }
.cands { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; padding-top: 3px; border-top: 1px dashed var(--line2); }
.cand { font-size: 10.5px; padding: 2px 6px; border-radius: 7px; cursor: pointer; border: 0; background: var(--ok-soft); color: var(--ok-ink); }
.cand.low { background: var(--warn-soft); color: var(--warn-ink); }
.cand.busy { background: var(--neutral-soft); color: var(--disabled-ink); text-decoration: line-through; }
.cand:hover { filter: brightness(.95); }

.roster { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.remp { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 12px; cursor: grab; user-select: none; }
.remp:hover { background: var(--surface-3); }
.remp .nmw { flex: 1; min-width: 0; }
.remp .rnote { font-size: 11px; line-height: 1.3; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.remp .rnote svg.i { width: 11px; height: 11px; margin-inline-end: 3px; color: var(--muted); }
.remp .rnote.fixed { color: var(--muted); }
.remp .nm { display: block; flex: 1; font-size: 13.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remp .cnt { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 8px; background: var(--neutral-soft); color: var(--ink2); direction: ltr; }
.remp .cnt.ok { background: var(--ok-soft); color: var(--ok-ink); }
.remp .cnt.over { background: var(--bad-soft); color: var(--bad-ink); }
.remp .cnt.under { background: var(--warn-soft); color: var(--warn-ink); }
.remp.sel { background: var(--primary-soft); }
.sub-h { font-size: 12px; color: var(--muted); font-weight: 600; margin: 12px 4px 4px; }
.report { font-size: 13px; }
.report li { margin: 3px 0; }

/* טבלאות */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.tbl th { text-align: start; font-weight: 600; color: var(--ink2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:hover td { background: var(--surface-2); }
.tbl-wrap { overflow: auto; }

/* מפת חום אילוצים */
.heat { display: grid; gap: 5px; min-width: 560px; }
.hcell { border-radius: 12px; padding: 6px; min-height: 58px; font-size: 11.5px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; }
.hcell .num { font-weight: 700; font-size: 15px; }
.hcell.off { background: var(--neutral-soft); box-shadow: none; }
.hcell .names { color: var(--ink2); line-height: 1.35; }
.hcell .names .l { color: var(--warn-ink); }

/* גאנט חופשות */
.gantt { display: grid; font-size: 12px; min-width: 760px; }
.gantt .gh { text-align: center; padding: 4px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.gantt .gh.we { background: var(--surface-2); }
.gantt .gh.td { color: var(--primary); font-weight: 700; }
.gantt .gn { padding: 6px 8px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.gantt .gc { border-bottom: 1px solid var(--line); position: relative; height: 34px; }
.gantt .gc.we { background: var(--surface-2); }
.gantt .bar { position: absolute; inset-block: 7px; inset-inline: 1px; border-radius: 0; }
.gantt .bar.s { border-start-start-radius: 8px; border-end-start-radius: 8px; inset-inline-start: 3px; }
.gantt .bar.e { border-start-end-radius: 8px; border-end-end-radius: 8px; inset-inline-end: 3px; }
.gantt .bar.pending { background: repeating-linear-gradient(-45deg, var(--warn), var(--warn) 4px, var(--warn-mid) 4px, var(--warn-mid) 8px) !important; }
.gantt .bar.conflict { box-shadow: 0 0 0 2px var(--bad); }

.req-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.req-card + .req-card { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.copybox { display: flex; gap: 6px; }
.copybox input { direction: ltr; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* הדפסה */
@media print {
  .side, .mobile-top, .roster, .toolbar, .addb, .cands, .x, .no-print, .tabbar { display: none !important; }
  .admin { display: block; }
  body { background: var(--surface); }
  .scell, .dayh { box-shadow: none !important; border: 1px solid var(--line2); }
  .sched-wrap { display: block; }
  .main { padding: 0; }
}
div.ltr { display: block; text-align: right; }

/* ---------- שיבוץ: ימים בעמודות, משמרות בשורות ---------- */
.sched .dayh.top { box-shadow: var(--shadow); padding: 8px 2px; }
.sched .rowh { cursor: pointer; justify-content: center; padding: 8px 4px; }
.sched .rowh .nm { font-size: 14px; }
.sched .rowh .t { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sched .rowh.ro { cursor: default; }
.sched .rowh.ro:hover { outline: 0; }

/* ---------- המשמרות שלי: מיקום לאורך שורת היום ---------- */
.mytrack-head, .mytrack { display: grid; gap: 6px; align-items: stretch; }
.mytrack-head { margin: 4px 0 6px; }
.mytrack-head .sh { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; color: var(--ink2); font-weight: 600; }
.mytrack-head .sh svg.i { width: 15px; height: 15px; color: var(--c); }
.mytrack { margin-bottom: 7px; }
.mytrack .day { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 0; }
.mytrack .day b { font-size: 15px; }
.mytrack .day span { font-size: 11px; color: var(--muted); }
.mytrack .slot { border-radius: 14px; border: 1.5px dashed var(--line2); min-height: 64px; }
.mytrack .shiftcard { border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); padding: 7px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; cursor: pointer; border: 0; border-top: 4px solid var(--c); min-height: 64px; }
.mytrack .shiftcard svg.i { color: var(--c); width: 20px; height: 20px; }
.mytrack .shiftcard b { font-size: 13px; }
.mytrack .shiftcard .hr { font-size: 11px; color: var(--ink2); direction: ltr; }
.mytrack .shiftcard .nt { font-size: 10.5px; color: var(--note-ink); }
.mytrack .vacbar { border-radius: 14px; background: var(--vac-bg); display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--violet); font-weight: 600; min-height: 64px; }
.mytrack.off .slot { opacity: .55; }
.pchip { flex-wrap: wrap; }
.pchip .sub { flex-basis: 100%; padding-inline-start: 29px; margin-top: -2px; }
.sched .rowh .hr { white-space: nowrap; }
@media (max-width: 640px) {
  .sched .rowh { padding: 6px 2px; }
}
/* תוכן רחב (טבלאות) נגלל בתוך הכרטיס ולא מרחיב את העמוד במובייל */
.grid2 > *, .sched-wrap > *, .card { min-width: 0; }
.tbl-wrap { max-width: 100%; }
.side-backdrop { display: none; }
@media (max-width: 900px) {
  .side-backdrop.open { display: block; position: fixed; inset: 0; z-index: 39; background: var(--overlay); }
}
/* איורים: אימוג'י זמני או קובץ תמונה (ראו ILLUSTRATIONS ב-common.js) */
.art img { width: 72px; height: 72px; object-fit: contain; display: block; }
.empty .art { font-size: 44px; margin-bottom: 6px; filter: none; }

/* ---------- styleguide: אייקונים דו-גוניים, באנרים מאוירים ואווטרים ---------- */
svg.i .d { fill: currentColor; fill-opacity: .16; }
.shift-head svg.i .d, .shift-ico svg.i .d, .mytrack svg.i .d { fill-opacity: .22; }
.tabbar svg.i .d, .nav-btn svg.i .d { fill: var(--icon-fill); fill-opacity: .55; }
.tabbar button.on svg.i .d, .nav-btn.on svg.i .d { fill-opacity: 1; }
.tabbar button svg.i { width: 24px; height: 24px; }
.tabbar button.on { color: var(--primary); font-weight: 600; }
@media (max-width: 899px) {
  .tabbar button { padding: 4px 14px; }
  .tabbar button.on svg.i { background: var(--primary-soft); border-radius: 10px; box-sizing: content-box; padding: 3px 12px; margin-block: -3px; }
}

/* באנר: האיור בצד שמאל, הטקסט (HTML אמיתי) בצד ימין. התמונה לא נמתחת (cover) ומעוגנת לשמאל;
   במסכים רחבים נחתך מעט מלמעלה ומלמטה */
.hero.banner {
  display: block; width: 100%; aspect-ratio: 724 / 233; max-height: 240px;  /* בלי min-height: הגובה גדל עם הטקסט ולא חותך אותו */
  padding: 18px 20px; padding-inline-end: 46%;
  background-repeat: no-repeat; background-size: 100% 100%, cover; background-position: center, left 62%;
  color: var(--banner-ink);
}
.hero.banner.constraints { background-image: var(--banner-scrim), var(--banner-constraints); }
.hero.banner.vacations { background-image: var(--banner-scrim), var(--banner-vacations); }
.hero.banner h2 { font-size: 21px; font-weight: 700; color: var(--banner-ink); }
.hero.banner p { color: var(--banner-ink); font-size: 14px; }
.hero-note { font-size: 13px; color: var(--ink2); line-height: 1.5; margin: 10px 4px 0; }
@media (max-width: 380px) {
  .hero.banner { padding: 14px; padding-inline-end: 42%; }
  .hero.banner h2 { font-size: 18px; }
  .hero.banner p { font-size: 13px; }
}

.avatar.img { background: var(--surface-3) !important; overflow: hidden; padding: 0; }
.avatar.img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.logo-mark.app-icon { background: none; box-shadow: 0 8px 20px var(--primary-glow); overflow: hidden; }
.logo-mark.app-icon img { width: 100%; height: 100%; display: block; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.avatar-pick button { border: 2px solid transparent; background: var(--surface-2); border-radius: 50%; padding: 2px; cursor: pointer; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.avatar-pick button img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-pick button.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.avatar-pick button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- שבת שעברה (מעל לוח השיבוץ) */
.prevsat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 9px 14px; border-radius: var(--radius-s); background: var(--surface-3); border: 1px solid var(--line); font-size: 13px; color: var(--ink2); }
.prevsat b { color: var(--ink); }
.prevsat .psn { font-weight: 600; color: var(--ink); }
.cand.prevsat-c { box-shadow: inset 0 0 0 1.5px var(--violet); }

/* ---- פעמון התראות למנהל */
.iconbtn.bell { position: relative; }
.iconbtn.bell .badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 16px; height: 16px; font-size: 10px; }

/* ---- בחירת סוג משמרת בחלון השיבוץ */
.seg.wrap { flex-wrap: wrap; }

/* ---- מגבלת משמרת סופ"ש בהגדרות */
.capbox { padding: 12px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }
.capbox p { margin-bottom: 0; }

/* ---- "x עורכים פתחו" מתחת לעיגול בלוח האילוצים */
.cell .opened { font-size: 10px; line-height: 1.15; margin-top: 3px; font-weight: 600; text-align: center; padding: 1px 5px; border-radius: 7px; }
.cell .opened.none { color: var(--bad-ink); background: var(--bad-soft); }
.cell .opened.few { color: var(--warn-ink); background: var(--warn-soft); }
.cell .opened.ok { color: var(--ok-ink); background: var(--ok-soft); }
.hero-note.how { margin: 12px 2px 0; }
.taphelp { margin: 0; padding-inline-start: 18px; line-height: 1.7; }

/* ---- לוגו Google Calendar */
svg.i .gc { stroke: none; }
svg.i .gc-blue { fill: var(--gcal-blue); }
svg.i .gc-blue2 { fill: var(--gcal-blue-dark); }
svg.i .gc-green { fill: var(--gcal-green); }
svg.i .gc-yellow { fill: var(--gcal-yellow); }
svg.i .gc-red { fill: var(--gcal-red); }
svg.i .gc-paper { fill: var(--gcal-paper); }
svg.i text.gc { fill: var(--gcal-blue); font: 700 7.4px/1 var(--font-body); }
