:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --purple: #6d28d9;
  --purple-700: #5b21b6;
  --green: #16a34a;
  --yellow: #d97706;
  --blue: #2563eb;
  --red: #dc2626;
  --gray: #6b7280;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
}

.header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 30;
  transition: box-shadow 160ms ease;
}

.header--scrolled {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand__logo {
  height: 34px;
  width: auto;
  display: block;
}

.statusbar {
  padding: 14px 0 0;
}

.overall {
  width: 100%;
  border-radius: 6px;
  padding: 14px 16px;
  font-weight: 600;
  color: #ffffff;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.meta__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meta__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.badge--online {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.badge--maintenance {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.badge--offline {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.badge--unknown {
  border-color: rgba(107, 114, 128, 0.35);
  background: rgba(107, 114, 128, 0.12);
  color: #374151;
}

.contact {
  position: relative;
}

.contact__button {
  appearance: none;
  border: 1px solid var(--purple);
  background: var(--purple);
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.contact__button:hover {
  background: var(--purple-700);
  border-color: var(--purple-700);
}

.contact__button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 180px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  z-index: 20;
}

.contact__item {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.contact__item:hover {
  background: #f8fafc;
}

.contact__item--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.overall--loading {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}

.overall--operational {
  background: var(--green);
}

.overall--maintenance {
  background: var(--yellow);
}

.overall--major_outage {
  background: var(--red);
}

.overall--unknown {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 28px);
  }

  .brand__logo {
    height: 28px;
  }

  .contact__button {
    padding: 9px 10px;
    font-size: 13px;
  }
}

.panel {
  padding: 28px 0;
}

.panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.panel__title:empty {
  display: none;
}

.incidents {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.incidents__title {
  font-weight: 700;
  color: var(--text);
}

.incident {
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: 10px;
  background: #ffffff;
  padding: 12px 14px;
}

.incident__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.incident__label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.incident--active {
  padding: 14px 16px;
}

.incident__meta {
  font-size: 12px;
  color: var(--muted);
}

.incident__headline {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.incident__time {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.incident__affected {
  margin: 10px 0 12px;
}

.incident__affectedLabel {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.incident__affectedList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.pill--muted {
  color: var(--muted);
  background: #f8fafc;
}

.incident__details {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.incident__detailsSummary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.incident__detailsSummary::-webkit-details-marker {
  display: none;
}

.incident__detailsSummary::marker {
  content: "";
}

.incident__body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.incident__body--pre {
  white-space: pre-line;
}

.incident--history {
  background: #ffffff;
}

.incident--none {
  border-left-color: var(--gray);
}

.incident--success {
  border-left-color: var(--green);
}

.incident--info {
  border-left-color: var(--blue);
}

.incident--warning {
  border-left-color: var(--yellow);
}

.incident--danger {
  border-left-color: var(--red);
}

.history {
  display: grid;
  gap: 14px;
}

.history__day {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.history__day:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.history__date {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}

.history__content {
  display: grid;
  gap: 10px;
}

.history__empty {
  color: var(--muted);
  font-size: 14px;
}

.error {
  margin: 8px 0 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 6px;
}

.list {
  display: grid;
  gap: 18px;
}

.group {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.group__summary::-webkit-details-marker {
  display: none;
}

.group__summary::marker {
  content: "";
}

.group__summaryLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.group__titleText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group__summaryRight {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group__count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.group__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
  flex: 0 0 auto;
}

.group[open] .group__chev {
  transform: rotate(45deg);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.thead th:last-child {
  text-align: right;
}

.tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.tbody tr:hover td {
  background: #f3f4f6;
}

.tbody tr:last-child td {
  border-bottom: none;
}

.table__empty {
  padding: 14px;
  color: var(--muted);
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  letter-spacing: 0.1px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gray);
  flex: 0 0 auto;
}

.dot--online {
  background: var(--green);
}

.dot--offline {
  background: var(--red);
}

.dot--maintenance {
  background: var(--yellow);
}

.dot--unknown {
  background: var(--gray);
}

.cell-status {
  text-align: right;
  font-weight: 600;
  font-size: 14px;
}

.cell-status--online {
  color: var(--green);
}

.cell-status--offline {
  color: var(--red);
}

.cell-status--maintenance {
  color: var(--yellow);
}

.cell-status--unknown {
  color: var(--gray);
}

@media (max-width: 520px) {
  .container {
    width: min(980px, calc(100% - 26px));
  }
}

