@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a4f6e;
  --primary-light: #2a6f96;
  --primary-dark: #0d3349;
  --accent: #e8a020;
  --accent-light: #f5c55a;
  --success: #2e9e6b;
  --warning: #d4821a;
  --danger: #c0392b;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  /* WCAG-friendly body & muted (ui-ux-pro-max light-mode guidance) */
  --text: #0f172a;
  --text-muted: #475569;
  --border: #d0dbe6;
  --shadow: 0 2px 12px rgba(26,79,110,0.10);
  --shadow-lg: 0 8px 32px rgba(26,79,110,0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --focus-ring: 0 0 0 3px rgba(232, 160, 32, 0.35);
}

html { font-size: 16px; }
body {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Page shell: floating header spacing (skip full-bleed login / pin gate) */
body:not(:has(.login-page)):not(:has(.pin-gate-page)) {
  padding: 16px 16px 0;
  box-sizing: border-box;
}
body:has(.login-page),
body:has(.pin-gate-page) {
  padding: 0;
}

/* SVG icons — replace emoji in UI */
.ui-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  display: block;
}
.ui-icon-mid {
  width: 1.5rem;
  height: 1.5rem;
}
.ui-icon-lg {
  width: 2.25rem;
  height: 2.25rem;
}
.ui-icon-xl {
  width: 3rem;
  height: 3rem;
}
.brand-icon svg,
.login-logo svg {
  color: inherit;
}
.brand-icon {
  font-size: 0;
}
.brand-icon .ui-icon {
  width: 22px;
  height: 22px;
  color: var(--primary-dark);
}
.login-logo {
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo .ui-icon-xl {
  color: var(--primary-dark);
}
.empty-state-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 12px;
  color: var(--text-muted);
  opacity: 0.85;
}
.btn-inline-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-inline-icon .ui-icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* Keyboard focus — visible focus rings (forms keep existing .form-group focus) */
.btn:focus-visible,
.site-header a:focus-visible,
.admin-link a:focus-visible,
.teacher-btn:focus-visible,
.modal-close:focus-visible,
.btn-icon:focus-visible,
.master-tab-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 79, 110, 0.18);
}
.checkbox-item:focus-within {
  box-shadow: var(--focus-ring);
}

@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;
  }
}

/* ─── HEADER ─── */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: white;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 24px rgba(13, 51, 73, 0.22);
  position: sticky;
  top: 16px;
  z-index: 100;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.site-header .brand-icon .ui-icon {
  color: var(--primary-dark);
}

.brand-text h1 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  opacity: 0.75;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-chip {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subject-stats-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.subject-stat-chip {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* ─── ADMIN: section headers (staffing + reference data) ─── */
.admin-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.admin-section-head--lg {
  margin-bottom: 18px;
  padding-bottom: 16px;
}
.admin-section-head__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(26, 79, 110, 0.1) 0%, rgba(232, 160, 32, 0.12) 100%);
  border: 1px solid rgba(26, 79, 110, 0.14);
  color: var(--primary-dark);
}
.admin-section-head__text {
  flex: 1;
  min-width: 0;
}
.admin-section-head__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.35;
  margin-bottom: 4px;
}
.admin-section-head--lg .admin-section-head__title {
  font-size: 1.15rem;
}
.admin-section-head__desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.staffing-dashboard-card {
  margin-bottom: 16px;
  border: 1px solid rgba(26, 79, 110, 0.12);
  box-shadow: var(--shadow);
}
.staffing-dashboard-mount:empty {
  display: none;
}
.staffing-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.staffing-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  justify-content: flex-start;
}
.staffing-stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
  min-width: 108px;
  flex: 1 1 108px;
  max-width: 200px;
  box-shadow: 0 1px 3px rgba(26, 79, 110, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.staffing-stat-chip:hover {
  border-color: rgba(26, 79, 110, 0.28);
  box-shadow: 0 2px 10px rgba(26, 79, 110, 0.1);
}
.staffing-stat-chip--emphasis {
  border-color: rgba(26, 79, 110, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  border-top: 3px solid var(--accent);
}
.staffing-stat-chip__value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}
.staffing-stat-chip--emphasis .staffing-stat-chip__value {
  color: var(--primary);
}
.staffing-stat-chip__label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
}
.staffing-subsection {
  padding-top: 4px;
}
.staffing-subsection--notes {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.staffing-subsection__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 10px 0;
  letter-spacing: 0.01em;
}
.staffing-subject-chips {
  margin-bottom: 0;
}
.staffing-subject-chip {
  font-size: 0.8rem;
  font-weight: 600;
}
.staffing-notes-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  line-height: 1.55;
}
.staffing-notes-list__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.staffing-notes-list__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.staffing-notes-list__name {
  font-weight: 700;
  color: var(--primary-dark);
}
.staffing-notes-list__text {
  color: var(--text);
  word-break: break-word;
}

/* ─── ADMIN: master / reference data ─── */
.admin-master-wrap {
  margin-top: 8px;
  margin-bottom: 32px;
}
.master-data-card {
  border: 1px solid rgba(26, 79, 110, 0.12);
  padding-top: 20px;
}
.master-data-head {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 14px;
}
.master-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.master-tab-btn {
  appearance: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(26, 79, 110, 0.06);
}
.master-tab-btn:hover {
  border-color: rgba(26, 79, 110, 0.25);
  color: var(--primary-dark);
}
.master-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 79, 110, 0.25);
}
.master-tab-panel {
  padding-top: 4px;
}
.master-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(240, 244, 248, 0.85) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.master-toolbar .filter-group {
  flex: 1 1 160px;
  min-width: 140px;
  margin-bottom: 0;
}
.master-toolbar .btn {
  flex: 0 0 auto;
  align-self: flex-end;
}

@media (max-width: 900px) {
  .master-tabs-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    margin-bottom: 12px;
    scrollbar-width: thin;
  }
  .master-tabs-row::-webkit-scrollbar {
    height: 6px;
  }
  .master-tabs-row::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
  }
}

@media (max-width: 640px) {
  .staffing-stats-row {
    flex-direction: column;
    align-items: stretch;
  }
  .staffing-stat-chip {
    max-width: none;
  }
  .admin-section-head__icon {
    width: 40px;
    height: 40px;
  }
}

/* ─── LOGIN PAGE ─── */
body.tamkeen-login-body {
  margin: 0;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 28px 18px 36px;
  background: linear-gradient(165deg, #0c4a6e 0%, var(--primary-dark) 28%, var(--primary) 55%, #2980b9 88%, #3d9ccc 100%);
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 70% at 50% -15%, rgba(255, 255, 255, 0.16) 0%, transparent 52%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(232, 160, 32, 0.12) 0%, transparent 48%),
    radial-gradient(ellipse 60% 45% at 0% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 42%);
}

.login-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 22px;
  padding: 40px 34px 34px;
  width: 100%;
  max-width: 460px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 0 0 1px rgba(13, 51, 73, 0.04),
    0 16px 40px rgba(13, 51, 73, 0.18),
    0 4px 12px rgba(13, 51, 73, 0.08);
}

.login-card__accent {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(200px, 48%);
  height: 4px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-light), transparent);
  opacity: 0.95;
}

.login-brand-block {
  margin-bottom: 22px;
}

.login-logo {
  width: 76px;
  height: 76px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 10px 28px rgba(26, 79, 110, 0.38);
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.login-logo .ui-icon-xl {
  color: white;
  width: 2.75rem;
  height: 2.75rem;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.55;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.login-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 24px;
  margin-bottom: 14px;
}

.login-loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.login-loader::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: login-spin 0.75s linear infinite;
}
@keyframes login-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .login-loader::before {
    animation: none;
    border-top-color: var(--border);
    opacity: 0.7;
  }
}

.login-error {
  display: none;
  font-size: 0.86rem;
  color: var(--danger);
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  text-align: right;
  line-height: 1.45;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.22);
}

.login-form {
  text-align: right;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.login-form select,
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: #fafbfd;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.login-form select {
  cursor: pointer;
}

.login-form select:focus,
.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 79, 110, 0.12);
}

.login-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.45;
}

.login-mode-row-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  text-align: right;
}

.login-mode-segmented {
  display: flex;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.login-mode-pill {
  position: relative;
  flex: 1;
  min-width: 140px;
  margin: 0;
  cursor: pointer;
}

.login-mode-pill input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.login-mode-pill span {
  display: block;
  padding: 13px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  line-height: 1.35;
}

.login-mode-pill:hover span {
  border-color: rgba(26, 79, 110, 0.35);
}

.login-mode-pill input:focus-visible + span {
  box-shadow: var(--focus-ring);
}

.login-mode-pill input:checked + span {
  border-color: var(--primary);
  background: rgba(26, 79, 110, 0.07);
  color: var(--primary-dark);
}

.login-optional-panel {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.login-optional-heading {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: right;
}

.login-submit-wrap {
  margin-top: 22px;
}

.login-submit-wrap .btn-primary {
  width: 100%;
  justify-content: center;
  padding-top: 13px;
  padding-bottom: 13px;
  border-radius: 14px;
  font-size: 0.95rem;
}

/* تلخيص المادة والتعيين (قراءة فقط) */
.login-assignment-info {
  margin-top: 14px;
  margin-bottom: 6px;
  padding: 14px 16px;
  text-align: right;
  border-radius: 14px;
  background: rgba(26, 79, 110, 0.06);
  border: 1px solid rgba(26, 79, 110, 0.12);
}
.login-assignment-info__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.login-assignment-info__value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}
.login-assignment-info__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.45;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 16px 0;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.teacher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.teacher-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
  text-align: center;
}

.teacher-btn:hover, .teacher-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(26,79,110,0.28);
}

.admin-link,
.login-footer-nav {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
}

.admin-link a,
.login-footer-nav a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.admin-link a:hover,
.login-footer-nav a:hover {
  color: var(--primary);
  border-color: rgba(26, 79, 110, 0.35);
  background: rgba(26, 79, 110, 0.05);
}
.admin-link .btn-inline-icon,
.login-footer-nav .btn-inline-icon { justify-content: center; gap: 8px; }
.admin-link .btn-inline-icon .ui-icon,
.login-footer-nav .btn-inline-icon .ui-icon { color: var(--text-muted); }
.admin-link .btn-inline-icon:hover .ui-icon,
.login-footer-nav .btn-inline-icon:hover .ui-icon { color: var(--primary); }

.login-footer-sep {
  color: var(--border);
  font-weight: 400;
  user-select: none;
}

/* ─── LAYOUT ─── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 4px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.stat-card:hover {
  box-shadow: 0 6px 20px rgba(26,79,110,0.12);
}
.stat-card.total { border-top-color: var(--primary); }
.stat-card.new { border-top-color: var(--warning); }
.stat-card.progress { border-top-color: var(--accent); }
.stat-card.done { border-top-color: var(--success); }
.stat-card.teachers { border-top-color: #7b52d4; }

.stat-number {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card.total .stat-number { color: var(--primary); }
.stat-card.new .stat-number { color: var(--warning); }
.stat-card.progress .stat-number { color: var(--accent); }
.stat-card.done .stat-number { color: var(--success); }
.stat-card.teachers .stat-number { color: #7b52d4; }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── TOOLBAR ─── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.toolbar-actions-spaced {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* إعدادات الإدارة — بطاقة موحّدة */
.admin-settings-card {
  margin-bottom: 20px;
  border: 1px solid rgba(26, 79, 110, 0.14);
  background: linear-gradient(180deg, var(--bg-card) 0%, #f8fbfd 100%);
}
.admin-settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}
.admin-settings-grid .btn {
  flex: 1 1 200px;
  justify-content: center;
}
.admin-settings-advanced {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.admin-settings-advanced__title {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.admin-settings-advanced__hint {
  margin: 0 0 10px 0;
  font-size: 0.84rem;
  line-height: 1.55;
}
.admin-settings-grid--advanced .btn {
  flex: 1 1 220px;
}

/* تبويبات رئيسية — لوحة الإدارة */
.admin-main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.admin-main-tab-btn {
  flex: 1 1 160px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.admin-main-tab-btn:hover {
  border-color: rgba(26, 79, 110, 0.35);
  background: #f5f9fc;
}
.admin-main-tab-btn.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #ffffff 0%, #f0f7fb 100%);
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(26, 79, 110, 0.12);
}
.admin-main-tab-panel {
  margin-bottom: 4px;
}

/* ─── FILTERS ─── */
.filters-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Match main form fields — filter bar is not wrapped in .form-group */
.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"],
.filter-group input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: #fafbfd;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  direction: rtl;
}
.filter-group select {
  cursor: pointer;
  background-color: #fafbfd;
}
.filter-group input[type="date"] {
  min-height: 42px;
  color-scheme: light;
}
.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 79, 110, 0.12);
}
.filter-group select:hover,
.filter-group input:hover {
  border-color: rgba(26, 79, 110, 0.28);
}
.filter-group input::placeholder {
  color: #64748b;
}

/* ─── TABLE ─── */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll { overflow-x: auto; }

.admin-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f0f5f9;
  border-top: 1px solid var(--border);
}
.admin-pagination-info { font-size: 0.85rem; }
.admin-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.admin-pagination-label { font-size: 0.8rem; color: var(--text-muted); }
.admin-page-size-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
}
.admin-page-label { font-size: 0.85rem; min-width: 3.5em; text-align: center; }

.teacher-row-count {
  display: inline-block;
  min-width: 1.75em;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #1e293b;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--primary);
  color: white;
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5f8fb; }

.date-cell { white-space: nowrap; font-size: 0.8rem; color: var(--text-muted); }

/* ─── BADGES ─── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-new { background: #fef3cd; color: #9a6b00; }
.badge-progress { background: #d1ecf1; color: #0c5460; }
.badge-done { background: #d4edda; color: #155724; }
.badge-parent { background: #e8d5f0; color: #5a3d6b; font-size: 0.75rem; }
.badge-therapeutic { background: #d4e6f1; color: #1a5276; font-size: 0.75rem; }

.segmented-control { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented-control .segmented-option { flex: 1; margin: 0; }
.segmented-control .segmented-option input { position: absolute; opacity: 0; }
.segmented-control .segmented-option span { display: block; padding: 10px 14px; text-align: center; cursor: pointer; background: var(--bg); color: var(--text); transition: var(--transition); }
.segmented-control .segmented-option input:checked + span { background: var(--primary); color: white; }
.record-type-switch .segmented-control { max-width: 280px; }

.form-helper { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--text-muted); }
.checkbox-group .form-helper { margin-top: 2px; }

.student-name-autocomplete-wrap { position: relative; }
.student-name-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 2px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  list-style: none;
}
.student-name-suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.student-name-suggestion-item:last-child { border-bottom: none; }
.student-name-suggestion-item:hover,
.student-name-suggestion-item:focus {
  background: var(--bg);
  outline: none;
}

.type-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

/* ─── ACTION BUTTONS ─── */
.action-btns { display: flex; gap: 6px; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.btn-icon .ui-icon {
  width: 16px;
  height: 16px;
}
.btn-icon:hover { border-color: transparent; }
.btn-view:hover { background: #e8f4fd; }
.btn-edit:hover { background: #fff3cd; }
.btn-delete:hover { background: #fde8e8; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(26,79,110,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 6px 18px rgba(26,79,110,0.38);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 4px 12px rgba(232,160,32,0.3);
}
.btn-accent:hover:not(:disabled) {
  filter: brightness(1.03);
  box-shadow: 0 6px 16px rgba(232,160,32,0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #a93226; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ─── FORMS ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,79,110,0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0 4px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
  margin-top: 8px;
}

.req { color: var(--danger); }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── CHECKBOX GRID ─── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all var(--transition);
}
.checkbox-item:hover { border-color: var(--primary); }
.checkbox-item input[type="checkbox"]:checked + span { color: var(--primary); font-weight: 600; }
.checkbox-item:has(input:checked) { border-color: var(--primary); background: rgba(26,79,110,0.06); }

/* ─── QUICK-SELECT TAGS (اختيار سريع) ─── */
.quick-select-block {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(26,79,110,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.quick-select-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}
.quick-select-tags.checkbox-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-bottom: 8px;
}
.quick-select-block .btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* ─── RANGE ─── */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-wrap input[type="range"] {
  flex: 1;
  padding: 0;
  height: 4px;
  accent-color: var(--primary);
}
.range-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 42px;
  text-align: center;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
  overflow-y: auto;
}
.modal-overlay.active { opacity: 1; }

.modal-box {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s;
  margin: auto;
}
.modal-overlay.active .modal-box { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* Config edit (subjects/grades) */
.config-edit-form { padding: 20px 24px 24px; }
.config-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.config-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.config-list-label { font-weight: 500; color: var(--text); }
.config-list-remove {
  padding: 4px 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.config-list-remove:hover { color: var(--danger, #c0392b); }
.config-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.config-add-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.config-add-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.record-form {
  padding: 20px 24px 24px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ─── VIEW RECORD ─── */
.view-record { padding: 20px 24px 24px; }

/* طويلة السجلات العلاجية: إبقاء التوصيات ضمن التمرير */
.view-record-scroll {
  max-height: min(78vh, 760px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.recommendations-section--highlight {
  background: rgba(26, 79, 110, 0.06);
  border: 1px solid rgba(26, 79, 110, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.reco-hint {
  font-size: 0.82rem;
  margin: 0 0 10px;
  line-height: 1.45;
}

.view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.view-field {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.vf-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.vf-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.detail-heading {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 700;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.detail-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.detail-key { color: var(--text-muted); font-weight: 600; width: 40%; }

.view-notes {
  background: #fffbf0;
  border-right: 3px solid var(--accent);
  padding: 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ─── CONFIRM ─── */
.confirm-box { padding: 28px 24px; text-align: center; }
.confirm-box p { font-size: 0.95rem; color: var(--text); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--primary-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }

/* ─── EMPTY STATE ─── */
#emptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
#emptyState .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
#emptyState .empty-state-icon { margin-bottom: 12px; opacity: 0.9; }
#emptyState p { font-size: 0.9rem; }

/* ─── LOADER ─── */
#loader {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 40px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TEXT UTILS ─── */
.text-muted { color: var(--text-muted); }
strong { font-weight: 700; }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .brand-text h1 { font-size: 0.8rem; }
  .header-brand { min-width: 0; flex: 1; }
  .brand-text { min-width: 0; }
  .brand-text h1 { line-height: 1.35; word-break: break-word; }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
  .page-wrap { padding: 16px 12px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .view-grid { grid-template-columns: 1fr; }
  .teacher-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .filters-card { padding: 14px 16px; }
  .filters-row { gap: 14px; }
  .filter-group {
    flex: 1 1 100%;
    min-width: 0;
  }
  th:nth-child(4), td:nth-child(4),
  th:nth-child(5), td:nth-child(5) { display: none; }
}

@media (max-width: 480px) {
  .login-page {
    padding: 18px 14px 28px;
    align-items: flex-start;
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .login-card {
    padding: 26px 16px 22px;
    border-radius: 18px;
  }
  .login-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }
  .login-subtitle {
    font-size: 0.82rem;
    line-height: 1.65;
    max-width: none;
  }
  .login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 18px;
  }
  .login-logo .ui-icon-xl {
    width: 2.4rem;
    height: 2.4rem;
  }
  .login-subtitle-break {
    display: none;
  }
}

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

/* ─── APP BANNERS / PIN GATE ─── */
.pin-gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 50%, #1a6e8e 100%);
}
.app-banner-warn {
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.5;
}

.teacher-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.teacher-chip .teacher-chip-icon .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
  opacity: 0.95;
}

/* ─── ABOUT PAGE ─── */
.about-page { background: var(--bg); }
.about-wrap { max-width: 800px; margin: 0 auto; padding: 24px 20px 48px; }

.about-hero {
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.about-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 8px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.about-subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 20px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.about-badge {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.about-highlight-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
  transition: transform var(--transition);
}
.about-highlight-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.about-highlight-icon {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 12px;
}
.about-highlight-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.about-highlight-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.about-content-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.about-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.about-body {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}
.about-list {
  margin: 0;
  padding-right: 22px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.8;
}
.about-list li { margin-bottom: 8px; }
.about-list-numbered { list-style: decimal; padding-right: 26px; }

.about-signature-card {
  background: linear-gradient(135deg, rgba(26,79,110,0.08) 0%, rgba(232,160,32,0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.about-signature-line {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.about-signature-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .about-wrap { padding: 16px 14px 36px; }
  .about-hero {
    padding: 26px 16px 22px;
    border-radius: 16px;
  }
  .about-title {
    font-size: clamp(1.15rem, 5vw, 1.35rem);
    line-height: 1.35;
  }
  .about-subtitle {
    font-size: 0.88rem;
    line-height: 1.65;
    max-width: none;
    padding-inline: 2px;
  }
  .about-highlights { grid-template-columns: 1fr; gap: 16px; }
  .about-content-card { padding: 20px 20px; }
}

/* ─── Workflow: notifications & recommendations ─── */
.notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.site-header .notif-bell-btn.btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
}
.site-header .notif-bell-btn.btn:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.site-header .notif-bell-btn.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}
.site-header .notif-bell-btn .ui-icon {
  width: 1.35rem;
  height: 1.35rem;
}
.notif-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid rgba(13, 51, 73, 0.35);
  box-sizing: border-box;
}
.recommendations-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.recommendation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.recommendation-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.recommendation-card__name { color: var(--text); }
.recommendation-role-tag { color: var(--text-muted); }
.recommendation-type-tag {
  background: rgba(26, 79, 110, 0.12);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.recommendation-card__time {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.recommendation-card__text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}
.reco-empty { margin-bottom: 8px; }
.recommendation-compose { margin-top: 4px; }
.reco-compose-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.reco-compose-text {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
}
.reco-compose-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.reco-compose-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
}
.notif-panel { padding: 16px 20px 20px; max-height: 70vh; overflow-y: auto; }
.notif-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.notif-row:last-child { border-bottom: none; }
.notif-row__title { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.notif-row__msg { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.notif-row__time { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.notif-read { opacity: 0.72; }

/* Inline nav link in headers (management workbench) */
.text-link {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.text-link:hover { color: var(--primary); }

/* Admin header: one line greeting, no raw UUIDs */
.admin-session-user-line {
  max-width: 100%;
  line-height: 1.5;
  word-break: break-word;
}

/* ─── Printable record report (window opened from dashboard) ─── */
.print-report-page {
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
  font-family: "Tajawal", sans-serif;
  line-height: 1.6;
}
.print-report-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}
.print-report-logo-wrap {
  flex-shrink: 0;
}
.print-report-logo-img {
  display: block;
  max-width: 160px;
  max-height: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: right center;
}
.print-report-title {
  font-size: 1.2rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin: 0;
}
.print-report-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}
.print-report-body .view-grid {
  margin-top: 0;
}
.print-report-body .view-notes {
  margin-top: 12px;
}
@media print {
  .print-report-page {
    padding: 12mm;
    background: #fff;
  }
  .print-report-head {
    break-inside: avoid;
  }
  .print-report-body .view-field {
    break-inside: avoid;
  }
}
