:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --orange: #f59e0b;
  --orange-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f1f5f9;
  color: var(--text);
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #f8fafc;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span,
.sidebar-card small {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 3px;
}

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

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-card strong {
  display: block;
  margin-top: 8px;
  color: #86efac;
  font-size: 22px;
}

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

.topbar,
.panel-header,
.actions,
.metrics,
.queue li {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  font-size: 20px;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
}

button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.metric-card {
  padding: 20px;
}

.metric-card span,
.resource span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.metric-card small,
.resource small,
.queue small {
  color: var(--muted);
}

.metric-card.danger strong {
  color: var(--red);
}

.grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 16px;
}

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

.panel.large {
  min-height: 330px;
}

.panel-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.chart {
  height: 250px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  padding-top: 20px;
}

.chart div {
  height: var(--height);
  min-height: 42px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  position: relative;
}

.chart span {
  position: absolute;
  left: 50%;
  bottom: -30px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.queue li {
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 16px;
}

.queue div {
  flex: 1;
}

.queue strong {
  display: block;
}

.queue em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dot.blue {
  background: var(--blue);
}

.dot.purple {
  background: #8b5cf6;
}

.dot.green {
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status.ok {
  background: var(--green-soft);
  color: var(--green);
}

.status.warn {
  background: var(--orange-soft);
  color: #a16207;
}

input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  min-width: 220px;
}

.resource {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

@media (max-width: 980px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics,
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .panel.large {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 20px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .grid {
    grid-template-columns: 1fr;
  }

  .chart {
    gap: 8px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  input[type="search"] {
    width: 100%;
    min-width: 0;
  }
}
