:root {
  --bg-primary: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --border: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-green: #22c55e;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Layout ── */
.container { max-width: 1280px; margin: 0 auto; padding: 16px; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
header h1 {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
header .user-info { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-secondary); }
header .user-info img { width: 28px; height: 28px; border-radius: 50%; }
header .status-global {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600;
}
.status-global.green { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.status-global.orange { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.status-global.red { background: rgba(239,68,68,0.15); color: var(--accent-red); }

/* ── Grid ── */
.grid { display: grid; gap: 16px; margin-bottom: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s;
}
.card:hover { border-color: #334155; }
.card-title {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px;
}
.card-value {
  font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono);
  line-height: 1.2;
}
.card-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* ── Stat row ── */
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(30,41,59,0.5); }
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }
.stat-value { font-size: 0.85rem; font-family: var(--font-mono); font-weight: 600; }

/* ── Bar (mini progress) ── */
.bar-wrap { height: 6px; background: #1e293b; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.bar-fill.green { background: var(--accent-green); }
.bar-fill.orange { background: var(--accent-orange); }
.bar-fill.red { background: var(--accent-red); }

/* ── Profile row ── */
.profile-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(30,41,59,0.3);
}
.profile-row:last-child { border-bottom: none; }
.profile-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.profile-dot.active { background: var(--accent-green); box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.profile-dot.inactive { background: var(--text-muted); }
.profile-name { font-size: 0.9rem; font-weight: 600; min-width: 90px; }
.profile-meta { font-size: 0.75rem; color: var(--text-secondary); font-family: var(--font-mono); }

/* ── Alert ── */
.alert {
  padding: 12px 14px; border-radius: 8px; margin-bottom: 8px;
  font-size: 0.85rem; display: flex; align-items: flex-start; gap: 10px;
}
.alert.critical { background: rgba(239,68,68,0.12); border-left: 3px solid var(--accent-red); }
.alert.warning { background: rgba(245,158,11,0.12); border-left: 3px solid var(--accent-orange); }
.alert.info { background: rgba(59,130,246,0.12); border-left: 3px solid var(--accent-blue); }
.alert-icon { font-size: 1.1rem; }
.alert-title { font-weight: 600; }
.alert-msg { color: var(--text-secondary); margin-top: 2px; }

/* ── History ── */
.history-item { padding: 8px 0; border-bottom: 1px solid rgba(30,41,59,0.3); font-size: 0.8rem; }
.history-item:last-child { border-bottom: none; }
.history-ts { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem; }

/* ── Login page ── */
.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  flex-direction: column; gap: 24px;
}
.login-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 48px 40px; text-align: center; max-width: 400px;
}
.login-box h1 { font-size: 1.8rem; margin-bottom: 8px; }
.login-box p { color: var(--text-secondary); margin-bottom: 32px; font-size: 0.9rem; }
.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 28px; border-radius: 8px;
  background: #fff; color: #1a1a2e;
  font-weight: 600; font-size: 0.95rem;
  text-decoration: none; transition: opacity 0.2s;
}
.btn-google:hover { opacity: 0.9; }
.login-footer { color: var(--text-muted); font-size: 0.75rem; }

/* ── Refreshing indicator ── */
.refreshing { opacity: 0.6; transition: opacity 0.3s; }

/* ── Service status ── */
.service-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.service-dot.active { background: var(--accent-green); }
.service-dot.inactive { background: var(--accent-red); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .container { padding: 12px; }
  header h1 { font-size: 1.2rem; }
  .login-box { padding: 32px 24px; }
}
