/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:   #00875a;
  --yellow:  #ff8b00;
  --orange:  #de350b;
  --red:     #bf1650;
  --blue:    #0052cc;
  --gray-50: #f4f5f7;
  --gray-100:#ebecf0;
  --gray-200:#dfe1e6;
  --gray-400:#97a0af;
  --gray-600:#5e6c84;
  --gray-800:#172b4d;
  --white:   #ffffff;
  --radius:  6px;
  --shadow:  0 1px 3px rgba(9,30,66,.12), 0 0 1px rgba(9,30,66,.08);
  --shadow-md: 0 3px 8px rgba(9,30,66,.16);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 28px; width: auto; display: block; }
.logo-sep { width: 1px; height: 20px; background: var(--gray-200); }
.logo-sub { font-size: 12px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; }

.header-right { display: flex; align-items: center; gap: 16px; }
.refresh-info { font-size: 12px; color: var(--gray-400); display: flex; gap: 4px; align-items: center; }
.countdown { font-weight: 600; color: var(--gray-600); min-width: 28px; }

.lang-switch { display: flex; align-items: center; gap: 4px; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--gray-400);
  padding: 3px 6px; border-radius: 3px; transition: color .15s;
}
.lang-btn.active { color: var(--blue); }
.lang-btn:hover { color: var(--gray-800); }
.lang-sep { color: var(--gray-200); }

/* ── Banner ──────────────────────────────────────────────────────────────── */
.banner {
  background: var(--green);
  color: var(--white);
  transition: background .3s;
}
.banner.degraded    { background: var(--yellow); }
.banner.partial_outage { background: var(--orange); }
.banner.major_outage   { background: var(--red); }

.banner-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.banner-icon { font-size: 36px; }
.banner-title { font-size: 24px; font-weight: 700; }
.banner-sub { font-size: 14px; opacity: .85; margin-top: 3px; }

/* ── Main layout ─────────────────────────────────────────────────────────── */
.main {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.loading-row {
  padding: 20px;
  color: var(--gray-400);
  text-align: center;
  font-size: 14px;
}

/* ── Services Card ───────────────────────────────────────────────────────── */
.services-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.service-group-label {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
}

.service-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.service-row:last-child { border-bottom: none; }
.service-row:hover { background: var(--gray-50); }

.service-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 14px;
  flex-shrink: 0;
}
.dot-operational   { background: var(--green); box-shadow: 0 0 0 3px rgba(0,135,90,.15); }
.dot-degraded      { background: var(--yellow); box-shadow: 0 0 0 3px rgba(255,139,0,.15); }
.dot-partial_outage { background: var(--orange); box-shadow: 0 0 0 3px rgba(222,53,11,.15); }
.dot-major_outage  { background: var(--red); box-shadow: 0 0 0 3px rgba(191,22,80,.15); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(191,22,80,.15); }
  50%       { box-shadow: 0 0 0 6px rgba(191,22,80,.25); }
}

.service-info { flex: 1; }
.service-name { font-size: 15px; font-weight: 500; }
.service-desc { font-size: 12px; color: var(--gray-400); margin-top: 1px; }
.service-detail { font-size: 11px; color: var(--gray-400); margin-top: 2px; font-style: italic; }

.service-meta { text-align: right; }
.service-status-label { font-size: 13px; font-weight: 500; }
.status-label-operational   { color: var(--green); }
.status-label-degraded      { color: var(--yellow); }
.status-label-partial_outage { color: var(--orange); }
.status-label-major_outage  { color: var(--red); }
.service-latency { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Uptime ──────────────────────────────────────────────────────────────── */
.uptime-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.uptime-row {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.uptime-row:last-child { border-bottom: none; }

.uptime-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.uptime-name { font-size: 14px; font-weight: 500; }

.uptime-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.uptime-bars {
  display: flex;
  gap: 2px;
  align-items: center;
  width: 100%;
}
.uptime-bar {
  flex: 1;
  height: 24px;
  border-radius: 2px;
  min-width: 2px;
  cursor: default;
}
.uptime-bar-ok       { background: var(--green); }
.uptime-bar-partial  { background: var(--yellow); }
.uptime-bar-outage   { background: var(--red); }
.uptime-bar-nodata   { background: var(--gray-200); }

.uptime-legend {
  display: flex;
  justify-content: space-between;
  padding: 4px 20px 10px;
  font-size: 11px;
  color: var(--gray-400);
}

/* ── Incidents ───────────────────────────────────────────────────────────── */
.incidents-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.incident-row {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.incident-row:last-child { border-bottom: none; }

.incident-header { display: flex; align-items: flex-start; gap: 12px; }
.incident-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.incident-status-dot.resolved   { background: var(--green); }
.incident-status-dot.investigating { background: var(--red); animation: pulse 1.5s infinite; }
.incident-status-dot.monitoring { background: var(--yellow); }

.incident-title { font-size: 14px; font-weight: 600; }
.incident-meta  { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.incident-detail { font-size: 12px; color: var(--gray-600); margin-top: 6px; font-style: italic; }

.incident-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-resolved     { background: #e3fcef; color: var(--green); }
.badge-investigating { background: #ffebe6; color: var(--red); }
.badge-monitoring   { background: #fffae6; color: var(--yellow); }

.no-incidents {
  padding: 32px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
}
.no-incidents-icon { font-size: 32px; margin-bottom: 8px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  margin-top: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .banner-title { font-size: 18px; }
  .banner-icon { font-size: 28px; }
  .service-name { font-size: 13px; }
  .logo-img { height: 22px; }
  .logo-sub { display: none; }
  .logo-sep { display: none; }
  .refresh-info { display: none; }
}
