:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #334155;
  --radius: 12px;
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 10;
}
.main { flex: 1; margin-left: 240px; padding: 32px; }

/* Logo */
.logo { font-size: 20px; font-weight: 800; margin-bottom: 32px; display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 12px; height: 12px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Nav */
.nav { list-style: none; flex: 1; }
.nav li { margin-bottom: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--text-muted); transition: all 0.15s;
}
.nav a:hover, .nav a.active { background: var(--bg-hover); color: var(--text); text-decoration: none; }

.nav-bottom { border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; }
.plan-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; background: var(--border); color: var(--text-muted);
}
.plan-badge.pro { background: var(--primary); color: #fff; }
.plan-badge.business { background: var(--warning); color: #000; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}

/* Stats row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { text-align: center; }
.stat-value { font-size: 32px; font-weight: 700; }
.stat-label { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* Status indicators */
.status-up { color: var(--success); }
.status-down { color: var(--danger); }
.status-degraded { color: var(--warning); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.up { background: var(--success); }
.status-dot.down { background: var(--danger); }
.status-dot.degraded { background: var(--warning); }

/* Monitor list */
.monitor-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.monitor-row:hover { background: var(--bg-hover); }
.monitor-row:last-child { border-bottom: none; }
.monitor-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.monitor-name { font-weight: 600; }
.monitor-url { color: var(--text-muted); font-size: 13px; }
.monitor-stats { display: flex; gap: 24px; align-items: center; }
.monitor-stat { text-align: right; }
.monitor-stat-label { font-size: 11px; color: var(--text-muted); }

/* Uptime bar */
.uptime-bar { display: flex; gap: 2px; height: 28px; align-items: flex-end; }
.uptime-tick {
  width: 4px; border-radius: 2px; min-height: 4px; transition: height 0.2s;
}
.uptime-tick.up { background: var(--success); height: 100%; }
.uptime-tick.down { background: var(--danger); height: 100%; }
.uptime-tick.degraded { background: var(--warning); height: 60%; }
.uptime-tick.none { background: var(--border); height: 20%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: 14px; outline: none; transition: border 0.15s;
}
.form-input:focus { border-color: var(--primary); }
select.form-input { appearance: none; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: var(--bg-card); border-radius: var(--radius); padding: 32px; width: 90%; max-width: 500px; }
.modal h2 { margin-bottom: 20px; }

/* Auth page */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { text-align: center; margin-bottom: 8px; }
.auth-box p { text-align: center; color: var(--text-muted); margin-bottom: 24px; }

/* Header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; }

/* Response time chart (simple) */
.response-chart { display: flex; align-items: flex-end; gap: 1px; height: 60px; }
.response-bar {
  flex: 1; background: var(--primary); border-radius: 2px 2px 0 0;
  min-height: 2px; transition: height 0.2s; opacity: 0.7;
}
.response-bar:hover { opacity: 1; }

/* Toast notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 20px; margin-bottom: 8px; min-width: 280px;
  animation: slideIn 0.3s ease;
}
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
  .main { margin-left: 0; padding: 16px; }
  .app { flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .monitor-stats { display: none; }
}

/* Pricing page */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.pricing-card { text-align: center; padding: 32px; }
.pricing-card.featured { border-color: var(--primary); position: relative; }
.pricing-card.featured::before {
  content: 'POPULAR'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 4px 16px; border-radius: 12px; font-size: 11px; font-weight: 700;
}
.pricing-price { font-size: 40px; font-weight: 800; margin: 16px 0; }
.pricing-price span { font-size: 16px; color: var(--text-muted); }
.pricing-features { list-style: none; text-align: left; margin: 20px 0; }
.pricing-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pricing-features li::before { content: '\2713'; color: var(--success); margin-right: 8px; font-weight: 700; }

/* Hide sections */
.hidden { display: none !important; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--text-muted); }
