/* QR codes, documents & digital cards (also used standalone by the public card page /c/<token>) */

/* ---------------- documents panel */
.docp > header { flex-wrap: wrap; } .docp > header .btn span { margin-inline-start: 2px; }
.docp-drop { border: 1.5px dashed var(--line2); border-radius: 10px; padding: 10px; text-align: center; color: var(--mute); font-size: 13px; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.docp-drop.on { border-color: var(--clay); background: color-mix(in srgb, var(--clay) 10%, transparent); color: var(--ink); }
.docp-list { display: flex; flex-direction: column; gap: 8px; }
.docp-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel2); }
.docp-thumb { width: 64px; height: 64px; border-radius: 14px 14px 6px 6px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--mute); }
.docp-thumb img { width: 100%; height: 100%; object-fit: cover; } .docp-thumb span { display: flex; flex-direction: column; align-items: center; font: 600 9px var(--f-mono); }
.docp-info { min-width: 0; } .docp-info b { display: block; overflow-wrap: anywhere; } .docp-info small { display: block; color: var(--mute); font-size: 12px; overflow-wrap: anywhere; }
.docp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .docp-tags span { font: 500 10.5px var(--f-mono); padding: 1px 7px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 3px; }
.docp-tags .ok { color: var(--ok); } .docp-tags .ico { width: 12px; height: 12px; }
.docp-exp.warn { background: var(--warn-bg) !important; color: var(--warn); border-color: var(--straw) !important; } .docp-exp.bad { background: var(--bad-bg) !important; color: var(--bad); }
.docp-acts { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.docp.compact .docp-row { grid-template-columns: 48px minmax(0, 1fr); } .docp.compact .docp-thumb { width: 48px; height: 48px; } .docp.compact .docp-acts { grid-column: 1 / -1; justify-content: flex-start; }
.docp-new { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; } .docp-new img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.docp-pdf { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 10px; border: 1px solid var(--line); border-radius: 10px; text-align: center; overflow-wrap: anywhere; }
.docp-prev .modal-body img { width: 100%; border-radius: 8px; } .docp-prev iframe { width: 100%; height: 70vh; border: 0; border-radius: 8px; background: #fff; }
.docp-ai input[type=checkbox] { width: auto; } .docp-ai td input:not([type]) { padding: 4px 6px; font-size: 13px; }
.hp-card-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------------- document scanner */
.scn-stage { position: relative; background: #1a1a1a; border-radius: 10px; padding: 8px; display: grid; place-items: center; max-height: 60vh; overflow: hidden; touch-action: none; }
.scn-stage canvas { max-width: 100%; max-height: 56vh; cursor: crosshair; touch-action: none; }
.scn-crop { position: absolute; border: 2px solid var(--clay); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); pointer-events: none; }
.scn-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; } .scn-range { display: flex; align-items: center; gap: 6px; font-size: 13px; } .scn-range input { width: 110px; padding: 0; }

/* ---------------- QR panel */
.qr-card { text-align: center; } .qrp-code svg { width: 150px; height: 150px; }
.qrp-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.qrp-fields { margin-top: 10px; }

/* ---------------- list selection & bulk bar */
.sel-col { width: 34px; } .sel-col input { width: auto; } .tbl tr.sel td { background: color-mix(in srgb, var(--clay) 9%, var(--panel)); }
.tbl tr.is-bin td { opacity: .65; } .tbl tr.is-arch td.strong { color: var(--mute); } .list-thumb { width: 34px; height: 34px; border-radius: 10px 10px 4px 4px; object-fit: cover; }
.bulkbar { position: sticky; top: 58px; z-index: 15; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--green); color: var(--oat); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.bulkbar .btn.ghost { color: var(--oat); border-color: #2B4237; background: transparent; } .bulkbar .btn.ghost:hover { border-color: var(--clay); }
.bulkbar .danger-txt { color: #F2A08C !important; } .bulk-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.list-page .page-head .btn span, .docs-page .btn span { margin-inline-start: 2px; }
.menu-list .list-btn small { font-family: var(--f-head); }
.rec-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--straw-bg); border: 1px solid var(--straw); }
.rec-state span { flex: 1; min-width: 180px; }
.docs-tabs { margin-bottom: 12px; }

/* ---------------- bulk scan */
.sc-bulk { margin-top: 12px; } .sc-bulk > header { flex-wrap: wrap; } .sc-qty { width: 100px; padding: 5px 8px; }
.sc-bulk-acts { margin-top: 10px; } .sc-bulk-acts select { width: auto; }

/* ---------------- digital cards (CR80 ratio 85.6 : 54) */
.dcard { --dc-accent: #E3915E; --dc-ink: #12201A; position: relative; width: 100%; max-width: 440px; aspect-ratio: 85.6 / 54; perspective: 1400px; margin: 0 auto; font-size: clamp(9px, 2.6vw, 12px); color: var(--dc-ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dc-face { position: absolute; inset: 0; border-radius: 1.8em 1.8em .7em .7em; background: #F7F6F1; box-shadow: 0 18px 40px -22px rgba(18, 32, 26, .6); overflow: hidden; display: flex; flex-direction: column; backface-visibility: hidden; transition: transform .55s cubic-bezier(.2, .7, .2, 1); border: 1px solid #E5E2D8; }
.dc-back { transform: rotateY(180deg); } .dcard.flipped .dc-front { transform: rotateY(-180deg); } .dcard.flipped .dc-back { transform: rotateY(0); }
.dcard.can-flip { cursor: pointer; }
.dc-top { display: flex; align-items: center; gap: .6em; background: var(--dc-ink); color: #F3EFE6; padding: .7em 1.1em; border-bottom: .3em solid var(--dc-accent); }
.dc-top svg { width: 1.9em; height: 1.9em; flex: none; } .dc-logo { height: 1.9em; max-width: 6em; object-fit: contain; }
.dc-stable { flex: 1; font: 700 1.15em Rajdhani, sans-serif; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-kind { font: 600 .82em 'IBM Plex Mono', monospace; letter-spacing: .14em; color: var(--dc-accent); white-space: nowrap; }
.dc-body { flex: 1; display: grid; grid-template-columns: 6.8em minmax(0, 1fr) auto; gap: .9em; padding: .9em 1.1em .5em; min-height: 0; }
.dc-photo { width: 6.8em; height: 8.2em; border-radius: 2em 2em .6em .6em; overflow: hidden; background: #E5E2D8; display: grid; place-items: center; }
.dc-photo img { width: 100%; height: 100%; object-fit: cover; } .dc-photo span { font: 700 2.6em Rajdhani, sans-serif; color: var(--dc-ink); }
.dc-main { min-width: 0; } .dc-main h3 { font: 700 1.75em/1 Rajdhani, sans-serif; margin: 0; overflow-wrap: anywhere; } .dc-sub { margin: .25em 0 .5em; font-size: .95em; color: #3E4A42; }
.dcard dl { margin: 0; display: grid; gap: .3em; } .dcard dl div { min-width: 0; } .dcard dt { font: 600 .66em 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: #6E766C; }
.dcard dd { margin: 0; font: 600 1em Rajdhani, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-qr { align-self: start; background: #fff; padding: .3em; border-radius: .4em; } .dc-qr svg { width: 5.4em; height: 5.4em; display: block; }
.dc-qr.big { display: flex; flex-direction: column; align-items: center; gap: .2em; } .dc-qr.big svg { width: 7.6em; height: 7.6em; } .dc-qr small { font: 500 .7em 'IBM Plex Mono', monospace; color: #6E766C; }
.dc-alert { margin: 0 1.1em .4em; background: #FFF3D1; border: 1px solid #E5B83B; color: #6B5200; border-radius: .5em; padding: .25em .6em; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-foot { display: flex; justify-content: space-between; gap: .6em; background: var(--dc-ink); color: #F3EFE6; padding: .45em 1.1em; font: 600 .78em 'IBM Plex Mono', monospace; letter-spacing: .06em; }
.dc-state.valid { color: #B7D3B0; } .dc-state.expired, .dc-state.revoked { color: var(--dc-accent); }
.dc-back-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1em; padding: 1em 1.1em; align-items: center; min-height: 0; }
.dcard.s-revoked .dc-front::after, .dcard.s-expired .dc-front::after { content: attr(data-x); position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(168, 52, 31, .06) 0 10px, transparent 10px 20px); pointer-events: none; }
.dc-wrap { padding: 10px 0; } .dc-hint { text-align: center; color: var(--mute, #6E766C); font-size: 12px; margin: 6px 0; }
.dc-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.dc-issue { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.dc-verify { text-align: center; font: 700 16px Rajdhani, sans-serif; padding: 10px 14px; border-radius: 12px; margin: 0 auto 12px; max-width: 440px; }
.dc-verify.valid { background: #DDEDD8; color: #2E7D4F; } .dc-verify.expired, .dc-verify.revoked, .dc-verify.unknown { background: #F8DED6; color: #A8341F; }
.dc-check .dcard { margin-bottom: 10px; }

/* ---------------- public card page /c/<token> */
body.dc-public { margin: 0; min-height: 100vh; background: #12201A; color: #F3EFE6; font: 500 15px Rajdhani, system-ui, sans-serif; display: grid; place-items: center; padding: 18px; box-sizing: border-box; }
.dc-page { width: min(460px, 100%); } .dc-public .dc-hint { color: #8FA596; }
.dc-public .dc-acts button, .dc-public .dc-acts a { background: #1B2E25; color: #F3EFE6; border: 1px solid #2B4237; border-radius: 10px; padding: 9px 14px; font: 700 14px Rajdhani, sans-serif; cursor: pointer; text-decoration: none; }
.dc-public .dc-acts button:hover, .dc-public .dc-acts a:hover { border-color: #E3915E; }
.dc-staff { display: block; text-align: center; color: #8FA596; font-size: 13px; margin-top: 14px; }

@media (max-width: 760px) {
  .docp-row { grid-template-columns: 52px minmax(0, 1fr); } .docp-thumb { width: 52px; height: 52px; } .docp-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .docp-new { grid-template-columns: 1fr; } .docp-new img { max-height: 40vh; object-fit: contain; }
  .bulkbar { top: 52px; } .bulkbar b { width: 100%; }
  .list-page .page-head .btn span, .docs-page .page-head .btn span { display: none; }
}
@media print { .bulkbar, .docp-acts, .qrp-acts { display: none !important; } }
