:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --border: #e0e4e2;
  --text: #1a2b22;
  --text-muted: #6b7975;
  --accent: #2E7D32;
  --accent-hover: #1B5E20;
  --danger: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.view { min-height: 100vh; }
.muted { color: var(--text-muted); }
.error { color: var(--danger); font-size: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 1rem 0; font-size: 1.05rem; font-weight: 600; }

/* Login */
.login-card {
  max-width: 400px;
  margin: 10vh auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.login-card input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Buttons */
.btn {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}
.btn:hover { background: #fafafa; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; }

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.badge { background: #e8f3ea; color: var(--accent); font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.topbar select { padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 0.85rem; }

/* Dashboard body */
.dashboard-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stat { padding: 1rem 1.25rem; }
.stat-label { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.5rem; font-weight: 600; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 0.5rem; }
.funnel-step { display: grid; grid-template-columns: 140px 1fr 120px; align-items: center; gap: 0.75rem; }
.funnel-step .label { font-size: 0.9rem; }
.funnel-step .bar-outer { background: #eef2f0; height: 24px; border-radius: 6px; overflow: hidden; }
.funnel-step .bar-inner { background: var(--accent); height: 100%; transition: width 0.4s ease; }
.funnel-step .count { font-size: 0.85rem; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 0.55rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:last-child td { border-bottom: none; }

@media (max-width: 600px) {
  .funnel-step { grid-template-columns: 1fr; }
  .funnel-step .count { text-align: left; }
}
