
:root {
  --bg: #060d18;
  --bg-2: #0a1322;
  --panel: rgba(12, 23, 42, 0.94);
  --panel-soft: rgba(18, 31, 56, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef3ff;
  --muted: #aab6cb;
  --accent: #ff922d;
  --accent-2: #ffb36e;
  --good: #27c281;
  --warn: #f2c94c;
  --bad: #ef7272;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(255,146,45,0.16), transparent 28%),
    linear-gradient(180deg, #081120 0%, #040912 100%);
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(5, 12, 24, 0.95);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #111;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-name { font-size: 18px; font-weight: 700; }
.brand-sub {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav { display: grid; gap: 8px; }

.nav-link {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.05);
  border-color: var(--line);
  color: var(--text);
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.sidebar-foot p {
  margin: 10px 0 0;
  line-height: 1.45;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow,
.small-label {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

h1 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  margin: 10px 0 10px;
  font-size: 30px;
  line-height: 1.1;
}

p { line-height: 1.55; }

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
}

.hero-card,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  margin-bottom: 20px;
}

.hero-card p {
  margin: 0;
  max-width: 860px;
  color: var(--muted);
}

.hero-actions {
  min-width: 220px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.view { display: none; }
.view.active { display: block; }

.card-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  padding: 18px;
}
.card .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.card .value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}
.card .sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.panel-body {
  color: var(--muted);
}

.chart-panel canvas {
  width: 100% !important;
  height: 320px !important;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 18px;
  flex-wrap: wrap;
}

.toolbar label,
.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-note {
  color: var(--muted);
  font-size: 13px;
  max-width: 720px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.span-2 {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

textarea { resize: vertical; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.primary-btn,
.secondary-btn {
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  font: inherit;
  transition: 180ms ease;
}

.primary-btn {
  border: 1px solid transparent;
  color: #131313;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.secondary-btn {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.inline-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: rgba(255,255,255,0.02);
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.list-clean {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.list-item-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.list-item-sub {
  font-size: 12px;
  color: var(--muted);
}

.kv {
  display: grid;
  gap: 10px;
}
.kv-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }

.muted { color: var(--muted); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 12px;
}

.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

.file-link {
  color: var(--accent-2);
  text-decoration: none;
}
.file-link:hover { text-decoration: underline; }

.code-box {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  min-height: 210px;
  color: #dbe5ff;
}

@media (max-width: 1200px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; border-right: 0; border-bottom: 1px solid var(--line); }
  .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-two { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
}

@media (max-width: 760px) {
  .main { padding: 18px; }
  .topbar, .hero-card { flex-direction: column; }
  .card-grid.four, .card-grid.three { grid-template-columns: 1fr; }
}

.brand-logo {
  width: 132px;
  height: auto;
  display: block;
}

.selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.selector-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  display: grid;
  gap: 10px;
}

.selector-card select,
.selector-card input,
input,
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.selector-card select {
  min-height: 260px;
  padding: 8px;
}

.selector-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.selector-count {
  font-size: 12px;
  color: var(--accent-2);
}

.small { font-size: 12px; }

.list-clean { display: grid; gap: 10px; }
.list-item {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 12px 14px;
}
.list-item-title { font-weight: 700; color: var(--text); }
.list-item-sub { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 4px; }
.pill-inline {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  margin: 0 8px 8px 0;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--text); background: rgba(255,255,255,0.04); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }

.file-link { color: var(--accent-2); text-decoration: none; }
.file-link:hover { text-decoration: underline; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 16px;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}
.kv { display: grid; gap: 8px; }
.kv-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.kv-row:last-child { border-bottom: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.primary-btn, .secondary-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #111; }
.secondary-btn { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--line); }
.muted { color: var(--muted); }
.inline-message { min-height: 20px; }
.code-box {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.26);
  border: 1px solid var(--line);
  color: #dce5f7;
  white-space: pre-wrap;
}

@media (max-width: 1280px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-two, .selector-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar, .hero-card { flex-direction: column; }
}
