/*
 * Sellway — minimal custom CSS.
 * Tailwind CDN asosiy dizayn tizimini ta'minlaydi.
 * Bu faylda faqat:
 *   1. JS-rendered elementlar uchun semantic class'lar (pill, notice, event-item)
 *   2. Tailwind'da yo'q shimmer/transition animatsiyalar
 *   3. Alpine `x-cloak` flash himoyasi
 */

/* Alpine.js — x-cloak bilan FOUC'ni oldini olish */
[x-cloak] { display: none !important; }

/* Utility — JS classList.toggle("is-hidden") uchun */
.is-hidden { display: none !important; }

/* ── Notices (inline form message) ───────────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid;
  animation: notice-in 180ms ease-out;
}

.notice.hidden { display: none; }

.notice.error,
.notice[data-kind="error"] {
  background-color: rgb(254 242 242);
  color: rgb(153 27 27);
  border-color: rgb(254 202 202);
}
.dark .notice.error,
.dark .notice[data-kind="error"] {
  background-color: rgb(76 5 25 / 0.4);
  color: rgb(252 165 165);
  border-color: rgb(127 29 29 / 0.5);
}

.notice.success,
.notice[data-kind="success"] {
  background-color: rgb(236 253 245);
  color: rgb(6 95 70);
  border-color: rgb(167 243 208);
}
.dark .notice.success,
.dark .notice[data-kind="success"] {
  background-color: rgb(6 78 59 / 0.4);
  color: rgb(110 231 183);
  border-color: rgb(6 95 70 / 0.5);
}

.notice.warning,
.notice[data-kind="warning"] {
  background-color: rgb(255 251 235);
  color: rgb(146 64 14);
  border-color: rgb(253 230 138);
}
.dark .notice.warning,
.dark .notice[data-kind="warning"] {
  background-color: rgb(120 53 15 / 0.4);
  color: rgb(252 211 77);
  border-color: rgb(146 64 14 / 0.5);
}

.notice.info,
.notice[data-kind="info"] {
  background-color: rgb(239 246 255);
  color: rgb(30 64 175);
  border-color: rgb(191 219 254);
}
.dark .notice.info,
.dark .notice[data-kind="info"] {
  background-color: rgb(30 58 138 / 0.4);
  color: rgb(147 197 253);
  border-color: rgb(30 64 175 / 0.5);
}

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

/* ── Pills (status badges in history / schedule rows) ────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
  opacity: 0.7;
}

.pill.muted {
  background: rgb(241 245 249);
  color: rgb(71 85 105);
  border-color: rgb(226 232 240);
}
.dark .pill.muted {
  background: rgb(30 41 59 / 0.6);
  color: rgb(203 213 225);
  border-color: rgb(51 65 85);
}

.pill.success {
  background: rgb(220 252 231);
  color: rgb(22 101 52);
  border-color: rgb(187 247 208);
}
.dark .pill.success {
  background: rgb(20 83 45 / 0.4);
  color: rgb(134 239 172);
  border-color: rgb(22 101 52 / 0.5);
}

.pill.warning {
  background: rgb(254 243 199);
  color: rgb(146 64 14);
  border-color: rgb(253 230 138);
}
.dark .pill.warning {
  background: rgb(120 53 15 / 0.4);
  color: rgb(252 211 77);
  border-color: rgb(146 64 14 / 0.5);
}

.pill.error {
  background: rgb(254 226 226);
  color: rgb(153 27 27);
  border-color: rgb(254 202 202);
}
.dark .pill.error {
  background: rgb(127 29 29 / 0.4);
  color: rgb(252 165 165);
  border-color: rgb(153 27 27 / 0.5);
}

.pill.info {
  background: rgb(219 234 254);
  color: rgb(30 64 175);
  border-color: rgb(191 219 254);
}
.dark .pill.info {
  background: rgb(30 58 138 / 0.4);
  color: rgb(147 197 253);
  border-color: rgb(30 64 175 / 0.5);
}

.pill.brand {
  background: rgb(224 231 255);
  color: rgb(55 48 163);
  border-color: rgb(199 210 254);
}
.dark .pill.brand {
  background: rgb(49 46 129 / 0.4);
  color: rgb(165 180 252);
  border-color: rgb(55 48 163 / 0.5);
}

/* ── Event log items (progress stream) ───────────────────────────────── */
.event-item {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(249 250 251);
  font-size: 0.8125rem;
  animation: event-in 220ms ease-out;
}
.dark .event-item {
  background: rgb(15 23 42 / 0.4);
  border-color: rgb(30 41 59);
}

.event-item > div:first-child {
  font-weight: 600;
  color: rgb(15 23 42);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dark .event-item > div:first-child {
  color: rgb(226 232 240);
}

.event-item .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: rgb(100 116 139);
}
.dark .event-item .meta { color: rgb(148 163 184); }

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

/* ── Provider list cards (JS-rendered) ───────────────────────────────── */
.provider-list:not(:empty) { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) {
  .provider-list:not(:empty) { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .provider-list:not(:empty) { grid-template-columns: repeat(3, 1fr); }
}

.provider-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
  transition: all 180ms ease;
  overflow: hidden;
}
.dark .provider-card {
  background: rgb(15 23 42 / 0.6);
  border-color: rgb(30 41 59);
}
.provider-card:hover {
  border-color: rgb(199 210 254);
  box-shadow: 0 8px 24px -8px rgb(99 102 241 / 0.2);
  transform: translateY(-1px);
}
.dark .provider-card:hover {
  border-color: rgb(79 70 229 / 0.4);
  box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.5);
}

.provider-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgb(99 102 241 / 0.04) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms;
}
.provider-card:hover::before { opacity: 1; }
.dark .provider-card::before { background: linear-gradient(135deg, transparent 50%, rgb(99 102 241 / 0.08) 100%); }

/* ── Table (history) ─────────────────────────────────────────────────── */
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table-wrap thead th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(100 116 139);
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
  padding: 0.75rem 1rem;
}
.dark .table-wrap thead th {
  background: rgb(15 23 42 / 0.6);
  border-color: rgb(30 41 59);
  color: rgb(148 163 184);
}

.table-wrap tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgb(241 245 249);
  color: rgb(30 41 59);
  vertical-align: middle;
}
.dark .table-wrap tbody td {
  border-color: rgb(30 41 59 / 0.6);
  color: rgb(203 213 225);
}

.table-wrap tbody tr {
  transition: background 120ms;
  cursor: pointer;
}
.table-wrap tbody tr:hover {
  background: rgb(248 250 252);
}
.dark .table-wrap tbody tr:hover {
  background: rgb(30 41 59 / 0.4);
}

.table-wrap tbody tr.is-selected {
  background: rgb(238 242 255);
}
.dark .table-wrap tbody tr.is-selected {
  background: rgb(49 46 129 / 0.25);
}

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed rgb(226 232 240);
  border-radius: 1rem;
  color: rgb(100 116 139);
  background: rgb(248 250 252 / 0.5);
}
.dark .empty-state {
  border-color: rgb(30 41 59);
  color: rgb(148 163 184);
  background: rgb(15 23 42 / 0.3);
}

.empty-state svg,
.empty-state i {
  color: rgb(148 163 184);
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.25rem;
}

/* ── Stats grid (overview cards) ─────────────────────────────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: 0.875rem;
  border: 1px solid rgb(226 232 240);
  background: white;
  transition: all 160ms;
}
.dark .stat-card {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42 / 0.4);
}
.stat-card:hover {
  border-color: rgb(199 210 254);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgb(99 102 241 / 0.15);
}
.dark .stat-card:hover { border-color: rgb(79 70 229 / 0.4); }

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(100 116 139);
}
.dark .stat-label { color: rgb(148 163 184); }

.stat-value {
  margin-top: 0.25rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: rgb(15 23 42);
  font-variant-numeric: tabular-nums;
}
.dark .stat-value { color: rgb(241 245 249); }

.stat-hint {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: rgb(100 116 139);
}
.dark .stat-hint { color: rgb(148 163 184); }

/* ── Buttons inside JS-rendered content (.primary / .secondary / .danger-button) ── */
.primary,
button.primary,
a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-image: linear-gradient(to right, rgb(79 70 229), rgb(67 56 202));
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: all 140ms;
  box-shadow: 0 4px 12px -2px rgb(79 70 229 / 0.35);
  text-decoration: none;
}
.primary:hover {
  background-image: linear-gradient(to right, rgb(99 102 241), rgb(79 70 229));
  box-shadow: 0 6px 16px -2px rgb(79 70 229 / 0.5);
  transform: translateY(-1px);
}
.primary:active { transform: translateY(0) scale(0.98); }
.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary,
button.secondary,
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: white;
  color: rgb(51 65 85);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgb(226 232 240);
  cursor: pointer;
  transition: all 140ms;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  text-decoration: none;
}
.dark .secondary {
  background: rgb(15 23 42);
  color: rgb(226 232 240);
  border-color: rgb(51 65 85);
}
.secondary:hover {
  border-color: rgb(203 213 225);
  background: rgb(248 250 252);
}
.dark .secondary:hover {
  background: rgb(30 41 59);
  border-color: rgb(71 85 105);
}
.secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: rgb(254 242 242);
  color: rgb(159 18 57);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgb(254 202 202);
  cursor: pointer;
  transition: all 140ms;
}
.dark .danger-button {
  background: rgb(76 5 25 / 0.4);
  color: rgb(252 165 165);
  border-color: rgb(127 29 29 / 0.5);
}
.danger-button:hover {
  background: rgb(254 226 226);
  border-color: rgb(252 165 165);
}
.dark .danger-button:hover {
  background: rgb(127 29 29 / 0.5);
}

/* ── Fields (inputs / selects inside JS-rendered content) ────────────── */
.field > span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: rgb(71 85 105);
  margin-bottom: 0.375rem;
}
.dark .field > span { color: rgb(148 163 184); }

/* ── Sync action buttons (inside JS-rendered cards) ──────────────────── */
.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid;
  transition: all 140ms;
  cursor: pointer;
}
.sync-btn[data-variant="run"] {
  background: rgb(224 231 255);
  color: rgb(55 48 163);
  border-color: rgb(199 210 254);
}
.dark .sync-btn[data-variant="run"] {
  background: rgb(49 46 129 / 0.5);
  color: rgb(199 210 254);
  border-color: rgb(79 70 229 / 0.4);
}
.sync-btn[data-variant="run"]:hover {
  background: rgb(199 210 254);
  transform: translateY(-1px);
}

.sync-btn[data-variant="stop"] {
  background: rgb(254 226 226);
  color: rgb(159 18 57);
  border-color: rgb(254 202 202);
}
.sync-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-width: 260px;
  max-width: 420px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: white;
  color: rgb(15 23 42);
  border: 1px solid rgb(226 232 240);
  box-shadow: 0 20px 40px -10px rgb(0 0 0 / 0.15);
  animation: toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.875rem;
  font-weight: 500;
}
.dark .toast {
  background: rgb(15 23 42);
  color: rgb(226 232 240);
  border-color: rgb(51 65 85);
}
.toast.toast-out { animation: toast-out 180ms ease-in forwards; }

.toast-icon {
  margin-top: 1px;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}
.toast[data-kind="success"] .toast-icon { color: rgb(16 185 129); }
.toast[data-kind="error"] .toast-icon   { color: rgb(239 68 68); }
.toast[data-kind="warning"] .toast-icon { color: rgb(245 158 11); }
.toast[data-kind="info"] .toast-icon    { color: rgb(99 102 241); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(8px); }
}

/* ── Legacy support — eski JS class'lari ──────────────────────────────── */
/* Tab switcher — JS `classList.toggle("active")` ishlatadi */
.tab-switcher { display: inline-flex; gap: 0.25rem; }
.tab { cursor: pointer; }

/* JS render qiladigan card panel fallback */
.card.panel {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  padding: 1.25rem;
}
.dark .card.panel {
  background: rgb(15 23 42 / 0.6);
  border-color: rgb(30 41 59);
}

/* Section head (used inside JS-rendered content) */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.section-head h2,
.section-head h3,
.section-head h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgb(15 23 42);
}
.dark .section-head h2,
.dark .section-head h3,
.dark .section-head h4 { color: rgb(226 232 240); }

/* Hint box — JS rendered inline helper */
.hint-box {
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  color: rgb(71 85 105);
  border: 1px dashed rgb(226 232 240);
  background: rgb(248 250 252);
}
.dark .hint-box {
  color: rgb(148 163 184);
  border-color: rgb(30 41 59);
  background: rgb(15 23 42 / 0.4);
}

/* Form grid — JS rendered settings editor */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .form-grid.two-up { grid-template-columns: repeat(2, 1fr); }
}

.stacked-form { display: flex; flex-direction: column; gap: 1rem; }
.actions-row { display: flex; gap: 0.5rem; align-items: center; }
.actions-row.end { justify-content: flex-end; }

/* History detail drawer */
.history-detail:not(:empty) {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.875rem;
  background: rgb(248 250 252);
  animation: fade-in 200ms ease-out;
}
.dark .history-detail:not(:empty) {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42 / 0.4);
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Schedule + settings cards — JS renders them */
.schedule-card,
.settings-card {
  padding: 1rem;
  border-radius: 0.875rem;
  border: 1px solid rgb(226 232 240);
  background: white;
  transition: border-color 160ms;
}
.dark .schedule-card,
.dark .settings-card {
  background: rgb(15 23 42 / 0.4);
  border-color: rgb(30 41 59);
}

/* Focus ring for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgb(99 102 241);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   OBSERVATORY — Monitoring dashboard styles
   ══════════════════════════════════════════════════════════════════════════ */

.obs-card {
  position: relative;
  overflow: hidden;
  padding: 1.125rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: linear-gradient(180deg, white 0%, rgb(248 250 252) 100%);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.03);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.dark .obs-card {
  border-color: rgb(30 41 59);
  background: linear-gradient(180deg, rgb(15 23 42 / 0.7) 0%, rgb(2 6 23 / 0.8) 100%);
}
.obs-card:hover {
  border-color: rgb(199 210 254);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -12px rgb(99 102 241 / 0.25);
}
.dark .obs-card:hover {
  border-color: rgb(79 70 229 / 0.5);
  box-shadow: 0 8px 24px -12px rgb(99 102 241 / 0.4);
}

/* Subtle corner accent */
.obs-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at top right, rgb(99 102 241 / 0.08), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms;
}
.obs-card:hover::after { opacity: 1; }

.obs-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.obs-icon {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
}

.obs-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgb(100 116 139);
}
.dark .obs-label { color: rgb(148 163 184); }

/* Large numeric displays — JetBrains Mono, tabular */
.obs-number {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-feature-settings: "tnum", "zero";
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: -0.02em;
  line-height: 1;
  font-weight: 700;
}
.obs-number-xl { font-size: 2.75rem; }
.obs-number-lg { font-size: 1.875rem; }

.obs-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgb(100 116 139);
}
.dark .obs-sub { color: rgb(148 163 184); }

/* Stat block */
.obs-stat {
  border-left: 2px solid rgb(226 232 240);
  padding-left: 0.75rem;
}
.dark .obs-stat { border-color: rgb(51 65 85); }

.obs-stat-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgb(100 116 139);
}
.dark .obs-stat-label { color: rgb(148 163 184); }

.obs-stat-value {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 700;
  color: rgb(15 23 42);
  line-height: 1;
  margin-top: 0.25rem;
}
.dark .obs-stat-value { color: rgb(248 250 252); }

.obs-stat-hint {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: rgb(100 116 139);
}
.dark .obs-stat-hint { color: rgb(148 163 184); }

/* System health chip inside hero */
.obs-system-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.875rem;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.06);
  backdrop-filter: blur(10px);
  transition: background 160ms ease;
}
.obs-system-chip:hover { background: rgb(255 255 255 / 0.1); }

.obs-system-dot {
  position: relative;
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.obs-system-dot.ok {
  background: rgb(34 197 94);
  box-shadow: 0 0 0 0 rgb(34 197 94 / 0.7);
  animation: obs-heartbeat 1.8s ease-in-out infinite;
}
.obs-system-dot.fail {
  background: rgb(244 63 94);
  box-shadow: 0 0 0 0 rgb(244 63 94 / 0.7);
  animation: obs-heartbeat-fast 1s ease-in-out infinite;
}
.obs-system-dot.degraded {
  background: rgb(251 191 36);
}

@keyframes obs-heartbeat {
  0% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0.55); }
  80%,100% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0); }
}
@keyframes obs-heartbeat-fast {
  0% { box-shadow: 0 0 0 0 rgb(244 63 94 / 0.55); }
  80%,100% { box-shadow: 0 0 0 10px rgb(244 63 94 / 0); }
}

.obs-system-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(241 245 249);
}

.obs-system-latency {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  color: rgb(148 163 184);
  margin-top: 1px;
}

/* Sparkline — SVG animation */
.obs-spark-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: obs-spark-draw 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes obs-spark-draw {
  to { stroke-dashoffset: 0; }
}

/* Terminal event log */
.obs-terminal {
  scrollbar-width: thin;
  scrollbar-color: rgb(51 65 85) transparent;
  background:
    linear-gradient(180deg, rgb(2 6 23 / 0.0) 0%, transparent 8px),
    rgb(2 6 23);
  background-size: 100% 100%, 100% 100%;
}
.obs-terminal::before {
  content: "";
  display: block;
  position: sticky;
  top: -12px;
  margin-bottom: 4px;
  height: 16px;
  background: linear-gradient(to bottom, rgb(2 6 23), transparent);
  pointer-events: none;
}

.obs-log-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: obs-log-enter 200ms ease-out;
}
@keyframes obs-log-enter {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

.obs-log-ts { color: rgb(100 116 139); flex-shrink: 0; }
.obs-log-type-sync { color: rgb(110 231 183); }
.obs-log-type-provider { color: rgb(165 180 252); }
.obs-log-type-schedule { color: rgb(252 211 77); }
.obs-log-type-account { color: rgb(203 213 225); }
.obs-log-type-policy { color: rgb(244 114 182); }
.obs-log-type-user { color: rgb(125 211 252); }
.obs-log-msg { color: rgb(203 213 225); overflow: hidden; text-overflow: ellipsis; }

/* Number flip/count animation */
.obs-number[data-flip="1"] {
  animation: obs-flip 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes obs-flip {
  0%   { transform: translateY(-4px); opacity: 0.5; }
  60%  { transform: translateY(1px); opacity: 1; }
  100% { transform: translateY(0); }
}

/* Ranking row */
.obs-rank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  background: rgb(248 250 252);
  transition: background 140ms;
}
.dark .obs-rank-row { background: rgb(15 23 42 / 0.5); }
.obs-rank-row:hover { background: rgb(241 245 249); }
.dark .obs-rank-row:hover { background: rgb(30 41 59 / 0.6); }

.obs-rank-badge {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.75rem;
  background: rgb(226 232 240);
  color: rgb(51 65 85);
}
.dark .obs-rank-badge { background: rgb(30 41 59); color: rgb(203 213 225); }
.obs-rank-row:nth-child(1) .obs-rank-badge {
  background: linear-gradient(135deg, rgb(252 211 77), rgb(251 146 60));
  color: rgb(69 26 3);
}
.obs-rank-row:nth-child(2) .obs-rank-badge {
  background: linear-gradient(135deg, rgb(203 213 225), rgb(148 163 184));
  color: rgb(15 23 42);
}
.obs-rank-row:nth-child(3) .obs-rank-badge {
  background: linear-gradient(135deg, rgb(217 119 6), rgb(180 83 9));
  color: white;
}

/* Type pill for provider breakdown */
.obs-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: rgb(224 231 255);
  color: rgb(55 48 163);
  border: 1px solid rgb(199 210 254);
}
.dark .obs-type-pill {
  background: rgb(49 46 129 / 0.4);
  color: rgb(199 210 254);
  border-color: rgb(79 70 229 / 0.4);
}
.obs-type-pill strong {
  font-weight: 700;
  color: rgb(30 27 75);
}
.dark .obs-type-pill strong { color: rgb(224 231 255); }

/* Scrollbar styling (subtle) */
.event-log::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.event-log::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.event-log::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: rgb(203 213 225);
  border-radius: 9999px;
}
.dark .event-log::-webkit-scrollbar-thumb,
.dark .table-wrap::-webkit-scrollbar-thumb { background: rgb(51 65 85); }
.event-log::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184); }
