/* ============================================================================
   א.מ-בק מהנדסים — פורטל · מערכת העיצוב
   ----------------------------------------------------------------------------
   ממשק מוצר עכשווי: ניטרלי קריר, טיפוגרפיה גרוטסקית אחת (IBM Plex Sans Hebrew)
   עם מספרים ב-Plex Mono, קווים דקים וצל מינימלי, סרגל צד כהה ושטוח,
   וצבע דגש יחיד — טורקיז עמוק. הסטטוסים בגוונים שלהם, לא בפסטל.
   ============================================================================ */

:root {
  --bg:         #F4F5F7;
  --surface:    #FFFFFF;
  --surface-2:  #F8F9FA;
  --line:       #E5E7EA;
  --line-2:     #EEF0F2;
  --text:       #14161A;
  --text-2:     #5A606B;
  --text-3:     #8B919C;

  --accent:       #0F7B6C;
  --accent-hover: #0B6357;
  --accent-soft:  #E3F2EF;
  --accent-ring:  rgba(15, 123, 108, .22);

  --dark:       #141518;   /* סרגל צד */
  --dark-2:     #1C1E23;

  --ok:   #1C8A55;  --ok-soft:   #E4F4EA;
  --warn: #C8781A;  --warn-soft: #FBF0E0;
  --bad:  #D53F34;  --bad-soft:  #FBE7E5;
  --info: #2E6FD6;  --info-soft: #E7EFFB;
  --plum: #7A4BB8;  --plum-soft: #EFE8F9;

  --radius:    8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow-1:  0 1px 2px rgba(20, 22, 26, .05);
  --shadow-2:  0 8px 28px rgba(20, 22, 26, .12), 0 2px 6px rgba(20, 22, 26, .06);

  --font: 'IBM Plex Sans Hebrew', 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'IBM Plex Sans Hebrew', ui-monospace, monospace;

  /* כינויים לשמות קודמים — סגנונות מוטבעים בקוד ממשיכים לעבוד */
  --ink: var(--text); --ink-2: var(--text-2); --ink-3: var(--text-3);
  --paper: var(--bg); --paper-2: var(--surface-2); --paper-3: var(--surface-2);
  --rule: var(--line); --rule-2: var(--line-2); --muted: var(--text-3);
  --card: var(--surface); --border: var(--line);
  --primary: var(--accent); --primary-600: var(--accent); --primary-100: var(--accent-soft);
  --success: var(--ok); --danger: var(--bad); --warning: var(--warn); --purple: var(--plum);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: var(--font); font-size: 14px; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9CDD3; border: 3px solid transparent; background-clip: content-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #AEB3BB; background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

.money, .num, .stat-value, .money-strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  direction: ltr; unicode-bidi: isolate; display: inline-block; text-align: start;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); }
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================ שלד ============================ */
.app-body { display: flex; min-height: 100vh; background: var(--bg); }

/* ---------- סרגל צד — כהה, שטוח ---------- */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--dark); color: rgba(255, 255, 255, .7);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 60;
}
.sidebar-logo { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.logo-mark {
  width: 34px; height: 34px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-mark-blue { margin-inline: auto; width: 44px; height: 44px; color: var(--text); }
.logo-text b { display: block; color: #fff; font-size: 16px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.logo-text span { font-size: 10px; color: rgba(255, 255, 255, .42); letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }

.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .68); text-decoration: none; font-weight: 500; font-size: 13.5px;
  transition: background .14s, color .14s;
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .45); transition: color .14s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item:hover i { color: rgba(255, 255, 255, .8); }
.nav-item.active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-item.active i { color: #3FBFAB; }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-user-text { flex: 1; min-width: 0; }
.sb-user-text b { display: block; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-text small { color: rgba(255, 255, 255, .42); font-size: 11.5px; }
.sb-logout { color: rgba(255, 255, 255, .5); }
.sb-logout:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(20, 22, 26, .45); }
.sidebar-overlay.show { display: block; animation: fadeIn .18s; }

/* ---------- אזור ראשי ---------- */
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 22px; height: 56px; flex-shrink: 0; position: relative; z-index: 40;
}
.hamburger { display: none; }

.search-box { position: relative; flex: 1; max-width: 400px; }
.search-box > i { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 12.5px; pointer-events: none; }
.search-box input {
  width: 100%; height: 36px; padding: 0 32px 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s, background .15s; font-size: 13.5px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }

.search-results {
  display: none; position: absolute; top: calc(100% + 6px); inset-inline-start: 0; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-2); max-height: 400px; overflow-y: auto; z-index: 50;
}
.search-results.show { display: block; animation: riseIn .15s; }
.sr-group { border-top: 1px solid var(--line-2); padding: 6px 0; }
.sr-group:first-child { border-top: none; }
.sr-group > small { display: block; padding: 6px 14px 4px; color: var(--text-3); font-size: 11.5px; font-weight: 600; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; font-size: 13.5px; }
.sr-item:hover { background: var(--surface-2); }
.sr-item > i { color: var(--text-3); font-size: 12px; width: 15px; }
.sr-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sr-item small { color: var(--text-3); font-family: var(--mono); font-size: 11.5px; }
.sr-empty { padding: 22px; text-align: center; color: var(--text-3); font-size: 13.5px; }

.topbar-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 14px; transition: background .14s, color .14s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }

.badge-dot {
  position: absolute; top: 4px; inset-inline-end: 4px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface);
}

.bell-wrap, .user-wrap { position: relative; }
.notif-dropdown, .user-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 330px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-2); z-index: 50; overflow: hidden;
}
.notif-dropdown.show, .user-dropdown.show { display: block; animation: riseIn .15s; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.notif-head b { font-size: 13px; font-weight: 600; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; align-items: center; }
.notif-item:hover { background: var(--surface-2); }
.notif-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; }
.notif-txt { min-width: 0; flex: 1; }
.notif-txt b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-txt small { color: var(--text-3); font-size: 11.5px; }
.notif-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 13px; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: var(--radius-sm); }
.user-chip:hover { background: var(--surface-2); }
.user-chip-text { text-align: start; line-height: 1.25; }
.user-chip-text b { display: block; font-size: 13px; font-weight: 500; }
.user-chip-text small { color: var(--text-3); font-size: 11px; }
.user-chip > i { color: var(--text-3); font-size: 10px; }
.user-dropdown { width: 290px; }
.udd-head { display: flex; gap: 11px; padding: 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
.udd-head b { display: block; font-size: 14px; font-weight: 600; }
.udd-head small { display: block; color: var(--text-3); font-size: 11.5px; margin-bottom: 6px; direction: ltr; text-align: end; }
.udd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; font-size: 13.5px; text-align: start; }
.udd-item:hover { background: var(--surface-2); }
.udd-item i { width: 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.udd-logout { color: var(--bad); border-top: 1px solid var(--line-2); }
.udd-logout i { color: var(--bad); }

/* ---------- תוכן ---------- */
.content { flex: 1; overflow-y: auto; padding: 24px 28px 64px; }
.page { display: none; }
.page.active { display: block; animation: riseIn .2s ease; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; line-height: 1.25; }
.page-title i { display: none; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ============================ רכיבים ============================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-1); }
.card-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title i { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s; white-space: nowrap;
}
.btn i { font-size: 12px; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline { border-color: var(--line); color: var(--text); background: var(--surface); box-shadow: var(--shadow-1); }
.btn-outline:hover { border-color: #CDD1D7; background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-warning { background: var(--warn); color: #fff; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-sm i { font-size: 10.5px; }
.btn-lg { padding: 11px 20px; font-size: 14.5px; }
.btn-block { width: 100%; }

/* ---------- תגיות סטטוס: נקודה + טקסט ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge i { display: none; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-soft { background: var(--surface-2); color: var(--text-2); }

.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text-2); transition: all .14s;
}
.chip i { font-size: 11px; color: var(--text-3); }
.chip:hover { border-color: #CDD1D7; color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.chip.active i { color: #fff; }
.chip-count { font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.chip.active .chip-count { background: rgba(255, 255, 255, .16); color: #fff; }
.count-pill { font-family: var(--mono); font-size: 11.5px; font-weight: 500; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }

.days-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.days-chip i { font-size: 10px; }
.chip-red { color: var(--bad); }
.chip-orange { color: var(--warn); }
.chip-blue { color: var(--text-2); }
.chip-green { color: var(--ok); }
.chip-gray { color: var(--text-3); }

/* ---------- אווטאר ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-lg { width: 42px; height: 42px; font-size: 14.5px; }

/* ---------- טבלאות ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 10px 14px; text-align: start; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-sm th, .table-sm td { padding: 8px 11px; }

/* ---------- טפסים ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-2); }
.req { color: var(--bad); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, #F5F6F8 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-xs); }
.sk-line { height: 12px; margin: 8px 0; }
.w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.sk-circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.sk-stat { display: flex; align-items: center; gap: 13px; }
.sk-row { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.sk-row:last-child { border-bottom: none; }

/* ---------- מצב ריק ---------- */
.empty-state { text-align: center; padding: 44px 20px; }
.empty-icon { font-size: 22px; color: var(--text-3); opacity: .55; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff; padding: 11px 15px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(8px); transition: opacity .22s, transform .22s; max-width: 380px;
}
.toast.show { opacity: 1; transform: none; }
.toast i { font-size: 14px; }
.toast-success i { color: #4ADE80; }
.toast-error i { color: #F87171; }
.toast-warning i { color: #FBBF24; }
.toast-info i { color: #7DD3FC; }

/* ---------- מודלים ---------- */
/* שכבות: מגירה 800/810 · עורך המסמכים 1500 · חלונות 1600 · הודעות 2000.
   חלון שנפתח מתוך העורך חייב להיות מעליו, אחרת אי אפשר ללחוץ עליו. */
.modal-overlay { position: fixed; inset: 0; z-index: 1600; background: rgba(20, 22, 26, .5); display: flex; align-items: center; justify-content: center; padding: 22px; opacity: 0; transition: opacity .18s; }
.modal-overlay.open { opacity: 1; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-2); transform: translateY(8px) scale(.99); transition: transform .2s; }
.modal-overlay.open .modal { transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.modal-header h3 i { display: none; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.confirm-body { text-align: center; padding: 28px 26px 22px; }
.confirm-icon { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); font-size: 18px; }
.confirm-icon.danger { background: var(--bad-soft); color: var(--bad); }
.confirm-body h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.confirm-body p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.confirm-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }

/* ---------- מדדים ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
  transition: border-color .14s, box-shadow .14s;
}
.stat-card:hover { border-color: #CDD1D7; box-shadow: 0 2px 8px rgba(20, 22, 26, .06); }
.stat-icon { position: absolute; top: 15px; inset-inline-end: 16px; width: auto; height: auto; background: none !important; color: var(--text-3) !important; font-size: 13px; }
.stat-info { min-width: 0; }
.stat-value { display: block; font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; order: 2; }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; display: block; order: 1; margin-bottom: 6px; }
.stat-info { display: flex; flex-direction: column; }
.stat-trend { font-family: var(--mono); font-size: 12px; font-weight: 500; order: 3; margin-top: 6px; color: var(--text-3) !important; }

.charts-row { margin-bottom: 16px; }
.chart-holder { height: 250px; position: relative; }

/* ---------- פעילות ---------- */
.activity-mini { display: flex; flex-direction: column; }
.act-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.act-row:last-child { border-bottom: none; }
.act-row-lg { padding: 13px 0; }
.act-icon { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; }
.act-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-2); }
.act-text b { color: var(--text); font-weight: 500; }
.act-details { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.act-when { text-align: end; white-space: nowrap; }
.act-when b { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 500; font-family: var(--mono); }
.act-when small { color: var(--text-3); font-size: 11.5px; }
.activity-feed { padding: 4px 20px; }

/* ---------- ציר זמן ---------- */
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 12px; animation: riseIn .3s ease backwards; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot { position: absolute; inset-inline-start: -21px; top: 10px; width: 10px; height: 10px; border-radius: 50%; outline: 3px solid var(--surface); }
.timeline-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 13px; }
.timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; flex-wrap: wrap; }
.timeline-head b { font-size: 13.5px; font-weight: 600; }
.timeline-head b i { display: none; }
.timeline-card small { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }

/* ---------- מגירה ---------- */
.drawer-overlay { display: none; position: fixed; inset: 0; z-index: 800; background: rgba(20, 22, 26, .45); }
.drawer-overlay.show { display: block; animation: fadeIn .18s; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 810; width: min(560px, 96vw);
  background: var(--surface); box-shadow: var(--shadow-2);
  transform: translateX(-102%); transition: transform .26s cubic-bezier(.22, 1, .36, 1);
}
.drawer.open { transform: none; }
.drawer-inner { height: 100%; display: flex; flex-direction: column; overflow-y: auto; }
.drawer-loading { padding: 30px 24px; }
.drawer-header { padding: 18px 24px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.drawer-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-actions { display: flex; gap: 4px; }
.drawer-title { font-size: 19px; font-weight: 600; line-height: 1.3; margin-bottom: 10px; letter-spacing: -.015em; }
.drawer-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-body { padding: 0 24px 26px; }
.drawer-section { padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.drawer-section:last-child { border-bottom: none; }
.dw-sec-title { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dw-sec-title i { display: none; }
.dw-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.dw-files { display: flex; flex-direction: column; gap: 8px; }
.dw-file { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; transition: border-color .14s, background .14s; }
.dw-file:hover { border-color: #CDD1D7; background: var(--surface-2); }
.file-mini-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.dw-file-info { flex: 1; min-width: 0; }
.dw-file-info b { display: block; font-size: 13px; font-weight: 500; direction: ltr; text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-file-info small { color: var(--text-3); font-size: 11.5px; font-family: var(--mono); }

.perm-cell { font-size: 15px; text-align: center; }
.perm-yes { color: var(--ok); }
.perm-no { color: #D0D4DA; }
.user-inactive { opacity: .55; }

/* ============================ דף הכניסה ============================ */
.login-page { background: var(--bg); min-height: 100vh; }
.login-shell { display: flex; min-height: 100vh; }
.login-brand { flex: 1; position: relative; overflow: hidden; background: var(--dark); color: #fff; padding: 56px 64px; display: flex; align-items: center; }
/* סמל החברה בגדול, נחתך בקצה — האלמנט הגרפי היחיד */
.login-brand::after {
  content: ''; position: absolute; inset-inline-end: -180px; bottom: -160px; width: 620px; height: 620px;
  border-radius: 50%; background: rgba(255, 255, 255, .045); pointer-events: none;
}
.login-brand-glow { position: absolute; inset-inline-end: 130px; bottom: 150px; width: 300px; height: 300px; border-radius: 50%; background: rgba(63, 191, 171, .12); filter: blur(60px); pointer-events: none; }
.login-brand-inner { position: relative; z-index: 2; max-width: 480px; }
.login-brand .login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 52px; }
.login-brand .logo-mark { color: #fff; width: 40px; height: 40px; }
.login-brand .logo-text b { color: #fff; font-size: 17px; }
.login-brand .logo-text span { color: rgba(255, 255, 255, .45); }
.login-brand h1 { font-size: 38px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; margin-bottom: 16px; }
.login-brand p { font-size: 15px; color: rgba(255, 255, 255, .62); margin-bottom: 36px; line-height: 1.65; max-width: 44ch; }
.login-features { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.login-features li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.login-features i { color: #3FBFAB; font-size: 12px; width: 18px; text-align: center; }

.login-form-side { width: 480px; flex-shrink: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 44px; gap: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px 30px; box-shadow: var(--shadow-1); }
.login-card.shake { animation: shake .45s; }
.login-card-head { text-align: center; margin-bottom: 24px; }
.login-card-head h2 { font-size: 21px; font-weight: 600; margin: 14px 0 4px; letter-spacing: -.02em; }
.login-card-head p { color: var(--text-3); font-size: 13.5px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }
.input-icon-wrap .form-input { padding-inline-start: 36px; height: 42px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: var(--radius-xs); color: var(--text-3); }
.pw-toggle:hover { color: var(--text-2); background: var(--surface-2); }
.login-error { display: none; background: var(--bad-soft); color: var(--bad); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.login-error.show { display: block; animation: popIn .18s; }
.demo-users { margin-top: 22px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.demo-title { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-chip { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13px; font-weight: 500; text-align: start; transition: border-color .14s, background .14s; }
.demo-chip i { color: var(--text-3); margin-inline-end: 5px; font-size: 11px; }
.demo-chip small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; direction: ltr; text-align: start; font-family: var(--mono); margin-top: 2px; }
.demo-chip:hover { border-color: #CDD1D7; background: var(--surface-2); }
.login-footer { color: var(--text-3); font-size: 12px; }

@media (max-width: 1000px) { .login-brand { display: none; } .login-form-side { width: 100%; } }
@media (max-width: 900px) {
  .sidebar { position: fixed; inset-inline-start: -260px; transition: inset-inline-start .26s; }
  .sidebar.open { inset-inline-start: 0; }
  .hamburger { display: flex; }
  .content { padding: 18px 14px 54px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* דף הכניסה — טופס בחירת סיסמה אישית */
#login-form[hidden], #change-form[hidden] { display: none; }
.change-intro { font-size: 13px; color: var(--text-2); line-height: 1.6; margin: 0 0 14px;
  padding: 10px 12px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.change-intro i { color: var(--accent); margin-inline-end: 6px; }
