/* The admin console only (docs/customer-support.md §6.4) — after ../app.css (the "Silver Night" system), ../support.css
   (form card, conversation, composer) and console.css (design/components/admin.css as tools/web/sync-design.mjs copies
   it: the console's top bar, segmented tabs, dense tables, key-value lists). This file seats web/views/admin.js markup on
   those pieces. Dense, flat, no motion; Korean text never under 12px (12px only inside .dtable). */

/* ───────── Top bar: mark + 「관리」, the two pages, who is signed in, session time, log out ───────── */
.adm-top { padding: 10px clamp(16px, 2.4vw, 28px); }
.adm-top:empty { display: none; }                 /* the login page has no bar */
.adm-top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; width: min(100%, 1400px); margin-inline: auto; }
.admin-brand { gap: 8px; margin-right: var(--s-2); }
.admin-brand .brand-mark { width: 26px; height: 26px; }
.admin-brand .brand-word { font-size: 1.125rem; }
.admin-brand .adm-tag { margin-left: 2px; font: 600 var(--fs-ko-min)/1 var(--font-body); letter-spacing: 0; text-transform: none; }
.adm-links { display: flex; flex-wrap: wrap; gap: 2px; }
.adm-links a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--fg-2); font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.adm-links a:hover { background: var(--night-3); color: var(--fg); }
.admin-who { font-size: .875rem; font-weight: 700; color: var(--fg); }
.session-left { font-variant-numeric: tabular-nums; }

/* ───────── Page body ───────── */
.admin-wrap { width: min(100%, 1456px); margin-inline: auto; align-content: start; grid-template-columns: minmax(0, 1fr); }
.admin-wrap.admin-narrow { width: min(100% - 32px, 460px); padding: 72px 0 56px; }
.admin-section {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px;
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.admin-section h1 { font-size: 2rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.admin-section h2 { font-size: 1rem; }
.admin-section > .btn, .admin-section > a.btn { align-self: flex-start; }
.admin-login { align-items: stretch; gap: var(--s-4); padding: clamp(24px, 4vw, 36px); border-radius: var(--r-xs);
  background: var(--surface) linear-gradient(180deg, var(--surface-sheen), transparent 45%); border-color: var(--surface-edge); box-shadow: var(--shadow-surface); }
.admin-login h1 { font-size: 2rem; }
.admin-login > .btn { align-self: flex-start; }

.admin-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.admin-search input {
  flex: 1 1 320px; height: 42px; padding: 0 12px; border: 1px solid var(--ctl); border-radius: var(--r-sm);
  background: var(--night-3); color: var(--fg); font: 500 .875rem var(--font-mono);
}
.admin-search input::placeholder { color: var(--fg-3); opacity: 1; }
.admin-search input:hover { border-color: var(--ctl-hover); }
.admin-search input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgb(156 196 255 / .2); border-radius: var(--r-sm); }
.admin-search .small { flex-basis: 100%; font-size: var(--fs-ko-min); }
.admin-search .small.err { color: var(--no); font-weight: 600; }

.seg { align-self: flex-start; flex-wrap: wrap; }
.seg a[aria-current="page"] { background: var(--silver); color: var(--night-1); }
.seg a:not([aria-current]):hover { background: var(--night-3); color: var(--fg); }

/* ───────── Tables (.dtable from console.css) ───────── */
.admin-table-box { border: 1px solid var(--line); border-radius: var(--r-sm); }
/* Cells keep their words whole (review finding 17: "anywhere" let a cell shrink to one letter, so 'active' became
   'activ/e' and a 390px screen showed columns of single letters). Ids, states, times and amounts never wrap; free text
   (subjects, names, bug notes) wraps between words. A table wider than its box scrolls inside .admin-table-box. */
.admin-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td.cell-wrap, .admin-table td.subject { white-space: normal; word-break: keep-all; overflow-wrap: break-word; max-width: 36em; }
.admin-table td.subject { min-width: 16em; }
.admin-table td a:not(.btn) { color: var(--fg); text-decoration-color: var(--line-3); }
.admin-section code { font-family: var(--font-mono); font-size: .8125rem; overflow-wrap: anywhere; }
.admin-table code { font-size: .75rem; overflow-wrap: normal; }
.admin-table tr.warn td { background: rgb(232 194 122 / .08); color: var(--warn); }
.admin-table tr.mark td { background: var(--night-4); color: var(--fg); }
.admin-table tr.mark td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.admin-table .cell-text { white-space: pre-wrap; }
.admin-table .links a + a { margin-left: 6px; }

.admin-notice { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: .875rem; line-height: 1.6; }
.admin-notice.err { border-color: rgb(255 138 128 / .55); background: rgb(255 138 128 / .06); color: var(--no); font-weight: 600; }
.admin-notice.warn { border-color: rgb(232 194 122 / .55); background: rgb(232 194 122 / .06); color: var(--warn); font-weight: 600; }
.ref-warn { display: block; margin-top: 6px; color: var(--warn); font-weight: 600; }

/* ───────── One ticket: the conversation beside the user summary ───────── */
.admin-ticket { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.admin-side { position: sticky; top: 76px; }
.admin-ticket .facts, .admin-side .facts { font-size: .875rem; }
.admin-ticket .reply textarea { min-height: 140px; }
.admin-user { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.paddle-email { font-family: var(--font-mono); font-size: .875rem; color: var(--ok); overflow-wrap: anywhere; }
.paddle-email.err { color: var(--no); font-family: inherit; }

@media (max-width: 960px) {
  .admin-ticket { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; }
}
@media (max-width: 760px) {
  .adm-top .spacer { flex-basis: 100%; }
  .admin-section { padding: 16px; }
}

/* 2단계 인증 (/admin/security.html): numbered steps, the key and the code field spaced like the rest of the console */
.admin-totp ol { margin: 0 0 16px; padding-left: 1.4em; list-style: decimal; line-height: 1.7; }
.admin-totp-form { display: grid; gap: 12px; justify-items: start; margin-top: 4px; }
.admin-totp-form .field { display: grid; gap: 6px; }
.admin-totp-qr { display: block; width: 240px; height: 240px; padding: 12px; border-radius: var(--r-sm); background: #fff; image-rendering: pixelated; }
