:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171d23;
  --panel-strong: #202932;
  --text: #f4f7fb;
  --muted: #9aa8b6;
  --line: #2b3540;
  --accent: #47c2a0;
  --accent-strong: #73dfba;
  --danger: #ff6b6b;
  --warning: #f2b84b;
  --info: #77a7ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top left, rgba(71, 194, 160, 0.16), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #06110e;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--accent-strong);
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1318;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.is-hidden {
  display: none !important;
}

.public-view,
.dashboard {
  display: grid;
  gap: 22px;
}

.login-panel {
  width: min(460px, 100%);
  margin: 10vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 35, 0.94);
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-block.compact {
  margin-bottom: 0;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #06110e;
  font-weight: 900;
}

.brand-block h1,
.topbar h1,
.hero-band h2,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block p,
.hero-band p,
.form-message {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-form,
.monitor-form,
.report-form {
  display: grid;
  gap: 16px;
}

.topbar,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.eyebrow,
.section-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.ghost-button {
  min-width: 84px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.hero-band,
.stat-card,
.monitor-card,
.monitor-form,
.report-form,
.status-panel,
.provider-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 35, 0.94);
  box-shadow: var(--shadow);
}

.hero-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 28px;
}

.hero-band h2 {
  max-width: 780px;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1;
}

.hero-status {
  display: grid;
  gap: 8px;
  min-width: 160px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel-strong);
}

.hero-status span {
  color: var(--muted);
}

.hero-status strong {
  color: var(--accent);
  font-size: 3rem;
  line-height: 1;
}

.public-grid,
.insight-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.report-form,
.status-panel {
  padding: 18px;
}

.provider-list,
.ranking-list,
.report-list,
.monitor-list {
  display: grid;
  gap: 12px;
}

.provider-card,
.monitor-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.provider-card div,
.monitor-title {
  display: grid;
  gap: 4px;
}

.provider-card span,
.monitor-title span,
.monitor-meta,
.report-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-pill {
  min-width: 92px;
  border-radius: 999px;
  padding: 7px 12px;
  text-align: center;
  color: #06110e;
  font-weight: 900;
}

.status-pill.normal,
.status-pill.online {
  background: var(--accent);
  color: #06110e;
}

.status-pill.atencao,
.status-pill.checking {
  background: var(--warning);
  color: #1d1303;
}

.status-pill.instavel,
.status-pill.offline {
  background: var(--danger);
  color: #260909;
}

.ranking-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.ranking-item span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
}

.ranking-item em {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(10px, 1fr));
  gap: 5px;
  align-items: end;
  min-height: 190px;
  padding-top: 12px;
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 0;
  height: 180px;
}

.bar-item span {
  align-self: end;
  min-height: 6px;
  border-radius: 6px 6px 0 0;
  background: var(--info);
}

.bar-item small {
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.report-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.report-card p {
  margin: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.stat-card.online strong {
  color: var(--accent);
}

.stat-card.offline strong {
  color: var(--danger);
}

.monitor-form {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  padding: 18px;
}

.monitor-form button {
  min-width: 120px;
}

.monitor-section {
  display: grid;
  gap: 14px;
}

.monitor-card {
  grid-template-columns: 1fr auto auto;
}

.monitor-title strong {
  overflow-wrap: anywhere;
}

.delete-button {
  width: 44px;
  min-width: 44px;
  background: #2b1517;
  color: #ffb4b4;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .hero-band,
  .public-grid,
  .insight-grid,
  .stats-grid,
  .monitor-form,
  .monitor-card,
  .provider-card {
    grid-template-columns: 1fr;
  }

  .hero-band {
    padding: 22px;
  }

  .hero-status {
    min-width: 0;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
  }

  .bar-chart {
    gap: 3px;
    overflow-x: auto;
  }

  .bar-item {
    width: 18px;
  }

  .delete-button,
  .ghost-button,
  .monitor-form button {
    width: 100%;
  }
}
