:root {
  --bg-0: #0a101c;
  --bg-1: #0f1b2e;
  --bg-2: #13233b;
  --line: #274567;
  --line-soft: #1e3551;
  --text-main: #e8f2ff;
  --text-sub: #9bb4d1;
  --accent: #39d0ff;
  --ok: #2dd783;
  --danger: #ff5d7a;
  --warn: #ffc857;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", "PingFang SC", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1100px 500px at 85% -15%, #1a3f72 0%, transparent 70%),
    radial-gradient(1000px 550px at -5% 105%, #153255 0%, transparent 72%),
    linear-gradient(180deg, var(--bg-0), #08111d);
  padding: 20px;
}

.terminal {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(155deg, rgba(15, 27, 46, 0.95), rgba(11, 20, 33, 0.96));
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

p {
  margin: 6px 0 0;
  color: var(--text-sub);
}

.hidden {
  display: none;
}

.inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-sub);
  font-size: 13px;
}

input,
select,
.btn {
  border: 1px solid var(--line);
  background: #0b1728;
  color: var(--text-main);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
}

select {
  appearance: none;
}

.btn {
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
}

.btn.primary {
  background: linear-gradient(130deg, #1f70c1, #165998);
  border-color: #2c80d6;
}

.btn.success {
  background: linear-gradient(130deg, #1d8756, #156844);
  border-color: #2aa56d;
}

.btn.danger {
  background: linear-gradient(130deg, #a5324a, #7d2438);
  border-color: #c24560;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  padding: 10px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric span {
  color: var(--text-sub);
  font-size: 12px;
}

.metric strong {
  font-size: 16px;
  font-weight: 600;
  color: #f4f9ff;
  word-break: break-word;
}

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

thead th {
  text-align: left;
  padding: 8px;
  color: #cce1ff;
  background: rgba(35, 66, 102, 0.25);
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 8px;
  border-bottom: 1px solid rgba(39, 69, 103, 0.4);
}

tbody tr:hover {
  background: rgba(54, 89, 133, 0.16);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
}

.warning {
  border-color: #9b7b2b;
  background: linear-gradient(160deg, rgba(91, 67, 17, 0.28), rgba(44, 34, 14, 0.34));
  color: #ffd68a;
}

.error {
  color: var(--danger);
}

.success {
  color: var(--ok);
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .card {
    border-radius: 12px;
    padding: 12px;
  }
}
