.admin { background: #f4f1ec; }
.back-link { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--brand); }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; padding: 4px 20px 14px; }
.tab { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.admin-bar { max-width: 1280px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stats { display: flex; gap: 16px; font-size: 14px; }
.stats b { color: var(--brand-dk); }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.btn-sm.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-sm.danger { color: var(--bad); border-color: #e7c4c4; }
.btn-sm:disabled { opacity: .45; cursor: default; }

/* ── Table (scales to thousands; only the current page renders) ── */
.table-wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; overflow-x: auto; }
table.entries { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.entries thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); white-space: nowrap; }
table.entries tbody td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.entries tbody tr:hover { background: #fbf7ee; }
table.entries tbody tr:last-child td { border-bottom: 0; }

.c-thumb { width: 56px; }
.rthumb { width: 44px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; display: block; background: #efe8dd; }
.rthumb.none { display: grid; place-items: center; color: var(--muted); cursor: default; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); font-weight: 700; white-space: nowrap; }
.nm { font-weight: 600; white-space: nowrap; }
.contact { font-size: 11.5px; color: var(--muted); }
.contact span { display: block; }
.sub { white-space: nowrap; color: var(--muted); font-size: 12px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.pending { background: #f3ede3; color: #8a7c68; }
.badge.approved { background: #e3f1e8; color: var(--ok); }
.badge.void { background: #f7e4e4; color: var(--bad); }
.badge.winner { background: #fbf0d5; color: var(--gold); }
.badge.mail { background: #e6edf7; color: #3a5a8a; margin-left: 4px; }

.c-sel { width: 34px; text-align: center; }
.c-act { min-width: 150px; }
.act-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act { font: inherit; font-size: 14px; font-weight: 700; min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: #fff; }
.act.approve { color: var(--ok); border-color: #bfe0cd; }
.act.approve:hover { background: #e3f1e8; }
.act.void { color: var(--bad); border-color: #e7c4c4; }
.act.void:hover { background: #f7e4e4; }
.act.kebab { color: var(--muted); font-size: 18px; line-height: 1; }
.act.kebab:hover { background: #f1ece3; }
.notified-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.note-ro { cursor: help; font-size: 12px; }

/* Kebab menu (contextual transitions) */
.row-menu { position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(40,25,12,.18); padding: 5px; min-width: 180px; display: flex; flex-direction: column; }
.row-menu button { font: inherit; font-size: 13px; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.row-menu button:hover { background: #f6f1e8; }
.row-menu button.danger { color: var(--bad); }

/* Bulk action bar */
.bulk-bar { position: sticky; top: 8px; z-index: 40; max-width: 1280px; margin: 0 auto 10px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.bulk-count b { font-size: 16px; }
.bulk-actions { display: flex; gap: 8px; }
.btn-sm.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-sm.ghost:hover { background: rgba(255,255,255,.12); }

/* Undo toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 14px 11px 20px; display: flex; align-items: center; gap: 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.toast-undo { font: inherit; font-weight: 700; color: #ffd9a8; background: transparent; border: 0; cursor: pointer; padding: 4px 8px; }
.toast-undo:hover { text-decoration: underline; }

/* Void reason dialog */
dialog#void-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 420px; width: calc(100% - 32px); box-sizing: border-box; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
dialog#void-dialog h3 { margin: 0 0 12px; }
dialog#void-dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
dialog#void-dialog input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; box-sizing: border-box; }
dialog#void-dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 18px 0 0; }
dialog#void-dialog::backdrop { background: rgba(40,30,20,.4); }

/* Reset demo dialog */
dialog#reset-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 440px; width: calc(100% - 32px); box-sizing: border-box; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
dialog#reset-dialog h3 { margin: 0 0 10px; }
dialog#reset-dialog::backdrop { background: rgba(40,30,20,.4); }
dialog#reset-dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 18px 0 0; }
.reset-list { margin: 10px 0; padding: 0; list-style: none; font-size: 13.5px; }
.reset-list li { padding: 5px 0; }
.muted { color: var(--muted); }

/* ── Pager ── */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px; }
.pageinfo { font-size: 13px; color: var(--muted); min-width: 130px; text-align: center; }

.empty { text-align: center; color: var(--muted); padding: 40px; }

/* ── Lightbox ── */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 98vw; max-height: 98vh; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(20, 14, 8, .86); backdrop-filter: blur(2px); }
/* explicit box + object-fit so even a viewBox-only SVG scales up to fill the viewport height */
dialog.lightbox img { width: 94vw; height: 92vh; object-fit: contain; display: block; }
.lightbox-cap { position: fixed; left: 0; right: 0; bottom: 12px; text-align: center; color: #f3e9dd; text-shadow: 0 1px 4px rgba(0,0,0,.7); font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; pointer-events: none; }
.lightbox-close { position: fixed; top: 14px; right: 20px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: rgba(255,255,255,.28); }

/* ── Dialogs (mail-in / draw) ── */
dialog#manual-dialog, dialog#draw-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.2); box-sizing: border-box; }
/* reset the global form styling (styles.css) that would otherwise add a 2nd padding layer */
dialog#manual-dialog form, dialog#draw-dialog form { padding: 0; border: 0; background: transparent; box-shadow: none; }
dialog h3 { margin: 0 0 14px; }
dialog::backdrop { background: rgba(40,30,20,.4); }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-grid input, dialog select, dialog#manual-dialog input, dialog#draw-dialog input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; min-width: 0; box-sizing: border-box; }
.span-2 { grid-column: 1 / -1; }
dialog#manual-dialog label, dialog#draw-dialog label { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 14px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 18px 0 0; }
.dlg-msg { font-size: 13px; font-weight: 600; min-height: 18px; margin: 12px 0 0; }
.dlg-msg.ok { color: var(--ok); } .dlg-msg.err { color: var(--bad); }
.dlg-warn { background: #fff3cd; border: 1px solid #f0d98a; color: #8a6d00; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.draw-preview { list-style: decimal; margin: 8px 0 0; padding-left: 26px; max-height: 240px; overflow-y: auto; font-size: 13px; }
.draw-preview li { padding: 3px 0; }
.draw-preview .rno { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.draw-preview b { color: var(--gold); }
