:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0f1012;
  --surface: #1b1d21;
  --surface-2: #141518;
  --line: rgba(255, 255, 255, .105);
  --text: #f7f3f1;
  --muted: #a69e9b;
  --dim: #77716f;
  --rose: #e11d48;
  --crimson: #be123c;
  --orange: #f97316;
  --gold: #fbbf24;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 0%, rgba(225, 29, 72, .14), transparent 31rem),
    radial-gradient(circle at 10% 95%, rgba(249, 115, 22, .08), transparent 34rem),
    var(--bg);
}
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 80px; }
header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.admin-brand { display: flex; align-items: center; gap: 18px; }
.admin-brand img { flex: 0 0 auto; border-radius: 16px; filter: drop-shadow(0 12px 28px rgba(225, 29, 72, .25)); }
h1 { margin: 4px 0 8px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.04em; }
h2 { margin: 0 0 6px; font-size: 18px; }
p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--orange); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.subtitle { font-size: 15px; }

.card { border: 1px solid var(--line); border-radius: 18px; background: rgba(27, 29, 33, .94); box-shadow: 0 20px 70px rgba(0, 0, 0, .28); }
.login-card { width: min(520px, 100%); padding: 28px; }
.login-card form { margin-top: 22px; }
label { display: block; margin-bottom: 8px; color: #d8cfcc; font-size: 12px; font-weight: 700; }
.row { display: flex; gap: 10px; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: #101114; color: var(--text); padding: 11px 13px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: rgba(249,115,22,.7); box-shadow: 0 0 0 3px rgba(225,29,72,.12); }
button { border-radius: 10px; background: linear-gradient(115deg, var(--crimson), var(--rose) 56%, var(--orange)); color: #fff8f4; padding: 11px 16px; font-weight: 800; white-space: nowrap; box-shadow: 0 8px 22px rgba(190,18,60,.13); }
button:hover { filter: brightness(1.07); }
button:disabled { cursor: not-allowed; opacity: .5; }
.secondary { background: #292a2f; color: #e1d9d6; box-shadow: none; }
.danger { background: rgba(225, 29, 72, .14); color: #fb8ca3; box-shadow: none; }
.warning { background: rgba(251, 191, 36, .14); color: #ffd86e; box-shadow: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stats article { border: 1px solid var(--line); border-radius: 16px; background: rgba(27, 29, 33, .9); padding: 20px; }
.stats span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stats strong { font-size: 28px; }
.add-card { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 22px; margin-bottom: 14px; }
.add-card form { width: min(520px, 55%); }
.waitlist-card { overflow: hidden; margin-bottom: 14px; }
.task-types-card { overflow: hidden; margin-bottom: 14px; }
.task-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 18px 22px 22px; }
.task-type-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); padding: 15px; }
.task-type-name { color: var(--text); font-size: 13px; font-weight: 750; }
.task-type-card button { padding: 8px 10px; font-size: 10px; }
.proxy-card { overflow: hidden; margin-bottom: 14px; }
.proxy-form { padding: 22px; border-bottom: 1px solid var(--line); }
.proxy-form textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.proxy-form label:not(:first-of-type) { margin-top: 15px; }
.proxy-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.proxy-form-footer > span { color: var(--dim); font-size: 11px; }
.compact-row { flex-direction: row; }
.managed-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 18px 22px 22px; }
.managed-list { border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); padding: 15px; }
.managed-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.managed-list-name { color: var(--text); font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.managed-list .actions { margin-top: 13px; justify-content: flex-start; }
.table-card { overflow: hidden; }
.table-heading { display: flex; justify-content: space-between; align-items: center; padding: 22px; border-bottom: 1px solid var(--line); }
.table-heading p { font-size: 11px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid rgba(255,255,255,.075); text-align: left; vertical-align: middle; }
th { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
td { color: #ddd5d2; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.email { font-weight: 750; color: var(--text); }
.meta { margin-top: 4px; color: var(--dim); font-size: 11px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #292a2f; color: #c8bfbc; font-size: 10px; font-weight: 800; }
.badge.good { background: rgba(249, 115, 22, .13); color: #ffad70; }
.badge.bad { background: rgba(225, 29, 72, .14); color: #fb8ca3; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.actions button { padding: 7px 9px; font-size: 10px; }
.user-task-types { display: grid; gap: 8px; min-width: 165px; }
.user-task-type { display: grid; gap: 4px; }
.user-task-type label { margin: 0; color: var(--muted); font-size: 9px; }
.user-task-type select { padding: 7px 9px; border-radius: 8px; font-size: 10px; }
.empty { padding: 48px; text-align: center; }

.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5, 5, 7, .8); backdrop-filter: blur(8px); }
.modal-card { width: min(460px, 100%); border: 1px solid var(--line); border-radius: 18px; background: #1b1d21; padding: 28px; box-shadow: 0 28px 90px #000; }
.modal-card h2 { margin-top: 6px; font-size: 24px; }
.credential { display: flex; gap: 9px; margin: 22px 0; }
.credential code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; background: #101114; color: #ffad70; padding: 12px; font-size: 14px; line-height: 1.55; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; border: 1px solid var(--line); border-radius: 12px; background: #202126; padding: 13px 16px; box-shadow: 0 16px 50px #000; color: var(--text); font-size: 12px; }
.toast.error { border-color: rgba(225,29,72,.55); color: #ffabbc; }
.hidden { display: none !important; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 30px; }
  header, .add-card { align-items: stretch; flex-direction: column; }
  .admin-brand { align-items: flex-start; }
  .add-card form { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .compact-row { flex-direction: row; }
  .proxy-form-footer { align-items: stretch; flex-direction: column; }
}
