:root {
  /* צבעי ברירת מחדל (Light) */
  --primary: #6366f1;   /* Indigo 500 */
  --primary-600: #5457e0;
  --primary-700: #4f46e5;

  --accent:  #22c55e;   /* Emerald 500 */
  --accent-600: #16a34a;

  --warn:    #f59e0b;   /* Amber 500 */
  --danger:  #ef4444;   /* Red 500 */

  --bg-from: #f7f9fd;
  --bg-to:   #edf2ff;

  --surface: #ffffff;
  --muted:   #6b7280;
  --border:  #e5e7eb;
  --text:    #0f172a;

  --radius:  16px;
  --shadow-lg: 0 15px 35px rgba(31, 41, 55, 0.12);
  --shadow-md: 0 8px 20px rgba(31, 41, 55, 0.08);
}

/* --- Dark mode overrides --- */
body.dark {
  --primary: #8b95ff;
  --primary-600: #7d86ff;
  --primary-700: #6f78ff;

  --accent:  #34d399;
  --accent-600: #10b981;

  --bg-from: #0b1220;
  --bg-to:   #111827;

  --surface: #121826;
  --muted:   #a3a3a3;
  --border:  #1f2937;
  --text:    #e5e7eb;
}

/* קונטיינר עמוד */
.container-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* כרטיס */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* טופס – אלמנטים */
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

/* כפתורים */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .06s ease, filter .2s ease, background .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { filter: brightness(1.06); }

/* secondary תמיד קריא גם בדארק */
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { filter: brightness(1.03); }

/* כפתור רפוי (לינקי ניווט) */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: rgba(0,0,0,.03); }
body.dark .btn-ghost:hover { background: rgba(255,255,255,.06); }

/* כפתור סכמטי (לוגאאוט בולט) */
.btn-danger {
  background: linear-gradient(180deg, var(--danger), #b91c1c);
  color: #fff;
}

/* צ'יפים / קיצורי טווח תאריכים */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #e0e7ff;
  font-size: 12px;
  font-weight: 700;
}
body.dark .chip {
  background: rgba(139,149,255,.15);
  color: #c7d2fe;
  border-color: rgba(139,149,255,.35);
}

/* טבלה */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead th {
  background: #f1f5ff;
  color: #1e293b;
  text-align: left;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.table tbody tr:nth-child(even) td { background: #fbfdff; }
/* Totals row looks like regular row */
.table tfoot td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #fbfdff;
  font-weight: 700;
}

body.dark .table thead th {
  background: #1b2540;
  color: #cbd5e1;
}
body.dark .table tbody td { border-bottom-color: #1f2937; }
body.dark .table tbody tr:nth-child(even) td { background: #141b2e; }
body.dark .table tfoot td {
  border-top-color: #1f2937;
  background: #141b2e;
}

/* סרגל עליון */
.topbar {
  backdrop-filter: saturate(120%) blur(6px);
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.25));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
body.dark .topbar {
  background: linear-gradient(180deg, rgba(18,24,38,.8), rgba(18,24,38,.45));
}

/* מודאל/טוסט */
.modal-panel {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.toast-ok    { background: linear-gradient(180deg, #34d399, #059669); color: #fff; }
.toast-error { background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; }
.toast-box {
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  padding: 12px 16px;
}

/* פריסות קטנות */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap { gap: 10px; }
.gap-lg { gap: 16px; }
.wrap { flex-wrap: wrap; }

/* קונטיינרים */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-md);
}
