/* FieldOps v2 — Bold Modern Redesign
   Mobile-first · RTL Hebrew · Touch-friendly
   ─────────────────────────────────────────── */

:root {
  /* ── Brand ─────────────────────────────── */
  --primary:       #1D4ED8;
  --primary-dark:  #1E3A8A;
  --primary-hover: #1E40AF;
  --primary-mid:   #2563EB;
  --primary-light: #EFF6FF;
  --primary-100:   #DBEAFE;

  /* ── Semantic ───────────────────────────── */
  --success:       #059669;
  --success-light: #ECFDF5;
  --success-100:   #D1FAE5;
  --warning:       #B45309;
  --warning-bg:    #FFFBEB;
  --warning-100:   #FEF3C7;
  --danger:        #DC2626;
  --danger-light:  #FEF2F2;
  --danger-100:    #FEE2E2;
  --teal:          #0D9488;
  --teal-light:    #F0FDFA;
  --teal-100:      #CCFBF1;
  --violet:        #6D28D9;
  --violet-light:  #F5F3FF;
  --violet-100:    #EDE9FE;
  --orange:        #C2410C;
  --orange-light:  #FFF7ED;
  --orange-100:    #FED7AA;

  /* ── Grayscale ──────────────────────────── */
  --surface:       #FFFFFF;
  --bg:            #F1F5F9;
  --bg-dark:       #E2E8F0;
  --text:          #0F172A;
  --text2:         #475569;
  --text3:         #94A3B8;
  --border:        #E2E8F0;
  --border-dark:   #CBD5E1;

  /* ── Shadows ────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 8px  rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.05);
  --shadow-lg: 0 8px 24px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.06);

  /* ── Layout ─────────────────────────────── */
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --bottom-nav-h:  68px;

  /* ── Radius ─────────────────────────────── */
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;

  /* ── Legacy v1 aliases ──────────────────────
     דפי ה-PHP עדיין מפנים לשמות הישנים —
     בלי אלה הצבעים פשוט לא מוצגים            */
  --blue:        var(--primary);
  --blue-mid:    var(--primary-mid);
  --blue-light:  var(--primary-light);
  --green:       var(--success);
  --green-lt:    var(--success-light);
  --red:         var(--danger);
  --red-lt:      var(--danger-light);
  --orange-lt:   var(--orange-light);
  --violet-lt:   var(--violet-light);
  --border-str:  var(--border-dark);
}

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

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

body {
  font-family: 'Rubik', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }

/* ════════════════════════════════════════════
   TOPBAR
════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(29,78,216,.30);
}

.logo-mark svg { width: 22px; height: 22px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text2);
}

.topbar-user-name {
  font-weight: 600;
  color: var(--text);
  display: none;
}
@media (min-width: 900px) { .topbar-user-name { display: block; } }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(29,78,216,.25);
}

.role-pill {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid var(--primary-100);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.role-pill.tech {
  background: var(--teal-light);
  color: var(--teal);
  border-color: var(--teal-100);
}

.topbar-logout {
  font-size: 14px;
  color: var(--text3);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-logout:hover { background: var(--danger-light); color: var(--danger); }
.topbar-logout svg { width: 16px; height: 16px; }

/* hamburger — mobile only */
.topbar-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-dark);
  background: var(--surface);
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text2);
  transition: all .12s;
  flex-shrink: 0;
}
.topbar-hamburger:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.topbar-hamburger svg { width: 20px; height: 20px; }

/* ════════════════════════════════════════════
   LAYOUT
════════════════════════════════════════════ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

/* ════════════════════════════════════════════
   SIDEBAR — desktop only
════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 12px 0 20px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}
.sidebar::-webkit-scrollbar { width: 0; }

.nav-section { margin-bottom: 4px; }

.nav-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
  transition: all .12s;
  user-select: none;
  border-right: 3px solid transparent;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-right-color: var(--primary);
  font-weight: 700;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}
.nav-icon svg { width: 18px; height: 18px; }

.nav-badge {
  margin-right: auto;
  background: var(--danger);
  color: white;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}
.nav-badge.orange { background: var(--warning); }

/* ════════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════════ */
.main {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

/* ════════════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-sub {
  font-size: 14px;
  color: var(--text3);
  margin-top: 4px;
  font-weight: 400;
}

.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  height: 46px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Rubik', sans-serif;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(29,78,216,.30);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(29,78,216,.40);
  transform: translateY(-1px);
}

.btn-teal   { background: var(--teal);    color: white; box-shadow: 0 2px 6px rgba(13,148,136,.25); }
.btn-orange { background: var(--orange);  color: white; }
.btn-green  { background: var(--success); color: white; }
.btn-red    { background: var(--danger);  color: white; }
.btn-teal:hover, .btn-orange:hover, .btn-green:hover, .btn-red:hover { transform: translateY(-1px); opacity: .92; }

.btn-ghost {
  background: var(--surface);
  color: var(--text2);
  border: 1.5px solid var(--border-dark);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-violet { background: var(--violet-light); color: var(--violet); border: 1.5px solid var(--violet-100); }

.btn.sm   { height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; gap: 6px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.lg   { height: 54px; padding: 0 32px; font-size: 17px; border-radius: var(--radius); }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ════════════════════════════════════════════
   STAT CARDS
════════════════════════════════════════════ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-stripe {
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.stat-num {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  line-height: 1.3;
}

/* ════════════════════════════════════════════
   CARDS
════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  flex-wrap: wrap;
}

.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body  { padding: 20px; }
.card-sub   { font-size: 13px; color: var(--text3); margin-top: 3px; }

/* ════════════════════════════════════════════
   TABLE
════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 20px;
  text-align: right;
  border-bottom: 2px solid var(--border-dark);
  background: var(--bg);
  white-space: nowrap;
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 14px;
}

tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--primary-light); }

/* ════════════════════════════════════════════
   BADGES
════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border: 1.5px solid transparent;
}
.badge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }

.b-blue   { background:var(--primary-light);  color:var(--primary);  border-color:var(--primary-100);   } .b-blue::before   { background:var(--primary); }
.b-orange { background:var(--orange-light);   color:var(--orange);   border-color:var(--orange-100);    } .b-orange::before { background:var(--orange); }
.b-green  { background:var(--success-light);  color:var(--success);  border-color:var(--success-100);   } .b-green::before  { background:var(--success); }
.b-red    { background:var(--danger-light);   color:var(--danger);   border-color:var(--danger-100);    } .b-red::before    { background:var(--danger); }
.b-teal   { background:var(--teal-light);     color:var(--teal);     border-color:var(--teal-100);      } .b-teal::before   { background:var(--teal); }
.b-violet { background:var(--violet-light);   color:var(--violet);   border-color:var(--violet-100);    } .b-violet::before { background:var(--violet); }
.b-gray   { background:var(--bg);             color:var(--text2);    border-color:var(--border-dark);   } .b-gray::before   { background:var(--text3); }

/* ════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════ */
.alert {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  border: 1.5px solid;
  line-height: 1.4;
}
.alert a { font-weight: 800; text-decoration: underline; }

.alert-orange { background:var(--warning-bg);     border-color:var(--warning-100); color:var(--warning); }
.alert-green  { background:var(--success-light);  border-color:var(--success-100); color:var(--success); }
.alert-red    { background:var(--danger-light);   border-color:var(--danger-100);  color:var(--danger);  }
.alert-blue   { background:var(--primary-light);  border-color:var(--primary-100); color:var(--primary); }

/* ════════════════════════════════════════════
   PROJECT GRID
════════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.proj-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: block;
}
.proj-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--primary-100);
}

.proj-card-stripe { height: 5px; }
.proj-card-body { padding: 18px 20px; }
.proj-card-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.proj-card-addr { font-size: 13px; color: var(--text3); margin-bottom: 14px; }
.proj-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text2); margin-bottom: 14px; flex-wrap: wrap; }
.progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text3); margin-bottom: 5px; }
.progress-track { height: 6px; background: var(--bg-dark); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 3px; }

/* ════════════════════════════════════════════
   FORMS
════════════════════════════════════════════ */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr;       gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr;   gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label { font-size: 14px; font-weight: 700; color: var(--text); }
.form-label .req { color: var(--danger); }

.form-input {
  background: var(--surface);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 48px;
  font-size: 15px;
  font-family: 'Rubik', sans-serif;
  direction: rtl;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.form-input::placeholder { color: var(--text3); }
textarea.form-input { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; }
select.form-input { cursor: pointer; }

/* ════════════════════════════════════════════
   BREADCRUMB
════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text3);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border-dark); }

/* ════════════════════════════════════════════
   FILTERS BAR
════════════════════════════════════════════ */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-wrap input { padding-right: 42px; }
.search-wrap::before {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: var(--text3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M9 3a6 6 0 100 12A6 6 0 009 3zM1 9a8 8 0 1114.32 4.906l3.387 3.387a1 1 0 01-1.414 1.414l-3.387-3.387A8 8 0 011 9z' clip-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M9 3a6 6 0 100 12A6 6 0 009 3zM1 9a8 8 0 1114.32 4.906l3.387 3.387a1 1 0 01-1.414 1.414l-3.387-3.387A8 8 0 011 9z' clip-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}

/* ════════════════════════════════════════════
   TABS
════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-dark);
  border: 1.5px solid var(--border-dark);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  border-radius: 8px;
  transition: all .12s;
  user-select: none;
  text-decoration: none;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.6); }
.tab.active { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: var(--shadow-sm); }

/* ════════════════════════════════════════════
   SCHEDULE
════════════════════════════════════════════ */
.schedule-grid { display: grid; grid-template-columns: 70px repeat(5,1fr); gap: 4px; min-width: 600px; }

.sch-head {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
}

.sch-time {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text3); font-weight: 700;
  min-height: 64px;
}

.sch-cell {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  min-height: 64px;
  transition: background .12s;
}
.sch-cell:hover { background: var(--primary-light); border-color: var(--primary-100); }

.sch-task {
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
  cursor: pointer;
  line-height: 1.3;
  border: 1.5px solid transparent;
  text-decoration: none;
  display: block;
}

/* ════════════════════════════════════════════
   SIGNATURE PAD
════════════════════════════════════════════ */
.sig-pad {
  border: 2px dashed var(--border-dark);
  border-radius: 10px;
  background: var(--bg);
  cursor: crosshair;
}
.sig-pad canvas { display: block; border-radius: 10px; max-width: 100%; height: auto; }
.sig-controls { display: flex; gap: 10px; margin-top: 10px; align-items: center; }

/* ════════════════════════════════════════════
   TIMELINE
════════════════════════════════════════════ */
.tl-item { display: flex; gap: 16px; padding-bottom: 22px; position: relative; }
.tl-item::before { content:''; position:absolute; right:17px; top:36px; bottom:0; width:2px; background:var(--border-dark); }
.tl-item:last-child::before { display:none; }
.tl-dot { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex-shrink:0; border:2px solid var(--border); background:var(--surface); color:var(--text2); box-shadow:var(--shadow-sm); }
.tl-content { flex:1; }
.tl-title { font-weight:700; font-size:15px; color:var(--text); }
.tl-time  { font-size:12px; color:var(--text3); margin-top:2px; }
.tl-desc  { font-size:14px; color:var(--text2); margin-top:4px; }

/* ════════════════════════════════════════════
   LAYOUT HELPERS
════════════════════════════════════════════ */
.two-col   { display: grid; grid-template-columns: 1fr 1fr;     gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.part-missing {
  background: var(--warning-bg);
  border: 1.5px solid var(--warning-100);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--warning);
  margin-bottom: 14px;
  font-weight: 600;
}

/* ════════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity:0; transform: translateY(16px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1);   }
}

.modal-header { padding: 18px 22px; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-size: 17px; font-weight: 800; }
.modal-close  { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--text3); padding: 4px 8px; border-radius: 6px; line-height: 1; }
.modal-close:hover { color: var(--danger); background: var(--danger-light); }
.modal-body   { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1.5px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════ */
.login-page { min-height: 100vh; display: flex; }

/* Public pages (open.php) — centered single card */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

/* Left panel — branding */
.login-left {
  flex: 1;
  background: var(--primary-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

.login-left-circle-a {
  position: absolute;
  top: -15%;  right: -15%;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: rgba(37,99,235,.35);
}
.login-left-circle-b {
  position: absolute;
  bottom: -20%; left: -10%;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgba(29,78,216,.25);
}

.login-brand { position: relative; z-index: 1; text-align: center; color: white; }

.login-brand-logo {
  width: 76px; height: 76px;
  border-radius: 20px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}
.login-brand-logo svg { width: 38px; height: 38px; }

.login-brand-name {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.login-brand-tagline {
  font-size: 16px;
  opacity: .7;
  font-weight: 400;
}

.login-features {
  position: relative; z-index: 1;
  margin-top: 52px;
  display: flex; flex-direction: column; gap: 18px;
  width: 100%; max-width: 310px;
}

.login-feature {
  display: flex; align-items: center; gap: 14px;
  color: rgba(255,255,255,.85);
  font-size: 15px; font-weight: 500;
}

.login-feature-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login-feature-icon svg { width: 18px; height: 18px; }

/* Right panel — form */
.login-right {
  width: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  background: var(--surface);
}

.login-form-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.login-form-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.login-form-sub {
  font-size: 15px;
  color: var(--text2);
  margin-bottom: 36px;
}

.login-submit {
  width: 100%;
  height: 54px;
  font-size: 17px;
  border-radius: var(--radius);
}

/* ════════════════════════════════════════════
   MOBILE BOTTOM NAV
════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; right: 0; left: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 2px solid var(--border);
  z-index: 300;
  box-shadow: 0 -4px 16px rgba(15,23,42,.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
  display: flex;
  height: 100%;
  align-items: stretch;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  padding: 6px 2px;
  position: relative;
  border: none;
  background: none;
  font-family: 'Rubik', sans-serif;
}

.bottom-nav-item svg { width: 24px; height: 24px; }

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

.bottom-nav-badge {
  position: absolute;
  top: 4px; right: 16%;
  background: var(--danger);
  color: white;
  border-radius: 10px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  text-align: center;
}

/* ════════════════════════════════════════════
   MOBILE DRAWER (for "More" menu)
════════════════════════════════════════════ */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 400;
}
.drawer-overlay.open { display: block; }

.mobile-drawer {
  position: fixed;
  bottom: var(--bottom-nav-h); right: 0; left: 0;
  background: var(--surface);
  z-index: 410;
  border-top: 2px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12);
  transform: translateY(calc(100% + var(--bottom-nav-h)));
  transition: transform .25s ease;
  padding: 12px 0 20px;
}
.mobile-drawer.open { transform: translateY(0); }

.drawer-handle {
  width: 40px; height: 4px;
  background: var(--border-dark);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ════════════════════════════════════════════
   MOBILE RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar-hamburger { display: flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .role-pill { display: none; }
  .logo { font-size: 17px; gap: 8px; }
  .logo-mark { width: 32px; height: 32px; }

  .main {
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 20px);
  }

  .bottom-nav { display: flex; }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 14px 16px; }
  .stat-num  { font-size: 30px; }

  .two-col, .three-col, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }

  .page-title  { font-size: 22px; }
  .page-header { margin-bottom: 16px; }

  td, th { padding: 11px 14px; font-size: 13px; }

  .tabs { width: 100%; }
  .tab  { font-size: 13px; padding: 7px 14px; }

  .btn { font-size: 14px; height: 44px; padding: 0 16px; }

  /* Login mobile */
  .login-page { flex-direction: column; }
  .login-left { padding: 28px 24px; min-height: 160px; }
  .login-left .login-features { display: none; }
  .login-brand-name { font-size: 26px; }
  .login-brand-tagline { font-size: 14px; }
  .login-brand-logo { width: 56px; height: 56px; margin-bottom: 14px; }
  .login-right { width: 100%; flex: 1; padding: 28px 24px; justify-content: flex-start; }
  .login-form-title { font-size: 24px; }
  .login-form-sub { margin-bottom: 24px; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
}

@media (min-width: 769px) {
  .bottom-nav        { display: none !important; }
  .topbar-hamburger  { display: none !important; }
  .drawer-overlay    { display: none !important; }
  .mobile-drawer     { display: none !important; }
}

/* ════════════════════════════════════════════
   v2 COLORFUL OVERRIDES
   צבעוני · חיוני · ברור לכולם
════════════════════════════════════════════ */

/* ── Stat cards — colored variants ─────── */
.stat-card.c-blue   { background: linear-gradient(135deg, #EFF6FF 0%, #fff 65%); border-color: #93C5FD; }
.stat-card.c-teal   { background: linear-gradient(135deg, #F0FDFA 0%, #fff 65%); border-color: #5EEAD4; }
.stat-card.c-orange { background: linear-gradient(135deg, #FFF7ED 0%, #fff 65%); border-color: #FDBA74; }
.stat-card.c-green  { background: linear-gradient(135deg, #ECFDF5 0%, #fff 65%); border-color: #6EE7B7; }
.stat-card.c-red    { background: linear-gradient(135deg, #FEF2F2 0%, #fff 65%); border-color: #FCA5A5; }

/* Emoji icon inside stat card */
.stat-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.12));
}

/* ── Badges — more vibrant, remove dot ── */
.badge::before { display: none; }

.badge { gap: 6px; font-size: 13px; padding: 5px 12px; }

/* Badge symbol (first child span) */
.badge-sym { font-size: 13px; line-height: 1; }

.b-blue   { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD;  }
.b-orange { background: #FED7AA; color: #9A3412; border-color: #FB923C;  }
.b-green  { background: #A7F3D0; color: #065F46; border-color: #34D399;  }
.b-red    { background: #FECACA; color: #991B1B; border-color: #F87171;  }
.b-teal   { background: #CCFBF1; color: #0F766E; border-color: #2DD4BF;  }
.b-violet { background: #DDD6FE; color: #5B21B6; border-color: #A78BFA;  }
.b-gray   { background: #E2E8F0; color: #334155; border-color: #94A3B8;  }

/* ── Card headers — colored accent line ─ */
.card-header { border-right: 4px solid var(--border-dark); }
.card-header.accent-blue   { border-right-color: var(--primary); }
.card-header.accent-teal   { border-right-color: var(--teal); }
.card-header.accent-green  { border-right-color: var(--success); }
.card-header.accent-orange { border-right-color: var(--orange); }
.card-header.accent-red    { border-right-color: var(--danger); }

/* ── Page icon in page-header ──────────── */
.page-icon {
  font-size: 36px;
  line-height: 1;
  margin-left: 10px;
  vertical-align: middle;
}

/* ── Alert icons ──────────────────────── */
.alert-icon { font-size: 18px; flex-shrink: 0; }
