* { margin: 0; padding: 0; box-sizing: border-box; }

body, input, button, select, textarea, table {
  font-family: ui-monospace, 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
}

body {
  background: #23272f;
  color: #eaeaea;
  height: 100vh;
  overflow: hidden;
}

.auth-overlay {
  position: fixed; inset: 0; background: #16181d;
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.auth-box {
  background: #23272f; border: 1px solid #333846; border-radius: 16px;
  padding: 48px 40px 40px; width: 380px; max-width: 90vw; text-align: center;
  box-shadow: 0 12px 48px #0008;
}
.auth-icon { font-size: 3em; margin-bottom: 12px; }
.auth-title { color: #fff; font-size: 1.4em; margin-bottom: 4px; }
.auth-subtitle { color: #8a8f99; font-size: 0.88em; margin-bottom: 28px; }
.auth-input {
  display: block; width: 100%; padding: 12px 16px; margin-bottom: 14px;
  background: #16181d; border: 1px solid #333846; border-radius: 8px;
  color: #eaeaea; font-size: 0.95em; outline: none;
}
.auth-input:focus { border-color: #30b8ff; }
.auth-error { color: #ff5555; font-size: 0.85em; min-height: 20px; margin-bottom: 8px; }
.auth-btn {
  width: 100%; padding: 12px; background: #30b8ff; color: #fff;
  font-size: 1em; font-weight: 600; border: none; border-radius: 8px; cursor: pointer;
}
.auth-btn:hover { background: #1fa3e8; }

.logout-btn { margin-left: auto; cursor: pointer; color: #8a8f99; }
.logout-btn:hover { color: #ff5555; }

.container { display: flex; height: 100vh; }
.sidebar {
  width: 240px; min-width: 240px; background: #16181d;
  display: flex; flex-direction: column; border-right: 1px solid #292c36;
}
.sidebar-header {
  display: flex; align-items: center; padding: 20px;
  font-size: 1.15em; font-weight: bold; color: #fff;
  border-bottom: 1px solid #292c36;
}
.nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: block; padding: 11px 20px; color: #8a8f99; text-decoration: none;
  border-left: 3px solid transparent; font-size: 0.92em;
}
.nav-item:hover { color: #eaeaea; background: #1c1f27; }
.nav-item.active { color: #30b8ff; border-left-color: #30b8ff; background: #1c1f27; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #292c36; }
.hint { color: #555; font-size: 0.72em; line-height: 1.45; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 24px; border-bottom: 1px solid #292c36; background: #1c1f27;
}
.header-controls { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.ctrl { display: flex; align-items: center; gap: 6px; color: #8a8f99; font-size: 0.8em; }
.ctrl select, .ctrl input {
  background: #16181d; border: 1px solid #333846; color: #eaeaea;
  border-radius: 6px; padding: 6px 8px; font-size: 0.9em;
}
.btn-sm {
  background: #30b8ff; color: #fff; border: none; border-radius: 6px;
  padding: 7px 12px; cursor: pointer; font-size: 0.85em;
}
.btn-sm:hover { background: #1fa3e8; }
.btn-ghost {
  background: transparent; color: #30b8ff; border: 1px solid #30b8ff;
  border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 0.75em;
}

.main-content {
  flex: 1; overflow-y: auto; padding: 24px;
  scrollbar-width: thin; scrollbar-color: #363d4e #23272f;
}

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi {
  background: #1c1f27; border: 1px solid #333846; border-radius: 12px; padding: 14px;
}
.kpi .label { color: #8a8f99; font-size: 0.72em; margin-bottom: 6px; }
.kpi .value { color: #fff; font-size: 1.35em; font-weight: 700; }
.kpi .sub { color: #6a7080; font-size: 0.7em; margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #1c1f27; border: 1px solid #333846; border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.card h2 { font-size: 0.95em; margin-bottom: 14px; color: #fff; }
.disclaimer {
  background: #2a2418; border: 1px solid #6b5a2a; color: #e8c96a;
  border-radius: 8px; padding: 12px 14px; font-size: 0.82em; line-height: 1.5;
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.82em; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #292c36; }
th { color: #8a8f99; font-weight: 600; position: sticky; top: 0; background: #1c1f27; }
tr:hover td { background: #252a34; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { max-height: 420px; overflow: auto; }

.chart-wrap { position: relative; height: 280px; }
.chart-wrap.sm { height: 220px; }
.chart-wrap.lg { height: 320px; }

.funnel-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.funnel-bar {
  height: 28px; background: linear-gradient(90deg, #30b8ff, #1a7aad);
  border-radius: 6px; min-width: 4px; transition: width 0.3s;
}
.funnel-meta { min-width: 220px; font-size: 0.85em; }
.muted { color: #8a8f99; }
.error { color: #ff5555; }
.loading { color: #8a8f99; padding: 40px; text-align: center; }

.timeline { font-size: 0.8em; }
.timeline .enter { color: #30b8ff; }
.timeline .ev { color: #c0c0c0; }

.path-chip {
  display: inline-block; background: #16181d; border: 1px solid #333846;
  border-radius: 6px; padding: 2px 8px; margin: 2px; font-size: 0.78em;
}
