:root {
  --bg:#f5f7fa; --card:#fff; --text:#1c2333; --muted:#667085; --line:#e4e7ec;
  --primary:#0f6b4f; --primary-2:#0c5a42; --danger:#c0392b; --warn:#b7791f; --info:#2563eb;
  --new:#6b7280; --approved:#2563eb; --preparing:#b7791f; --exited:#0f6b4f; --received:#0f6b4f; --rejected:#c0392b; --cancelled:#9ca3af;
  --radius:12px; --shadow:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
}
* { box-sizing:border-box; }
html { direction:rtl; }
body { margin:0; background:var(--bg); color:var(--text); font-family:"Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif; font-size:16px; line-height:1.5; }
a { color:var(--primary); }
header.top { background:var(--primary); color:#fff; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
header.top h1 { font-size:18px; margin:0; font-weight:700; }
header.top .sub { font-size:13px; opacity:.85; }
header.top button { background:rgba(255,255,255,.15); color:#fff; border:1px solid rgba(255,255,255,.35); }
main { max-width:960px; margin:0 auto; padding:16px; }
main.narrow { max-width:520px; }
.card { background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; margin-bottom:14px; }
.card h2 { font-size:17px; margin:0 0 12px; }
.card h3 { font-size:15px; margin:14px 0 8px; }
label { display:block; font-size:14px; color:var(--muted); margin:10px 0 4px; }
input, select, textarea { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:8px; font:inherit; background:#fff; color:var(--text); }
input:focus, select:focus, textarea:focus { outline:2px solid #b7dccf; border-color:var(--primary); }
input[type=file] { padding:6px; }
button, .btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:9px 14px; border-radius:8px; border:1px solid transparent; font:inherit; font-weight:600; cursor:pointer; background:var(--primary); color:#fff; text-decoration:none; }
button:hover { background:var(--primary-2); }
button:disabled { opacity:.55; cursor:not-allowed; }
button.secondary { background:#fff; color:var(--text); border-color:var(--line); }
button.secondary:hover { background:#f2f4f7; }
button.danger { background:var(--danger); }
button.warn { background:var(--warn); }
button.info { background:var(--info); }
button.small { padding:6px 10px; font-size:14px; }
button.block { width:100%; margin-top:14px; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.row > * { flex:1 1 140px; }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.muted { color:var(--muted); font-size:14px; }
.small { font-size:13px; }
.err { color:var(--danger); font-size:14px; margin-top:8px; min-height:1.2em; }
.ok { color:var(--primary); font-size:14px; margin-top:8px; }
.badge { display:inline-block; padding:3px 10px; border-radius:999px; font-size:13px; font-weight:600; color:#fff; background:var(--new); white-space:nowrap; }
.badge.new{background:var(--new)} .badge.approved{background:var(--approved)} .badge.preparing{background:var(--preparing)}
.badge.exited{background:var(--exited)} .badge.received{background:var(--received)} .badge.rejected{background:var(--rejected)} .badge.cancelled{background:var(--cancelled)}
.badge.pending{background:var(--warn)} .badge.active{background:var(--primary)} .badge.suspended{background:var(--danger)}
.tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:14px; border-bottom:2px solid var(--line); }
.tabs button { background:none; color:var(--muted); border:none; border-bottom:3px solid transparent; border-radius:0; padding:10px 14px; margin-bottom:-2px; }
.tabs button.active { color:var(--primary); border-bottom-color:var(--primary); }
.tabs button .count { background:var(--danger); color:#fff; border-radius:999px; padding:0 7px; font-size:12px; margin-right:6px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:right; padding:9px 8px; border-bottom:1px solid var(--line); vertical-align:middle; }
th { color:var(--muted); font-weight:600; font-size:13px; background:#fafbfc; }
.table-wrap { overflow-x:auto; }
.student { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.student:last-child { border-bottom:none; }
.student .name { font-weight:700; font-size:17px; }
.stepper { display:flex; justify-content:space-between; margin:16px 0; position:relative; }
.stepper::before { content:""; position:absolute; top:14px; right:10%; left:10%; height:3px; background:var(--line); z-index:0; }
.step { text-align:center; flex:1; position:relative; z-index:1; font-size:12px; color:var(--muted); }
.step .dot { width:30px; height:30px; border-radius:50%; background:#fff; border:3px solid var(--line); margin:0 auto 6px; display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--muted); }
.step.done .dot { background:var(--primary); border-color:var(--primary); color:#fff; }
.step.current .dot { border-color:var(--primary); color:var(--primary); box-shadow:0 0 0 4px #b7dccf; }
.step.done, .step.current { color:var(--text); }
.timeline { list-style:none; padding:0; margin:0; }
.timeline li { padding:6px 0; border-bottom:1px dashed var(--line); font-size:14px; display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#1c2333; color:#fff; padding:10px 18px; border-radius:8px; font-size:14px; opacity:0; transition:opacity .3s; pointer-events:none; z-index:99; max-width:90vw; }
.toast.show { opacity:1; }
.big-status { text-align:center; padding:20px; border-radius:var(--radius); margin-bottom:12px; font-size:20px; font-weight:700; }
.modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.4); display:flex; align-items:center; justify-content:center; padding:16px; z-index:50; }
.modal { background:#fff; border-radius:var(--radius); padding:18px; width:100%; max-width:520px; max-height:90vh; overflow:auto; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:10px; }
.kpi { background:#fafbfc; border:1px solid var(--line); border-radius:10px; padding:12px; text-align:center; }
.kpi .v { font-size:26px; font-weight:800; color:var(--primary); }
.kpi .l { font-size:13px; color:var(--muted); }
.live { display:inline-flex; align-items:center; gap:6px; font-size:13px; }
.live::before { content:""; width:9px; height:9px; border-radius:50%; background:#9ca3af; }
.live.on::before { background:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.25); }
.pill-row { display:flex; gap:6px; flex-wrap:wrap; }
.checkbox { display:flex; align-items:center; gap:8px; padding:6px 0; }
.checkbox input { width:auto; }
@media (max-width:600px) { .student .name { font-size:16px; } main { padding:12px; } }
