/* HEARTBEAT — GTSM look, matched to better-half-clone: light-mode default (warm cream/white),
   dark-mode toggle, accent #ed2426, PP Neue numbers, WorkModeBadge, cardIn entrance */

@font-face { font-family:'Blender Pro'; src:url('fonts/Blender-Light.9c99116393b8b3f17916f1f3b6d06998.woff2') format('woff2'); font-weight:300; font-display:swap; }
@font-face { font-family:'Blender Pro'; src:url('fonts/Blender-Regular.8230a21a71ee7cdaab4e6d8fd8b4c472.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Blender Pro'; src:url('fonts/Blender-Bold.69fde62d77c995aab90d8568925986ba.woff2') format('woff2'); font-weight:700; font-display:swap; }
@font-face { font-family:'Blender Pro'; src:url('fonts/Blender-Black.129d546a19a68c88a5aa0a4d68465d4b.woff2') format('woff2'); font-weight:900; font-display:swap; }
@font-face { font-family:'PP Neue Montreal'; src:url('fonts/PPNeueMontrealTT-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'PP Neue Montreal'; src:url('fonts/PPNeueMontrealTT-Medium.woff2') format('woff2'); font-weight:500; font-display:swap; }

/* טוקנים לפי הפלטה הרשמית של GTSM (2026 refresh, ראה /gtsm-design):
   Signal Red #ED213A, Volt Blue #2D5BFF, Cyan Spark #15E0C0, Signal Yellow
   #FFD23F, Bone #F0EEE9 (light), Ink #15110F (dark). LIGHT הוא ברירת המחדל
   של הכלי הזה — הפוך ע"י .dark-mode. */
:root {
  --accent: #ED213A;  /* Signal Red */
  --blue: #2D5BFF;    /* Volt Blue */
  --cyan: #15E0C0;    /* Cyan Spark */
  --yellow: #FFD23F;  /* Signal Yellow — bg/chips only, too light for text on Bone */
  --yellow-ink: #8a6a1a; /* Signal Yellow, darkened for legible text on light bg */
  --black: #1C1C1C;
  --warm-white: #F0EEE9;
  --gold: #B8832E; /* legacy — vat-tag/etc use --yellow instead */

  --bg: #F0EEE9;      /* Bone */
  --bg-card: #ffffff;
  --bg-card-2: #E8E4DA;
  --topbar-bg: rgba(240,238,233,.85);
  --border: #d9d4c9;
  --text: #15110F;    /* Ink */
  --text-2: #6b645c;
  --text-3: #a39d92;
  --green: #16A34A;
  --amber: #F59E0B;

  /* Flat design אמיתי — לפי דרישה מפורשת. פינות 0, בלי צללים, בלי מסגרות
     על קלפים — ההבחנה קלף/רקע רק דרך ניגוד bg-card מול bg. */
  --radius: 0;
  --radius-sm: 0;
  --radius-lg: 0;
  --shadow: none;
  --shadow-sm: none;
  --shadow-card: none;
}

html.dark-mode, body.dark-mode {
  --gold: #C9954A;
  --yellow-ink: #FFD23F; /* bright Signal Yellow reads fine directly on Ink */
  --bg: #15110F;      /* Ink */
  --bg-card: #1E1A16;
  --bg-card-2: #262019;
  --topbar-bg: rgba(21,17,15,.85);
  --border: #332C24;
  --text: #F0EEE9;    /* Bone */
  --text-2: #948C80;
  --text-3: #5c564c;
  --green: #22C55E;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Blender Pro', 'Rubik', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* מעברי צבע חלקים בהחלפת theme (כמו באתר הראשי) */
body, body * { transition: background-color .45s ease, border-color .45s ease, color .3s ease; }
body *, body *::before, body *::after {
  transition-property: background-color, border-color, color;
  transition-duration: .45s, .45s, .3s;
  transition-timing-function: ease;
}
.pp { font-family: 'PP Neue Montreal', 'Blender Pro', sans-serif; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-sm); }

/* ---- Animations ---- */
@keyframes cardIn { from { opacity:0; transform: translateY(28px) scale(.98);} to { opacity:1; transform: translateY(0) scale(1);} }
.card-in { animation: cardIn .35s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes fadeUp { from { opacity:0; transform: translateY(8px);} to { opacity:1; transform: translateY(0);} }
.fade-up { animation: fadeUp .3s ease both; }
@keyframes slideUp { from { opacity:0; transform: translateY(16px) scale(.98);} to { opacity:1; transform: translateY(0) scale(1);} }
.slide-up { animation: slideUp .25s ease both; }
@keyframes countPulse { 0%{transform:scale(1); color:var(--accent);} 40%{transform:scale(1.08);} 100%{transform:scale(1);} }
.count-pulse { animation: countPulse .5s ease; }
@keyframes wm-blink { 0%,49%,100%{opacity:1;} 50%,99%{opacity:.2;} }
@keyframes pulseRing { 0%{box-shadow:0 0 0 0 rgba(237,33,58,.5);} 100%{box-shadow:0 0 0 22px rgba(237,33,58,0);} }

/* ---- Layout shells ---- */
.auth-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 28px;
  position: relative;
  overflow: hidden; /* בלי גלילה בכלל — כמו .hero-fullscreen ב-better-half-clone */
  background: var(--bg);
}

/* שעון חי מעל הוידאו — "The pulse of your workday" מוצג פשוטו כמשמעו.
   צבע קבוע (לא לפי theme) כי הוא תמיד יושב מעל ה-scrim הכהה של הוידאו. */
.hero-clock { position: relative; z-index: 2; text-align: center; }
.hero-clock-time {
  font-weight: 500; font-size: clamp(2.6rem, 9vw, 4.5rem);
  color: #F0EEE9; letter-spacing: .02em; line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 28px rgba(0,0,0,.5);
  /* H/:/M/:/S הם spans נפרדים בלי טקסט עברי שיעגן כיוון — בלי זה, בדף RTL
     הם מוצגים בסדר הפוך (שניות→דקות→שעות) */
  direction: ltr; unicode-bidi: isolate;
}
.hc-colon { color: var(--accent); display: inline-block; margin: 0 1px; animation: wm-blink 1.8s infinite; }
.hero-clock-date {
  margin-top: 10px; font-size: 11px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(240,238,233,.65);
}

/* וידאו רקע במסך הכניסה (hero.mp4) — אותו דפוס בדיוק כמו .hero-video
   ב-better-half-clone: absolute, ממורכז, object-fit cover */
.hero-video {
  position: absolute; top: 50%; left: 50%;
  min-width: 100%; min-height: 100%; width: auto; height: auto;
  transform: translate(-50%, -50%);
  z-index: 0; object-fit: cover;
}
/* כהה תמיד, גם ב-light mode — וידאו רקע צריך scrim כהה כדי להישאר קריא
   ועדיין נראה (Bone שקוף שם "מסך לבן" מעל הסרטון וטשטש אותו) */
.video-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 20% 10%, rgba(237,33,58,.18), transparent 45%),
              rgba(0,0,0,.5);
}
/* אותיות GTSM ענקיות בקושי נראות ברקע — כמו .hero-letters ב-better-half-clone */
.hero-letters { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.hero-letter {
  position: absolute; font-family: 'PP Neue Montreal', sans-serif; font-weight: 400;
  font-size: 32vw; line-height: .82; color: #ffffff; opacity: .035;
  letter-spacing: -.04em; user-select: none;
}
.hero-letter--g { top: -10%; left: -2%; }
.hero-letter--t { top: 6%; right: -5%; }
.hero-letter--s { bottom: -14%; left: 16%; }
.hero-letter--m { bottom: -10%; right: -7%; }
@media (max-width: 700px) { .hero-letters { display: none; } }

.auth-card { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
.app-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }

/* אותיות GTSM ברקע גם בעמודי העבודה (עובד/מנהל) — קבוע מאחורי כל התוכן,
   תלוי-theme (לא לבן קבוע כמו בהירו של הכניסה, כי אין כאן scrim כהה) */
.bg-letters { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-letters .hero-letter { color: var(--text); opacity: .03; }
@media (max-width: 700px) { .bg-letters { display: none; } }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { height: 26px; }
.topbar-title { font-weight: 900; font-size: 16px; letter-spacing: .02em; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { font-size: 13px; color: var(--text-2); }
.topbar-user b { color: var(--text); font-weight: 700; }

.work-mode-badge { display:flex; align-items:center; gap:6px; }
.work-mode-dot { width:6px; height:6px; border-radius:50%; background:var(--accent); display:inline-block; flex-shrink:0; animation: wm-blink 1.8s infinite; }
.work-mode-label { font-family:'PP Neue Montreal',sans-serif; font-size:9px; font-weight:500; letter-spacing:.16em; text-transform:uppercase; color:var(--text-2); white-space:nowrap; }

/* לוגו כפול (בהיר/כהה) — מוחלף לפי theme, כמו באתר הראשי.
   ספציפיות img.logo-* > .auth-logo/.topbar-logo כדי לנצח בלי תלות בסדר בקובץ */
img.logo-dark { display: none; }
html.dark-mode img.logo-light { display: none; }
html.dark-mode img.logo-dark { display: block; }

/* שעון חי בטופבר — כמו .header-time באתר הראשי, בלי geolocation */
.header-clock {
  font-family: 'Blender Pro', 'Rubik', sans-serif; font-size: 12.5px;
  letter-spacing: .02em; color: var(--text-2); font-variant-numeric: tabular-nums;
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.header-clock .hc-sep { opacity: .4; }

/* Theme toggle — שמש/ירח, זהה לוגית לאתר הראשי */
.theme-toggle-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .15s ease;
}
.theme-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle-btn svg { width: 16px; height: 16px; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.btn-ghost:hover { border-color: var(--text-2); color: var(--text); }

.main {
  flex: 1; max-width: 980px; width: 100%; margin: 0 auto; padding: 28px 20px 0;
  display: flex; flex-direction: column;
}
.main > .app-footer { margin-top: auto; padding-top: 40px; }

/* ---- Auth card ---- */
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}
.auth-logo { height: 34px; display: block; margin: 0 auto 22px; }
.auth-logo-gif { height: 64px; width: auto; display: block; margin: 0 auto 22px; filter: invert(1) hue-rotate(180deg); }
html.dark-mode .auth-logo-gif { filter: none; }
.auth-title { font-size: 26px; font-weight: 900; text-align: center; margin: 0 0 4px; }
.auth-sub { font-size: 13px; color: var(--text-2); text-align: center; margin: 0 0 28px; }

/* ---- Form controls ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; outline: none;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
/* כל textarea באפליקציה היא שדה הערות — עיצוב ייחודי כדי שיהיה ברור
   שזה שדה פתוח לכתיבה חופשית, לא עוד input רגיל */
.field textarea {
  resize: vertical; min-height: 64px;
  border-right: 3px solid var(--yellow-ink);
  background: linear-gradient(to left, rgba(255,210,63,.08), transparent 60px), var(--bg-card-2);
}
.note-label { display: flex; align-items: center; gap: 5px; }
.note-label svg { width: 13px; height: 13px; color: var(--yellow-ink); flex-shrink: 0; }

/* כפתור עין להצגת/הסתרת סיסמה */
.password-wrap { position: relative; }
.password-wrap input { padding-left: 42px; }
.password-toggle {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--text-2);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); transition: color .15s ease;
}
.password-toggle:hover { color: var(--accent); }
.password-toggle svg { width: 18px; height: 18px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.btn {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 13px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn-outline:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { width: auto; padding: 8px 16px; font-size: 13px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: #fff; }

.error-msg { color: var(--accent); font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* ---- Clock ---- */
/* שתי קוביות מקבילות — "עובד עכשיו?" (טיימר) מול "כבר עבדת?" (הוספה ידנית) */
.action-tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px;
}
.action-tile {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 28px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.action-tile-head { margin-bottom: 18px; }
.action-tile-title { font-size: 17px; font-weight: 800; }
.action-tile-sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.action-tile-icon { color: var(--text-3); margin-bottom: 16px; }
.action-tile-icon svg { width: 34px; height: 34px; }
@media (max-width: 700px) {
  .action-tiles { grid-template-columns: 1fr; }
}
.clock-status { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.clock-timer {
  font-family: 'PP Neue Montreal', sans-serif; font-weight: 500; font-size: 3rem;
  color: var(--text); letter-spacing: .02em; margin: 4px 0 22px; font-variant-numeric: tabular-nums;
}
.clock-btn {
  width: 148px; height: 148px; border-radius: 50%; border: none; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  background: var(--accent); color: #fff; font-weight: 900; font-size: 16px;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, filter .15s ease;
}
.clock-btn:hover { filter: brightness(1.08); }
.clock-btn:active { transform: scale(.96); }
.clock-btn.running { background: var(--bg-card-2); border: 2px solid var(--accent); color: var(--accent); animation: pulseRing 2s infinite; }
.clock-btn svg { width: 30px; height: 30px; }

/* ---- KPI row ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow-card);
}
.kpi-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 8px; }
.kpi-value { font-family: 'PP Neue Montreal', sans-serif; font-size: 2rem; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-value.accent { color: var(--accent); }
.kpi-value.blue { color: var(--blue); }
.kpi-value.yellow { color: var(--yellow-ink); }
.kpi-value.gold { color: var(--gold); }
.kpi-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ---- Section ---- */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 700; }
.section-title .count { color: var(--text-2); font-weight: 400; margin-right: 4px; }

/* ---- Entry list ---- */
.entry-list { display: flex; flex-direction: column; gap: 8px; }
.entry-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
}
.entry-time { font-family: 'PP Neue Montreal', sans-serif; font-size: 14px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.entry-time .sep { color: var(--text-3); margin: 0 4px; }
.entry-dur { font-size: 12px; color: var(--text-2); background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 3px 10px; white-space: nowrap; }
.entry-note { flex: 1; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: all .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-2); }
.icon-btn.danger:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.active { color: var(--accent); border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn:disabled:hover { color: var(--text-2); border-color: var(--border); }
.icon-btn svg { width: 15px; height: 15px; }
.badge-running { color: var(--green); font-size: 11px; font-weight: 700; }

/* ניווט בין חודשים בהיסטוריה */
.hist-month-nav {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-bottom: 14px;
}
.hist-month-nav .icon-btn { font-size: 18px; font-weight: 700; }
.hist-month-label { font-size: 15px; font-weight: 700; min-width: 130px; text-align: center; }

.empty-state { text-align: center; color: var(--text-3); font-size: 13px; padding: 30px 0; }

/* אזהרת משמרת תקועה — לא נסגרה מיום קודם */
.stuck-shift-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(237,33,58,.1); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px;
}
.stuck-shift-title { font-weight: 800; font-size: 14px; color: var(--accent); }
.stuck-shift-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* תלוש חודשי — סטטוס תשלום + פירוט מע"מ, לחודש הנצפה בהיסטוריה */
.payslip-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; text-align: center;
}
.payslip-status {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--text-2);
  background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 6px 18px;
}
.payslip-status.paid {
  font-size: 22px; font-weight: 900; color: var(--accent); background: rgba(237,33,58,.1);
  padding: 10px 28px; letter-spacing: .04em;
}

/* פוטר אחיד — לב, ציטוט השראה, חותמת מותג. פס מפריד אחד, לא כמה חתיכות */
.app-footer {
  text-align: center; padding: 28px 20px 22px; margin-top: 12px;
  border-top: 1px solid var(--border);
}
.footer-heart { width: 18px; height: 18px; margin: 0 auto 16px; color: var(--accent); }
.footer-heart svg { width: 100%; height: 100%; display: block; }
.quote-text {
  font-size: 13px; color: var(--text-2); font-style: italic; line-height: 1.6;
  max-width: 440px; margin: 0 auto;
}
.quote-author {
  font-size: 11px; color: var(--text-3); font-weight: 700; margin-top: 8px;
  letter-spacing: .04em;
}

/* חותמת "Part of Sagigi Holdings Co." — כמו באתר הראשי */
.brand-stamp {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); text-align: center; direction: ltr; unicode-bidi: isolate;
  margin-top: 16px;
}

/* ---- Notes ---- */
.notes-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 20px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 13px; z-index: 100;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--accent); }

/* ---- Feedback bubble (pop-in/out, on clock-in / clock-out) — גדול ומחזיק
   מספיק זמן שאי אפשר לפספס אותו */
.feedback-bubble {
  position: fixed; top: 90px; left: 50%; transform: translateX(-50%) scale(0);
  background: var(--accent); color: #fff; padding: 14px 28px; border-radius: var(--radius-sm);
  font-weight: 800; font-size: 16px; box-shadow: var(--shadow); z-index: 150;
  white-space: nowrap; animation: bubblePop 2.6s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes bubblePop {
  0%   { transform: translateX(-50%) scale(0); opacity: 0; }
  12%  { transform: translateX(-50%) scale(1.15); opacity: 1; }
  20%  { transform: translateX(-50%) scale(1); opacity: 1; }
  88%  { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(.85) translateY(-10px); opacity: 0; }
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px;
}
.modal-lg { max-width: 560px; }
.modal-title { font-size: 17px; font-weight: 800; margin: 0 0 18px; }

/* מתג מצב הזנה — שעת סיום / משך זמן */
.entry-mode-toggle {
  display: flex; gap: 6px; background: var(--bg-card-2); border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 16px;
}
.mode-btn {
  flex: 1; background: transparent; border: none; color: var(--text-2);
  padding: 7px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  transition: all .15s ease;
}
.mode-btn.active { background: var(--accent); color: #fff; }

.duration-preview {
  font-family: 'PP Neue Montreal', sans-serif; font-size: 13px; color: var(--text-2);
  text-align: center; margin: -6px 0 16px; min-height: 18px;
}
.duration-preview .num { color: var(--accent); font-weight: 700; }
.duration-preview.warn { color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn, .modal-actions .btn-outline { flex: 1; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-btn {
  background: transparent; border: none; color: var(--text-2); padding: 10px 4px; margin-left: 18px;
  font-size: 14px; font-weight: 700; border-bottom: 2px solid transparent; transition: all .15s ease;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---- Employees table (admin) ---- */
.emp-table { width: 100%; border-collapse: collapse; }
.emp-table th {
  text-align: right; font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.emp-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.emp-table tr:last-child td { border-bottom: none; }
.emp-name { font-weight: 700; }
.emp-username { color: var(--text-2); font-size: 12px; }
.pay-note { font-size: 11px; margin-top: 3px; color: var(--amber); font-weight: 600; }
.pay-note.paid { color: var(--green); font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.active { background: var(--green); }
.status-dot.inactive { background: var(--text-3); }
.vat-tag { font-size: 11px; color: var(--yellow-ink); background: rgba(255,210,63,.18); padding: 2px 8px; border-radius: var(--radius-sm); }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-pad { padding: 18px; }
.table-scroll { overflow-x: auto; }
/* עמודת/עמודות הפעולות (עריכה/מחיקה/צפייה) - בתצוגת RTL עם overflow-x, הן העמודות שבברירת מחדל
   נחתכות משמאל (מחוץ לתחום הגלילה ההתחלתי). מצמידים אותן לקצה הנראה כדי שלא ייחתכו. */
.sticky-action { position: sticky; left: 0; background: var(--bg-card); z-index: 1; }
.sticky-action-2 { left: 54px; }

/* ---- Date range bar ---- */
.range-bar { display: flex; align-items: end; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.range-bar .field { margin-bottom: 0; min-width: 150px; }
.range-presets { display: flex; gap: 6px; }
.chip {
  background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text-2);
  padding: 7px 13px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
}
.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---- Welcome splash ---- */
.welcome-splash {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(circle at 30% 20%, rgba(237,33,58,.14), transparent 50%), var(--bg);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  text-align: center; padding: 24px;
}
/* הפייד-אאוט מופעל ע"י JS אחרי שהתוכן באמת מוצג (לא לפי זמן טעינת הדף —
   כניסה/API איטיים לא יגזלו מזמן הקריאה בפועל) */
.welcome-splash.closing { animation: welcomeOut .6s ease both; }
.welcome-splash.hide { display: none; }
.welcome-word {
  font-family: 'PP Neue Montreal', sans-serif; font-weight: 500; font-size: clamp(3rem, 14vw, 6.5rem);
  letter-spacing: -.02em; color: var(--text); line-height: 1;
  animation: welcomeWordIn .6s cubic-bezier(.22,1,.36,1) both;
  /* "WELCOME" + span("​.") הן שתי קופסאות אחיות בלי טקסט עברי שיעגן כיוון —
     בלי direction:ltr הנקודה קופצת לצד הלא נכון בדף RTL */
  direction: ltr; unicode-bidi: isolate;
}
.welcome-word span { color: var(--accent); }
.welcome-line {
  margin-top: 16px; font-size: 15px; color: var(--text-2); max-width: 380px;
  animation: fadeUp .5s ease .25s both;
}
.welcome-name { color: var(--text); font-weight: 700; }
@keyframes welcomeWordIn { from { opacity:0; transform: translateY(18px) scale(.96);} to { opacity:1; transform: translateY(0) scale(1);} }
@keyframes welcomeOut { from { opacity:1; visibility:visible;} to { opacity:0; visibility:hidden; pointer-events:none;} }

/* ============================================================
   RESPONSIVE — desktop large → tablet → mobile → height → landscape
   ============================================================ */

/* ---- Desktop 4K (26"/24") ---- */
@media (min-width: 2560px) {
  .main { max-width: 1320px; }
  .kpi-value { font-size: 2.4rem; }
  .clock-btn { width: 168px; height: 168px; }
  .clock-timer { font-size: 3.4rem; }
}

/* ---- Desktop FHD+ (22"/17" FHD) ---- */
@media (min-width: 1920px) {
  .main { max-width: 1180px; }
  .kpi-card { padding: 20px 18px; }
}

/* ---- Desktop HD (16" laptop) ---- */
@media (min-width: 1600px) {
  .main { max-width: 1080px; }
}

/* ---- Tablet / Fold open (616px–1024px) ---- */
@media (max-width: 1024px) {
  .main { max-width: 100%; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

/* ---- Mobile-L: general mobile (≤700px) ---- */
@media (max-width: 700px) {
  .main { padding: 18px 14px 50px; }
  .topbar { padding: 12px 14px; }
  .topbar-title { font-size: 14px; }
  .topbar-right { gap: 10px; }
  .auth-card { padding: 28px 22px; }
  .action-tile { padding: 26px 18px; }
  .clock-timer { font-size: 2.3rem; }
  .clock-btn { width: 128px; height: 128px; }
  .kpi-row { gap: 10px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-value { font-size: 1.6rem; }
  .modal { padding: 20px; }
  /* לא מסתירים עמודת שעות — גוללים אופקית דרך .table-scroll במקום */
  .emp-table th, .emp-table td { white-space: nowrap; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .section-head { flex-wrap: wrap; row-gap: 8px; }
  .btn-ghost { padding: 7px 11px; font-size: 12px; }
}

/* ---- Mobile-M: iPhone Pro Max (≤430px) ---- */
@media (max-width: 430px) {
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
  .clock-btn { width: 116px; height: 116px; font-size: 14px; }
  .clock-timer { font-size: 2rem; margin: 4px 0 18px; }
  .range-bar .field { min-width: 130px; }
  .entry-row { gap: 8px; padding: 10px 12px; }
  .entry-time { font-size: 13px; }
  .mode-btn { font-size: 11px; padding: 7px 6px; }
}

/* ---- Mobile-S: Galaxy S23–S26 / iPhone 15 Pro (≤393px) ---- */
@media (max-width: 393px) {
  .work-mode-label { display: none; }
  .header-clock { display: none; }
  .topbar-user { font-size: 12px; }
  .section-title { font-size: 14px; }
  .section-head .btn-outline { padding: 6px 10px; font-size: 12px; }
  .clock-btn { width: 104px; height: 104px; }
  .clock-timer { font-size: 1.8rem; }
  .kpi-value { font-size: 1.4rem; }
  .entry-note { display: none; } /* יתגלה בעריכה — שומר מקום בשורה הצפופה */
}

/* ---- Mobile-XS: Galaxy S21/S22 (≤360px) ---- */
@media (max-width: 360px) {
  .auth-card { padding: 22px 16px; }
  .auth-title { font-size: 22px; }
  .topbar-logo { height: 22px; }
  .field-row { flex-direction: column; gap: 0; }
  .range-bar .field { min-width: 100%; }
  .welcome-line { font-size: 13px; }
  .topbar-user { display: none; } /* דקורטיבי — שם המשתמש כבר מוצג ב-welcome splash / login */
}

/* ---- Fold סגור (≤280px) ---- */
@media (max-width: 280px) {
  .topbar-right .work-mode-badge { display: none; }
  .kpi-row { grid-template-columns: 1fr; }
  .clock-btn { width: 92px; height: 92px; font-size: 12px; }
  .clock-timer { font-size: 1.5rem; }
  .entry-row { flex-wrap: wrap; }
  .modal { padding: 16px; }
  .entry-mode-toggle { flex-direction: column; }
  .theme-toggle-btn { width: 28px; height: 28px; }
  /* השעון החי מתנגש בכפתור theme-toggle הצף בפינה — מסתירים את השעון ומפנים
     מקום לטופס ההתחברות, בדיוק כמו בגובה מסך זעיר (ראו hero-clock display:none למעלה) */
  .hero-clock { display: none; }
}

/* ---- גובה מסך — לפטופ עם taskbar ---- */
@media (max-height: 768px) {
  .auth-shell { padding: 14px; gap: 18px; }
  .action-tile { padding: 22px 20px; }
  .hero-clock-time { font-size: clamp(2.2rem, 7vw, 3.4rem); }
}

/* ---- גובה מסך — compact ---- */
@media (max-height: 650px) {
  .main { padding-top: 16px; }
  .action-tile { padding: 16px; margin-bottom: 14px; }
  .clock-timer { margin: 2px 0 14px; }
  .modal-backdrop { align-items: flex-start; overflow-y: auto; padding: 16px; }
  .modal { margin: 16px 0; }
  .auth-shell { gap: 10px; }
  .hero-clock-date { display: none; }
}

/* ---- גובה מסך נמוך מאוד / mobile landscape ---- */
@media (max-height: 560px) {
  .welcome-word { font-size: clamp(2.2rem, 10vw, 4rem); }
  .welcome-line { margin-top: 8px; }
  .clock-btn { width: 96px; height: 96px; }
  .clock-status { margin-bottom: 2px; }
  .hero-clock { display: none; } /* עדיפות לטופס ההתחברות בגובה מסך זעיר */
}

@media (max-height: 500px) and (max-width: 932px) {
  .topbar { padding: 8px 14px; }
  .action-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .action-tile { padding: 12px; }
  .action-tile-head { margin-bottom: 8px; }
  .clock-timer { margin: 2px 0 10px; font-size: 1.8rem; }
  .clock-btn { width: 76px; height: 76px; font-size: 11px; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
