:root {
  --primary: #7c5cfc;
  --primary-bright: #6d4cf6;
  --primary-soft: rgba(124, 92, 252, 0.12);
  --green: #16b890;
  --yellow: #e8a710;
  --blue: #0ea5e9;
  --orange: #f0773c;
  --purple: #8b6cf2;
  --bg: #e9e6dd;
  --card: rgba(255, 255, 255, 0.86);
  --card-2: rgba(20, 24, 60, 0.05);
  --text: #161a2b;
  --muted: #7c8198;
  --border: rgba(20, 24, 60, 0.08);
  --shadow: 0 10px 34px rgba(25, 32, 64, 0.08);
  --shadow-hover: 0 22px 48px rgba(25, 32, 64, 0.14);
  --frame: rgba(255, 255, 255, 0.6);
  --pill-active: #161a2b;
  --pill-active-text: #fff;
  --radius: 22px;
}

/* ---------- ערכת נושא כהה ---------- */
body.dark {
  --primary-bright: #8d6bff;
  --primary-soft: rgba(124, 92, 252, 0.16);
  --green: #2dd4a8;
  --yellow: #fbbf24;
  --blue: #38bdf8;
  --orange: #fb923c;
  --purple: #a78bfa;
  --bg: #0c0c14;
  --card: rgba(21, 21, 31, 0.88);
  --card-2: rgba(255, 255, 255, 0.05);
  --text: #f2f2f8;
  --muted: #8b8ba3;
  --border: rgba(255, 255, 255, 0.07);
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 22px 48px rgba(0, 0, 0, 0.5);
  --frame: rgba(14, 14, 24, 0.66);
  --pill-active: #f2f2f8;
  --pill-active-text: #0c0c14;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.ico { vertical-align: -2px; flex: none; }
.btn .ico, .nav-item .ico { vertical-align: -2px; margin-inline-end: 2px; }

body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: color .25s;
  overflow-x: hidden;
}

/* ---------- אנימציות ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideStart {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- מסגרת זכוכית ראשית ---------- */
.app {
  min-height: calc(100vh - 36px);
  display: flex; flex-direction: column;
  max-width: 1600px; margin: 18px auto;
  background: var(--frame);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 36px;
  box-shadow: 0 36px 90px rgba(15, 22, 50, 0.22);
  animation: fadeUp .55s cubic-bezier(.2, .7, .3, 1) backwards;
}
body.dark .app { border-color: rgba(255, 255, 255, 0.08); }

/* ---------- Top navigation ---------- */
.topnav {
  display: flex; align-items: center; gap: 22px;
  padding: 18px 30px 12px;
  position: sticky; top: 0; z-index: 60;
  border-radius: 36px 36px 0 0;
  background: var(--frame);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  overflow: visible;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-img {
  height: 52px; display: block;
  filter: drop-shadow(0 4px 12px rgba(20, 30, 60, .22));
  transition: transform .2s;
}
.brand-img:hover { transform: scale(1.05); }
body.dark .brand-img { filter: drop-shadow(0 0 14px rgba(255, 255, 255, .25)); }

.nav {
  display: flex; align-items: center; gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 6px;
  box-shadow: var(--shadow);
  margin-inline-end: auto;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
/* ניווט קפסולות מתרחבות: אייקון בלבד, הפריט הפעיל/בריחוף נפתח ומציג את שמו */
.nav-item {
  display: inline-flex; align-items: center; gap: 0;
  padding: 10px 12px; border-radius: 999px;
  color: var(--muted); font-weight: 600; cursor: pointer;
  transition: all .28s cubic-bezier(.2, .7, .3, 1);
  text-decoration: none; font-size: 13.5px; white-space: nowrap;
  flex: none;
}
.nav-item .ico { flex: none; }
.nav-label {
  display: inline-block; overflow: hidden;
  max-width: 0; opacity: 0; transform: translateX(6px);
  transition: max-width .28s cubic-bezier(.2, .7, .3, 1), opacity .2s, transform .28s cubic-bezier(.2, .7, .3, 1), margin .28s;
}
.nav-item:hover { color: var(--text); background: var(--card-2); }
.nav-item:hover .nav-label,
.nav-item.active .nav-label {
  max-width: 120px; opacity: 1; transform: none; margin-inline-start: 8px;
}
.nav-item.active {
  background: var(--pill-active); color: var(--pill-active-text);
  font-weight: 700; padding: 10px 16px;
  box-shadow: 0 8px 18px rgba(22, 26, 43, 0.28);
}
.topnav-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
/* ---------- פעמון התראות ---------- */
.bell-wrap { position: relative; }
.bell-badge {
  position: absolute; top: -4px; inset-inline-start: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: #ef4444; color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(239, 68, 68, .5);
  pointer-events: none;
}
.notif-panel {
  position: absolute; top: 50px; inset-inline-end: 0;
  width: 380px; max-width: 88vw; z-index: 80;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: 0 30px 70px rgba(15, 22, 50, .25);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  animation: popIn .22s cubic-bezier(.2, .7, .3, 1) backwards;
  overflow: hidden;
}
.notif-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--border);
}
.notif-head h4 { font-size: 15px; font-weight: 800; }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px 0; }
.notif-empty { text-align: center; padding: 36px 20px; color: var(--muted); font-size: 14px; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--card-2); }
.notif-item.unread { background: var(--primary-soft); }
.notif-ic {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-2); color: var(--muted);
}
.notif-ic.vip { background: rgba(124, 92, 252, .16); color: var(--primary); }
.notif-title { font-weight: 700; font-size: 13.5px; }
.notif-body { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.notif-actions { margin-top: 8px; }
.notif-actions .btn { padding: 6px 12px; font-size: 11.5px; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 4px; opacity: .8; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: border .15s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input { border: none; outline: none; font-family: inherit; font-size: 14px; width: 130px; background: transparent; color: var(--text); }
.search-box input::placeholder { color: var(--muted); }
.user-area {
  display: flex; align-items: center; gap: 12px;
  padding: 5px 6px 5px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.user-area-sep { width: 1px; height: 24px; background: var(--border); flex: none; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow);
}
body.dark .user-chip img { border-color: rgba(255, 255, 255, .15); }
.user-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.user-role { color: var(--muted); font-size: 12px; line-height: 1.2; }
.logout-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
  background: rgba(229, 72, 100, .1); color: #d23f5f;
  transition: background .18s, transform .18s;
}
.logout-btn:hover { background: rgba(229, 72, 100, .18); transform: translateY(-1px); }
body.dark .logout-btn { background: rgba(229, 72, 100, .16); color: #ff8aa1; }
body.dark .logout-btn:hover { background: rgba(229, 72, 100, .26); }
@media (max-width: 900px) {
  .user-area { padding: 4px; gap: 8px; }
  .user-chip > div, .user-area-sep { display: none; }
  .logout-btn { padding: 8px 12px; }
}

/* ---------- כותרת עמוד (Hero) ---------- */
.hero { padding: 14px 30px 6px; }
.hero-inner { display: flex; justify-content: space-between; align-items: flex-end; }
.hero h1 { font-size: 32px; font-weight: 800; color: var(--text); animation: slideStart .5s cubic-bezier(.2, .7, .3, 1) backwards; }
.hero p { color: var(--muted); font-size: 14.5px; margin-top: 4px; animation: slideStart .5s .07s cubic-bezier(.2, .7, .3, 1) backwards; }
.hero-actions { display: flex; gap: 12px; }
.hero-pill {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 22px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow);
}

/* ---------- Main ---------- */
.main { flex: 1; padding: 18px 30px 36px; }
.view-container { max-width: 1540px; margin: 0 auto; }
.muted { color: var(--muted); font-size: 14px; }

.loading { text-align: center; padding: 80px; color: var(--muted); font-size: 18px; animation: fadeIn .4s backwards; }

/* ---------- Metrics ---------- */
.metrics-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-bottom: 22px;
}
.metric-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  border: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: fadeUp .5s cubic-bezier(.2, .7, .3, 1) backwards;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s;
}
.metric-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.metric-card:nth-child(1) { animation-delay: .03s; }
.metric-card:nth-child(2) { animation-delay: .09s; }
.metric-card:nth-child(3) { animation-delay: .15s; }
.metric-card:nth-child(4) { animation-delay: .21s; }
.metric-card:nth-child(5) { animation-delay: .27s; }
.metric-card .title { color: var(--muted); font-size: 13px; font-weight: 500; }
.metric-card .value { font-size: 26px; font-weight: 800; margin: 8px 0 6px; }
.metric-trend { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.metric-trend.up { color: var(--green); }
.metric-trend.down { color: var(--orange); }
.metric-trend .txt { color: var(--muted); font-weight: 400; }
.spark-wrap { position: relative; width: 100%; height: 34px; margin-top: 10px; }

/* ---------- Grid layout ---------- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: fadeUp .55s cubic-bezier(.2, .7, .3, 1) backwards;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.grid-2 .card:nth-child(2), .grid-3 .card:nth-child(2) { animation-delay: .08s; }
.grid-3 .card:nth-child(3) { animation-delay: .16s; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-head h3 { font-size: 17px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 13px; }
.chart-wrap { position: relative; height: 260px; }
.donut-wrap { position: relative; height: 220px; }

/* ---------- Legend ---------- */
.legend { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-item .count { margin-inline-start: auto; color: var(--muted); font-weight: 600; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: right; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--card-2); }
.customer-cell { display: flex; align-items: center; gap: 10px; }
.customer-cell img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.customer-cell .product-thumb, .product-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: var(--shadow); }
.product-thumb-empty {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--primary-soft); color: var(--primary);
}

/* ---------- יומן גלובלי (לוח שנה חודשי) ---------- */
.cal-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav-btn {
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; font-size: 20px; line-height: 1; padding-bottom: 3px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  transition: background .15s;
}
.cal-nav-btn:hover { background: var(--pill-active); color: var(--pill-active-text); }
.cal-title { font-size: 20px; font-weight: 800; }
.cal-title span { color: var(--muted); font-weight: 600; }
.cal-filters { display: flex; gap: 8px; margin-inline-start: auto; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-grid-head { margin-bottom: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cal-grid-body {
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: var(--border); gap: 1px;
}
.cal-cell {
  background: var(--card); min-height: 104px; padding: 7px 8px;
  display: flex; flex-direction: column; gap: 5px; cursor: pointer;
  transition: background .15s;
}
.cal-cell:hover { background: var(--card-2); }
.cal-cell.weekend { background: color-mix(in srgb, var(--card) 94%, var(--primary)); }
.cal-cell.weekend:hover { background: var(--card-2); }
.cal-cell.other { opacity: .42; }
.cal-daynum {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted); flex: none;
}
.cal-cell.today .cal-daynum { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(99, 102, 241, .4); }
.cal-cell.today { background: color-mix(in srgb, var(--card) 90%, var(--primary)); }

.cal-evts { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-evt {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  border: none; cursor: pointer; text-align: start;
  padding: 3px 7px; border-radius: 7px; font-family: inherit;
  font-size: 11px; font-weight: 600; color: var(--text);
  background: var(--card-2);
}
.cal-evt-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-evt-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.cal-evt.pending, .cal-evt-dot.pending { --dot: var(--yellow); }
.cal-evt.approved, .cal-evt-dot.approved { --dot: var(--green); }
.cal-evt.in_progress, .cal-evt-dot.in_progress { --dot: var(--blue); }
.cal-evt.completed, .cal-evt-dot.completed { --dot: var(--purple); }
.cal-evt.cancelled, .cal-evt-dot.cancelled { --dot: var(--orange); }
.cal-evt .cal-evt-dot, .cal-evt-dot { background: var(--dot, var(--muted)); }
.cal-evt.pending { background: rgba(232, 167, 16, .13); }
.cal-evt.approved { background: rgba(45, 212, 168, .13); }
.cal-evt.in_progress { background: rgba(56, 189, 248, .13); }
.cal-evt.completed { background: rgba(139, 108, 242, .13); }
.cal-evt.cancelled { background: rgba(240, 119, 60, .13); text-decoration: line-through; }
.cal-evt:hover { filter: brightness(.94); }
.cal-more {
  border: none; background: transparent; cursor: pointer; text-align: start;
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--primary);
  padding: 1px 7px;
}
.cal-more:hover { text-decoration: underline; }

.cal-day-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cal-day-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px; border-radius: 14px; cursor: pointer; text-align: start;
  background: var(--card-2); border: 1px solid var(--border); font-family: inherit;
  transition: border-color .15s;
}
.cal-day-item:hover { border-color: var(--primary); }
.cdi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cdi-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.cdi-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .cal-cell { min-height: 72px; padding: 5px; }
  .cal-evt .cal-evt-txt { display: none; }
  .cal-evt { padding: 3px 5px; }
  .cal-filters { margin-inline-start: 0; width: 100%; }
  .cal-filters select { flex: 1; }
}

/* ---------- חיפוש בגריד כרטיסים ---------- */
.grid-search {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px; padding: 9px 14px;
  background: var(--card-2); border: 1.5px solid var(--border); border-radius: 14px;
  transition: border-color .18s;
}
.grid-search:focus-within { border-color: var(--primary); background: var(--card); }
.grid-search .gs-ic { display: grid; place-items: center; color: var(--muted); flex: none; }
.grid-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 13.5px; color: var(--text); min-width: 0;
}
.grid-search input::placeholder { color: var(--muted); }
.grid-search .gs-count { color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; }

/* ---------- רשת מוצרים (חנות בסגנון איקומרס) ---------- */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 13px;
}
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow);
  animation: fadeUp .5s cubic-bezier(.2, .7, .3, 1) backwards;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.product-grid .product-card:nth-child(2) { animation-delay: .05s; }
.product-grid .product-card:nth-child(3) { animation-delay: .1s; }
.product-grid .product-card:nth-child(4) { animation-delay: .15s; }
.product-grid .product-card:nth-child(5) { animation-delay: .2s; }
.product-grid .product-card:nth-child(n+6) { animation-delay: .25s; }
.pc-img {
  position: relative; aspect-ratio: 4 / 3;
  background: var(--card-2); display: grid; place-items: center; color: var(--muted);
  overflow: hidden;
}
.pc-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.product-card:hover .pc-img img { transform: scale(1.06); }
.pc-badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pc-badge.low { background: rgba(232, 167, 16, .9); color: #fff; }
.pc-badge.out { background: rgba(240, 119, 60, .92); color: #fff; }
.pc-badge.region { background: rgba(22, 26, 43, .65); color: #fff; }
.pc-desc {
  color: var(--muted); font-size: 11.5px; margin-top: 4px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-body { padding: 10px 11px 11px; }
.pc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pc-name { font-weight: 700; font-size: 13px; line-height: 1.3; }
.pc-price { font-weight: 800; font-size: 13.5px; color: var(--primary); white-space: nowrap; }
.pc-meta { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.pc-actions .btn { flex: 1 1 calc(50% - 6px); padding: 6px 8px; font-size: 11.5px; white-space: nowrap; }
.pc-actions .pc-main { flex: 1 1 auto; }
.pc-more {
  flex: none; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
  transition: background .15s, color .15s;
}
.pc-more:hover { background: var(--pill-active); color: var(--pill-active-text); }

/* תפריט פעולות נפתח של כרטיס */
.card-menu {
  position: fixed; z-index: 9999; min-width: 158px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 46px rgba(10, 14, 40, .22); direction: rtl;
  animation: cardMenuIn .14s ease;
}
@keyframes cardMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cm-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text); text-align: start;
  font-family: inherit; font-size: 13px; font-weight: 600;
}
.cm-item:hover { background: var(--card-2); }
.cm-item.danger { color: #d23f5f; }
.cm-item.danger:hover { background: rgba(229, 72, 100, .1); }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.approved { background: rgba(45,212,168,.16); color: var(--green); }
.badge.pending { background: rgba(232,167,16,.15); color: var(--yellow); }
.badge.in_progress { background: rgba(56,189,248,.15); color: var(--blue); }
.badge.completed { background: rgba(139,108,242,.15); color: var(--purple); }
.badge.cancelled { background: rgba(240,119,60,.15); color: var(--orange); }
.badge.active { background: rgba(45,212,168,.16); color: var(--green); }
.badge.blocked { background: rgba(240,119,60,.15); color: var(--orange); }

/* ---------- Popular / ranks ---------- */
.popular-list { display: flex; flex-direction: column; gap: 14px; }
.popular-item { display: flex; align-items: center; gap: 14px; border-radius: 14px; transition: transform .18s; }
.popular-item:hover { transform: translateX(-4px); }
.rank { font-size: 22px; font-weight: 800; color: var(--primary-bright); opacity: .55; width: 36px; }
.popular-item img { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; background: var(--card-2); }
.popular-item .pname { font-weight: 600; font-size: 14px; }
.popular-item .pcount { color: var(--muted); font-size: 12px; }

/* ---------- Bottom KPIs ---------- */
.kpi-card { text-align: center; }
.kpi-card .kval { font-size: 30px; font-weight: 800; }
.kpi-card .ktitle { color: var(--muted); font-size: 14px; margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; background: var(--pill-active); color: var(--pill-active-text); padding: 9px 18px;
  border-radius: 999px; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: all .18s cubic-bezier(.2, .7, .3, 1);
  box-shadow: 0 6px 16px rgba(22, 26, 43, 0.18);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(22, 26, 43, 0.24); opacity: 1; }
.btn.primary, .btn.purple { background: var(--primary); color: #fff; }
.btn.ghost { background: var(--card-2); color: var(--text); box-shadow: none; }
.btn.green { background: var(--green); color: #fff; }
body.dark .btn.green { color: #07211a; }
.btn.sm { padding: 6px 14px; font-size: 12px; }

.section-title { font-size: 18px; font-weight: 700; margin: 6px 0 16px; }
.empty { text-align: center; padding: 50px; color: var(--muted); animation: fadeIn .4s backwards; }

/* ---------- Actions ---------- */
.btn.danger { background: rgba(240,119,60,.14); color: var(--orange); box-shadow: none; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- בקשות ביטול (התראת מנהל) ---------- */
.cancel-req-card {
  border: 1px solid rgba(229, 72, 100, 0.35);
  background: linear-gradient(180deg, rgba(255, 235, 240, 0.6), var(--card));
}
.cancel-req-card .card-head h3 { color: #d23f6a; display: flex; align-items: center; gap: 7px; }
.cancel-req-list { display: flex; flex-direction: column; gap: 12px; }
.cancel-req {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--border);
}
.cancel-req-info { min-width: 0; }
.cr-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.cr-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.cr-reason { font-size: 13px; margin-top: 6px; color: var(--text); background: rgba(240,119,60,.10); padding: 7px 10px; border-radius: 10px; }
.cr-when { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cancel-req-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.cancel-req-actions .btn { white-space: nowrap; }
.cancel-req-actions .btn.danger { background: #d23f6a; color: #fff; }
.cancel-req-actions .btn.danger:hover { background: #b8325a; }
@media (max-width: 720px) {
  .cancel-req { flex-direction: column; }
  .cancel-req-actions { flex-direction: row; width: 100%; }
  .cancel-req-actions .btn { flex: 1; }
}

/* ---------- נתונים קטנים: משתמשים ---------- */
.users-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}
.mini-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12px;
}
.mini-stat b {
  font-size: 16px;
  line-height: 1;
  color: var(--primary-bright);
}
.mini-stat span { color: var(--muted); font-weight: 600; }

/* ---------- אזור חובשים ורכזים ---------- */
.staff-hub {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  margin: 8px 0 20px;
}
.staff-hub-main, .staff-hub-stats {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.staff-hub-main {
  position: relative;
  overflow: hidden;
  padding: 24px;
  color: #f8fcff;
  background:
    radial-gradient(360px 160px at 90% -8%, rgba(255,255,255,.24), transparent 60%),
    radial-gradient(280px 150px at 8% 105%, rgba(46,219,187,.28), transparent 65%),
    linear-gradient(140deg, #062149 0%, #0a3269 55%, #0f4e95 100%);
  border-color: rgba(190, 228, 255, 0.22);
}
.staff-hub-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 22, 47, 0.36), transparent 52%);
  pointer-events: none;
}
.staff-hub-main > * { position: relative; z-index: 1; }
.staff-hub-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #b9eaff;
  margin-bottom: 10px;
}
.staff-hub-main h3 { font-size: 28px; line-height: 1.2; margin-bottom: 7px; }
.staff-hub-main p { font-size: 14px; color: rgba(233, 246, 255, 0.9); max-width: 560px; }
.staff-hub-actions { display: flex; gap: 10px; margin-top: 16px; }
.staff-hub-actions .btn {
  box-shadow: none;
  background: #50e8cd;
  color: #0b2550;
}
.staff-hub-actions .btn.ghost {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #f0fbff;
}

.staff-hub-stats {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.staff-box {
  border-radius: 16px;
  padding: 16px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
}
.staff-box .num { font-size: 25px; font-weight: 800; color: var(--primary-bright); line-height: 1; }
.staff-box .label { margin-top: 5px; font-size: 12.5px; color: var(--text); }
.staff-box.muted .num { color: var(--muted); }
.staff-box:last-child { grid-column: 1 / -1; }

/* ---------- Forms (filters etc.) ---------- */
select, input[type="text"], input[type="date"], input[type="number"] {
  color-scheme: light;
}
body.dark select, body.dark input[type="text"], body.dark input[type="date"], body.dark input[type="number"] {
  color-scheme: dark;
}
.card select, .card input {
  background: var(--card-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; font-family: inherit; font-size: 13px; outline: none;
  transition: border .15s;
}
.card select:focus, .card input:focus { border-color: var(--primary); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 28, .45);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .2s backwards;
}
body.dark .modal-overlay { background: rgba(5,5,12,.7); }
.modal {
  background: var(--card); border-radius: 26px; padding: 28px; width: 460px; max-width: 100%;
  box-shadow: 0 40px 90px rgba(10, 16, 40, .35); max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  animation: popIn .3s cubic-bezier(.2, .7, .3, 1) backwards;
}
.modal h3 { font-size: 20px; margin-bottom: 20px; }
.modal .field { margin-bottom: 14px; }
.modal label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 14px;
  font-family: inherit; font-size: 14px; outline: none;
  background: var(--card-2); color: var(--text);
}
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }
.modal-wide { width: 580px; }

/* ---------- טופס יצירת הזמנה ידנית (מנהל) ---------- */
.grid-2-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-msg { padding: 11px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.modal-msg.success { background: rgba(0, 196, 159, .12); color: #00926f; }
.modal-msg.error { background: rgba(255, 80, 80, .12); color: #d83333; }
.mo-line { border: 1.5px solid var(--border); border-radius: 16px; padding: 12px; margin-bottom: 10px; background: var(--card-2); }
.mo-line-main { display: grid; grid-template-columns: 1fr 70px 1fr auto; gap: 8px; align-items: center; }
.mo-line-main .line-del { padding: 8px 10px; }
.mo-line .line-hours-wrap { margin-top: 8px; }
.mo-line .line-hours-wrap label { font-size: 12px; }
.mo-price {
  margin-top: 16px; padding: 14px 16px; border-radius: 16px; line-height: 1.7;
  background: var(--primary-soft); color: var(--text); font-size: 14px;
}

/* ---------- תיק משתמש (פרטים מלאים) ---------- */
.uv-modal { width: 760px; max-width: 95vw; }
.uv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.uv-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.uv-head h3 { margin-bottom: 0; }
.uv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.uv-stat {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 10px; text-align: center;
}
.uv-stat .v { font-size: 19px; font-weight: 800; color: var(--primary); }
.uv-stat .t { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.uv-sec { font-size: 15px; font-weight: 700; margin: 20px 0 10px; display: flex; align-items: center; gap: 7px; }
.uv-table { background: var(--card-2); border-radius: 14px; padding: 4px 12px; overflow-x: auto; }
.uv-table table { min-width: 540px; }
.uv-table td, .uv-table th { font-size: 13px; padding: 9px 8px; }
.user-click { cursor: pointer; }
.user-click:hover { color: var(--primary); }
@media (max-width: 700px) { .uv-stats { grid-template-columns: repeat(2, 1fr); } }
.detail-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .dk { color: var(--muted); font-weight: 500; flex: none; min-width: 130px; }
.detail-row .dv { font-weight: 600; text-align: left; line-height: 1.5; }
.order-applicants { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.order-applicants h4 { font-size: 15px; margin-bottom: 10px; }
.order-applicant { padding: 10px 12px; background: var(--card-2); border-radius: 14px; margin-bottom: 8px; }
.muted.sm { font-size: 12px; margin-top: 2px; }

/* ---------- Document viewer (lightbox) ---------- */
.doc-viewer {
  background: var(--card); border-radius: 24px; padding: 20px; width: 760px; max-width: 95vw;
  max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 40px 90px rgba(10, 16, 40, .4);
  border: 1px solid var(--border);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  animation: popIn .3s cubic-bezier(.2, .7, .3, 1) backwards;
}
.doc-viewer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.doc-viewer-head h3 { font-size: 17px; }
.doc-viewer-body {
  flex: 1; overflow: auto; background: var(--card-2); border-radius: 16px; padding: 12px;
  display: grid; place-items: center; min-height: 300px;
}
.doc-image { max-width: 100%; max-height: 70vh; border-radius: 8px; object-fit: contain; }
.doc-frame { width: 100%; height: 70vh; border: none; border-radius: 8px; background: #fff; }

/* ---------- Scrollbar ---------- */
/* ---------- מסלולים ---------- */
.trail-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trail-tab {
  border: 1.5px solid var(--border); background: var(--card-2); color: var(--text);
  padding: 9px 16px; border-radius: 14px; font-family: inherit; font-size: 13.5px;
  font-weight: 700; cursor: pointer; transition: all .18s;
}
.trail-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.trail-tab .cnt {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: rgba(120,128,160,.18); font-size: 12px; margin-inline-start: 6px;
}
.trail-tab.active .cnt { background: rgba(255,255,255,.25); }
.pc-badge.draft { background: rgba(232, 167, 16, .92); color: #fff; }
.pc-badge.published { background: rgba(0, 196, 159, .92); color: #fff; }

.trail-modal { width: 860px; max-width: 96vw; }
.trail-sec { border: 1.5px solid var(--border); border-radius: 18px; margin-bottom: 12px; overflow: hidden; background: var(--card-2); }
.trail-sec-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer;
  font-weight: 700; font-size: 14.5px; user-select: none;
}
.trail-sec-head .sec-num {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary-bright); font-size: 13px; flex-shrink: 0;
}
.trail-sec-head .sec-arrow { margin-inline-start: auto; transition: transform .2s; color: var(--muted); }
.trail-sec.open .sec-arrow { transform: rotate(180deg); }
.trail-sec-body { display: none; padding: 4px 16px 16px; }
.trail-sec.open .trail-sec-body { display: block; }
.trail-sec .grid-2-form { gap: 0 14px; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.chk-grid .chk {
  display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 4px 2px;
}
.chk-grid .chk input { width: auto; accent-color: var(--primary); }
.trail-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.trail-img-thumb { position: relative; width: 86px; height: 66px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--border); }
.trail-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trail-img-thumb .img-del {
  position: absolute; top: 4px; inset-inline-start: 4px; width: 20px; height: 20px; border: none;
  border-radius: 50%; background: rgba(10,14,28,.72); color: #fff; cursor: pointer;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
}
/* פרופיל מזין הדאטה */
.editor-chip {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; margin-bottom: 9px;
  border: 1px solid var(--border); border-radius: 13px; background: var(--card-2);
  cursor: pointer; transition: border-color .18s, background .18s;
}
.editor-chip:hover { border-color: var(--primary); }
.editor-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.editor-chip .ec-txt { min-width: 0; }
.editor-chip .ec-name { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.editor-chip .ec-title { font-size: 11px; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.editor-chip .ec-mail { font-size: 10.5px; color: var(--primary-bright); direction: ltr; text-align: right; }

.editor-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px;
  border: 1.5px solid var(--border); border-radius: 18px; background: var(--card-2); cursor: pointer;
  transition: border-color .18s;
}
.editor-head:hover { border-color: var(--primary); }
.editor-head img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.editor-head .eh-name { font-size: 15.5px; font-weight: 800; }
.editor-head .eh-title { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.editor-head .eh-mail { font-size: 12px; color: var(--primary-bright); direction: ltr; text-align: right; margin-top: 2px; }
.editor-head .eh-go { margin-inline-start: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.editor-landing { text-align: center; padding-top: 6px; }
.editor-landing img.el-avatar {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 14px 34px rgba(74, 58, 255, .25); margin-bottom: 12px;
}
.editor-landing .el-name { font-size: 24px; font-weight: 800; }
.editor-landing .el-title { font-size: 14.5px; color: var(--primary-bright); font-weight: 600; margin-top: 3px; }
.editor-landing .el-meta { font-size: 13px; color: var(--muted); margin-top: 8px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.editor-landing .el-bio {
  margin: 16px auto 0; max-width: 560px; text-align: start; font-size: 14px; line-height: 1.75;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px;
  white-space: pre-wrap;
}
.el-trails { margin-top: 20px; text-align: start; }
.el-trail-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--card-2); margin-bottom: 8px; cursor: pointer; transition: border-color .18s;
}
.el-trail-row:hover { border-color: var(--primary); }
.el-trail-row img, .el-trail-row .el-ic { width: 46px; height: 36px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-bright); flex-shrink: 0; }
.el-trail-row .name { font-size: 13.5px; font-weight: 700; }
.el-trail-row .meta { font-size: 12px; color: var(--muted); }

.trail-view-sec { margin: 16px 0 6px; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.trail-view-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.trail-view-imgs img { width: 140px; height: 100px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 128, 160, .4); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 128, 160, .6); }

@media (max-width: 1200px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .staff-hub { grid-template-columns: 1fr; }
  .topnav { gap: 12px; }
  .topnav-left { gap: 8px; }
  .nav-item { padding: 9px 11px; font-size: 13px; }
}
@media (max-width: 900px) {
  .app { margin: 10px; border-radius: 26px; min-height: calc(100vh - 20px); }
  .topnav { flex-wrap: wrap; padding: 14px 16px 8px; border-radius: 26px 26px 0 0; }
  .nav { order: 3; width: 100%; margin-inline-end: 0; }
  .hero { padding: 12px 16px 4px; }
  .hero h1 { font-size: 26px; }
  .main { padding: 14px 16px 26px; }
  .search-box { display: none; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .users-mini-stats { gap: 8px; margin-bottom: 12px; }
  .mini-stat { padding: 6px 10px; font-size: 11px; }
  .mini-stat b { font-size: 14px; }
  .staff-hub-main { padding: 20px 16px; }
  .staff-hub { gap: 14px; margin: 8px 0 16px; }
  .staff-hub-main h3 { font-size: 24px; }
  .staff-hub-actions { flex-direction: column; }
  .staff-hub-stats { grid-template-columns: 1fr; }
  .staff-box:last-child { grid-column: auto; }
}
