:root { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #17243c; background: #f2f5fa; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.card { width: 100%; max-width: 440px; padding: 36px; background: white; border: 1px solid #e3e8f0; border-radius: 18px; box-shadow: 0 16px 50px #1932530a; }
.brand { font-weight: 800; letter-spacing: .06em; color: #285bd7; margin-bottom: 32px; }
.brand span { color: #718096; font-size: 12px; font-weight: 500; margin-left: 8px; }
h1 { font-size: 28px; margin: 0 0 10px; }
.subtitle { color: #657186; font-size: 14px; line-height: 1.7; margin: 0 0 26px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
input:not([type=hidden]) { display: block; width: 100%; border: 1px solid #cbd4e2; border-radius: 8px; padding: 12px; font: inherit; background: #fff; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #98b5ff; outline-offset: 3px; }
button { display: block; width: 100%; background: #285bd7; color: white; border: 0; border-radius: 8px; padding: 12px 16px; font: inherit; font-weight: 600; cursor: pointer; margin-top: 26px; }
button:hover { background: #204bb4; }
.error, .success { font-size: 14px; padding: 12px; border-radius: 8px; line-height: 1.6; }
.error { background: #fff0f0; color: #a52b2b; }
.success { background: #eaf8ee; color: #236b3c; }
a { color: #285bd7; font-size: 14px; text-underline-offset: 4px; }
.back { display: inline-block; margin-top: 22px; }
.secondary { background: #edf1f8; color: #334563; }
.secondary:hover { background: #dfe7f3; }
.hint { color: #718096; font-size: 12px; margin: 6px 0 0; }
.modules { display: grid; gap: 14px; }
.module { display: block; padding: 20px; border: 1px solid #dce4ef; border-radius: 12px; text-decoration: none; background: #f8faff; }
.module:hover { background: #eef3ff; border-color: #98b5ff; }
.module strong { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }
.module > span { display: block; color: #657186; margin-top: 8px; line-height: 1.6; }
@media (max-width: 480px) { .card { padding: 28px 22px; } }
.wide-card { max-width: 960px; }
.page-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.page-heading > a { white-space: nowrap; }
h2 { font-size: 19px; margin: 0 0 12px; }
.upload-panel { margin-top: 16px; background: #f8faff; padding: 24px; border: 1px solid #dce4ef; border-radius: 12px; }
.upload-panel button { width: auto; }
.upload-status { font-size: 14px; overflow-wrap: anywhere; line-height: 1.7; margin-bottom: 0; }
.upload-success { color: #008f9d; font-size: 14px; }
.upload-success > span:first-child, .upload-failure > span:first-child { font-size: 20px; font-weight: 800; }
.upload-failure { color: #c32b37; }
.file-size, .count { color: #718096; font-size: 13px; font-weight: 400; }
.manual-list { margin-top: 32px; }
.manual-items { display: grid; gap: 16px; }
.manual-item { display: flex; justify-content: space-between; gap: 24px; padding: 22px; border: 1px solid #dce4ef; border-radius: 12px; }
.manual-details { min-width: 0; flex: 1; }
.manual-details h3 { font-size: 17px; margin: 0; overflow-wrap: anywhere; }
.qr-preview { width: 160px; min-height: 160px; flex-shrink: 0; display: grid; place-items: center; color: #718096; background: #f8faff; font-size: 13px; border-radius: 8px; }
.qr-preview img { display: block; width: 160px; height: 160px; }
.row-actions { display: flex; gap: 20px; flex-wrap: wrap; margin: 18px 0; }
button.compact { width: auto; margin-top: 16px; font-size: 14px; padding: 9px 15px; }
button.danger { color: #b42e3b; background: #fff0f1; }
button.danger:hover { background: #ffe0e4; }
button:disabled { opacity: .6; cursor: wait; }
.empty-state { color: #718096; padding: 30px 16px; text-align: center; border: 1px dashed #cbd4e2; border-radius: 12px; }
.viewer-body { display: block; }
.viewer-card { max-width: 1040px; margin: auto; }
.document-name { font-size: 22px; overflow-wrap: anywhere; }
.document-image { display: block; max-width: 100%; height: auto; margin: 24px auto 0; }
.pdf-pages { margin-top: 22px; }
.pdf-page { margin: 0 0 24px; }
.pdf-page figcaption { color: #657186; font-size: 13px; margin: 0 0 8px; }
.pdf-page a { display: block; }
.pdf-page img { display: block; width: 100%; height: auto; background: white; border: 1px solid #e3e8f0; }
.pdf-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 24px; padding: 20px 0; }
.pdf-pagination span { font-size: 14px; color: #657186; }
@media (max-width: 600px) {
  .upload-panel { padding: 18px; }
  .manual-item { flex-direction: column; padding: 18px; }
  .qr-preview { align-self: center; }
}
