@font-face {
  font-family: "Amiri";
  src: url("fonts/amiri/amiri-ar-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Amiri";
  src: url("fonts/amiri/amiri-ar-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --blue-800: #123A83;
  --blue-700: #1447A6;
  --blue-600: #155EEF;
  --blue-500: #2979FF;
  --blue-100: #DCE9FF;
  --blue-50: #F0F5FF;
  --green-700: #067647;
  --green-600: #079455;
  --green-100: #D1FADF;
  --green-50: #ECFDF3;
  --red-700: #B42318;
  --red-600: #D92D20;
  --red-100: #FEE4E2;
  --red-50: #FEF3F2;
  --amber-700: #B54708;
  --amber-100: #FEF0C7;
  --ink: #172033;
  --ink-soft: #344054;
  --muted: #475467;
  --subtle: #667085;
  --line: #E4E7EC;
  --line-strong: #D0D5DD;
  --surface: #FFFFFF;
  --surface-alt: #F7F9FC;
  --navy: #0D1830;
  --navy-2: #11264B;
  --sidebar-width: 276px;
  --topbar-height: 82px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-md: 0 12px 32px rgba(20, 47, 91, .10);
  --shadow-lg: 0 24px 60px rgba(13, 24, 48, .18);
  --font: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --text-xs: 13px;
  --text-sm: 15px;
  --text-md: 16px;
  --text-lg: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface-alt); font-family: var(--font); font-size: var(--text-md); line-height: 1.65; min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { color: #fff; background: var(--blue-600); }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10000; top: -80px; inset-inline-start: 18px; padding: 10px 16px; color: #fff; background: var(--navy); border-radius: 10px; }
.skip-link:focus { top: 14px; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; }
.brand > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.brand strong { font-size: 18px; letter-spacing: 0; }
.brand small { color: #C5D1E3; font-size: var(--text-xs); }
.brand--dark { color: var(--navy); }
.brand--dark small { color: var(--muted); }
.brand__logo { flex: 0 0 auto; width: 52px; height: 52px; padding: 3px; object-fit: cover; background: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; box-shadow: 0 8px 20px rgba(13, 24, 48, .16); }
.auth-card > .brand .brand__logo { width: 62px; height: 62px; border-color: var(--line); }
.sidebar .brand { max-width: 220px; }
.sidebar .brand strong { font-size: 16px; line-height: 1.35; }

.auth-screen { display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(480px, .95fr); min-height: 100vh; background: #fff; }
.auth-visual { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 100vh; padding: clamp(40px, 7vw, 110px); color: #fff; background: linear-gradient(145deg, #0D1830 0%, #143C79 52%, #076044 125%); isolation: isolate; }
.auth-visual::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: .17; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 90%); }
.auth-visual::after { content: ""; position: absolute; inset-inline-end: -18%; bottom: -35%; z-index: -1; width: 650px; height: 650px; border-radius: 50%; background: radial-gradient(circle, rgba(7,148,85,.52), rgba(7,148,85,0) 67%); }
.auth-visual__content { position: relative; z-index: 2; max-width: 620px; }
.brand-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; padding: 7px 12px; color: #DCE9FF; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.13); border-radius: 99px; font-size: var(--text-sm); font-weight: 700; }
.brand-kicker::before { content: ""; width: 7px; height: 7px; background: #56D89B; border-radius: 50%; box-shadow: 0 0 0 5px rgba(86,216,155,.13); }
.auth-visual h1 { margin: 0; font-size: clamp(48px, 6vw, 84px); line-height: 1.22; letter-spacing: 0; }
.auth-visual h1 span { color: #77E2AC; }
.auth-visual__content > p { max-width: 570px; margin: 24px 0 34px; color: #E0E8F6; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.8; }
.auth-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 540px; }
.auth-highlights div { display: grid; padding: 17px 18px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; backdrop-filter: blur(10px); }
.auth-highlights strong { font-size: 23px; }
.auth-highlights span { color: #D0DBEB; font-size: var(--text-sm); }
.visual-orbit { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.orbit-one { width: 420px; height: 420px; inset-inline-start: -170px; top: -140px; }
.orbit-two { width: 230px; height: 230px; inset-inline-end: 9%; top: 9%; border-width: 45px; opacity: .4; }

.auth-panel { display: grid; place-items: center; align-content: center; gap: 25px; padding: 45px clamp(28px, 6vw, 90px); background: radial-gradient(circle at 100% 0, var(--blue-50), transparent 28rem), #fff; }
.auth-card { width: min(100%, 480px); }
.auth-heading { margin: 46px 0 30px; }
.eyebrow { margin: 0 0 5px; color: var(--blue-600); font-size: var(--text-sm); font-weight: 800; letter-spacing: 0; }
.auth-heading h2 { margin: 0; color: var(--navy); font-size: 38px; line-height: 1.4; }
.auth-heading > p:last-child { margin: 7px 0 0; color: var(--muted); }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: var(--text-md); font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.text-button { min-height: 44px; padding: 8px 10px; color: var(--blue-600); background: transparent; border: 0; cursor: pointer; font-size: var(--text-sm); font-weight: 700; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input, .input-wrap select { width: 100%; height: 56px; padding: 0 43px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; outline: none; transition: .18s ease; }
.input-wrap input:focus, .input-wrap select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-100); }
.input-wrap input[aria-invalid="true"] { border-color: var(--red-600); box-shadow: 0 0 0 4px var(--red-100); }
.input-icon { position: absolute; inset-inline-start: 15px; z-index: 1; color: var(--subtle); font-size: var(--text-md); }
.input-action { position: absolute; inset-inline-end: 8px; width: 35px !important; height: 35px !important; }
.field-error { display: block; min-height: 22px; margin-top: 4px; color: var(--red-600); font-size: var(--text-sm); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: var(--text-md); font-weight: 700; line-height: 1.5; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; touch-action: manipulation; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button--primary { color: #fff; background: var(--blue-600); box-shadow: 0 8px 20px rgba(21,94,239,.22); }
.button--primary:hover { background: var(--blue-700); }
.button--success { color: #fff; background: var(--green-600); }
.button--danger { color: #fff; background: var(--red-600); }
.button--secondary { color: var(--ink-soft); background: #fff; border-color: var(--line-strong); }
.button--soft { color: var(--blue-700); background: var(--blue-50); border-color: var(--blue-100); }
.button--large { width: 100%; min-height: 52px; margin-top: 2px; }
.form-message { min-height: 25px; margin: 10px 0 0; color: var(--red-600); text-align: center; font-size: var(--text-sm); }
.auth-footer { margin: 0; color: var(--muted); font-size: var(--text-sm); text-align: center; }
.demo-accounts { margin-top: 18px; padding: 14px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 14px; }
.demo-accounts > p { margin: 0 0 10px; color: var(--muted); font-size: var(--text-sm); }
.demo-accounts code { color: var(--blue-700); }
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.demo-grid button { display: flex; align-items: center; gap: 8px; padding: 8px; text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.demo-grid button:hover { border-color: var(--blue-500); }
.demo-grid button > span:last-child { display: grid; font-size: var(--text-sm); font-weight: 700; }
.demo-grid small { color: var(--muted); font-size: var(--text-xs); font-weight: 400; }

.avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; color: #fff; border-radius: 12px; font-size: var(--text-sm); font-weight: 800; }
.avatar--blue { background: linear-gradient(145deg, var(--blue-500), var(--blue-700)); }
.avatar--green { background: linear-gradient(145deg, #12B76A, var(--green-700)); }
.avatar--red { background: linear-gradient(145deg, #F04438, var(--red-700)); }
.avatar--navy { background: linear-gradient(145deg, #344054, var(--navy)); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 22px 17px 17px; color: #fff; background: linear-gradient(175deg, var(--navy) 0%, #102C57 72%, #0D3E34 125%); box-shadow: 12px 0 45px rgba(13,24,48,.08); }
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 19px; }
.sidebar-close { display: none !important; color: #fff !important; }
.school-year { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 18px; padding: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; }
.school-year__icon { display: grid; place-items: center; width: 33px; height: 33px; color: #BFD2FF; background: rgba(21,94,239,.25); border-radius: 9px; }
.school-year > span:nth-child(2) { display: grid; }
.school-year small { color: #B9C7DA; font-size: var(--text-xs); }
.school-year strong { font-size: var(--text-sm); }
.main-nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav-section-label { margin: 17px 11px 7px; color: #9BAECC; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 48px; margin: 3px 0; padding: 11px 12px; color: #D1DAE9; background: transparent; border: 0; border-radius: 10px; cursor: pointer; text-align: start; transition: .16s ease; touch-action: manipulation; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(21,94,239,.48), rgba(21,94,239,.17)); }
.nav-item.is-active::before { content: ""; position: absolute; inset-inline-start: -17px; width: 4px; height: 26px; background: #6EA0FF; border-radius: 0 6px 6px 0; }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; font-size: 18px; }
.nav-item span:nth-child(2) { flex: 1; font-size: 16px; font-weight: 700; }
.nav-badge { padding: 1px 8px; color: #fff; background: var(--red-600); border-radius: 99px; font-size: var(--text-xs); }
.sidebar__bottom { margin-top: auto; padding-top: 16px; }
.local-status { display: flex; align-items: center; gap: 9px; margin: 0 4px 12px; padding: 10px; color: #BFCBE0; background: rgba(255,255,255,.05); border-radius: 10px; }
.local-status > span { width: 8px; height: 8px; background: #4ED696; border-radius: 50%; box-shadow: 0 0 0 5px rgba(78,214,150,.11); }
.local-status div { display: grid; }
.local-status strong { font-size: var(--text-sm); }
.local-status small { color: #AFC0D7; font-size: var(--text-xs); }
.user-mini { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; width: 100%; padding: 11px 8px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; cursor: pointer; text-align: start; }
.user-mini > span:nth-child(2) { display: grid; }
.user-mini strong { font-size: var(--text-sm); }
.user-mini small { color: #B6C4D8; font-size: var(--text-xs); }

.app-area { min-height: 100vh; margin-inline-start: var(--sidebar-width); }
.topbar { position: sticky; z-index: 40; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: var(--topbar-height); padding: 13px clamp(18px, 3vw, 38px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar__start, .topbar__actions { display: flex; align-items: center; gap: 14px; }
.topbar__start > div:last-child { display: grid; }
.breadcrumb { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.topbar h1 { margin: 0; color: var(--navy); font-size: 24px; line-height: 1.45; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.icon-button:hover { background: var(--surface-alt); }
.menu-button { display: none; }
.quick-search { display: flex; align-items: center; gap: 8px; width: clamp(180px, 21vw, 300px); height: 40px; padding: 0 12px; color: var(--subtle); background: var(--surface-alt); border: 1px solid transparent; border-radius: 10px; }
.quick-search:focus-within { background: #fff; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.quick-search input { min-width: 0; flex: 1; background: transparent; border: 0; outline: 0; }
.quick-search kbd { padding: 1px 6px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 5px; font-size: var(--text-xs); direction: ltr; }
.notification-button { position: relative; border: 1px solid var(--line); }
.notification-button i { position: absolute; top: 7px; inset-inline-end: 7px; width: 7px; height: 7px; background: var(--red-600); border: 2px solid #fff; border-radius: 50%; }
.top-user { display: flex; align-items: center; gap: 9px; padding: 4px 5px 4px 9px; background: transparent; border: 0; border-radius: 12px; cursor: pointer; text-align: start; }
.top-user:hover { background: var(--surface-alt); }
.top-user__copy { display: grid; min-width: 88px; }
.top-user__copy strong { font-size: var(--text-sm); }
.top-user__copy small { color: var(--muted); font-size: var(--text-xs); }
.main-content { min-height: calc(100vh - var(--topbar-height)); padding: clamp(18px, 3vw, 38px); }

.page { max-width: 1500px; margin: 0 auto; animation: pageIn .28s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-header h2 { margin: 0; color: var(--navy); font-size: clamp(28px, 3vw, 36px); line-height: 1.4; }
.page-header p { margin: 5px 0 0; color: var(--muted); font-size: var(--text-md); line-height: 1.75; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--dashboard { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.card { min-width: 0; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.card__header h3 { margin: 0; color: var(--navy); font-size: var(--text-lg); line-height: 1.5; }
.card__header p { margin: 3px 0 0; color: var(--muted); font-size: var(--text-sm); }
.card__action { min-height: 44px; padding: 8px 10px; color: var(--blue-600); background: transparent; border: 0; cursor: pointer; font-size: var(--text-sm); font-weight: 700; }
.stat-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; min-height: 124px; }
.stat-card::after { content: ""; position: absolute; width: 100px; height: 100px; inset-inline-end: -45px; bottom: -55px; border: 18px solid var(--blue-100); border-radius: 50%; opacity: .45; }
.stat-icon { display: grid; flex: 0 0 auto; place-items: center; width: 49px; height: 49px; color: var(--blue-700); background: var(--blue-50); border-radius: 14px; font-size: 20px; }
.stat-card.green .stat-icon { color: var(--green-700); background: var(--green-50); }
.stat-card.red .stat-icon { color: var(--red-700); background: var(--red-50); }
.stat-card.amber .stat-icon { color: var(--amber-700); background: #FFFAEB; }
.stat-copy { display: grid; }
.stat-copy small { color: var(--muted); font-size: var(--text-sm); }
.stat-copy strong { margin: 2px 0; color: var(--navy); font-size: 31px; line-height: 1.35; }
.trend { display: inline-flex; align-items: center; gap: 4px; color: var(--green-700); font-size: var(--text-xs); font-weight: 700; }
.trend.down { color: var(--red-700); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-control { position: relative; display: flex; align-items: center; min-width: min(100%, 260px); }
.search-control span { position: absolute; inset-inline-start: 12px; color: var(--subtle); }
.search-control input, .filter-select { height: 46px; padding: 0 37px 0 12px; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; font-size: var(--text-md); }
.search-control input { width: 100%; }
.filter-select { padding-inline-start: 12px; }
.search-control input:focus, .filter-select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.data-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.65; }
.data-table caption { padding: 12px 16px; color: var(--muted); background: var(--surface-alt); text-align: start; }
.data-table th { padding: 13px 15px; color: var(--ink-soft); background: #F9FAFB; border-bottom: 1px solid var(--line); text-align: start; font-size: 14px; font-weight: 800; white-space: nowrap; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #FBFCFE; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-person { display: flex; align-items: center; gap: 9px; min-width: 155px; }
.cell-person > span:last-child { display: grid; }
.cell-person strong { font-size: var(--text-sm); }
.cell-person small { color: var(--muted); font-size: var(--text-xs); }
.table-actions { display: flex; gap: 3px; }
.table-actions .icon-button { width: 44px; height: 44px; font-size: var(--text-md); }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; font-size: var(--text-xs); font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status--success { color: var(--green-700); background: var(--green-100); }
.status--danger { color: var(--red-700); background: var(--red-100); }
.status--warning { color: var(--amber-700); background: var(--amber-100); }
.status--info { color: var(--blue-700); background: var(--blue-100); }
.status--neutral { color: var(--muted); background: #EAECF0; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-top: 1px solid var(--line); }
.pagination p { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.pagination__buttons { display: flex; gap: 4px; }
.pagination button { min-width: 44px; height: 44px; padding: 0 9px; background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: var(--text-xs); }
.pagination button.is-active { color: #fff; background: var(--blue-600); border-color: var(--blue-600); }

.welcome-banner { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 24px 27px; color: #fff; background: linear-gradient(115deg, #123A83, #155EEF 66%, #08734F 135%); border-radius: var(--radius-lg); box-shadow: 0 16px 35px rgba(21,94,239,.18); }
.welcome-banner::after { content: ""; position: absolute; width: 190px; height: 190px; inset-inline-end: -35px; top: -82px; border: 34px solid rgba(255,255,255,.08); border-radius: 50%; }
.welcome-banner__copy { position: relative; z-index: 1; }
.welcome-banner h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.45; }
.welcome-banner p { max-width: 650px; margin: 5px 0 0; color: #E3ECFF; font-size: var(--text-md); }
.welcome-date { position: relative; z-index: 1; display: grid; min-width: 140px; padding: 12px 15px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); border-radius: 13px; text-align: center; }
.welcome-date strong { font-size: var(--text-md); }
.welcome-date small { color: #DCE7FA; font-size: var(--text-xs); }

.chart { position: relative; min-height: 230px; }
.chart canvas { width: 100%; height: 220px; }
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 115px 1fr 48px; gap: 9px; align-items: center; font-size: var(--text-sm); }
.bar-track { height: 8px; overflow: hidden; background: #EEF1F5; border-radius: 99px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-600), #69A2FF); border-radius: inherit; }
.bar-fill.green { background: linear-gradient(90deg, var(--green-600), #59D998); }
.bar-fill.red { background: linear-gradient(90deg, var(--red-600), #FF887F); }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 25px; min-height: 220px; }
.donut { position: relative; width: 145px; height: 145px; border-radius: 50%; background: conic-gradient(var(--green-600) 0 68%, var(--blue-600) 68% 87%, var(--red-600) 87%); }
.donut::after { content: ""; position: absolute; inset: 25px; background: #fff; border-radius: 50%; }
.donut__center { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; }
.donut__center strong { font-size: 23px; }
.donut__center small { color: var(--muted); font-size: var(--text-xs); }
.legend { display: grid; gap: 8px; }
.legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--text-sm); }
.legend i { width: 8px; height: 8px; border-radius: 3px; }

.activity-list, .schedule-list, .notice-list { display: grid; gap: 5px; }
.activity-item, .schedule-item, .notice-item { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; }
.activity-item:hover, .schedule-item:hover, .notice-item:hover { background: var(--surface-alt); }
.activity-icon { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; color: var(--blue-700); background: var(--blue-50); border-radius: 10px; }
.activity-copy { min-width: 0; flex: 1; display: grid; }
.activity-copy strong { overflow: hidden; font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.activity-copy small { color: var(--muted); font-size: var(--text-xs); }
.activity-time { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }

.empty-state { display: grid; place-items: center; padding: 55px 20px; text-align: center; }
.empty-state__icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 12px; color: var(--blue-600); background: var(--blue-50); border-radius: 18px; font-size: 26px; }
.empty-state h3 { margin: 0; font-size: var(--text-lg); }
.empty-state p { max-width: 420px; margin: 5px 0 14px; color: var(--muted); font-size: var(--text-sm); }
.page-loading { display: grid; place-items: center; min-height: 55vh; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.popover { position: fixed; z-index: 100; top: 73px; inset-inline-start: auto; inset-inline-end: auto; width: 220px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-lg); }
.popover::before { content: ""; position: absolute; top: -6px; right: 25px; width: 11px; height: 11px; background: #fff; border-top: 1px solid var(--line); border-left: 1px solid var(--line); transform: rotate(45deg); }
.popover__profile { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; padding: 10px; border-bottom: 1px solid var(--line); }
.popover__profile > span:last-child { display: grid; }
.popover__profile strong { font-size: var(--text-sm); }
.popover__profile small { color: var(--muted); font-size: var(--text-xs); }
.popover > button { width: 100%; min-height: 44px; padding: 10px 11px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; text-align: start; font-size: var(--text-sm); }
.popover > button:hover { background: var(--surface-alt); }
.danger-text { color: var(--red-600) !important; }

.modal-layer { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13,24,48,.56); backdrop-filter: blur(4px); }
/* عمود مرن: الرأس والذيل بحجمهما، والجسم يأخذ ما بقي ويتمرّر.
   قبلها كان الجسم يأخذ `calc(88vh - 145px)` — و145 رقم مفترض لارتفاع
   الرأس والذيل. حين يطول العنوان سطرين أو تلتفّ أزرار الذيل يتجاوز
   المجموع الحدّ الأقصى، و`overflow: hidden` يقصّ ما زاد — وهو الذيل، أي
   زرّ التأكيد. فيملأ المستخدم النموذج ثم لا يجد ما يحفظ به.
   قيس على الإنتاج: 43 بكسل مقصوصة على سطح المكتب من 12 حقلًا فأكثر،
   و57 بكسل على الجوال في كل الأحوال. */
.modal { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(100%, 650px); max-height: min(88vh, 850px); overflow: hidden; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: modalIn .2s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__header, .modal__footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; }
.modal__header { border-bottom: 1px solid var(--line); }
.modal__header h2 { margin: 0; font-size: 24px; line-height: 1.45; }
/* `min-height: 0` شرط لا تحسين: عنصر مرن لا ينكمش دون محتواه بدونه،
   فيدفع الذيل خارج النافذة بدل أن يتمرّر. */
.modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px; }
/* الالتفاف لا الفيض: ثلاثة أزرار عربية («حفظ» و«حفظ وإضافة آخر» و«إلغاء»)
   لا تسع عرض هاتف في سطر واحد. */
.modal__footer { flex-wrap: wrap; justify-content: flex-start; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .field { margin: 0; }
.form-grid .field--full { grid-column: 1 / -1; }
.selection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; max-height: 280px; overflow: auto; padding: 4px; }
.selection-option { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-alt); cursor: pointer; }
.selection-option:hover { border-color: var(--blue-400); background: var(--blue-50); }
.selection-option input { inline-size: 18px; block-size: 18px; flex: 0 0 auto; accent-color: var(--blue-600); }
.selection-option span { display: grid; gap: 2px; }
.selection-option small { color: var(--muted); }
.compact-field { margin: 0; }
.compact-field > span, .card-meta { display: block; color: var(--muted); font-size: var(--text-xs); }
.schedule-cell { display: block; inline-size: 100%; min-inline-size: 118px; padding: 9px; text-align: start; border: 1px solid; border-radius: 8px; cursor: pointer; font-family: inherit; }
.schedule-cell strong, .schedule-cell small { display: block; }
.schedule-cell strong { font-size: var(--text-sm); }
.schedule-cell small { color: var(--muted); font-size: var(--text-xs); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; font-size: var(--text-md); line-height: 1.6; }
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.confirm-box { padding: 13px; color: var(--red-700); background: var(--red-50); border: 1px solid var(--red-100); border-radius: 10px; font-size: var(--text-sm); }

.toast-region { position: fixed; z-index: 300; inset-inline-end: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue-600); border-radius: 11px; box-shadow: var(--shadow-md); animation: toastIn .25s ease both; }
.toast.success { border-inline-start-color: var(--green-600); }
.toast.error { border-inline-start-color: var(--red-600); }
.toast strong { display: block; font-size: var(--text-sm); }
.toast small { color: var(--muted); font-size: var(--text-xs); }
.toast button { min-width: 44px; min-height: 44px; background: transparent; border: 0; cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.mobile-overlay { display: none; }
.metric-strip { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.metric-chip { min-width: 135px; padding: 10px 12px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; }
.metric-chip small { display: block; color: var(--muted); font-size: var(--text-xs); }
.metric-chip strong { font-size: var(--text-lg); }
.alert-card { display: flex; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--amber-700); border-radius: 11px; }
.alert-card.is-danger { border-inline-start-color: var(--red-600); }
.alert-card.is-success { border-inline-start-color: var(--green-600); }
.alert-card__icon { font-size: 18px; }
.alert-card__copy { flex: 1; }
.alert-card h4 { margin: 0; font-size: var(--text-md); }
.alert-card p { margin: 3px 0 7px; color: var(--muted); font-size: var(--text-sm); }
.alert-card button { color: var(--blue-600); background: transparent; border: 0; cursor: pointer; font-size: var(--text-sm); font-weight: 700; }

.school-profile-heading { display: flex; align-items: center; gap: 15px; }
.school-profile-logo { width: 74px; height: 74px; padding: 3px; object-fit: cover; background: #fff; border: 1px solid var(--line); border-radius: 50%; box-shadow: var(--shadow-sm); }
.school-brand-editor { display: flex; align-items: center; gap: 18px; padding: 16px; background: var(--surface-alt); border: 1px dashed var(--line-strong); border-radius: 14px; }
.school-logo-preview { flex: 0 0 auto; width: 108px; height: 108px; padding: 4px; object-fit: cover; background: #fff; border: 2px solid var(--green-100); border-radius: 50%; box-shadow: var(--shadow-sm); }
.school-brand-actions { display: grid; gap: 8px; min-width: 0; }
.school-brand-actions > strong { font-size: var(--text-md); }
.school-brand-actions > small { color: var(--muted); line-height: 1.7; }
.certificate-sheet { position: relative; overflow: hidden; padding: 30px; background: #fff; border: 3px double var(--green-700); border-radius: 16px; font-family: 'Amiri', 'Noto Sans Arabic', serif; }
.certificate-sheet::before, .certificate-sheet::after { content: ""; position: absolute; width: 150px; height: 150px; border: 22px solid rgba(7,148,85,.07); border-radius: 50%; pointer-events: none; }
.certificate-sheet::before { top: -92px; inset-inline-start: -82px; }
.certificate-sheet::after { bottom: -98px; inset-inline-end: -78px; }
.certificate-brand { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; margin-bottom: 24px; text-align: center; }
.certificate-logo { width: 112px; height: 112px; padding: 4px; object-fit: cover; background: #fff; border: 2px solid var(--green-100); border-radius: 50%; }
.certificate-school-name { margin: 0; color: var(--green-700); font-size: 30px; line-height: 1.45; }
.certificate-subtitle { margin: 0; color: var(--muted); font-size: var(--text-md); }
.certificate-contact { max-width: 620px; margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.7; }
.certificate-title { margin: 20px 0 5px; color: var(--navy); font-size: 27px; text-align: center; }
.certificate-student { margin: 0 0 22px; color: var(--ink-soft); text-align: center; }
.certificate-footer-note { display: grid; gap: 6px; margin-top: 24px; color: var(--ink-soft); text-align: center; }
.certificate-footer-note p { margin: 0; }

@media (max-width: 1150px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .span-8, .span-7 { grid-column: span 12; }
  .span-6 { grid-column: span 6; }
  .span-5, .span-4 { grid-column: span 6; }
  .auth-screen { grid-template-columns: .9fr 1.1fr; }
  .auth-visual { padding: 45px; }
  .auth-highlights { grid-template-columns: 1fr; max-width: 250px; }
  .auth-highlights div { grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
}

@media (max-width: 900px) {
  .auth-screen { display: block; background: linear-gradient(145deg, #0D1830, #1447A6); }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 32px 20px; }
  .sidebar { transform: translateX(105%); transition: transform .22s ease; }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.is-open, html[dir="rtl"] .sidebar.is-open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: inline-grid !important; }
  .mobile-overlay { position: fixed; z-index: 50; inset: 0; background: rgba(13,24,48,.45); }
  .mobile-overlay.is-open { display: block; }
  .app-area { margin-inline-start: 0; }
  .topbar { padding-inline: 18px; }
  .quick-search { display: none; }
}

@media (max-width: 680px) {
  .main-content { padding: 16px 12px 35px; }
  .topbar { min-height: 70px; }
  .top-user__copy, .top-user > span:last-child { display: none; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions .button { flex: 1; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--dashboard { display: block; }
  .grid--dashboard > * { margin-bottom: 12px; }
  .welcome-banner { align-items: flex-start; padding: 20px; }
  .welcome-date { display: none; }
  .toolbar { align-items: stretch; }
  .toolbar__group { width: 100%; }
  .search-control { flex: 1 1 100%; }
  .filter-select { flex: 1; min-width: 125px; }
  .data-card { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .data-table caption { display: block; width: 100%; padding: 14px 16px; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { margin-bottom: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
  .data-table td { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border: 0; text-align: end; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: var(--text-xs); font-weight: 700; text-align: start; }
  .data-table td:first-child { justify-content: flex-start; }
  .data-table td:first-child::before { display: none; }
  .table-actions { justify-content: flex-end; width: 100%; }
  .pagination { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--full { grid-column: auto; }
  .modal-layer { padding: 0; align-items: end; }
  /* `dvh` لا `vh`: شريط المتصفح على الجوال يظهر ويختفي، و`vh` تُحسب على
     أكبر ارتفاع فتخرج النافذة تحت الشريط. و`env` لشريط الإيماءات. */
  .modal { width: 100%; max-height: 94dvh; border-radius: 20px 20px 0 0; }
  .modal__footer { padding-bottom: calc(17px + env(safe-area-inset-bottom, 0px)); }
  .donut-wrap { flex-direction: column; }
  .certificate-sheet { padding: 20px 14px; }
  .certificate-logo { width: 90px; height: 90px; }
  .certificate-school-name { font-size: 24px; }
  .school-brand-editor { align-items: flex-start; flex-direction: column; }
  .school-logo-preview { width: 92px; height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toolbar, .toast-region { display: none !important; }
  .app-area { margin: 0; }
  .main-content { padding: 0; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
  body.certificate-printing > .auth-screen,
  body.certificate-printing > .app-shell,
  body.certificate-printing > .popover,
  body.certificate-printing > .toast-region,
  body.certificate-printing .modal-backdrop,
  body.certificate-printing .modal__header,
  body.certificate-printing .modal__footer { display: none !important; }
  body.certificate-printing .modal-layer { position: static; display: block !important; padding: 0; }
  body.certificate-printing .modal { width: 100%; max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
  body.certificate-printing .modal__body { max-height: none; overflow: visible; padding: 0; }
  body.certificate-printing .certificate-sheet { min-height: 95vh; border-color: #067647; break-inside: avoid; }
}

/* ---------- مؤشر المزامنة ---------- */
/* اللون وحده لا يكفي: النص يقول الحالة صراحةً لمن لا يميّز الألوان. */
.sync-chip {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.sync-chip--off { color: var(--muted, #6b7280); }
.sync-chip--synced { color: #067647; }
.sync-chip--syncing { color: #b54708; }
.sync-chip--error { color: #b42318; }
.sync-chip:hover { filter: brightness(1.15); }

@media (max-width: 720px) {
  .sync-chip { padding: 5px 9px; font-size: 11px; }
}

/* ---------- حقول تُدار من لوحة أثر ---------- */
/* تُعرض للقراءة لا كحقل معطّل: الحقل المعطّل يوحي بأنه سيُفتح يومًا. */
.managed-by-athar {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px dashed var(--border, #d0d5dd);
  border-radius: 12px;
  background: var(--surface-muted, rgba(0, 0, 0, .02));
}
.managed-by-athar .managed-label { font-size: 13px; font-weight: 600; color: var(--muted-dark, #667085); }
.managed-by-athar strong { font-size: 16px; }
.managed-by-athar small { font-size: 12px; color: var(--muted-dark, #667085); line-height: 1.7; }

/* ---------- طبقة الهوية الفاخرة — الشكل فقط ---------- */
/* هذه الطبقة لا تغيّر بنية العناصر أو حالاتها أو صلاحياتها؛ إنها تعيد ضبط
   اللغة البصرية إلى لوحة مدرسية مؤسسية هادئة: أخضر عميق، عاجي، وذهبي. */
:root {
  --blue-800: #4d3519;
  --blue-700: #79521f;
  --blue-600: #a16d2a;
  --blue-500: #c08a42;
  --blue-100: #f0e2ca;
  --blue-50: #fbf6ec;
  --green-700: #0d5b4d;
  --green-600: #13745f;
  --green-100: #d8eee5;
  --green-50: #eff9f4;
  --ink: #1c2b2d;
  --ink-soft: #3b4e50;
  --muted: #5c6e70;
  --subtle: #738284;
  --line: #dfe7e3;
  --line-strong: #c9d5d0;
  --surface: #fffdfa;
  --surface-alt: #f3f6f3;
  --navy: #102f34;
  --navy-2: #17474a;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 5px 18px rgba(16, 47, 52, .055);
  --shadow-md: 0 16px 38px rgba(16, 47, 52, .09);
  --shadow-lg: 0 28px 70px rgba(16, 47, 52, .16);
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
  --display-font: "Amiri", Georgia, serif;
  --text-xs: 13px;
  --text-sm: 15px;
  --text-md: 16px;
  --text-lg: 21px;
}

html { background: #eef2ef; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0, rgba(161, 109, 42, .055), transparent 28rem),
    linear-gradient(135deg, #f7f8f5 0%, #eef3ef 100%);
}
::selection { color: #fff; background: var(--green-700); }
:focus-visible { outline: 3px solid #d49c51; outline-offset: 3px; }

.brand strong,
.auth-visual h1,
.auth-heading h2,
.page-header h2,
.welcome-banner h2,
.card__header h3,
.modal__header h2,
.certificate-school-name,
.certificate-title {
  font-family: var(--display-font);
  font-weight: 700;
}
.brand strong { letter-spacing: .01em; }
.eyebrow { color: var(--green-700); letter-spacing: .04em; }

.auth-screen {
  background: var(--surface);
  grid-template-columns: minmax(440px, 1.08fr) minmax(480px, .92fr);
}
.auth-visual {
  background:
    radial-gradient(circle at 22% 18%, rgba(192, 138, 66, .28), transparent 20rem),
    linear-gradient(145deg, #0c282e 0%, #123d40 57%, #0b5145 125%);
}
.auth-visual::before {
  opacity: .11;
  background-size: 56px 56px;
}
.auth-visual::after {
  background: radial-gradient(circle, rgba(192, 138, 66, .42), rgba(192, 138, 66, 0) 68%);
}
.auth-visual__content { max-width: 650px; }
.brand-kicker {
  color: #f2ddbc;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(224, 174, 99, .42);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}
.brand-kicker::before { background: #e0ae63; box-shadow: 0 0 0 5px rgba(224, 174, 99, .14); }
.auth-visual h1 { font-size: clamp(54px, 6vw, 92px); line-height: 1.12; }
.auth-visual h1 span { color: #e0ae63; }
.auth-visual__content > p { color: #d9e7e2; }
.auth-highlights div {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(224, 174, 99, .22);
  border-radius: 18px;
}
.auth-highlights strong { color: #f1d6a8; font-family: var(--display-font); }
.orbit-one { border-color: rgba(224, 174, 99, .2); }
.orbit-two { border-color: rgba(224, 174, 99, .24); }
.auth-panel {
  background: radial-gradient(circle at 100% 0, #fbf2e2, transparent 30rem), var(--surface);
}
.auth-card > .brand .brand__logo { border-color: #e7d5b8; box-shadow: 0 10px 25px rgba(16, 47, 52, .1); }
.auth-heading { margin-top: 48px; }
.auth-heading h2 { color: var(--navy); font-size: 42px; }
.input-wrap input, .input-wrap select,
.field input, .field select, .field textarea {
  background: rgba(255, 255, 255, .88);
  border-color: var(--line-strong);
  border-radius: 13px;
}
.input-wrap input:focus, .input-wrap select:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px var(--blue-100), 0 8px 24px rgba(161, 109, 42, .08);
}
.button { border-radius: 12px; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button--primary {
  background: linear-gradient(135deg, #b27b34, #8f5c20);
  box-shadow: 0 12px 24px rgba(143, 92, 32, .22);
}
.button--primary:hover { background: linear-gradient(135deg, #c48b45, #a16d2a); }
.button--secondary { background: rgba(255, 255, 255, .76); }

.sidebar {
  padding: 25px 18px 18px;
  background:
    radial-gradient(circle at 12% 8%, rgba(224, 174, 99, .18), transparent 17rem),
    linear-gradient(175deg, #0d2c32 0%, #102f34 64%, #0b493e 125%);
  border-inline-end: 1px solid rgba(224, 174, 99, .17);
  box-shadow: 18px 0 55px rgba(16, 47, 52, .13);
}
.sidebar__top { padding-bottom: 23px; }
.sidebar .brand__logo { border-color: rgba(224, 174, 99, .55); box-shadow: 0 8px 26px rgba(0, 0, 0, .18); }
.sidebar .brand strong { font-size: 18px; }
.school-year {
  margin-bottom: 21px;
  padding: 13px;
  background: rgba(255, 255, 255, .055);
  border-color: rgba(224, 174, 99, .2);
  border-radius: 15px;
}
.school-year__icon { color: #e0ae63; background: rgba(161, 109, 42, .22); }
.nav-section-label { color: #c7b58e; letter-spacing: .04em; }
.nav-item { color: #c3d1cf; border-radius: 12px; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(161, 109, 42, .5), rgba(161, 109, 42, .14));
  box-shadow: inset 0 0 0 1px rgba(224, 174, 99, .13);
}
.nav-item.is-active::before { background: #e0ae63; box-shadow: 0 0 18px rgba(224, 174, 99, .55); }
.nav-badge { background: #b96045; }
.local-status { background: rgba(255, 255, 255, .055); border: 1px solid rgba(224, 174, 99, .12); border-radius: 12px; }
.user-mini { background: rgba(255, 255, 255, .035); border-color: rgba(224, 174, 99, .2); border-radius: 14px; }
.user-mini:hover { background: rgba(255, 255, 255, .09); border-color: rgba(224, 174, 99, .42); }

.app-area { background: transparent; }
.topbar {
  min-height: 84px;
  background: rgba(255, 253, 250, .84);
  border-bottom-color: rgba(201, 213, 208, .72);
  box-shadow: 0 8px 28px rgba(16, 47, 52, .045);
}
.breadcrumb { color: var(--green-700); font-weight: 700; }
.topbar h1 { color: var(--navy); font-family: var(--display-font); font-size: 29px; }
.icon-button { border-radius: 12px; }
.icon-button:hover, .top-user:hover { background: #f1eee7; }
.notification-button { border-color: var(--line-strong); }
.quick-search { background: #f2f4f0; border-color: var(--line); border-radius: 12px; }
.quick-search:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.top-user { border: 1px solid transparent; }
.top-user[aria-expanded="true"] { background: #f2eee5; border-color: #e7d5b8; }
.main-content { padding: clamp(22px, 3.4vw, 44px); }
.page-header { margin-bottom: 27px; }
.page-header h2 { font-size: clamp(32px, 3vw, 42px); }
.page-header p { max-width: 690px; color: #647577; }
.page { max-width: 1540px; }
.card {
  padding: 22px;
  background: rgba(255, 253, 250, .92);
  border-color: rgba(201, 213, 208, .8);
  border-radius: 19px;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: 0 12px 30px rgba(16, 47, 52, .075); }
.card__header { margin-bottom: 18px; }
.card__header h3 { color: var(--navy); font-size: 23px; }
.stat-card { min-height: 132px; }
.stat-card::after { border-color: #ead7b7; opacity: .35; }
.stat-icon { color: var(--blue-700); background: var(--blue-50); border: 1px solid #edddc4; border-radius: 15px; }
.stat-copy strong { color: var(--navy); font-family: var(--display-font); font-size: 35px; }
.welcome-banner {
  margin-bottom: 22px;
  padding: 29px 32px;
  background:
    radial-gradient(circle at 84% 18%, rgba(224, 174, 99, .2), transparent 17rem),
    linear-gradient(115deg, #0d2c32, #123f42 66%, #0d5b4d 135%);
  border: 1px solid rgba(224, 174, 99, .23);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(16, 47, 52, .16);
}
.welcome-banner h2 { font-size: clamp(30px, 3vw, 40px); }
.welcome-banner p { color: #d8e6e1; }
.welcome-date { background: rgba(255, 253, 250, .1); border-color: rgba(224, 174, 99, .32); border-radius: 15px; }
.welcome-date strong { color: #f0d5a6; }
.welcome-date small { color: #d4e1dc; }

.data-card { border-radius: 19px; }
.data-table th { color: var(--navy); background: #f3f5f1; border-bottom-color: var(--line-strong); }
.data-table td { border-bottom-color: #e8eeea; }
.data-table tbody tr:hover { background: #fbf8f0; }
.status--info { color: var(--blue-700); background: var(--blue-100); }
.pagination { border-top-color: var(--line); }
.pagination button { border-color: var(--line-strong); border-radius: 9px; }
.pagination button.is-active { background: var(--green-700); border-color: var(--green-700); }
.search-control input, .filter-select { border-color: var(--line-strong); border-radius: 11px; }
.search-control input:focus, .filter-select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }

.bar-track { background: #e8efeb; }
.bar-fill { background: linear-gradient(90deg, #a16d2a, #d2a25e); }
.bar-fill.green { background: linear-gradient(90deg, #0d5b4d, #43a98a); }
.donut::after { background: var(--surface); }
.activity-item:hover, .schedule-item:hover, .notice-item:hover { background: #f7f5ee; }
.activity-icon { color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-100); }
.empty-state__icon { color: var(--blue-700); background: var(--blue-50); border: 1px solid #edddc4; }

.popover {
  padding: 9px;
  background: rgba(255, 253, 250, .97);
  border-color: #dfcba8;
  border-radius: 16px;
  box-shadow: 0 24px 54px rgba(16, 47, 52, .2);
  backdrop-filter: blur(18px);
}
.popover::before { background: #fffdfa; border-top-color: #dfcba8; border-left-color: #dfcba8; }
.popover__profile { padding: 12px; border-bottom-color: var(--line); }
.popover > button:hover { color: var(--green-700); background: #f4efe5; }

.modal-backdrop { background: rgba(8, 32, 36, .62); backdrop-filter: blur(7px); }
.modal { background: var(--surface); border: 1px solid #e2d9c9; border-radius: 22px; box-shadow: 0 32px 90px rgba(8, 32, 36, .25); }
.modal__header { border-bottom-color: var(--line); }
.modal__header h2 { color: var(--navy); font-size: 28px; }
.modal__footer { border-top-color: var(--line); }
.selection-option { background: #f7f8f5; border-color: var(--line); border-radius: 12px; }
.selection-option:hover { border-color: #d6b274; background: #fbf6ec; }
.confirm-box { border-radius: 12px; }
.toast { background: rgba(255, 253, 250, .98); border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-md); }
.metric-chip { background: #f5f6f2; border-color: var(--line); border-radius: 12px; }
.alert-card { border-radius: 13px; }

.school-profile-logo, .school-logo-preview, .certificate-logo { border-color: #d7b77d; box-shadow: 0 10px 26px rgba(16, 47, 52, .09); }
.school-brand-editor { background: #f7f8f5; border-color: #d8c8aa; border-radius: 16px; }
.certificate-sheet { border-color: #a16d2a; box-shadow: 0 14px 35px rgba(16, 47, 52, .08); }
.certificate-school-name { color: var(--green-700); }

@media (max-width: 900px) {
  .auth-screen { background: linear-gradient(145deg, #0d2c32, #123f42); }
  .auth-panel { background: radial-gradient(circle at 100% 0, #fbf2e2, transparent 26rem), var(--surface); }
}

@media (max-width: 680px) {
  .main-content { padding: 18px 13px 38px; }
  .topbar { min-height: 74px; }
  .page-header h2 { font-size: 32px; }
  .welcome-banner { padding: 23px 20px; border-radius: 20px; }
  .card { padding: 18px; border-radius: 16px; }
  .data-table tr { border-color: var(--line); border-radius: 14px; }
  .pagination { border-color: var(--line); }
}

@media print {
  .card, .modal { box-shadow: none; }
}

/* Premium responsive navigation: keeps the existing routes and permission model intact. */
:root { --sidebar-width: 294px; }
.sidebar {
  inset-block: 14px;
  inset-inline-start: 14px;
  width: var(--sidebar-width);
  height: calc(100dvh - 28px);
  padding: 22px 16px 16px;
  border: 1px solid rgba(224, 174, 99, .2);
  border-radius: 26px;
  box-shadow: 0 20px 55px rgba(16, 47, 52, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.sidebar__top { padding-inline: 6px; padding-bottom: 21px; }
.sidebar .brand { padding-inline: 2px; }
.sidebar .brand strong { letter-spacing: -.01em; }
.school-year { margin-inline: 2px; margin-bottom: 19px; padding: 13px; }
.main-nav { padding-inline: 2px; }
.nav-section-label { margin-inline: 9px; }
.nav-item { min-height: 51px; margin: 4px 0; padding: 11px 13px; gap: 12px; border-radius: 15px; }
.nav-item::after { content: ''; position: absolute; inset: 5px; border: 1px solid transparent; border-radius: 11px; pointer-events: none; }
.nav-item:hover::after { border-color: rgba(255, 255, 255, .12); }
.nav-item.is-active::after { border-color: rgba(224, 174, 99, .18); }
.nav-icon { width: 31px; height: 31px; color: #d9c18f; background: rgba(255, 255, 255, .055); border: 1px solid rgba(224, 174, 99, .16); border-radius: 10px; }
.nav-item.is-active .nav-icon { color: #fff4da; background: rgba(161, 109, 42, .36); border-color: rgba(224, 174, 99, .38); }
.sidebar__bottom { padding: 15px 2px 2px; }
.local-status { margin-inline: 0; margin-bottom: 12px; padding: 11px; border-radius: 14px; }
.user-mini { min-height: 61px; padding: 10px; border-radius: 15px; }
.app-area { margin-inline-start: calc(var(--sidebar-width) + 28px); }

@media (max-width: 900px) {
  .sidebar {
    inset-block: 0;
    inset-inline-start: 0;
    width: min(88vw, 330px);
    height: 100dvh;
    padding: 24px 16px 16px;
    border-radius: 24px 0 0 24px;
  }
  .app-area { margin-inline-start: 0; }
  .topbar { padding-inline: 16px; }
}

@media (max-width: 480px) {
  .sidebar { width: min(91vw, 330px); padding-inline: 13px; }
  .nav-item { min-height: 53px; }
  .nav-item span:nth-child(2) { font-size: 15px; }
}
