/* ============================================================================
   THEME PREMIUM — שכבת עיצוב "תומכי מנהלה" מעל מערכת העיצוב הבסיסית
   נטען מ-school_base.html אחרי בלוק ה-tokens; דורס עיצוב בלי לשנות HTML.
   מסתמך על ה-tokens (כולל --brand-*) המוגדרים ב-:root של school_base.html.
   ============================================================================ */
/* ============================================================================
   BRAND THEME — גרסה בהשראת עיצוב "תומכי מנהלה"
   כחול עמוק + זהב חם + קרם, עם כרטיסים נקיים, קצוות רכים והדגשות אלגנטיות
   ============================================================================ */

body {
  background:
    radial-gradient(circle at 85% 8%, rgba(217,154,22,.08), transparent 26rem),
    radial-gradient(circle at 10% 92%, rgba(23,63,120,.06), transparent 30rem),
    var(--bg-page);
}

.logo-strip {
  background: linear-gradient(180deg, #fffdf9 0%, #fbf6eb 100%);
  border-bottom: 2px solid var(--brand-gold-soft);
}

.page-title-strip {
  color: var(--brand-navy);
  border-bottom: 1px solid var(--brand-gold-soft);
}

.topbar,
.navbar {
  background: rgba(255,253,248,.96);
  border-bottom: 1px solid var(--brand-gold-soft);
  box-shadow: 0 3px 14px rgba(16,47,93,.08);
}

.brand-name,
.card h2,
h1, h2, h3, h4 {
  color: var(--brand-navy);
}

.nav-desktop a,
.nav-group > summary,
.user-strip .btn-ghost,
.hamburger {
  background: #f3ecde;
  color: var(--brand-navy);
}

.nav-desktop a:hover,
.nav-group > summary:hover,
.nav-group[open] > summary,
.user-strip .btn-ghost:hover,
.hamburger:hover {
  background: var(--accent-soft);
  color: var(--brand-navy);
}

.nav-desktop a.active,
.nav-group.has-active > summary,
.drawer-panel a.active {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(23,63,120,.18);
}

.card {
  background: rgba(255,253,248,.98);
  border: 1px solid #e7dcc5;
  box-shadow: 0 4px 16px rgba(16,47,93,.07);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 72px;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-navy));
  border-radius: 0 0 999px 0;
}

.card:hover {
  box-shadow: 0 10px 28px rgba(16,47,93,.11);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-deep));
  color: #fff;
  box-shadow: 0 4px 10px rgba(23,63,120,.16);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1c4c8d, var(--brand-navy));
}

.btn-ghost {
  color: var(--brand-navy);
  border-color: #d8c79f;
  background: #fffaf0;
}

.btn-ghost:hover {
  background: #f8edcf;
}

.input-field {
  background: #fffefb;
  border-color: #ded3bc;
}

.input-field:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(23,63,120,.14);
}

th {
  background: #f4ecdc;
  color: var(--brand-navy);
}

tr:hover td {
  background: #fcf7ed;
}

.badge-yellow {
  background: #fff0c9;
  color: #95620a;
}

.favs-bar {
  background: rgba(255,253,248,.94);
  border-block-end-color: var(--brand-gold-soft);
}

.favs-chip {
  background: #edf2fa;
  color: var(--brand-navy);
  border-color: #b9c8df;
}

.favs-chip:hover {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #fff;
}

.favs-add {
  background: #f5eddf;
  border-color: #d7c59b;
  color: var(--brand-navy);
}

.drawer-panel {
  background:
    linear-gradient(180deg, rgba(255,253,248,.98), rgba(247,242,232,.98));
}

.drawer-panel a,
.drawer-item-toggle {
  background: #f1e9da;
}

.drawer-toc-list a,
.drawer-subitems a {
  background: #fbf7ef;
  border-inline-start-color: var(--brand-gold-soft);
}

.drawer-toc-list a:hover,
.drawer-subitems a:hover {
  border-inline-start-color: var(--brand-gold);
}

#admin-page-settings-btn {
  background: rgba(217,154,22,.86);
  color: var(--brand-navy-deep);
  border-color: rgba(255,255,255,.45);
  box-shadow: 0 5px 16px rgba(16,47,93,.16);
}

#admin-page-settings-btn:hover {
  background: rgba(217,154,22,.96);
}

#page-settings-modal .tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-gold);
}

@media (max-width: 600px) {
  .card::before { width: 54px; }
}


/* ============================================================================
   FULL UI REDESIGN — "תומכי מנהלה" / PREMIUM SCHOOL ADMIN
   שכבת עיצוב מלאה מעל המערכת הקיימת, ללא שינוי HTML
   ============================================================================ */

/* ---------- Base & typography ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  letter-spacing: -0.01em;
}

::selection {
  background: rgba(217,154,22,.22);
  color: var(--brand-navy-deep);
}

a {
  text-underline-offset: 3px;
}

/* ---------- Main shell ---------- */
.container {
  max-width: 1220px;
  margin-top: 28px;
  margin-bottom: 40px;
}

.logo-strip {
  position: relative;
  overflow: hidden;
}

.logo-strip::after {
  content: "";
  position: absolute;
  inset-inline: 12%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(217,154,22,.7),
    rgba(23,63,120,.55),
    transparent
  );
}

.page-title-strip {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  letter-spacing: -.01em;
}

/* ---------- Navigation ---------- */
.topbar-inner {
  min-height: 68px;
  height: auto;
  padding-block: 8px;
}

.brand-icon-only {
  background: linear-gradient(135deg, #f7ead0, #eee2c5);
  color: var(--brand-navy);
  border: 1px solid #dfcca0;
  box-shadow: 0 3px 10px rgba(16,47,93,.07);
}

.nav-desktop a,
.nav-group > summary,
.user-strip .btn-ghost {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
}

.nav-desktop a:hover,
.nav-group > summary:hover,
.user-strip .btn-ghost:hover {
  border-color: #d9c69a;
  transform: translateY(-1px);
}

.nav-desktop a.active,
.nav-group.has-active > summary {
  border-color: rgba(255,255,255,.18);
}

.nav-group-panel {
  min-width: 220px;
  padding: 8px;
  border-color: #e2d5ba;
  border-radius: 14px;
  background: rgba(255,253,248,.98);
  box-shadow: 0 14px 36px rgba(16,47,93,.14);
  backdrop-filter: blur(12px);
}

.nav-group-panel a {
  min-height: 38px;
  border-radius: 9px;
}

.hamburger {
  border: 1px solid #e2d5ba;
  box-shadow: 0 2px 7px rgba(16,47,93,.05);
}

/* ---------- Cards ---------- */
.card {
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,253,248,.96)),
    var(--bg-card);
}

.card::after {
  content: "";
  position: absolute;
  inset-inline-end: -28px;
  inset-block-start: -28px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217,154,22,.10), transparent 68%);
  pointer-events: none;
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
}

.card h2::before {
  content: "";
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-gold), var(--brand-navy));
  flex-shrink: 0;
}

/* ---------- Dashboard-ish grids / generic grids ---------- */
.grid-2,
.grid-3,
.grid-4 {
  gap: 18px !important;
}

.grid-2 > *,
.grid-3 > *,
.grid-4 > * {
  min-width: 0;
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 40px;
  border-radius: 11px;
  letter-spacing: -.01em;
  box-shadow: none;
}

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

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

.btn-primary {
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 6px 14px rgba(23,63,120,.17);
}

.btn-success,
.btn-danger {
  box-shadow: 0 5px 12px rgba(26,35,50,.10);
}

.btn-sm {
  min-height: 32px;
  border-radius: 9px;
}

/* ---------- Forms ---------- */
.input-field {
  min-height: 44px;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

textarea.input-field {
  min-height: 120px;
  resize: vertical;
}

label {
  color: var(--text-secondary);
}

form .card,
.card form {
  position: relative;
}

.form-row {
  gap: 14px !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand-navy);
}

/* ---------- Tables ---------- */
.table-wrap {
  border: 1px solid #e5d8bc;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 3px 12px rgba(16,47,93,.04);
}

table {
  background: transparent;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2e9d8;
  color: var(--brand-navy-deep);
  border-bottom-color: #dbcba9;
}

th:first-child {
  border-start-start-radius: 12px;
}

th:last-child {
  border-start-end-radius: 12px;
}

td {
  vertical-align: middle;
}

tbody tr {
  transition: background var(--dur-fast), transform var(--dur-fast);
}

tbody tr:hover td {
  background: #fcf5e7;
}

/* ---------- Badges / statuses ---------- */
.badge {
  padding: 5px 11px;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
}

.badge-green {
  border-color: rgba(45,122,74,.17);
}

.badge-yellow {
  border-color: rgba(183,121,16,.2);
}

.badge-red {
  border-color: rgba(180,44,56,.16);
}

.badge-gray {
  border-color: #ddd2bd;
}

/* ---------- Selectors / attendance ---------- */
.class-selector {
  gap: 9px;
}

.class-btn {
  border-width: 1px;
  background: #fffdf8;
  border-color: #dfd2b9;
  box-shadow: 0 2px 6px rgba(16,47,93,.04);
}

.class-btn:hover,
.class-btn.active {
  box-shadow: 0 4px 12px rgba(23,63,120,.09);
}

.att-label {
  border-width: 1px;
  box-shadow: 0 2px 6px rgba(16,47,93,.04);
}

/* ---------- Favorites ---------- */
.favs-bar {
  box-shadow: 0 2px 8px rgba(16,47,93,.04);
}

.favs-inner {
  min-height: 38px;
}

.favs-chip {
  min-height: 29px;
  border-radius: 999px;
}

.favs-add {
  box-shadow: 0 2px 7px rgba(16,47,93,.05);
}

/* ---------- Drawer ---------- */
.drawer-backdrop {
  background: rgba(16,47,93,.42);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  width: min(350px, 88vw);
  border-inline-start: 1px solid #e2d5ba;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f0e7d6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer-section-title {
  color: var(--brand-navy);
}

.drawer-panel a {
  border: 1px solid transparent;
}

.drawer-panel a:hover {
  border-color: #decda8;
}

/* ---------- Modal ---------- */
#page-settings-modal {
  backdrop-filter: blur(3px);
}

#page-settings-modal .modal-card,
.favs-modal-panel {
  border: 1px solid #e5d7b7;
  background: linear-gradient(180deg, #fffdf9, #f9f3e8);
  box-shadow: 0 18px 50px rgba(16,47,93,.18);
}

#page-settings-modal .tabs {
  border-bottom-color: #e6d9bf;
}

#page-settings-modal .tab {
  border-radius: 8px 8px 0 0;
}

#page-settings-modal .tab:hover {
  background: #f5eddd;
}

/* ---------- Alerts ---------- */
.error-msg,
.success-msg,
.page-banner {
  border: 1px solid transparent;
  box-shadow: 0 3px 10px rgba(16,47,93,.04);
}

.error-msg {
  border-color: rgba(180,44,56,.14);
}

.success-msg {
  border-color: rgba(45,122,74,.16);
}

.page-banner {
  border-color: #ead29b;
  background: linear-gradient(180deg, #fff4d5, #fce9b9);
}

/* ---------- Maintenance page ---------- */
.maintenance-screen {
  border: 1px solid #e4d6b9;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(217,154,22,.08), transparent 40%),
    #fffdf8;
  box-shadow: 0 10px 28px rgba(16,47,93,.08);
}

/* ---------- Admin settings floating button ---------- */
#admin-page-settings-btn {
  border-radius: 999px;
  padding-inline: 18px;
  min-height: 42px;
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 20px rgba(16,47,93,.15);
}

/* ---------- Utility patterns for pages that already use generic divs ---------- */
.kpi,
.stat-card,
.summary-card,
.metric-card {
  background: #fffdf8;
  border: 1px solid #e5d8bc;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(16,47,93,.06);
}

.kpi strong,
.stat-card strong,
.summary-card strong,
.metric-card strong {
  color: var(--brand-navy);
}

/* Optional premium section headers if these classes exist */
.section-title,
.panel-title,
.page-heading {
  color: var(--brand-navy);
  font-weight: 700;
}

/* ---------- Scrollbar ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #c8b98f #f4ede0;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #f4ede0;
}

*::-webkit-scrollbar-thumb {
  background: #c8b98f;
  border-radius: 999px;
  border: 2px solid #f4ede0;
}

*::-webkit-scrollbar-thumb:hover {
  background: #aa986c;
}

/* ---------- Focus accessibility ---------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.class-btn:focus-visible,
.favs-chip:focus-visible,
.favs-add:focus-visible {
  outline: 3px solid rgba(217,154,22,.35);
  outline-offset: 2px;
}

/* ---------- Responsive polish ---------- */
@media (max-width: 820px) {
  .logo-strip img {
    max-height: 115px;
  }

  .page-title-strip {
    font-size: 15px;
    min-height: 38px;
  }

  .card {
    padding: 22px;
    border-radius: 17px;
  }

  .card h2 {
    font-size: 20px;
  }

  .topbar-inner {
    gap: 8px;
  }
}

@media (max-width: 600px) {
  body {
    background:
      radial-gradient(circle at 90% 0%, rgba(217,154,22,.07), transparent 18rem),
      var(--bg-page);
  }

  .container {
    margin-top: 16px;
    margin-bottom: 24px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .card h2 {
    font-size: 18px;
  }

  .page-title-strip {
    padding-inline: 10px;
  }

  .table-wrap {
    border-radius: 11px;
  }

  .btn {
    min-height: 42px;
  }

  .drawer-panel {
    width: min(330px, 92vw);
  }
}

/* ---------- Print ---------- */
@media print {
  body {
    background: #fff !important;
  }

  .topbar,
  .favs-bar,
  .hamburger,
  #admin-page-settings-btn,
  .drawer {
    display: none !important;
  }

  .card,
  .table-wrap {
    box-shadow: none !important;
    border-color: #ccc !important;
  }
}


/* ============================================================================
   SHELL v2 — פריסת שפת "מסך היום" לניווט העליון של כל המסכים (2026-08)
   טאבים שקטים עם קו-תחתי זהב במקום כפתורי-גלולה. CSS בלבד — אותם
   סלקטורים, אותו DOM, כל ה-JS וההזרקות ממשיכים לעבוד.
   הסקופ הוא ילדים ישירים (.nav-desktop > a) כדי לא לגעת בקישורים
   שבתוך הפאנלים הנפתחים (.nav-group-panel a).
   ============================================================================ */

.topbar {
  background: rgba(255,253,248,.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--brand-gold-soft);
  box-shadow: 0 2px 10px rgba(16,47,93,.05);
}

.nav-desktop > a,
.nav-group > summary {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 11px 10px;
  border-bottom: 2.5px solid transparent;
  transform: none;
}
.nav-desktop > a:hover,
.nav-group > summary:hover,
.nav-group[open] > summary {
  background: transparent;
  color: var(--text-primary);
  border-color: transparent;
  border-bottom-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}
.nav-desktop > a.active,
.nav-group.has-active > summary {
  background: transparent;
  color: var(--text-primary);
  border-color: transparent;
  border-bottom-color: var(--brand-gold);
  box-shadow: none;
}
.nav-group[open].has-active > summary {
  border-bottom-color: var(--brand-gold);
}

/* הכפתור המוזרק של המשימות (✅) מקבל את אותה שפה */
.nav-desktop > a .tasks-nav-badge { vertical-align: 2px; }

/* הפאנל הנפתח נשאר משטח קרם מורם — מקבל הפרדה ברורה מהטאב השקוף */
.nav-group-panel {
  margin-top: 2px;
  border-color: var(--brand-gold-soft);
}

/* דגש עדין: chevron בטאבים */
.nav-group > summary .chevron { opacity: .55; }
.nav-group[open] > summary .chevron { opacity: .9; }

/* טאב הגדרות-עמוד במודל (היה כחול-סגול זר #4361ee) */
#page-settings-modal .tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-gold);
}
