:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #18202a;
  --muted: #667085;
  --line: #d9e0e8;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --danger: #b42318;
  --warning: #b54708;
  --info: #175cd3;
  --success: #027a48;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

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

.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 28px;
}

.brand small,
.muted {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 22px;
}

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

.nav-list a {
  color: #d1d5db;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

.nav-list a.active,
.nav-list a:hover {
  background: #1f2937;
  color: white;
}

.main-shell {
  min-width: 0;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.content {
  padding: 28px;
}

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

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 28px; }
h2 { margin-bottom: 8px; font-size: 18px; }
p { color: var(--muted); line-height: 1.5; }

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

.metric-card,
.panel,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.metric-card {
  padding: 18px;
  border-left: 4px solid var(--primary);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.metric-card strong {
  font-size: 32px;
}

.metric-card.warning { border-left-color: var(--warning); }
.metric-card.info { border-left-color: var(--info); }
.metric-card.success { border-left-color: var(--success); }

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

.panel {
  padding: 20px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-light {
  background: var(--surface-2);
  color: var(--text);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
}

.auth-card .brand-mark {
  margin-bottom: 18px;
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 18px;
}

.alert-danger {
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #fecdca;
}

code {
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 4px;
}

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

  .sidebar {
    position: static;
  }

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

