:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --bg-2: #e9edf5;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #101828;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #e4e7ec;
  --line-2: #eef1f5;
  --nav: #0b1220;
  --nav-2: #121a2b;
  --blue: #2f7cff;
  --teal: #15b79e;
  --green: #12805c;
  --amber: #b7791f;
  --red: #c43b4a;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 10px 26px rgba(16, 24, 40, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(47, 124, 255, 0.08), transparent 340px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(47, 124, 255, 0.12), transparent 220px),
    var(--nav);
  color: #ffffff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #dbe7ff);
  color: #0b1220;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand-block small {
  margin-top: 3px;
  color: #9aa8c7;
  font-size: 12px;
  font-weight: 700;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-list a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border-radius: 8px;
  color: #b8c4dc;
  font-size: 14px;
  font-weight: 800;
}

.nav-list a.active,
.nav-list a:hover {
  background: var(--nav-2);
  color: #ffffff;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.sidebar-card {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-card strong,
.sidebar-card small {
  display: block;
}

.sidebar-card strong {
  font-size: 18px;
}

.sidebar-card small {
  color: #9aa8c7;
  font-size: 12px;
  line-height: 1.45;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(21, 183, 158, 0.12);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer span,
.sidebar-footer strong {
  display: block;
}

.sidebar-footer span {
  color: #9aa8c7;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-footer strong {
  margin-top: 2px;
  font-size: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.page-title h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-title p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

select,
.search,
.login-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select:focus,
.search:focus,
.login-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 124, 255, 0.13);
}

.switch {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  width: 32px;
  height: 18px;
  position: relative;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.2s ease;
}

.switch span::after {
  content: "";
  width: 14px;
  height: 14px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.switch strong {
  font-size: 13px;
}

.primary-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
}

.primary-btn:disabled {
  opacity: 0.68;
}

.view-root {
  display: grid;
  gap: 16px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 22px;
  align-items: stretch;
  padding: 26px;
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(47, 124, 255, 0.18), transparent 44%),
    linear-gradient(135deg, #0b1220, #111c32);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero-label {
  color: #9ec0ff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-copy h2 {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 660px;
  margin: 14px 0 0;
  color: #c7d2ea;
  font-size: 15px;
  line-height: 1.6;
}

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

.hero-stats div {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-stats span,
.hero-stats small {
  color: #aebbd5;
  font-size: 11px;
  font-weight: 850;
}

.hero-stats strong {
  font-size: 24px;
  line-height: 1;
}

.metric-grid,
.grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two-one {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.live-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.8fr);
}

.metric-card,
.panel,
.subpage-head,
.system-card {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-height: 140px;
  display: grid;
  align-content: space-between;
  padding: 18px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #edf4ff;
}

.metric-icon.pulse {
  background: #e8faf6;
}

.metric-icon.warning {
  background: #fff7e6;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.large {
  min-height: 360px;
}

.realtime-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 18%, rgba(21, 183, 158, 0.18), transparent 32%),
    linear-gradient(135deg, #07111f, #12203a);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.realtime-hero h2 {
  max-width: 820px;
  margin: 9px 0 0;
  font-size: 34px;
  line-height: 1.1;
}

.realtime-hero p {
  max-width: 780px;
  margin: 11px 0 0;
  color: #c7d2ea;
  font-size: 14px;
  line-height: 1.55;
}

.realtime-pulse {
  min-width: 190px;
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.realtime-pulse > span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(21, 183, 158, 0.48);
  animation: livePulse 1.4s infinite;
}

.realtime-pulse strong {
  font-size: 18px;
}

.realtime-pulse small {
  color: #9fb0cf;
  font-size: 12px;
}

@keyframes livePulse {
  70% {
    box-shadow: 0 0 0 12px rgba(21, 183, 158, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(21, 183, 158, 0);
  }
}

.map-panel {
  min-height: 460px;
}

.world-map {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 45%, rgba(47, 124, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #0a1527, #07111f);
}

.world-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.68;
}

.world-shape path {
  fill: rgba(148, 163, 184, 0.18);
  stroke: rgba(207, 216, 232, 0.16);
  stroke-width: 2;
}

.map-gridline {
  position: absolute;
  pointer-events: none;
  opacity: 0.22;
}

.map-gridline.lat {
  left: 0;
  right: 0;
  height: 1px;
  background: #8aa3d8;
}

.map-gridline.lon {
  top: 0;
  bottom: 0;
  width: 1px;
  background: #8aa3d8;
}

.lat-a { top: 33%; }
.lat-b { top: 66%; }
.lon-a { left: 33%; }
.lon-b { left: 66%; }

.map-point {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(47, 124, 255, 0.2);
  color: #ffffff;
}

.map-point::before,
.map-point::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(47, 124, 255, 0.56);
  animation: mapPing 1.9s infinite;
}

.map-point::after {
  animation-delay: 0.55s;
}

.map-point span {
  width: 42%;
  height: 42%;
  position: relative;
  z-index: 2;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2dd4bf);
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.54);
}

@keyframes mapPing {
  from {
    transform: scale(0.75);
    opacity: 0.9;
  }
  to {
    transform: scale(1.75);
    opacity: 0;
  }
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b9c7dd;
  font-size: 13px;
  font-weight: 800;
}

.country-list {
  display: grid;
  gap: 10px;
  max-height: 390px;
  overflow: auto;
  padding-right: 4px;
}

.country-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.country-main,
.country-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.country-main {
  justify-content: flex-start;
}

.country-main > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  font-size: 20px;
}

.country-main strong,
.country-main small,
.country-stats strong,
.country-stats small {
  display: block;
}

.country-main strong {
  font-size: 13px;
}

.country-main small,
.country-stats small {
  color: var(--muted);
  font-size: 12px;
}

.country-stats strong {
  font-size: 20px;
}

.minute-bars {
  height: 190px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding: 12px 2px 0;
}

.minute-bar {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 18px;
  gap: 7px;
  align-items: end;
}

.minute-bar span {
  display: block;
  min-height: 6px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--blue), var(--teal));
  box-shadow: 0 8px 18px rgba(47, 124, 255, 0.18);
}

.minute-bar small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2,
.subpage-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.panel-head p,
.subpage-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.subpage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.search-wrap {
  min-width: 320px;
}

.search {
  width: 100%;
}

.chart {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #ffffff;
}

.chart.xl {
  height: 300px;
}

.trend-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trend-svg rect {
  fill: #ffffff;
}

.grid-lines line {
  stroke: #edf1f5;
}

.grid-lines text,
.x-label {
  fill: #98a2b3;
  font-size: 11px;
  font-weight: 700;
}

.area-path {
  fill: url(#trafficFill);
}

.page-line,
.visitor-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-line {
  stroke: var(--blue);
  stroke-width: 3;
}

.visitor-line {
  stroke: var(--teal);
  stroke-width: 2.4;
}

.leader-list,
.rank-list,
.ops-list,
.activity-stack,
.system-list,
.insight-list,
.log-grid {
  display: grid;
  gap: 10px;
}

.leader-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.leader-row > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf1ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
}

.leader-row strong,
.leader-row small,
.leader-row em {
  display: block;
}

.leader-row strong,
.rank-main strong,
.activity-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.leader-row small,
.leader-row em,
.rank-main span,
.activity-row span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rank-row,
.ops-item,
.activity-row {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.rank-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rank-meter {
  height: 7px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.rank-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.ops-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ops-item strong,
.ops-item span {
  font-size: 13px;
}

.ops-item span {
  color: var(--muted);
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
}

.table-toolbar strong {
  font-size: 14px;
}

.table-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

td strong,
td small {
  display: block;
}

td small {
  max-width: 360px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f7;
  color: #344054;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.badge.good {
  background: #e8faf3;
  color: var(--green);
}

.badge.warn {
  background: #fff5df;
  color: var(--amber);
}

.badge.soft {
  color: var(--muted);
}

.open-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.live-feed {
  display: grid;
  gap: 9px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.live-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.live-time strong,
.live-time span,
.live-main strong,
.live-main span {
  display: block;
}

.live-time strong {
  font-size: 14px;
}

.live-time span,
.live-main span {
  color: var(--muted);
  font-size: 12px;
}

.live-main {
  min-width: 0;
}

.live-main strong,
.live-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-meta {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}

.donut circle {
  fill: none;
  stroke-width: 4.6;
}

.donut-legend {
  display: grid;
  gap: 10px;
}

.donut-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-legend strong {
  font-size: 13px;
}

.donut-legend span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-row {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-2);
}

.status-row strong,
.status-row span {
  display: block;
}

.status-row strong {
  font-size: 24px;
}

.status-row span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.status-row.good {
  border: 1px solid #d8f3e8;
}

.status-row.warn {
  border: 1px solid #ffe2a8;
}

.status-row.bad {
  border: 1px solid #ffd2d7;
}

.insight-list div {
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.insight-list strong,
.insight-list span {
  display: block;
}

.insight-list strong {
  font-size: 13px;
}

.insight-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.system-card {
  position: relative;
  padding: 18px;
}

.system-card > span {
  width: 10px;
  height: 10px;
  position: absolute;
  top: 18px;
  right: 18px;
  border-radius: 50%;
  background: var(--green);
}

.system-card.warn > span {
  background: var(--amber);
}

.system-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.system-card strong {
  display: block;
  margin-top: 14px;
  font-size: 28px;
}

.system-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.system-line {
  display: grid;
  grid-template-columns: 10px minmax(0, 160px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.system-line > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.system-line strong {
  font-size: 13px;
}

.system-line em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coverage-grid div {
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.coverage-grid span,
.coverage-grid strong {
  display: block;
}

.coverage-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.coverage-grid strong {
  margin-top: 8px;
  font-size: 24px;
}

.log-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.log-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}

.log-row strong,
.log-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-row strong {
  font-size: 13px;
}

.log-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.empty,
.loading-screen,
.error-panel {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.loading-screen,
.error-panel {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.loading-screen strong,
.error-panel strong {
  color: var(--ink);
  font-size: 16px;
}

.loader {
  width: 34px;
  height: 34px;
  border: 3px solid #d9e3f7;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 15%, rgba(47, 124, 255, 0.24), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(21, 183, 158, 0.2), transparent 28%),
    #0b1220;
}

.login-shell {
  width: min(430px, calc(100% - 32px));
}

.login-card {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.login-card h1 {
  margin: 20px 0 0;
  font-size: 30px;
  line-height: 1.12;
}

.login-card p {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.login-form input {
  min-height: 44px;
  font-size: 15px;
}

.login-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
}

.login-form button:disabled {
  opacity: 0.7;
}

.login-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffecee;
  color: var(--red);
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .metric-grid,
  .compact-grid,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel,
  .grid.live-layout,
  .grid.two-one,
  .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-list a {
    justify-content: center;
  }

  .nav-list a span:last-child {
    display: none;
  }

  .sidebar-card {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .subpage-head {
    display: grid;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .search-wrap {
    min-width: 0;
  }

  .log-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 14px;
  }

  .page-title h1 {
    font-size: 25px;
  }

  .toolbar,
  .field,
  .switch,
  select,
  .primary-btn,
  .search {
    width: 100%;
  }

  .hero-panel {
    padding: 20px;
  }

  .realtime-hero {
    display: grid;
    padding: 20px;
  }

  .realtime-hero h2 {
    font-size: 28px;
  }

  .realtime-pulse {
    min-width: 0;
  }

  .map-panel {
    min-height: 360px;
  }

  .world-map {
    min-height: 320px;
  }

  .hero-copy h2 {
    font-size: 29px;
  }

  .hero-stats,
  .metric-grid,
  .compact-grid,
  .grid.three,
  .coverage-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 118px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .live-item {
    grid-template-columns: 1fr;
  }

  .live-meta {
    justify-content: flex-start;
  }

  .table-panel {
    padding-bottom: 12px;
  }

  .table-toolbar {
    display: grid;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  tbody tr {
    display: grid;
    gap: 0;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
  }

  td {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-2);
  }

  td:last-child {
    border-bottom: 0;
    justify-content: flex-start;
  }

  td::before {
    content: "";
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
  }

  td:nth-child(1)::before { content: "Dominio"; }
  td:nth-child(2)::before { content: "Produto"; }
  td:nth-child(3)::before { content: "Tipo"; }
  td:nth-child(4)::before { content: "Acessos"; }
  td:nth-child(5)::before { content: "Pageviews"; }
  td:nth-child(6)::before { content: "Visitantes"; }
  td:nth-child(7)::before { content: "Ativos"; }
  td:nth-child(8)::before { content: "Erros"; }
  td:nth-child(9)::before { content: "Ultimo"; }
  td:nth-child(10)::before { content: "SSL"; }

  td:first-child {
    display: grid;
    justify-content: stretch;
    gap: 5px;
    padding-top: 13px;
  }

  td:first-child::before {
    margin-bottom: 2px;
  }

  td small {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .open-link {
    width: 100%;
  }
}
