/* OpenGate Brand Theme Override for panel.opengate.stream (New API v1.x) */
:root {
  --radius: 0.75rem;
  --font-ui-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --background: #f6f8fa;
  --foreground: #0b1220;
  --card: #ffffff;
  --card-foreground: #0b1220;
  --popover: #ffffff;
  --popover-foreground: #0b1220;
  --primary: #059669;
  --primary-foreground: #ffffff;
  --secondary: #eef2f6;
  --secondary-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #ecfdf5;
  --accent-foreground: #065f46;
  --border: #e2e8f0;
  --input: #dbe3ec;
  --ring: #10b981;
  --sidebar: #ffffff;
  --sidebar-foreground: #0f172a;
  --sidebar-primary: #059669;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #ecfdf5;
  --sidebar-accent-foreground: #047857;
  --sidebar-border: #e2e8f0;
  --sidebar-ring: #10b981;
  --chart-1: #059669;
  --chart-2: #0ea5e9;
  --chart-3: #8b5cf6;
  --chart-4: #f59e0b;
  --chart-5: #14b8a6;
  --overview-accent-1: #059669;
  --overview-accent-2: #0ea5e9;
  --overview-accent-3: #8b5cf6;
}

.dark {
  --background: #090c12;
  --foreground: #f1f5f9;
  --card: #111622;
  --card-foreground: #f1f5f9;
  --popover: #151b29;
  --popover-foreground: #f1f5f9;
  --primary: #10b981;
  --primary-foreground: #032117;
  --secondary: #1b2233;
  --secondary-foreground: #e2e8f0;
  --muted: #161c2a;
  --muted-foreground: #94a3b8;
  --accent: rgba(16, 185, 129, 0.14);
  --accent-foreground: #6ee7b7;
  --border: rgba(255, 255, 255, 0.085);
  --input: rgba(255, 255, 255, 0.14);
  --ring: #10b981;
  --sidebar: #0c1018;
  --sidebar-foreground: #e2e8f0;
  --sidebar-primary: #10b981;
  --sidebar-primary-foreground: #032117;
  --sidebar-accent: rgba(16, 185, 129, 0.14);
  --sidebar-accent-foreground: #6ee7b7;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-ring: #10b981;
  --chart-1: #34d399;
  --chart-2: #38bdf8;
  --chart-3: #a78bfa;
  --chart-4: #fbbf24;
  --chart-5: #a3e635;
  --overview-accent-1: #34d399;
  --overview-accent-2: #38bdf8;
  --overview-accent-3: #a3e635;
}

body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

table td, table th, code, pre {
  font-variant-numeric: tabular-nums;
}

main {
  padding-bottom: 76px !important;
}

/* Lift #root > .isolate stacking trap so z-50 dialogs/sheets natively stack above #og-dock (z-9) */
#root > .isolate {
  isolation: auto !important;
}

/* OpenGate Floating Quick Dock — z-9 below dialogs/sheets (z-50) & auto-hidden whenever any modal/sheet opens */
#og-dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.12);
  backdrop-filter: blur(12px);
  font-family: var(--font-ui-sans);
  font-size: 12px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
html[data-base-ui-scroll-locked] #og-dock,
body[data-base-ui-scroll-locked] #og-dock,
body[data-scroll-locked] #og-dock,
html:has([data-base-ui-inert]) #og-dock,
html:has([data-slot="dialog-content"]:not([data-closed])) #og-dock,
html:has([data-slot="dialog-overlay"]:not([data-closed])) #og-dock,
html:has([data-slot="sheet-content"]:not([data-closed])) #og-dock,
html:has([data-slot="sheet-overlay"]:not([data-closed])) #og-dock,
html:has([data-slot="alert-dialog-content"]:not([data-closed])) #og-dock,
html:has([role="dialog"]:not([data-closed])) #og-dock,
html:has([role="alertdialog"]:not([data-closed])) #og-dock,
#og-dock.og-modal-hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.dark #og-dock {
  background: rgba(17, 22, 34, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
#og-dock a, #og-dock button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--foreground);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}
#og-dock a:hover, #og-dock button:hover { background: var(--muted); }
#og-dock a.og-pay-cta {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.32);
}
#og-dock a.og-pay-cta:hover { filter: brightness(1.07); background: linear-gradient(135deg, #059669, #10b981); }
#og-dock .og-sep { width: 1px; height: 14px; background: var(--border); }
#og-dock.collapsed {
  left: auto;
  right: 12px;
  transform: none;
  padding: 4px;
}
#og-dock.collapsed .og-item,
#og-dock.collapsed .og-sep { display: none !important; }
#og-toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 60;
  padding: 8px 14px; border-radius: 8px; background: #0f172a; color: #f8fafc;
  font-size: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
#og-toast.show { opacity: 1; }
#og-inv-mask {
  position: fixed; inset: 0; z-index: 55; display: none; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(4px); padding: 16px; font-family: var(--font-ui-sans);
}
#og-inv-mask.open { display: flex; }
#og-inv-card {
  width: 100%; max-width: 460px; border-radius: 14px; padding: 22px; background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
}
.og-inv-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.og-inv-kpi > div { padding: 10px 12px; border-radius: 9px; background: var(--muted); border: 1px solid var(--border); }
.og-inv-kpi small { display: block; font-size: 11px; color: var(--muted-foreground); }
.og-inv-kpi strong { display: block; font-size: 18px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.og-inv-row { display: flex; gap: 8px; margin-top: 8px; }
.og-inv-inp { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--muted); color: var(--foreground); font-size: 12.5px; font-family: ui-monospace, monospace; }
.og-inv-btn { padding: 8px 13px; border-radius: 8px; border: none; background: var(--primary); color: var(--primary-foreground); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
@media (max-width: 640px) {
  #og-dock { bottom: 8px; padding: 4px 6px; gap: 4px; }
  #og-dock .og-hide-sm { display: none; }
}
