/* Admin panel styles. Black and white, RTL, responsive. No external fonts or scripts. */
:root { --fg: #111; --bg: #f5f5f5; --card: #fff; --muted: #555; --line: #ddd; --ok: #1e7b34; --bad: #b3261e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --fg: #f2f2f2; --bg: #0b0b0b; --card: #161616; --muted: #a8a8a8; --line: #2c2c2c; }
}
:root[data-theme="dark"] { --fg: #f2f2f2; --bg: #0b0b0b; --card: #161616; --muted: #a8a8a8; --line: #2c2c2c; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); font-family: system-ui, Tahoma, sans-serif; line-height: 1.7; font-size: 16px; overflow-wrap: anywhere; }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top nav a { color: var(--fg); margin-inline-start: 12px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card.narrow { max-width: 420px; margin: 40px auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat span { display: block; color: var(--muted); font-size: 14px; }
.stat strong { font-size: 28px; }
label { display: block; margin: 12px 0; font-size: 15px; }
input { display: block; width: 100%; margin-top: 6px; padding: 10px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
button { min-height: 44px; padding: 10px 18px; font: inherit; font-weight: 600; color: var(--bg); background: var(--fg); border: 0; border-radius: 8px; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #777; outline-offset: 2px; }
.inline { display: inline; }
.error, .error-list { color: var(--bad); }
.notice { color: var(--ok); font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
code { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 480px) { .wrap { padding: 12px; } .card.narrow { margin: 16px auto; } }

/* Status column: keep labels on one line. */
th.status, td.status { white-space: nowrap; min-width: 96px; }

/* Requirements table: stacked label/value rows on narrow screens. */
@media (max-width: 480px) {
  table.req, table.req tbody, table.req tr, table.req td { display: block; width: 100%; }
  table.req thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.req tr { border-bottom: 1px solid var(--line); padding-block: 8px; }
  table.req td { border-bottom: 0; padding: 4px 0; }
  table.req td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
  table.req td.status { white-space: normal; min-width: 0; }
}

/* Account and two-factor pages. */
.stack { display: grid; gap: 12px; max-width: 420px; margin-block: 12px; }
.muted { color: var(--muted); overflow-wrap: anywhere; font-size: 13px; }
.secret { font-size: 18px; letter-spacing: 1px; overflow-wrap: anywhere; }
.codes { list-style: none; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.codes code { font-size: 16px; }
button.danger { background: var(--bad); border-color: var(--bad); }
details { margin-block: 12px; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }

.stack-wide { display: grid; gap: 14px; margin-block: 12px; }
.stack-wide textarea, .stack-wide select, .stack-wide input { max-width: 100%; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: 22px; height: 22px; }
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--fg); border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 700; }
.panel-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.panel-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
textarea, select { display: block; width: 100%; margin-top: 6px; padding: 10px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
