@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: "Amiri", Tahoma, "Segoe UI", Arial, sans-serif;
  --text-xs: 14px;
  --text-sm: 16px;
  --text-md: 18px;
  --text-lg: 21px;
}

* { 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.75; }
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 rgba(21, 94, 239, .35); outline-offset: 2px; }
.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 { padding: 2px; 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: 46px; 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; }
.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%; margin: 3px 0; padding: 11px 12px; color: #D1DAE9; background: transparent; border: 0; border-radius: 10px; cursor: pointer; text-align: start; transition: .16s ease; }
.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: 40px; height: 40px; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.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 { 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: 36px; height: 36px; 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: 36px; height: 36px; 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-end: 22px; 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; inset-inline-end: 25px; width: 11px; height: 11px; background: #fff; border-top: 1px solid var(--line); border-inline-start: 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%; 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); }
.modal { position: relative; z-index: 1; 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 { 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; }
.modal__body { max-height: calc(88vh - 145px); overflow-y: auto; padding: 20px; }
.modal__footer { 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 { 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; }
.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; }
  .modal { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .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; }
}
