:root {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background-color: #f5f7fb;
  color: #0f172a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #0f172a;
}

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

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

.page-header h1 {
  margin: 4px 0 8px;
  font-size: 32px;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.header-subtitle {
  margin: 0;
  color: #6b7280;
}

.header-actions .button {
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
}

.button-outline {
  border-color: #d1d5db;
  color: #111827;
}

.button-solid {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.status-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 32px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.status-banner p {
  margin: 0;
}

.banner-label {
  font-weight: 600;
  font-size: 18px;
}

.banner-message {
  margin-top: 4px;
  color: #374151;
}

.banner-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  color: #1f2937;
}

.status-banner.status-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.status-banner.status-partial {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.status-banner.status-major {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.status-banner.status-idle {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
}

.system-status .section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.system-status h2 {
  margin: 0;
  font-size: 20px;
}

.muted {
  color: #6b7280;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.window-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.window-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  gap: 4px;
}

.window-form select,
.window-form input[type='datetime-local'] {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  min-width: 160px;
}

.service-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.service-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.service-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-name {
  margin: 0;
  font-weight: 600;
}

.service-url {
  margin: 2px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.status-dot-up {
  background: #22c55e;
}

.status-dot-down {
  background: #dc2626;
}

.service-metrics {
  text-align: right;
}

.uptime-value {
  display: block;
  font-weight: 600;
}

.history-bar {
  margin-top: 16px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(2px, 1fr);
  gap: 2px;
  min-height: 14px;
}

.history-segment {
  width: 100%;
  height: 12px;
  border-radius: 2px;
  position: relative;
}

.history-segment::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 5;
  min-width: 140px;
}

.history-segment::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 4;
}

.history-segment:hover::after,
.history-segment:hover::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.history-ok {
  background: #22c55e;
}

.history-warning {
  background: #fbbf24;
}

.history-error {
  background: #ef4444;
}

.history-unknown {
  background: #d1d5db;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  background: #f9fafb;
  text-align: center;
}

.empty-state code {
  background: #111827;
  color: #f9fafb;
  padding: 2px 6px;
  border-radius: 4px;
}

.page-footer {
  margin-top: 48px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

@media (max-width: 640px) {
  .status-banner {
    flex-direction: column;
  }

  .service-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-metrics {
    text-align: left;
  }
}
