:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee7;
  --text: #1d2430;
  --muted: #697586;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #15202b;
  color: #f8fafc;
  padding: 18px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  border-radius: 8px;
  color: #d7dee8;
  padding: 10px 12px;
}

.nav a.active,
.nav a:hover {
  background: #223447;
  color: #ffffff;
}

.content {
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.button,
button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 14px;
}

.button.secondary,
button.secondary {
  background: #edf2f7;
  color: var(--text);
}

.button:hover,
button:hover {
  background: var(--accent-dark);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.login {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
}

.error {
  color: var(--danger);
  margin-bottom: 12px;
}

.status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 13px;
  padding: 3px 8px;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-missing {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .content {
    padding: 16px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
