:root {
  --ink: #14213d;
  --muted: #68738a;
  --line: #dfe5ee;
  --soft: #f4f7fb;
  --paper: #ffffff;
  --navy: #102a43;
  --blue: #1769e0;
  --cyan: #00a8a8;
  --green: #16825d;
  --amber: #a15c00;
  --red: #b83b4b;
  --shadow: 0 16px 40px rgba(20, 33, 61, .08);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 90% 0, #e5f4ff 0, transparent 30%), var(--soft); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(165deg, #0d233c 0%, #112f50 60%, #0b4961 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; font-weight: 800; background: linear-gradient(145deg, #3a8cff, #12b8ad); box-shadow: 0 8px 24px rgba(0, 168, 168, .25); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { color: #9fb6cb; font-size: 12px; margin-top: 3px; }
nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 10px; color: #c6d5e4; background: transparent; text-align: left; }
.nav-item span { display: grid; place-items: center; width: 23px; font-size: 20px; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active { box-shadow: inset 3px 0 #3dc9c3; }
.sidebar-bottom { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-bottom a { color: #bdd4e8; font-size: 13px; text-decoration: none; }
.system-state { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: #9fb6cb; font-size: 12px; }
.system-state i { width: 8px; height: 8px; border-radius: 50%; background: #d9a441; box-shadow: 0 0 0 4px rgba(217,164,65,.12); }
.system-state i.ok { background: #32c48d; box-shadow: 0 0 0 4px rgba(50,196,141,.12); }

main { min-width: 0; padding: 34px 44px 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 5px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 21px; letter-spacing: -.02em; }
h3 { margin-bottom: 6px; }
.identity { display: flex; align-items: center; gap: 12px; min-width: 220px; justify-content: flex-end; }
.identity strong, .identity small { display: block; text-align: right; }
.identity strong { font-size: 13px; }
.identity small { color: var(--muted); margin-top: 3px; }
.demo-badge { padding: 5px 8px; color: #81530a; background: #fff1c7; border: 1px solid #ead28f; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stats article { padding: 18px 20px; border: 1px solid rgba(223,229,238,.9); border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: 0 8px 25px rgba(20,33,61,.04); backdrop-filter: blur(8px); }
.stats span { display: block; color: var(--muted); font-size: 12px; }
.stats strong { display: block; margin-top: 5px; font-size: 25px; }
.view { display: none; }
.view.active { display: block; animation: reveal .2s ease-out; }
@keyframes reveal { from { opacity: .2; transform: translateY(4px); } }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.search-panel { padding: 24px; }
.search-panel form > label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.search-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, textarea, select { width: 100%; border: 1px solid #cfd8e6; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.12); }
textarea { resize: vertical; }
button.primary, button.secondary { border-radius: 9px; padding: 10px 16px; font-weight: 700; border: 1px solid transparent; }
button.primary { color: #fff; background: var(--blue); box-shadow: 0 6px 16px rgba(23,105,224,.2); }
button.primary:hover { background: #0f59c3; }
button.secondary { color: var(--ink); border-color: #cfd8e6; background: #fff; }
button.secondary:hover { background: var(--soft); }
.search-options { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(180px, .7fr); gap: 16px 24px; align-items: end; margin-top: 18px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend, label { color: #34435d; font-size: 12px; font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.checks.vertical { display: grid; }
.checks label { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-weight: 600; }
.checks input { width: auto; accent-color: var(--blue); }
.search-options details { grid-column: 1 / -1; }
summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; }
details textarea { margin-top: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.result-heading { display: flex; justify-content: space-between; margin: 28px 3px 12px; }
.result-heading p, .section-bar p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.results { display: grid; gap: 12px; }
.empty-state { min-height: 230px; place-content: center; padding: 36px; text-align: center; color: var(--muted); border: 1px dashed #bdc9d8; border-radius: 16px; }
.empty-state h3 { color: var(--ink); }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: var(--blue); background: #e8f1ff; font-size: 28px; }
.result-card { display: grid; grid-template-columns: 54px 1fr; gap: 16px; padding: 19px 21px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(20,33,61,.045); }
.score { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; color: var(--blue); background: #eaf2ff; font-size: 13px; font-weight: 800; }
.result-card header { display: flex; justify-content: space-between; gap: 16px; }
.result-card header strong { font-size: 14px; }
.result-card header small { color: var(--muted); }
.result-card p { margin: 9px 0 12px; color: #34435d; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 7px; border-radius: 5px; color: #496078; background: #edf2f7; font-size: 10px; font-weight: 700; }

.section-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 8px 2px 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e8edf3; text-align: left; vertical-align: middle; font-size: 12px; }
th { color: #607089; background: #f8fafc; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status.ready, .status.completed { color: #0d6b4b; background: #dff6ed; }
.status.queued, .status.processing { color: #84520b; background: #fff0c9; }
.status.failed { color: #9a2e3e; background: #ffe2e7; }
.progress { width: 110px; height: 6px; overflow: hidden; border-radius: 20px; background: #e8edf3; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.table-action { padding: 5px 8px; border: 0; border-radius: 6px; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.table-action.danger { color: var(--red); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.config-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(20,33,61,.045); }
.config-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.config-card h3 { font-size: 16px; }
.config-card p { min-height: 38px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.config-card dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 16px 0; font-size: 11px; }
.config-card dt { color: var(--muted); }
.config-card dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.card-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid #edf1f5; }

dialog { width: min(560px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 17px; box-shadow: 0 30px 80px rgba(5,18,35,.3); }
dialog::backdrop { background: rgba(9,24,43,.55); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: 16px; padding: 24px; }
.dialog-form header { display: flex; justify-content: space-between; gap: 16px; }
.dialog-form h2 { margin-bottom: 0; }
.dialog-form label { display: grid; gap: 7px; }
.dialog-form footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: var(--soft); font-size: 21px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#toast { position: fixed; right: 25px; bottom: 25px; max-width: 380px; padding: 13px 16px; border-radius: 10px; color: #fff; background: var(--navy); box-shadow: 0 14px 35px rgba(8,30,52,.25); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { background: var(--red); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { padding: 24px 10px; }
  .brand { justify-content: center; padding: 0 0 28px; }
  .brand > div:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; padding: 12px 8px; font-size: 0; }
  .nav-item span { font-size: 20px; }
  .sidebar-bottom { display: none; }
  main { padding: 26px 24px 50px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 20; right: 10px; bottom: 10px; top: auto; left: 10px; width: auto; height: auto; padding: 7px; border-radius: 14px; }
  .brand, .sidebar-bottom { display: none; }
  nav { display: flex; justify-content: space-around; }
  .nav-item { width: 42px; padding: 8px; }
  .nav-item.active { box-shadow: none; background: rgba(255,255,255,.15); }
  main { padding: 22px 15px 92px; }
  .topbar { align-items: flex-start; }
  .identity { min-width: 0; }
  .identity div { display: none; }
  .stats { gap: 8px; }
  .stats article { padding: 14px; }
  .search-line, .search-options { grid-template-columns: 1fr; }
  .search-options details { grid-column: auto; }
  .result-card { grid-template-columns: 1fr; }
  .score { width: auto; height: 30px; justify-self: start; padding: 0 9px; }
  .section-bar { align-items: flex-start; }
  .two-columns { grid-template-columns: 1fr; }
}

