:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-input: #232631;
    --border: #2a2d3a;
    --text: #e4e6eb;
    --text-muted: #8b8fa3;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.3em; font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--text-muted); font-size: 0.9em; }
.nav-links a:hover { color: var(--text); }

/* Buttons */
.btn { display: inline-block; padding: 8px 18px; border-radius: var(--radius); font-size: 0.9em; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 12px 28px; font-size: 1em; }
.btn-sm { padding: 4px 10px; font-size: 0.8em; }
.btn-full { width: 100%; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 0.9em; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 0.9em;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group small { color: var(--text-muted); font-size: 0.8em; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Auth */
.auth-form { max-width: 400px; margin: 60px auto; background: var(--bg-card); padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); }
.auth-form h2 { margin-bottom: 24px; text-align: center; }
.auth-link { text-align: center; margin-top: 16px; font-size: 0.9em; color: var(--text-muted); }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9em; }
.alert-error { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* Hero */
.hero { text-align: center; padding: 80px 0 60px; }
.hero h1 { font-size: 3em; font-weight: 800; line-height: 1.2; margin-bottom: 16px; background: linear-gradient(135deg, var(--primary), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 1.2em; color: var(--text-muted); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; padding: 40px 0; }
.feature-card { background: var(--bg-card); padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); }
.feature-icon { font-size: 2em; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.9em; }

/* Pricing */
.pricing-section { padding: 60px 0; text-align: center; }
.pricing-section h2 { margin-bottom: 40px; font-size: 2em; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.pricing-card { background: var(--bg-card); padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); text-align: center; position: relative; }
.pricing-card.featured { border-color: var(--primary); }
.pricing-card .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 0.8em; }
.pricing-card h3 { margin-bottom: 12px; }
.price { font-size: 2.5em; font-weight: 700; margin-bottom: 24px; }
.price span { font-size: 0.4em; color: var(--text-muted); }
.pricing-card ul { list-style: none; margin-bottom: 24px; }
.pricing-card li { padding: 6px 0; color: var(--text-muted); font-size: 0.9em; }

/* Dashboard */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; padding: 30px 0 20px; }
.dashboard-actions { display: flex; gap: 10px; }
.stats-bar { display: flex; gap: 24px; padding: 20px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 24px; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.8em; font-weight: 700; }
.stat-label { font-size: 0.8em; color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* Status dots */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot-gray { background: #555; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75em; font-weight: 600; text-transform: uppercase; }
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-yellow { background: rgba(234,179,8,0.15); color: var(--yellow); }

/* Monitor list */
.monitors-list { display: flex; flex-direction: column; gap: 8px; }
.monitor-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.monitor-info { flex: 1; }
.monitor-name { color: var(--text); font-weight: 600; font-size: 1em; }
.monitor-name:hover { color: var(--primary); }
.monitor-meta { font-size: 0.8em; color: var(--text-muted); display: block; }
.monitor-url { font-size: 0.8em; color: var(--text-muted); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-actions { display: flex; gap: 6px; }
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* Monitor detail */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 30px 0 20px; }
.detail-meta { color: var(--text-muted); font-size: 0.9em; }
.chart-container { background: var(--bg-card); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); margin: 20px 0; }
.checks-table { overflow-x: auto; }
.checks-table table { width: 100%; border-collapse: collapse; }
.checks-table th, .checks-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85em; }
.checks-table th { color: var(--text-muted); font-weight: 600; }
.error-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }

/* Incidents */
.incidents-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.incident-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.incident-date { color: var(--text-muted); font-size: 0.8em; margin-left: auto; }

/* Settings */
.settings-section { background: var(--bg-card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; }
.settings-section h3 { margin-bottom: 16px; }
.api-key { display: block; padding: 10px; background: var(--bg-input); border-radius: var(--radius); word-break: break-all; font-size: 0.85em; }
.text-muted { color: var(--text-muted); font-size: 0.85em; }
.alert-channel-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-bottom: 1px solid var(--border); }
.plan-upgrade { display: flex; gap: 10px; }

/* Form page */
.form-page { max-width: 700px; margin: 30px auto; background: var(--bg-card); padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); }
.form-page h2 { margin-bottom: 24px; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-content { background: var(--bg-card); padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; max-width: 500px; }

/* Status Page */
.status-page-body { background: var(--bg); }
.status-page { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.status-header { text-align: center; margin-bottom: 40px; }
.status-header h1 { font-size: 2em; margin-bottom: 16px; }
.overall-status { display: inline-block; padding: 12px 28px; border-radius: var(--radius); font-size: 1.1em; font-weight: 600; }
.status-operational { background: rgba(34,197,94,0.15); color: var(--green); }
.status-degraded { background: rgba(234,179,8,0.15); color: var(--yellow); }
.status-outage { background: rgba(239,68,68,0.15); color: var(--red); }

.status-category { margin-bottom: 32px; }
.status-category h2 { font-size: 1.1em; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.status-monitor { background: var(--bg-card); padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 8px; }
.status-monitor-header { display: flex; align-items: center; margin-bottom: 8px; }
.status-monitor-name { font-weight: 600; flex: 1; }
.status-monitor-uptime { color: var(--text-muted); font-size: 0.85em; }

/* Uptime bar */
.uptime-bar { display: flex; gap: 1px; height: 28px; }
.uptime-day { flex: 1; border-radius: 2px; min-width: 2px; transition: opacity 0.2s; cursor: pointer; }
.uptime-day:hover { opacity: 0.7; }
.day-green { background: var(--green); }
.day-yellow { background: var(--yellow); }
.day-red { background: var(--red); }
.day-nodata { background: #333; }
.uptime-bar-labels { display: flex; justify-content: space-between; font-size: 0.7em; color: var(--text-muted); margin-top: 4px; }

/* Status incidents */
.status-incidents { margin-top: 40px; }
.status-incidents h2 { margin-bottom: 16px; }
.incident-item { background: var(--bg-card); padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 8px; }
.incident-header { display: flex; align-items: center; gap: 10px; }
.incident-desc { color: var(--text-muted); font-size: 0.9em; margin-top: 8px; }
.incident-resolved { color: var(--green); font-size: 0.85em; margin-top: 4px; }

/* Subscribe */
.status-subscribe { text-align: center; margin-top: 40px; padding: 32px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.subscribe-form { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.subscribe-form input { max-width: 300px; }

.status-footer { text-align: center; margin-top: 40px; color: var(--text-muted); font-size: 0.85em; }

@media (max-width: 768px) {
    .hero h1 { font-size: 2em; }
    .stats-bar { flex-wrap: wrap; }
    .monitor-row { flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; }
    .detail-header { flex-direction: column; gap: 12px; }
}
