:root {
  --waybe: #1f86d1;
  --waybe-deep: #0f4f86;
  --waychef: #f68b1f;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --border: #e1e7ef;
  --text: #15202d;
  --muted: #5b6878;
  --ok: #1f9d55;
  --warn: #e2b100;
  --down: #d33c3c;
  --none: #a3aab5;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --waybe: #4aa6ec;
    --waychef: #ff9d3d;
    --bg: #0d141c;
    --surface: #141d27;
    --border: #233041;
    --text: #e8edf3;
    --muted: #93a2b4;
    --ok: #34c472;
    --warn: #f2c94c;
    --down: #ef5a5a;
    --none: #4b5664;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

[data-status="operacional"] { --c: var(--ok); }
[data-status="degradado"] { --c: var(--warn); }
[data-status="indisponivel"] { --c: var(--down); }
[data-status="sem_dados"] { --c: var(--none); }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--none));
  flex: none;
}

.top {
  background: linear-gradient(110deg, #0f4f86 0%, #1f86d1 60%, #3a95d8 100%);
  color: #fff;
  border-bottom: 4px solid #f68b1f;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 18px; letter-spacing: -0.01em; }
.brand-text span { font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.brand-text b { font-weight: 700; }
.brand-text .waybe { color: #fff; }
.brand-text .waychef { color: #ffc27f; }
.mark { position: relative; width: 34px; height: 34px; flex: none; }
.mark i { position: absolute; width: 22px; height: 22px; border-radius: 7px; }
.mark i:first-child { left: 0; top: 0; background: #fff; }
.mark i:last-child { right: 0; bottom: 0; background: #f68b1f; box-shadow: 0 0 0 2px #1f86d1; }
.sifat-chip { display: flex; align-items: center; background: #fff; border-radius: 10px; padding: 6px 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.sifat-chip img { display: block; height: 30px; width: auto; }
.updated { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; align-self: flex-start; }

.overall {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 24px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--c);
  box-shadow: 0 1px 2px rgba(15, 79, 134, 0.06);
}
.overall .dot { width: 14px; height: 14px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent); }
.overall h1 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.overall p { margin: 2px 0 0; color: var(--muted); }

.group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 79, 134, 0.06);
}
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--waybe) 6%, var(--surface));
}
.group-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--waybe);
  padding-left: 10px;
  border-left: 3px solid var(--waychef);
}
.badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  padding: 3px 10px;
  border-radius: 999px;
}

.components { list-style: none; margin: 0; padding: 0; }
.component { padding: 14px 20px 12px; border-top: 1px solid var(--border); }
.component:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.name { font-weight: 500; }
.detail { color: var(--muted); font-size: 13px; }
.state { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--c); }

.history { display: flex; gap: 2px; height: 28px; margin-top: 10px; }
.bar { flex: 1; min-width: 0; border-radius: 2px; background: var(--c); opacity: 0.85; transition: opacity 0.15s; }
.bar:hover { opacity: 1; }
.history-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.uptime { font-weight: 600; color: var(--waybe); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; padding: 0; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 6px; }

.foot { color: var(--muted); font-size: 12px; padding-top: 24px; padding-bottom: 40px; }

@media (max-width: 560px) {
  .top .wrap { padding-top: 14px; padding-bottom: 14px; gap: 10px; }
  .sifat-chip { padding: 4px 8px; }
  .sifat-chip img { height: 22px; }
  .overall { flex-wrap: wrap; gap: 8px 14px; }
  .overall > div { flex: 1; min-width: 0; }
  .updated { margin-left: 28px; text-align: left; flex-basis: 100%; }
  .mark { display: none; }
  .history { gap: 1px; }
  .detail { display: none; }
}
