:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --ink: #111817;
  --muted: #64736e;
  --line: #dce4e1;
  --brand: #0f654d;
  --brand-dark: #123d35;
  --danger: #9b2c2c;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

.shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}

.auth-panel {
  width: min(440px, 100%);
  margin: 10vh auto 0;
  display: grid;
  gap: 14px;
}

.hidden {
  display: none !important;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  background: #101817;
  color: #fff;
}

.brand-block {
  padding: 4px 8px 18px;
}

.brand-block .eyebrow {
  color: #9fb0aa;
}

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

.nav-item {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  color: #cbd8d4;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #1f332e;
  color: #fff;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: 30px;
  line-height: 36px;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.icon-button {
  background: #e9efed;
  color: var(--ink);
}

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

.stats-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.stat span {
  color: var(--muted);
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stack {
  display: grid;
  gap: 12px;
}

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

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

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

th {
  color: var(--muted);
  font-weight: 900;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 800;
}

.success {
  min-height: 20px;
  color: var(--brand);
  font-weight: 800;
}

@media (max-width: 760px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .main-pane {
    padding: 14px;
  }

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

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

  h1 {
    font-size: 24px;
    line-height: 30px;
  }
}
