/* Anees Admin — utilitarian control room in the app's warm palette. */
:root {
  --bg: #F6EFEA; --panel: #FFFFFF; --panel2: #F3ECE7; --line: #E8DCD4; --fg: #2A2024; --muted: #8E7E75;
  --faint: #B4A49B; --brand: #F0654C; --brand2: #FF9B6A; --on-brand: #FFF6F1; --ok: #2E9E6E; --warn: #B87A2E;
  --bad: #D9434A; --info: #3D7BD9;
  --shadow: 0 2px 10px -4px rgba(74, 40, 30, .25);
  --f: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120D10; --panel: #1E171B; --panel2: #2A2025; --line: #33282E; --fg: #F6EEEA; --muted: #A08E86;
    --faint: #6F5F58; --brand: #FF7D63; --brand2: #FFA97A; --on-brand: #20100C; --ok: #43C98A; --warn: #E0A75C;
    --bad: #FF6B6E; --info: #7FA8F0; --shadow: 0 2px 12px -4px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.mark { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: grid; place-items: center; color: var(--on-brand); font-weight: 800; }
.login h1 { margin: 4px 0 0; font-size: 22px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=search] { width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--fg); }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: var(--on-brand); }
.btn.ghost { background: var(--panel2); color: var(--fg); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.ok-text { color: var(--ok); font-size: 13px; }

/* shell */
header.top { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); }
.top .row { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand .mark { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
nav.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; white-space: nowrap; }
nav.tabs button.on { background: var(--panel2); color: var(--fg); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand);
  color: var(--on-brand); font-size: 12px; font-weight: 700; text-align: center; margin-inline-start: 6px; }
main { max-width: 1100px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head h2 { margin: 0; font-size: 20px; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }

/* code requests */
.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.card.waiting { border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.req { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.req .who { min-width: 0; }
.req .phone { font-size: 17px; font-weight: 700; }
.req .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.chip { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--muted); }
.chip.waiting { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.chip.used { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.chip.locked { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chip.signup { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.reveal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px;
  margin-top: 4px; border-top: 1px dashed var(--line); }
.code { font: 700 28px/1 var(--mono); letter-spacing: .18em; padding: 6px 12px; border-radius: 12px; background: var(--panel2); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 16px; }

/* accounts */
.search { max-width: 380px; flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.acct { cursor: pointer; text-align: start; width: 100%; color: inherit; }
.acct .name { font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.detail { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
.scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
form.pw { max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 560px) {
  .req { grid-template-columns: 1fr; }
  .brand span:last-child { display: none; }
}
@media (prefers-reduced-motion: no-preference) { .card { transition: border-color .2s; } }
