:root {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #0f172a;
  background: #f8fafc;
  font-synthesis: none;
  --muted: #64748b;
  --border: #e2e8f0;
  --blue: #1d4ed8;
  --blue-hover: #1e40af;
  --pale-blue: #eff6ff;
}
* { box-sizing: border-box; }
body { min-height: 100dvh; margin: 0; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.shell { width: min(100% - 32px, 1040px); margin-inline: auto; }
.top { background: #ffffff; border-bottom: 1px solid var(--border); }
.top-inner { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 9px; align-items: center; color: inherit; text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: -.02em; }
.brand-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 16px; }
.nav-link { color: #334155; font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border); background: #fff; transition: background .15s ease; }
.nav-link:hover { background: #f1f5f9; }
.nav-link span { margin-inline-start: 2px; }
.stage { flex: 1; display: grid; place-items: center; padding-block: clamp(24px, 5vw, 52px); }
.panel { width: min(100%, 480px); padding: clamp(22px, 5vw, 32px); border-radius: 18px; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px #0f172a0a, 0 12px 32px #0f172a08; overflow-wrap: anywhere; }
.panel h1 { margin: 14px 0 6px; font-size: clamp(22px, 4.5vw, 26px); font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--blue); background: var(--pale-blue); font-size: 19px; font-weight: 650; }
.mark.success { background: #ecfdf5; color: #047857; }
.card-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; font-weight: 600; color: #0f172a; background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 13px; color: #1e293b; margin-bottom: 6px; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select { width: 100%; min-width: 0; min-height: 44px; font-size: 14px; border-radius: 10px; border: 1px solid #cbd5e1; padding: 9px 12px; color: inherit; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
input:not([type=checkbox]):focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #1d4ed81f; }
input::placeholder { color: #94a3b8; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.phone { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
.hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); display: block; margin-top: 6px; }
.password, .search { position: relative; }
.password input:not([type=checkbox]) { padding-right: 72px; }
.reveal { position: absolute; right: 6px; top: 5px; height: 34px; border: 0; padding-inline: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.reveal:hover { color: #0f172a; background: #f1f5f9; }
.demo-notice { color: #854d0e; background: #fefce8; border: 1px solid #fef08a; border-radius: 9px; padding: 8px 12px; font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; width: 100%; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s ease; }
.button:hover:not(:disabled) { background: var(--blue-hover); }
.button:disabled { color: #94a3b8; background: #f1f5f9; cursor: default; }
.secondary { color: #1e293b; background: #f1f5f9; border-color: var(--border); }
.secondary:hover:not(:disabled) { background: #e2e8f0; }
.danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.danger:hover:not(:disabled) { background: #fee2e2; }
.notice { margin: 14px 0 0; font-size: 13.5px; }
.notice:empty { display: none; }
.notice.error { color: #b91c1c; }
.notice.ok { color: #047857; }
.inset { margin: 18px 0; padding: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; }
.inset h2, .reset h2 { font-size: 14.5px; font-weight: 650; margin: 0 0 6px; color: #0f172a; }
.inset p, .reset p { font-size: 13.5px; margin-bottom: 10px; }
.inset p:last-child, .reset p:last-child { margin-bottom: 0; }
.copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.copy .button { width: auto; padding-inline: 12px; white-space: nowrap; }
.confirm { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px; cursor: pointer; font-size: 13.5px; }
.confirm input { width: 16px; height: 16px; margin: 2px 0; accent-color: var(--blue); flex: none; }
.reset { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
video { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; background: #0f172a; margin-bottom: 12px; }
.file { width: 100%; margin-block: 4px 11px; font-size: 13px; }
.scan-actions { display: grid; gap: 8px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-block: 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.footer div { display: flex; gap: 16px; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: #0f172a; }
@media (max-width: 370px) {
  .shell { width: calc(100% - 24px); }
  .copy { grid-template-columns: 1fr; }
}

.admin-inventory { margin-top: 20px; }
.admin-inventory h2 { margin: 0 0 8px; font-size: 14.5px; font-weight: 650; color: #0f172a; }
.admin-inventory ul { margin: 0; padding: 0; list-style: none; }
.admin-inventory li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-block: 10px; font-size: 13.5px; }
.admin-inventory li .button { width: auto; min-height: 34px; padding: 4px 11px; font-size: 12.5px; }
.admin-logout { margin-top: 14px; }
#qr-preview:empty { display: none; }
#qr-preview { margin-block: 12px; display: grid; gap: 10px; }
#qr-preview img { width: min(100%, 180px); display: block; margin: 0 auto 8px; }
.field .copy { margin-bottom: 8px; }
.dest-preview { font-size: 12.5px; line-height: 1.45; padding: 8px 11px; border-radius: 8px; margin-bottom: 8px; }
.dest-preview.review { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.dest-preview.maps { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.dest-preview.invalid { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.dest-preview a { font-weight: 650; white-space: nowrap; }
.guide { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.guide summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.guide ol { margin: 8px 0 8px 18px; padding: 0; display: grid; gap: 4px; }
.admin-card-info { display: grid; gap: 2px; min-width: 0; }
.admin-card-info strong { font-size: 13.5px; font-weight: 600; }
.admin-card-info small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.admin-card-meta { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.admin-card-meta p { margin-bottom: 4px; font-size: 13px; color: #334155; }
.card-designer { margin-bottom: 4px; }
.card-designer h3 { margin: 0 0 10px; font-size: 14px; font-weight: 650; color: #0f172a; }
.designer-controls { display: grid; gap: 10px; margin-bottom: 12px; }
.designer-controls .field { margin-bottom: 0; }
.idcard-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.idcard-sheet { margin: 0; }
.idcard-sheet figcaption { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.idcard-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 4px 14px #0f172a12; background: #fff; max-width: 100%; }
.idcard-frame[data-mode=vertical] { max-width: 240px; margin-inline: auto; }
.idcard-frame[data-mode=square] { max-width: 300px; margin-inline: auto; }
.idcard-frame svg { display: block; width: 100%; height: auto; }
.designer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.designer-actions #print-idcard { grid-column: 1 / -1; }
@media (max-width: 420px) { .designer-actions { grid-template-columns: 1fr; } }
@media print {
  body { background: #fff; }
  .top, .footer, .panel > :not(#card-assets), #card-assets > :not(#qr-preview), #qr-preview > :not(.card-designer),
  .card-designer > :not(#idcard-grid), .idcard-sheet figcaption { display: none !important; }
  .shell, .stage, .panel, .inset, #qr-preview, .card-designer, .idcard-grid { width: auto; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; display: block; }
  .idcard-frame { border: 0; border-radius: 0; box-shadow: none; max-width: none; }
  .idcard-frame svg { width: 100%; height: auto; }
}
