@font-face {
  font-family: 'IDArial';
  src: local('Arial'), local('ArialMT'), local('Arial Regular'), url('/fonts/LiberationSans-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal;
}
:root {
  --navy: #2f2483; --navy-2: #241c6a; --red: #e7343e; --cyan: #0098d8;
  --ink: #16182b; --muted: #5f6478; --line: #e3e5ee; --bg: #f5f6fa; --card: #fff;
  --ok: #0f8a5f; --ok-bg: #e6f6ef; --warn: #a15c00; --warn-bg: #fff3df;
  --radius: 12px; --shadow: 0 1px 2px rgba(22,24,43,.06), 0 8px 24px rgba(22,24,43,.06);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* ---------- header ---------- */
.topbar { background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 55%, #0b5fa5 100%); color: #fff; }
.topbar .in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #fff url('/template/front.svg') no-repeat; background-size: 212.6px 338.6px; background-position: -10.9px -15.9px; box-shadow: 0 0 0 2px #fff; }
.brand small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.brand strong { font-size: 16px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar .link { color: #fff; opacity: .85; text-decoration: none; font-size: 14px; }
.topbar .link:hover { opacity: 1; text-decoration: underline; }
.redline { height: 4px; background: var(--red); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------- buttons ---------- */
.btn { appearance: none; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: 600 14px/1.2 var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #d22731; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover:not(:disabled) { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: #c9ccda; background: #fafbfd; }
.btn-danger { background: #fff; color: #c0262f; border-color: #f2c9cc; }
.btn-danger:hover { background: #fff5f5; }
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; flex: none; }
:focus-visible { outline: 3px solid rgba(0,152,216,.45); outline-offset: 2px; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 30px 0 10px; }
.hero h1 { font-size: 40px; letter-spacing: -.02em; color: var(--navy); }
.hero h1 span { color: var(--red); }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 520px; margin: 14px 0 26px; }
.steps { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--muted); }
.steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #e9e7f6; color: var(--navy); display: grid; place-items: center; font-size: 13px; }
.steps strong { color: var(--ink); display: block; }
.hero-cards { display: flex; justify-content: center; gap: 18px; perspective: 1200px; }
.hero-cards .cardbox { width: 46%; max-width: 230px; }
.hero-cards .cardbox:first-child { transform: rotate(-4deg) translateY(6px); }
.hero-cards .cardbox:last-child { transform: rotate(3deg) translateY(-6px); }

.cardbox { background: #fff; border-radius: 10px; box-shadow: 0 2px 4px rgba(22,24,43,.08), 0 14px 34px rgba(22,24,43,.16); overflow: hidden; line-height: 0; }
.cardbox svg { width: 100%; height: auto; display: block; }
.cardlabel { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- form page ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.form-panel { padding: 28px; }
.form-panel h2 { font-size: 22px; color: var(--navy); }
.form-panel .sub { color: var(--muted); margin: 6px 0 22px; }
.preview-panel { padding: 20px; position: sticky; top: 20px; }
.preview-panel h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.preview-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.back-link:hover { color: var(--navy); }

.staff-form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.staff-form .f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.staff-form .f.full { grid-column: 1 / -1; }
.staff-form .f > span { font-size: 13px; font-weight: 600; color: #34384d; }
.staff-form .f > span i { color: var(--red); font-style: normal; }
.staff-form .f > span em { font-weight: 400; color: var(--muted); }
.staff-form input:not([type=range]):not([type=file]), .staff-form select, .staff-form textarea {
  width: 100%; border: 1px solid #cfd2de; border-radius: 9px; padding: 10px 12px; font: 15px/1.4 var(--font); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.staff-form textarea { resize: vertical; min-height: 78px; }
.staff-form input[name=name], .staff-form textarea { text-transform: uppercase; }
.staff-form input[name=name]::placeholder, .staff-form textarea::placeholder { text-transform: none; }
.staff-form input:focus, .staff-form select:focus, .staff-form textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,152,216,.18); }
.staff-form .invalid input, .staff-form .invalid select, .staff-form .invalid textarea, .staff-form .invalid .crop { border-color: var(--red) !important; }
.field-msg { color: #c0262f; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.photo-row { display: flex; gap: 18px; align-items: flex-start; }
.crop { position: relative; width: 150px; aspect-ratio: 53.1502 / 60.2197; border: 1px solid #cfd2de; border-radius: 8px; overflow: hidden; background: #f1f2f7; touch-action: none; flex: none; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; cursor: grab; }
.crop.dragging img { cursor: grabbing; }
.crop-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; color: #9aa0ae; font-size: 12px; }
.photo-tools { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding-top: 4px; }
.file-btn { position: relative; }
.zoom { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.zoom input { width: 160px; accent-color: var(--navy); }
.form-error { background: #fff1f2; color: #a3141d; border: 1px solid #f6c8cc; padding: 10px 14px; border-radius: 9px; margin-top: 18px; font-size: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.success { text-align: center; padding: 56px 28px; max-width: 560px; margin: 30px auto; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; }
.success h2 { color: var(--navy); font-size: 24px; }
.success p { color: var(--muted); margin: 10px 0 24px; }

/* ---------- admin ---------- */
.login { max-width: 400px; margin: 70px auto; padding: 32px; }
.login h2 { color: var(--navy); font-size: 22px; margin-bottom: 4px; }
.login p { color: var(--muted); margin: 0 0 20px; }
.login input { width: 100%; border: 1px solid #cfd2de; border-radius: 9px; padding: 11px 12px; font: 15px var(--font); margin-bottom: 14px; }
.login input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,152,216,.18); }
.login .btn { width: 100%; justify-content: center; }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-size: 26px; color: var(--navy); }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat small { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.stat div { font-size: 28px; font-weight: 700; color: var(--navy); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.pending div { color: var(--warn); }
.stat.printed div { color: var(--ok); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search { flex: 1 1 240px; position: relative; }
.toolbar .search input { width: 100%; border: 1px solid #cfd2de; border-radius: 9px; padding: 9px 12px 9px 36px; font: 14px var(--font); }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 8px 12px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.toolbar select { border: 1px solid #cfd2de; border-radius: 9px; padding: 8px 10px; font: 14px var(--font); background: #fff; }
.toolbar label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.staff { width: 100%; border-collapse: collapse; font-size: 14px; }
table.staff th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.staff td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.staff tr:last-child td { border-bottom: 0; }
table.staff tr:hover td { background: #fbfbfe; }
table.staff .thumb { width: 40px; height: 45px; border-radius: 5px; object-fit: cover; background: #eef0f5; display: block; border: 1px solid var(--line); }
table.staff .nm { font-weight: 600; }
table.staff .sm { color: var(--muted); font-size: 13px; }
table.staff .acts { display: flex; gap: 6px; justify-content: flex-end; }
table.staff input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 0; cursor: default; font-family: inherit; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.printed { background: var(--ok-bg); color: var(--ok); }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 24px 80px rgba(10,12,30,.35); max-width: min(980px, 94vw); width: 100%; color: var(--ink); }
dialog::backdrop { background: rgba(14,16,36,.55); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 18px; color: var(--navy); }
.dlg-x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.dlg-x:hover { background: var(--bg); }
.dlg-body { padding: 22px; max-height: calc(100vh - 180px); overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.preview-big { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.preview-big .cardbox { width: 280px; }
dialog.edit { max-width: min(1060px, 96vw); }
dialog.edit .dlg-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
dialog.edit .form-actions { position: sticky; bottom: -22px; background: #fff; padding-bottom: 6px; }
dialog.small { max-width: 440px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
iframe.print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; visibility: hidden; }

footer.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 20px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero h1 { font-size: 32px; }
  .form-layout, dialog.edit .dlg-body { grid-template-columns: 1fr; }
  .preview-panel { position: static; order: -1; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat div { font-size: 22px; }
}
@media (max-width: 600px) {
  .wrap { padding: 18px 14px 40px; }
  .staff-form .grid { grid-template-columns: 1fr; }
  .form-panel { padding: 20px; }
  .photo-row { flex-direction: column; }
  .topbar .in { padding: 12px 14px; }
  .brand strong { font-size: 14px; }
  table.staff .hide-sm { display: none; }
}

/* ===================== v2: larger header, nav buttons, mobile ===================== */
body { font-size: 16px; }
.topbar .in { padding: 16px 24px; gap: 12px; }
.brand-mark { width: 50px; height: 50px; background-size: 265.8px 423.3px; background-position: -13.6px -19.9px; }
.brand small { font-size: 12.5px; letter-spacing: .1em; opacity: .9; }
.brand strong { font-size: 24px; letter-spacing: .01em; }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 15.5px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .1s, box-shadow .15s; }
.nav-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.nav-btn.ghost { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.45); }
.nav-btn.ghost:hover { background: rgba(255,255,255,.2); }
.nav-btn svg { width: 18px; height: 18px; flex: none; }

.login { max-width: 440px; margin: 60px auto; padding: 36px 34px; text-align: center; }
.login-icon { width: 60px; height: 60px; border-radius: 50%; background: #ecebf8; color: var(--navy); display: grid; place-items: center; margin: 0 auto 16px; }
.login h2 { font-size: 28px; margin-bottom: 8px; }
.login p { font-size: 16px; margin-bottom: 24px; }
.login-label { display: block; text-align: left; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: #34384d; }
.login input { font-size: 17px; padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; }
.login .btn { font-size: 17px; padding: 14px; }

.staff-form .f > span { font-size: 14.5px; }
.staff-form input:not([type=range]):not([type=file]), .staff-form select, .staff-form textarea { font-size: 16px; padding: 12px 14px; }
.success p.done-note { font-size: 14px; margin-top: -12px; margin-bottom: 0; }
.dash-head h1 { font-size: 28px; }
table.staff { font-size: 15px; }

@media (max-width: 760px) {
  .topbar .in { padding: 12px 14px; }
  .brand { gap: 10px; min-width: 0; }
  .brand-mark { width: 42px; height: 42px; background-size: 223.3px 355.6px; background-position: -11.4px -16.7px; }
  .brand small { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand strong { font-size: 20px; }
  .brand > span:last-child { min-width: 0; }
  .nav-btn { padding: 9px 13px; font-size: 14px; }
  .nav-btn span { white-space: nowrap; }

  .wrap { padding: 20px 14px 40px; }
  .hero { padding-top: 6px; gap: 26px; text-align: left; }
  .hero h1 { font-size: 34px; }
  .hero p.lead { font-size: 16px; margin: 12px 0 20px; }
  #generate { width: 100%; justify-content: center; font-size: 18px; padding: 16px; }
  .steps { margin-top: 26px; }
  .hero-cards { gap: 12px; }
  .hero-cards .cardbox { width: auto; max-width: none; }
  .hero-cards > div { width: 44%; }

  .form-panel { padding: 20px 16px; }
  .form-panel h2 { font-size: 22px; }
  .preview-panel { padding: 16px; }
  .preview-pair { max-width: 360px; margin: 0 auto; }
  .staff-form .grid { grid-template-columns: 1fr; gap: 16px; }
  .photo-row { flex-direction: row; gap: 14px; }
  .crop { width: 130px; }
  .zoom input { width: 120px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; padding: 15px; font-size: 17px; }
  .success { margin: 10px auto; padding: 40px 20px; }

  .login { margin: 24px auto; padding: 28px 20px; }

  /* dashboard */
  .dash-head { align-items: stretch; }
  .dash-head > div:last-child { width: 100%; }
  .dash-head > div:last-child .btn { flex: 1; justify-content: center; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat small { font-size: 11px; letter-spacing: .04em; }
  .stat div { font-size: 24px; }
  .toolbar { padding: 12px; }
  .toolbar .search { flex-basis: 100%; }
  .seg { flex: 1; }
  .seg button { flex: 1; padding: 9px 6px; }
  .toolbar label.inline { width: 100%; justify-content: space-between; }
  .toolbar select { flex: 1; max-width: 230px; }

  /* table → cards */
  table.staff thead { display: none; }
  table.staff, table.staff tbody { display: block; }
  table.staff tr { display: grid; grid-template-columns: 28px 56px 1fr; grid-template-areas: "sel photo name" "sel photo status" "meta meta meta" "acts acts acts"; column-gap: 10px; row-gap: 6px; padding: 14px; border-bottom: 1px solid var(--line); }
  table.staff tr:last-child { border-bottom: 0; }
  table.staff td { padding: 0; border: 0; display: block; background: none !important; }
  table.staff td.c-sel { grid-area: sel; padding-top: 4px; }
  table.staff td.c-photo { grid-area: photo; }
  table.staff td.c-photo .thumb { width: 56px; height: 63px; }
  table.staff td.c-name { grid-area: name; }
  table.staff td.c-status { grid-area: status; }
  table.staff td.hide-sm { display: inline-block !important; font-size: 14px; color: var(--muted); }
  table.staff td.hide-sm::before { content: attr(data-l) ": "; font-weight: 600; color: var(--ink); }
  table.staff tr { grid-template-areas: "sel photo name" "sel photo status" "d1 d1 d1" "d2 d2 d2" "d3 d3 d3" "acts acts acts"; }
  table.staff td[data-l="Dept."] { grid-area: d1; }
  table.staff td[data-l="Mobile"] { grid-area: d2; }
  table.staff td[data-l="Submitted"] { grid-area: d3; }
  table.staff td.c-acts { grid-area: acts; margin-top: 6px; }
  table.staff .acts { justify-content: stretch; }
  table.staff .acts .btn { flex: 1; justify-content: center; padding: 10px 6px; font-size: 14px; }
  table.staff .acts .btn-danger { flex: 0 0 44px; }

  dialog { max-width: 100vw; width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .dlg-body { padding: 16px; max-height: calc(92vh - 140px); }
  .preview-big { gap: 12px; flex-wrap: nowrap; }
  .preview-big > div { flex: 1; }
  .preview-big .cardbox { width: 100%; }
  .dlg-foot .btn { flex: 1; justify-content: center; }
  dialog.edit .dlg-body > div:last-child { order: -1; max-width: 340px; margin: 0 auto; width: 100%; }
}
@media (max-width: 560px) {
  .nav-btn.ghost span { display: none; }
  .nav-btn.ghost { padding: 10px; }
}
@media (max-width: 380px) {
  .nav-btn span { display: none; }
  .nav-btn { padding: 10px; }
  .brand strong { font-size: 18px; }
}
.hero-cards > div { width: 44%; max-width: 250px; }
.hero-cards .cardbox { width: 100%; max-width: none; }

/* ===================== v3: reference design ===================== */
.theme {
  --navy: #0b2f6e; --navy-2: #08245a; --blue: #1f5fc2; --red: #e3111f;
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-family: var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 85% 20%, #cfe5fb 0%, rgba(207,229,251,0) 60%),
              linear-gradient(180deg, #f3f8fe 0%, #e6f1fd 100%);
  position: relative; overflow-x: hidden;
}
.theme main.wrap { flex: 1; position: relative; z-index: 1; width: 100%; padding-bottom: 150px; }
.theme.admin:not(.on-login) main.wrap { padding-bottom: 60px; }
.theme.admin:not(.on-login) .bg-waves { display: none; }
.theme.admin { background: #f4f7fc; }
.theme.admin.on-login { background: linear-gradient(180deg, #fff 0%, #f1f6fd 100%); }

/* header */
.theme .topbar { background: linear-gradient(90deg, #0a2c6b 0%, #0d3a8a 55%, #1450b0 100%); box-shadow: 0 2px 12px rgba(8,36,90,.25); position: relative; z-index: 3; }
.theme .topbar .in { max-width: 1280px; padding: 14px 32px; }
.theme .brand { gap: 18px; }
.brand-bar { width: 4px; height: 52px; background: #fff; border-radius: 2px; flex: none; }
.theme .brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.logo { font-size: 36px; font-weight: 800; letter-spacing: -.01em; color: #fff; line-height: 1; }
.logo em, .hero-title em, .login-title em { font-style: normal; color: var(--red); }
.logo em { color: #ff2a36; }
.theme .brand small { order: 2; font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: 1; margin-top: 5px; }
.nav-btn.outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.9); box-shadow: none; border-radius: 12px; padding: 10px 20px; font-weight: 600; font-size: 17px; }
.nav-btn.outline:hover { background: rgba(255,255,255,.12); }
.nav-btn.outline.solid { background: #fff; color: var(--navy); }
.nav-btn.outline svg { width: 22px; height: 22px; }
.theme .redline { height: 5px; background: var(--red); position: relative; z-index: 3; }

/* hero */
.theme .hero { grid-template-columns: 1.05fr .95fr; gap: 40px; padding: 34px 0 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 12px; background: #dbe9fb; color: var(--navy); font-weight: 600; font-size: 18px; padding: 10px 22px; border-radius: 999px; }
.pill svg { width: 26px; height: 26px; color: var(--blue); }
.theme .hero .hero-title { font-size: 92px; font-weight: 800; color: var(--navy); line-height: 1; margin: 26px 0 6px; letter-spacing: -.02em; }
.theme .hero .hero-sub { font-size: 46px; font-weight: 700; color: var(--navy); line-height: 1.12; letter-spacing: -.01em; }
.title-bar { display: block; width: 104px; height: 6px; border-radius: 3px; background: var(--red); margin: 20px 0 24px; }
.theme .hero p.lead { font-size: 21px; color: #3f4a63; max-width: 640px; margin: 0 0 30px; line-height: 1.55; }
.btn-hero { display: inline-flex; align-items: center; gap: 18px; border: 0; cursor: pointer; font: 600 25px var(--font); color: #fff; padding: 18px 42px 18px 36px; border-radius: 14px; background: linear-gradient(180deg, #f2333d 0%, #d80f1b 100%); box-shadow: 0 10px 24px rgba(216,15,27,.32); transition: transform .1s, box-shadow .15s; }
.btn-hero:hover { box-shadow: 0 14px 30px rgba(216,15,27,.42); transform: translateY(-1px); }
.btn-hero svg { width: 30px; height: 30px; flex: none; }
.btn-hero .arr { width: 28px; margin-left: 10px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px; max-width: 680px; }
.feat { background: rgba(255,255,255,.92); border-radius: 16px; box-shadow: 0 6px 22px rgba(15,47,110,.08); padding: 18px 12px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 500; font-size: 17px; color: #1b2440; line-height: 1.3; }
.fi { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; }
.fi svg { width: 30px; height: 30px; }
.fi.blue { background: #d9ecfd; color: #1f6fd1; }
.fi.violet { background: #e6e3fb; color: #4b3fc4; }
.fi.green { background: #dcf3e2; color: #16a34a; }

.theme .hero-cards { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 0; min-height: 560px; perspective: none; }
.theme .hero-cards .hc { width: 330px; max-width: 48%; display: flex; flex-direction: column; align-items: center; gap: 22px; position: relative; }
.theme .hero-cards .hc .cardbox { width: 100%; border-radius: 18px; box-shadow: 0 22px 50px rgba(11,47,110,.25); }
.theme .hero-cards .hc.front { transform: rotate(-6deg); z-index: 2; margin-right: -26px; }
.theme .hero-cards .hc.back { transform: rotate(6deg) translateY(30px); z-index: 1; }
.theme .hero-cards .hc.back .cardbox { box-shadow: 0 18px 40px rgba(11,47,110,.18); }
.side-pill { background: #e2eefc; color: var(--navy); font-weight: 600; font-size: 18px; padding: 8px 26px; border-radius: 999px; transform: rotate(6deg); }
.hc.back .side-pill { transform: rotate(-6deg); }
.theme .cardlabel { font-family: var(--font); }

/* waves + footer */
.bg-waves { position: absolute; left: 0; right: 0; bottom: 64px; height: 190px; z-index: 0; pointer-events: none; }
.bg-waves svg { width: 100%; height: 100%; display: block; }
.site-foot { position: relative; z-index: 2; background: linear-gradient(90deg, #0a2c6b, #0c3a88); color: #fff; height: 64px; display: flex; align-items: center; justify-content: center; gap: 36px; font-weight: 600; font-size: 22px; }
.site-foot::before, .site-foot::after { content: ''; width: 160px; height: 2px; background: rgba(255,255,255,.85); }
.theme footer.foot { display: none; }

/* panels in theme */
.theme .panel { border-radius: 18px; border-color: #e1e9f5; box-shadow: 0 8px 30px rgba(11,47,110,.08); }
.theme .form-panel h2, .theme .success h2, .theme .dash-head h1 { color: var(--navy); font-weight: 700; }
.theme .btn { font-family: var(--font); }
.theme .btn-primary { background: linear-gradient(180deg, #f2333d, #d80f1b); }
.theme .btn-navy { background: var(--navy); }
.theme .staff-form input, .theme .staff-form select, .theme .staff-form textarea { font-family: var(--font); }

/* admin login */
.theme .login { max-width: 640px; margin: 60px auto 40px; padding: 36px 56px 48px; border-radius: 26px; border: 1px solid #e3ecf8; box-shadow: 0 10px 50px rgba(31,95,194,.16); background: #fff; }
.theme .login-icon { width: 110px; height: 110px; background: #d7e8fb; color: var(--navy); margin-bottom: 18px; }
.theme .login-icon svg { width: 54px; height: 54px; }
.login-title { display: flex; align-items: center; justify-content: center; gap: 30px; font-size: 48px !important; font-weight: 800; color: var(--navy); margin-bottom: 10px !important; letter-spacing: -.01em; }
.login-title::before, .login-title::after { content: ''; width: 70px; height: 2px; background: var(--navy); }
.theme .login p { font-size: 19px; color: #26304a; margin-bottom: 28px; }
.pw-wrap { position: relative; margin-bottom: 18px; }
.pw-wrap .key { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; color: var(--blue); pointer-events: none; }
.theme .login .pw-wrap input { margin: 0; padding: 20px 64px 20px 72px; font: 500 20px var(--font); border: 2px solid #c9dcf5; border-radius: 14px; box-shadow: 0 4px 14px rgba(31,95,194,.08); }
.theme .login .pw-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,95,194,.15); }
.pw-wrap .eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #33415e; cursor: pointer; padding: 8px; border-radius: 8px; }
.pw-wrap .eye svg { width: 28px; height: 28px; display: block; }
.pw-wrap .eye.on .slash { display: none; }
.btn-login { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 16px; border: 0; cursor: pointer; background: linear-gradient(180deg, #0d3a88, #0a2c6b); color: #fff; font: 600 26px var(--font); padding: 18px; border-radius: 14px; box-shadow: 0 8px 20px rgba(10,44,107,.28); }
.btn-login:hover { background: linear-gradient(180deg, #11449c, #0b3278); }
.btn-login svg { width: 32px; height: 32px; }

@media (max-width: 1100px) {
  .theme .hero .hero-title { font-size: 72px; }
  .theme .hero .hero-sub { font-size: 36px; }
  .theme .hero-cards .hc { width: 280px; }
  .theme .hero-cards { min-height: 480px; }
}
@media (max-width: 900px) {
  .theme .hero { grid-template-columns: 1fr; }
  .theme .hero-cards { min-height: 0; padding: 10px 0 30px; }
}
@media (max-width: 760px) {
  .theme .topbar .in { padding: 12px 16px; }
  .theme .brand { gap: 12px; }
  .brand-bar { height: 40px; width: 3px; }
  .logo { font-size: 27px; }
  .theme .brand small { font-size: 11.5px; margin-top: 3px; white-space: normal; overflow: visible; }
  .nav-btn.outline { padding: 8px 12px; font-size: 14px; border-radius: 10px; border-width: 1.5px; }
  .nav-btn.outline svg { width: 18px; height: 18px; }
  .pill { font-size: 14px; padding: 8px 16px; }
  .pill svg { width: 20px; height: 20px; }
  .theme .hero .hero-title { font-size: 58px; margin-top: 18px; }
  .theme .hero .hero-sub { font-size: 28px; }
  .title-bar { margin: 14px 0 16px; height: 5px; width: 80px; }
  .theme .hero p.lead { font-size: 16.5px; margin-bottom: 22px; }
  .btn-hero { width: 100%; justify-content: center; font-size: 20px; padding: 16px 20px; }
  .btn-hero svg { width: 24px; height: 24px; }
  .features { gap: 10px; margin-top: 26px; }
  .feat { font-size: 13px; padding: 14px 6px; gap: 8px; border-radius: 14px; }
  .fi { width: 44px; height: 44px; }
  .fi svg { width: 22px; height: 22px; }
  .theme .hero-cards .hc { width: 46%; max-width: none; gap: 14px; }
  .theme .hero-cards .hc.front { margin-right: -10px; }
  .side-pill { font-size: 13px; padding: 6px 14px; }
  .theme main.wrap { padding-bottom: 110px; }
  .bg-waves { height: 110px; bottom: 52px; }
  .site-foot { height: 52px; font-size: 13.5px; gap: 12px; padding: 0 10px; text-align: center; }
  .site-foot::before, .site-foot::after { width: 28px; flex: none; }
  .theme .login { margin: 26px auto; padding: 28px 20px 32px; border-radius: 20px; }
  .theme .login-icon { width: 84px; height: 84px; }
  .theme .login-icon svg { width: 42px; height: 42px; }
  .login-title { font-size: 34px !important; gap: 14px; }
  .login-title::before, .login-title::after { width: 30px; }
  .theme .login p { font-size: 15.5px; margin-bottom: 20px; }
  .theme .login .pw-wrap input { font-size: 17px; padding: 16px 56px 16px 58px; }
  .pw-wrap .key { left: 18px; width: 24px; height: 24px; }
  .btn-login { font-size: 20px; padding: 15px; }
  .btn-login svg { width: 26px; height: 26px; }
}
@media (max-width: 560px) {
  .theme .nav-btn.outline:not(.solid) span { display: none; }
  .theme .nav-btn.outline:not(.solid) { padding: 9px; }
  .theme.admin .nav-btn.outline span { display: none; }
  .theme.admin .nav-btn.outline { padding: 9px; }
}
@media (max-width: 400px) {
  .theme .brand small { display: none; }
}
/* v3 fixes */
.theme .wrap { max-width: 1440px; padding-left: 48px; padding-right: 48px; }
.theme .topbar .in { max-width: 1440px; padding-left: 48px; padding-right: 48px; }
.theme .brand .logo { font-size: 36px; font-weight: 800; }
.theme .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.theme .hero .hero-sub { white-space: nowrap; }
.features { max-width: 720px; }
@media (max-width: 1250px) { .theme .hero .hero-sub { white-space: normal; } }
@media (max-width: 760px) {
  .theme .wrap { padding-left: 16px; padding-right: 16px; }
  .theme .topbar .in { padding-left: 16px; padding-right: 16px; }
  .theme .brand .logo { font-size: 27px; }
  .theme .hero .hero-sub { white-space: normal; }
}
@media (max-width: 900px) {
  .theme .hero { grid-template-columns: 1fr; gap: 34px; }
  .theme .hero-cards { justify-content: center; }
}
@media (max-width: 400px) {
  .theme .brand small { display: block; font-size: 10.5px; }
  .theme .brand .logo { font-size: 25px; }
}

/* ===================== v4: proper sizing (fit laptop screens) ===================== */
.theme .topbar .in { padding-top: 10px; padding-bottom: 10px; }
.brand-bar { height: 42px; }
.theme .brand { gap: 14px; }
.theme .brand .logo { font-size: 28px; }
.theme .brand small { font-size: 13px; margin-top: 3px; }
.nav-btn.outline { font-size: 15px; padding: 8px 16px; border-radius: 10px; border-width: 1.5px; }
.nav-btn.outline svg { width: 18px; height: 18px; }

.theme main.wrap { padding-top: 22px; padding-bottom: 80px; }
.theme .hero { padding: 6px 0 0; gap: 32px; }
.pill { font-size: 14.5px; padding: 7px 16px; gap: 9px; }
.pill svg { width: 20px; height: 20px; }
.theme .hero .hero-title { font-size: clamp(46px, 8.5vh, 70px); margin: 16px 0 4px; }
.theme .hero .hero-sub { font-size: clamp(24px, 4.4vh, 36px); }
.title-bar { width: 80px; height: 5px; margin: 14px 0 16px; }
.theme .hero p.lead { font-size: 17px; max-width: 560px; margin: 0 0 22px; line-height: 1.55; }
.btn-hero { font-size: 19px; padding: 13px 30px 13px 26px; gap: 14px; border-radius: 12px; }
.btn-hero svg { width: 23px; height: 23px; }
.btn-hero .arr { width: 21px; margin-left: 6px; }
.features { margin-top: 24px; gap: 14px; max-width: 600px; }
.feat { font-size: 14.5px; padding: 14px 10px; gap: 8px; border-radius: 14px; }
.fi { width: 46px; height: 46px; }
.fi svg { width: 23px; height: 23px; }

.theme .hero-cards { min-height: 0; padding: 10px 0 34px; }
.theme .hero-cards .hc { width: clamp(170px, 34vh, 250px); gap: 16px; }
.theme .hero-cards .hc .cardbox { border-radius: 14px; }
.theme .hero-cards .hc.front { margin-right: -18px; }
.theme .hero-cards .hc.back { transform: rotate(6deg) translateY(22px); }
.side-pill { font-size: 14.5px; padding: 6px 18px; }

.bg-waves { height: 110px; bottom: 48px; }
.site-foot { height: 48px; font-size: 16px; gap: 24px; }
.site-foot::before, .site-foot::after { width: 90px; }

/* admin login */
.theme .login { max-width: 500px; margin: 36px auto 30px; padding: 28px 40px 34px; border-radius: 20px; }
.theme .login-icon { width: 78px; height: 78px; margin-bottom: 12px; }
.theme .login-icon svg { width: 38px; height: 38px; }
.login-title { font-size: 34px !important; gap: 18px; }
.login-title::before, .login-title::after { width: 44px; }
.theme .login p { font-size: 15.5px; margin-bottom: 20px; }
.theme .login .pw-wrap input { font-size: 16px; padding: 14px 54px 14px 54px; border-radius: 12px; }
.pw-wrap .key { left: 18px; width: 22px; height: 22px; }
.pw-wrap .eye svg { width: 22px; height: 22px; }
.btn-login { font-size: 19px; padding: 13px; border-radius: 12px; gap: 12px; }
.btn-login svg { width: 23px; height: 23px; }

/* dashboard / form headings a touch smaller */
.theme .dash-head h1 { font-size: 24px; }
.theme .form-panel h2 { font-size: 21px; }

@media (max-width: 900px) {
  .theme .hero-cards .hc { width: 40%; max-width: 230px; }
}
@media (max-width: 760px) {
  .theme .topbar .in { padding-top: 10px; padding-bottom: 10px; }
  .brand-bar { height: 36px; }
  .theme .brand { gap: 10px; }
  .theme .brand .logo { font-size: 23px; }
  .theme .brand small { font-size: 11px; }
  .nav-btn.outline { padding: 7px 10px; font-size: 13.5px; }
  .theme main.wrap { padding-top: 16px; padding-bottom: 70px; }
  .pill { font-size: 13px; padding: 6px 13px; }
  .pill svg { width: 17px; height: 17px; }
  .theme .hero .hero-title { font-size: 44px; margin-top: 14px; }
  .theme .hero .hero-sub { font-size: 23px; }
  .title-bar { width: 64px; height: 4px; margin: 12px 0 14px; }
  .theme .hero p.lead { font-size: 15px; margin-bottom: 18px; }
  .btn-hero { font-size: 17px; padding: 13px 18px; }
  .btn-hero svg { width: 21px; height: 21px; }
  .features { gap: 8px; margin-top: 18px; }
  .feat { font-size: 12px; padding: 11px 5px; gap: 6px; border-radius: 12px; }
  .fi { width: 38px; height: 38px; }
  .fi svg { width: 19px; height: 19px; }
  .theme .hero { gap: 18px; }
  .theme .hero-cards { padding: 4px 0 26px; }
  .theme .hero-cards .hc { width: 42%; gap: 10px; }
  .side-pill { font-size: 12px; padding: 5px 12px; }
  .bg-waves { height: 80px; bottom: 44px; }
  .site-foot { height: 44px; font-size: 12.5px; gap: 10px; }
  .site-foot::before, .site-foot::after { width: 22px; }
  .theme .login { margin: 18px auto; padding: 24px 18px 26px; }
  .theme .login-icon { width: 66px; height: 66px; }
  .theme .login-icon svg { width: 32px; height: 32px; }
  .login-title { font-size: 28px !important; gap: 12px; }
  .login-title::before, .login-title::after { width: 24px; }
  .theme .login p { font-size: 14.5px; }
  .btn-login { font-size: 17px; }
}
@media (max-width: 400px) {
  .theme .brand .logo { font-size: 22px; }
  .theme .brand small { font-size: 10px; }
}

/* ===================== v5: custom dropdown arrow ===================== */
.staff-form select, .toolbar select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b2f6e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  padding-right: 44px !important;
  cursor: pointer;
  text-overflow: ellipsis;
}
.staff-form select:hover, .toolbar select:hover { border-color: #9fb6d8; }
.staff-form select:invalid, .staff-form select option[value=""] { color: #8a93a8; }
.staff-form select option { color: #16182b; }
.toolbar select { padding-top: 8px; padding-bottom: 8px; background-position: right 10px center; background-size: 16px 16px; padding-right: 36px !important; }
.staff-form select::-ms-expand { display: none; }

/* ===================== v6: professional split-screen login ===================== */
.theme.admin.on-login { background: #fff; }
.on-login > .topbar, .on-login > .redline, .on-login > main, .on-login > .bg-waves, .on-login > .site-foot { display: none !important; }

.auth { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; width: 100%; }

/* brand panel */
.auth-brand {
  position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column;
  padding: 40px clamp(32px, 4.5vw, 64px) 34px;
  background:
    radial-gradient(700px 500px at 85% 30%, rgba(46,120,230,.38), transparent 60%),
    radial-gradient(500px 400px at 0% 100%, rgba(227,17,31,.16), transparent 60%),
    linear-gradient(160deg, #0c3480 0%, #0a2a66 48%, #071d4a 100%);
}
.auth-brand::before { /* fine dot grid */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 70%); mask-image: linear-gradient(120deg, #000 0%, transparent 70%);
}
.auth-brand::after { /* red signature stripe, echoing the card */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, transparent, #e3111f 30%, #e3111f);
}
.auth-brand > * { position: relative; z-index: 1; }
.ab-top { display: flex; align-items: center; gap: 14px; }
.ab-emblem {
  width: 52px; height: 52px; border-radius: 50%; flex: none; background: #fff url('/template/front.svg') no-repeat;
  background-size: 276.3px 440px; background-position: -13.9px -20.4px; box-shadow: 0 0 0 3px rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.25);
}
.ab-emblem.sm { width: 36px; height: 36px; background-size: 191.3px 304.6px; background-position: -9.6px -14.1px; box-shadow: 0 0 0 1px #e3e9f3; }
.ab-inst { display: flex; flex-direction: column; font-weight: 600; font-size: 15.5px; line-height: 1.25; letter-spacing: .005em; }
.ab-inst small { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; }

.ab-mid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 3vw, 48px); padding: 32px 0; }
.ab-copy .logo { font-size: 22px; display: inline-block; padding: 6px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(255,255,255,.06); margin-bottom: 22px; }
.ab-copy h1 { font-size: clamp(30px, 3.1vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; color: #fff; }
.ab-copy p { margin: 18px 0 0; max-width: 400px; font-size: 15.5px; line-height: 1.65; color: rgba(225,234,250,.82); }

.ab-cards { position: relative; width: clamp(170px, 15vw, 230px); aspect-ratio: 153.07 / 243.78; margin-right: 34px; }
.ab-card { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; background: #fff; line-height: 0; }
.ab-card img, .ab-card svg { width: 100%; height: auto; display: block; }
.ab-card.front { transform: rotate(-5deg); box-shadow: 0 30px 60px rgba(2,10,35,.5), 0 0 0 1px rgba(255,255,255,.6); animation: abFloat 7s ease-in-out infinite; }
.ab-card.back { transform: translate(44px, 18px) rotate(7deg); opacity: .9; box-shadow: 0 24px 50px rgba(2,10,35,.45); filter: saturate(.9) brightness(.92); }
@keyframes abFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

.ab-facts { list-style: none; margin: 0; padding: 22px 0 0; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; gap: 10px 30px; font-size: 13.5px; color: rgba(225,234,250,.85); }
.ab-facts li { display: flex; align-items: center; gap: 9px; }
.ab-facts svg { width: 18px; height: 18px; color: #7fb2ff; flex: none; }

/* form side */
.auth-main { display: flex; flex-direction: column; padding: 28px clamp(24px, 4vw, 56px) 24px; background: linear-gradient(180deg, #fff 0%, #f7f9fd 100%); }
.am-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 40px; }
.am-mobile-brand { display: none; align-items: center; gap: 10px; margin-right: auto; }
.am-mobile-brand .logo { color: var(--navy); font-size: 22px; }
.am-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: #46516b; text-decoration: none; padding: 8px 14px; border: 1px solid #dde4f0; border-radius: 999px; background: #fff; transition: border-color .15s, color .15s; }
.am-link:hover { color: var(--navy); border-color: #b9c8e2; }
.am-link svg { width: 15px; height: 15px; }

.auth-form { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.af-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.af-eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--red); border-radius: 2px; }
.auth-form h2 { font-size: 34px; font-weight: 700; color: #0b1e45; letter-spacing: -.02em; margin: 10px 0 8px; }
.af-sub { margin: 0 0 30px; color: #5b6780; font-size: 15px; line-height: 1.6; }

.af-label { display: block; font-size: 13.5px; font-weight: 600; color: #26314d; margin-bottom: 8px; }
.af-field { position: relative; }
.af-field input {
  width: 100%; height: 52px; padding: 0 52px 0 46px; font: 500 15.5px var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid #d5ddea; border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.af-field input::placeholder { color: #9aa5ba; font-weight: 400; }
.af-field input:hover { border-color: #b7c5dc; }
.af-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,95,194,.13); }
.af-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #7a87a1; pointer-events: none; transition: color .15s; }
.af-field:focus-within .af-ico { color: var(--blue); }
.af-field .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #6b7690; cursor: pointer; padding: 8px; border-radius: 8px; line-height: 0; }
.af-field .eye:hover { background: #f0f4fa; color: var(--navy); }
.af-field .eye svg { width: 20px; height: 20px; }
.af-field .eye.on .slash { display: none; }

.af-caps { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12.5px; font-weight: 500; color: var(--warn); }
.af-caps svg { width: 14px; height: 14px; }
.af-error { margin-top: 12px; padding: 10px 14px 10px 38px; position: relative; font-size: 13.5px; line-height: 1.45; color: #9f1620; background: #fff3f4; border: 1px solid #f7cfd3; border-radius: 10px; }
.af-error::before { content: '!'; position: absolute; left: 12px; top: 10px; width: 17px; height: 17px; border-radius: 50%; background: #d7262f; color: #fff; font: 700 11px/17px var(--font); text-align: center; }
.auth-form.err .af-field input { border-color: #e04650; }
.auth-form.err .af-field { animation: afShake .38s ease; }
@keyframes afShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.af-submit {
  position: relative; width: 100%; height: 52px; margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 12px; cursor: pointer; color: #fff; font: 600 16px var(--font); letter-spacing: .01em;
  background: linear-gradient(180deg, #11449c 0%, #0a2c6b 100%); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 10px 24px -8px rgba(10,44,107,.55);
  transition: filter .15s, box-shadow .15s, transform .05s;
}
.af-submit:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 14px 28px -8px rgba(10,44,107,.6); }
.af-submit:active:not(:disabled) { transform: translateY(1px); }
.af-submit:disabled { cursor: progress; }
.af-submit .arr { width: 18px; height: 18px; transition: transform .2s; }
.af-submit:hover .arr { transform: translateX(3px); }
.af-submit .spin { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: afSpin .7s linear infinite; }
.af-submit.busy .arr { display: none; }
.af-submit.busy .spin { display: block; }
@keyframes afSpin { to { transform: rotate(360deg); } }

.af-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 28px; padding: 14px 16px; background: #f2f6fc; border: 1px solid #e2e9f4; border-radius: 12px; }
.af-note svg { width: 18px; height: 18px; flex: none; color: var(--blue); margin-top: 1px; }
.af-note p { margin: 0; font-size: 12.5px; line-height: 1.55; color: #56627b; }

.am-foot { text-align: center; font-size: 12px; color: #8a94a8; padding-top: 12px; }

@media (prefers-reduced-motion: reduce) { .ab-card.front, .auth-form.err .af-field { animation: none; } }

/* laptops with short screens */
@media (max-height: 720px) and (min-width: 961px) {
  .auth-brand { padding-top: 28px; padding-bottom: 24px; }
  .ab-cards { width: clamp(150px, 26vh, 200px); }
  .ab-copy .logo { margin-bottom: 14px; }
}
/* tablet: brand panel without cards */
@media (max-width: 1180px) {
  .ab-mid { grid-template-columns: 1fr; }
  .ab-cards { display: none; }
}
/* phones & portrait tablets: single column */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .am-mobile-brand { display: inline-flex; }
  .auth-main { min-height: 100vh; padding: 18px 20px 18px; background:
    radial-gradient(600px 300px at 100% 0%, rgba(31,95,194,.08), transparent 70%), linear-gradient(180deg, #fff, #f5f8fd); }
  .auth-form { padding: 24px 0; }
  .auth-form h2 { font-size: 30px; }
}
@media (max-width: 400px) {
  .am-link { padding: 7px 11px; font-size: 13px; }
  .af-sub { font-size: 14.5px; margin-bottom: 24px; }
}

/* ===================== v7: registration + email OTP ===================== */
.af-sub { margin-bottom: 14px; }
.af-label { margin: 16px 0 8px; }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.af-msg { margin: 6px 0 0; font-size: 12.5px; color: #c0262f; min-height: 0; }
.af-msg:empty { display: none; }
.af-help { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: #6b7690; }
.af-help code { font: 500 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef2f8; padding: 1px 5px; border-radius: 4px; color: #26314d; }
.af-field.bad input { border-color: #e04650; }
.af-field.bad input:focus { box-shadow: 0 0 0 4px rgba(224,70,80,.13); }
.setup .af-field input { height: 48px; }

.af-meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; align-items: center; margin-top: 10px; }
.af-meter i { height: 4px; border-radius: 4px; background: #e3e8f0; transition: background .2s; }
.af-meter span { font-size: 12px; font-weight: 500; color: #8a94a8; margin-left: 6px; min-width: 104px; text-align: right; }
.af-meter[data-s="1"] i:nth-child(-n+1) { background: #e04650; }
.af-meter[data-s="2"] i:nth-child(-n+2) { background: #e8a23a; }
.af-meter[data-s="3"] i:nth-child(-n+3) { background: #3b82d6; }
.af-meter[data-s="4"] i { background: #0f8a5f; }
.af-meter[data-s="1"] span { color: #c0262f; } .af-meter[data-s="2"] span { color: #a15c00; }
.af-meter[data-s="3"] span { color: #1f5fc2; } .af-meter[data-s="4"] span { color: #0f8a5f; }

.af-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8a94a8; }
.af-divider::before, .af-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f2; }

.af-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 22px; padding: 6px 10px 6px 6px; border: 0; background: none; border-radius: 8px; font: 500 14px var(--font); color: #56627b; cursor: pointer; }
.af-back:hover { background: #eef2f8; color: var(--navy); }
.af-back svg { width: 18px; height: 18px; }
.otp-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; color: var(--blue); background: linear-gradient(180deg, #eaf1fc, #dde8f9); box-shadow: 0 0 0 6px #f3f7fd; }
.otp-badge svg { width: 28px; height: 28px; }
.otp .af-sub b { color: #0b1e45; font-weight: 600; }
.otp-boxes { display: flex; align-items: center; gap: 10px; margin: 26px 0 0; }
.otp-boxes input {
  flex: 1; min-width: 0; height: 60px; text-align: center; font: 600 26px var(--font); color: #0b1e45;
  border: 1.5px solid #d5ddea; border-radius: 12px; background: #fff; caret-color: var(--blue); transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp-boxes input:hover { border-color: #b7c5dc; }
.otp-boxes input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,95,194,.13); }
.otp-boxes input.filled { background: #f5f8fd; border-color: #a9bfe3; }
.otp-dash { flex: none; width: 10px; height: 2px; background: #c3cddd; border-radius: 2px; }
.auth-form.otp.err .otp-boxes { animation: afShake .38s ease; }
.auth-form.otp.err .otp-boxes input { border-color: #e04650; }
.af-dev { margin: 14px 0 0; padding: 10px 14px; font-size: 12.5px; line-height: 1.5; color: #7a4a00; background: #fff6e5; border: 1px solid #f3dcae; border-radius: 10px; }
.otp-resend { margin: 20px 0 0; text-align: center; font-size: 13.5px; color: #6b7690; }
.linkbtn { border: 0; background: none; padding: 0; font: 600 13.5px var(--font); color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:disabled { color: #9aa5ba; cursor: default; text-decoration: none; }
#otpTimer { color: #8a94a8; font-variant-numeric: tabular-nums; }

.theme .brand small .who:not(:empty)::before { content: ' · '; }

@media (max-width: 520px) {
  .af-row { grid-template-columns: 1fr; }
  .otp-boxes { gap: 6px; }
  .otp-boxes input { height: 52px; font-size: 22px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) { .auth-form.otp.err .otp-boxes { animation: none; } }
.otp-boxes input { width: 0; }
.auth-main, .auth-form { min-width: 0; }
@media (max-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr); } }

/* ===================== v8: staff portal sign-in ===================== */
a.am-mobile-brand { text-decoration: none; }
.am-foot a { color: inherit; }
.af-inline { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.af-inline .linkbtn { font-size: 13px; text-decoration: none; }
.af-inline .linkbtn:hover { text-decoration: underline; }
.af-switch { margin: 22px 0 0; text-align: center; font-size: 14px; color: #5b6780; }
.af-switch .linkbtn { font-size: 14px; }

.st-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; }
.st-badge svg { width: 28px; height: 28px; }
.st-badge.pending { color: #a15c00; background: linear-gradient(180deg, #fff6e5, #ffecc9); box-shadow: 0 0 0 6px #fffaf0; }
.st-badge.rejected { color: #c0262f; background: linear-gradient(180deg, #fff1f2, #fde0e2); box-shadow: 0 0 0 6px #fff8f8; }
.st-card { margin: 6px 0 0; padding: 4px 18px; background: #fff; border: 1px solid #e2e9f4; border-radius: 14px; }
.st-card > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #eef2f8; font-size: 14px; }
.st-card > div:last-child { border-bottom: 0; }
.st-card dt { color: #6b7690; }
.st-card dd { margin: 0; color: #0b1e45; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.st-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.st-pill.pending { background: #fff3df; color: #a15c00; }
.st-pill.rejected { background: #fff1f2; color: #c0262f; }
.st-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 22px; }
.af-submit.ghost { margin-top: 0; background: #fff; color: var(--navy); border: 1.5px solid #c9d6ea; box-shadow: none; }
.af-submit.ghost:hover:not(:disabled) { filter: none; background: #f4f7fc; box-shadow: none; }
.af-submit.ghost .spin { border-color: rgba(10,44,107,.2); border-top-color: var(--navy); }
.af-submit.ghost.busy .lbl { opacity: .6; }
.status .af-sub { margin-bottom: 20px; }

/* landing: sign-in aware header + gate note */
.nav-acts { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 10px; color: #fff; margin-right: 4px; }
.nav-user i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.5); }
.nav-user > span { display: flex; flex-direction: column; line-height: 1.2; }
.nav-user small { font-size: 11px; opacity: .75; }
.nav-user b { font-size: 14px; font-weight: 600; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.nav-btn { font-family: var(--font); cursor: pointer; }
.gate-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: 14px; color: #46516b; max-width: 560px; }
.gate-note svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--blue); }
.gate-note a { color: var(--blue); font-weight: 600; }
.st-pill.approved { background: var(--ok-bg); color: var(--ok); }
.sv-card { max-width: 380px; margin: 0 auto; text-align: left; }
@media (max-width: 760px) {
  .nav-user > span { display: none; }
  .nav-user i { width: 32px; height: 32px; }
  .theme .nav-acts .nav-btn.outline:not(.solid) span { display: none; }
  .theme .nav-acts .nav-btn.outline:not(.solid) { padding: 8px; }
  .gate-note { font-size: 13px; }
}

/* admin: tabs + staff accounts */
.dash-tabs { display: flex; gap: 4px; margin: 0 0 22px; border-bottom: 1px solid #dfe6f1; }
.dash-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: -1px; border: 0; border-bottom: 2.5px solid transparent; background: none; font: 600 14.5px var(--font); color: #5b6780; cursor: pointer; }
.dash-tabs button svg { width: 18px; height: 18px; }
.dash-tabs button:hover { color: var(--navy); }
.dash-tabs button.on { color: var(--navy); border-bottom-color: var(--red); }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.stat.rejected div { color: #c0262f; }
.badge.rejected { background: #fff1f2; color: #c0262f; }
.ac-who { display: flex; align-items: center; gap: 12px; }
.ac-who i { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-style: normal; font-weight: 700; color: var(--navy); background: #e6eefb; }
.ac-who .sm { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .dash-tabs { overflow-x: auto; }
  .dash-tabs button { padding: 10px 12px; font-size: 13.5px; white-space: nowrap; }
  table.staff.accounts tr { grid-template-columns: 1fr auto; grid-template-areas: "name status" "d1 d1" "d2 d2" "acts acts"; }
  table.staff.accounts td.c-name { grid-area: name; }
  table.staff.accounts td.c-status { grid-area: status; }
  table.staff.accounts td[data-l="Registered"] { grid-area: d1; }
  table.staff.accounts td[data-l="Form"] { grid-area: d2; }
  table.staff.accounts td.c-acts { grid-area: acts; }
}
.af-back { display: flex; width: fit-content; }
