:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --border: #dbe1e8;
  --navy: #102a43;
  --blue: #1769aa;
  --blue-light: #e8f2fa;
  --green: #18794e;
  --green-bg: #eaf8f1;
  --amber: #9a6700;
  --amber-bg: #fff6d8;
  --red: #b42318;
  --red-bg: #fff0ee;
  --shadow: 0 8px 30px rgba(16, 42, 67, .08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); }
.container { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.site-header { background: var(--navy); color: #fff; border-bottom: 4px solid var(--blue); }
.header-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-weight: 800; letter-spacing: .14em; font-size: 23px; }
.brand-subtitle { opacity: .8; margin-top: 4px; font-size: 14px; letter-spacing: .03em; }
.admin-link { color: #fff; text-decoration: none; font-size: 14px; opacity: .9; }
.admin-link:hover { opacity: 1; text-decoration: underline; }
.header-actions { display: flex; gap: 18px; align-items: center; }
.page-stack { display: grid; gap: 22px; padding: 30px 0 48px; }
.section-card, .overall-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.overall-card { display: flex; gap: 18px; align-items: center; padding: 26px 28px; border-left: 6px solid var(--green); }
.overall-card.issue { border-left-color: var(--red); }
.overall-card.loading { border-left-color: var(--blue); }
.overall-card h1 { margin: 0 0 7px; font-size: clamp(24px, 3vw, 34px); }
.overall-card p { margin: 0; color: var(--muted); }
.status-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px var(--green-bg); flex: 0 0 auto; }
.issue .status-dot { background: var(--red); box-shadow: 0 0 0 6px var(--red-bg); }
.loading .status-dot { background: var(--blue); box-shadow: 0 0 0 6px var(--blue-light); }
.section-card { padding: 26px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2, .admin-summary h1 { margin: 3px 0 0; font-size: 22px; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; color: var(--blue); font-weight: 700; font-size: 11px; }
.auto-refresh, .muted { color: var(--muted); font-size: 13px; }
.service-groups { display: grid; gap: 24px; }
.service-group h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.service-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 13px 0; border-top: 1px solid var(--border); }
.service-row:first-of-type { border-top: 0; }
.service-name { font-weight: 600; }
.service-message { color: var(--muted); font-size: 12px; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.operational { color: var(--green); background: var(--green-bg); }
.badge.degraded, .badge.recovering { color: var(--amber); background: var(--amber-bg); }
.badge.unhealthy, .badge.issue { color: var(--red); background: var(--red-bg); }
.badge.unknown { color: var(--muted); background: #eef1f5; }
.incident-list, .admin-incidents { display: grid; gap: 16px; }
.incident-card { border: 1px solid #f0c8c3; background: #fffafa; border-radius: 12px; padding: 20px; }
.incident-card.admin { background: #fff; border-color: var(--border); }
.incident-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.incident-card h3 { margin: 0 0 5px; font-size: 18px; }
.incident-meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.incident-message { margin: 15px 0; padding: 12px 14px; background: var(--surface-2); border-radius: 9px; line-height: 1.5; }
.timeline { margin: 18px 0 0; border-left: 2px solid var(--border); padding-left: 18px; display: grid; gap: 14px; }
.timeline-item { position: relative; font-size: 13px; line-height: 1.5; }
.timeline-item::before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); left: -23px; top: 5px; }
.timeline-time { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.recent-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13px; }
.recent-row:first-child { border-top: 0; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 22px 0 34px; }
.hidden { display: none !important; }
.skeleton-row { height: 42px; margin: 6px 0; border-radius: 8px; background: linear-gradient(90deg, #eef1f5, #f8fafc, #eef1f5); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.admin-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.admin-summary p { max-width: 780px; line-height: 1.55; }
.identity-pill { background: var(--blue-light); color: var(--navy); border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-controls { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; margin: 18px 0; }
.status-button { border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 12px 9px; cursor: pointer; min-height: 83px; text-align: left; transition: .12s ease; }
.status-button:hover { transform: translateY(-1px); border-color: var(--blue); }
.status-button.current { border: 2px solid var(--blue); background: var(--blue-light); }
.status-button.resolve { border-color: #b9dfca; }
.status-button .number { display: block; font-size: 22px; font-weight: 800; color: var(--navy); }
.status-button .label { display: block; font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 5px; }
.update-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
label { display: grid; gap: 7px; color: var(--navy); font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 10px 11px; font: inherit; color: var(--text); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid #b8dcf5; border-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.button { border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 700; cursor: pointer; background: var(--blue); color: #fff; }
.button.secondary { background: #eef2f6; color: var(--navy); border: 1px solid var(--border); }
.button.danger { background: var(--red); }
.button:disabled { opacity: .55; cursor: wait; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.checkbox-row input { width: auto; }
.flash { padding: 13px 15px; border-radius: 9px; font-size: 13px; border: 1px solid; }
.flash.success { color: var(--green); background: var(--green-bg); border-color: #b9dfca; }
.flash.error { color: var(--red); background: var(--red-bg); border-color: #f0c8c3; }
.warning-line { font-size: 12px; color: var(--amber); margin-top: 8px; }
.communication-note { border-left: 4px solid var(--blue); background: var(--blue-light); padding: 11px 13px; margin: 14px 0 4px; border-radius: 6px; color: var(--navy); font-size: 12px; line-height: 1.5; }

@media (max-width: 820px) {
  .status-controls { grid-template-columns: 1fr; }
  .status-button { min-height: auto; }
  .update-grid, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .admin-summary { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 22px, 1120px); }
  .section-card, .overall-card { padding: 18px; }
  .header-inner { min-height: 74px; }
  .admin-link { font-size: 12px; }
  .incident-top, .section-heading { flex-direction: column; }
}

/* v1.5.7 admin control hardening */
select, select option {
  color-scheme: light;
  background-color: #ffffff;
  color: var(--text);
}
.select-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.button.compact { padding: 9px 11px; white-space: nowrap; }
.field-status { display: block; margin-top: 6px; font-size: 12px; }
.error-text { color: #b42318; }
.test-card strong { color: var(--text); }
@media (max-width: 720px) {
  .select-row { grid-template-columns: 1fr; }
}
