/* ============================================================
   LEARNING RESOURCE BOOKING — RESPONSIVE UI
   School brand + booking status colors
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-hover: #f1f5f7;

  --text: #173f55;
  --muted: #6d7d86;
  --muted-2: #94a1a7;

  --border: #dce5e9;
  --border-strong: #c8d6dd;

  --primary: #1d536f;
  --primary-hover: #17445c;
  --primary-soft: #e8f1f5;

  /* Booking status colors — unchanged */
  --available: #73bd8d;
  --available-soft: #edf8f0;
  --pending: #dfb44c;
  --pending-soft: #fff7dc;
  --booked: #e78268;
  --booked-soft: #fff0eb;
  --danger: #cf5454;
  --danger-soft: #fcecec;
  --success: #34855a;

  --radius-xs: 9px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --shadow-card: 0 8px 28px rgba(23, 63, 85, 0.055);
  --shadow-modal: 0 26px 80px rgba(20, 22, 16, 0.20);

  --sidebar-width: 78px;
  --tap-size: 44px;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;

  --transition: 180ms ease;
}

/* ---------- 2. Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Tajawal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; stroke-width: 2; }

/* ---------- 3. App shell ---------- */
.app-shell {
  width: min(1600px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  min-height: calc(100svh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  direction: ltr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
}
.sidebar, .main { direction: rtl; }

/* ---------- 4. Sidebar: desktop/tablet ---------- */
.sidebar {
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 18px 12px;
  background: var(--primary-soft);
  border-right: 1px solid var(--border);
}
.brand {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
}
.nav-stack { display: grid; gap: 12px; }
.nav-btn, .icon-btn {
  width: var(--tap-size); height: var(--tap-size);
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.nav-btn { border-radius: 50%; }
.icon-btn { border-radius: 13px; }
.nav-btn:hover, .nav-btn.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.sidebar-bottom { margin-top: auto; }
.user-dot {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #dceedd;
  color: var(--primary);
}

/* ---------- 5. Main ---------- */
.main { min-width: 0; padding: clamp(18px, 2.3vw, 32px); }

/* ---------- 6. Branded header ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-width: 0;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}
.header-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
}
/* =========================
   HEADER LOGO SIZE
========================= */

.header-logo {
  width: 115px;
  height: auto;
  max-height: 78px;

  object-fit: contain;
  flex-shrink: 0;
}
.header-info { min-width: 0; }
.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.header-info h1 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 1.2;
}
.header-info p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.header-controls { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Three-dots menu: hidden on larger screens, visible on responsive mobile/tablet */
.header-menu { position: relative; display: none; }
.header-menu-btn {
  width: var(--tap-size); height: var(--tap-size);
  padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.header-menu-btn:hover, .header-menu-btn[aria-expanded="true"] {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--border-strong);
}
.header-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 120;
  width: min(240px, calc(100vw - 28px));
  padding: 7px;
  display: none;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 16px 44px rgba(23, 63, 85, 0.16);
}
.header-dropdown.open { display: grid; animation: menuIn 140ms ease-out; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.header-dropdown button, .header-dropdown-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: right;
  text-decoration: none;
  font-size: 13px;
}
.header-dropdown button:hover, .header-dropdown-link:hover { background: var(--primary-soft); color: var(--primary); }
.header-dropdown svg { width: 17px; height: 17px; }

/* ---------- 7. General text/buttons ---------- */
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.subtle { color: var(--muted); font-size: 14px; line-height: 1.7; }
.btn {
  min-height: var(--tap-size);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn:disabled, .small-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 8. Cards/stats ---------- */
.card, .stat { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); }
.card { min-width: 0; padding: 20px; border-radius: var(--radius-lg); }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.stat {
  min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
}
.stat-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
}
.stat-icon.green { background: var(--available-soft); }
.stat-icon.yellow { background: var(--pending-soft); }
.stat-icon.purple { background: var(--primary-soft); }
.stat p { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 2px; font-size: 25px; }

/* ---------- 9. Dashboard ---------- */
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: var(--space-4);
  align-items: start;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 16px;
}
.card-head > div:first-child { min-width: 0; }
.card-head h2, .card-head h3 { margin-bottom: 4px; }
.week-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------- 10. Schedule ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.legend .l-free { background: var(--available); }
.legend .l-pending { background: var(--pending); }
.legend .l-booked { background: var(--booked); }
.schedule-wrap { min-width: 0; overflow-x: auto; padding-bottom: 4px; }
@supports (scrollbar-width: thin) {
  .schedule-wrap { scrollbar-width: thin; }
}
.schedule {
  width: 100%;
  min-width: 760px;
  display: grid;
  grid-template-columns: 96px repeat(5, minmax(112px, 1fr));
  gap: 8px;
}
.cell {
  min-width: 0;
  min-height: 66px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.cell.header, .cell.period {
  display: grid; place-items: center;
  background: var(--surface);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.cell.slot { width: 100%; text-align: right; color: var(--text); transition: transform var(--transition), border-color var(--transition); }
button.cell.slot:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-strong); }
.cell.slot.free { background: var(--available-soft); }
.cell.slot.pending { background: var(--pending-soft); }
.cell.slot.booked { background: var(--booked-soft); }
button.cell.slot:disabled { cursor: default; }
.slot-label { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.slot-meta { margin-top: 5px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

/* ---------- 11. Side column ---------- */
.side-col { display: grid; gap: var(--space-4); }
.profile { overflow: hidden; padding-top: 0; text-align: center; }
.profile-cover {
  height: 82px; margin: 0 -20px;
  background: radial-gradient(circle at 30% 20%, #dff0df, transparent 35%), linear-gradient(135deg, var(--primary-soft), #f5f7f4);
}
.profile-avatar {
  width: 74px; height: 74px;
  display: grid; place-items: center;
  margin: -37px auto 10px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #dceedd;
  color: var(--primary);
}
.mini-list { display: grid; gap: 10px; }
.booking-mini { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 15px; }
.booking-mini .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- 12. Status ---------- */
.badge {
  width: fit-content;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.pending { background: var(--pending-soft); }
.badge.approved { background: var(--available-soft); color: var(--success); }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }

/* ---------- 13. Admin table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 860px; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
  font-size: 13px;
}
.data-table th { color: var(--muted); font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.small-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.small-btn.approve { color: #277846; }
.small-btn.reject { color: var(--danger); }

/* ---------- 14. Modal/form ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  display: none; place-items: center;
  padding: 18px;
  background: rgba(15,16,13,.35);
}
.modal-backdrop.open { display: grid; }
.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-modal);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { min-width: 0; display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 44px;
  padding: 10px 12px;
  outline: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-actions { display: flex; justify-content: flex-start; gap: 9px; margin-top: 17px; }

/* ---------- 15. Toast/states ---------- */
.toast {
  position: fixed; bottom: 20px; left: 20px; z-index: 220;
  max-width: min(390px, calc(100% - 40px));
  padding: 12px 15px;
  border-radius: 13px;
  background: #1f211d;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #9e3e3e; }
.empty { padding: 22px 8px; color: var(--muted); text-align: center; }
.loading { opacity: .55; pointer-events: none; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   1700+ handled by 1600px max shell
   1200 / 920 / 600 / 480 / 400 / 390
   ============================================================ */

/* Medium desktop / landscape tablet */
@media (max-width: 1200px) {
  .dashboard { grid-template-columns: 1fr; }
  .side-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule { min-width: 700px; }
}

/* Tablet + mobile navigation: sidebar disappears, header dots become navigation */
@media (max-width: 920px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    display: block;
    border: 0;
    border-radius: 0;
  }
  .sidebar { display: none; }
  .main { padding: 18px; }
  .header-actions, .topbar > .actions { display: none; }
  .header-menu { display: block; }
  .stats { gap: 12px; }
  .schedule { min-width: 0; grid-template-columns: 78px repeat(5, minmax(72px, 1fr)); gap: 6px; }
  .cell { min-height: 60px; padding: 7px; }
  .cell.header, .cell.period { font-size: 11px; }
  .slot-label { font-size: 11px; }
  .slot-meta { font-size: 10px; }
}

/* 600px: compact header, schedule still fits without page overflow */
@media (max-width: 600px) {
  .main { padding: 14px; }
  .topbar { gap: 10px; padding: 12px 13px; border-radius: 18px; }
  .header-brand { gap: 10px; overflow: hidden; }
  .header-logo {    width: 90px;
    max-height: 65px;}
  .header-info { overflow: hidden; }
  .header-info h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-info p { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .eyebrow { font-size: 10px; }
  .header-menu-btn { width: 42px; height: 42px; }
  .header-dropdown { width: min(220px, calc(100vw - 28px)); }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { min-height: 112px; padding: 10px; flex-direction: column; justify-content: center; text-align: center; gap: 6px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 11px; }
  .stat-icon svg { width: 17px; height: 17px; }
  .stat p { font-size: 10px; line-height: 1.25; }
  .stat strong { font-size: 20px; }

  .card { padding: 14px; border-radius: 19px; }
  .card-head { align-items: flex-start; gap: 8px; }
  .card-head h2 { font-size: 17px; }
  .subtle { font-size: 12px; }
  .legend { gap: 9px; font-size: 10px; }

  .schedule-wrap { overflow-x: hidden; }
  .schedule { min-width: 0; grid-template-columns: 58px repeat(5, minmax(0, 1fr)); gap: 4px; }
  .cell { min-height: 54px; padding: 5px 4px; border-radius: 10px; }
  .cell.header, .cell.period { font-size: 10px; line-height: 1.2; }
  .cell.header .slot-meta, .cell.period .slot-meta { display: none; }
  .slot-label { font-size: 9.5px; line-height: 1.2; text-align: center; }
  .cell.slot .slot-meta { display: none; }

  .side-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-actions .btn { flex: 1; }

  /* Admin table becomes mobile cards */
  .table-wrap { overflow: visible; }
  .data-table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
  .data-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    overflow-wrap: anywhere;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; }
  .row-actions { justify-content: flex-start; }
}

/* Small phones */
@media (max-width: 480px) {
  .main { padding: 12px; }
  .topbar { margin-bottom: 14px; padding: 10px 11px; }
  .header-logo {     width: 82px;
    max-height: 58px; }
  .header-info h1 { font-size: 17px; }
  .header-info p { display: none; }
  .header-menu-btn { width: 40px; height: 40px; }
  .header-dropdown { left: 0; width: min(210px, calc(100vw - 24px)); }
  .stats { margin-bottom: 12px; }
  .stat { min-height: 80px; padding: 8px 5px; }
  .stat-icon { width: 30px; height: 30px; }
  .stat p { font-size: 9px; }
  .stat strong { font-size: 18px; }
  .card { padding: 12px; border-radius: 17px; }
  .schedule { grid-template-columns: 50px repeat(5, minmax(0, 1fr)); gap: 3px; }
  .cell { min-height: 52px; padding: 4px 2px; border-radius: 8px; }
  .cell.header, .cell.period { font-size: 9px; }
  .slot-label { font-size: 8.5px; }
  .week-actions .icon-btn { width: 38px; height: 38px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal {
    width: 100%;
    max-height: 92svh;
    padding: 17px 14px max(17px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
  .toast { left: 12px; bottom: 12px; max-width: calc(100% - 24px); }
}

/* 400px and 390px tuning */
@media (max-width: 400px) {
  .main { padding: 10px; }
  .topbar { border-radius: 16px; }
  .header-info h1 { font-size: 16px; }
  .eyebrow { font-size: 9px; }
  .header-menu-btn { width: 38px; height: 38px; border-radius: 11px; }
  .schedule { grid-template-columns: 46px repeat(5, minmax(0, 1fr)); }
  .cell.header, .cell.period { font-size: 8.5px; }
  .slot-label { font-size: 8px; }
  .data-table td { grid-template-columns: 82px minmax(0, 1fr); }
}

@media (max-width: 390px) {
  .header-brand { gap: 8px; }
  .header-logo { width: 40px; height: 40px; }
  .header-info h1 { font-size: 15px; }
  .schedule { grid-template-columns: 44px repeat(5, minmax(0, 1fr)); gap: 2px; }
  .cell { min-height: 50px; }
  .legend { margin-bottom: 10px; }
}

/* Print/PDF */
@media print {
  .sidebar, .topbar, .stats, .week-actions, .no-print, .row-actions { display: none !important; }
  body, .app-shell, .main { width: 100% !important; margin: 0 !important; background: #fff !important; }
  .app-shell { display: block; border: 0; }
  .dashboard { display: block; }
  .card { border: 0; box-shadow: none; }
  .data-table { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ---------- Stat content overflow safety ---------- */
.stat > div:not(.stat-icon) {
  min-width: 0;
}

/* =========================
   SYSTEM FOOTER
========================= */

.system-footer {
  width: 100%;
  padding: 18px 16px 22px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;

  gap: 7px;

  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.system-footer strong {
  color: var(--primary);
  font-weight: 700;
}

.footer-divider {
  color: var(--border-strong);
}

@media (max-width: 480px) {
  .system-footer {
    padding: 16px 12px 20px;
    font-size: 12px;
    gap: 5px;
  }
}


/* =========================================================
   COMPACT ADMIN BOOKINGS — TABLET / MOBILE
========================================================= */

@media (max-width: 900px) {

  /* الجدول نفسه */
  #requestsCard .table-wrap {
    overflow: visible;
  }

  #requestsCard table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  /* نخفي رأس الجدول على الجوال */
  #requestsCard thead {
    display: none;
  }

  #requestsCard tbody {
    display: grid;
    gap: 12px;
  }


  /* كل حجز = بطاقة صغيرة */
  #requestsBody tr {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 0;

    padding: 12px 14px;

    border:
      1px solid var(--border);

    border-radius: 18px;

    background:
      var(--surface);

    box-shadow:
      0 4px 16px
      rgba(23, 63, 85, 0.035);
  }


  /* كل معلومة */
  #requestsBody td {
    width: auto !important;

    min-width: 0;

    padding: 8px 10px;

    display: block;

    border: 0 !important;

    border-bottom:
      1px dashed var(--border);

    text-align: right;
  }


  /* اسم الحقل */
  #requestsBody td::before {
    content:
      attr(data-label);

    display: block;

    margin-bottom: 3px;

    color:
      var(--muted);

    font-size: 11px;

    font-weight: 600;
  }


  /* اسم المعلمة */
  #requestsBody td:nth-child(1) {
    grid-column:
      1 / -1;

    padding-top: 3px;
    padding-bottom: 10px;
  }

  #requestsBody td:nth-child(1)::before {
    display: none;
  }

  #requestsBody td:nth-child(1) strong {
    display: block;

    color:
      var(--text);

    font-size: 15px;

    font-weight: 800;

    line-height: 1.45;

    white-space: normal;
    overflow-wrap: anywhere;
  }


  /* التاريخ + الحصة */
  #requestsBody td:nth-child(2),
  #requestsBody td:nth-child(3) {
    grid-column: span 1;
  }


  /* المادة + الصف */
  #requestsBody td:nth-child(4),
  #requestsBody td:nth-child(5) {
    grid-column: span 1;
  }


  /* الغرض يأخذ العرض كامل */
  #requestsBody td:nth-child(6) {
    grid-column:
      1 / -1;

    line-height: 1.5;
  }


  /* الحالة + الإجراء */
  #requestsBody td:nth-child(7),
  #requestsBody td:nth-child(8) {
    grid-column: span 1;

    border-bottom: 0;
  }


  #requestsBody .badge {
    display: inline-flex;

    min-height: 30px;

    padding:
      4px 10px;

    align-items: center;
    justify-content: center;

    font-size: 12px;
  }


  #requestsBody .row-actions {
    display: flex;

    gap: 6px;

    flex-wrap: wrap;
  }


  #requestsBody .small-btn {
    min-height: 32px;

    padding:
      5px 9px;

    font-size: 11px;
  }

}

@media (max-width: 480px) {

  #requestsBody {
    gap: 10px;
  }

  #requestsBody tr {
    padding: 10px;
    border-radius: 15px;
  }

  #requestsBody td {
    padding: 7px 8px;
    font-size: 13px;
  }

  #requestsBody td::before {
    font-size: 10px;
  }

  #requestsBody td:nth-child(1) strong {
    font-size: 14px;
  }

}


/* =========================================================
   ADMIN DASHBOARD REDESIGN
========================================================= */

.admin-overview {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}


/* =========================
   TOP STATS
========================= */

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-stat-card {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  gap: 14px;

  min-height: 120px;
  padding: 20px;

  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.admin-stat-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  opacity: .85;
}

.admin-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.admin-stat-icon i,
.admin-stat-icon svg {
  width: 24px;
  height: 24px;
}

.admin-stat-content {
  min-width: 0;
}

.admin-stat-content p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.admin-stat-content strong {
  display: block;
  color: var(--text);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1;
  font-weight: 800;
}


/* TONES */
.tone-blue {
  background: linear-gradient(180deg, #f8fbfe 0%, #ffffff 100%);
}
.tone-blue::after {
  background: #7aaed1;
}
.tone-blue .admin-stat-icon {
  background: #eaf4fb;
  color: #1d536f;
}

.tone-green {
  background: linear-gradient(180deg, #f8fcfa 0%, #ffffff 100%);
}
.tone-green::after {
  background: #8ac6a0;
}
.tone-green .admin-stat-icon {
  background: #eaf6ef;
  color: #34855a;
}

.tone-orange {
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}
.tone-orange::after {
  background: #e6b679;
}
.tone-orange .admin-stat-icon {
  background: #fff2e2;
  color: #c98733;
}


/* =========================
   INSIGHTS GRID
========================= */

.admin-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.dashboard-panel {
  padding: 20px;
  border-radius: 24px;
  min-width: 0;
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-panel-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

.dashboard-panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-panel-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.dashboard-panel-badge i,
.dashboard-panel-badge svg {
  width: 21px;
  height: 21px;
}

.soft-blue {
  background: #eaf4fb;
  color: #1d536f;
}

.soft-green {
  background: #eaf6ef;
  color: #34855a;
}


/* =========================
   TOP TEACHERS
========================= */

.teacher-ranking {
  display: grid;
  gap: 8px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;

  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}

.ranking-position {
  width: 38px;
  height: 38px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #edf3f7;
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

.ranking-item:first-child .ranking-position {
  background: #eaf4fb;
  color: #1d536f;
}

.ranking-item:nth-child(2) .ranking-position {
  background: #eef5ef;
  color: #4a7557;
}

.ranking-item:nth-child(3) .ranking-position {
  background: #fff3e8;
  color: #b9792f;
}

.ranking-teacher {
  min-width: 0;
}

.ranking-teacher strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ranking-teacher span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ranking-count {
  text-align: left;
  white-space: nowrap;
}

.ranking-count strong {
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.ranking-count span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.ranking-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}


/* =========================
   EXECUTED RANGE
========================= */

.modern-range-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.executed-range-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.executed-range-field input {
  width: 100%;
  height: 44px;
  padding: 10px 12px;

  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);

  font: inherit;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.executed-range-field input:focus {
  outline: none;
  border-color: #9fc3d8;
  box-shadow: 0 0 0 4px rgba(29, 83, 111, 0.08);
}

.modern-filter-btn {
  height: 44px;
  min-width: 92px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border-radius: 14px;
  border: 1px solid #dbe8df;
  background: #edf8f0;
  color: #2d6f48;
  font-weight: 700;
}

.modern-filter-btn:hover {
  background: #e6f4eb;
}

.executed-result-box {
  margin-top: 18px;
  padding: 16px 18px;

  display: flex;
  align-items: center;
  gap: 14px;

  border-radius: 20px;
  background: linear-gradient(180deg, #f8fcfa 0%, #ffffff 100%);
  border: 1px solid #e5efe8;
}

.executed-result-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #eaf6ef;
  color: #34855a;
  flex-shrink: 0;
}

.executed-result-icon i,
.executed-result-icon svg {
  width: 22px;
  height: 22px;
}

.executed-result-content {
  min-width: 0;
}

.executed-result-content span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.executed-result-content strong {
  display: flex;
  align-items: baseline;
  gap: 6px;

  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.executed-result-content strong small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
  .admin-insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-stat-card {
    min-height: 108px;
  }
}

@media (max-width: 700px) {
  .dashboard-panel {
    padding: 16px;
    border-radius: 20px;
  }

  .dashboard-panel-head h2 {
    font-size: 18px;
  }

  .dashboard-panel-head p {
    font-size: 13px;
  }

  .modern-range-form {
    grid-template-columns: 1fr;
  }

  .modern-filter-btn {
    width: 100%;
  }

  .ranking-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .ranking-count {
    grid-column: 2 / 3;
    text-align: right;
  }

  .ranking-teacher strong {
    font-size: 16px;
  }

  .ranking-count strong {
    font-size: 19px;
  }

  .executed-result-content strong {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .admin-stat-card {
    padding: 16px;
    border-radius: 20px;
  }

  .admin-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .admin-stat-content p {
    font-size: 13px;
  }

  .admin-stat-content strong {
    font-size: 30px;
  }

  .executed-result-box {
    padding: 14px;
    border-radius: 18px;
  }
}

.cancel-booking-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(207, 84, 84, 0.18);
}

.cancel-booking-btn:hover {
  background: #f8dddd;
}

.cancel-booking-btn svg {
  width: 15px;
  height: 15px;
}

/* =========================================================
   BOOKING DETAILS MODAL
========================================================= */

.booking-slot-button {
  width: 100%;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.booking-slot-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(23, 63, 85, 0.08);
}

.booking-slot-button:focus-visible {
  outline: 3px solid rgba(29, 83, 111, 0.16);
  outline-offset: 2px;
}


/* Overlay */

.booking-details-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background:
    rgba(23, 63, 85, 0.18);

  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.booking-details-modal[hidden] {
  display: none;
}


/* Dialog */

.booking-details-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);

  overflow-y: auto;

  background: var(--surface);

  border:
    1px solid var(--border);

  border-radius: 26px;

  box-shadow:
    0 24px 70px
    rgba(23, 63, 85, 0.18);
}


/* Header */

.booking-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;

  padding: 20px;

  border-bottom:
    1px solid var(--border);
}

.booking-details-heading {
  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 0;
}

.booking-details-icon {
  width: 46px;
  height: 46px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 15px;

  background:
    var(--available-soft);

  color:
    var(--success);
}

.booking-details-icon svg {
  width: 21px;
  height: 21px;
}

.booking-details-heading h2 {
  margin: 0;

  color: var(--text);

  font-size: 18px;
  font-weight: 800;
}

.booking-details-heading p {
  margin: 3px 0 0;

  color: var(--muted);

  font-size: 12px;
}


.booking-details-close {
  width: 38px;
  height: 38px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border:
    1px solid var(--border);

  border-radius: 12px;

  background:
    var(--surface);

  color:
    var(--muted);

  cursor: pointer;
}

.booking-details-close:hover {
  background:
    var(--surface-hover);

  color:
    var(--text);
}

.booking-details-close svg {
  width: 18px;
  height: 18px;
}


/* Body */

.booking-details-body {
  display: grid;
  gap: 12px;

  padding: 20px;
}

.booking-details-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;
}

.booking-detail {
  min-width: 0;

  padding: 12px 14px;

  border:
    1px solid var(--border);

  border-radius: 16px;

  background:
    var(--surface-soft);
}

.booking-detail span {
  display: block;

  margin-bottom: 5px;

  color:
    var(--muted);

  font-size: 11px;
  font-weight: 600;
}

.booking-detail strong {
  display: block;

  color:
    var(--text);

  font-size: 14px;
  font-weight: 700;

  line-height: 1.55;

  white-space: normal;
  overflow-wrap: anywhere;
}

.booking-detail-main {
  background:
    var(--primary-soft);

  border-color:
    #d8e8ef;
}

.booking-detail-main strong {
  font-size: 16px;
  font-weight: 800;
}

.booking-detail-wide {
  width: 100%;
}


/* Stop background scroll */

body.modal-open {
  overflow: hidden;
}


/* Mobile */

@media (max-width: 600px) {

  .booking-details-modal {
    align-items: flex-end;

    padding:
      14px;
  }

  .booking-details-dialog {
    width: 100%;

    max-height:
      calc(100vh - 28px);

    border-radius:
      24px;
  }

  .booking-details-head {
    padding: 16px;
  }

  .booking-details-body {
    padding: 16px;
  }

  .booking-details-grid {
    grid-template-columns:
      1fr;
  }

  .booking-details-heading h2 {
    font-size: 16px;
  }

}
/* ==========================================
   BREAK / الفسحة
========================================== */

.break-period {
  background: #fff2c7 !important;
  border-color: #e4c15d !important;
  color: #805f0c !important;
  font-weight: 700;
}

.break-period .slot-meta {
  color: #9a7922;
}

.break-slot.free {
  background: #fff9e8 !important;
  border-color: #ead07a !important;
}

.break-slot.free .slot-label {
  color: #84620e;
}

.break-slot.free .slot-meta {
  color: #a18437;
}

.break-slot.free:hover {
  background: #fff0bd !important;
  border-color: #ddb947 !important;
}

.break-slot.booked {
  background: #f3d88d !important;
  border-color: #d6ae3c !important;
}

.break-slot.booked .slot-label {
  color: #704f00;
}

/* ==========================================
   CURRENT DAY / اليوم الحالي
========================================== */

.current-day-header {
  background: #eaf4ff !important;
  border-color: #a9ccef !important;
  color: #245f91 !important;
}

.today-badge {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #d5eaff;
  color: #245f91;
  font-size: 0.7rem;
  font-weight: 700;
}

.current-day-slot {
  box-shadow:
    inset 2px 0 0 #82b7e6,
    inset -2px 0 0 #82b7e6;
}

/* اليوم الحالي + خانة متاحة */
.current-day-slot.free:not(.break-slot) {
  background: #f4f9ff !important;
  border-color: #bed9ef !important;
}

/* اليوم الحالي + حجز */
.current-day-slot.booked:not(.break-slot) {
  border-color: #91bddf !important;
}

/* إذا كانت الفسحة هي أيضًا اليوم الحالي
   نحافظ على اللون الأصفر للفسحة */
.current-day-slot.break-slot {
  box-shadow:
    inset 2px 0 0 #d3ad45,
    inset -2px 0 0 #d3ad45;
}

/* ==========================================
   NEXT BOOKING NOTICE
========================================== */

.next-booking-notice {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 14px 0;
  padding: 10px 14px;

  background: #f7f9fb;
  border: 1px solid #e5e9ee;
  border-radius: 12px;

  color: #46515c;
  font-size: 0.9rem;
}

.next-booking-notice i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #6d7882;
}

.next-booking-notice > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.next-booking-label {
  font-weight: 700;
  color: #34404b;
}

#nextBookingText {
  color: #66717c;
}

.next-booking-notice[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .next-booking-notice {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .next-booking-notice > div {
    display: block;
  }

  .next-booking-label {
    display: block;
    margin-bottom: 3px;
  }
}
/* مسافة بين الجدول الأسبوعي وقسم الحجوزات */
#requestsCard {
  margin-top: 32px;
}

@media (max-width: 768px) {
  #requestsCard {
    margin-top: 22px;
  }
}
.contact-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-copy-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #f8fafb;
  cursor: pointer;
}

.mini-copy-btn:hover {
  background: #eef3f6;
}

.mini-copy-btn i {
  width: 15px;
  height: 15px;
}

.mobile-header-subtitle {
  display: none;
}

@media (max-width: 480px) {
  .mobile-header-subtitle {
    display: block;
    margin: 3px 0 0;
    color: #7a8792;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.35;
  }
}
/* =========================================================
   CLS STABILITY FIX
   تثبيت المساحات أثناء تحميل الصفحة
========================================================= */

/* حجز مساحة ثابتة للشعار قبل تحميل الصورة */
.header-logo {
  width: 115px;
  height: 78px;
  object-fit: contain;
  flex: 0 0 115px;
}

/* تثبيت ارتفاع الهيدر */
.topbar {
  min-height: 108px;
}

/* منع بطاقات الإحصائيات من تغيير الارتفاع عند وصول الأرقام */
.stat {
  min-height: 96px;
}

.stat strong {
  min-height: 30px;
  line-height: 30px;
}

/* مساحة ثابتة للأيقونات قبل تحميل Lucide */
.stat-icon,
.nav-btn,
.icon-btn,
.header-menu-btn {
  flex-shrink: 0;
}

/* منع منطقة الجدول من الانكماش أثناء جلب البيانات */
.schedule-wrap {
  min-height: 120px;
}


/* Tablet / phone */
@media (max-width: 600px) {
  .header-logo {
    width: 90px;
    height: 65px;
    flex-basis: 90px;
  }

  .topbar {
    min-height: 90px;
  }

  .stat {
    min-height: 112px;
  }
}


/* Small phones */
@media (max-width: 480px) {
  .header-logo {
    width: 82px;
    height: 58px;
    flex-basis: 82px;
  }

  .topbar {
    min-height: 78px;
  }

  .stat {
    min-height: 80px;
  }
}


/* Very small phones */
@media (max-width: 390px) {
  .header-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .topbar {
    min-height: 66px;
  }
}
/* ==========================================
   CLS FIX — ADMIN BOOKINGS TABLE
========================================== */

#requestsCard .table-wrap {
  min-height: 220px;
}

/* على الجوال لأن الجدول يتحول إلى بطاقات */
@media (max-width: 900px) {
  #requestsCard .table-wrap {
    min-height: 320px;
  }
}

/* زر إضافة الحجز في اللابتوب والآيباد: أيقونة فقط */
.admin-add-booking-desktop {
  width: 54px;
  height: 44px;
  padding: 0 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 14px;
}

.admin-add-booking-desktop .admin-add-booking-text {
  display: none;
}

.admin-add-booking-desktop svg {
  width: 20px;
  height: 20px;
}

/* في الهاتف نخفي زر الهيدر ونستخدم القائمة */
@media (max-width: 920px) {
  .admin-add-booking-desktop {
    display: none !important;
  }
}
/* =========================================================
   PAST SLOTS — FINAL OVERRIDE
   الحصص التي انتهى وقتها
========================================================= */

.cell.slot.past-slot,
.cell.slot.past-slot.free,
.cell.slot.past-slot.booked,
.cell.slot.past-slot.current-day-slot,
.cell.slot.past-slot.break-slot,
.cell.slot.past-slot.current-day-slot.free,
.cell.slot.past-slot.current-day-slot.booked {
  background: #f1f3f4 !important;
  border-color: #d6dde1 !important;
  color: #7d878d !important;
  box-shadow: none !important;
}

.cell.slot.past-slot .slot-label {
  color: #737d83 !important;
}

.cell.slot.past-slot .slot-meta {
  color: #9aa2a7 !important;
}

.cell.slot.past-slot:hover {
  background: #f1f3f4 !important;
  border-color: #d6dde1 !important;
  transform: none !important;
}


.profile-welcome {
  margin: 8px 0 3px;
  font-weight: 600;
  color: #234d67;
}

.profile-welcome + .subtle {
  margin-top: 0;
}

/* =========================================================
   BOOKINGS FILTER BAR — ELEGANT TOOLBAR
========================================================= */

.bookings-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;

  width: 100%;
  margin: 12px 0 18px;
  padding: 9px 10px;

  background: #ffffff;
  border: 1px solid #e3e8eb;
  border-radius: 14px;

  box-shadow: 0 6px 18px rgba(23, 63, 85, .06);
}


/* Search */

.bookings-filter-bar #bookingSearch {
  flex: 1 1 320px;
  min-width: 220px;
}


/* Selects */

.bookings-filter-bar select {
  flex: 0 1 170px;
  min-width: 140px;
}


/* All controls */

.bookings-filter-bar input,
.bookings-filter-bar select {
  height: 38px;

  padding-inline: 12px;

  border: 1px solid #d9e1e5;
  border-radius: 9px;

  background: #fbfcfd;
  color: var(--text);

  font-family: inherit;
  font-size: .86rem;

  outline: none;

  transition:
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}


.bookings-filter-bar input::placeholder {
  color: #9ca7ad;
}


/* Hover */

.bookings-filter-bar input:hover,
.bookings-filter-bar select:hover {
  background: #ffffff;
  border-color: #c8d4da;
}


/* Focus */

.bookings-filter-bar input:focus,
.bookings-filter-bar select:focus {
  background: #ffffff;
  border-color: #8fb4c8;

  box-shadow:
    0 0 0 3px rgba(29, 83, 111, .06);
}


/* Reset */

.bookings-filter-bar #clearBookingFilters {
  height: 38px;

  padding: 0 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 8px;

  background: transparent;

  color: #7d898f;

  font-size: .82rem;
  font-weight: 500;

  white-space: nowrap;
}


.bookings-filter-bar #clearBookingFilters:hover {
  background: #f1f4f6;
  color: var(--primary);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {
  .bookings-filter-bar {
    flex-wrap: wrap;
  }

  .bookings-filter-bar #bookingSearch {
    flex: 1 1 100%;
  }

  .bookings-filter-bar select {
    flex: 1 1 calc(50% - 4px);
  }

  .bookings-filter-bar #clearBookingFilters {
    flex: 0 0 auto;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {
  .bookings-filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 7px;

    padding: 8px;
    border-radius: 12px;
  }

  .bookings-filter-bar #bookingSearch {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .bookings-filter-bar select {
    min-width: 0;
  }

  .bookings-filter-bar #clearBookingFilters {
    grid-column: 1 / -1;

    width: auto;
    justify-self: start;

    height: 34px;
    padding-inline: 8px;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {
  .bookings-filter-bar {
    grid-template-columns: 1fr;
  }

  .bookings-filter-bar #bookingSearch,
  .bookings-filter-bar #clearBookingFilters {
    grid-column: auto;
  }
}
/* ==========================================
   TEACHER CONTACT CARD
========================================== */

.teacher-contact-card {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 16px;

  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.teacher-contact-icon {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 14px;

  background: var(--primary-soft);
  color: var(--primary);
}

.teacher-contact-icon svg {
  width: 19px;
  height: 19px;
}

.teacher-contact-content {
  min-width: 0;
}

.teacher-contact-content h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.teacher-contact-content p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-contact-phone {
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.teacher-contact-phone:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .teacher-contact-card {
    padding: 13px;
    border-radius: 15px;
  }

  .teacher-contact-icon {
    width: 40px;
    height: 40px;
  }
}

/* Teacher sidebar cards stay vertically stacked */
.teacher-side-col {
  grid-template-columns: 1fr !important;
}

.teacher-contact-card {
  align-self: start;
  min-height: 0;
}
/* ==========================================
   TEACHER BOOKINGS FILTERS
========================================== */

.teacher-booking-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 14px;
}

.teacher-filter-btn {
  min-height: 34px;
  padding: 6px 11px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: #fff;
  color: var(--muted);

  font-size: .8rem;
  font-weight: 600;

  cursor: pointer;
}

.teacher-filter-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.teacher-filter-btn.active {
  background: var(--primary-soft);
  border-color: #cbdde6;
  color: var(--primary);
}

@media (max-width: 480px) {
  .teacher-booking-filters {
    gap: 6px;
  }

  .teacher-filter-btn {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }
}
/* ==========================================
   STATS — SUBTLE LIFE
========================================== */

.stat {
  position: relative;
  overflow: hidden;

  transition:
    transform .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 83, 111, .16);

  box-shadow:
    0 8px 22px rgba(23, 63, 85, .07);
}

/* الأيقونة */
.stat-icon {
  transition:
    transform .2s ease,
    background .2s ease;
}

.stat:hover .stat-icon {
  transform: scale(1.05);
}

/* الرقم */
.stat strong {
  transition: transform .2s ease;
}

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

/* ==========================================
   MOBILE + SMALL PHONES
========================================== */

@media (max-width: 600px) {
  .stat {
    transition:
      transform .15s ease,
      box-shadow .15s ease,
      border-color .15s ease;
  }

  .stat:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }

  .stat:active {
    transform: scale(.985);
    border-color: rgba(29, 83, 111, .14);
  }

  .stat-icon {
    transition: transform .15s ease;
  }

  .stat:active .stat-icon {
    transform: scale(.97);
  }

  .stat strong {
    transition: none;
  }
}


/* Small phones */
@media (max-width: 400px) {
  .stat {
    min-height: 78px;
    padding: 8px 6px;
  }

  .stat-icon {
    width: 30px;
    height: 30px;
  }

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

  .stat p {
    font-size: 9px;
    line-height: 1.25;
  }

  .stat strong {
    font-size: 18px;
  }
}


/* Very small phones */
@media (max-width: 360px) {
  .stat {
    min-height: 74px;
    padding: 7px 5px;
  }

  .stat p {
    font-size: 8.5px;
  }

  .stat strong {
    font-size: 17px;
  }
}

/* =========================================
   ADMIN LOGIN
========================================= */

.admin-login-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 100dvh;
  padding: 24px;

  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(41, 98, 82, 0.08),
      transparent 38%
    ),
    #f7f8f5;
}

.admin-login-gate[hidden] {
  display: none !important;
}

.admin-login-card {
  width: min(100%, 420px);

  padding: 38px 34px 32px;

  background: #ffffff;
  border: 1px solid rgba(30, 55, 47, 0.09);
  border-radius: 24px;

  box-shadow:
    0 22px 60px rgba(30, 55, 47, 0.10),
    0 4px 14px rgba(30, 55, 47, 0.04);

  text-align: center;
}

.admin-login-icon {
  width: 68px;
  height: 68px;

  margin: 0 auto 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 20px;

  background: rgba(41, 98, 82, 0.09);
  color: #296252;
}

.admin-login-icon svg {
  width: 31px;
  height: 31px;
  stroke-width: 1.8;
}

.admin-login-card h2 {
  margin: 0 0 9px;

  color: #1e372f;

  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
  line-height: 1.35;
}

.admin-login-card > p {
  max-width: 320px;

  margin: 0 auto 26px;

  color: #718079;

  font-size: 0.94rem;
  line-height: 1.8;
}

#adminLoginForm {
  display: grid;
  gap: 14px;
}

#adminPasswordInput {
  width: 100%;
  height: 52px;

  padding: 0 17px;

  border: 1px solid #dfe5e1;
  border-radius: 14px;

  outline: none;

  background: #fafbf9;
  color: #1e372f;

  font: inherit;
  font-size: 1rem;

  text-align: right;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

#adminPasswordInput::placeholder {
  color: #9aa6a0;
}

#adminPasswordInput:hover {
  border-color: #cbd6d1;
}

#adminPasswordInput:focus {
  background: #ffffff;
  border-color: #296252;

  box-shadow:
    0 0 0 4px rgba(41, 98, 82, 0.10);
}

#adminLoginBtn {
  width: 100%;
  min-height: 52px;

  margin-top: 2px;

  border: 0;
  border-radius: 14px;

  background: #296252;
  color: #ffffff;

  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

#adminLoginBtn:hover {
  background: #234f44;

  box-shadow:
    0 9px 22px rgba(41, 98, 82, 0.18);

  transform: translateY(-1px);
}

#adminLoginBtn:active {
  transform: translateY(0);
}

#adminLoginBtn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.admin-login-message {
  min-height: 20px;
  margin-top: 14px;

  color: #64736c;

  font-size: 0.88rem;
  font-weight: 600;
}

.admin-login-message.error {
  color: #b13b3b;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

  .admin-login-gate {
    padding: 18px;
    align-items: center;
  }

  .admin-login-card {
    width: 100%;

    padding:
      32px
      22px
      26px;

    border-radius: 20px;

    box-shadow:
      0 16px 40px rgba(30, 55, 47, 0.09);
  }

  .admin-login-icon {
    width: 60px;
    height: 60px;

    margin-bottom: 18px;

    border-radius: 18px;
  }

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

  .admin-login-card > p {
    margin-bottom: 22px;
    font-size: 0.9rem;
  }

  #adminPasswordInput,
  #adminLoginBtn {
    min-height: 50px;
  }
}


/* Very small phones */

@media (max-width: 360px) {

  .admin-login-gate {
    padding: 12px;
  }

  .admin-login-card {
    padding:
      26px
      17px
      22px;

    border-radius: 18px;
  }

  .admin-login-card h2 {
    font-size: 1.3rem;
  }
}

/* =========================================
   ADMIN SIDEBAR LOGOUT — SAFE OVERRIDE
   Header/mobile menu rules are untouched.
========================================= */

.sidebar-bottom {
  width: 100%;
  margin-top: auto;
  padding-top: 14px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-nav-btn {
  width: var(--tap-size);
  height: var(--tap-size);

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 50%;
  border: 1px solid var(--border);

  background: var(--surface);
  color: var(--text);
}

.logout-nav-btn svg {
  display: block;
  width: 21px;
  height: 21px;
  stroke: currentColor;
}

.logout-nav-btn:hover {
  background: #fff1f1;
  border-color: #f0cece;
  color: #c44f4f;
}
/* =========================================
   ADMIN LOGOUT — ALWAYS VISIBLE ON DESKTOP
========================================= */

@media (min-width: 921px) {

  #adminLogoutBtn {



    z-index: 100;

    width: 46px;
    height: 46px;

    display: grid !important;
    place-items: center;

    margin: 0 !important;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: #ffffff;
    color: var(--text);

    box-shadow: 0 5px 16px rgba(23, 63, 85, 0.08);
  }

  #adminLogoutBtn svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: currentColor;
  }

  #adminLogoutBtn:hover {
    background: #fff1f1;
    border-color: #efcccc;
    color: #c44f4f;
  }
}


/* Mobile/tablet uses three-dots menu */
@media (max-width: 920px) {

  #adminLogoutBtn {
    display: none !important;
  }

}

.sidebar-bottom {
  width: 100%;

  /* 28px sidebar gap - 16px = 12px, matching the nav button spacing */
  margin-top: -16px;
  padding-top: 0;

  display: flex;
  justify-content: center;
  align-items: center;
}

#adminLogoutBtn {
  width: var(--tap-size);
  height: var(--tap-size);

  display: grid;
  place-items: center;

  border-radius: 50%;
  border: 1px solid var(--border);

  background: var(--surface);
  color: var(--text);

  margin: 0;
  padding: 0;
}

#adminLogoutBtn svg {
  width: 20px;
  height: 20px;
}