@font-face { font-family: Tajawal; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/Tajawal-Regular.ttf') format('truetype'); }
@font-face { font-family: Tajawal; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/Tajawal-Medium.ttf') format('truetype'); }
@font-face { font-family: Tajawal; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/Tajawal-Bold.ttf') format('truetype'); }
:root {
  color-scheme: light;
  --primary: #0c6467; --primary-dark: #084d50; --primary-soft: #e6f5f2;
  --canvas: #f4f7f6; --card: #fff; --subtle: #eef3f2; --border: #d3dfdc;
  --text: #142c35; --secondary: #415963; --muted: #596e78;
  --success: #137547; --warning: #9a5b08; --danger: #af3035; --calling: #6545a4;
  --radius-md: 12px; --radius-lg: 20px;
  --shadow-card: 0 2px 8px #183d4310, 0 18px 44px #183d4308;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 88% 0, #e7f4f0 0, transparent 34rem), var(--canvas); color: var(--text); font: 400 16px/1.6 Tajawal, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { min-width: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 2vw, 32px); line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 1.35; }
h3 { font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled, .button.disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #b16a0b; outline-offset: 3px; }
[hidden] { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.muted { color: var(--secondary); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.inline-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; }
.inline-status { display: inline-flex; align-items: center; gap: 6px; }
.state-icon .inline-icon { width: 28px; height: 28px; }
small.muted { color: var(--muted); font-size: 12px; line-height: 16px; }
.card { padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card > .card { box-shadow: none; }
.notice { background: var(--primary-soft); padding: 18px; border-radius: 16px; }
.danger-notice { color: var(--danger); border-inline-start: 3px solid var(--danger); }
.page-heading { display: flex; flex-direction: column; gap: 6px; margin-block-end: 4px; }
.page-heading .muted { font-size: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 15px; line-height: 20px; font-weight: 700; text-align: center; text-decoration: none; overflow-wrap: anywhere; transition: background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.button:hover { text-decoration: none; }
.button.primary { background: var(--primary); color: #fff; box-shadow: 0 7px 16px #0c646728; }
.button.primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 10px 20px #0c646733; }
.button.secondary { background: #fff; color: var(--primary); border-color: #91bfba; }
.button.secondary:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.button.danger { background: var(--danger); color: #fff; }
.button.ghost { color: var(--primary); background: transparent; min-height: 44px; padding: 10px 12px; }
.button.ghost:hover:not(:disabled) { background: var(--primary-soft); }
.button:disabled, .button.disabled { color: var(--secondary); background: #e2e8f0; border-color: #e2e8f0; }
.button[aria-busy=true]::before { content: '◌'; animation: spin 1s linear infinite; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 14px; font-weight: 700; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; min-height: 50px; padding: 10px 14px; border: 1px solid #aebfba; border-radius: 11px; background: #fff; line-height: 1.5; font-size: 16px; }
.field input[type=checkbox] { align-self: flex-start; width: 24px; height: 24px; accent-color: var(--primary); }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.field input:user-invalid, .field textarea:user-invalid, .field select:user-invalid,
.field [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.field input[type=file] { background: var(--subtle); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); }
.filter-bar .field { flex: 1 1 160px; }
.filter-bar .field:first-child { flex-basis: 220px; }
.filter-bar .button { flex: 0 0 auto; }
.preview-bar { background: #e8f2ef; border-bottom: 1px solid var(--border); font-size: 12px; }
.preview-bar summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 38px; padding: 8px 24px; cursor: pointer; }
.preview-label { color: var(--primary-dark); font-weight: 700; }
.preview-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px 24px 18px; }
.preview-controls .field { flex: 1 1 150px; max-width: 230px; }
.preview-controls .muted:last-child { flex: 1 0 100%; }
.topbar { min-height: 76px; padding: 12px 32px; border-bottom: 1px solid var(--border); background: #ffffffed; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; min-height: 44px; }
.brand-mark { display: grid; place-items: center; background: linear-gradient(145deg, #0c6467, #169b84); color: #fff; width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 8px 18px #0c64672b; }
.portal-layout { min-height: calc(100vh - 38px); }
.main-content { min-width: 0; padding: 36px; }
.main-content.parent { width: min(440px,100%); max-width: 100%; margin-inline: auto; padding: 28px 22px; padding-block-end: 112px; }
.main-content.staff { max-width: 1280px; margin-inline: auto; }
.login-screen { padding-block-start: 68px; min-height: 680px; }
.login-screen h1 { font-size: 32px; line-height: 38px; }
.login-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(145deg, #0c6467, #169b84); box-shadow: 0 15px 30px #0c64672c; color: #fff; font-size: 32px; font-weight: 700; }
.login-screen .card { padding: 0; border: 0; box-shadow: none; background: transparent; }
.login-screen .field { background: #fff; border-radius: 12px; padding: 16px; }
.login-screen .field label { font-size: 12px; line-height: 16px; }
.login-screen .field input { padding: 0; border: 0; min-height: 30px; }
.login-screen .button { width: 100%; }
.staff .login-screen { padding-block-start: 0; max-width: 560px; min-height: 650px; }
.staff .login-mark { display: none; }
.staff .login-screen h1 { font-size: 24px; line-height: 31px; }
.staff .login-screen .card { padding: 24px; background: #fff; }
.staff .login-screen .field { background: var(--subtle); }
.staff .login-screen .field input { background: transparent; }
.otp-input { font-size: 24px !important; letter-spacing: .3em; text-align: center; font-weight: 700; }
.student-grid { display: grid; gap: 18px; }
.active-request-banner { display: grid; gap: 4px; padding: 14px; border-radius: var(--radius-md); background: var(--subtle); }
.active-request-banner h2 { font-size: 16px; line-height: 25px; font-weight: 400; }
.active-request-banner p, .active-request-banner a { font-size: 14px; line-height: 20px; }
.active-request-banner a { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; }
.student-card { min-height: 244px; gap: 10px; align-items: flex-start; border-inline-start: 4px solid #9acfc4; }
.student-card:has(.status-Calling) { border-inline-start-color: var(--calling); }
.student-card:has(.status-Ready) { border-inline-start-color: var(--success); }
.student-card h2 { font-size: 22px; }
.student-card .button { margin-block-start: auto; min-width: 160px; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: var(--primary-dark); background: var(--primary-soft); font-size: 21px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border-radius: 999px; padding: 7px 10px; font-size: 13px; line-height: 16px; font-weight: 700; color: var(--text); background: var(--subtle); }
.badge img { flex: 0 0 8px; }
.status-Calling { color: var(--calling); }
.status-Accepted { color: var(--primary); }
.status-StudentOnTheWay { color: #176c91; }
.status-Ready, .status-Delivered { color: var(--success); }
.status-StudentNotFound, .status-ParentNoShow, .status-DeliveryFailed, .status-Rejected { color: var(--danger); }
.status-title { font-size: 24px; line-height: 31px; }
.current-status-card { gap: 6px; border-radius: var(--radius-md); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.timeline li { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: start; gap: 10px; color: var(--muted); font-size: 14px; }
.timeline li.complete { color: var(--success); }
.timeline li.current { color: var(--calling); font-weight: 700; }
.timeline-marker { font-size: 18px; line-height: 20px; }
.bottom-nav { display: grid; grid-template-columns: repeat(3,1fr); position: fixed; z-index: 20; inset-block-end: 0; inset-inline: 0; width: 440px; max-width: 100%; margin-inline: auto; padding: 8px 10px max(8px,env(safe-area-inset-bottom)); background: #fffffff2; border-top: 1px solid var(--border); box-shadow: 0 -10px 30px #183d430d; }
.bottom-nav a, .portal-nav a { min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 10px; color: var(--secondary); font-size: 14px; }
.bottom-nav a.active, .portal-nav a.active { color: var(--primary-dark); background: var(--primary-soft); border-radius: 10px; font-weight: 700; }
.bottom-nav a:hover, .portal-nav a:hover { background: var(--subtle); text-decoration: none; border-radius: 10px; }
.portal-layout > .portal-nav { display: flex; justify-content: center; border-top: 1px solid var(--border); background: #fff; }
.admin-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: calc(100vh - 38px); }
.sidebar { padding: 30px 20px; background: #fff; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; }
.school-brand { color: var(--primary-dark); font-size: 23px; line-height: 1.3; }
.sidebar .portal-nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar .portal-nav a { justify-content: flex-start; padding-inline: 16px; }
.sidebar > .button:last-child { margin-block-start: auto; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.status-tabs .button { min-width: 150px; border-radius: 999px; }
.queue-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 18px; align-items: start; }
.queue-list { gap: 12px; max-height: 540px; overflow-y: auto; padding: 2px; }
.queue-card .button { align-self: flex-start; }
.queue-selected .card { min-height: 320px; }
.queue-selected .button { width: 100%; }
.queue-card { min-height: 160px; gap: 8px; border-inline-start: 4px solid #a1cac1; }
.queue-card:has(.status-Ready) { border-inline-start-color: var(--success); }
.queue-card:has(.status-Calling) { border-inline-start-color: var(--calling); }
.queue-card:hover { border-color: #9dc5bc; box-shadow: 0 8px 24px #183d431a; }
.queue-card h2 { font-size: 16px; line-height: 25px; }
.queue-card .text-link { min-height: 24px; font-size: 12px; }
.selected-request { min-height: 490px; background: linear-gradient(160deg, #fff, #f5fbf9); }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 18px; align-items: stretch; }
.staff .detail-layout > .card { min-height: 510px; padding: 20px; }
.detail-layout .button { width: 100%; }
.detail-layout .row .button { flex: 1 1 160px; width: auto; }
.two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.two-columns > .card { min-height: 390px; padding: 18px; }
.three-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.three-columns > .card { min-height: 470px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 16px; }
.kpi { min-height: 142px; gap: 8px; border-block-start: 4px solid #9ccbc1; }
.kpi:nth-child(2) { border-block-start-color: var(--success); }
.kpi:nth-child(4) { border-block-start-color: var(--warning); }
.kpi:nth-child(5) { border-block-start-color: var(--danger); }
.kpi-value { color: var(--text); font-size: clamp(30px, 2.5vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.chart { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.chart dt { width: 54px; font-size: 14px; }
.chart dd { margin: 0; color: #fff; background: linear-gradient(90deg, #16a085, var(--primary)); border-radius: 8px; padding: 5px 9px; text-align: end; }
.bar-21 { width: 45%; } .bar-36 { width: 72%; } .bar-13 { width: 30%; }
.table-scroll { overflow-x: auto; width: 100%; border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: start; }
th { background: var(--subtle); color: var(--secondary); font-size: 13px; font-weight: 700; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; overflow-wrap: anywhere; }
tr:nth-child(even) td { background: #f8faf9; }
tbody tr:hover td { background: var(--primary-soft); }
td .row { flex-wrap: nowrap; }
td .row .button, td .text-link { white-space: nowrap; }
.state-panel { align-items: center; text-align: center; min-height: 320px; padding: 32px 24px; }
.state-icon { display: grid; place-items: center; font-size: 32px; color: var(--danger); background: #fef2f2; width: 64px; height: 64px; border-radius: 50%; }
.state-icon.loading { color: var(--primary); background: var(--primary-soft); animation: spin 1.2s linear infinite; }
.state-icon.empty { color: var(--muted); background: var(--subtle); }
.skeleton { height: 16px; border-radius: 8px; width: 100%; background: var(--subtle); animation: pulse 1.4s ease-in-out infinite; }
.camera-view { display: grid; place-items: center; min-height: 340px; padding: 24px; background: #0f172a; color: #fff; border-radius: 12px; }
.viewfinder { width: min(100%,240px); aspect-ratio: 1; border: 3px solid #fff; border-radius: 12px; padding: 12px; font-size: 14px; }
.dialog { width: min(100% - 32px,600px); max-height: min(85vh,850px); overflow-y: auto; padding: 24px; color: var(--text); background: #fff; border: 0; border-radius: 16px; box-shadow: 0 20px 80px #0f172a40; }
.dialog::backdrop { background: #0f172a80; }
.dialog .row > .button { flex: 1 1 120px; }
.toast { position: fixed; z-index: 100; inset-block-end: 90px; inset-inline: 16px; margin-inline: auto; width: fit-content; max-width: min(90%,620px); padding: 14px 20px; border-radius: 10px; background: #0f172a; color: #fff; box-shadow: 0 4px 20px #0003; }
.toast.error { background: var(--danger); }
.skip-link { position: fixed; z-index: 120; inset-block-start: 8px; inset-inline-start: 8px; padding: 10px 14px; border-radius: 8px; background: var(--text); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width:768px) {
  .main-content.parent:not(:has(.login-screen)) { width: 760px; }
  .student-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bottom-nav { position: static; width: 390px; margin-block: 16px 32px; border: 1px solid var(--border); border-radius: 12px; }
  .main-content.parent { padding-block-end: 24px; }
}
@media (max-width:1100px) {
  .admin-layout { grid-template-columns: 210px minmax(0,1fr); }
  .sidebar { padding: 18px; }
  .kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .three-columns { grid-template-columns: 1fr; }
  .three-columns > .card { min-height: auto; }
}
@media (max-width:800px) {
  .admin-layout { display: flex; flex-direction: column; }
  .sidebar { gap: 8px; border-bottom: 1px solid var(--border); }
  .sidebar .portal-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .portal-nav a { flex: 1 1 140px; }
  .sidebar > .button:last-child { align-self: flex-start; }
  .main-content { padding: 24px; }
  .queue-layout, .detail-layout, .two-columns { grid-template-columns: 1fr; }
  .staff .detail-layout > .card, .selected-request, .two-columns > .card { min-height: auto; }
  .queue-list { order: -1; }
  .topbar { padding: 12px 16px; }
  .topbar .row > .muted { display: none; }
}
@media (max-width:480px) {
  .main-content:not(.parent) { padding: 16px; }
  .preview-bar summary { padding-inline: 16px; }
  .preview-controls { padding-inline: 16px; }
  .preview-bar summary > .muted { font-size: 12px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar { padding: 10px; }
  .filter-bar .field { flex-basis: 100%; }
  .button { max-width: 100%; }
  table { min-width: 620px; }
  .login-screen { padding-block-start: 64px; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
.main-content:has(.login-screen) { max-width: 560px; margin-inline: auto; }
