
/* ── APP SHELL ── */
body { background: #f0f5ff; }

.app-header {
  background: linear-gradient(135deg,#0f2540,#1a3a5c);
  position: sticky; top: 0; z-index: 200;
}
.app-header .header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header .logo { display: flex; align-items: center; gap: 10px; }
.app-header .logo-icon { font-size: 1.6rem; }
.app-header .logo-text h1 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.1rem; font-weight: 900; color: white; margin: 0;
}
.app-header .logo-text span {
  font-size: 0.7rem; color: rgba(255,255,255,0.6);
}
.header-right { display: flex; align-items: center; gap: 8px; }
.header-right .user-info {
  font-size: 0.82rem; color: rgba(255,255,255,0.95);
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
  font-family: inherit; cursor: pointer;
  padding: 7px 14px; border-radius: 22px; transition: all 0.18s;
}
.header-right .user-info:hover {
  background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.35);
}
.header-right .user-info:active { transform: translateY(1px); }
.header-right .user-info::before {
  content: '👤'; font-size: 0.92rem;
}
.header-right .user-info::after {
  content: '▾'; font-size: 0.7rem; opacity: 0.8; margin-right: 2px;
}
.header-right .user-info strong { color: #fff; font-weight: 800; }
.header-right .role-badge {
  background: rgba(255,255,255,0.15);
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; color: white;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
}
.header-right .role-badge[role="button"]:hover {
  background: rgba(255,255,255,0.28);
}
.header-right .role-badge[role="button"]:active {
  transform: scale(0.95);
}
.header-right .role-badge[role="button"]:focus-visible {
  outline: 2px solid #f0c040;
  outline-offset: 2px;
}
.btn-header {
  background: rgba(255,255,255,0.15);
  color: white; border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 12px; border-radius: 7px;
  font-family: 'Heebo', sans-serif; font-weight: 600;
  font-size: 0.8rem; cursor: pointer; transition: background 0.15s;
}
.btn-header:hover { background: rgba(255,255,255,0.25); }

/* ── TAB NAVIGATION ── */
.tab-nav {
  background: white;
  border-bottom: 2px solid #e8eef5;
  position: sticky; top: 56px; z-index: 150;
  display: flex;
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 10px 6px 8px;
  border: none; background: transparent;
  color: #8a9aaa; font-family: 'Heebo', sans-serif;
  font-size: 0.74rem; font-weight: 700; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn .ti { font-size: 1.25rem; line-height: 1; }
.tab-btn.active { color: #1a3a5c; border-bottom-color: #1a3a5c; }
.tab-btn:hover:not(.active) { color: #2a5298; }

/* ── TAB PANELS ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-inner {
  max-width: 860px; margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ── CHAPTER CARDS GRID ── */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
/* ── RANDOM QUIZ BANNER ── */
.random-mode-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1a3a5c, #2a5298);
  border-radius: 14px; padding: 14px 18px;
  cursor: pointer; color: white; margin-bottom: 12px;
  transition: opacity 0.15s, transform 0.15s;
}
.random-mode-banner:hover { opacity: 0.9; transform: translateY(-2px); }
.rmb-left { display: flex; align-items: center; gap: 12px; }
.rmb-icon { font-size: 1.8rem; }
.rmb-title { font-weight: 800; font-size: 1rem; }
.rmb-meta { font-size: 0.78rem; opacity: 0.75; margin-top: 2px; }
.rmb-arrow { font-size: 1.1rem; opacity: 0.7; }
.rmb-locked { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; opacity: 0.75; }

.chapter-card {
  background: white; border-radius: 14px;
  padding: 16px 14px; border: 2px solid #e8eef5;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: flex-start; gap: 12px;
  position: relative;
}
.chapter-card:hover:not(.cc-locked) {
  border-color: #2a5298; transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,58,92,0.1);
}
.chapter-card.cc-locked { opacity: 0.65; }
.cc-icon { font-size: 1.8rem; flex-shrink: 0; margin-top: 2px; }
.cc-body { flex: 1; min-width: 0; }
.cc-num { font-size: 0.68rem; font-weight: 700; color: #7a8a9a; margin-bottom: 2px; }
.cc-title { font-size: 0.88rem; font-weight: 700; color: #0f2540; line-height: 1.3; margin-bottom: 4px; }
.cc-meta { font-size: 0.73rem; color: #8a9aaa; }
.cc-free-tag {
  display: inline-block; background: #e6f9ef;
  color: #15803d; font-size: 0.65rem; font-weight: 800;
  padding: 1px 6px; border-radius: 4px; margin-right: 4px;
}
.cc-arrow { color: #c8d6e8; font-size: 1rem; flex-shrink: 0; align-self: center; }
.cc-lock-icon { color: #aab; font-size: 1rem; flex-shrink: 0; align-self: center; }

/* ════════════════ DARK MODE ════════════════ */
.theme-toggle {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.3s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.25); }
.theme-toggle:active { transform: rotate(180deg); }

[data-theme="dark"] body { background: #0a1220; color: #e6eef8; }

/* רקעים של כרטיסים */
[data-theme="dark"] .chapter-card,
[data-theme="dark"] .exam-sel-card,
[data-theme="dark"] .sim-card,
[data-theme="dark"] .ch-header-bar,
[data-theme="dark"] .prog-stat-card,
[data-theme="dark"] .prog-chapter-row,
[data-theme="dark"] .prog-session-row,
[data-theme="dark"] .progress-gate,
[data-theme="dark"] .qs-mode-btn,
[data-theme="dark"] .qs-count-btn,
[data-theme="dark"] .quiz-container,
[data-theme="dark"] .option-btn,
[data-theme="dark"] .results-screen,
[data-theme="dark"] .quiz-setup,
[data-theme="dark"] .site-search-input,
[data-theme="dark"] #search-results,
[data-theme="dark"] .sr-item:hover,
[data-theme="dark"] .free-notice {
  background: #162033 !important;
  border-color: #243650 !important;
  color: #e6eef8 !important;
}

[data-theme="dark"] .tab-nav {
  background: #0f1828;
  border-bottom-color: #243650;
}
[data-theme="dark"] .tab-btn { color: #8ea0b8; }
[data-theme="dark"] .tab-btn.active { color: #f0c040; border-bottom-color: #f0c040; }
[data-theme="dark"] .tab-btn:hover:not(.active) { color: #b8c8e0; }

/* טקסטים */
[data-theme="dark"] .cc-title,
[data-theme="dark"] .esc-title,
[data-theme="dark"] .sim-title,
[data-theme="dark"] .ch-header-bar .chb-title,
[data-theme="dark"] .qs-title,
[data-theme="dark"] .prog-chapter-name,
[data-theme="dark"] .prog-session-chapter,
[data-theme="dark"] .progress-gate h3,
[data-theme="dark"] .practice-welcome h3,
[data-theme="dark"] .sr-title,
[data-theme="dark"] #q-text,
[data-theme="dark"] .option-btn span:last-child {
  color: #e6eef8 !important;
}

[data-theme="dark"] .cc-num,
[data-theme="dark"] .cc-meta,
[data-theme="dark"] .esc-meta,
[data-theme="dark"] .sim-meta,
[data-theme="dark"] .ch-header-bar .chb-name,
[data-theme="dark"] .qs-desc,
[data-theme="dark"] .prog-attempts,
[data-theme="dark"] .prog-session-detail,
[data-theme="dark"] .prog-stat-card small,
[data-theme="dark"] .practice-welcome p,
[data-theme="dark"] .progress-gate p,
[data-theme="dark"] .sr-meta,
[data-theme="dark"] .prog-section-title,
[data-theme="dark"] .sr-section-title,
[data-theme="dark"] .sr-header,
[data-theme="dark"] .site-search-input::placeholder,
[data-theme="dark"] .sr-empty {
  color: #8ea0b8 !important;
}

[data-theme="dark"] .cc-arrow,
[data-theme="dark"] .esc-arrow,
[data-theme="dark"] .sr-arrow {
  color: #4a6080;
}

/* רקעי משנה */
[data-theme="dark"] .sr-header,
[data-theme="dark"] .sr-section-title { background: #0f1828; border-color: #243650; }
[data-theme="dark"] .sr-item { border-color: #1f2b40; }
[data-theme="dark"] .sr-item:hover { background: #1c2840 !important; }
[data-theme="dark"] .prog-bar-wrap { background: #0f1828; }

/* כפתורים */
[data-theme="dark"] .btn-back {
  background: #1c2840;
  color: #b8c8e0;
  border-color: #243650;
}
[data-theme="dark"] .btn-back:hover { background: #243650; }
[data-theme="dark"] .qs-mode-btn.active,
[data-theme="dark"] .qs-count-btn.popular {
  background: linear-gradient(135deg,#1a3a5c,#2a5298) !important;
  color: white !important;
  border-color: #2a5298 !important;
}

/* תשובות */
[data-theme="dark"] .option-btn { color: #e6eef8; border-color: #243650; }
[data-theme="dark"] .option-btn:hover:not(:disabled) { border-color: #2a5298; background: #1c2840 !important; }
[data-theme="dark"] .option-btn.correct { background: #14352a !important; border-color: #27ae60 !important; color: #6ee7a8 !important; }
[data-theme="dark"] .option-btn.wrong { background: #3a1a20 !important; border-color: #e74c3c !important; color: #ff8a80 !important; }
[data-theme="dark"] .option-btn.selected { background: #1a2540 !important; border-color: #2a5298 !important; }

/* חיפוש — input */
[data-theme="dark"] .site-search-input { color: #e6eef8 !important; }
[data-theme="dark"] .site-search-icon { color: #8ea0b8; }
[data-theme="dark"] .site-search-clear { background: #243650; color: #b8c8e0; }
[data-theme="dark"] .sr-title mark { background: #5a4a10; color: #ffe28a; }

/* פאנל אדמין */
[data-theme="dark"] .admin-panel { background: #0f1828; }
[data-theme="dark"] .admin-panel-body { background: #0a1220; }
[data-theme="dark"] .adm-stat-card,
[data-theme="dark"] .adm-list { background: #162033; border-color: #243650; }
[data-theme="dark"] .adm-stat-val { color: #e6eef8; }
[data-theme="dark"] .adm-row { border-bottom-color: #243650; }
[data-theme="dark"] .adm-row-name { color: #e6eef8; }
[data-theme="dark"] .adm-row-meta { color: #8ea0b8; }
[data-theme="dark"] .adm-row-val { color: #b8c8e0; }
[data-theme="dark"] .adm-section-title { color: #b8c8e0; }

/* טופס תיאוריה */
[data-theme="dark"] .tcs-email-input {
  background: #162033;
  border-color: #243650;
  color: #e6eef8;
}

/* ── ADMIN PANEL ── */
.admin-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0c040, #e6a93a);
  border: none;
  box-shadow: 0 6px 20px rgba(15,37,64,0.25);
  cursor: pointer;
  font-size: 1.6rem;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.admin-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,37,64,0.35);
}
.admin-fab.show { display: flex; }

.admin-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,37,64,0.5);
  backdrop-filter: blur(3px);
  z-index: 9500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.admin-panel-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ─── User Details Modal ─── */
.ud-overlay {
  position: fixed; inset: 0;
  background: rgba(15,37,64,0.65);
  backdrop-filter: blur(4px);
  z-index: 9700; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.ud-overlay.show { opacity: 1; pointer-events: auto; }

.ud-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 460px; max-width: 92vw; max-height: 90vh;
  background: white; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  z-index: 9800; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  overflow: hidden; display: flex; flex-direction: column;
}
.ud-modal.show {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.ud-close {
  position: absolute; top: 12px; left: 12px;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: white;
  font-size: 1rem; cursor: pointer; z-index: 2;
  transition: background 0.15s;
}
.ud-close:hover { background: rgba(255,255,255,0.32); }

.ud-body { overflow-y: auto; padding: 0; }

.ud-header {
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
  color: white; padding: 24px 20px 18px; text-align: center;
  position: relative;
}
.ud-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #f0c040, #d8a020);
  color: #0f2540; font-weight: 900; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.ud-name {
  font-family: 'Frank Ruhl Libre', serif; font-size: 1.25rem;
  font-weight: 900; margin: 0 0 4px;
}
.ud-email {
  font-size: 0.82rem; color: rgba(255,255,255,0.8);
  word-break: break-all; margin-bottom: 8px;
}
.ud-badge-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ud-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 800;
  padding: 3px 10px; border-radius: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ud-badge.admin   { background: #fbbf24; color: #422006; }
.ud-badge.premium { background: #f0c040; color: #0f2540; }
.ud-badge.student { background: rgba(255,255,255,0.2); color: white; }
.ud-badge.expired { background: #ef4444; color: white; }

.ud-section {
  padding: 16px 20px; border-bottom: 1px solid #eef2f7;
}
.ud-section:last-child { border-bottom: none; }
.ud-section-title {
  font-size: 0.7rem; font-weight: 800; color: #8a9aaa;
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.ud-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 0.86rem; color: #1a3a5c;
}
.ud-info-row .lbl { color: #5a6a7a; }
.ud-info-row .val { font-weight: 700; color: #0f2540; }
.ud-info-row.warn .val { color: #b45309; }
.ud-info-row.danger .val { color: #b91c1c; }
.ud-info-row.success .val { color: #15803d; }

.ud-uid-box {
  background: #f5f7fa; padding: 8px 10px; border-radius: 8px;
  font-family: monospace; font-size: 0.72rem; color: #5a6a7a;
  word-break: break-all; cursor: pointer;
  border: 1px solid #e5e9f0; transition: background 0.15s;
}
.ud-uid-box:hover { background: #eef2f7; }

.ud-actions { padding: 16px 20px; background: #f7f9fc; }
.ud-actions-title {
  font-size: 0.7rem; font-weight: 800; color: #8a9aaa;
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
}
.ud-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ud-btn {
  flex: 1; min-width: 80px; padding: 10px 12px;
  border: none; border-radius: 8px; cursor: pointer;
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 0.82rem;
  transition: transform 0.1s, opacity 0.15s;
}
.ud-btn:hover { transform: translateY(-1px); }
.ud-btn:active { transform: translateY(0); }
.ud-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ud-btn-grant   { background: #f0c040; color: #0f2540; }
.ud-btn-extend  { background: #dbeafe; color: #1e40af; }
.ud-btn-revoke  { background: #fee2e2; color: #b91c1c; }
.ud-btn-device  { background: #fef3c7; color: #92400e; }
.ud-btn-secondary { background: #e5e9f0; color: #1a3a5c; }

.ud-days-label {
  font-size: 0.78rem; color: #5a6a7a; margin-bottom: 6px; display: block;
}

/* ═══════════════════════════════════════════════
   TOAST + CONFIRM DIALOG — מערכת גלובלית
═══════════════════════════════════════════════ */
#app-toast-container {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%); z-index: 99999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-width: 92vw; width: 380px;
}
.app-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  background: #1a3a5c; color: white;
  opacity: 0; transform: translateY(-12px);
  transition: opacity 0.25s, transform 0.25s;
  direction: rtl; line-height: 1.4;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast-icon {
  flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.app-toast-msg { flex: 1; word-break: break-word; }
.app-toast-info    { background: #1a3a5c; }
.app-toast-success { background: linear-gradient(135deg, #15803d, #16a34a); }
.app-toast-warn    { background: linear-gradient(135deg, #b45309, #d97706); }
.app-toast-error   { background: linear-gradient(135deg, #b91c1c, #dc2626); }

.app-confirm-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(15,37,64,0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity 0.2s;
}
.app-confirm-overlay.show { opacity: 1; }
.app-confirm-modal {
  background: white; border-radius: 16px;
  padding: 24px 22px 18px; max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  direction: rtl;
  transform: scale(0.96); transition: transform 0.2s;
}
.app-confirm-overlay.show .app-confirm-modal { transform: scale(1); }
.app-confirm-msg {
  font-family: 'Heebo', sans-serif; font-size: 1rem;
  font-weight: 600; color: #0f2540; line-height: 1.5;
  margin-bottom: 20px; white-space: pre-line;
}
.app-confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.app-confirm-btn {
  padding: 10px 22px; border: none; border-radius: 10px;
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; transition: transform 0.1s, opacity 0.15s;
}
.app-confirm-btn:hover { transform: translateY(-1px); }
.app-confirm-btn:focus-visible { outline: 2px solid #2a5298; outline-offset: 2px; }
.app-confirm-cancel {
  background: #e5e9f0; color: #1a3a5c;
}
.app-confirm-ok {
  background: linear-gradient(135deg, #1a3a5c, #2a5298); color: white;
}
.app-confirm-ok.danger {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

[data-theme="dark"] .app-confirm-modal { background: #0f1828; }
[data-theme="dark"] .app-confirm-msg { color: #e6eef8; }
[data-theme="dark"] .app-confirm-cancel { background: #243650; color: #e6eef8; }

[data-theme="dark"] .ud-modal { background: #0f1828; color: #e6eef8; }
[data-theme="dark"] .ud-section { border-bottom-color: #243650; }
[data-theme="dark"] .ud-info-row { color: #b8c8e0; }
[data-theme="dark"] .ud-info-row .lbl { color: #8ea0b8; }
[data-theme="dark"] .ud-info-row .val { color: #e6eef8; }
[data-theme="dark"] .ud-uid-box { background: #1a2638; border-color: #2c3a52; color: #8ea0b8; }
[data-theme="dark"] .ud-actions { background: #0a1220; }

.adm-row { cursor: pointer; transition: background 0.1s; }
.adm-row:hover { background: rgba(42,82,152,0.06); }
[data-theme="dark"] .adm-row:hover { background: rgba(42,82,152,0.15); }

.admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 420px;
  max-width: 92vw;
  background: white;
  box-shadow: -4px 0 30px rgba(0,0,0,0.2);
  z-index: 9600;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
}
.admin-panel.show { transform: translateX(0); }

.admin-panel-header {
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
  color: white;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.admin-panel-header h3 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.15rem;
  font-weight: 900;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-panel-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s;
}
.admin-panel-close:hover { background: rgba(255,255,255,0.25); }

.admin-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 30px;
}

.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.adm-stat-card {
  background: #f7f9fc;
  border: 1.5px solid #e8eef5;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.adm-stat-val {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: #0f2540;
  line-height: 1.1;
}
.adm-stat-lbl {
  font-size: 0.72rem;
  color: #7a8a9a;
  font-weight: 700;
  margin-top: 4px;
}
.adm-stat-card.gold .adm-stat-val { color: #c19a2e; }
.adm-stat-card.green .adm-stat-val { color: #15803d; }
.adm-stat-card.blue .adm-stat-val { color: #1e40af; }

.adm-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #5a6a7a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.adm-list {
  background: #f7f9fc;
  border: 1.5px solid #e8eef5;
  border-radius: 12px;
  padding: 8px 4px;
}
.adm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid #e8eef5;
}
.adm-row:last-child { border-bottom: none; }
.adm-row-left {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-row-name { color: #0f2540; font-weight: 600; }
.adm-row-meta { font-size: 0.72rem; color: #7a8a9a; margin-top: 2px; }
.adm-row-val { font-weight: 800; color: #1a3a5c; font-size: 0.85rem; flex-shrink: 0; padding-right: 10px; display: flex; align-items: center; gap: 6px; }
.adm-revoke-btn { background: #fee2e2; border: none; border-radius: 6px; color: #b91c1c; font-size: 0.75rem; font-weight: 800; cursor: pointer; padding: 2px 7px; line-height: 1.4; }
.adm-revoke-btn:hover { background: #fca5a5; }
.adm-revoke-btn:disabled { opacity: 0.5; cursor: default; }
.adm-reset-device-btn { background: #dbeafe; border: none; border-radius: 6px; color: #1e40af; font-size: 0.85rem; font-weight: 800; cursor: pointer; padding: 2px 7px; line-height: 1.4; }
.adm-reset-device-btn:hover { background: #93c5fd; }
.adm-reset-device-btn:disabled { opacity: 0.5; cursor: default; }
.adm-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  margin-right: 4px;
}
.adm-badge.premium { background: #fef3c7; color: #92400e; }
.adm-badge.admin   { background: #dbeafe; color: #1e40af; }
.adm-badge.student { background: #f3f4f6; color: #4b5563; }

.adm-loading,
.adm-empty {
  text-align: center;
  padding: 24px 16px;
  color: #8a9aaa;
  font-size: 0.85rem;
}

.adm-refresh-btn {
  background: #0f2540;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  margin-top: 14px;
}
.adm-refresh-btn:hover { background: #1a3a5c; }

/* ── Security dashboard launcher button (inside admin panel) ── */
.sec-launch-btn {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
  margin-top: 8px !important;
}
.sec-launch-btn:hover { background: linear-gradient(135deg, #991616, #6b1414) !important; }

/* ── Security stat card (red variant) ── */
.adm-stat-card.red .adm-stat-val { color: #b91c1c; }

/* ── Back button ── */
.sec-back-btn {
  background: transparent;
  border: none;
  color: #1a3a5c;
  font-family: 'Heebo', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0 14px;
  display: block;
}
.sec-back-btn:hover { color: #0f2540; text-decoration: underline; }
[data-theme="dark"] .sec-back-btn { color: #b8c8e0; }

/* ── Heartbeat card ── */
.sec-hb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1.5px solid transparent;
}
.sec-hb-green  { background: #ecfdf5; border-color: #a7f3d0; }
.sec-hb-yellow { background: #fffbeb; border-color: #fde68a; }
.sec-hb-red    { background: #fef2f2; border-color: #fca5a5; }
.sec-hb-icon   { font-size: 1.8rem; flex-shrink: 0; }
.sec-hb-body   { flex: 1; min-width: 0; }
.sec-hb-title  { font-weight: 800; color: #0f2540; font-size: 0.95rem; }
.sec-hb-sub    { font-size: 0.78rem; color: #5a6a7a; margin-top: 3px; line-height: 1.4; }
[data-theme="dark"] .sec-hb-green  { background: #062c20; border-color: #14532d; }
[data-theme="dark"] .sec-hb-yellow { background: #2a1f00; border-color: #78350f; }
[data-theme="dark"] .sec-hb-red    { background: #2a0a0a; border-color: #7f1d1d; }
[data-theme="dark"] .sec-hb-title  { color: #e6eef8; }
[data-theme="dark"] .sec-hb-sub    { color: #8ea0b8; }

/* ── Filter pills ── */
.sec-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sec-filter-btn {
  background: #f0f5fb;
  border: 1px solid #d8e3ee;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a6a7a;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sec-filter-btn:hover { background: #e2ecf6; }
.sec-filter-btn.active {
  background: #0f2540;
  color: white;
  border-color: #0f2540;
}
[data-theme="dark"] .sec-filter-btn {
  background: #0f1828;
  border-color: #243650;
  color: #b8c8e0;
}
[data-theme="dark"] .sec-filter-btn.active {
  background: #2a5298;
  border-color: #2a5298;
  color: white;
}

/* ── Alert card ── */
.sec-alerts-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}
.sec-alert {
  background: white;
  border: 1.5px solid #e8eef5;
  border-radius: 10px;
  padding: 10px 12px;
}
.sec-alert-acked { opacity: 0.55; background: #f7f9fc; }
.sec-alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sec-alert-icon { font-size: 1.05rem; flex-shrink: 0; }
.sec-alert-title {
  flex: 1;
  font-weight: 800;
  color: #0f2540;
  font-size: 0.88rem;
  line-height: 1.3;
  min-width: 0;
}
.sec-alert-time {
  font-size: 0.7rem;
  color: #8a9aaa;
  flex-shrink: 0;
  font-weight: 600;
}
.sec-alert-msg {
  font-size: 0.82rem;
  color: #5a6a7a;
  line-height: 1.45;
  margin: 4px 0;
}
.sec-alert-meta {
  font-size: 0.72rem;
  color: #7a8a9a;
  font-family: monospace;
  margin-top: 4px;
}
.sec-alert-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}
.sec-ack-btn {
  background: #d1fae5;
  color: #065f46;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.sec-ack-btn:hover { background: #a7f3d0; }
.sec-ack-btn:disabled { opacity: 0.5; cursor: default; }
.sec-ack-badge {
  background: #d1fae5;
  color: #065f46;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}
[data-theme="dark"] .sec-alert { background: #0f1828; border-color: #243650; }
[data-theme="dark"] .sec-alert-acked { background: #0a1220; }
[data-theme="dark"] .sec-alert-title { color: #e6eef8; }
[data-theme="dark"] .sec-alert-msg { color: #b8c8e0; }
[data-theme="dark"] .sec-alert-meta { color: #8ea0b8; }
[data-theme="dark"] .sec-ack-btn,
[data-theme="dark"] .sec-ack-badge { background: #14532d; color: #a7f3d0; }

@media (max-width: 600px) {
  .admin-fab {
    bottom: 18px;
    left: 18px;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
}

/* ── SITE SEARCH ── */
.site-search {
  position: relative;
  margin-bottom: 16px;
}
.site-search-input {
  width: 100%;
  padding: 13px 44px 13px 40px;
  border: 2px solid #e8eef5;
  border-radius: 12px;
  background: white;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  color: #0f2540;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.site-search-input:focus {
  border-color: #2a5298;
  box-shadow: 0 0 0 4px rgba(42,82,152,0.1);
}
.site-search-input::placeholder { color: #8a9aaa; }
.site-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
  color: #8a9aaa;
}
.site-search-clear {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #e8eef5;
  border: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  color: #5a6a7a;
  display: none;
  align-items: center;
  justify-content: center;
}
.site-search-clear:hover { background: #d8e3ee; }
.site-search-clear.show { display: flex; }

#search-results {
  display: none;
  background: white;
  border: 2px solid #e8eef5;
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
#search-results.show { display: block; }
.sr-header {
  padding: 10px 16px;
  background: #f7f9fc;
  font-size: 0.78rem;
  color: #5a6a7a;
  font-weight: 700;
  border-bottom: 1px solid #e8eef5;
}
.sr-section-title {
  padding: 10px 16px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #8a9aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafbfd;
}
.sr-item {
  padding: 12px 16px;
  border-top: 1px solid #f0f4f8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.1s;
}
.sr-item:hover { background: #f7f9fc; }
.sr-item.locked { opacity: 0.55; }
.sr-icon { font-size: 1.4rem; flex-shrink: 0; }
.sr-body { flex: 1; min-width: 0; }
.sr-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f2540;
  margin-bottom: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-meta {
  font-size: 0.74rem;
  color: #7a8a9a;
}
.sr-title mark {
  background: #fff3b8;
  color: #0f2540;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 800;
}
.sr-arrow { color: #c8d6e8; font-size: 1.1rem; flex-shrink: 0; }
.sr-empty {
  padding: 30px 20px;
  text-align: center;
  color: #8a9aaa;
  font-size: 0.9rem;
}

/* Upgrade banner in topics — קומפקטי, רוחב מלא */
.upgrade-banner {
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: row;        /* טקסט + כפתור בשורה אחת */
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: right;
  margin-top: 12px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(15,37,64,0.12);
}
#upgrade-banner { display: none; }
.ub-icon { display: none; }
.ub-body {
  flex: 1;
  min-width: 0;
}
.ub-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 900;
  color: white;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.ub-desc {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.4;
}
.upgrade-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #f0c040, #e8a830);
  color: #0f2540;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-family: 'Heebo', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  width: auto;
  box-shadow: 0 4px 14px rgba(240,192,64,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
@media (max-width: 520px) {
  .upgrade-banner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 14px 16px;
  }
  .upgrade-btn { width: 100%; }
}
.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240,192,64,0.45);
}
.upgrade-btn:active {
  transform: translateY(0);
}

/* ── PRACTICE TAB ── */
.practice-welcome {
  text-align: center; padding: 60px 20px;
  color: #7a8a9a;
}
.practice-welcome .pw-icon { font-size: 52px; margin-bottom: 14px; }
.practice-welcome h3 {
  font-family: 'Frank Ruhl Libre', serif;
  color: #1a3a5c; font-size: 1.2rem; margin-bottom: 8px;
}
.practice-welcome p { font-size: 0.88rem; }
.practice-welcome .pw-btn {
  margin-top: 18px; display: inline-block;
  background: #1a3a5c; color: white;
  border: none; border-radius: 10px; padding: 11px 22px;
  font-family: 'Heebo', sans-serif; font-weight: 700;
  font-size: 0.9rem; cursor: pointer;
}

.ch-header-bar {
  display: flex; align-items: center; gap: 12px;
  background: white; border-radius: 12px; padding: 12px 14px;
  margin-bottom: 14px; border: 2px solid #e8eef5;
}
.ch-header-bar .chb-icon { font-size: 1.8rem; }
.ch-header-bar .chb-meta { flex: 1; }
.ch-header-bar .chb-name { font-size: 0.72rem; font-weight: 700; color: #7a8a9a; }
.ch-header-bar .chb-title { font-size: 0.92rem; font-weight: 700; color: #0f2540; }
.btn-back {
  background: #f0f5ff; color: #2a5298;
  border: 2px solid #d8e3ee; border-radius: 8px;
  padding: 7px 12px; font-family: 'Heebo', sans-serif;
  font-weight: 700; font-size: 0.8rem; cursor: pointer;
  white-space: nowrap;
}
.btn-back:hover { background: #d8e3ee; }

/* ── EXAMS TAB ── */
.exam-hero-card {
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
  border-radius: 18px; padding: 36px 24px;
  text-align: center; margin-bottom: 16px;
}
.exam-hero-card .eh-icon { font-size: 52px; margin-bottom: 12px; }
.exam-hero-card h3 {
  font-family: 'Frank Ruhl Libre', serif;
  color: white; font-size: 1.4rem; font-weight: 900; margin-bottom: 6px;
}
.exam-hero-card p { color: rgba(255,255,255,0.65); font-size: 0.88rem; margin-bottom: 20px; }
.exam-hero-card .exam-stats {
  display: flex; justify-content: center; gap: 24px;
  margin-bottom: 22px;
}
.exam-hero-card .es-stat { text-align: center; }
.exam-hero-card .es-val { font-size: 1.5rem; font-weight: 900; color: #f0c040; }
.exam-hero-card .es-lbl { font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-top: 2px; }
.btn-start-exam {
  display: inline-block; text-decoration: none;
  background: #f0c040; color: #0f2540;
  padding: 13px 32px; border-radius: 10px;
  font-family: 'Heebo', sans-serif; font-weight: 900;
  font-size: 1rem; transition: opacity 0.15s;
}
.btn-start-exam:hover { opacity: 0.9; }
.exam-locked-msg {
  background: rgba(255,255,255,0.1); border-radius: 10px;
  padding: 12px 16px; margin-top: 12px;
  font-size: 0.82rem; color: rgba(255,255,255,0.7);
}

/* ── PROGRESS TAB ── */
.progress-gate {
  text-align: center; padding: 48px 20px;
  background: white; border-radius: 16px; border: 2px solid #e8eef5;
}
.progress-gate .pg-icon { font-size: 48px; margin-bottom: 12px; }
.progress-gate h3 { font-family:'Frank Ruhl Libre',serif; color:#1a3a5c; font-size:1.2rem; margin-bottom:8px; }
.progress-gate p { color:#7a8a9a; font-size:0.88rem; margin-bottom:20px; line-height:1.6; }
.btn-upgrade-prog {
  background: linear-gradient(135deg,#1a3a5c,#2a5298);
  color: white; border: none; border-radius: 10px;
  padding: 12px 28px; font-family:'Heebo',sans-serif;
  font-weight: 800; font-size: 0.95rem; cursor: pointer;
}

.prog-summary { display:flex; gap:10px; margin-bottom:18px; }
.prog-stat-card { flex:1; background:white; border-radius:12px; padding:14px 10px; text-align:center; border:2px solid #e8eef5; }
.prog-stat-card .psv { display:block; font-size:1.5rem; font-weight:900; color:#1a3a5c; }
.prog-stat-card small { font-size:0.7rem; color:#7a8a9a; font-weight:600; }

.prog-section-title { font-size:0.78rem; font-weight:700; color:#8a9aaa; text-transform:uppercase; letter-spacing:0.8px; margin:18px 0 10px; }

.prog-chapter-row { background:white; border-radius:11px; padding:12px 14px; margin-bottom:8px; border:1.5px solid #e8eef5; }
.prog-chapter-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:7px; }
.prog-chapter-name { font-size:0.87rem; font-weight:700; color:#0f2540; }
.prog-chapter-stats { display:flex; align-items:center; gap:10px; }
.prog-attempts { font-size:0.7rem; color:#8a9aaa; }
.prog-best-pct { font-size:0.88rem; font-weight:900; }
.prog-best-pct.pass { color:#27ae60; }
.prog-best-pct.fail { color:#e74c3c; }
.prog-bar-wrap { height:5px; background:#f0f5ff; border-radius:3px; overflow:hidden; }
.prog-bar-fill { height:100%; border-radius:3px; }

.prog-session-row { display:flex; align-items:center; gap:10px; padding:10px 14px; background:white; border-radius:10px; margin-bottom:7px; border:1.5px solid #e8eef5; }
.prog-session-chapter { flex:1; font-size:0.84rem; font-weight:600; color:#0f2540; }
.prog-session-score { font-size:0.88rem; font-weight:900; min-width:40px; text-align:center; }
.prog-session-score.pass { color:#27ae60; }
.prog-session-score.fail { color:#e74c3c; }
.prog-session-detail { font-size:0.7rem; color:#8a9aaa; }

.prog-loading { text-align:center; padding:40px; color:#8a9aaa; font-size:0.9rem; }
.prog-empty { text-align:center; padding:40px 20px; color:#7a8a9a; }
.prog-empty .pe-icon { font-size:40px; margin-bottom:10px; }

/* ── MODE TOGGLE ── */
.qs-mode-row { display:flex; gap:8px; margin-bottom:16px; }
.qs-mode-btn {
  flex:1; padding:11px 8px; border:2px solid #d8e3ee; border-radius:10px;
  background:#f7f9fc; font-family:'Heebo',sans-serif; font-weight:700;
  font-size:0.88rem; color:#5a6a7a; cursor:pointer; transition:all 0.15s;
}
.qs-mode-btn.active { border-color:#1a3a5c; background:#1a3a5c; color:white; }

/* ── QUIZ SETUP ── */
.qs-card { background:white; border-radius:16px; padding:22px 18px; box-shadow:0 4px 16px rgba(0,0,0,0.06); }
.qs-header { text-align:center; margin-bottom:18px; }
.qs-icon { font-size:36px; margin-bottom:7px; }
.qs-header h3 { font-family:'Frank Ruhl Libre',serif; font-size:1.2rem; color:#0f2540; margin-bottom:3px; }
.qs-header p { color:#5a6a7a; font-size:0.83rem; }
.qs-label { font-size:0.88rem; font-weight:700; color:#1a3a5c; display:block; margin-bottom:10px; }
.qs-count-grid { display:flex; flex-wrap:wrap; gap:9px; }
.qs-count-btn {
  flex:1; min-width:70px; padding:13px 8px; background:#f0f5ff;
  border:2px solid #d8e3ee; border-radius:10px; font-family:'Heebo',sans-serif;
  font-weight:700; font-size:0.9rem; color:#1a3a5c; cursor:pointer;
  transition:all 0.15s; text-align:center; line-height:1.3;
}
.qs-count-btn:hover { border-color:#2a5298; background:#e8f0fe; }
.qs-count-btn.popular { border-color:#f0c040; background:#fffde7; }
.qs-info {
  display:flex; flex-wrap:wrap; justify-content:center; gap:16px;
  margin-top:16px; font-size:0.82rem; color:#5a6a7a; font-weight:600;
  background:#f7f9fc; border-radius:10px; padding:10px;
}

/* ── QUIZ TIMER ── */
.quiz-timer {
  font-size:0.88rem; font-weight:800; padding:4px 10px;
  background:rgba(255,255,255,0.15); border-radius:8px;
  border:1px solid rgba(255,255,255,0.25); color:white; letter-spacing:0.5px;
}
.btn-topbar-finish {
  background: #27ae60; color: white; border: none; border-radius: 8px;
  padding: 4px 12px; font-family: 'Heebo', sans-serif; font-weight: 700;
  font-size: 0.85rem; cursor: pointer; transition: opacity 0.15s;
}
.btn-topbar-finish:hover { opacity: 0.85; }

/* ── TIMER TOAST ── */
.quiz-toast {
  position: fixed; top: 76px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  padding: 11px 22px; border-radius: 12px;
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 0.95rem;
  color: white; background: #1a3a5c;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 9999; pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.quiz-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.quiz-toast.warning { background: #d97706; }
.quiz-toast.danger  { background: #dc2626; }
.quiz-timer.warning { background:rgba(255,160,0,0.3); border-color:#ffa000; color:#ffe082; }
.quiz-timer.danger  { background:rgba(229,57,53,0.35); border-color:#e53935; color:#ff8a80; animation:timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1}50%{opacity:0.6} }

/* ── NAV DOTS ── */
.q-nav-dots { 
  display: flex; 
  flex-wrap: nowrap; 
  overflow-x: auto; 
  gap: 6px; 
  padding: 10px 14px 14px 14px; /* קצת יותר מרווח למטה בשביל הפס */
  background: #f7f9fc; 
  border-bottom: 1px solid #e8eef5; 
  -webkit-overflow-scrolling: touch; 
  flex-shrink: 0; 
}

/* עיצוב פס גלילה דק ואלגנטי למחשב */
.q-nav-dots::-webkit-scrollbar { height: 6px; }
.q-nav-dots::-webkit-scrollbar-track { background: transparent; }
.q-nav-dots::-webkit-scrollbar-thumb { background: #c8d6e8; border-radius: 10px; }
.q-nav-dots::-webkit-scrollbar-thumb:hover { background: #aab8c8; }

.qnd { 
  width: 28px; 
  height: 28px; 
  flex-shrink: 0; 
  border-radius: 6px; 
  border: none; 
  font-size: 0.75rem; 
  font-weight: 700; 
  cursor: pointer; 
  background: #f0f5ff; 
  color: #5a6a7a; 
  transition: all 0.12s; 
}
.qnd:hover { background: #d8e3ee; }
.qnd.ans  { background: #1a3a5c; color: white; }
.qnd.flag { background: #f0c040; color: #0f2540; }
.qnd.curr { box-shadow: 0 0 0 2.5px #2a5298; }

/* ── AUTO-ADVANCE BAR ── */
.auto-advance-bar {
  height: 3px;
  background: #27ae60;
  width: 0%;
  opacity: 0;
  flex-shrink: 0;
}

/* ── QUIZ FOOTER ── */
.quiz-footer { display:flex; gap:8px; justify-content:space-between; align-items:center; padding:12px 16px max(16px, env(safe-area-inset-bottom)); }
.btn-quiz-nav { padding:10px 18px; border:none; border-radius:9px; font-family:'Heebo',sans-serif; font-weight:700; font-size:0.9rem; cursor:pointer; transition:all 0.15s; }
.btn-prev-q { background:#f0f5ff; color:#2a5298; border:2px solid #d8e3ee; }
.btn-prev-q:hover { background:#d8e3ee; }
.btn-next-q { background:linear-gradient(135deg,#1a3a5c,#2a5298); color:white; }
.btn-next-q:hover { opacity:0.9; }
.btn-flag-q { padding:9px 14px; border-radius:8px; border:2px solid #f0c040; background:#fffde7; color:#c8940b; font-family:'Heebo',sans-serif; font-weight:700; font-size:0.82rem; cursor:pointer; white-space:nowrap; }
.btn-flag-q.flagged { background:#f0c040; color:#0f2540; }

/* ── OPTION SELECTED ── */
.option-btn.selected { border-color:#1a3a5c !important; background:#e8f0fe !important; font-weight:700; }
.option-btn.selected .option-letter { background:#1a3a5c; color:white; }

/* ── RESULT STATS ── */
.result-stats-row { display:flex; gap:10px; margin:14px 0; }
.rs-stat { flex:1; background:white; border-radius:11px; padding:12px 8px; text-align:center; box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.rs-stat span { display:block; font-size:1.7rem; font-weight:900; color:#1a3a5c; }
.rs-stat small { font-size:0.73rem; color:#5a6a7a; font-weight:600; }
.rs-stat.correct span { color:#27ae60; }
.rs-stat.wrong   span { color:#e74c3c; }
.rs-stat.flagged span { color:#f59e0b; }

/* ── REVIEW ── */
.review-toggle-btn { background:white; border-radius:10px; padding:13px 16px; margin-bottom:8px; cursor:pointer; display:flex; justify-content:space-between; font-weight:700; color:#1a3a5c; box-shadow:0 2px 8px rgba(0,0,0,0.06); font-size:0.9rem; }
.review-filters { display:flex; gap:8px; margin-bottom:10px; }
.rf-btn { flex:1; padding:7px 10px; border:2px solid #e8eef5; border-radius:8px; background:white; font-family:'Heebo',sans-serif; font-size:0.82rem; font-weight:700; cursor:pointer; color:#5a6a7a; transition:all 0.15s; }
.rf-btn.active { background:#1a3a5c; color:white; border-color:#1a3a5c; }
.rr-item { border-radius:10px; padding:11px 14px; margin-bottom:7px; font-size:0.84rem; line-height:1.6; background:#fff5f5; border:1.5px solid #fecaca; }
.rr-item.rr-flagged { background:#fffbeb; border-color:#fbbf24; }
.rr-q      { font-weight:700; color:#0f2540; margin-bottom:4px; }
.rr-correct { color:#15803d; font-weight:700; }
.rr-wrong   { color:#b91c1c; text-decoration:line-through; }
.rr-exp    { color:#5a6a7a; font-size:0.78rem; margin-top:5px; font-style:italic; border-top:1px solid rgba(0,0,0,0.06); padding-top:5px; }

/* ── TOPICS TAB — EXAM SELECTOR ── */
.exam-sel-grid {
  display: flex; flex-direction: column; gap: 16px;
}
.exam-sel-card {
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
  border-radius: 20px; padding: 28px 24px;
  display: flex; align-items: center; gap: 20px;
  cursor: pointer; transition: all 0.18s;
  box-shadow: 0 4px 24px rgba(15,37,64,0.18);
  border: 2px solid rgba(255,255,255,0.08);
}
.exam-sel-card:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(15,37,64,0.28); }
.esc-icon {
  font-size: 3rem; flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 16px; width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
}
.esc-info { flex: 1; }
.esc-title { font-family: 'Frank Ruhl Libre', serif; font-size: 1.4rem; font-weight: 900; color: white; }
.esc-meta  { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 6px; }
.esc-arrow { color: rgba(255,255,255,0.4); font-size: 1.6rem; flex-shrink: 0; }

@media (min-width: 600px) {
  .exam-sel-grid {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
  }
  .exam-sel-card {
    flex: 1;
    max-width: 380px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 28px;
    gap: 16px;
  }
  .esc-icon {
    width: 90px; height: 90px;
    font-size: 3.6rem;
  }
  .esc-info { flex: none; }
  .esc-title { font-size: 1.6rem; }
  .esc-meta { font-size: 0.9rem; }
  .esc-arrow { display: none; }
}

/* ── EXAM BACK BAR ── */
.exam-back-bar {
  display: flex; align-items: center; gap: 10px;
  background: white; border-radius: 12px; padding: 12px 14px;
  margin-bottom: 14px; border: 2px solid #e8eef5;
}
.ebb-title { flex: 1; font-weight: 800; color: #0f2540; font-size: 0.95rem; text-align: center; }

/* ── SIMULATIONS TAB ── */
.sim-specs-bar {
  display: flex; justify-content: center; gap: 32px;
  background: linear-gradient(135deg,#0f2540,#1a3a5c);
  border-radius: 14px; padding: 20px; margin-bottom: 16px;
}
.ssb-stat { text-align: center; }
.ssb-val { font-size: 1.8rem; font-weight: 900; color: #f0c040; line-height: 1; }
.ssb-lbl { font-size: 0.72rem; color: rgba(255,255,255,0.65); margin-top: 4px; }
.sim-card {
  background: white; border-radius: 14px; padding: 18px 20px;
  border: 2px solid #e8eef5; margin-bottom: 12px;
}
.sim-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sim-icon { font-size: 2rem; flex-shrink: 0; }
.sim-title { font-family: 'Frank Ruhl Libre', serif; font-size: 1.1rem; font-weight: 900; color: #0f2540; }
.sim-meta  { font-size: 0.78rem; color: #7a8a9a; margin-top: 3px; }
.btn-start-sim {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg,#1a3a5c,#2a5298);
  color: white; border: none; border-radius: 10px;
  font-family: 'Heebo',sans-serif; font-weight: 800; font-size: 0.95rem; cursor: pointer;
  transition: opacity 0.15s;
}
.btn-start-sim:hover { opacity: 0.9; }
.btn-start-sim.locked { background: #e8eef5; color: #8a9aaa; cursor: default; }

/* ── FREE NOTICE ── */
.free-notice { display:flex; align-items:center; gap:8px; background:#e6f9ef; border:1.5px solid #a7f3c8; border-radius:10px; padding:10px 14px; font-size:0.85rem; font-weight:600; color:#15803d; margin-bottom:14px; }

/* ── AUTH NEW FLOW ── */
.auth-step-container { transition: all 0.3s ease-in-out; }
#auth-overlay input:focus { border-color: #1a3a5c !important; box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
#step-email, #step-login, #step-register { animation: slideIn 0.3s ease-out; }

/* ═══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.tab-panel { display:none; }
.tab-panel.active { display:block; }

#tab-practice .tab-inner {
  max-width:700px; width:100%; margin:0 auto; padding:16px;
}
#tab-practice.quiz-active .tab-inner { padding:0; }

.quiz-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* מלבן התרגול המרכזי */
#tab-practice.quiz-active .quiz-container {
  position: fixed;
  top: 108px;
  height: calc(100vh - 140px); /* <<< פותר את החיתוך! גובה מוחלט ששומר על הכפתורים */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 750px; 
  border-radius: 14px; 
  box-shadow: 0 4px 32px rgba(15,37,64,0.15);
  z-index: 50;
}

.quiz-topbar, .quiz-progress-bar, .q-nav-dots, .quiz-footer { flex-shrink: 0; }

.question-card {
  flex: 1; 
  overflow-y: auto; 
  min-height: 0; 
  padding: 10px 16px 8px; 
}

.options-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px; 
}

.option-btn {
  padding: 8px 14px !important;
  min-height: 40px !important; 
}
.explanation.show {
  padding: 8px 14px !important;
  margin-top: 8px !important;
}

@media (min-width: 901px) {
  #tab-practice.quiz-active .quiz-container {
    max-width: 750px; 
  }
  .question-card {
    display: flex;
    flex-direction: column; 
    gap: 10px; 
    align-items: stretch;
  }
  .question-text {
    margin-bottom: 0;
    font-size: 1.05rem; 
    position: static; 
  }
  .options-wrap {
    width: 100%;
  }
}

@media (max-width: 900px) {
  #tab-practice.quiz-active .quiz-container {
    left: 0;
    top: 108px;
    height: calc(100vh - 108px); /* בנייד מנצל את כל המסך עד למטה */
    transform: none;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
  }
  .options-wrap { display: contents; }
}

.btn-topbar-exit {
  background:rgba(255,255,255,0.18); border:1px solid rgba(255,255,255,0.28);
  color:white; width:30px; height:30px; border-radius:7px; flex-shrink:0;
  cursor:pointer; font-size:0.9rem; display:flex; align-items:center; justify-content:center; padding:0;
}
.btn-topbar-exit:hover { background:rgba(255,255,255,0.32); }

/* ── TAB SOON BADGE ── */
.tab-soon-badge {
  font-size: 0.52rem; font-weight: 800; letter-spacing: 0.3px;
  background: linear-gradient(135deg, #f0c040, #e8a800);
  color: #0f2540; padding: 1px 5px; border-radius: 4px;
  line-height: 1.4; margin-top: -1px;
}

/* ── THEORY COMING SOON ── */
.theory-coming-soon {
  position: relative; overflow: hidden;
  text-align: center;
  background: linear-gradient(160deg, #0f2540 0%, #1a3a5c 55%, #1e4976 100%);
  border-radius: 24px;
  padding: 52px 28px 44px;
  color: white;
  margin-top: 8px;
}
.tcs-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,192,64,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.tcs-icon {
  font-size: 4rem; margin-bottom: 16px;
  filter: drop-shadow(0 4px 16px rgba(240,192,64,0.4));
}
.tcs-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f0c040, #e8a800);
  color: #0f2540; font-weight: 900; font-size: 0.78rem;
  padding: 4px 14px; border-radius: 20px; letter-spacing: 0.5px;
  margin-bottom: 18px;
}
.tcs-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 2rem; font-weight: 900; color: white;
  margin-bottom: 12px; line-height: 1.2;
}
.tcs-desc {
  font-size: 0.95rem; color: rgba(255,255,255,0.65);
  max-width: 440px; margin: 0 auto 32px;
  line-height: 1.7;
}
.tcs-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 440px; margin: 0 auto 36px;
}
@media (min-width: 600px) {
  .tcs-features { grid-template-columns: repeat(4, 1fr); max-width: 640px; }
}
.tcs-feature {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; padding: 16px 10px;
  transition: background 0.15s;
}
.tcs-feature:hover { background: rgba(255,255,255,0.14); }
.tcs-feat-icon { font-size: 1.6rem; margin-bottom: 8px; }
.tcs-feat-text { font-size: 0.78rem; color: rgba(255,255,255,0.75); font-weight: 600; line-height: 1.3; }

.tcs-notify-box {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px; padding: 22px 20px;
  max-width: 420px; margin: 0 auto;
}
.tcs-notify-label {
  font-size: 0.88rem; color: rgba(255,255,255,0.7);
  font-weight: 600; margin-bottom: 12px;
}
.tcs-notify-row { display: flex; gap: 8px; }
/* honeypot — חבוי מבחינה ויזואלית אך נשאר ב-DOM כדי שבוטים אוטומטיים ימלאו אותו.
   לא משתמשים ב-display:none / visibility:hidden כי בוטים חכמים מדלגים על שדות
   שאינם נראים. הטכניקה: דחיפה מחוץ ל-viewport. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}
.tcs-email-input {
  flex: 1; padding: 11px 14px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 9px; color: white;
  font-family: 'Heebo', sans-serif; font-size: 0.9rem;
  outline: none; direction: rtl;
}
.tcs-email-input::placeholder { color: rgba(255,255,255,0.35); }
.tcs-email-input:focus { border-color: #f0c040; }
.tcs-notify-btn {
  padding: 11px 18px; border: none; border-radius: 9px;
  background: linear-gradient(135deg, #f0c040, #e8a800);
  color: #0f2540; font-family: 'Heebo', sans-serif;
  font-weight: 800; font-size: 0.88rem; cursor: pointer;
  white-space: nowrap; transition: opacity 0.15s;
}
.tcs-notify-btn:hover { opacity: 0.88; }
.tcs-notify-btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* checkbox הסכמה — חובה לפי סעיף 30א לחוק התקשורת. נשאר בהיר וקריא ברקע כהה. */
.tcs-consent-row {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 12px; padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 0.82rem; line-height: 1.55;
  color: rgba(255,255,255,0.78); cursor: pointer;
}
.tcs-consent-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px;
  flex-shrink: 0; cursor: pointer; accent-color: #f0c040;
}
.tcs-consent-row strong { color: #f0c040; font-weight: 700; }
.tcs-consent-row:hover { background: rgba(255,255,255,0.08); }
.tcs-msg { min-height: 20px; margin-top: 10px; font-size: 0.85rem; font-weight: 700; }

/* ── פוטר נגישות (חובה ב-app + exam) — שקוף, מתמזג עם רקע הדף ── */
.app-footer-a11y {
  text-align: center; padding: 18px 16px;
  font-size: 0.78rem; color: #5a6a7a;
  background: transparent; border-top: 1px solid #d8e3ee;
  margin-top: 24px;
}
.app-footer-a11y a {
  color: #2a5298; text-decoration: none;
  margin: 0 6px; font-weight: 600;
}
.app-footer-a11y a:hover { text-decoration: underline; }
[data-theme="dark"] .app-footer-a11y {
  color: rgba(255,255,255,0.55); border-top-color: #243650;
}
[data-theme="dark"] .app-footer-a11y a { color: #8aaae0; }


/* ── INIT LOADER ── */
#app-init-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
}
#app-init-loader .ail-icon { font-size: 3.2rem; animation: ail-bounce 1.2s ease-in-out infinite; }
@keyframes ail-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
#app-init-loader .ail-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.6rem; font-weight: 900; color: #fff; margin: 0;
}
#app-init-loader .ail-sub {
  font-size: 0.85rem; color: rgba(255,255,255,0.6);
}
#app-init-loader .ail-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #f0c040;
  border-radius: 50%;
  animation: ail-spin 0.8s linear infinite;
}
@keyframes ail-spin { to { transform: rotate(360deg); } }

/* ── COUPON PANEL ── */
  .cp-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); z-index: 3000;
    align-items: flex-start; justify-content: center;
    padding: 24px; overflow-y: auto;
  }
  .cp-modal {
    background: white; border-radius: 18px; width: 100%;
    max-width: 680px; box-shadow: 0 24px 64px rgba(0,0,0,0.3); margin: auto;
  }
  .cp-header {
    background: linear-gradient(135deg, #0f2540, #2a5298);
    border-radius: 18px 18px 0 0; padding: 22px 28px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
  }
  .cp-header h2 {
    font-family: 'Frank Ruhl Libre', serif; color: white;
    font-size: 1.4rem; font-weight: 900; margin-bottom: 3px;
  }
  .cp-header p { color: rgba(255,255,255,0.6); font-size: 0.82rem; margin: 0; }
  .cp-close-btn {
    background: rgba(255,255,255,0.15); border: none; color: white;
    width: 36px; height: 36px; border-radius: 8px; font-size: 1.2rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .cp-content { padding: 28px; }
  .cp-section-title {
    font-size: 0.95rem; font-weight: 700; color: #1a3a5c;
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid #d8e3ee;
  }
  .cp-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px; margin-bottom: 14px;
  }
  .cp-field { min-width: 0; }
  .cp-field label {
    font-size: 0.8rem; font-weight: 700; color: #5a6a7a;
    display: block; margin-bottom: 5px; line-height: 1.3;
  }
  .cp-field input, .cp-field select {
    width: 100%; min-width: 0; max-width: 100%;
    padding: 10px 12px;
    border: 2px solid #d8e3ee; border-radius: 8px;
    font-family: 'Heebo', sans-serif; font-size: 0.9rem;
    outline: none; box-sizing: border-box;
    -webkit-appearance: none; appearance: none;
  }
  .cp-field input[type="date"] {
    direction: ltr;
    /* iOS Safari: input type=date has intrinsic min-width — force shrink */
    min-height: 42px; /* תיקון height אחרי הסרת appearance */
  }
  .cp-field input[type="date"]::-webkit-date-and-time-value {
    text-align: right;
  }
  /* החזרת חץ ב-select אחרי הסרת appearance */
  .cp-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235a6a7a'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 8px center;
    background-size: 18px;
    padding-left: 32px;
  }
  .cp-field input[id="cp-prefix"], .cp-field input[id="cp-custom"] { letter-spacing: 1px; }
  .cp-preview {
    background: #f0f5ff; border: 2px dashed #3d6bb5;
    border-radius: 10px; padding: 14px 18px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
  }
  .cp-preview-label { font-size: 0.85rem; color: #5a6a7a; }
  .cp-preview-code {
    font-family: monospace; font-size: 1.1rem; font-weight: 800;
    color: #0f2540; letter-spacing: 2px;
  }
  .cp-preview-desc { font-size: 0.85rem; color: #2a5298; font-weight: 700; }
  .cp-submit-btn {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #1a3a5c, #2a5298);
    color: white; border: none; border-radius: 8px;
    font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 1rem;
    cursor: pointer; margin-bottom: 4px;
  }
  .cp-existing-title {
    font-size: 0.95rem; font-weight: 700; color: #1a3a5c;
    margin: 24px 0 14px; padding-bottom: 10px;
    border-bottom: 2px solid #d8e3ee;
  }
  /* ─── מובייל ─── */
  @media (max-width: 600px) {
    .cp-overlay { padding: 0; align-items: stretch; justify-content: stretch; }
    .cp-modal {
      border-radius: 0; max-width: 100vw; width: 100vw;
      min-height: 100vh; margin: 0;
    }
    .cp-header {
      border-radius: 0; padding: 16px 18px;
      position: sticky; top: 0; z-index: 5;
    }
    .cp-header h2 { font-size: 1.15rem; }
    .cp-header p { font-size: 0.74rem; }
    .cp-content { padding: 18px 16px; }
    .cp-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .cp-preview {
      flex-direction: column; align-items: stretch;
      text-align: center; gap: 6px; padding: 14px;
    }
    .cp-preview-code { font-size: 1.25rem; }
  }

/* ── נגישות: כיבוד העדפת תנועה מופחתת ──
   משתמשים עם רגישות וסטיבולרית או מי שהגדיר במערכת ההפעלה
   prefers-reduced-motion=reduce — מקבלים אנימציות מינימליות. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — מסך בית, מאמן AI, פאנל אדמין (קלאסים חדשים 12-2026)
   המודולים מזריקים סגנון inline עם רקעים לבנים — נדרס כאן.
   ═══════════════════════════════════════════════════════════════ */

/* ── HOME SCREEN ─────────────────────────────────────────────── */
[data-theme="dark"] .home-hi { color: #e6eef8; }
[data-theme="dark"] .home-hi-sub { color: #8ea0b8; }
[data-theme="dark"] .home-quota {
  background: #1a2c4a; color: #b8ccf0; border-color: #2a3f60;
}

[data-theme="dark"] .home-cta { background: #1a2c4a; }
[data-theme="dark"] .home-cta:hover { background: #243a5c; }
[data-theme="dark"] .home-cta-ic { background: #3a5fa8; }

[data-theme="dark"] .home-stat { background: #162033; border-color: #2a3a52; }
[data-theme="dark"] .home-stat-gold {
  background: #2a2010; border-color: #5a4520;
}
[data-theme="dark"] .home-stat-gold .home-stat-val { color: #f0c060; }
[data-theme="dark"] .home-stat-green {
  background: #102818; border-color: #2a5a3a;
}
[data-theme="dark"] .home-stat-green .home-stat-val { color: #70d090; }
[data-theme="dark"] .home-stat-blue {
  background: #122038; border-color: #2a4068;
}
[data-theme="dark"] .home-stat-blue .home-stat-val { color: #8ab8f0; }
[data-theme="dark"] .home-stat-val { color: #e6eef8; }
[data-theme="dark"] .home-stat-lbl { color: #8ea0b8; }

[data-theme="dark"] .home-sc {
  background: #162033; border-color: #2a3a52;
}
[data-theme="dark"] .home-sc-header { color: #8ea0b8; }
[data-theme="dark"] .home-sc-title { color: #e6eef8; }
[data-theme="dark"] .home-sc-sub { color: #8ea0b8; }
[data-theme="dark"] .home-sc-badge-red { color: #ff7070; }
[data-theme="dark"] .home-sc-badge-amber { color: #f0c060; }
[data-theme="dark"] .home-sc-badge-green { color: #70d090; }
[data-theme="dark"] .home-sc-empty { color: #6a7a92; }
[data-theme="dark"] .home-sc-btn { background: #2a5298; }
[data-theme="dark"] .home-sc-btn:hover { background: #3a6ab8; }
[data-theme="dark"] .home-sc-clear {
  background: transparent; border-color: #2a3a52; color: #8ea0b8;
}
[data-theme="dark"] .home-sc-clear:hover { background: #1a2538; }
[data-theme="dark"] .home-sc-date {
  background: #0f1a2a; border-color: #2a3a52; color: #e6eef8;
}

[data-theme="dark"] .home-sec-title { color: #e6eef8; }
[data-theme="dark"] .home-refresh {
  border-color: #2a3a52; color: #b8ccf0;
}
[data-theme="dark"] .home-refresh:hover { background: #1a2538; }

[data-theme="dark"] .home-insight {
  background: #162033; border-color: #2a3a52;
}
[data-theme="dark"] .home-insight:hover { border-color: #3a5070; }
[data-theme="dark"] .home-insight-title { color: #e6eef8; }
[data-theme="dark"] .home-insight-body { color: #b0bac8; }
[data-theme="dark"] .home-ic-blue { background: #1a3050; }
[data-theme="dark"] .home-ic-gold { background: #3a2810; }
[data-theme="dark"] .home-ic-green { background: #143020; }

[data-theme="dark"] .home-more-btn {
  border-color: #2a3a52; color: #b8ccf0;
}
[data-theme="dark"] .home-more-btn:hover { background: #1a2538; }

[data-theme="dark"] .home-ask {
  background: #162033; border-color: #2a3a52;
}
[data-theme="dark"] .home-ask:focus-within { border-color: #3a5fa8; }
[data-theme="dark"] .home-ask input { color: #e6eef8; }
[data-theme="dark"] .home-ask input::placeholder { color: #6a7a92; }
[data-theme="dark"] .home-ask button { background: #2a5298; }
[data-theme="dark"] .home-ask button:hover { background: #3a6ab8; }

[data-theme="dark"] .home-upsell {
  background: #162033; border-color: #2a3a52;
}
[data-theme="dark"] .home-upsell-t { color: #e6eef8; }
[data-theme="dark"] .home-upsell-p { color: #b0bac8; }

[data-theme="dark"] .home-muted { color: #6a7a92; }
[data-theme="dark"] .home-divider { background: #2a3a52; }

/* ── COACH / מאמן AI ─────────────────────────────────────────── */
[data-theme="dark"] .coach-head h2 { color: #e6eef8; }
[data-theme="dark"] .coach-head p { color: #8ea0b8; }
[data-theme="dark"] .coach-quota { color: #6a7a92; }
[data-theme="dark"] .coach-insight {
  background: #162033; border-right-color: #3a5fa8;
}
[data-theme="dark"] .coach-insight-title { color: #b8ccf0; }
[data-theme="dark"] .coach-insight-body { color: #b0bac8; }
[data-theme="dark"] .coach-refresh {
  border-color: #2a3a52; color: #b8ccf0;
}
[data-theme="dark"] .coach-section-bar h3 { color: #e6eef8; }
[data-theme="dark"] .coach-collapse {
  border-color: #2a3a52; color: #b8ccf0;
}
[data-theme="dark"] .coach-collapse:hover { background: #1a2538; }
[data-theme="dark"] .coach-chat {
  background: #162033; border-color: #2a3a52;
}
[data-theme="dark"] .coach-msg.bot { background: #1a2538; color: #e6eef8; }
[data-theme="dark"] .coach-msg.user { background: #2a5298; color: #fff; }
[data-theme="dark"] .coach-msg.err { background: #3a1818; color: #ff8080; }
[data-theme="dark"] .coach-inputrow {
  background: #0f1a2a; border-top-color: #2a3a52;
}
[data-theme="dark"] .coach-inputrow textarea {
  background: #162033; border-color: #2a3a52; color: #e6eef8;
}
[data-theme="dark"] .coach-inputrow textarea::placeholder { color: #6a7a92; }
[data-theme="dark"] .coach-typing { color: #6a7a92; }
[data-theme="dark"] .coach-gate { background: #162033; }
[data-theme="dark"] .coach-gate h2 { color: #e6eef8; }
[data-theme="dark"] .coach-gate p { color: #b0bac8; }

/* ── כפתור "הסבר לי" (AI) ──────────────────────────────────── */
.quiz-explain-btn {
  background: linear-gradient(135deg, #2a5298, #3a6ab8);
  color: #fff; border: none; border-radius: 10px;
  padding: 9px 16px; font-family: inherit; font-weight: 800;
  font-size: 0.86rem; cursor: pointer; transition: opacity 0.15s;
}
.quiz-explain-btn:hover { opacity: 0.9; }
.quiz-explain-btn:disabled { opacity: 0.6; cursor: default; }
[data-theme="dark"] #quiz-explain-ans {
  background: #1a2538 !important; color: #b8ccf0 !important;
  border-right-color: #3a5fa8 !important;
}

/* ── Language dropdown בכותרת ────────────────────────────── */
.lang-dd { position: relative; display: inline-block; }
.lang-dd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-family: inherit; font-size: 0.78rem; font-weight: 700;
  padding: 6px 12px; border-radius: 22px; cursor: pointer; transition: background 0.15s;
}
.lang-dd-btn:hover { background: rgba(255,255,255,0.2); }
.lang-dd-arrow { font-size: 0.65rem; opacity: 0.8; }
.lang-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border: 1.5px solid #e3e8f0; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  min-width: 160px; padding: 6px; z-index: 9999;
  animation: lang-dd-fade 0.15s ease;
}
@keyframes lang-dd-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.lang-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #0f2540; text-decoration: none; font-size: 0.88rem; font-weight: 600;
  transition: background 0.12s;
}
.lang-dd-item:hover { background: #eef2ff; }
.lang-dd-flag { font-size: 1.1rem; }
.lang-dd-check { margin-right: auto; color: #2a6a38; font-weight: 900; }
.lang-dd-active { background: #eef4ff; }
[data-theme="dark"] .lang-dd-menu { background: #162033; border-color: #2a3a52; }
[data-theme="dark"] .lang-dd-item { color: #e6eef8; }
[data-theme="dark"] .lang-dd-item:hover { background: #1a2538; }
[data-theme="dark"] .lang-dd-active { background: #1a2538; }

/* ── כפתור "חזרה לבית" ─────────────────────────────────────── */
.back-to-home {
  background: none; border: 1.5px solid #c8d4e8; color: #2a5298;
  border-radius: 10px; padding: 8px 16px; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; font-family: inherit; margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.back-to-home:hover { background: #eef2ff; }
[data-theme="dark"] .back-to-home {
  border-color: #2a3a52; color: #b8ccf0;
}
[data-theme="dark"] .back-to-home:hover { background: #1a2538; }

/* ── ADMIN PANEL — AI toggle ─────────────────────────────────── */
[data-theme="dark"] #adm-ai-toggle-wrap {
  background: #162033 !important; border-color: #2a3a52 !important;
}
[data-theme="dark"] #adm-ai-toggle-wrap > div > div:first-child { color: #e6eef8 !important; }
[data-theme="dark"] #adm-ai-status-text { color: #8ea0b8 !important; }

