:root {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-raised: #18233c;
  --field: #0d1426;
  --border: #283756;
  --border-strong: #40557d;
  --text: #f4f7ff;
  --text-muted: #aab7d1;
  --text-faint: #7583a1;
  --accent: #7699ff;
  --accent-hover: #91adff;
  --accent-ink: #101a38;
  --success: #52d4a0;
  --warning: #f3bb64;
  --danger: #fb7c89;
  --info: #79b9ff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-width: 320px;
  margin: 0;
  background: radial-gradient(900px 480px at 50% -180px, #263c73 0%, var(--bg) 67%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
::selection { background: #718cff; color: #fff; }
:focus-visible { outline: 3px solid #9bb1ff; outline-offset: 3px; }

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.app-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.brand { display: flex; gap: 13px; align-items: center; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #6d8ef8; box-shadow: 0 8px 18px rgb(1 5 17 / .28); }
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: white; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { margin: 0; font-size: 1.15rem; line-height: 1.15; letter-spacing: -.025em; }
.brand-context { margin: 3px 0 0; color: var(--text-muted); font-size: .84rem; }
.page-title { margin: 20px 0 7px; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.045em; line-height: 1.08; }
.page-intro { max-width: 67ch; margin: 0; color: var(--text-muted); }
.header-actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.section { margin-bottom: 18px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.02em; }
.section-description, .muted { color: var(--text-muted); font-size: .9rem; }
.section-description { margin: 5px 0 0; }
.field { margin-bottom: 16px; }
label { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: .84rem; font-weight: 650; }
input, select {
  width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--field); color: var(--text); font: inherit; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
input::placeholder { color: var(--text-faint); }
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgb(118 153 255 / .17); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-group label { display: flex; gap: 7px; align-items: center; margin: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--field); color: var(--text-muted); font-size: .84rem; cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.checkbox-group label:has(input:checked) { border-color: #617ff0; background: #172552; color: #f4f7ff; }
.checkbox-group input { accent-color: var(--accent); width: 15px; min-height: auto; margin: 0; }
button { min-height: 40px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; background: var(--surface-raised); color: var(--text); cursor: pointer; font: inherit; font-size: .88rem; font-weight: 720; transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease; }
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: var(--accent-hover); }
.secondary { border-color: var(--border); background: var(--surface-raised); }
.secondary:hover { border-color: var(--border-strong); background: #202d4a; }
.linkbox { padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); color: #aabfff; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .79rem; }
.status, .result { padding: 12px 13px; border-radius: 10px; font-size: .9rem; }
.status { margin-bottom: 18px; border: 1px solid #385075; background: #142039; color: #bed4ff; }
.result { display: none; margin-top: 12px; }
.result.ok { display: block; border: 1px solid #247357; background: #102b25; color: #91ebc4; }
.result.err, .error { color: #ffadb4; }
.result.err { display: block; border: 1px solid #843846; background: #35141b; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { min-height: 104px; padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); }
.num { color: var(--text); font-size: 1.8rem; font-weight: 760; letter-spacing: -.045em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .muted { display: block; margin-top: 7px; font-size: .82rem; }
.table-wrap { overflow-x: auto; padding: 8px; border: 1px solid var(--border); border-radius: 11px; }
table { width: 100%; min-width: 720px; border-collapse: collapse; background: var(--field); }
th, td { padding: 12px 14px; border-bottom: 1px solid #22304b; text-align: left; font-size: .84rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #141e35; }
th { color: var(--text-faint); font-size: .7rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
td { color: #d8e0f4; }
.status-pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: .74rem; font-weight: 720; white-space: nowrap; }
.status-completed { background: #12392d; color: #80e7bb; }
.status-processing { background: #17335a; color: #8fc6ff; }
.status-pending { background: #463315; color: #ffd181; }
.status-failed { background: #4a1821; color: #ffacb5; }
.table-actions { display: flex; gap: 7px; }
.table-actions button { min-height: 32px; padding: 5px 9px; font-size: .77rem; }

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1120px); padding-top: 26px; }
  .app-header { display: block; }
  .header-actions { margin-top: 20px; }
  .page-title { margin-top: 25px; }
  .section { padding: 17px; }
  .row, .stats { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading .actions { margin-top: 14px; }
}
@media (max-width: 430px) {
  .header-actions .secondary { flex: 1; }
  .actions > button { width: 100%; }
}
