/* Midabada waxaa laga soo qaatay letterhead-ka Wasaaradda:
   buluugga calanka, dahabka astaanta, cagaarka caleemaha. */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
  --ink: #0b2a52;         /* buluug madow – dowladeed */
  --flag: #4189dd;        /* buluugga calanka */
  --flag-d: #1f5ea8;
  --gold: #c9a227;        /* dahabka astaanta (deggan) */
  --leaf: #2e7d4f;
  --bad: #b3261e;
  --bg: #e8f1fb;
  --paper: #ffffff;
  --text: #1d2733;
  --muted: #5b6676;
  --line: #d9dee5;
  --font: "Source Sans 3", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.5; background: var(--bg); color: var(--text); }
a { color: var(--flag-d); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; color: var(--ink); line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .9rem; color: var(--ink); }
h3.sub { font-size: .95rem; margin: 1.1rem 0 .5rem; color: var(--muted); font-weight: 600; }
small { display: block; color: var(--muted); font-size: .82rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0 !important; }
.mb6 { margin-bottom: 6px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--ink); color: #fff; border-bottom: 4px solid var(--gold);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 24px;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.topbar nav a { color: #c9d9ee; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-weight: 600; }
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.active { color: var(--ink); background: #fff; }

.container { max-width: 1180px; margin: 26px auto 60px; padding: 0 18px; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }

/* ---------- Cards & grid ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; margin-bottom: 18px; }
.card-bad { border-left: 5px solid var(--bad); }
.card-ok  { border-left: 5px solid var(--leaf); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 18px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .92rem; }
input[type=text], input[type=tel], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #bfcbda; border-radius: 4px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--flag); box-shadow: 0 0 0 3px rgba(65,137,221,.2); }
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 4px;
  border: 1px solid transparent; background: var(--flag-d); color: #fff; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { background: var(--ink); }
.btn-ok { background: var(--leaf); }  .btn-ok:hover { background: #1f5c39; }
.btn-bad { background: var(--bad); }  .btn-bad:hover { background: #962d22; }
.btn-light { background: #fff; color: var(--ink); border-color: #bfcbda; }
.btn-light:hover { background: #f1f5fa; }
.btn-sm { padding: 6px 11px; font-size: .86rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.mt-note { margin: 14px 0 0; }
.btn-block { width: 100%; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.actions.center { justify-content: center; }
.actions form { margin: 0; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; border-left: 5px solid; background: #fff; }
.alert-success { border-color: var(--leaf); background: #eef8f1; }
.alert-warning { border-color: var(--gold); background: #fff8e6; }
.alert-error   { border-color: var(--bad);  background: #fdf0ee; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 3px; font-size: .78rem; font-weight: 700; vertical-align: middle; }
.b-received  { background: #e6f0fb; color: #1f5fa8; }
.b-verified  { background: #e5f4ea; color: #1f6b40; }
.b-preparing { background: #fff3cf; color: #8a6200; }
.b-done      { background: var(--ink); color: #fff; }
.b-rejected  { background: #fbe4e1; color: #a02b1f; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
.data th, .data td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data th { font-size: .85rem; color: var(--muted); font-weight: 700; background: #f6f9fc; }
.data tbody tr:hover { background: #f8fbff; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-bar input, .filter-bar select { width: auto; flex: 1 1 170px; }

/* ---------- Dashboard stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin-bottom: 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stat { padding: 16px 18px; text-decoration: none; color: var(--text); border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat:hover { background: #f6f9fc; }
.stat b { display: block; font-size: 1.9rem; color: var(--ink); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }

/* ---------- Intake checklist ---------- */
.checklist .check { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 4px; margin-bottom: 10px; cursor: pointer; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--leaf); flex: none; }
.check:has(input:checked) { border-color: var(--leaf); background: #f1f9f4; }

/* ---------- Case page ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--flag); }

.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-card { border: 2px solid var(--line); border-radius: 6px; padding: 16px 18px; cursor: pointer; font-weight: 400; }
.type-card input { accent-color: var(--flag-d); margin-right: 6px; }
.type-card b { font-size: 1.05rem; color: var(--ink); }
.type-card:has(input:checked) { border-color: var(--flag-d); background: #f2f7fd; }

/* ---------- Letter builder ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { border: 1px solid #bfcbda; background: #fff; border-radius: 3px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: .9rem; color: var(--text); }
.chip:hover { border-color: var(--flag); }
.chip.on { background: var(--flag-d); border-color: var(--flag-d); color: #fff; }
.add-row { display: flex; gap: 8px; max-width: 460px; }
.sel-list .row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 6px; background: #fafcfe; }
.sel-list .num { width: 24px; color: var(--muted); font-weight: 700; }
.sel-list .name { flex: 1; font-weight: 600; }
.sel-list .year { width: 140px; padding: 6px 8px; }
.sel-list .year-label { margin: 0; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.sel-list .year.empty { border: 2px solid var(--bad); background: #fdf0ee; }
.marks-table small.need { color: var(--bad); font-weight: 700; }
.marks-table th, .marks-table td { text-align: center; }
.marks-table td:first-child, .marks-table th:first-child { text-align: left; font-weight: 600; }
.marks-table input { width: 84px; text-align: center; padding: 7px; }
.marks-table input.bad { border-color: var(--bad); background: #fdf0ee; }
.marks-table tfoot td { background: #f6f9fc; }

/* ---------- QR slip ---------- */
.qr-slip { max-width: 420px; margin: 0 auto 10px; text-align: center; }
.slip-logo { width: 100%; margin-bottom: 8px; }
.qr-box { display: flex; justify-content: center; padding: 14px; margin: 10px auto; border: 3px solid var(--ink); border-radius: 6px; width: max-content; }
.slip-name { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.slip-code { letter-spacing: 1px; margin: 4px 0; }
.slip-url { font-size: .8rem; color: var(--muted); word-break: break-all; margin-bottom: 6px; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--ink); }
.login-box { width: 100%; max-width: 420px; border-top: 5px solid var(--gold); }
.login-logo { width: 100%; margin-bottom: 14px; }
.login-box h1 { font-size: 1.25rem; text-align: center; }

/* ---------- Bogga ardayga (track) ---------- */
.track-page { background: #fff; }
.track-wrap { max-width: 480px; margin: 0 auto; padding: 16px 18px 40px; }
.track-logo { width: 100%; display: block; margin-bottom: 14px; }
.hello { font-size: 1.05rem; margin: 0 0 12px; }
.track-msg { border-radius: 6px; padding: 22px 20px; text-align: center; margin-bottom: 22px; color: #fff; background: var(--flag-d); }
.track-msg .icon { font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }
.track-msg h1 { color: inherit; font-size: 1.35rem; margin: 0 0 6px; }
.track-msg p { margin: 0; opacity: .95; }
.track-msg .reason { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.35); text-align: left; }
.st-received  { background: var(--flag-d); }
.st-verified  { background: var(--leaf); }
.st-preparing { background: var(--ink); border-bottom: 5px solid var(--gold); }
.st-done      { background: var(--leaf); border-bottom: 5px solid var(--gold); }
.st-rejected  { background: var(--bad); }

.tsteps { list-style: none; margin: 0 0 22px; padding: 0; }
.tsteps li { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.tsteps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.tsteps li.done:not(:last-child)::after { background: var(--leaf); }
.tsteps .dot { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  border: 2px solid var(--line); color: var(--muted); background: #fff; }
.tsteps li.done .dot { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.tsteps li.active .dot { background: var(--gold); border-color: var(--gold); color: var(--ink); animation: pulse 1.8s ease-in-out infinite; }
.tsteps li.todo b { color: var(--muted); font-weight: 600; }
.tsteps li b { display: block; padding-top: 6px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,169,0,.5); } 50% { box-shadow: 0 0 0 8px rgba(232,169,0,0); } }
@media (prefers-reduced-motion: reduce) { .tsteps li.active .dot { animation: none; } }

.track-info { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 14px; }
.track-info div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.track-info div:last-child { border-bottom: 0; }
.track-info span { color: var(--muted); }

/* ---------- Mobile & print ---------- */
@media (max-width: 640px) {
  .type-cards { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { padding: 10px 14px; }
}
@media print {
  .no-print, .topbar, .alert { display: none !important; }
  body { background: #fff; }
  .card { border: 0; }
}

/* ---------- Cidda shaqada qabatay (levels) ---------- */
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.who { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fafcfe; }
.who.ok { border-left: 4px solid var(--leaf); }
.who .lv { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.who b { display: block; }
.perm-group { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.perm-group h4 { margin: 0 0 6px; color: var(--ink); font-size: .95rem; }
.perm-group label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-bottom: 4px; font-size: .9rem; }
.perm-group input { margin-top: 3px; }
.lvl-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.lvl-badges span { background: #eef3f9; color: var(--ink); border-radius: 3px; padding: 1px 6px; font-size: .75rem; white-space: nowrap; }

/* ---------- Hawlaha (Task Management) ---------- */
.tk-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tk-pending     { background: #eef1f5; color: #4a5a6e; }
.tk-in_progress { background: #e6f0fb; color: #1f5fa8; }
.tk-overdue     { background: #fbe4e1; color: #a02b1f; }
.tk-completed   { background: #e2f3e8; color: #1f6b40; }
.tk-stopped     { background: #fff1d6; color: #8a5a00; }
.tk-bar { display: inline-block; vertical-align: middle; width: 110px; height: 8px; background: #eef3f9; border-radius: 4px; overflow: hidden; }
.tk-fill { height: 100%; border-radius: 4px; background: var(--flag); }
.tk-f-completed { background: var(--leaf); }
.tk-f-overdue   { background: var(--bad); }
.tk-f-stopped   { background: var(--gold); }
.tk-pct { display: inline-block; min-width: 36px; margin-left: 6px; font-size: .82rem; font-weight: 700; color: var(--ink); vertical-align: middle; }
.tk-late { color: var(--bad); font-weight: 700; }
.tk-soon { color: #8a6200; font-weight: 700; }


/* =====================================================================
   MUUQAALKA DOWLADEED (Waaxda Adeegyada Dugsiyada)
   ===================================================================== */
body { background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
.gov-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container { max-width: 1240px; width: 100%; margin: 24px auto 40px; padding: 0 20px; flex: 1; }

/* Xariiqda sare */
.gov-strip { background: #061c38; color: #b9c6d8; font-size: .78rem; letter-spacing: .2px; }
.gov-strip .gov-wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 5px; padding-bottom: 5px; }

/* Madaxa: astaanta + magaca */
.gov-head { background: #fff; border-bottom: 4px solid var(--flag); }
.gov-head-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 12px; padding-bottom: 12px; }
.gov-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; min-width: 0; }
.gov-brand img { height: 66px; width: auto; flex: none; }
.gov-titles { display: flex; flex-direction: column; min-width: 0; padding-left: 16px; border-left: 2px solid var(--line); }
.gov-ministry { font-size: .8rem; color: var(--muted); }
.gov-name { font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.gov-sub { font-size: .9rem; color: var(--flag-d); font-weight: 600; letter-spacing: .2px; }
.gov-user { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; text-align: right; flex: none; }
.gov-user-name { font-weight: 700; color: var(--ink); }
.gov-user-role { grid-row: 2; font-size: .8rem; color: var(--muted); }
.gov-logout { grid-row: 1 / span 2; grid-column: 2; border: 1px solid var(--line); color: var(--ink); text-decoration: none;
              padding: 7px 14px; border-radius: 3px; font-weight: 600; font-size: .88rem; background: #fff; }
.gov-logout:hover { border-color: var(--bad); color: var(--bad); }

/* Menu-ga */
.gov-nav { background: var(--ink); position: sticky; top: 0; z-index: 50; }
.gov-nav .gov-wrap { display: flex; flex-wrap: wrap; }
.gov-nav a { color: #d6e0ee; text-decoration: none; font-weight: 600; font-size: .9rem; padding: 12px 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.gov-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.gov-nav a.active { color: #fff; background: rgba(255,255,255,.1); border-bottom-color: var(--gold); }

/* Hoosta */
.gov-foot { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .8rem; }
.gov-foot .gov-wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }

/* Cinwaannada */
h1 { font-size: 1.45rem; font-weight: 700; color: var(--ink); }
h2 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.page-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }

/* Kaararka */
.card { border-radius: 4px; border: 1px solid var(--line); box-shadow: none; }

/* Badhamada */
.btn { border-radius: 3px; background: var(--flag-d); font-weight: 600; letter-spacing: .1px; }
.btn:hover { background: var(--ink); }
.btn-ok { background: var(--leaf); } .btn-ok:hover { background: #22603c; }
.btn-bad { background: var(--bad); } .btn-bad:hover { background: #8c1d17; }
.btn-light { background: #fff; color: var(--ink); border-color: #c3cbd6; }
.btn-light:hover { background: #f1f4f8; border-color: var(--ink); }

/* Foomamka */
label { color: #2a3646; }
input[type=text], input[type=tel], input[type=date], input[type=password], input[type=search], input[type=month], select, textarea {
  border-radius: 3px; border: 1px solid #c3cbd6; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--flag-d); box-shadow: 0 0 0 3px rgba(31,94,168,.15); }
input[type=file] { font: inherit; font-size: .9rem; }
.checklist .check, .type-card { border-radius: 3px; }
.type-card:has(input:checked) { border-color: var(--flag-d); background: #f2f6fc; }

/* Shaxyada */
.data th { background: #eef2f7; color: var(--ink); font-size: .8rem; letter-spacing: .2px; border-bottom: 2px solid var(--line); }
.data td { border-bottom: 1px solid #e6eaf0; }
.data tbody tr:hover { background: #f7f9fc; }

/* Tirooyinka */
.stats { border-radius: 4px; }
.stat b { font-size: 1.75rem; }
.alert { border-radius: 3px; }
.badge { border-radius: 3px; }

@media (max-width: 760px) {
  .gov-strip .gov-wrap > span:first-child { display: none; }
  .gov-strip .gov-wrap { justify-content: flex-end; }
  .gov-head-in { flex-wrap: wrap; }
  .gov-brand img { height: 50px; }
  .gov-name { font-size: 1.15rem; }
  .gov-ministry { display: none; }
  .gov-user { width: 100%; justify-content: space-between; text-align: left; }
  .gov-nav .gov-wrap { flex-wrap: nowrap; overflow-x: auto; }
}
@media print { .gov-strip, .gov-head, .gov-nav, .gov-foot { display: none !important; } }

/* ---------- Bogga gelitaanka (login) ---------- */
.login-page { display: flex; flex-direction: column; min-height: 100vh; padding: 0; align-items: stretch; justify-content: flex-start; background: var(--bg); }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-box { width: 100%; max-width: 860px; max-width: min(860px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: #fff;
             border: 1px solid var(--line); border-top: 4px solid var(--flag); border-radius: 4px; overflow: hidden; }
.login-brand { background: var(--ink); color: #d6e0ee; padding: 36px 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.login-brand img { width: 150px; height: auto; margin-bottom: 18px; background: #fff; border-radius: 4px; padding: 10px; }
.login-ministry { font-size: .82rem; line-height: 1.5; }
.login-name { font-size: 1.45rem; font-weight: 700; color: #fff; margin-top: 14px; line-height: 1.2; }
.login-sub { font-size: .9rem; color: #f0d77a; margin-top: 4px; font-weight: 600; }
.login-form { padding: 36px 32px; }
.login-form h1 { font-size: 1.3rem; margin-bottom: 18px; text-align: left; }
.login-note { margin: 18px 0 0; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 720px) { .login-box { grid-template-columns: 1fr; } .login-brand { padding: 24px; } .login-brand img { width: 100px; } }


/* ===== LOGIN: muuqaal dugsi & arday (animation) ===== */
.login-main { position: relative; overflow: hidden; }
.login-main > .login-box { position: relative; z-index: 2; }
.login-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(#eaf2fb 0%, #f3f5f8 70%); }
.login-scene svg, .login-scene div { position: absolute; }
.ls-ground { left: 0; right: 0; bottom: 0; height: 46px; background: #d9e8d2; border-top: 3px solid #b9d3ad; }
.ls-ground::after { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 14px; background: #e8dcc4; }
.ls-school { left: 3%; bottom: 40px; width: 300px; }
.ls-tree { bottom: 40px; width: 70px; }
.ls-tree.t1 { left: calc(3% + 305px); } .ls-tree.t2 { right: 4%; width: 90px; }
.ls-flag { transform-box: fill-box; transform-origin: left center; animation: lsFlag 2.4s ease-in-out infinite; }
@keyframes lsFlag { 0%,100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(-4deg) scaleX(.94); } }

.ls-cloud { width: 120px; opacity: .9; animation: lsDrift 70s linear infinite; }
.ls-cloud.c1 { top: 6%; animation-delay: -10s; }
.ls-cloud.c2 { top: 16%; width: 80px; animation-duration: 90s; animation-delay: -55s; }
.ls-cloud.c3 { top: 3%; width: 95px; animation-duration: 80s; animation-delay: -35s; }
@keyframes lsDrift { from { left: -140px; } to { left: 100%; } }

.ls-float { opacity: .55; animation: lsFloat 6s ease-in-out infinite; }
.ls-float.f1 { top: 12%; left: 9%;  width: 70px; }
.ls-float.f2 { top: 30%; left: 18%; width: 64px; animation-delay: -2s; }
.ls-float.f3 { top: 52%; left: 7%;  width: 80px; animation-delay: -4s; transform: rotate(-20deg); }
.ls-float.f4 { top: 14%; right: 12%; width: 60px; animation-delay: -1s; }
.ls-float.f5 { top: 34%; right: 7%; animation-delay: -3s; }
.ls-float.f6 { top: 52%; right: 15%; animation-delay: -5s; }
.ls-float.f7 { top: 8%; left: 44%; width: 48px; animation-delay: -2.5s; opacity: .35; }
.ls-txt { font: 700 22px/1 Georgia, serif; color: #1f5ea8; letter-spacing: 2px; }
.ls-txt.f6 { color: #2e7d4f; font-size: 18px; }
@keyframes lsFloat { 0%,100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -14px; rotate: 3deg; } }

.ls-walk { bottom: 20px; width: 44px; height: 106px; display: flex; align-items: flex-end; animation: lsWalk 40s linear infinite; }
.ls-walk svg { position: static; width: 44px; height: 106px; animation: lsBob .5s ease-in-out infinite; }
.ls-walk.w1 { animation-delay: 0s; } .ls-walk.w2 { animation-delay: -4s; }
.ls-walk.w3 { animation-delay: -21s; } .ls-walk.w4 { animation-delay: -25s; }
.ls-walk.w2 svg, .ls-walk.w4 svg { width: 37px; height: 89px; }
.ls-bag { fill: var(--bag, #b3261e); }
.ls-leg, .ls-arm { transform-box: fill-box; transform-origin: top center; }
.ls-leg-a { animation: lsLeg .5s ease-in-out infinite alternate; }
.ls-leg-b { animation: lsLeg .5s ease-in-out infinite alternate-reverse; }
.ls-arm { animation: lsLeg .5s ease-in-out infinite alternate-reverse; }
@keyframes lsLeg { from { transform: rotate(22deg); } to { transform: rotate(-22deg); } }
@keyframes lsBob { 0%,100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes lsWalk { from { left: 105%; } to { left: -60px; } }

@media (max-width: 900px) { .ls-float, .ls-tree.t1 { display: none; } .ls-school { width: 200px; } }
@media (max-width: 720px) { .login-main { padding-bottom: 150px; } }
@media (prefers-reduced-motion: reduce) { .login-scene * { animation: none !important; } }

/* ===== Luqadda, menu-ga user-ka iyo sub-menu (Ardayda) ===== */
.lang-sw { display: inline-flex; gap: 2px; }
.lang-sw a { color: #c7d3e3; text-decoration: none; padding: 1px 8px; border-radius: 3px; font-weight: 600; }
.lang-sw a:hover { color: #fff; }
.lang-sw a.on { background: var(--gold); color: #0b2a52; }

.um { position: relative; }
.um-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; border: 0; border-radius: 4px;
          padding: 9px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.um-btn:hover, .um.open .um-btn { background: var(--flag-d); }
.um-caret { font-size: .75em; opacity: .85; }
.um-menu, .nav-sub { display: none; position: absolute; top: calc(100% + 4px); min-width: 230px; background: #fff; border: 1px solid var(--line);
          border-radius: 6px; box-shadow: 0 12px 30px rgba(11,42,82,.18); padding: 6px 0; z-index: 80; }
.um-menu { right: 0; }
.um.open .um-menu { display: block; }
.um-head { padding: 8px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.um-head b { display: block; color: var(--ink); }
.um-head span { font-size: .8rem; color: var(--muted); }
.um-menu a { display: block; padding: 8px 16px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.um-menu a:hover { background: #eef4fb; color: var(--flag-d); }
.um-menu a.um-out { border-top: 1px solid var(--line); margin-top: 4px; color: var(--bad); }

.nav-dd { position: relative; }
.nav-dd-btn { background: none; border: 0; border-bottom: 3px solid transparent; color: #d6e0ee; font: inherit; font-weight: 600; font-size: .9rem;
              padding: 12px 14px; cursor: pointer; white-space: nowrap; height: 100%; }
.nav-dd-btn:hover, .nav-dd.open .nav-dd-btn { color: #fff; background: rgba(255,255,255,.06); }
.nav-dd.active .nav-dd-btn { color: #fff; background: rgba(255,255,255,.1); border-bottom-color: var(--gold); }
.nav-sub { left: 0; top: 100%; border-radius: 0 0 6px 6px; border-top: 3px solid var(--gold); }
.nav-dd:hover .nav-sub, .nav-dd.open .nav-sub { display: block; }
.gov-nav .nav-sub a { display: block; color: var(--text); padding: 10px 18px; border-bottom: 0; font-size: .92rem; }
.gov-nav .nav-sub a:hover { background: #eef4fb; color: var(--flag-d); }
.gov-nav .nav-sub a.active { background: #e3edf9; color: var(--ink); border-left: 3px solid var(--gold); }
@media (max-width: 720px) {
  .gov-nav .gov-wrap { flex-wrap: wrap; overflow: visible; }
  .nav-dd:hover .nav-sub { display: none; }
  .nav-dd.open .nav-sub { display: block; }
}

/* Asalka guud: buluug khafiif ah */
.card { border-color: #d3e0ef; }

/* ===== LOGIN (qaab EMIS): bidix sawir + astaan, midig foom madow ===== */
.lg-body { margin: 0; min-height: 100vh; background: #2f3e50; display: block; }
.lg-wrap { display: grid; grid-template-columns: minmax(0, 37%) minmax(0, 1fr); min-height: 100vh; }
.lg-left { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 40px 28px;
           background: linear-gradient(160deg, #123a6b 0%, #0b2a52 55%, #082040 100%); background-size: cover; background-position: center; }
.lg-left.has-photo::before { content: ""; position: absolute; inset: 0; background: rgba(8, 26, 52, .35); }
.lg-left .login-scene { background: none; }
.lg-left .ls-ground { background: rgba(255,255,255,.12); border-top-color: rgba(255,255,255,.25); }
.lg-left .ls-ground::after { background: rgba(255,255,255,.08); }
.lg-left .ls-school { left: 6%; width: 230px; opacity: .55; }
.lg-left .ls-float { opacity: .35; }
.lg-left .ls-float.f1 { top: 7%; left: 8%; } .lg-left .ls-float.f2 { top: 80%; left: auto; right: 10%; top: auto; bottom: 160px; }
.lg-left .ls-float.f4 { top: 6%; right: 9%; } .lg-left .ls-float.f5 { top: 46%; right: 4%; } .lg-left .ls-float.f6 { top: 50%; left: 3%; right: auto; }
.lg-left .ls-txt { color: #9cc2ef; }
.lg-left .ls-txt.f6 { color: #9fd3b4; }
.lg-card { position: relative; z-index: 2; width: 100%; max-width: 520px; background: rgba(226, 232, 240, .86); border-radius: 6px;
           padding: 30px 26px 40px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); backdrop-filter: blur(2px); }
.lg-seal { width: 72%; max-width: 300px; margin: 0 auto 18px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); }
.lg-seal svg { display: block; width: 100%; height: auto; }
.lg-title { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.2; color: #111; font-weight: 700; }
.lg-title-en { margin-top: 8px; font-size: clamp(1rem, 1.5vw, 1.35rem); color: #1b2a3c; font-weight: 600; }
.lg-abbr { margin-top: 14px; font-size: clamp(1.4rem, 2.2vw, 2rem); font-weight: 700; color: #111; }

.lg-right { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 24px 70px; color: #fff; }
.lg-lang { position: absolute; top: 18px; right: 22px; display: flex; gap: 4px; }
.lg-lang a { color: #c9d4e2; text-decoration: none; font-weight: 600; font-size: .88rem; padding: 3px 10px; border-radius: 3px; border: 1px solid rgba(255,255,255,.2); }
.lg-lang a.on { background: #f5a31a; border-color: #f5a31a; color: #1d2733; }
.lg-form { width: 100%; max-width: 400px; }
.lg-brand { font-size: 2.1rem; font-weight: 700; letter-spacing: .5px; line-height: 1.1; }
.lg-brand .o { color: #f5a31a; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.lg-brand .b { color: #29a8e0; }
.lg-lead { margin: 10px 0 34px; font-size: 1.1rem; color: #e8eef5; }
.lg-field { margin-bottom: 22px; }
.lg-field label { display: block; color: #fff; font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.lg-field input { width: 100%; box-sizing: border-box; height: 46px; padding: 8px 12px; border: 1px solid #fff; border-radius: 2px; background: #fff;
                  font: inherit; font-size: 1rem; color: #1d2733; }
.lg-field input:focus { outline: 3px solid rgba(245, 163, 26, .55); outline-offset: 0; }
.lg-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.lg-btn { background: #f5a31a; color: #fff; border: 0; border-radius: 3px; padding: 10px 22px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.lg-btn:hover { background: #e08f00; }
.lg-forgot { color: #2bc7a4; text-decoration: none; font-size: .98rem; }
.lg-forgot:hover { text-decoration: underline; }
.lg-forgot-note { margin-top: 14px; background: rgba(255,255,255,.08); border-left: 3px solid #2bc7a4; padding: 10px 12px; font-size: .9rem; color: #dfe7f0; }
.lg-note { margin-top: 34px; font-size: .85rem; color: #9fb0c3; }
.lg-right .alert { margin-bottom: 18px; }
.lg-foot { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .78rem; color: #8597ab; padding: 0 16px; }
@media (max-width: 900px) {
  .lg-wrap { grid-template-columns: 1fr; }
  .lg-left { min-height: 0; padding: 28px 16px 120px; }
  .lg-seal { width: 46%; }
  .lg-right { padding: 50px 20px 70px; }
}

/* ===== Foomamka tallaabo-tallaabo (wizard) ===== */
.wz-hide { display: none !important; }
.wz-bar { list-style: none; margin: 0 0 18px; padding: 14px 16px; display: flex; gap: 0; background: #fff; border: 1px solid #d3e0ef; border-radius: 6px; counter-reset: wz; overflow-x: auto; }
.wz-bar li { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 10px; position: relative; padding-right: 14px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.wz-bar li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: #d3e0ef; margin-left: 4px; min-width: 16px; }
.wz-bar li.done:not(:last-child)::after { background: var(--leaf); }
.wz-n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eef3f9; border: 2px solid #c6d4e5; color: var(--muted); font-weight: 700; }
.wz-t { white-space: nowrap; }
.wz-bar li.clickable { cursor: pointer; }
.wz-bar li.done .wz-n { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.wz-bar li.on { color: var(--ink); }
.wz-bar li.on .wz-n { background: var(--ink); border-color: var(--gold); color: #fff; box-shadow: 0 0 0 4px rgba(201,162,39,.2); }
.wz-nav { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 18px;
          background: #fff; border: 1px solid #d3e0ef; border-top: 3px solid var(--gold); border-radius: 6px 6px 0 0; box-shadow: 0 -6px 18px rgba(18,53,91,.08); }
.wz-info { color: var(--muted); font-size: .88rem; }
.wz-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.wz-right [data-wz-submit] { display: contents; }
.wz-right .actions, .wz-right .lf-submit { margin: 0; }
.wz-next { padding-left: 22px; padding-right: 22px; }
.wz-err { flex-basis: 100%; order: 5; background: #fbe6e4; color: var(--bad); border-left: 4px solid var(--bad); padding: 8px 12px; font-weight: 600; font-size: .92rem; }
.wz-on .wz-step.card, .wz-on .wz-step > .card { margin-bottom: 0; }
.wz-review .wz-sec { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px; overflow: hidden; }
.wz-sec-h { display: flex; justify-content: space-between; align-items: center; background: #f2f6fb; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.wz-sec-h b { color: var(--ink); }
.wz-sec dl { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); margin: 0; padding: 6px 14px; }
.wz-sec dt, .wz-sec dd { margin: 0; padding: 6px 0; border-bottom: 1px solid #edf1f6; }
.wz-sec dt { color: var(--muted); font-size: .9rem; }
.wz-sec dd { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.wz-sec dt.wz-ok { grid-column: 1 / -1; color: var(--text); font-weight: 600; }
.wz-sec dt.wz-ok::before { content: "✓ "; color: var(--leaf); font-weight: 700; }
.wz-sec dt.wz-ok + dd { display: none; }
.wz-sec > p { padding: 8px 14px; margin: 0; }
@media (max-width: 640px) { .wz-t { display: none; } .wz-bar li { min-width: 0; } .wz-bar li.on .wz-t { display: inline; } }

/* ===== Madaxa: magaca Jamhuuriyadda + luqadda gudaha menu-ga ===== */
.gov-rep { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--flag-d); }
.gov-nav .gov-wrap { align-items: stretch; }
.nav-lang { margin-left: auto; align-self: center; padding: 6px 0 6px 12px; }
.nav-lang a { color: #c7d3e3; font-size: .82rem; }
@media (max-width: 720px) { .nav-lang { margin-left: 0; padding: 8px 14px; } }

/* ===== Madaxa: qoraalka ku fidi meesha bannaan oo dhan ===== */
.gov-brand { flex: 1; }
.gov-brand img { height: 84px; }
.gov-titles { flex: 1; align-items: center; text-align: center; border-left: 0; padding: 0 12px; gap: 2px; }
.gov-rep { font-size: .9rem; letter-spacing: 2px; }
.gov-ministry { font-size: .98rem; color: #3d4a5c; }
.gov-name { font-size: 2rem; letter-spacing: .3px; }
.gov-sub { font-size: 1.08rem; }
@media (max-width: 760px) {
  .gov-brand img { height: 54px; }
  .gov-brand { flex-basis: 100%; }
  .gov-titles { align-items: flex-start; text-align: left; }
  .gov-name { font-size: 1.2rem; }
  .gov-sub, .gov-rep { font-size: .8rem; letter-spacing: .5px; }
}
.lg-brand .b { margin-left: 10px; }
