:root {
  --navy-900: #0b1626;
  --navy-800: #102036;
  --navy-700: #17304f;
  --navy-600: #22436b;
  --gold: #b08d57;
  --gold-600: #96753f;
  --gold-soft: #f4ecdd;
  --paper: #f7f3ec;
  --paper-2: #efe9de;
  --white: #ffffff;
  --ink: #142030;
  --ink-2: #4b5768;
  --muted: #8b93a0;
  --line: #e4ddd0;
  --line-2: #d6cdbd;
  --danger: #a63a2f;
  --danger-soft: #f8e9e6;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(11, 22, 38, .06);
  --shadow: 0 1px 2px rgba(11, 22, 38, .05), 0 12px 32px -12px rgba(11, 22, 38, .18);
  --display: 'Alexandria', 'IBM Plex Sans Arabic', sans-serif;
  --body: 'IBM Plex Sans Arabic', sans-serif;
  /* Fine engraved line pattern, in the spirit of security print. */
  --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60' viewBox='0 0 120 60'%3E%3Cg fill='none' stroke='%23b08d57' stroke-width='.6' stroke-opacity='.22'%3E%3Cpath d='M0 30 C 20 0, 40 0, 60 30 S 100 60, 120 30'/%3E%3Cpath d='M0 30 C 20 60, 40 60, 60 30 S 100 0, 120 30'/%3E%3Cpath d='M0 20 C 20 -10, 40 -10, 60 20 S 100 50, 120 20'/%3E%3Cpath d='M0 40 C 20 70, 40 70, 60 40 S 100 10, 120 40'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-600); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 32px; height: 68px; background: var(--navy-900); color: #fff;
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(176, 141, 87, .35);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 17px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold);
  display: grid; place-items: center;
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-logo { display: block; height: 23px; width: auto; }
.brand-tag { font-family: var(--body); font-weight: 500; font-size: 13px; color: rgba(255,255,255,.6); padding-inline-start: 12px; margin-inline-start: 2px; border-inline-start: 1px solid rgba(255,255,255,.2); }
.top-end { display: flex; align-items: center; gap: 22px; }
.top-meta { display: flex; align-items: center; gap: 12px; color: #fff; }
.top-meta b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.top-meta small { display: block; font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.35; }
.top-ico { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(176,141,87,.55); color: var(--gold); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 13px; flex: none; }
.top-ico svg { width: 16px; height: 16px; }
.top-end .top-meta { padding-inline-end: 22px; border-inline-end: 1px solid rgba(255,255,255,.14); }
.brand small { display: block; font-family: var(--body); font-weight: 400; font-size: 11.5px; color: rgba(255,255,255,.55); line-height: 1.2; }
.topbar .btn.ghost { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.22); background: transparent; }
.topbar .btn.ghost:hover { border-color: var(--gold); color: #fff; background: rgba(255,255,255,.04); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius); border: 1px solid var(--navy-800); cursor: pointer;
  font-weight: 600; font-size: 15px; background: var(--navy-800); color: #fff; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gold-soft), 0 0 0 4px var(--gold); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
.btn.gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.btn.ghost { background: var(--white); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--navy-700); background: var(--white); }
.btn.danger { background: transparent; color: var(--danger); border-color: #e7c9c4; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 14px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 26px; font-size: 16px; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.req { color: var(--gold-600); margin-inline-start: 3px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--white); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
select.input { padding-inline-end: 10px; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: #b3b9c2; }
.input:hover { border-color: #c4b9a6; }
.input:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(34, 67, 107, .12); }
.input[readonly], .input:disabled { background: var(--paper); color: var(--ink-2); border-style: dashed; }
.input.ltr { direction: ltr; text-align: left; }
.yesno { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; width: fit-content; background: var(--white); }
.yesno button { border: 0; background: transparent; padding: 10px 26px; cursor: pointer; font-weight: 600; color: var(--ink-2); transition: background .15s; }
.yesno button + button { border-inline-start: 1px solid var(--line-2); }
.yesno button:hover:not(:disabled) { background: var(--paper); }
.yesno button.on { background: var(--navy-800); color: #fff; }
.yesno button:disabled { cursor: default; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; background: var(--danger-soft); color: var(--danger); border: 1px solid #ecccc6; }
.alert.info { background: var(--gold-soft); color: var(--ink); border-color: #e6d6b8; }
.alert.info a { color: var(--navy-700); font-weight: 600; }

/* ---------- login ---------- */
.login-page { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1.05fr 1fr; }
.login-hero {
  position: relative; overflow: hidden; background: var(--navy-900); color: #fff;
  padding: 72px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.login-hero::before {
  content: ''; position: absolute; inset: 0; background-image: var(--guilloche); background-size: 160px 80px; opacity: .9;
  mask-image: linear-gradient(160deg, #000 10%, transparent 75%); -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
}
.login-hero::after {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%; inset-inline-start: -180px; bottom: -260px;
  border: 1px solid rgba(176, 141, 87, .28); box-shadow: 0 0 0 40px rgba(176,141,87,.04), 0 0 0 80px rgba(176,141,87,.03);
}
.login-hero > * { position: relative; z-index: 1; }
.eyebrow { font-size: 12.5px; letter-spacing: .02em; color: var(--gold); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.login-hero h1 { font-size: 40px; line-height: 1.35; margin: 18px 0 16px; max-width: 14em; }
.login-hero p { color: rgba(255,255,255,.7); max-width: 30em; margin: 0; font-size: 16px; }
.dest-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid rgba(255,255,255,.12); max-width: 440px; }
.dest-list li { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; }
.dest-list li:nth-child(odd) { padding-inline-end: 20px; }
.dest-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.dest-list b { font-family: var(--display); font-size: 16px; }
.dest-list span { font-size: 12.5px; color: rgba(255,255,255,.5); }
.steps-inline { display: flex; gap: 28px; flex-wrap: wrap; font-size: 13.5px; color: rgba(255,255,255,.75); }
.steps-inline span { display: flex; align-items: center; gap: 10px; }
.steps-inline i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-size: 12px; }

.login-side { display: grid; place-items: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; animation: rise .5s ease both; }
.login-card h2 { font-size: 26px; margin: 0 0 6px; }
.login-card .lead { margin: 0 0 30px; color: var(--ink-2); }
.login-card form { display: flex; flex-direction: column; gap: 18px; }
.dob-row { display: grid; grid-template-columns: 1fr 1.5fr 1.15fr; gap: 8px; }
.fineprint { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.fineprint svg { flex: none; width: 16px; height: 16px; color: var(--gold-600); margin-top: 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* simple centered card (admin login, 404) */
.center-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 32px 16px; }
.center-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 36px 32px; box-shadow: var(--shadow); }
.center-card h1 { font-size: 22px; margin: 0 0 22px; }
.center-card .lead { margin: 0 0 24px; color: var(--ink-2); }
.center-card form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- portal layout ---------- */
.shell { max-width: 1160px; margin: 0 auto; padding: 32px 24px 80px; }

/* Header card styled like a boarding pass: main part + perforated stub. */
.pass {
  display: grid; grid-template-columns: 1fr auto; background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 28px; overflow: hidden; animation: rise .4s ease both;
}
.pass-main { position: relative; padding: 26px 30px; background: linear-gradient(90deg, transparent, transparent), var(--white); }
.pass-main::before {
  content: ''; position: absolute; inset: 0; background-image: var(--guilloche); background-size: 160px 80px; opacity: .55;
  mask-image: linear-gradient(270deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(270deg, #000, transparent 60%);
}
.pass-main > * { position: relative; }
.pass-main .eyebrow { color: var(--gold-600); }
.pass-main h2 { margin: 8px 0 2px; font-size: 26px; }
.pass-main p { margin: 0; color: var(--ink-2); }
.pass-name { margin-top: 14px !important; font-family: var(--display); font-weight: 600; color: var(--ink) !important; letter-spacing: .04em; }
.pass-stub {
  position: relative; min-width: 250px; padding: 26px 30px; background: var(--navy-900); color: #fff;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.pass-stub::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-end: 100%; width: 0;
  border-inline-end: 2px dashed var(--line-2);
}
.pass-stub .kv { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: rgba(255,255,255,.55); }
.pass-stub .kv b { font-size: 18px; color: #fff; font-weight: 600; }
.mono { font-family: 'Google Sans', 'IBM Plex Sans Arabic', sans-serif; font-weight: 500; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; letter-spacing: .1em; }

.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 14px; border-radius: 3px; font-size: 13px; font-weight: 600;
  background: rgba(176,141,87,.16); color: var(--gold); width: fit-content; border: 1px solid rgba(176,141,87,.4);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.light { background: var(--paper); color: var(--navy-700); border-color: var(--line-2); }
.badge.light.s-needs_info, .badge.light.s-awaiting_data { background: var(--gold-soft); color: var(--gold-600); border-color: #e6d6b8; }
.badge.light.s-completed { color: var(--muted); }

.note {
  display: flex; gap: 14px; align-items: flex-start; margin: -12px 0 28px; padding: 16px 20px; border-radius: 8px;
  background: var(--gold-soft); border: 1px solid #e6d6b8; white-space: pre-wrap;
}
.note-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--display); }
.note b { display: block; font-size: 12.5px; color: var(--gold-600); margin-bottom: 2px; }

.layout { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.layout > *, .admin-grid > * { min-width: 0; }
.steps { position: sticky; top: 92px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 20px 14px 14px; box-shadow: var(--shadow-sm); }
.steps-progress { padding: 0 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.steps-progress .label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.steps-progress .label b { color: var(--ink); font-family: var(--display); }
.bar { height: 4px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-600)); border-radius: 4px; transition: width .4s; }
.steps-list { display: flex; flex-direction: column; position: relative; }
.steps-list button {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 8px; border: 0; border-radius: 6px; background: transparent;
  cursor: pointer; text-align: start; color: var(--ink-2); font-size: 14.5px;
}
.steps-list button:hover { background: var(--paper); color: var(--ink); }
.steps-list button.on { background: var(--paper); color: var(--navy-800); font-weight: 600; }
.steps-list button.on::after { content: ''; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 3px; background: var(--gold); border-radius: 0 3px 3px 0; }
.steps-list .dot {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center;
  font-size: 11.5px; color: var(--muted); background: var(--white); font-weight: 600;
}
.steps-list .on .dot { border-color: var(--navy-800); color: var(--navy-800); }
.steps-list .done .dot { background: var(--navy-800); border-color: var(--navy-800); color: var(--gold); }
.steps-list hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); padding: 32px 34px 26px; animation: rise .3s ease both; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel-head .eyebrow { color: var(--gold-600); margin-bottom: 4px; }
.panel-head h3 { margin: 0; font-size: 22px; }
.save-state { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; }
.grid .wide { grid-column: 1 / -1; }
.panel-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }

.list-block { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.list-block > label { font-weight: 600; font-size: 13.5px; }
.list-row { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px 18px; background: var(--paper); }
.list-row .grid { gap: 14px 16px; }
.list-row .row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.list-row .row-head span { font-family: var(--display); font-size: 13px; color: var(--gold-600); font-weight: 600; }
.list-empty { font-size: 13.5px; color: var(--muted); margin: 0; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 8px; }
.add-btn { align-self: flex-start; }

/* ---------- documents ---------- */
.docs { display: flex; flex-direction: column; gap: 12px; }
.doc-slot { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s; }
.doc-slot.has { border-color: #cdd6e2; background: linear-gradient(0deg, #fbfcfe, #fbfcfe); }
.doc-slot .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-slot .title { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.doc-slot .state { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; color: transparent; flex: none; }
.doc-slot.has .state { background: var(--navy-800); border-color: var(--navy-800); color: var(--gold); }
.doc-files { display: flex; flex-direction: column; gap: 6px; }
.doc-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 8px 12px; background: var(--paper); border-radius: 6px; }
.doc-file a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; font-weight: 500; }
.doc-file .meta { color: var(--muted); font-size: 12px; flex: none; margin-inline-start: auto; }
.upload-label { position: relative; overflow: hidden; }
.upload-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.progress { height: 3px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .2s; }

/* ---------- review ---------- */
.review-sec { margin-bottom: 26px; }
.review-sec h4 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--navy-800); }
.review-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.review-table td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.review-table td:first-child { color: var(--ink-2); width: 44%; padding-inline-end: 16px; }
.review-table td:last-child { font-weight: 500; }
.review-table .empty { color: #c2c7cf; font-weight: 400; }
.missing-list { margin: 8px 0 0; padding-inline-start: 20px; }
.done-box { text-align: center; padding: 36px 10px 30px; margin-bottom: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.done-box .ico { width: 58px; height: 58px; border-radius: 50%; background: var(--navy-800); color: var(--gold); display: grid; place-items: center; margin: 0 auto 14px; font-size: 22px; }
.done-box h3 { margin: 0 0 4px; font-size: 20px; }
.done-box p { margin: 0; color: var(--ink-2); }

/* ---------- admin ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 4px 0 0; font-size: 26px; }
.page-head .eyebrow { color: var(--gold-600); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 340px; }
.toolbar select.input { max-width: 200px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; cursor: pointer; transition: border-color .15s; text-align: start; }
.stat:hover, .stat.on { border-color: var(--navy-700); }
.stat span { display: block; font-size: 12.5px; color: var(--ink-2); }
.stat b { font-family: var(--display); font-size: 26px; color: var(--navy-800); line-height: 1.3; }
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; box-shadow: var(--shadow-sm); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.list th { text-align: start; font-weight: 600; color: var(--ink-2); font-size: 12.5px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
table.list td { padding: 14px 18px; border-bottom: 1px solid var(--line); }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; transition: background .12s; }
table.list tbody tr:hover { background: #fbf9f5; }
.empty-state { padding: 48px; text-align: center; color: var(--muted); }

dialog {
  border: 0; border-radius: 10px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--white); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(11,22,38,.45); border-top: 3px solid var(--gold);
}
dialog::backdrop { background: rgba(11, 22, 38, .55); backdrop-filter: blur(2px); }
dialog form { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
dialog h3 { margin: 0 0 4px; font-size: 20px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.admin-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: var(--shadow-sm); }
.card h4 { margin: 0 0 14px; font-size: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card.dark { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.card.dark h4 { border-color: rgba(255,255,255,.12); }
.card .stack { display: flex; flex-direction: column; gap: 12px; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.log li { border-inline-start: 2px solid var(--gold); padding-inline-start: 12px; }
.log time { color: var(--muted); font-size: 12px; display: block; }
.copy-box { background: var(--paper); border: 1px dashed var(--line-2); border-radius: 6px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; }
.small-note { margin: 0; font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--navy-900); color: #fff;
  padding: 11px 20px; border-radius: 6px; font-size: 14px; z-index: 100; box-shadow: var(--shadow); border-inline-start: 3px solid var(--gold);
}

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 24px; gap: 28px; }
  .login-hero h1 { font-size: 30px; }
  .dest-list, .steps-inline { display: none; }
  .layout, .admin-grid { grid-template-columns: 1fr; }
  .steps { position: static; padding: 14px; }
  .steps-list { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .steps-list button { flex: none; white-space: nowrap; }
  .steps-list button.on::after { display: none; }
  .steps-list hr { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topbar { padding: 0 16px; height: 60px; }
  .brand small { display: none; }
  .brand-logo { height: 20px; }
  .top-meta small { display: none; }
  .top-end { gap: 12px; }
  .top-end .top-meta { padding-inline-end: 0; border: 0; }
  .top-end .top-meta > span:last-child { display: none; }
  .top-ico { width: 34px; height: 34px; }
  .shell { padding: 18px 16px 56px; }
  .pass { grid-template-columns: 1fr; }
  .pass-main { padding: 20px; }
  .pass-main h2 { font-size: 22px; }
  .pass-stub { min-width: 0; flex-direction: row; justify-content: space-between; align-items: center; padding: 16px 20px; }
  .pass-stub::before { display: none; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .login-hero h1 { font-size: 26px; }
  .center-card { padding: 28px 20px; }
}

/* Phones: no iOS zoom on focus (inputs >= 16px), finger-sized targets, safe areas, table as cards. */
@media (max-width: 600px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .btn.sm { min-height: 40px; padding: 8px 14px; }
  .yesno button { padding: 12px 28px; }
  .steps-list button { min-height: 44px; }
  .topbar { padding-inline: max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-left)); }
  .shell { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .panel-foot .btn { flex: 1; }
  .doc-slot .top { flex-wrap: nowrap; align-items: flex-start; }
  .doc-slot .top .btn { flex: none; }
  .doc-file { flex-wrap: wrap; }
  .doc-file a { flex: 1 1 100%; }
  .review-table td:first-child { width: 48%; }
  .page-head .btn { width: 100%; }
  .toolbar .input, .toolbar select.input { max-width: none; flex: 1 1 100%; }
  .stats { gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 22px; }
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.list { min-width: 0; display: block; }
  table.list thead { display: none; }
  table.list tbody { display: flex; flex-direction: column; gap: 10px; }
  table.list tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
  table.list td { padding: 0; border: 0; font-size: 13.5px; }
  table.list td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  table.list td.t-main { grid-column: 1 / -1; font-size: 15px; font-weight: 600; }
  table.list td.t-main::before { display: none; }
  dialog form { padding: 22px 18px; }
  .dlg-foot .btn { flex: 1; }
  .login-side { padding: 32px 16px 40px; }
  .center-wrap { padding: 24px 16px; }
}

@media print {
  .topbar, .steps, .panel-foot, .no-print, .toolbar, .btn { display: none !important; }
  body { background: #fff; }
  .admin-grid, .layout { grid-template-columns: 1fr; }
  .panel, .card, .pass { box-shadow: none; }
}

/* Long unbroken values (handles, emails, file names) must wrap instead of widening the page. */
.review-table td, .copy-box, .note, .log li, .list-row, .doc-slot .title { overflow-wrap: anywhere; }
.review-table { table-layout: fixed; }
.doc-file, .doc-files, .doc-slot { min-width: 0; }
.doc-file a { min-width: 0; }
.top-end:has(#logout[hidden]) .top-meta { padding-inline-end: 0; border: 0; }

/* Sub-title inside a form section (e.g. «الأب» / «الأم»). */
.subhead { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--navy-800); margin-top: 6px; }
.subhead::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.grid > .subhead:first-child { margin-top: 0; }
.review-table td.rsub { font-family: var(--display); font-weight: 700; color: var(--navy-800); padding-top: 14px; width: auto; }

/* typed dates */
.date-in { display: grid; gap: 6px; }
.date-boxes { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 8px; }
.date-boxes .input { direction: ltr; text-align: center; font-variant-numeric: tabular-nums; }
.date-boxes .input::placeholder { font-family: inherit; }
.date-boxes .input.bad { border-color: var(--danger); background: #fffaf9; }
.date-err { font-size: 12.5px; color: var(--danger); }

/* ---------- shared: toasts, ask dialog ---------- */
.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.toasts { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast2 { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: var(--navy-900); color: #fff; padding: 11px 16px 11px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 14px 34px -12px rgba(11,22,38,.6); border-inline-start: 3px solid var(--gold); animation: rise .25s ease both; transition: opacity .3s, transform .3s; }
.toast2 button { border: 0; background: rgba(176,141,87,.22); color: #e9d6b0; font: inherit; font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.toast2.out { opacity: 0; transform: translateY(8px); }
dialog.ask { animation: rise .2s ease both; }
dialog.ask.danger { border-top-color: var(--danger); }
.ask-text { margin: 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: #8d2f25; border-color: #8d2f25; }

/* ---------- portal additions ---------- */
.offline-bar { display: none; margin-bottom: 16px; padding: 10px 16px; border-radius: 8px; background: var(--navy-900); color: #fff; font-size: 13.5px; border-inline-start: 3px solid var(--gold); }
body.offline .offline-bar { display: block; }

.tracker { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px 16px; margin: -12px 0 28px; box-shadow: var(--shadow-sm); animation: rise .45s ease both; }
.tr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tr-head b { font-family: var(--display); font-size: 15px; }
.tr-head span { font-size: 13px; color: var(--ink-2); }
.tracker ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.tracker li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 4px; }
.tracker li::before { content: ""; position: absolute; top: 14px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--line); }
.tracker li:first-child::before { display: none; }
.tracker li.past::before, .tracker li.now::before { background: var(--gold); }
.tracker i { position: relative; z-index: 1; font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--white); border: 1.5px solid var(--line-2); color: var(--muted); font-size: 12.5px; font-weight: 700; font-family: "Google Sans", var(--body); }
.tracker .past i { background: var(--gold); border-color: var(--gold); color: #fff; }
.tracker .now i { background: var(--navy-800); border-color: var(--navy-800); color: var(--gold); box-shadow: 0 0 0 5px rgba(16, 32, 54, .1); }
.tracker span { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.tracker .now span { color: var(--ink); font-weight: 700; }
.tracker small { font-size: 11.5px; color: var(--muted); }

.welcome { background: var(--navy-900); color: #fff; border-radius: 10px; padding: 22px 26px; margin: -12px 0 28px; position: relative; overflow: hidden; }
.welcome::before { content: ""; position: absolute; inset: 0; background-image: var(--guilloche); background-size: 160px 80px; opacity: .5; mask-image: linear-gradient(270deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(270deg, #000, transparent 70%); }
.welcome > * { position: relative; }
.welcome h3 { margin: 0 0 14px; font-size: 17px; color: var(--gold); }
.welcome ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: w; }
.welcome li { counter-increment: w; display: flex; flex-direction: column; gap: 3px; padding-inline-start: 38px; position: relative; }
.welcome li::before { content: counter(w); position: absolute; inset-inline-start: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.welcome li b { font-size: 14.5px; }
.welcome li span { font-size: 13px; color: rgba(255,255,255,.65); }

.steps-list .st-l { flex: 1; }
.steps-list .partial .dot { border-color: var(--gold); color: var(--gold-600); }
.st-miss { font-size: 11px; color: var(--gold-600); font-weight: 600; white-space: nowrap; }
.save-state.ok { color: var(--navy-600); }
.save-state.bad { color: var(--danger); }
.req-note { margin: -12px 0 22px; font-size: 13px; color: var(--muted); }
.field-err { font-size: 12.5px; color: var(--danger); }
.input.bad { border-color: var(--danger); background: #fffaf9; }
.field.flash { animation: flash 1.6s ease; border-radius: 8px; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 8px var(--gold-soft); background: var(--gold-soft); } 100% { box-shadow: 0 0 0 8px transparent; background: transparent; } }

.doc-slot.need { border-color: #e6d6b8; }
.doc-slot.drop { border-color: var(--gold); border-style: dashed; background: var(--gold-soft); }
.doc-slot .title { align-items: flex-start; }
.doc-slot .title b { display: block; font-weight: 600; }
.doc-slot .state { margin-top: 2px; }
.doc-hint { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.doc-file { padding: 8px; gap: 12px; }
.doc-thumb { flex: none; width: 46px; height: 46px; border-radius: 6px; overflow: hidden; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; text-decoration: none; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb span { font-size: 11px; font-weight: 700; color: var(--danger); letter-spacing: .04em; }
.doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-info a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; font-weight: 500; }
.doc-info .meta { font-size: 12px; color: var(--muted); margin: 0; }
.progress { position: relative; height: auto; background: none; display: flex; flex-direction: column; gap: 6px; }
.progress i { height: 3px; border-radius: 3px; background: var(--gold); width: 0; transition: width .2s; }
.progress span { font-size: 12px; color: var(--ink-2); }

.alert.ok { background: #eef3f9; color: var(--navy-800); border-color: #d3dfee; margin-bottom: 20px; }
.review-missing { margin-bottom: 20px; }
.review-missing .muted { font-size: 12.5px; }
.review-table tr.miss td:first-child { color: var(--danger); }
.review-table tr.miss .empty { color: var(--danger); font-weight: 600; }
.r-item + .r-item { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); }
.print-head { display: none; }

@media (max-width: 980px) {
  .welcome ol { grid-template-columns: 1fr; gap: 12px; }
  .steps-list .st-miss { display: none; }
  .steps-list .st-l { flex: none; }
}
@media (max-width: 600px) {
  .tracker { padding: 16px 12px 14px; }
  .tr-head { padding: 0 4px; }
  .tracker i { width: 26px; height: 26px; font-size: 11.5px; }
  .tracker li::before { top: 12px; }
  .tracker span { font-size: 11px; }
  .tracker small { display: none; }
  .welcome { padding: 20px 18px; }
  .doc-file { flex-wrap: nowrap; }
  .doc-file a { flex: initial; }
  .doc-info a { flex: none; }
}
@media print {
  .tracker, .welcome, .offline-bar, .note, .pass, .req-note, .toasts { display: none !important; }
  .shell { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  .panel-head { display: none; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #0b1626; padding-bottom: 10px; margin-bottom: 18px; }
  .print-head b { font-family: var(--display); font-size: 20px; }
  .print-head span { font-size: 12px; color: #444; }
  .review-sec { break-inside: avoid-page; }
  .alert { display: none; }
}
.copy-box { unicode-bidi: plaintext; }

/* documents: «scanned only» notice */
.scan-note { display: flex; gap: 14px; align-items: flex-start; margin: -8px 0 22px; padding: 16px 18px; border-radius: 8px; background: var(--gold-soft); border: 1px solid #e6d6b8; border-inline-start: 4px solid var(--gold); }
.scan-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--display); }
.scan-note b { display: block; font-family: var(--display); font-size: 15px; color: var(--navy-800); margin-bottom: 4px; }
.scan-note p { margin: 0; font-size: 13.5px; color: var(--ink); }
.scan-note .scan-sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
