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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242836;
  --border: #2e3345;
  --text: #e4e6f0;
  --text-muted: #8b8fa3;
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.15);
  --orange: #fb923c;
  --orange-dim: rgba(251, 146, 60, 0.15);
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

header h1 { font-size: 22px; font-weight: 600; }
header h1 span { color: var(--accent); }
header .subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.actions { display: flex; gap: 8px; }

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--accent); }
.btn-accent { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { opacity: 0.9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Summary cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.summary-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.summary-card .value {
  font-size: 28px;
  font-weight: 700;
}

.summary-card .unit { font-size: 14px; color: var(--text-muted); font-weight: 400; }

.quality-high { color: var(--accent); }
.quality-medium { color: var(--orange); }
.quality-low { color: var(--red); }

/* Provider status */
.providers-section { margin-bottom: 32px; }
.providers-section h2 { font-size: 16px; margin-bottom: 16px; }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.provider-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.provider-card .name { font-weight: 600; font-size: 14px; }
.provider-card .status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green { background: var(--accent); }
.dot-orange { background: var(--orange); }
.dot-red { background: var(--red); }

/* Category breakdown */
.breakdown-section { margin-bottom: 32px; }
.breakdown-section h2 { font-size: 16px; margin-bottom: 16px; }

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.breakdown-table th,
.breakdown-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.breakdown-table th {
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.breakdown-table tr:last-child td { border-bottom: none; }

.method-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.method-measured { background: var(--accent-dim); color: var(--accent); }
.method-estimated { background: var(--orange-dim); color: var(--orange); }

/* Bar chart */
.bar-chart { margin-top: 24px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.bar-label { width: 120px; font-size: 13px; color: var(--text-muted); text-align: right; }
.bar-track { flex: 1; height: 28px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: fit-content;
  transition: width 0.5s ease;
}
.bar-fill.measured { background: var(--accent); color: #000; }
.bar-fill.estimated { background: var(--orange); color: #000; }

/* Website scan */
.website-scan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}
.website-scan h3 { font-size: 14px; margin-bottom: 12px; }
.scan-input {
  display: flex;
  gap: 8px;
}
.scan-input input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.scan-input input:focus { outline: none; border-color: var(--accent); }

/* Errors */
.errors { margin-top: 16px; }
.error-item {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--red);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h2 { color: var(--text); margin-bottom: 12px; }
.empty-state p { margin-bottom: 24px; }

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth screen */
.auth-box {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
}
.auth-box h1 { font-size: 28px; margin-bottom: 8px; }
.auth-box h1 span { color: var(--accent); }
.auth-subtitle { color: var(--text-muted); margin-bottom: 32px; }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}
.auth-tab.active { background: var(--accent); color: #000; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form input {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form input::placeholder { color: var(--text-muted); }

.btn-full { width: 100%; padding: 12px; font-size: 15px; }

.auth-link {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}
.auth-link:hover { color: var(--accent); }

.auth-error {
  margin-top: 16px;
  padding: 12px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
  display: none;
}
.auth-success {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  display: none;
}

/* User info in header */
.user-info {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Org banner */
.org-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
}
.org-banner .org-name { font-weight: 600; font-size: 18px; }
.org-banner .org-domain { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

@media (max-width: 768px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .provider-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-box { margin: 40px auto; padding: 0 16px; }
}
