/* ============================================
   המפגש · CRM — עיצוב מקצועי
   צבעי המותג: זהב, טורקיז, חום
   ============================================ */

:root {
  --gold: #c9a227;
  --gold-light: #e3c65a;
  --teal: #2a9d8f;
  --teal-dark: #1f7a6f;
  --teal-light: #e5f4f2;
  --brown: #3d2417;
  --brown-2: #55321f;
  --green: #3c8a4a;
  --red: #c0492f;
  --ink: #2b2018;
  --muted: #8a7a6c;
  --bg: #f6f3ec;
  --card: #ffffff;
  --line: #ece5d8;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(61, 36, 23, 0.07);
  --shadow-md: 0 6px 24px rgba(61, 36, 23, 0.09);
  --shadow-lg: 0 14px 40px rgba(61, 36, 23, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Heebo", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ============ פריסה ============ */

.layout { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  flex: 1;
  padding: 28px 36px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ============ סרגל צד ============ */

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: linear-gradient(170deg, var(--brown) 0%, #2a170d 100%);
  color: #e9ddcf;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 10px 24px;
  border-bottom: 1px solid rgba(233, 221, 207, 0.12);
  margin-bottom: 22px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(233, 221, 207, 0.15);
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-icon svg { width: 34px; height: 34px; }

.brand-text { display: flex; flex-direction: column; }

.brand-title {
  font-size: 25px;
  font-weight: 900;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  line-height: 1.15;
}

.brand-tagline {
  font-size: 11px;
  color: #b7a895;
  font-weight: 400;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #cfc0af;
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

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

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: translateX(-2px);
}

.nav-item.active {
  background: linear-gradient(120deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(42, 157, 143, 0.35);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 2px;
  font-size: 12.5px;
  color: #a08e7c;
  border-top: 1px solid rgba(233, 221, 207, 0.12);
}

.sidebar-footer-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ============ סרגל עליון ============ */

.topbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--brown);
}

.topbar-actions { display: flex; gap: 10px; }

/* ============ כרטיסי סטטיסטיקה ============ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card::after {
  content: "";
  position: absolute;
  left: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-teal  { background: linear-gradient(135deg, #34b3a3, #1f7a6f); }
.stat-gold  { background: linear-gradient(135deg, #d9b13b, #a8851a); }
.stat-green { background: linear-gradient(135deg, #4aa35a, #2e6e3a); }
.stat-brown { background: linear-gradient(135deg, #6b4326, #3d2417); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
}

.stat-icon svg { width: 26px; height: 26px; }

.stat-info { display: flex; flex-direction: column; }

.stat-number { font-size: 32px; font-weight: 900; line-height: 1.1; }

.stat-label { font-size: 13.5px; opacity: 0.92; font-weight: 500; }

/* ============ פאנלים ============ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.panel-form { max-width: 860px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h2 { font-size: 17px; font-weight: 800; color: var(--brown); }

.link-more {
  color: var(--teal);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.link-more:hover { text-decoration: underline; }

/* ============ טבלאות ============ */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

td {
  text-align: right;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  vertical-align: middle;
}

tbody tr { transition: background 0.15s; }

tbody tr:hover { background: #faf7ef; }

tbody tr[onclick] { cursor: pointer; }

tbody tr:last-child td { border-bottom: none; }

.td-name { font-weight: 700; }

.td-name a { color: var(--teal-dark); text-decoration: none; }

.td-name a:hover { text-decoration: underline; }

.td-date { color: var(--muted); font-size: 13px; white-space: nowrap; }

.actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn:hover { background: var(--teal-light); color: var(--teal-dark); }

.icon-btn.icon-danger:hover { background: #fdeae5; color: var(--red); }

/* ============ קוד מזהה ============ */

.code-tag {
  display: inline-block;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--brown-2);
  background: #f5efe0;
  border: 1px solid #e3d7bd;
  border-radius: 7px;
  padding: 2px 9px;
  letter-spacing: 0.5px;
  direction: ltr;
  white-space: nowrap;
}

.code-tag-lg { font-size: 14px; padding: 5px 14px; }

.icon-btn.icon-convert:hover { background: #f7efd7; color: #8a6d10; }

/* ============ חיפוש ============ */

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 0 14px;
  flex: 1;
  max-width: 420px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3.5px rgba(42, 157, 143, 0.14);
}

.search-box svg { width: 17px; height: 17px; color: var(--muted); }

.search-box input {
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 14.5px;
  font-family: inherit;
  background: transparent;
  width: 100%;
  color: var(--ink);
}

/* שורת סינון (חיפוש + בוררים) */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.filter-select {
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3.5px rgba(42, 157, 143, 0.14);
}

/* בחירת כמה קורסים בטופס לקוח */
.field-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 8px;
}

.field-hint { color: var(--muted); font-size: 14px; margin: 0; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 9px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fdfcf9;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}

.checkbox-card:hover { border-color: var(--teal); }

.checkbox-card:has(input:checked) {
  border-color: var(--teal);
  background: rgba(42, 157, 143, 0.08);
}

.checkbox-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

/* לינק לקורס בכרטיס */
.course-link { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.course-link:hover { text-decoration: underline; }

/* ============ תגיות סטטוס ============ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-new        { background: var(--teal-light); color: var(--teal-dark); }
.badge-progress   { background: #faf0d2; color: #8a6d10; }
.badge-enrolled   { background: #e2f3e5; color: #2e6e3a; }
.badge-irrelevant { background: #efece7; color: #8a7a6c; }
.badge-other      { background: #efece7; color: #8a7a6c; }

/* ============ פילוח סטטוסים ============ */

.status-bars { display: flex; flex-direction: column; gap: 18px; }

.status-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.status-bar-count { font-size: 13px; font-weight: 600; color: var(--muted); }

.status-bar-track {
  height: 9px;
  background: #f0ebe1;
  border-radius: 20px;
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.fill-new        { background: linear-gradient(90deg, #34b3a3, #1f7a6f); }
.fill-progress   { background: linear-gradient(90deg, #d9b13b, #a8851a); }
.fill-enrolled   { background: linear-gradient(90deg, #4aa35a, #2e6e3a); }
.fill-irrelevant { background: #b8ab9c; }

/* ============ כפתורים ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 11px;
  padding: 10px 20px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn svg { width: 16px; height: 16px; }

.btn:hover { transform: translateY(-1px); }

.btn:active { transform: translateY(0); }

.btn-teal {
  background: linear-gradient(120deg, var(--teal), var(--teal-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(42, 157, 143, 0.35);
}

.btn-teal:hover { box-shadow: 0 7px 20px rgba(42, 157, 143, 0.45); }

.btn-gold {
  background: linear-gradient(120deg, var(--gold-light), var(--gold));
  color: var(--brown);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.btn-gold:hover { box-shadow: 0 7px 20px rgba(201, 162, 39, 0.5); }

.btn-outline {
  background: #fff;
  color: var(--teal-dark);
  border: 1.5px solid var(--teal);
}

.btn-outline:hover { background: var(--teal-light); }

.btn-danger-outline {
  background: #fff;
  color: var(--red);
  border: 1.5px solid #e5b3a6;
}

.btn-danger-outline:hover { background: #fdeae5; border-color: var(--red); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ============ סרגל כלים וסינון ============ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar-hint { color: var(--muted); font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 7px 18px;
  border-radius: 30px;
  border: 1.5px solid var(--line);
  color: var(--muted);
  background: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s;
}

.chip:hover { border-color: var(--teal); color: var(--teal-dark); }

.chip.active {
  background: linear-gradient(120deg, var(--teal), var(--teal-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}

/* ============ כרטיסי קורסים ============ */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.course-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 13px;
  transition: transform 0.2s, box-shadow 0.2s;
  border-top: 4px solid var(--teal);
}

.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.course-inactive { border-top-color: #c9beb0; opacity: 0.75; }

.course-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.course-card-head h3 { font-size: 17px; font-weight: 800; color: var(--brown); }

.course-desc {
  color: var(--muted);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink);
}

.course-meta-item svg { width: 16px; height: 16px; color: var(--teal); }

.course-card-actions { display: flex; gap: 8px; }

/* ============ טפסים ============ */

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form label { display: flex; flex-direction: column; gap: 7px; }

.form label > span {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brown);
}

.form label > span em { color: var(--red); font-style: normal; }

.form label.full, .form div.full { grid-column: 1 / -1; }

.form label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  align-self: end;
  padding-bottom: 12px;
  cursor: pointer;
}

.form label.checkbox input {
  width: 19px;
  height: 19px;
  accent-color: var(--teal);
  cursor: pointer;
}

.form input:not([type="checkbox"]), .form select, .form textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fdfcf9;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}

.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(42, 157, 143, 0.14);
}

.form input::placeholder, .form textarea::placeholder { color: #bdb1a2; }

.form textarea { resize: vertical; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding-top: 6px;
}

/* ============ מצבים ריקים ============ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state svg { width: 46px; height: 46px; opacity: 0.4; }

.empty-state p { font-size: 15px; }

.big-404 {
  font-size: 64px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

/* ============ פוטר ============ */

.footer {
  text-align: center;
  padding: 18px;
  font-size: 12.5px;
  color: #a99a8a;
  border-top: 1px solid var(--line);
}

/* ============ דף התחברות ============ */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(42, 157, 143, 0.14), transparent 45%),
    radial-gradient(ellipse at 85% 85%, rgba(201, 162, 39, 0.14), transparent 45%),
    linear-gradient(160deg, #2a170d, var(--brown) 55%, #55321f);
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--card);
  border-radius: 22px;
  padding: 38px 34px 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  text-align: center;
}

.login-brand .brand-icon {
  width: 70px;
  height: 70px;
  background: #f6f1e4;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  place-items: center;
}

.login-brand .brand-icon svg { width: 46px; height: 46px; }

.login-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--brown);
  line-height: 1.1;
}

.login-sub { font-size: 13px; color: var(--muted); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-form label { display: flex; flex-direction: column; gap: 7px; }

.login-form label span { font-size: 13.5px; font-weight: 700; color: var(--brown); }

.login-form input {
  padding: 12px 15px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
  font-family: inherit;
  background: #fdfcf9;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(42, 157, 143, 0.14);
}

.btn-block { width: 100%; justify-content: center; padding: 13px; font-size: 15.5px; margin-top: 6px; }

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.login-footer svg { width: 15px; height: 15px; color: var(--teal); }

.error-banner {
  background: #fdeae5;
  border: 1px solid #f0c4b8;
  color: #9c3620;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ============ משתמש מחובר ============ */

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 30px;
  padding: 5px 14px 5px 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.user-name { font-size: 13.5px; font-weight: 700; color: var(--brown); white-space: nowrap; }

.you-tag {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 8px;
  margin-right: 6px;
}

/* ============ הרשאות ============ */

.perm-section { display: flex; flex-direction: column; gap: 12px; }

.perm-title { font-size: 13.5px; font-weight: 700; color: var(--brown); }

.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perm-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 11px;
  background: #fdfcf9;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.perm-item:hover { border-color: var(--teal); }

.perm-item:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-light);
}

.perm-item input {
  width: 18px !important;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

.perm-text { display: flex; flex-direction: column; gap: 2px; }

.perm-text strong { font-size: 13.5px; color: var(--ink); }

.perm-text small { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ============ מודאל אישור ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 32, 24, 0.55);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s;
}

.modal-overlay.open { opacity: 1; }

.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 26px 22px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.18s;
}

.modal-overlay.open .modal-card { transform: translateY(0) scale(1); }

.modal-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fdeae5;
  color: var(--red);
  display: grid;
  place-items: center;
}

.modal-icon svg { width: 28px; height: 28px; }

.modal-message {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-actions { display: flex; gap: 10px; }

.modal-actions .btn { flex: 1; justify-content: center; }

.btn-danger-solid {
  background: linear-gradient(120deg, #d15a3e, #b3452f);
  color: #fff;
  box-shadow: 0 4px 14px rgba(192, 73, 47, 0.35);
}

/* ============ התראות Toast ============ */

.toast {
  position: fixed;
  bottom: 26px;
  right: 50%;
  transform: translate(50%, 70px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--brown);
  color: #fff;
  border-radius: 14px;
  padding: 13px 22px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  z-index: 110;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.3s;
  max-width: calc(100vw - 40px);
}

.toast.show { transform: translate(50%, 0); opacity: 1; }

.toast svg { width: 19px; height: 19px; color: #6ee7a0; flex-shrink: 0; }

/* ============ אזור נתונים ============ */

.td-revenue { font-weight: 800; color: var(--teal-dark); white-space: nowrap; }

.td-share { min-width: 130px; }

.td-share .share-track {
  display: inline-block;
  vertical-align: middle;
  width: 70px;
  height: 8px;
  background: #f0ebe1;
  border-radius: 20px;
  overflow: hidden;
  margin-left: 8px;
}

.td-share .share-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
}

.td-share .share-num { font-size: 12.5px; font-weight: 700; color: var(--muted); }

/* ============ רספונסיביות ============ */

@media (max-width: 960px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .layout { flex-direction: column; }

  /* סרגל צד הופך לניווט עליון קומפקטי */
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: column;
    padding: 12px 14px 10px;
    gap: 10px;
  }

  .sidebar-brand {
    border-bottom: none;
    padding: 0;
    margin: 0;
    justify-content: center;
  }

  .brand-icon { width: 40px; height: 40px; border-radius: 11px; }
  .brand-icon svg { width: 26px; height: 26px; }
  .brand-title { font-size: 20px; }
  .brand-tagline { font-size: 10px; }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 1;
    min-width: 76px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    font-size: 12px;
    border-radius: 10px;
    text-align: center;
  }

  .nav-item:hover { transform: none; }

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

  .sidebar-footer { display: none; }

  /* סרגל עליון */
  .topbar {
    padding: 12px 16px;
    position: static;
    gap: 8px;
  }

  .page-title { font-size: 18px; }

  .btn-gold .btn-text { display: none; }
  .btn-gold { padding: 10px 12px; }

  .user-name { display: none; }
  .user-chip { padding: 4px; border-radius: 50%; }

  /* תוכן */
  .content { padding: 16px 14px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  .stat-card { padding: 16px; gap: 12px; border-radius: 14px; }
  .stat-icon { width: 42px; height: 42px; border-radius: 11px; }
  .stat-icon svg { width: 21px; height: 21px; }
  .stat-number { font-size: 25px; }
  .stat-label { font-size: 12px; }

  .panel { padding: 16px; border-radius: 14px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .btn { justify-content: center; }
  .search-box { max-width: none; }

  .chip { padding: 8px 15px; }

  .form { grid-template-columns: 1fr; gap: 14px; }

  .form input:not([type="checkbox"]), .form select, .form textarea {
    padding: 12px 14px;
    font-size: 16px; /* מונע זום אוטומטי ב-iOS */
  }

  .form-actions { flex-direction: column; }
  .form-actions .btn { justify-content: center; padding: 13px; }

  .course-grid { grid-template-columns: 1fr; }

  /* טבלאות - גלילה אופקית נוחה */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  table { min-width: 640px; }

  th, td { padding: 11px 9px; font-size: 13.5px; }

  .icon-btn { width: 38px; height: 38px; }

  .login-card { padding: 30px 22px 22px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { flex-direction: column; text-align: center; gap: 8px; }
}
