:root {
  --green: #2fcc66;
  --yellow: #f5a623;
  --orange: #ea8c2e;
  --red: #e0492a;
  --gray: #d8dee4;
  --text: #1c2127;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2f6fed;
  --accent-tint: rgba(47, 111, 237, 0.14);
  --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fafafa;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 20px;
}

.back-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 28px;
}

.banner--operational { background: #e7f8ee; color: #1a7f43; }
.banner--degraded { background: #fdf0dd; color: #9a5b0a; }
.banner--down { background: #fbe7e3; color: #ad3219; }
.banner--maintenance { background: #e8effd; color: #2454b8; }
.banner--unknown { background: #f1f2f4; color: var(--muted); }

.banner-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.banner-detail {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}

.components {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.component {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.component:last-child {
  border-bottom: none;
}

.component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
}

.component-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot--operational, .component-status--operational { color: var(--green); }
.dot--degraded, .component-status--degraded { color: var(--yellow); }
.dot--down, .component-status--down { color: var(--red); }
.dot--unknown, .component-status--unknown { color: var(--gray); }

.dot--operational { background: var(--green); }
.dot--degraded { background: var(--yellow); }
.dot--down { background: var(--red); }
.dot--unknown { background: var(--gray); }

.component-status {
  font-size: 13px;
  font-weight: 600;
}

.component-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.history-bar {
  display: flex;
  gap: 2px;
  margin-top: 12px;
}

.history-cell {
  flex: 1;
  height: 28px;
  border-radius: 1px;
  background: var(--gray);
}

.history-cell--operational { background: var(--green); }
.history-cell--degraded { background: var(--yellow); }
.history-cell--down { background: var(--red); }
.history-cell--nodata { background: var(--gray); opacity: 0.5; }

.history-range {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.incidents {
  margin-top: 36px;
}

.incidents h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.incident {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
}

.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}

.incident-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f1f2f4;
  color: var(--muted);
}

.incident-status--resolved { background: #e7f8ee; color: #1a7f43; }
.incident-status--investigating { background: #fbe7e3; color: #ad3219; }
.incident-status--identified { background: #fdecdc; color: #b3591a; }
.incident-status--monitoring { background: #fdf0dd; color: #9a5b0a; }

.incident-updates {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incident-update {
  font-size: 13px;
}

.incident-update-time {
  color: var(--muted);
  font-size: 11px;
  margin-right: 8px;
}

.incident-update-status {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

.incident-update p {
  margin: 4px 0 0;
}

.empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.page-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.page--admin {
  max-width: 860px;
}

.admin-subtitle {
  margin: -12px 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.admin-card h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 18px;
}

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

.admin-form .field--full {
  grid-column: 1 / -1;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.admin-form textarea {
  resize: vertical;
  min-height: 64px;
}

.admin-form input:hover,
.admin-form select:hover,
.admin-form textarea:hover {
  border-color: #c7ccd4;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.admin-form button {
  grid-column: 1 / -1;
  justify-self: start;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-form button:hover {
  background: #2559c9;
}

.admin-incident {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gray);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}

.admin-incident:last-child {
  margin-bottom: 0;
}

.admin-incident--investigating { border-left-color: var(--red); }
.admin-incident--identified { border-left-color: var(--orange); }
.admin-incident--monitoring { border-left-color: var(--yellow); }
.admin-incident--resolved { border-left-color: var(--green); }

.update-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-form textarea {
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  resize: vertical;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.update-form textarea:hover {
  border-color: #c7ccd4;
}

.update-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.update-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.update-form-footer select {
  font: inherit;
  font-size: 13px;
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
  color: var(--text);
}

.update-form-footer select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.update-form-footer button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.update-form-footer button:hover {
  background: #f5f6f8;
  border-color: #c7ccd4;
}
