@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #132334;
  --muted: #708092;
  --faint: #9aa8b6;
  --line: #e6ecf0;
  --panel: #fff;
  --canvas: #f5f8fa;
  --navy: #0d1b2a;
  --teal: #0b8f84;
  --teal-dark: #08736a;
  --teal-pale: #e4f5f2;
  --orange: #f4a45b;
  --red: #dc6262;
  --shadow: 0 14px 36px rgba(13, 27, 42, .08);
  font-family: 'Manrope','Noto Sans SC',system-ui,sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.mono { font-family: 'DM Mono', monospace; letter-spacing: .02em; }
.icon { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; }
.hidden { display: none !important; }

/* Shared UI */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 700; transition: .2s ease; }
.btn-primary { background: var(--teal); color: white; box-shadow: 0 7px 16px rgba(11,143,132,.2); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--navy); color: white; }
.btn-secondary:hover { background: #1b3349; }
.btn-quiet { color: var(--muted); background: transparent; }
.btn-quiet:hover { color: var(--ink); background: #eef3f6; }
.btn-outline { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn-outline:hover { border-color: #b9cad3; background: #f7fafb; }
.btn-danger { color: var(--red); background: #fff2f2; }
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 12px; }
.field { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfdfe; outline: 0; transition: .2s; }
.field:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,143,132,.12); }
.label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.green { background: #e4f6f0; color: #118167; }
.tag.amber { background: #fff3df; color: #b87515; }
.tag.gray { background: #eef2f4; color: #697b89; }
.tag.red { background: #fff0f0; color: #c85454; }
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 13px; animation: rise .25s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes rise { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
.spinner { width: 18px; height: 18px; border: 2px solid #ccebe7; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }

/* User experience */
.user-shell { min-height: 100vh; display: flex; flex-direction: column; }
.user-header { height: 76px; display: flex; align-items: center; border-bottom: 1px solid rgba(230,236,240,.8); background: rgba(255,255,255,.85); backdrop-filter: blur(12px); }
.header-inner { width: min(1060px, calc(100% - 40px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--navy); }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
.header-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.code-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; color: var(--teal-dark); background: var(--teal-pale); border-radius: 8px; font-size: 12px; font-weight: 700; }
.user-main { flex: 1; width: min(1060px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 72px; }
.hero { display: grid; grid-template-columns: 1fr 330px; gap: 34px; align-items: center; margin-bottom: 42px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 13px 0 13px; font-size: clamp(30px, 5vw, 52px); line-height: 1.12; letter-spacing: -.04em; }
.hero p { max-width: 560px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-orbit { position: relative; height: 236px; overflow: hidden; border-radius: 24px; background: var(--navy); }
.hero-orbit::before { content: ''; position: absolute; width: 230px; height: 230px; top: -75px; right: -36px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; box-shadow: 0 0 0 27px rgba(255,255,255,.05), 0 0 0 55px rgba(255,255,255,.03); }
.hero-orbit::after { content: ''; position: absolute; width: 9px; height: 9px; top: 48px; right: 104px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 8px rgba(244,164,91,.13); }
.orbit-copy { position: absolute; inset: auto 26px 24px; color: #fff; }
.orbit-copy strong { display: block; font-size: 28px; letter-spacing: -.03em; }
.orbit-copy span { color: #b9c6d1; font-size: 12px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.step { position: relative; display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.step.active { border-color: #9dd8d1; background: #f0fbf9; }
.step.done { border-color: #c3ece4; background: #f8fdfc; }
.step-num { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: #eef2f4; font-size: 12px; font-weight: 800; }
.step.active .step-num { color: white; background: var(--teal); }
.step.done .step-num { color: var(--teal-dark); background: var(--teal-pale); }
.step-text b { display: block; font-size: 13px; }
.step-text span { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; }
.workflow { max-width: 760px; margin: 0 auto; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 28px 0; }
.card-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.card-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.card-body { padding: 25px 28px 28px; }
.verify-layout { display: grid; grid-template-columns: 190px 1fr; gap: 27px; align-items: center; }
.qr-box { width: 190px; height: 190px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fcfefe; }
.qr-grid { display: grid; grid-template-columns: repeat(11, 10px); gap: 3px; padding: 13px; background: #fff; border: 1px solid #dbe5e9; }
.qr-cell { width: 10px; height: 10px; background: #142735; }
.qr-cell.off { background: transparent; }
.verify-copy h3 { margin: 0 0 9px; font-size: 16px; }
.verify-copy p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.verify-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.tiny-note { margin-top: 14px; color: var(--faint); font-size: 11px; }
.requirements { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 24px; }
.requirement { display: flex; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfe; }
.requirement-mark { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--teal-dark); background: var(--teal-pale); font-size: 13px; font-weight: 800; }
.requirement b { display: block; margin-bottom: 3px; font-size: 13px; }
.requirement span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.upload-zone { position: relative; display: grid; place-items: center; min-height: 260px; padding: 30px; border: 1.5px dashed #afd9d3; border-radius: 16px; background: #f4fbfa; text-align: center; transition: .2s; }
.upload-zone:hover { border-color: var(--teal); background: #eff9f7; }
.upload-icon { width: 49px; height: 49px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 15px; color: var(--teal-dark); background: var(--teal-pale); }
.upload-zone strong { font-size: 15px; }
.upload-zone span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.qr-scan-box { max-width: 620px; margin: 0 auto; padding: 34px 20px 28px; border: 1px solid #dbe9e7; border-radius: 16px; background: #f8fcfb; text-align: center; }
.qr-scan-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 16px; color: var(--teal-dark); background: var(--teal-pale); }
.qr-scan-icon .icon { width: 27px; height: 27px; }
.qr-scan-box h3 { margin: 0; font-size: 17px; }
.scan-help { max-width: 470px; margin: 9px auto 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.qr-video { display: block; width: min(100%, 360px); aspect-ratio: 4 / 3; margin: 18px auto 0; border-radius: 14px; background: #101a1a; object-fit: cover; }
.error-text { color: var(--red) !important; }
.preview-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; }
.photo-preview { width: 180px; height: 224px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: #eef3f5; }
.preview-meta h3 { margin: 0 0 8px; font-size: 16px; }
.preview-meta p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.progress-box { padding: 17px; border-radius: 13px; background: #f7fafb; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e7eef0; }
.progress-value { height: 100%; border-radius: inherit; background: var(--teal); transition: width .3s ease; }
.status-list { display: flex; flex-direction: column; gap: 0; margin: 4px 0 24px; }
.status-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #d7e2e5; }
.status-row.done .status-dot { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-pale); }
.status-row.active .status-dot { background: var(--orange); box-shadow: 0 0 0 4px #fff0dc; }
.status-row b { font-size: 13px; }
.status-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.result-photo { display: block; width: min(250px, 100%); height: 310px; object-fit: cover; margin: 0 auto 20px; border: 1px solid var(--line); border-radius: 14px; background: #eef3f5; }
.success-banner { margin-bottom: 20px; padding: 15px 16px; border-radius: 12px; color: #136f5e; background: #e9f8f2; font-size: 13px; line-height: 1.6; }
.footer-note { margin-top: 20px; text-align: center; color: var(--faint); font-size: 11px; }

/* Admin */
.admin-shell { min-height: 100vh; display: flex; background: var(--canvas); }
.admin-side { width: 242px; display: flex; flex-direction: column; padding: 24px 15px; border-right: 1px solid #dce6eb; background: var(--navy); color: #fff; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 11px; margin-bottom: 36px; }
.admin-brand .brand-mark { background: var(--teal); }
.admin-brand small { display: block; margin-top: 3px; color: #94a9b8; font-size: 10px; }
.admin-nav { display: flex; flex-direction: column; gap: 5px; }
.admin-nav button { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 9px; color: #9db0bd; background: transparent; text-align: left; font-weight: 600; font-size: 13px; }
.admin-nav button:hover, .admin-nav button.active { color: #fff; background: rgba(255,255,255,.1); }
.admin-side-bottom { margin-top: auto; padding: 13px 12px; border-top: 1px solid rgba(255,255,255,.12); color: #91a5b3; font-size: 11px; line-height: 1.6; }
.admin-content { flex: 1; min-width: 0; }
.admin-top { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 35px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); }
.admin-top h1 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.admin-top p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.admin-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-size: 12px; font-weight: 800; }
.admin-main { max-width: 1300px; margin: 0 auto; padding: 32px 35px 60px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { padding: 19px 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 9px; font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.stat-foot { margin-top: 6px; color: var(--teal); font-size: 11px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.toolbar h2 { margin: 0; font-size: 17px; }
.toolbar-actions { display: flex; gap: 9px; }
.search { position: relative; width: 220px; }
.search .field { padding-left: 35px; min-height: 38px; font-size: 12px; }
.search .icon { position: absolute; top: 10px; left: 11px; color: var(--faint); }
.table-panel { overflow: hidden; }
.table-head, .table-row { display: grid; grid-template-columns: 1.15fr .75fr .75fr .8fr .8fr auto; gap: 14px; align-items: center; padding: 15px 19px; }
.table-head { color: var(--muted); background: #f8fafb; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.table-row { min-height: 64px; border-bottom: 1px solid var(--line); font-size: 12px; }
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: #fbfdfd; }
.code-text { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.empty { padding: 50px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.events-list { overflow: hidden; }
.event-row { display: grid; grid-template-columns: 1fr .9fr .8fr 1.3fr auto; gap: 15px; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.event-row:last-child { border-bottom: 0; }
.event-time { color: var(--muted); font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(13,27,42,.5); backdrop-filter: blur(4px); }
.modal { width: min(460px, 100%); border-radius: 16px; background: #fff; box-shadow: 0 22px 60px rgba(13,27,42,.22); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 22px 23px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 23px; border-top: 1px solid var(--line); }
.number-picker { display: flex; align-items: center; gap: 10px; }
.number-picker .field { width: 90px; text-align: center; }
.stepper { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }

@media (max-width: 800px) {
  .header-inner, .user-main { width: min(100% - 28px, 620px); }
  .user-header { height: 66px; }
  .hero { grid-template-columns: 1fr; gap: 22px; margin-bottom: 29px; }
  .hero-orbit { height: 155px; }
  .hero h1 { font-size: 35px; }
  .steps { gap: 5px; }
  .step { min-height: 54px; padding: 9px; gap: 7px; }
  .step-text span { display: none; }
  .card-head, .card-body { padding-left: 19px; padding-right: 19px; }
  .verify-layout { grid-template-columns: 1fr; }
  .qr-box { width: 158px; height: 158px; margin: 0 auto; }
  .qr-grid { transform: scale(.78); }
  .requirements { grid-template-columns: 1fr; }
  .preview-wrap { grid-template-columns: 130px 1fr; gap: 14px; }
  .photo-preview { width: 130px; height: 165px; }
  .admin-side { width: 70px; padding: 20px 10px; }
  .admin-brand .brand-name, .admin-brand small, .admin-nav span, .admin-side-bottom { display: none; }
  .admin-brand { justify-content: center; padding: 0; margin-bottom: 30px; }
  .admin-nav button { justify-content: center; padding: 12px 0; }
  .admin-top { padding: 0 20px; }
  .admin-main { padding: 23px 20px 50px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .table-panel { overflow-x: auto; }
  .table-head, .table-row { min-width: 760px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .search { flex: 1; width: auto; }
  .event-row { grid-template-columns: 1fr .8fr .8fr; min-width: 620px; }
}
@media (max-width: 480px) {
  .header-meta .code-chip { display: none; }
  .user-main { padding-top: 31px; }
  .hero h1 { font-size: 31px; }
  .card-head { padding-top: 21px; }
  .card-body { padding-top: 19px; }
  .preview-wrap { grid-template-columns: 1fr; }
  .photo-preview { width: 145px; height: 180px; }
  .admin-top h1 { font-size: 17px; }
  .admin-user span { display: none; }
}
