:root {
  --bristo-primary: #993C1D;
  --bristo-primary-light: #FAECE7;
  --bristo-bg: #FAFAF8;
  --bristo-surface: #FFFFFF;
  --bristo-border: rgba(0,0,0,0.08);
  --bristo-text: #1A1A1A;
  --bristo-text-muted: #5F5E5A;
  --bristo-text-dim: #9C9A92;
  --bristo-success: #1D9E75;
  --bristo-warning: #BA7517;
  --bristo-danger: #A32D2D;
  --bristo-radius: 8px;
  --bristo-radius-lg: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bristo-bg: #1A1815;
    --bristo-surface: #242220;
    --bristo-border: rgba(255,255,255,0.08);
    --bristo-text: #F1EFE8;
    --bristo-text-muted: #B4B2A9;
    --bristo-text-dim: #888780;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bristo-bg);
  color: var(--bristo-text);
  font-size: 14px;
  line-height: 1.5;
}

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

.sidebar {
  background: var(--bristo-surface);
  border-right: 0.5px solid var(--bristo-border);
  padding: 20px 0;
  overflow-y: auto;
}
.brand {
  padding: 0 20px 20px;
  border-bottom: 0.5px solid var(--bristo-border);
  margin-bottom: 12px;
}
.brand h1 {
  font-size: 16px; font-weight: 500; margin: 0; color: var(--bristo-primary);
}
.brand p { font-size: 12px; color: var(--bristo-text-muted); margin: 4px 0 0; }

.nav-section {
  padding: 12px 20px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--bristo-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--bristo-text-muted);
  cursor: not-allowed;
  user-select: none;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--bristo-bg); color: var(--bristo-text); }
.nav-item.active {
  color: var(--bristo-primary);
  border-left-color: var(--bristo-primary);
  background: var(--bristo-primary-light);
}
.nav-item .badge {
  margin-left: auto; font-size: 10px; padding: 2px 6px;
  background: var(--bristo-border); border-radius: 4px;
  color: var(--bristo-text-dim);
}

.main { padding: 32px 40px; overflow-y: auto; }
.page-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 0.5px solid var(--bristo-border);
}
.page-header h2 { margin: 0; font-size: 20px; font-weight: 500; }
.page-header .meta { font-size: 12px; color: var(--bristo-text-muted); }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 32px;
}
.kpi {
  background: var(--bristo-surface);
  border: 0.5px solid var(--bristo-border);
  border-radius: var(--bristo-radius);
  padding: 16px;
}
.kpi .label { font-size: 12px; color: var(--bristo-text-muted); margin-bottom: 6px; }
.kpi .value { font-size: 22px; font-weight: 500; }
.kpi .sub { font-size: 11px; color: var(--bristo-text-dim); margin-top: 4px; }

.card {
  background: var(--bristo-surface);
  border: 0.5px solid var(--bristo-border);
  border-radius: var(--bristo-radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 500; }

.module-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.module {
  padding: 14px 16px;
  border: 0.5px solid var(--bristo-border);
  border-radius: var(--bristo-radius);
  background: var(--bristo-bg);
}
.module .title { font-weight: 500; font-size: 13px; }
.module .layer { font-size: 11px; color: var(--bristo-text-dim); margin-top: 4px; }
.module .pending { font-size: 10px; color: var(--bristo-text-dim); margin-top: 6px; padding: 2px 6px; background: var(--bristo-border); border-radius: 4px; display: inline-block; }

.health-banner {
  padding: 12px 16px;
  border-radius: var(--bristo-radius);
  margin-bottom: 16px;
  font-size: 13px;
}
.health-ok { background: rgba(29,158,117,0.08); border-left: 3px solid var(--bristo-success); color: var(--bristo-success); }
.health-warn { background: rgba(186,117,23,0.08); border-left: 3px solid var(--bristo-warning); color: var(--bristo-warning); }
.health-err { background: rgba(163,45,45,0.08); border-left: 3px solid var(--bristo-danger); color: var(--bristo-danger); }

.footer {
  margin-top: 40px; padding-top: 16px;
  border-top: 0.5px solid var(--bristo-border);
  font-size: 11px; color: var(--bristo-text-dim);
}
