:root {
  --bg-0: #f2f6fb;
  --bg-1: #dfe8f4;
  --ink-0: #0f172a;
  --ink-1: #475569;
  --line: #d2dae6;
  --panel: rgba(255, 255, 255, 0.85);
  --sidebar: #0b1b33;
  --accent: #0ea5e9;
  --accent-2: #1d4ed8;
  --ok: #15803d;
  --warn: #b45309;
  --fail: #b91c1c;
  --unknown: #334155;
  --shadow: 0 10px 35px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Sora", "Manrope", "Trebuchet MS", sans-serif;
  color: var(--ink-0);
  background:
    radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.14), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(29, 78, 216, 0.14), transparent 48%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.venix-body {
  padding: 16px;
}

.venix-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  max-width: 1700px;
  margin: 0 auto;
}

.venix-sidebar {
  background: linear-gradient(170deg, #0f2342, var(--sidebar));
  border-radius: 18px;
  padding: 22px 16px;
  color: #cdd8ec;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #38bdf8, #1d4ed8);
  color: #fff;
  font-weight: 700;
}

.brand h1 {
  font-size: 17px;
  color: #fff;
}

.brand p {
  font-size: 12px;
  opacity: 0.8;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  text-decoration: none;
  color: #b7c5df;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.menu-item:hover {
  border-color: #355078;
  color: #fff;
}

.menu-item.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #29446b;
  padding-top: 14px;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.meta-value {
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 14px;
}

.venix-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.venix-topbar {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.venix-topbar h2 {
  font-size: 23px;
}

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

.status-pill {
  font-size: 12px;
  font-weight: 600;
  color: #0c4a6e;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 999px;
  padding: 6px 10px;
}

.status-pill.status-ok {
  color: #0c4a6e;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.status-pill.status-error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fca5a5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  border-radius: 16px;
  padding: 14px;
  color: #fff;
  box-shadow: var(--shadow);
}

.kpi-card p {
  font-size: 12px;
  opacity: 0.85;
}

.kpi-card h3 {
  margin-top: 8px;
  font-size: 28px;
}

.kpi-card.total {
  background: linear-gradient(145deg, #334155, #0f172a);
}

.kpi-card.success {
  background: linear-gradient(145deg, #16a34a, #166534);
}

.kpi-card.warning {
  background: linear-gradient(145deg, #f59e0b, #b45309);
}

.kpi-card.failed {
  background: linear-gradient(145deg, #ef4444, #b91c1c);
}

.kpi-card.running {
  background: linear-gradient(145deg, #2563eb, #1e40af);
}

.kpi-card.unknown {
  background: linear-gradient(145deg, #64748b, #334155);
}

.venix-card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.card-head {
  margin-bottom: 12px;
}

.card-head h3 {
  font-size: 18px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #1e293b;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  height: 38px;
  padding: 8px 10px;
  color: #0f172a;
}

input:focus,
select:focus {
  outline: 2px solid rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
}

button {
  border: 0;
  border-radius: 10px;
  height: 38px;
  padding: 0 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

button.secondary {
  color: #fff;
  background: linear-gradient(135deg, #334155, #1e293b);
}

button.ghost {
  width: 100%;
  color: #fff;
  border: 1px solid #47658d;
  background: transparent;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.server-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.server-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
}

.server-bar-name {
  font-size: 12px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.server-bar-seg {
  height: 100%;
}

.server-bar-seg.success {
  background: #16a34a;
}

.server-bar-seg.warning {
  background: #d97706;
}

.server-bar-seg.failed {
  background: #dc2626;
}

.server-bar-seg.running {
  background: #2563eb;
}

.server-bar-seg.unknown {
  background: #64748b;
}

.server-bar-total {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-align: right;
}

.history-pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-page-info {
  font-size: 13px;
  color: #334155;
}

.history-page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-page-controls label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.history-page-controls select {
  width: 80px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom: 1px solid #d9e2ef;
  padding: 10px 8px;
  text-align: left;
}

tbody td {
  border-bottom: 1px solid #e4ecf6;
  padding: 10px 8px;
  font-size: 13px;
  color: #0f172a;
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(14, 165, 233, 0.06);
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  color: #fff;
}

.chip.success {
  background: var(--ok);
}

.chip.failed {
  background: var(--fail);
}

.chip.warning {
  background: var(--warn);
}

.chip.running {
  background: #1d4ed8;
}

.chip.unknown {
  background: var(--unknown);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 370px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-card h1 {
  font-size: 24px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.error {
  color: var(--fail);
  font-size: 13px;
  min-height: 18px;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .venix-layout {
    grid-template-columns: 1fr;
  }

  .venix-sidebar {
    min-height: auto;
  }

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

@media (max-width: 600px) {
  .venix-body {
    padding: 10px;
  }

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

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .server-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .server-bar-total {
    text-align: left;
  }
}
