/* PocketFlow / expense-tracker admin theme — Live Deploy (respects dark/light toggle) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap");

/* ── Shared structure (both themes) ── */
body.pf-admin {
  --glow: #c7e4ff;
  --ok: #22c55e;
  --err: #ef4444;

  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Keep navy for filled CTAs; use theme primary for text accents */
html[data-theme="light"] body.pf-admin {
  --gold: #0f4aa6;
  --gold-dim: #0b3a84;
  --primary: #0f4aa6;
  --primary-dark: #0b3a84;
}

html[data-theme="dark"] body.pf-admin {
  --gold: #93c5fd;
  --gold-dim: #60a5fa;
  --primary: #93c5fd;
  --primary-dark: #60a5fa;
  --gold-glow: rgba(147, 197, 253, 0.16);
}

body.pf-admin h1,
body.pf-admin h2,
body.pf-admin h3,
body.pf-admin h4,
body.pf-admin .panel-head h2,
body.pf-admin .panel-head h3,
body.pf-admin .admin-topbar-left strong {
  font-family: Poppins, Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

body.pf-admin .admin-content {
  max-width: 1200px;
}

body.pf-admin .sidebar-link {
  border-radius: 14px;
}

body.pf-admin .sidebar-link.active {
  color: #fff;
  background: linear-gradient(90deg, #0f4aa6, #0b3a84);
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(15, 74, 166, 0.28);
}

body.pf-admin .panel,
body.pf-admin .live-bot-panel,
body.pf-admin .live-bot-history-panel {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  backdrop-filter: blur(12px) saturate(140%);
}

body.pf-admin .panel::before,
body.pf-admin .live-bot-panel::before,
body.pf-admin .live-bot-history-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #0f4aa6, #06b6d4);
  box-shadow: 0 8px 30px rgba(15, 74, 166, 0.18);
  pointer-events: none;
}

body.pf-admin .panel-head h2,
body.pf-admin .panel-head h3 {
  font-weight: 700;
  color: var(--text);
}

body.pf-admin .live-deploy-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

body.pf-admin .live-deploy-hero .panel-head h2 {
  font-size: 1.55rem;
  margin-bottom: 0.2rem;
}

body.pf-admin .muted,
body.pf-admin .panel .muted {
  color: var(--text-muted);
}

body.pf-admin input,
body.pf-admin select {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #0f4aa6 18%, var(--border));
  color: var(--text);
  background: var(--input-bg);
}

body.pf-admin input:focus,
body.pf-admin select:focus {
  border-color: #0f4aa6;
  box-shadow: 0 0 0 3px rgba(15, 74, 166, 0.22);
}

body.pf-admin .btn,
body.pf-admin button.btn,
body.pf-admin a.btn,
body.pf-admin .live-bot-deploy-btn {
  background: linear-gradient(90deg, #0f4aa6, #0b3a84);
  color: #fff !important;
  border: none;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15, 74, 166, 0.22), 0 6px 20px rgba(6, 182, 212, 0.06) inset;
}

body.pf-admin .btn:hover,
body.pf-admin .live-bot-deploy-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

body.pf-admin .desk-pill {
  border-radius: 999px;
  font-weight: 600;
}

body.pf-admin .desk-pill.on {
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

body.pf-admin .desk-pill.off {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.1);
}

body.pf-admin .live-bot-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

body.pf-admin .live-bot-hud-item {
  position: relative;
  overflow: hidden;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border-radius: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.pf-admin .live-bot-hud-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #0f4aa6, #06b6d4);
  opacity: 0.9;
}

body.pf-admin .live-bot-hud-item:hover {
  transform: translateY(-2px);
}

body.pf-admin .live-bot-hud-item .muted {
  font-size: 0.78rem;
  font-weight: 500;
}

body.pf-admin .live-bot-hud-value {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

body.pf-admin .live-bot-filter-btn {
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

body.pf-admin .live-bot-filter-btn.is-active {
  color: #fff;
  background: linear-gradient(90deg, #0f4aa6, #0b3a84);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(15, 74, 166, 0.25);
}

body.pf-admin .live-bot-card,
body.pf-admin .live-bot-history-card,
body.pf-admin .live-bot-empty-state,
body.pf-admin .live-bot-bridge-details {
  border-radius: 1.15rem;
  backdrop-filter: blur(10px) saturate(120%);
}

body.pf-admin .live-bot-empty-state {
  padding: 1.35rem 1.15rem;
  text-align: center;
}

body.pf-admin .live-bot-bridge-details {
  padding: 0.45rem 0.9rem 0.65rem;
}

body.pf-admin .paper-pnl-card,
body.pf-admin .live-bot-ltp-card {
  border-radius: 14px;
}

body.pf-admin .live-bot-leg-chip.buy,
body.pf-admin .live-bot-side-buy {
  color: #16a34a;
}

body.pf-admin .live-bot-leg-chip.sell,
body.pf-admin .live-bot-side-sell {
  color: #dc2626;
}

body.pf-admin .live-bot-signal-row.is-hot {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

body.pf-admin .live-bot-stop-banner.is-restart {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.1);
}

body.pf-admin .live-bot-stop-banner.is-final {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

body.pf-admin .theme-toggle-btn {
  opacity: 1;
}

/* ── Dark (PocketFlow zinc) ── */
html[data-theme="dark"] body.pf-admin {
  --bg: #09090b;
  --bg-2: #18181b;
  --surface: #27272a;
  --surface-2: rgba(39, 39, 42, 0.72);
  --surface-hover: #2f2f33;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --muted: #a1a1aa;
  --gold: #93c5fd;
  --gold-dim: #60a5fa;
  --primary: #93c5fd;
  --primary-dark: #60a5fa;
  --gold-glow: rgba(147, 197, 253, 0.16);
  --ok-bg: rgba(34, 197, 94, 0.14);
  --err-bg: rgba(239, 68, 68, 0.14);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(199, 228, 255, 0.14);
  --shadow: 0 18px 50px rgba(7, 8, 15, 0.55), 0 6px 30px rgba(199, 228, 255, 0.04);
  --input-bg: rgba(24, 24, 27, 0.92);
  --nav-bg: rgba(24, 24, 27, 0.92);
  --hero-grad: linear-gradient(135deg, rgba(15, 74, 166, 0.18), rgba(6, 182, 212, 0.08));
  --mesh-1: rgba(15, 74, 166, 0.16);
  --mesh-2: rgba(6, 182, 212, 0.08);
  --mesh-3: rgba(199, 228, 255, 0.04);
}

html[data-theme="dark"] body.pf-admin .bg-mesh,
html[data-theme="dark"] body.pf-admin .bg-orb {
  display: block !important;
}

html[data-theme="dark"] body.pf-admin .bg-mesh {
  background:
    radial-gradient(circle at 10% 20%, rgba(15, 74, 166, 0.14), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.1), transparent 20%),
    linear-gradient(180deg, #09090b, #18181b);
}

html[data-theme="dark"] body.pf-admin .app-sidebar {
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.98), rgba(9, 9, 11, 0.98));
  border-right-color: rgba(255, 255, 255, 0.05);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px) saturate(140%);
}

html[data-theme="dark"] body.pf-admin .sidebar-brand {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] body.pf-admin .sidebar-brand-text strong,
html[data-theme="dark"] body.pf-admin .live-bot-hud-value {
  color: #fafafa;
}

html[data-theme="dark"] body.pf-admin .sidebar-brand-text span,
html[data-theme="dark"] body.pf-admin .sidebar-link,
html[data-theme="dark"] body.pf-admin .live-bot-hud-item .muted {
  color: #a1a1aa;
}

html[data-theme="dark"] body.pf-admin .sidebar-group-label,
html[data-theme="dark"] body.pf-admin .admin-footer,
html[data-theme="dark"] body.pf-admin .site-footer {
  color: #71717a;
}

html[data-theme="dark"] body.pf-admin .sidebar-link:hover {
  color: #c7e4ff;
  background: rgba(15, 74, 166, 0.14);
  border-color: rgba(199, 228, 255, 0.08);
}

html[data-theme="dark"] body.pf-admin .sidebar-collapse-btn,
html[data-theme="dark"] body.pf-admin .logout-btn,
html[data-theme="dark"] body.pf-admin .theme-toggle-btn,
html[data-theme="dark"] body.pf-admin .profile-link,
html[data-theme="dark"] body.pf-admin .desk-pill,
html[data-theme="dark"] body.pf-admin .live-bot-filter-btn {
  background: rgba(39, 39, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
}

html[data-theme="dark"] body.pf-admin .sidebar-collapse-btn:hover,
html[data-theme="dark"] body.pf-admin .live-bot-filter-btn:hover {
  color: #c7e4ff;
  border-color: rgba(199, 228, 255, 0.2);
  background: rgba(15, 74, 166, 0.16);
}

html[data-theme="dark"] body.pf-admin .admin-topbar {
  background: rgba(24, 24, 27, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: none;
}

html[data-theme="dark"] body.pf-admin .admin-footer,
html[data-theme="dark"] body.pf-admin .site-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
  background: transparent;
}

html[data-theme="dark"] body.pf-admin .user-chip,
html[data-theme="dark"] body.pf-admin .user-chip-link {
  background: rgba(39, 39, 42, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fafafa;
}

html[data-theme="dark"] body.pf-admin .panel,
html[data-theme="dark"] body.pf-admin .live-bot-panel,
html[data-theme="dark"] body.pf-admin .live-bot-history-panel {
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.72), rgba(39, 39, 42, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] body.pf-admin .panel:hover,
html[data-theme="dark"] body.pf-admin .live-bot-panel:hover,
html[data-theme="dark"] body.pf-admin .live-bot-history-panel:hover {
  border-color: rgba(199, 228, 255, 0.12);
  box-shadow: 0 22px 56px rgba(7, 8, 15, 0.6), 0 0 0 1px rgba(199, 228, 255, 0.04);
}

html[data-theme="dark"] body.pf-admin .live-deploy-kicker {
  color: #a5b4fc;
}

html[data-theme="dark"] body.pf-admin input,
html[data-theme="dark"] body.pf-admin select {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  color: #fafafa;
}

html[data-theme="dark"] body.pf-admin input:focus,
html[data-theme="dark"] body.pf-admin select:focus {
  background: rgba(24, 24, 27, 0.95);
}

html[data-theme="dark"] body.pf-admin .btn-secondary,
html[data-theme="dark"] body.pf-admin .btn.btn-secondary,
html[data-theme="dark"] body.pf-admin .live-bot-refresh-btn {
  background: rgba(39, 39, 42, 0.9) !important;
  color: #e4e4e7 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none;
}

html[data-theme="dark"] body.pf-admin .btn-secondary:hover,
html[data-theme="dark"] body.pf-admin .live-bot-refresh-btn:hover {
  border-color: rgba(199, 228, 255, 0.2) !important;
  color: #c7e4ff !important;
  background: rgba(15, 74, 166, 0.16) !important;
}

html[data-theme="dark"] body.pf-admin .desk-pill.on {
  color: #4ade80;
}

html[data-theme="dark"] body.pf-admin .desk-pill.off {
  color: #f87171;
}

html[data-theme="dark"] body.pf-admin .live-bot-hud-item {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.7), rgba(39, 39, 42, 0.45));
  box-shadow: 0 10px 28px rgba(7, 8, 15, 0.35);
}

html[data-theme="dark"] body.pf-admin .live-bot-hud-item:hover {
  border-color: rgba(199, 228, 255, 0.12);
  box-shadow: 0 16px 36px rgba(7, 8, 15, 0.45);
}

html[data-theme="dark"] body.pf-admin .live-bot-card,
html[data-theme="dark"] body.pf-admin .live-bot-history-card,
html[data-theme="dark"] body.pf-admin .live-bot-empty-state,
html[data-theme="dark"] body.pf-admin .live-bot-bridge-details {
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.62), rgba(39, 39, 42, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 32px rgba(7, 8, 15, 0.35);
}

html[data-theme="dark"] body.pf-admin .live-bot-card.is-running {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12), 0 12px 32px rgba(7, 8, 15, 0.35);
}

html[data-theme="dark"] body.pf-admin .live-bot-card.is-waiting,
html[data-theme="dark"] body.pf-admin .live-bot-history-card.is-waiting {
  border-color: rgba(234, 179, 8, 0.35);
}

html[data-theme="dark"] body.pf-admin .live-bot-card.is-squared {
  border-color: rgba(249, 115, 22, 0.4);
}

html[data-theme="dark"] body.pf-admin .paper-pnl-card,
html[data-theme="dark"] body.pf-admin .live-bot-ltp-card {
  background: rgba(24, 24, 27, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] body.pf-admin .live-bot-leg-chip.buy,
html[data-theme="dark"] body.pf-admin .live-bot-side-buy {
  color: #4ade80;
}

html[data-theme="dark"] body.pf-admin .live-bot-leg-chip.sell,
html[data-theme="dark"] body.pf-admin .live-bot-side-sell {
  color: #f87171;
}

html[data-theme="dark"] body.pf-admin .flash.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

/* ── Light (PocketFlow light / white) ── */
html[data-theme="light"] body.pf-admin {
  --bg: #fafafb;
  --bg-2: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-hover: #f8fafc;
  --text: #0f172a;
  --text-muted: #6b7280;
  --muted: #6b7280;
  --gold-glow: rgba(15, 74, 166, 0.12);
  --ok-bg: rgba(34, 197, 94, 0.1);
  --err-bg: rgba(239, 68, 68, 0.1);
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 74, 166, 0.04);
  --input-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --hero-grad: linear-gradient(135deg, rgba(15, 74, 166, 0.06), rgba(6, 182, 212, 0.04));
  --mesh-1: transparent;
  --mesh-2: transparent;
  --mesh-3: transparent;
}

html[data-theme="light"] body.pf-admin .bg-mesh,
html[data-theme="light"] body.pf-admin .bg-orb {
  display: none !important;
}

html[data-theme="light"] body.pf-admin {
  background-image:
    radial-gradient(circle at 10% 10%, rgba(15, 74, 166, 0.035), transparent 12%),
    radial-gradient(circle at 90% 90%, rgba(148, 163, 184, 0.08), transparent 16%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
}

html[data-theme="light"] body.pf-admin .app-sidebar {
  background: #ffffff;
  border-right-color: #e5e7eb;
  box-shadow: 0 0 18px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
}

html[data-theme="light"] body.pf-admin .sidebar-brand {
  border-bottom-color: #e5e7eb;
}

html[data-theme="light"] body.pf-admin .sidebar-brand-text strong {
  color: #0f172a;
}

html[data-theme="light"] body.pf-admin .sidebar-brand-text span,
html[data-theme="light"] body.pf-admin .sidebar-link,
html[data-theme="light"] body.pf-admin .sidebar-group-label {
  color: #6b7280;
}

html[data-theme="light"] body.pf-admin .sidebar-link:hover {
  color: #0f4aa6;
  background: rgba(15, 74, 166, 0.08);
  border-color: rgba(15, 74, 166, 0.12);
}

html[data-theme="light"] body.pf-admin .sidebar-collapse-btn,
html[data-theme="light"] body.pf-admin .logout-btn,
html[data-theme="light"] body.pf-admin .theme-toggle-btn,
html[data-theme="light"] body.pf-admin .profile-link,
html[data-theme="light"] body.pf-admin .desk-pill,
html[data-theme="light"] body.pf-admin .live-bot-filter-btn {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #6b7280;
}

html[data-theme="light"] body.pf-admin .sidebar-collapse-btn:hover,
html[data-theme="light"] body.pf-admin .live-bot-filter-btn:hover {
  color: #0f4aa6;
  border-color: rgba(15, 74, 166, 0.28);
  background: rgba(15, 74, 166, 0.06);
}

html[data-theme="light"] body.pf-admin .admin-topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: blur(12px);
  box-shadow: none;
}

html[data-theme="light"] body.pf-admin .admin-footer,
html[data-theme="light"] body.pf-admin .site-footer {
  border-top-color: #e5e7eb;
  color: #6b7280;
  background: transparent;
}

html[data-theme="light"] body.pf-admin .user-chip,
html[data-theme="light"] body.pf-admin .user-chip-link {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #0f172a;
}

html[data-theme="light"] body.pf-admin .panel,
html[data-theme="light"] body.pf-admin .live-bot-panel,
html[data-theme="light"] body.pf-admin .live-bot-history-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
}

html[data-theme="light"] body.pf-admin .panel:hover,
html[data-theme="light"] body.pf-admin .live-bot-panel:hover,
html[data-theme="light"] body.pf-admin .live-bot-history-panel:hover {
  border-color: #d1d5db;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.pf-admin .btn-secondary,
html[data-theme="light"] body.pf-admin .btn.btn-secondary,
html[data-theme="light"] body.pf-admin .live-bot-refresh-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: none;
}

html[data-theme="light"] body.pf-admin .btn-secondary:hover,
html[data-theme="light"] body.pf-admin .live-bot-refresh-btn:hover {
  border-color: rgba(15, 74, 166, 0.35) !important;
  color: #0f4aa6 !important;
  background: rgba(15, 74, 166, 0.06) !important;
}

html[data-theme="light"] body.pf-admin .live-bot-hud-item {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] body.pf-admin .live-bot-hud-item:hover {
  border-color: rgba(15, 74, 166, 0.25);
  box-shadow: 0 12px 28px rgba(15, 74, 166, 0.08);
}

html[data-theme="light"] body.pf-admin .live-bot-card,
html[data-theme="light"] body.pf-admin .live-bot-history-card,
html[data-theme="light"] body.pf-admin .live-bot-empty-state,
html[data-theme="light"] body.pf-admin .live-bot-bridge-details {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] body.pf-admin .live-bot-card.is-running {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1), 0 8px 24px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] body.pf-admin .live-bot-card.is-waiting,
html[data-theme="light"] body.pf-admin .live-bot-history-card.is-waiting {
  border-color: rgba(234, 179, 8, 0.45);
}

html[data-theme="light"] body.pf-admin .live-bot-card.is-squared {
  border-color: rgba(249, 115, 22, 0.45);
}

html[data-theme="light"] body.pf-admin .paper-pnl-card,
html[data-theme="light"] body.pf-admin .live-bot-ltp-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

html[data-theme="light"] body.pf-admin .flash.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}

/* ── Dashboard extras ── */
body.pf-admin .dash-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

body.pf-admin .dash-live-panel .live-bot-hud {
  margin-top: 0.35rem;
}

body.pf-admin .dash-live-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

body.pf-admin .dash-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

body.pf-admin .dash-live-main {
  min-width: 0;
  flex: 1;
}

body.pf-admin .dash-live-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

body.pf-admin .dash-live-title h4 {
  margin: 0;
  font-size: 0.98rem;
  font-family: Poppins, Inter, sans-serif;
}

body.pf-admin .dash-live-m2m {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

body.pf-admin .is-pos,
body.pf-admin .live-bot-hud-value.is-pos,
body.pf-admin .dash-live-m2m.is-pos {
  color: #16a34a;
}

body.pf-admin .is-neg,
body.pf-admin .live-bot-hud-value.is-neg,
body.pf-admin .dash-live-m2m.is-neg {
  color: #dc2626;
}

html[data-theme="dark"] body.pf-admin .is-pos,
html[data-theme="dark"] body.pf-admin .live-bot-hud-value.is-pos,
html[data-theme="dark"] body.pf-admin .dash-live-m2m.is-pos {
  color: #4ade80;
}

html[data-theme="dark"] body.pf-admin .is-neg,
html[data-theme="dark"] body.pf-admin .live-bot-hud-value.is-neg,
html[data-theme="dark"] body.pf-admin .dash-live-m2m.is-neg {
  color: #f87171;
}

html[data-theme="dark"] body.pf-admin .dash-live-row {
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.55), rgba(39, 39, 42, 0.35));
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] body.pf-admin .dash-live-row {
  background: #f8fafc;
  border-color: #e5e7eb;
}

body.pf-admin .dash-action {
  border-radius: 1rem;
}

body.pf-admin .dash-strategy-row {
  border-radius: 1rem;
}

@media (max-width: 720px) {
  body.pf-admin .dash-live-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Dashboard MT5 broker card ── */
body.pf-admin .dash-broker-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.pf-admin .dash-broker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
}

body.pf-admin .dash-broker-cell {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

body.pf-admin .dash-broker-cell strong {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  word-break: break-word;
}

html[data-theme="dark"] body.pf-admin .dash-broker-cell {
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.55), rgba(39, 39, 42, 0.35));
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] body.pf-admin .dash-broker-cell {
  background: #f8fafc;
  border-color: #e5e7eb;
}

/* ── Global auth / login ── */
body.login-page.pf-admin {
  min-height: 100vh;
}

html[data-theme="dark"] body.login-page.pf-admin,
body.login-page.pf-admin {
  background: var(--bg);
}

html[data-theme="dark"] body.login-page.pf-admin .bg-mesh {
  display: block !important;
  background:
    radial-gradient(circle at 10% 20%, rgba(15, 74, 166, 0.16), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.1), transparent 22%),
    linear-gradient(180deg, #09090b, #18181b);
}

body.pf-admin .login-card,
body.login-page.pf-admin .login-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(140%);
}

body.pf-admin .login-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #0f4aa6, #06b6d4);
  pointer-events: none;
}

html[data-theme="dark"] body.pf-admin .login-card {
  background: linear-gradient(180deg, rgba(39, 39, 42, 0.78), rgba(39, 39, 42, 0.52));
}

html[data-theme="light"] body.pf-admin .login-card {
  background: #ffffff;
}

/* Strategy / list cards across app */
body.pf-admin .strategy-card,
body.pf-admin .dash-strategy-row,
body.pf-admin .dash-action {
  border-radius: 1rem;
  border-color: var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.pf-admin .strategy-card:hover,
body.pf-admin .dash-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, #0f4aa6 28%, var(--border));
}

body.pf-admin .btn,
body.pf-admin button.btn,
body.pf-admin a.btn {
  background: linear-gradient(90deg, #0f4aa6, #0b3a84);
  box-shadow: 0 12px 28px rgba(15, 74, 166, 0.2);
}

body.pf-admin .btn-secondary,
body.pf-admin a.btn-secondary,
body.pf-admin button.btn-secondary {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none;
}

body.pf-admin table th {
  color: var(--text-muted);
  font-weight: 600;
}

body.pf-admin .sidebar-link.active,
body.pf-admin .btn:not(.btn-secondary) {
  background: linear-gradient(90deg, #0f4aa6, #0b3a84);
}
