:root {
  --bg: #0f172a;
  --bg-secondary: #111f38;
  --surface: rgba(30, 41, 59, 0.72);
  --surface-strong: rgba(30, 41, 59, 0.9);
  --surface-soft: rgba(30, 41, 59, 0.45);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.28);
  --line: rgba(148, 163, 184, 0.14);
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.2);
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
  --hover-shadow: 0 24px 50px rgba(59, 130, 246, 0.2);
  --table-head: rgba(25, 38, 60, 0.72);
  --tooltip-bg: #0c1428;
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-secondary: #f2f2f4;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #ffffff;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.04);
  --line: rgba(0, 0, 0, 0.05);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.14);
  --success: #34c759;
  --error: #ff3b30;
  --warning: #ff9500;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --hover-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 10px 26px rgba(0, 0, 0, 0.08);
  --table-head: #f9f9f9;
  --tooltip-bg: rgba(28, 28, 30, 0.92);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(59, 130, 246, 0.26), transparent 36%),
    radial-gradient(circle at 95% 115%, rgba(16, 185, 129, 0.18), transparent 34%),
    var(--bg);
  transition: background 240ms ease, color 200ms ease;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(42px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.34;
}

.orb-a {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.72), rgba(59, 130, 246, 0));
  top: -90px;
  right: -90px;
  animation: drift-a 14s ease-in-out infinite alternate;
}

.orb-b {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.48), rgba(34, 197, 94, 0));
  bottom: -70px;
  left: -40px;
  animation: drift-b 18s ease-in-out infinite alternate;
}

.hidden {
  display: none !important;
}

.app {
  width: min(1280px, 94vw);
  margin: 18px auto 40px;
  animation: fade-in 420ms ease;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login {
  width: 420px;
  max-width: 92%;
}

.access-card {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.access-card h1 {
  margin: 0 0 8px;
}

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

.login-controls {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.login-controls input {
  width: 100%;
}

.login-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--error);
  font-size: 0.9rem;
}

.glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.card {
  background: linear-gradient(150deg, var(--surface), rgba(37, 52, 77, 0.54));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 12;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #dbeafe;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.92), rgba(59, 130, 246, 0.5));
  border: 1px solid rgba(59, 130, 246, 0.52);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 180ms ease;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.6);
}

.live-badge.is-connected {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.5);
}

.live-badge.is-connected .live-dot {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
  animation: pulse 1.6s infinite;
}

.live-badge.is-connecting {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.55);
}

.live-badge.is-connecting .live-dot {
  background: var(--accent);
}

.live-badge.is-disconnected {
  color: var(--text-muted);
}

.status-message {
  min-height: 22px;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.status-message.is-success {
  color: var(--success);
}

.status-message.is-error {
  color: var(--error);
}

.status-message.is-info {
  color: var(--text-muted);
}

.btn {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 620;
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 220ms ease, background 220ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.btn-primary {
  color: #e2e8f0;
  background: linear-gradient(140deg, #3b82f6, #2563eb);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.34);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.4);
}

.btn-ghost {
  background: var(--surface-soft);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.16);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card,
.mini-card {
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.kpi-card::before,
.mini-card::before {
  content: "";
  position: absolute;
  inset: -45% -20%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 62%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.kpi-card:hover,
.mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(59, 130, 246, 0.46);
}

.kpi-card:hover::before,
.mini-card:hover::before {
  opacity: 1;
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.kpi-title,
.mini-title {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 560;
}

.kpi-icon {
  min-width: 38px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 780;
  color: #dbeafe;
  border: 1px solid rgba(59, 130, 246, 0.46);
  background: linear-gradient(150deg, rgba(59, 130, 246, 0.42), rgba(59, 130, 246, 0.16));
}

.kpi-value {
  margin: 0;
  font-size: clamp(1.24rem, 2vw, 1.9rem);
  font-weight: 760;
  letter-spacing: -0.02em;
  transition: color 220ms ease;
}

.kpi-delta {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 220ms ease;
}

.mini-value {
  margin: 10px 0 0;
  font-size: clamp(1.02rem, 1.4vw, 1.28rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 220ms ease;
}

.kpi-card.trend-up .kpi-value,
.mini-card.trend-up .mini-value,
.kpi-card .kpi-delta.trend-up {
  color: var(--success);
}

.kpi-card.trend-down .kpi-value,
.mini-card.trend-down .mini-value,
.kpi-card .kpi-delta.trend-down {
  color: var(--error);
}

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

.insight-card {
  padding: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-head h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
}

.growth-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 740;
  color: var(--text-muted);
}

.growth-value.up {
  color: var(--success);
}

.growth-value.down {
  color: var(--error);
}

.sparkline {
  width: 100% !important;
  height: 78px !important;
}

.endpoint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.endpoint-row {
  display: grid;
  gap: 4px;
}

.endpoint-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.endpoint-path {
  max-width: 76%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.endpoint-value {
  color: var(--text-muted);
}

.endpoint-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.endpoint-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.66));
}

.geo-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  min-height: 84px;
  display: grid;
  place-items: center start;
}

.geo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.geo-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.88rem;
}

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

.chart-card {
  padding: 14px 14px 12px;
}

.chart-shell {
  position: relative;
  min-height: 250px;
}

.chart-shell canvas {
  width: 100% !important;
  height: 250px !important;
  opacity: 1;
  transition: opacity 240ms ease;
}

.chart-skeleton {
  display: none;
  position: absolute;
  inset: 10px 0 0;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.08),
    rgba(148, 163, 184, 0.22),
    rgba(148, 163, 184, 0.08)
  );
  background-size: 220% 100%;
  border: 1px solid var(--line);
  animation: shimmer 1.1s linear infinite;
}

.chart-card.loading .chart-skeleton {
  display: block;
}

.chart-card.loading canvas {
  opacity: 0.12;
}

.table-section {
  padding: 14px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

input,
select {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
  transition: border-color 160ms ease, box-shadow 200ms ease;
}

input {
  width: min(360px, 52vw);
}

input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 82%, transparent);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

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

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 670;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--table-head);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

th,
td {
  padding: 12px 11px;
  white-space: nowrap;
}

tbody td {
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--text) 94%, transparent);
}

tbody tr {
  animation: fade-in 220ms ease;
  transition: background 180ms ease, transform 180ms ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translateX(1px);
}

.path-cell {
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid;
  font-size: 0.78rem;
  font-weight: 650;
}

.status-success {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.44);
  background: rgba(34, 197, 94, 0.2);
}

.status-warning {
  color: #fdba74;
  border-color: rgba(245, 158, 11, 0.44);
  background: rgba(245, 158, 11, 0.2);
}

.status-error {
  color: #fda4af;
  border-color: rgba(239, 68, 68, 0.44);
  background: rgba(239, 68, 68, 0.2);
}

.status-neutral {
  color: var(--text-muted);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.14);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 18px;
}

.mobile-logs {
  display: none;
}

.log-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.log-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

.log-card-path {
  font-weight: 620;
  color: var(--text);
  overflow-wrap: anywhere;
}

.log-card-meta {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

#pageInfo {
  font-size: 0.9rem;
  color: var(--text-muted);
}

html[data-theme="light"] body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: #1d1d1f;
  background: #f5f5f7;
}

html[data-theme="light"] .bg-orb {
  display: none;
}

html[data-theme="light"] .glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] .card,
html[data-theme="light"] .access-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .app {
  margin: 24px auto 52px;
}

html[data-theme="light"] .topbar {
  min-height: 88px;
  padding: 20px 24px;
  gap: 18px;
  margin-bottom: 20px;
}

html[data-theme="light"] .eyebrow {
  color: #8e8e93;
}

html[data-theme="light"] .topbar h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

html[data-theme="light"] .brand-logo {
  color: #ffffff;
  background: #0a84ff;
  border: 1px solid rgba(10, 132, 255, 0.14);
}

html[data-theme="light"] .muted {
  color: #8e8e93;
}

html[data-theme="light"] .kpi-grid,
html[data-theme="light"] .meta-grid,
html[data-theme="light"] .insights-grid,
html[data-theme="light"] .charts-grid {
  gap: 16px;
  margin-bottom: 18px;
}

html[data-theme="light"] .kpi-card,
html[data-theme="light"] .mini-card,
html[data-theme="light"] .insight-card,
html[data-theme="light"] .chart-card,
html[data-theme="light"] .table-section {
  padding: 24px;
}

html[data-theme="light"] .kpi-card::before,
html[data-theme="light"] .mini-card::before {
  display: none;
}

html[data-theme="light"] .kpi-card:hover,
html[data-theme="light"] .mini-card:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .kpi-title,
html[data-theme="light"] .mini-title {
  color: #6e6e73;
  font-size: 14px;
  font-weight: 500;
}

html[data-theme="light"] .kpi-icon {
  color: #0a84ff;
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.14);
}

html[data-theme="light"] .kpi-value {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

html[data-theme="light"] .mini-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

html[data-theme="light"] .kpi-delta,
html[data-theme="light"] .growth-value,
html[data-theme="light"] .endpoint-value,
html[data-theme="light"] .geo-placeholder,
html[data-theme="light"] .geo-item,
html[data-theme="light"] .empty-state,
html[data-theme="light"] #pageInfo {
  color: #8e8e93;
}

html[data-theme="light"] .kpi-card.trend-up .kpi-value,
html[data-theme="light"] .mini-card.trend-up .mini-value,
html[data-theme="light"] .kpi-card .kpi-delta.trend-up,
html[data-theme="light"] .growth-value.up {
  color: #1e8e3e;
}

html[data-theme="light"] .kpi-card.trend-down .kpi-value,
html[data-theme="light"] .mini-card.trend-down .mini-value,
html[data-theme="light"] .kpi-card .kpi-delta.trend-down,
html[data-theme="light"] .growth-value.down {
  color: #c62828;
}

html[data-theme="light"] .btn {
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 500;
  transition: all 0.2s ease;
}

html[data-theme="light"] .btn-primary {
  background: #0a84ff;
  color: #ffffff;
  box-shadow: none;
}

html[data-theme="light"] .btn-primary:hover:not(:disabled) {
  background: #005bb5;
  box-shadow: none;
}

html[data-theme="light"] .btn-ghost {
  background: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .btn-ghost:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .live-badge {
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.05);
  border-color: transparent;
}

html[data-theme="light"] .live-dot {
  background: #8e8e93;
  box-shadow: none;
}

html[data-theme="light"] .live-badge.is-connected {
  background: rgba(52, 199, 89, 0.15);
  color: #1e8e3e;
  border-color: transparent;
}

html[data-theme="light"] .live-badge.is-connected .live-dot {
  background: #34c759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.6);
}

html[data-theme="light"] .live-badge.is-connecting {
  background: rgba(10, 132, 255, 0.12);
  color: #005bb5;
  border-color: transparent;
}

html[data-theme="light"] .live-badge.is-connecting .live-dot {
  background: #0a84ff;
}

html[data-theme="light"] .live-badge.is-disconnected {
  background: rgba(142, 142, 147, 0.16);
  color: #6e6e73;
}

html[data-theme="light"] .endpoint-bar {
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .endpoint-bar > span {
  background: #0a84ff;
}

html[data-theme="light"] .table-toolbar {
  margin-bottom: 16px;
}

html[data-theme="light"] input,
html[data-theme="light"] select {
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] input::placeholder {
  color: #8e8e93;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

html[data-theme="light"] .table-wrap {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] thead th {
  background: #f9f9f9;
  color: #6e6e73;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
  backdrop-filter: none;
}

html[data-theme="light"] tbody td {
  color: #1d1d1f;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: none;
}

html[data-theme="light"] .status-success {
  color: #1e8e3e;
  border-color: rgba(52, 199, 89, 0.3);
  background: rgba(52, 199, 89, 0.14);
}

html[data-theme="light"] .status-warning {
  color: #bf5f00;
  border-color: rgba(255, 149, 0, 0.34);
  background: rgba(255, 149, 0, 0.14);
}

html[data-theme="light"] .status-error {
  color: #c62828;
  border-color: rgba(255, 59, 48, 0.32);
  background: rgba(255, 59, 48, 0.14);
}

html[data-theme="light"] .status-neutral {
  color: #6e6e73;
  border-color: rgba(0, 0, 0, 0.07);
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .chart-skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.03)
  );
  border: 1px solid rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .log-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
}

html[data-theme="light"] .log-card-meta {
  color: #6e6e73;
}

.loading .kpi-value,
.loading .mini-value,
.loading .kpi-delta {
  color: transparent;
  position: relative;
}

.loading .kpi-value::after,
.loading .mini-value::after,
.loading .kpi-delta::after,
.skeleton-inline {
  content: "";
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.08),
    rgba(148, 163, 184, 0.22),
    rgba(148, 163, 184, 0.08)
  );
  background-size: 260% 100%;
  animation: shimmer 1s linear infinite;
}

.loading .kpi-value::after {
  width: 70%;
  height: 32px;
}

.loading .mini-value::after {
  width: 62%;
  height: 24px;
}

.loading .kpi-delta::after {
  width: 54%;
  height: 16px;
}

.skeleton-inline {
  width: 100%;
  height: 14px;
}

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

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

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

  .insights-grid > .insight-card:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .btn-row {
    width: 100%;
  }

  .btn-row .btn {
    flex: 1;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .app {
    width: min(1280px, 96vw);
    margin-top: 12px;
  }

  .kpi-grid,
  .meta-grid,
  .insights-grid,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .insights-grid > .insight-card:last-child {
    grid-column: span 1;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  input,
  select,
  .btn {
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .mobile-logs {
    display: grid;
    gap: 10px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes drift-a {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-28px, 22px);
  }
}

@keyframes drift-b {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(20px, -24px);
  }
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
