:root {
  --green: #059669;
  --green-light: #d1fae5;
  --red: #dc2626;
  --red-light: #fee2e2;
  --yellow: #d97706;
  --yellow-light: #fef3c7;
  --dark: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --surface: #ffffff;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* Nav */
.nav {
  background: var(--dark);
  border-bottom: 1px solid #1f2937;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-links a:hover { color: white; }
.nav-plan {
  background: var(--green);
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-family: var(--font);
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--green); color: white; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

/* App layout */
.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
}
.sidebar-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--bg);
  color: var(--green);
  font-weight: 600;
}
.sidebar-upgrade {
  display: block;
  margin-top: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  background: var(--green-light);
  color: var(--green);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}
.app-main {
  padding: 2rem;
  overflow-y: auto;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-up { background: var(--green-light); color: var(--green); }
.badge-down { background: var(--red-light); color: var(--red); }
.badge-unknown { background: var(--yellow-light); color: var(--yellow); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}
.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
}
.page-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Hero */
.hero {
  background: var(--dark);
  color: white;
  padding: 5rem 1.5rem;
  text-align: center;
}
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.hero h1 span { color: var(--green); }
.hero p {
  font-size: 1.15rem;
  color: #9ca3af;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* Section */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 3rem;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.feature-card p { color: var(--muted); font-size: 0.9rem; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.pricing-card.featured {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}
.pricing-name { font-weight: 700; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.pricing-price { font-size: 2.5rem; font-weight: 900; color: var(--dark); margin: 0.5rem 0; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.pricing-features { list-style: none; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.pricing-features li { font-size: 0.9rem; color: var(--text); }
.pricing-features li::before { content: '+ '; color: var(--green); font-weight: 700; }

/* Auth page */
.auth-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
.auth-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Status page */
.status-header {
  background: var(--dark);
  color: white;
  padding: 2.5rem 1.5rem;
}
.status-header-inner { max-width: 700px; margin: 0 auto; }
.status-name { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.status-overall {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
}
.status-overall.up { background: var(--green); }
.status-overall.down { background: var(--red); }
.status-overall::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: white; }
.status-content { max-width: 700px; margin: 2rem auto; padding: 0 1.5rem; }
.status-monitor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.status-monitor-name { font-weight: 600; }
.status-monitor-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

/* Bar chart for uptime */
.uptime-bars {
  display: flex;
  gap: 2px;
  height: 28px;
  align-items: flex-end;
}
.uptime-bar {
  flex: 1;
  border-radius: 2px;
  min-height: 4px;
}
.uptime-bar.up { background: var(--green); }
.uptime-bar.down { background: var(--red); }
.uptime-bar.unknown { background: var(--border); }

/* Alert / flash */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  border: 1px solid;
}
.alert-success { background: var(--green-light); color: #065f46; border-color: #6ee7b7; }
.alert-error { background: var(--red-light); color: #991b1b; border-color: #fca5a5; }
.alert-info { background: var(--yellow-light); color: #92400e; border-color: #fcd34d; }

/* Empty state */
.empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: 0.5rem; }
.empty p { font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Footer */
.footer {
  background: var(--dark);
  color: #6b7280;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: white; }

/* Responsive */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero h1 { font-size: 2rem; }
}
