/* TaskFlow — GTSM look, matched to HEARTBEAT/PulseBoard: light-mode default (warm cream/white),
   dark-mode toggle, accent #ED213A, PP Neue numbers, restrained radius (not flat/0 anymore — see --radius) */

@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; }

:root {
  --accent: #ED213A;      /* Signal Red — brand, primary actions */
  --accent-2: #0C9C86;    /* Cyan Spark, darkened for legible text/icons on Bone */
  --accent-2-bg: #15E0C0; /* true Cyan Spark — dots/borders/bg only */
  --blue: #2D5BFF;        /* Volt Blue — clash accent, used sparingly */
  --yellow: #FFD23F;
  --yellow-ink: #8a6a1a;
  --black: #1C1C1C;
  --warm-white: #F0EEE9;

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

  /* עדכון מכוון (סבב /apple + /gtsm-design): נשארים בלי צללים ובלי כהה-כברירת-
     מחדל — זה מה ששומר על המשפחה הזו (HEARTBEAT/PulseBoard) עקבית — אבל
     ה-0-radius המוחלט הוא בדיוק החלק שגרם ל"מרגיש ישן". רדיוס מרוסן (טוקני
     gtsm-design הרשמיים) על פני שטח אינטראקטיבי הוא השינוי המשמעותי ביותר
     שאפשר לעשות בלי לשבור את הזהות של הכלי */
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --shadow: none;
  --shadow-sm: none;
  --shadow-card: none;
}

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

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Blender Pro', 'Rubik', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body, body * { transition: background-color .3s ease, border-color .3s ease, color .2s 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; }

/* מסגרת פוקוס אחידה בכל האפליקציה — לניווט מקלדת/נגישות, לא היה שום כלל
   כזה עד עכשיו (כפתורים/קישורים היו נופלים לברירת המחדל הלא-עקבית של
   הדפדפן). :focus-visible ולא :focus, כדי שזה יופיע רק בטאב/מקלדת ולא
   על כל קליק עכבר */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); }

@keyframes cardIn { from { opacity:0; transform: translateY(20px);} to { opacity:1; transform: translateY(0);} }
.card-in { animation: cardIn .3s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes slideUp { from { opacity:0; transform: translateY(16px) scale(.98);} to { opacity:1; transform: translateY(0) scale(1);} }
.slide-up { animation: slideUp .28s cubic-bezier(.32,.72,0,1) both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(8px);} to { opacity:1; transform: translateY(0);} }
.fade-up { animation: fadeUp .3s ease both; }

/* ---- Auth shell ---- */
.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; gap: 20px;
  background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px; position: relative; z-index: 2;
  background: var(--bg-card); border: 1px solid var(--border); padding: 36px 32px;
}
/* ---- Hero clock — big live clock above the login card, ported from
   HEARTBEAT. No video backdrop here, so it uses theme-aware text color
   instead of the fixed white + shadow that was legible over dark video. ---- */
.hero-clock { position: relative; z-index: 2; text-align: center; margin-bottom: 4px; }
.hero-clock-time {
  font-weight: 500; font-size: clamp(2.2rem, 7vw, 3.6rem);
  color: var(--text); letter-spacing: .02em; line-height: 1;
  font-variant-numeric: tabular-nums; 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: 8px; font-size: 11px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-2);
}

/* ---- Header clock — day/date/time in the topbar, ported from HEARTBEAT ---- */
.header-clock {
  font-family: 'Blender Pro', 'Rubik', sans-serif; font-size: 12.5px;
  letter-spacing: .02em; color: var(--text-2); white-space: nowrap;
}
/* מבודד את החלק המספרי (dir=ltr) מהיום העברי שלפניו — אחרת ה-bidi reflow
   כל שנייה כשהספרות משתנות גורם לשעון "לרקוד". ראו גם .hero-clock-time */
.header-clock-time { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

.auth-logo { height: 34px; display: block; margin: 0 auto 22px; }
/* גיף GTSM אנימטיבי (כמו HEARTBEAT/PulseBoard) — מאויר לרקע כהה, ה-invert
   הופך אותו לקריא על הכרטיס הבהיר; במצב כהה מוצג כמו שהוא בלי סינון */
.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: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field label svg { width: 13px; height: 13px; color: var(--text-3); flex-shrink: 0; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text);
  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); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field textarea { resize: vertical; min-height: 64px; }
/* חץ מותאם במקום כרום ברירת המחדל של הדפדפן — נראה ישן/גנרי בלעדיו.
   dir=rtl אז החץ בצד שמאל, עם padding-left פנוי בהתאם. משותף לכל select
   באפליקציה — מוגדר פעם אחת בסוף הקובץ כדי לנצח בוודאות את כל שאר הכללים */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.btn {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 13px; 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-lg { padding: 17px; font-size: 16.5px; letter-spacing: .01em; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); width: auto; transition: all .15s ease, transform .1s cubic-bezier(.32,.72,0,1); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline:active { transform: scale(.96); }
.btn-danger { background: transparent; border: 1px solid var(--accent); color: var(--accent); width: auto; transition: all .15s ease, transform .1s cubic-bezier(.32,.72,0,1); }
.btn-danger:hover { background: var(--accent); color: #fff; }
.btn-danger:active { transform: scale(.96); }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  padding: 8px 14px; font-size: 13px; font-weight: 600; transition: all .15s ease;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

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

/* ---- GTSM letters watermark — ported from HEARTBEAT, fixed behind all
   content on every screen (login + app pages) for a unified brand look ---- */
.bg-letters { position: fixed; inset: 0; z-index: 0; 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: var(--text); opacity: .03;
  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) { .bg-letters { display: none; } }

/* ---- Entry splash — brief black brand moment on the login page itself,
   before the (light-themed) login form, referencing proposals.gtsm.co.il's
   opening screen. Always Ink regardless of the light/dark toggle — this is
   a one-time brand statement, not themed UI chrome ---- */
.entry-splash {
  position: fixed; inset: 0; z-index: 300; background: #15110F;
  display: flex; align-items: center; justify-content: center;
}
.entry-splash-logo { height: 52px; animation: entrySplashIn .6s cubic-bezier(.22,1,.36,1) both; }
/* כמו ב-proposals.gtsm.co.il: הלוגו "מתפוצץ" קדימה לעבר הצופה (מתגדל בחדות ודועך)
   כמעט בו-זמנית עם דעיכת הרקע השחור — פליק אחד מהיר וחד, לא שתי שכבות עם עיכוב */
.entry-splash.closing .entry-splash-logo { animation: entrySplashLogoOut .4s cubic-bezier(.5,0,.75,0) both; }
.entry-splash.closing { animation: entrySplashOut .45s ease .05s both; }
.entry-splash.hide { display: none; }
@keyframes entrySplashIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes entrySplashLogoOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@keyframes entrySplashOut { from { opacity: 1; visibility: visible; } to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---- Welcome splash — brief full-screen greeting on login, ported from
   HEARTBEAT. JS starts the auto-close timer only once content is actually
   shown (not page-load time), so a slow API call doesn't eat reading time ---- */
.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;
}
.welcome-splash.closing { animation: welcomeOut .6s ease both; }
.welcome-splash.hide { display: none; }
/* לוגו GTSM מוביל את מסך הפתיח, כמו ב-proposals.gtsm.co.il — לפני הכל,
   מעל הוורדמארק "WELCOME" — לא רק טקסט */
.welcome-logo { height: 44px; margin-bottom: 22px; animation: welcomeWordIn .5s cubic-bezier(.22,1,.36,1) both; }
.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;
  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;} }

/* ---- App shell / topbar ---- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.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; flex-wrap: wrap; gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { height: 24px; }
.topbar-title { font-weight: 900; font-size: 16px; letter-spacing: .02em; }
.topbar-nav { display: flex; gap: 6px; }
.topbar-nav button { background: transparent; border: 1px solid transparent; color: var(--text-2); padding: 7px 12px; font-size: 13px; font-weight: 600; transition: all .15s ease, transform .1s cubic-bezier(.32,.72,0,1); }
.topbar-nav button:hover { color: var(--accent); }
.topbar-nav button.active { border-color: var(--border); color: var(--text); background: var(--bg-card); }
.topbar-nav button.active:hover { color: var(--accent); border-color: var(--accent); }
.topbar-nav button:active { transform: scale(.95); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 13px; color: var(--text-2); background: none; border: none; padding: 4px 2px; cursor: pointer; font-family: inherit; }
.topbar-user b { color: var(--text); font-weight: 700; }
.topbar-user:hover b { color: var(--accent); }
.topbar-user:hover { color: var(--accent); }

img.logo-dark { display: none; }
html.dark-mode img.logo-light { display: none; }
html.dark-mode img.logo-dark { display: block; }

.theme-toggle-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  width: 32px; height: 32px; 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; }

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

/* ---- Footer — "Made with ♥" + Sagigi Holdings credit, ported from PulseBoard/HEARTBEAT ----
   .app-shell is a column (topbar/main grow, footer pinned below) so the footer always sits
   at the bottom of the viewport, never just at the end of short content. */
.app-footer {
  border-top: 1px solid var(--border); padding: 18px 4px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.app-footer .footer-brand {
  display: flex; align-items: center; gap: 6px;
  font-family: 'PP Neue Montreal', sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-2);
}
.app-footer .footer-heart { flex-shrink: 0; }
.app-footer .footer-holding {
  font-family: 'PP Neue Montreal', sans-serif; font-size: 11px; letter-spacing: 1px; color: var(--text-3);
}
.brand-stamp {
  font-family: 'PP Neue Montreal', sans-serif; font-size: 11px; letter-spacing: 1px; color: var(--text-3);
  text-align: center; margin-top: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.brand-stamp-heart { flex-shrink: 0; }
@media (max-width: 430px) {
  .app-footer { justify-content: center; text-align: center; }
}

/* ---- KPI row ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border); padding: 18px 16px; }
/* דגש ממוקד ומורווח — לא לכל KPI, רק לזה שממש דורש פעולה שלך עכשיו
   (Apple §17: feedback רק איפה שהוא מרוויח את מקומו, לא בכל מקום) */
.kpi-needs-you { border-color: var(--blue); background: rgba(45,91,255,.05); }
.kpi-needs-you .kpi-label::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-inline-start: 5px; animation: wm-blink 1.8s infinite; vertical-align: middle; }
.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; letter-spacing: -.015em; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-value.accent { color: var(--accent); }
.kpi-value.green { color: var(--green); }
.kpi-value.amber { color: var(--amber); }
.kpi-value.blue { color: var(--blue); }
.kpi-value.cyan { color: var(--accent-2); }
.kpi-value.yellow { color: var(--yellow-ink); }

/* ---- Section / toolbar ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.section-title { font-size: 15px; font-weight: 700; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar select { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; font-size: 13px; }

/* ---- Custom select — תחליף מלא ל-<select> הרגיל, כי הרשימה הנפתחת שלו
   היא chrome של מערכת ההפעלה שאין עליה שום שליטת עיצוב. ה-select המקורי
   מוסתר לגמרי (משמש רק כמאגר value/change), הכל מעל בנוי ידנית ---- */
.custom-select { position: relative; display: inline-block; }
.custom-select-native { display: none !important; }
.custom-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 7px 10px; font-size: 13px; border-radius: var(--radius-sm); cursor: pointer;
  min-width: 130px; white-space: nowrap; transition: border-color .15s ease;
}
.custom-select-trigger::after {
  content: ''; width: 9px; height: 9px; flex-shrink: 0; margin-inline-start: auto;
  border-inline-end: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
}
.custom-select:hover .custom-select-trigger { border-color: var(--accent); }
.custom-select.open .custom-select-trigger::after { transform: rotate(225deg) translateY(2px); }
.custom-select-list {
  display: none; position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; min-width: 100%;
  max-height: 240px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
}
.custom-select.open .custom-select-list { display: block; animation: fadeUp .15s ease both; }
.custom-select-option {
  display: block; width: 100%; text-align: right; background: transparent; border: none; color: var(--text);
  padding: 7px 9px; font-size: 13px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.custom-select-option:hover { background: var(--bg-card-2); }
.custom-select-option.selected { background: rgba(237,33,58,.08); color: var(--accent); font-weight: 600; }
/* מפריד עדין בין הפעולה הראשית (משימה חדשה) לפילטרים המשניים — כדי שהעין
   תעצור על הכפתור לפני שהיא ממשיכה לסינון, לא תבלע אותו כעוד פקד באותה שורה */
.toolbar-divider { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
@media (max-width: 700px) { .toolbar-divider { display: none; } }

/* ---- Kanban board ---- */
.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: start; }

/* כפתור החלפת סטטוס — מוסתר בדסקטופ (יש גרירה), מוצג בטאץ' (גרירה לא נוחה) */
.task-card-status-btn { display: none; }

.board-col {
  background: var(--bg-card-2); border: 1px solid var(--border); min-height: 120px; display: flex; flex-direction: column;
  transition: border-color .15s ease, background-color .15s ease;
}
/* הקולונה "מקבלת" את הכרטיס — לא רק שינוי צבע, גם קצת נפח, כדי שהיעד ירגיש
   חי ברגע שגוררים משהו מעליו, לא רק אחרי ה-drop */
.board-col.drag-over { border-color: var(--accent); background: var(--bg-card); }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.board-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 7px; }
.board-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.board-col-dot.todo { background: var(--text-3); }
.board-col-dot.in_progress { background: var(--accent-2-bg); }
.board-col-dot.stuck { background: var(--yellow-ink); }
.board-col-dot.pending_manager_approval { background: var(--blue); }
.board-col-dot.pending_approval { background: var(--amber); }
.board-col-dot.done { background: var(--green); }
.board-col-count { font-size: 12px; color: var(--text-2); }
.board-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 40px; }

.task-card {
  background: var(--bg-card); border: 1px solid var(--border); padding: 12px 13px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s ease, transform .12s cubic-bezier(.32,.72,0,1);
}
.task-card:hover { border-color: var(--accent); }
/* משוב על הלחיצה עצמה, לא רק על התוצאה — פותח את הכרטיס תוך כדי ה-tap
   מרגיש מיידי, לא ממתין ל-click/touch-up */
.task-card:active { transform: scale(.97); }
.task-card.needs-revision { border-inline-start: 3px solid var(--accent); }
.task-card[draggable="true"] { cursor: grab; }
.task-card-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.task-card-assignee { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.task-card-avatar {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg-card-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--text-2); flex-shrink: 0;
}
.task-card-due { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.task-card-due.overdue { color: var(--accent); font-weight: 700; }
/* תג "רמת סיכון" לתאריך יעד — pill עם אייקון, רק בשני השלבים שבאמת דורשים
   תשומת לב (Apple §16: feedback רק איפה שהוא מרוויח את מקומו). "בדרך" נשאר
   טקסט רגיל (.task-card-due למעלה), לא מקבל תג בכלל */
.due-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px 2px 7px; border-radius: 999px; border: 1px solid; font-variant-numeric: tabular-nums;
}
.due-badge svg { width: 11px; height: 11px; flex-shrink: 0; }
.due-badge.soon { color: var(--amber); border-color: var(--amber); background: rgba(245,158,11,.08); }
.due-badge.overdue { color: var(--accent); border-color: var(--accent); background: rgba(237,33,58,.08); }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.priority-dot.low { background: var(--text-3); }
.priority-dot.medium { background: var(--amber); }
.priority-dot.high { background: var(--accent); }
.board-col-empty { font-size: 12px; color: var(--text-3); text-align: center; padding: 20px 0; }

.task-card-status-btn {
  background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text-2);
  font-size: 11px; font-weight: 600; padding: 6px 8px; width: 100%; margin-top: 2px;
}
.task-card-status-btn:active { border-color: var(--accent); color: var(--accent); }

/* ---- Badges — pill (border-radius מלא), לא ה-radius-sm הרגיל: תגית מצב/
   עדיפות היא המקרה הקלאסי לצורת pill, וזה מבדיל אותה חזותית מכפתור/שדה ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; }
.badge.status-todo { color: var(--text-2); }
.badge.status-in_progress { color: var(--accent-2); border-color: var(--accent-2-bg); }
.badge.status-stuck { color: var(--yellow-ink); border-color: var(--yellow-ink); }
.badge.status-pending_manager_approval { color: var(--blue); border-color: var(--blue); }
.badge.status-pending_approval { color: var(--amber); border-color: var(--amber); }
.badge.status-done { color: var(--green); border-color: var(--green); }

/* תגי תשומת-לב על כרטיס משימה — "תיקונים נדרשים" גובר חזותית (אדום, ממלא),
   "יש עדכון חדש" עדין יותר (cyan, מתאר) כי הוא רק אינפורמטיבי לא דחוף */
.badge-revision { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge-update { color: var(--accent-2); border-color: var(--accent-2-bg); }

/* ---- Live status badge (header) — GTSM standard, red blink + label ---- */
.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; }
@keyframes wm-blink { 0%,49%,100% { opacity: 1; } 50%,99% { opacity: .2; } }

/* ---- 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; overflow-y: auto;
}
.modal { width: 100%; max-width: 460px; background: var(--bg-card); border: 1px solid var(--border); padding: 24px; margin: auto; }
.modal-lg { max-width: 640px; }
.modal-title { font-size: 17px; font-weight: 800; margin: 0 0 18px; display: flex; align-items: center; justify-content: space-between; }
.modal-close { background: transparent; border: none; color: var(--text-2); font-size: 20px; line-height: 1; padding: 2px 6px; }
.modal-close:hover { color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn, .modal-actions .btn-outline, .modal-actions .btn-danger { flex: 1; }

/* ---- Comments ---- */
.comment-list { display: flex; flex-direction: column; gap: 10px; max-height: 220px; overflow-y: auto; margin: 14px 0; padding-right: 2px; }
.comment-row { background: var(--bg-card-2); border: 1px solid var(--border); padding: 9px 11px; }
.comment-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.comment-head b { color: var(--text); }
.comment-body { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.comment-form { display: flex; gap: 8px; }
.comment-form textarea { flex: 1; min-height: 40px; }
.comment-form button { width: auto; padding: 0 16px; }

/* ---- History timeline events — slim log lines mixed with comment boxes in
   the same list, distinguished by a colored dot per event type instead of a
   full box (keeps the merged feed from feeling like duplicated noise) ---- */
.history-event { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 12px; color: var(--text-2); }
.history-event-text { flex: 1; }
.history-event-text b { color: var(--text); font-weight: 700; }
.history-event-time { flex-shrink: 0; font-size: 11px; color: var(--text-3); }
.history-event-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }
.history-event-status-change { background: var(--blue); }
.history-event-checklist-complete { background: var(--accent-2); }
.history-event-file-upload, .history-event-file-delete { background: var(--yellow); }
.history-event-link-add, .history-event-link-delete { background: var(--accent-2); }

/* ---- Task modal sub-sections (links / checklist / files) ---- */
/* חוצץ ברור בין קטעי המודל — לא רק רווח, גם קו — כדי שכרטיס משימה עמוס
   (פרטים/רקע/הקצאה/לינקים/צ'קליסט/קבצים/עדכונים) יקרא כחלקים נפרדים ולא כדף
   ארוך אחד רציף */
.modal-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); position: relative; }
.modal-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
/* "דגל" אדום על תחילת כל חוצץ — לא רק קו אפור גנרי, סימן מותג ברור לכל
   חלק חדש בכרטיס. יושב בדיוק על קו ה-border-top, בצד ה-RTL (ימין) */
.modal-section:not(:first-child)::before {
  content: ''; position: absolute; top: -1px; right: 0; width: 40px; height: 2px; background: var(--accent);
}
.modal-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
  margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;
}
.modal-section-title .count-pill { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--bg-card-2); border: 1px solid var(--border); padding: 1px 9px; border-radius: 999px; }
/* עדכונים/הערות — קופסה שלמה (לא רק קו עליון) כדי שיהיה ברור חזותית שזה
   אזור אחד תחום, לא המשך של טופס המשימה למעלה */
.comment-box { border: 1px solid var(--border); border-top: 1px solid var(--border); background: var(--bg-card-2); padding: 16px; margin-top: 18px; }
.comment-box .comment-list { background: transparent; }
.comment-box .comment-row { background: var(--bg-card); }

/* ---- Links ---- */
.link-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.link-row { display: flex; align-items: center; gap: 8px; background: var(--bg-card-2); border: 1px solid var(--border); padding: 8px 10px; }
.link-row svg { width: 14px; height: 14px; color: var(--accent-2); flex-shrink: 0; }
.link-row a { flex: 1; font-size: 13px; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a:hover { color: var(--accent-2); text-decoration: underline; }
/* הערת טקסט חופשי (לא לינק) — אותו מקום בשורה, בלי הבטחת "אפשר ללחוץ" */
.link-row .link-note-text { flex: 1; font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.link-row:has(.link-note-text) svg { color: var(--text-3); }
.link-row .link-label { color: var(--text-2); font-size: 11px; flex-shrink: 0; }
.link-row .remove-btn { flex-shrink: 0; }
.add-inline-form { display: flex; gap: 8px; }
.add-inline-form input { flex: 1; background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text); padding: 9px 11px; font-size: 13px; }
.add-inline-form button { width: auto; padding: 0 14px; flex-shrink: 0; }

/* ---- Checklist ---- */
.checklist-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.checklist-row { display: flex; align-items: flex-start; gap: 9px; background: var(--bg-card-2); border: 1px solid var(--border); padding: 9px 10px; }
.checklist-row-label { display: flex; align-items: flex-start; gap: 9px; flex: 1; cursor: pointer; }
.checklist-row input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; cursor: pointer; }
.checklist-row-text { flex: 1; font-size: 13px; line-height: 1.4; }
.checklist-row.done .checklist-row-text { color: var(--text-3); text-decoration: line-through; }
.checklist-tag { display: inline-block; font-size: 10px; font-weight: 600; color: var(--text-2); background: var(--bg-card); border: 1px solid var(--border); padding: 1px 7px; margin-inline-start: 6px; }
.checklist-gate-note { font-size: 11.5px; color: var(--amber); margin-top: 2px; }
.checklist-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.checklist-add-row select { background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text); padding: 9px 8px; font-size: 12.5px; flex-shrink: 0; width: 150px; }
.checklist-add-row input { flex: 1; min-width: 120px; background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text); padding: 9px 11px; font-size: 13px; }
.checklist-add-row button { width: auto; padding: 0 14px; flex-shrink: 0; }
.remove-btn {
  background: transparent; border: none; color: var(--text-3); font-size: 15px; line-height: 1;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.remove-btn:hover { color: var(--accent); }

/* ---- File upload (dropzone) ---- */
.dropzone {
  border: 2px dashed var(--border); background: var(--bg-card-2); padding: 22px 14px; text-align: center;
  cursor: pointer; transition: border-color .15s ease, background-color .15s ease; margin-bottom: 10px;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent-2-bg); background: rgba(21,224,192,.06); }
.dropzone svg { width: 26px; height: 26px; color: var(--text-3); margin-bottom: 6px; }
.dropzone-text { font-size: 12.5px; color: var(--text-2); }
.dropzone-text b { color: var(--accent-2); font-weight: 700; }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.file-row { display: flex; align-items: center; gap: 9px; background: var(--bg-card-2); border: 1px solid var(--border); padding: 8px 10px; }
.file-row svg { width: 15px; height: 15px; color: var(--text-2); flex-shrink: 0; }
.file-row a { flex: 1; font-size: 13px; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row a:hover { color: var(--accent-2); text-decoration: underline; }
.file-row .file-size { font-size: 11px; color: var(--text-3); flex-shrink: 0; }

/* ---- User management table ---- */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { text-align: right; font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.user-table td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.user-table:not(.task-table) tr:last-child td { border-bottom: none; }

/* ---- Task list — each row framed like a card (GTSM flat-design language:
   1px border, no radius/shadow), color-coded by priority, so it reads as a
   distinct unit instead of plain text in a dense table. Rows need visual
   separation for the frame to show on all 4 sides, so this table uses
   spaced rows rather than the collapsed-border .user-table default. ---- */
.task-table { border-collapse: separate; border-spacing: 0 6px; }
.task-table thead th { border-bottom: 1px solid var(--border); }
.task-table .task-row td { border-top: 1px solid var(--row-color, var(--border)); border-bottom: 1px solid var(--row-color, var(--border)); }
.task-table .task-row td:first-child { border-inline-start: 3px solid var(--row-color, var(--border)); font-weight: 600; }
.task-table .task-row td:last-child { border-inline-end: 1px solid var(--row-color, var(--border)); }
.task-table .task-row.priority-high { --row-color: var(--accent); }
.task-table .task-row.priority-medium { --row-color: var(--amber); }
.task-table .task-row.priority-low { --row-color: var(--text-3); }
.task-table .task-row:hover td { background: var(--bg-card-2); }
.task-table .task-row.overdue-row td { background: rgba(237,33,58,.06); }
.task-table .task-row.overdue-row:hover td { background: rgba(237,33,58,.1); }
.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); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 20px; font-size: 13px; font-weight: 600;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-state svg { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 12px; }

/* ============================================================
   Responsive — /responsive breakpoint table
   ============================================================ */

/* ---- Desktop גדול: FHD+/4K — יותר אוויר, לא נשאר ריק ---- */
@media (min-width: 1920px) {
  .main { max-width: 1360px; }
  .kpi-value { font-size: 2.3rem; }
  .board { gap: 18px; }
}

/* ---- Tablet / Fold פתוח (≤1024px) — Kanban ל-2 עמודות ---- */
@media (max-width: 1024px) {
  .board { grid-template-columns: 1fr 1fr; }
  .main { max-width: 100%; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* ---- Mobile-L (≤700px) — עמודה אחת, בלי גרירה: כפתור סטטוס ---- */
@media (max-width: 700px) {
  .main { padding: 18px 14px 0; }
  .modal { padding: 20px; }
  .topbar { padding: 12px 14px; }
  .board { grid-template-columns: 1fr; gap: 12px; }
  .board-col-body { min-height: unset; }
  .task-card-status-btn { display: block; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-direction: column; align-items: stretch; }
  .toolbar { width: 100%; }
  .toolbar select { flex: 1; }
  /* בנייד, הפעולה הראשית (משימה חדשה/עובד חדש) צריכה שורה מלאה משלה, כדי
     שלא תתחבא בין פילטרים או תישאר קטנה למרות שההורה שלה נמתח */
  .btn-primary-cta { width: 100%; margin-bottom: 4px; }
  .toolbar .btn-primary-cta { order: -1; }
  .user-table { display: block; overflow-x: auto; white-space: nowrap; }
  .checklist-add-row select { width: 100%; }
  .checklist-add-row input { width: 100%; }
}

/* ---- Mobile-M/S (≤430px) — iPhone Pro Max / Galaxy S ---- */
@media (max-width: 430px) {
  .auth-card { padding: 28px 22px; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 1.6rem; }
  .topbar-title { font-size: 14px; }
  .topbar-nav button { padding: 6px 9px; font-size: 12px; }
}

/* ---- Mobile-XS (≤360px) — Galaxy S21/S22 ---- */
@media (max-width: 360px) {
  .main { padding: 14px 10px 0; }
  .modal { padding: 16px; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 14px 12px; }
  .topbar-user { display: none; }
}

/* ---- Fold סגור (≤280px) — כלום לא נשבר ---- */
@media (max-width: 280px) {
  .kpi-row { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .modal-actions { flex-direction: column; }
  .topbar-nav { flex-wrap: wrap; }
}

/* ---- גובה מסך קצר — לפטופ 13-14" עם taskbar ---- */
@media (max-height: 700px) {
  .comment-list { max-height: 140px; }
  .modal-backdrop { align-items: flex-start; padding-top: 30px; }
}

/* ---- חץ מותאם ל-select, מוגדר כאן (סוף הקובץ) כדי לנצח בוודאות כל כלל
   select אחר בקובץ (זהה ב-specificity, ה-cascade מכריע לפי סדר) ----- */
.field select, .toolbar select, .checklist-add-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948C80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 14px;
  padding-left: 32px;
}

/* ============================================================
   נגישות תנועה/שקיפות — /apple skill §14. עד עכשיו לא היה כלום מזה
   באפליקציה: כל אנימציה (card-in, fade-up, slide-up, welcome, blink)
   רצה ללא תלות בהעדפות המשתמש. כאן היא הופכת לדעיכה עדינה במקום
   swipe/spring/הבהוב, וחומרי הזכוכית (topbar, backdrop) מתייצבים.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* אלה לא "אנימציה שנגמרת מהר" אלא מצב מתמשך — צריך לכבות אותן ממש, לא
     רק לקצר, אחרת הן מהבהבות בטירוף במקום להיות יציבות */
  .work-mode-dot, .hc-colon { animation: none !important; opacity: 1; }
  .task-card:active, .btn-outline:active, .btn-danger:active, .topbar-nav button:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar { backdrop-filter: none; background: var(--bg); }
  .modal-backdrop { backdrop-filter: none; background: rgba(0,0,0,.85); }
}

/* ============================================================
   רדיוס מרוסן — /gtsm-design tokens (8/5/12), מוגדר כאן במקום אחד כי אין
   שום border-radius מתחרה בשאר הקובץ (חוץ מהעיגולים 50% של דוטים/אווטארים,
   שלא נוגעים). שלוש רמות: קטן על אינטראקטיבי (כפתור/שדה/תג), בינוני על
   כרטיסים, גדול על מודלים.
   ============================================================ */
.btn, .btn-outline, .btn-danger, .btn-ghost, .btn-lg,
.field input, .field select, .field textarea,
.toolbar select, .checklist-add-row select, .checklist-add-row input,
.link-form input, .comment-form textarea,
.toast,
.task-card-status-btn, .remove-btn,
.theme-toggle-btn, .topbar-nav button,
.link-row, .comment-row, .checklist-row,
.file-row, .dropzone {
  border-radius: var(--radius-sm);
}
.task-card, .kpi-card, .board-col, .comment-box, .auth-card {
  border-radius: var(--radius);
}
/* היררכיית "משקל חומר" (Apple §12): המודל הראשי (עריכת משימה, .modal-lg)
   הוא השכבה הכבדה — רדיוס גדול יותר. חלוניות אישור/דחייה קטנות (.modal
   בלבד) נשארות ברדיוס הרגיל, כדי שיקראו כ-utility popup קליל, לא כמסך ראשי */
.modal {
  border-radius: var(--radius);
}
.modal-lg {
  border-radius: var(--radius-lg);
}
