/* Minimal extras on top of Tailwind — charts, loaders, form controls */

[hidden] { display: none !important; }

.nav-link {
  display: flex;
  align-items: center;
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  color: #64748b;
}
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.dark .nav-link:hover { background: #1e293b; color: #f8fafc; }
.nav-link.active {
  background: #eef6fc;
  color: #155a94;
}
.dark .nav-link.active {
  background: rgba(26, 111, 181, 0.18);
  color: #7dd3fc;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.7rem;
  background: #1a6fb5;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
}
.btn-primary:hover { background: #155a94; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.7rem;
  border: 1px solid #e2e8f0;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
}
.dark .btn-ghost { border-color: #334155; }
.btn-ghost:hover { background: #f8fafc; }
.dark .btn-ghost:hover { background: #1e293b; }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  border-radius: 0.7rem;
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.08);
  color: #e11d48;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
}
.dark .btn-danger {
  border-color: rgba(251, 113, 133, 0.35);
  color: #fb7185;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}
.dark .field { color: #94a3b8; }
.field input, .field select, .field textarea,
.input, .select {
  border-radius: 0.65rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.65rem;
  min-height: 2.25rem;
}
.dark .field input, .dark .field select, .dark .field textarea,
.dark .input, .dark .select {
  border-color: #334155;
  background: #0f172a;
  color: #f8fafc;
}
.field input:focus, .field select:focus, .input:focus, .select:focus {
  outline: 2px solid rgba(26, 111, 181, 0.35);
  outline-offset: 1px;
}

.card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21, 32, 43, 0.05);
}
.dark .card {
  border-color: #1e293b;
  background: #0f172a;
  box-shadow: none;
}

.table-rich {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}
.table-rich thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.dark .table-rich thead th {
  background: #111827;
  border-bottom-color: #1e293b;
  color: #94a3b8;
}
.table-rich tbody td {
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: nowrap;
}
.dark .table-rich tbody td { border-bottom-color: #1e293b; }
.table-rich tbody tr:hover td {
  background: rgba(14, 165, 233, 0.06);
}
.dark .table-rich tbody tr:hover td {
  background: rgba(56, 189, 248, 0.07);
}
.table-rich tbody tr:last-child td { border-bottom: 0; }

.badge-live {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}
.dark .badge-live { color: #34d399; }
.badge-delayed {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}
.dark .badge-delayed { color: #fbbf24; }

.tab-btn {
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
}
.tab-btn.active {
  color: #1a6fb5;
  border-bottom-color: #1a6fb5;
}
.dark .tab-btn.active { color: #38bdf8; border-bottom-color: #38bdf8; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.chart-box { min-height: 280px; }
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.charts-grid .wide { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}

.loader-spin {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  border-top-color: #1a6fb5;
  animation: spin 0.7s linear infinite;
}
.dark .loader-spin {
  border-color: #475569;
  border-top-color: #38bdf8;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #64748b;
}

.progress-track {
  height: 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.dark .progress-track { background: #334155; }
.progress-track > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #1a6fb5;
  transition: width .25s ease;
}

.up { color: #059669; font-weight: 700; }
.down { color: #e11d48; font-weight: 700; }
.dark .up { color: #34d399; }
.dark .down { color: #fb7185; }

.sig-pill {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
}
.sig-pill.buy { background: rgba(16,185,129,.14); color: #059669; }
.sig-pill.sell { background: rgba(244,63,94,.12); color: #e11d48; }
.sig-pill.hold { background: #eef2f7; color: #64748b; }
.dark .sig-pill.hold { background: #1e293b; color: #94a3b8; }

.switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .2s;
}
.dark .switch .track { background: #475569; }
.switch .track::after {
  content: '';
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #fff;
  transition: transform .2s;
}
.switch input:checked + .track { background: #10b981; }
.switch input:checked + .track::after { transform: translateX(1.2rem); }
