:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --text: #17212b;
  --muted: #607080;
  --line: #d9e1e8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --info: #2563eb;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 8px 24px rgba(22, 35, 49, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  background: #d7dee4;
  color: #6c7a86;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #17212b;
  color: #f8fafc;
  padding: 22px 18px;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}

.brand span,
.topbar p,
.metric span,
.form-message,
.empty,
dd,
dt {
  color: var(--muted);
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #b9c5d0;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: #d8e1e8;
  text-decoration: none;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.content {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.ghost:hover {
  background: #edf2f6;
}

.hidden {
  display: none !important;
}

.login-panel {
  display: grid;
  min-height: 60vh;
  place-items: center;
}

.login-form {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 700;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}

.dashboard-panel {
  display: grid;
  gap: 18px;
}

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

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

.metric {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

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

.panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.online {
  background: #d9f4eb;
  color: #047857;
}

.status-pill.warning {
  background: #fff0d8;
  color: var(--warn);
}

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

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: #475569;
  background: #f8fafc;
}

.empty {
  text-align: center;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.config-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 16px 0;
}

.config-status div {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.config-status span {
  color: var(--muted);
  font-size: 13px;
}

.config-status strong {
  overflow-wrap: anywhere;
}

.module-grid button {
  background: var(--surface-soft);
  color: #37515c;
}

.support-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 16px;
}

dt {
  margin-bottom: 4px;
  font-size: 13px;
}

dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metric-grid,
  .split-grid,
  .module-grid,
  .config-status,
  .support-list {
    grid-template-columns: 1fr;
  }

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