/* Admin panel styles only. The public verification pages do not use this file. */
:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1d2330;
    --muted: #667085;
    --border: #d9dde3;
    --primary: #1f4fd1;
    --primary-text: #ffffff;
    --danger: #b42318;
    --success-bg: #e8f6ee;
    --success-text: #146c2e;
    --error-bg: #fdecea;
    --error-text: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
a { color: var(--primary); }
code { font-family: ui-monospace, Consolas, monospace; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar .brand { font-weight: 600; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: .75rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 1rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

.btn { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #9aa3b2; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-danger { color: var(--danger); border-color: #f0b4ae; }
.btn-sm { padding: .3rem .65rem; font-size: .875rem; }
.btn-block { display: block; width: 100%; margin-top: 1rem; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: default; }
.inline { display: inline; }
.actions { display: flex; gap: .5rem; align-items: center; }
.actions.wrap { flex-wrap: wrap; }

label { display: block; font-weight: 600; margin: .75rem 0 .3rem; }
input[type=text], input[type=password], input[type=date], input[type=search], select {
    width: 100%; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff;
}
input[type=file] { display: block; margin-top: .25rem; }
.field { margin-bottom: .25rem; }
.has-error input { border-color: var(--danger); }
.error { color: var(--error-text); font-size: .875rem; margin-top: .25rem; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
small { display: block; }

.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

.login-box { max-width: 380px; margin: 4rem auto; }

.type-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.type-option { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--text); }
.type-option:hover { border-color: var(--primary); }

.filters { display: grid; grid-template-columns: 1fr 200px 160px auto; gap: .5rem; align-items: center; }
@media (max-width: 720px) { .filters { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
table.records { width: 100%; border-collapse: collapse; }
table.records th, table.records td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.records th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.records tr:last-child td { border-bottom: 0; }
.empty { padding: 2rem 0; text-align: center; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-archived { background: #fff4e5; color: #9a5b00; }
.badge-deleted { background: var(--error-bg); color: var(--error-text); }

.identity .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: .3rem; }
.url-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.url { word-break: break-all; font-size: .95rem; }

dl.details { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; word-break: break-word; }

img.qr { display: block; width: 220px; height: 220px; margin-bottom: .75rem; image-rendering: pixelated; }
img.card-image { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); margin-bottom: .75rem; }
.signature-preview { display: inline-block; padding: .5rem; margin: .25rem 0 .5rem; border: 1px dashed var(--border);
    background-color: #fff; background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.signature-preview img { display: block; max-width: 320px; max-height: 160px; }

.preset-choice { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.preset-choice legend { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.preset-choice small { flex-basis: 100%; }
.preset-option { margin: 0; font-weight: 600; cursor: pointer; }
.preset-option input { position: absolute; opacity: 0; pointer-events: none; }
.preset-option span { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.preset-option input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.preset-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.preset-option.disabled { cursor: not-allowed; opacity: .5; }
input.from-preset { background: #f0f3f8; color: var(--muted); }

.share-status { margin-top: .5rem; font-size: .9rem; color: var(--muted); }
.nav-active { font-weight: 700; text-decoration: none; }
.dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.dashboard .count { font-size: 2rem; font-weight: 700; }

.danger-zone { margin-top: 1.25rem; padding: 1rem; border: 1px solid #f0b4ae; border-radius: 8px; background: #fffafa; }
.danger-zone input { max-width: 320px; margin: .25rem 0 .75rem; display: block; }

.share-buttons { margin-top: .75rem; }
