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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #f5f7fa;
  color: #2c3e50;
  line-height: 1.5;
  min-height: 100vh;
}

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

/* Navbar */
.navbar {
  background: #1e293b;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  color: white;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: white;
}

.nav-user {
  color: #94a3b8;
  font-size: 14px;
}

.nav-logout {
  color: #f87171 !important;
}

/* Headings */
h1 { font-size: 28px; margin-bottom: 8px; }
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 16px; color: #64748b; font-weight: 600; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.monitor-url a {
  color: #64748b;
  font-size: 14px;
  text-decoration: none;
}

.monitor-url a:hover { color: #3b82f6; text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn:hover { background: #f1f5f9; }

.btn-primary {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.btn-primary:hover { background: #2563eb; }

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover { background: #fee2e2; }

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.btn-check {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.btn-check:hover { background: #d1fae5; }

.btn-check:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: #334155;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400 !important;
}

.checkbox-label input { width: auto !important; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.monitor-form {
  background: white;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  max-width: 700px;
}

/* Auth pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  padding: 24px;
}

.auth-box {
  background: white;
  padding: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 420px;
}

.auth-box h1 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 4px;
}

.auth-box h2 {
  text-align: center;
  color: #64748b;
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 24px;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #64748b;
}

.auth-link a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Status indicators */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.status-up { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-down { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.status-pending { background: #94a3b8; }

.status-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Summary bar */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.summary-item {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.summary-label {
  display: block;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.summary-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
}

.summary-up .summary-value { color: #10b981; }
.summary-down .summary-value { color: #ef4444; }
.summary-pending .summary-value { color: #94a3b8; }

/* Tables */
.monitors-table,
.data-table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
}

.monitors-table th,
.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
}

.monitors-table td,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  vertical-align: middle;
}

.monitors-table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: none;
}

.monitors-table tr:hover td {
  background: #f8fafc;
}

.monitor-name {
  color: #1e293b;
  font-weight: 500;
  text-decoration: none;
}

.monitor-name:hover { color: #3b82f6; }

.url-cell {
  color: #64748b;
  font-size: 13px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uptime-pct {
  font-weight: 600;
}

.uptime-good { color: #10b981; }
.uptime-ok { color: #f59e0b; }
.uptime-bad { color: #ef4444; }

.muted, .muted-cell {
  color: #94a3b8;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-up {
  background: #d1fae5;
  color: #065f46;
}

.badge-down {
  background: #fee2e2;
  color: #991b1b;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.stat-card h3 {
  margin-bottom: 8px;
}

.stat-uptime {
  font-size: 36px;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 8px;
}

.stat-detail {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 2px;
}

/* Detail sections */
.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.empty-state h2 {
  color: #475569;
  margin-bottom: 8px;
}

.empty-state p {
  color: #64748b;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .summary-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    gap: 12px;
  }
  .monitors-table {
    font-size: 12px;
  }
  .url-cell {
    max-width: 150px;
  }
}
