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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fa;
  color: #374151;
  line-height: 1.6;
}

a { color: #10519d; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  padding: 24px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
}
.logo img { height: 36px; }

/* Status Banner */
.status-banner {
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.banner-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.banner-issue { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Subscribe bar */
.subscribe-bar { text-align: right; margin-bottom: 24px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-subscribe { background: #10519d; color: #fff; }
.btn-subscribe:hover { background: #0d4080; text-decoration: none; }
.btn { background: #10519d; color: #fff; }
.btn:hover { background: #0d4080; text-decoration: none; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* Sections */
.section { margin-bottom: 32px; }
.section h2 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

/* Component rows */
.component-group { margin-bottom: 16px; }
.group-name {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0 4px;
}
.component-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  margin-bottom: -1px;
}
.component-row:first-child { border-radius: 6px 6px 0 0; }
.component-row:last-child { border-radius: 0 0 6px 6px; margin-bottom: 0; }
.component-row:only-child { border-radius: 6px; }
.component-name { font-weight: 500; }
.component-status {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.status-operational { background: #22c55e; }
.status-degraded { background: #eab308; }
.status-partial_outage { background: #f97316; }
.status-major_outage { background: #ef4444; }
.status-maintenance { background: #3b82f6; }

/* Status text colors */
.status-text-operational { color: #16a34a; }
.status-text-degraded { color: #ca8a04; }
.status-text-partial_outage { color: #ea580c; }
.status-text-major_outage { color: #dc2626; }
.status-text-maintenance { color: #2563eb; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  color: #fff;
}
.badge-sm { padding: 2px 8px; font-size: 11px; }
.badge-investigating { background: #f97316; }
.badge-identified { background: #eab308; }
.badge-monitoring { background: #3b82f6; }
.badge-in_progress { background: #8b5cf6; }
.badge-verifying { background: #06b6d4; }
.badge-resolved { background: #22c55e; }
.badge-scheduled { background: #6366f1; }
.badge-maintenance { background: #3b82f6; }
.badge-completed { background: #22c55e; }

/* Incident cards */
.incident-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.incident-active { border-left: 4px solid #ef4444; }
.incident-maintenance { border-left: 4px solid #3b82f6; }
.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.incident-title { font-weight: 600; color: #111827; }
.incident-desc { color: #6b7280; margin-top: 8px; font-size: 14px; }
.incident-date { color: #9ca3af; font-size: 13px; white-space: nowrap; }
.incident-schedule { color: #6b7280; font-size: 13px; margin-top: 8px; }

/* Incident updates on index */
.incident-updates { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.update-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}
.update-time { color: #9ca3af; white-space: nowrap; font-size: 12px; }

/* Incident detail */
.incident-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.incident-detail-header h1 { font-size: 24px; }
.affected-components { margin-top: 16px; }
.affected-components h3 { font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.affected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  font-size: 13px;
  margin-right: 8px;
  margin-bottom: 4px;
}

/* Timeline */
.timeline { }
.timeline-item {
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.timeline-message { color: #374151; font-size: 14px; }

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 { margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0 4px;
}
.modal-close:hover { color: #111827; }

/* Subscribe form */
.subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
}
.subscribe-form input[type="email"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

/* Message boxes */
.message { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.message-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.message-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Footer */
footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}
.footer-links { margin-bottom: 8px; }
.footer-links a {
  color: #6b7280;
  margin: 0 12px;
  font-size: 13px;
}
.copyright { color: #9ca3af; font-size: 12px; }

/* Timezone picker */
.timezone-picker {
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}
.timezone-picker select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  color: #374151;
  background: #fff;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.pagination a, .pagination span {
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}
.pagination .current {
  background: #10519d;
  color: #fff;
  border-color: #10519d;
}
.pagination-ellipsis {
  padding: 6px 8px;
  color: #9ca3af;
  border: none;
}

/* ===== ADMIN STYLES ===== */
.admin-nav {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 24px;
}
.admin-nav a {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}
.admin-nav a:hover { background: #e5e7eb; text-decoration: none; }
.admin-nav a.active { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

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

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: #111827; }
.stat-card .stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

/* Forms */
.form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}
.form-card h3 { margin-bottom: 16px; font-size: 16px; }
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-inline { display: flex; gap: 8px; align-items: end; }
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-check input[type="checkbox"] { width: auto; }

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f3f4f6; }
th { background: #f9fafb; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
tr:last-child td { border-bottom: none; }
td .actions { display: flex; gap: 4px; }

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .status-banner { font-size: 16px; padding: 12px 16px; }
  .incident-header { flex-direction: column; align-items: flex-start; }
  .component-row { padding: 8px 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .admin-nav { flex-wrap: wrap; }
}
