/* ==========================================================================
   Trademind.win — Binance Pro Desktop & Mobile PWA Terminal Design System
   Complete Layout, Sidebar, Topbar, KPI Grid, Buttons, Badges, Tables & Forms
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bn-bg: #0b0e11;
  --bn-panel: #11161d;
  --bn-bg-elevated: #161d26;
  --bn-border: #1f2937;
  --bn-border-light: #2b3139;
  --bn-text-primary: #eaecef;
  --bn-text-secondary: #848e9c;
  --bn-text-muted: #5e6673;

  --bn-yellow: #fcd535;
  --bn-yellow-hover: #f0b90b;
  --bn-yellow-bg: rgba(252, 213, 53, 0.14);

  --bn-green: #0ecb81;
  --bn-green-bg: rgba(14, 203, 129, 0.14);

  --bn-red: #f6465d;
  --bn-red-bg: rgba(246, 70, 93, 0.14);

  --bn-blue: #3b82f6;
  --bn-cyan: #22d3ee;
  --bn-purple: #a855f7;
}

html[data-theme="light"] {
  --bn-bg: #f4f6f9;
  --bn-panel: #ffffff;
  --bn-bg-elevated: #eef1f6;
  --bn-border: #dde2e8;
  --bn-border-light: #cfd6e0;
  --bn-text-primary: #1e2329;
  --bn-text-secondary: #474d57;
  --bn-text-muted: #707a8a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bn-bg);
  color: var(--bn-text-primary);
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono,
.font-mono-num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Text color utilities */
.text-green, .pos { color: var(--bn-green) !important; }
.text-red, .neg { color: var(--bn-red) !important; }
.text-yellow, .gold { color: var(--bn-yellow) !important; }
.text-muted { color: var(--bn-text-secondary) !important; }
.text-center { text-align: center !important; }
.mb-3 { margin-bottom: 14px !important; }

/* ==========================================================================
   APP SHELL: FIXED LEFT SIDEBAR + MAIN VIEWPORT
   ========================================================================== */
.bn-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.bn-sidebar {
  width: 248px;
  background: var(--bn-panel);
  border-right: 1px solid var(--bn-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.bn-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--bn-border);
  color: var(--bn-text-primary);
  text-decoration: none;
}

.bn-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--bn-yellow), #f59e0b);
  color: #0b0e11;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(252, 213, 53, 0.25);
}

.bn-brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--bn-text-primary);
}
.bn-brand-title span {
  color: var(--bn-yellow);
}

/* Sidebar Navigation */
.bn-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 10px;
  flex: 1;
}

.bn-nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--bn-text-secondary);
  padding: 10px 8px 4px;
}

.bn-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--bn-text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.bn-nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bn-nav-item:hover {
  background: var(--bn-bg-elevated);
  color: var(--bn-text-primary);
}

.bn-nav-item.active {
  background: var(--bn-yellow-bg);
  color: var(--bn-yellow);
  border-color: rgba(252, 213, 53, 0.35);
}

.bn-sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--bn-border);
  background: rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   MAIN VIEWPORT & STICKY TOP HEADER BAR
   ========================================================================== */
.bn-viewport {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bn-bg);
}

.bn-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(17, 22, 29, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bn-border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bn-topbar-left,
.bn-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bn-content {
  padding: 16px 18px 36px;
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
}

/* Paper / Live Segmented Toggle Pill */
.bn-mode-pill {
  display: inline-flex;
  background: #0b0e11;
  border: 1px solid var(--bn-border-light);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.bn-mode-pill button {
  background: transparent;
  border: none;
  color: var(--bn-text-secondary);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bn-mode-pill button.active-paper {
  background: var(--bn-yellow);
  color: #0b0e11;
}

.bn-mode-pill button.active-live {
  background: var(--bn-green);
  color: #0b0e11;
}

.bn-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--bn-border-light);
  background: var(--bn-bg-elevated);
  color: var(--bn-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bn-icon-btn:hover {
  border-color: var(--bn-yellow);
  color: var(--bn-yellow);
}

/* ==========================================================================
   CARDS, GRIDS & KPI STRIP
   ========================================================================== */
.bn-card {
  background: var(--bn-panel);
  border: 1px solid var(--bn-border);
  border-radius: 11px;
  overflow: hidden;
}

.bn-card-header {
  padding: 11px 15px;
  border-bottom: 1px solid var(--bn-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bn-card-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--bn-text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.bn-card-title .title-icon {
  width: 15px;
  height: 15px;
  color: var(--bn-yellow);
}

.bn-card-body {
  padding: 14px 15px;
}

/* KPI Strip Grid */
.bn-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.bn-kpi-card {
  background: var(--bn-panel);
  border: 1px solid var(--bn-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.bn-kpi-label {
  font-size: 11.5px;
  color: var(--bn-text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bn-kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--bn-text-primary);
  line-height: 1.2;
}

.bn-kpi-sub {
  font-size: 11.5px;
  color: var(--bn-text-secondary);
  margin-top: 5px;
}

/* Multi-Column Responsive Grids */
.bn-grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
}

.bn-grid-3 {
  display: grid;
  grid-template-columns: 1.45fr 1fr 0.95fr;
  gap: 12px;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.bn-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--bn-border-light);
  background: var(--bn-bg-elevated);
  color: var(--bn-text-primary);
  text-decoration: none;
  transition: all 0.14s ease;
  line-height: 1.2;
}

.bn-btn:hover {
  border-color: var(--bn-yellow);
}

.bn-btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 6px;
}

.bn-btn-primary {
  background: var(--bn-yellow);
  color: #0b0e11 !important;
  border-color: var(--bn-yellow);
}
.bn-btn-primary:hover {
  background: var(--bn-yellow-hover);
  border-color: var(--bn-yellow-hover);
}

.bn-btn-success {
  background: var(--bn-green-bg);
  color: var(--bn-green) !important;
  border-color: rgba(14, 203, 129, 0.45);
}
.bn-btn-success:hover {
  background: rgba(14, 203, 129, 0.24);
}

.bn-btn-danger {
  background: var(--bn-red-bg);
  color: var(--bn-red) !important;
  border-color: rgba(246, 70, 93, 0.45);
}
.bn-btn-danger:hover {
  background: rgba(246, 70, 93, 0.24);
}

.bn-btn-outline {
  background: var(--bn-bg-elevated);
  color: var(--bn-text-primary);
  border-color: var(--bn-border-light);
}
.bn-btn-outline:hover {
  border-color: var(--bn-yellow);
  color: var(--bn-yellow);
}

/* Badges */
.bn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.bn-badge-yellow {
  background: var(--bn-yellow-bg);
  color: var(--bn-yellow);
  border: 1px solid rgba(252, 213, 53, 0.35);
}

.bn-badge-green {
  background: var(--bn-green-bg);
  color: var(--bn-green);
  border: 1px solid rgba(14, 203, 129, 0.35);
}

.bn-badge-red {
  background: var(--bn-red-bg);
  color: var(--bn-red);
  border: 1px solid rgba(246, 70, 93, 0.35);
}

.bn-badge-gray {
  background: rgba(132, 142, 156, 0.14);
  color: var(--bn-text-secondary);
  border: 1px solid rgba(132, 142, 156, 0.25);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.bn-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.bn-form-group {
  margin-bottom: 12px;
}

.bn-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bn-text-secondary);
  margin-bottom: 5px;
}

.bn-input,
.bn-select {
  width: 100%;
  background: #0c1017;
  border: 1px solid var(--bn-border-light);
  color: var(--bn-text-primary);
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.bn-input:focus,
.bn-select:focus {
  border-color: var(--bn-yellow);
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.bn-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.bn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bn-table th {
  text-align: left;
  padding: 9px 10px;
  color: var(--bn-text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--bn-border);
  background: var(--bn-panel);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.bn-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.65);
  white-space: nowrap;
}

.bn-table tbody tr:hover {
  background: rgba(252, 213, 53, 0.05);
}

/* ==========================================================================
   TOAST NOTIFICATIONS & MOBILE BOTTOM BAR
   ========================================================================== */
.bn-toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bn-toast {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.bn-toast.toast-ok {
  background: #0d281e;
  border: 1px solid var(--bn-green);
  color: var(--bn-green);
}

.bn-toast.toast-err {
  background: #2c1218;
  border: 1px solid var(--bn-red);
  color: var(--bn-red);
}

/* Mobile Bottom Navigation (Hidden on Desktop, Shown on Mobile/Tablet) */
.bn-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bn-panel);
  border-top: 1px solid var(--bn-border);
  z-index: 95;
  justify-content: space-around;
  align-items: center;
}

.bn-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--bn-text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  flex: 1;
  height: 100%;
}

.bn-tab-item .tab-icon {
  width: 18px;
  height: 18px;
}

.bn-tab-item.active {
  color: var(--bn-yellow);
}

/* Responsive Breakpoints */
@media (max-width: 1350px) {
  .bn-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bn-grid-3 {
    grid-template-columns: 1fr;
  }
  .bn-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .bn-sidebar {
    display: none;
  }
  .bn-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 64px;
  }
  .bn-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bn-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--bn-border-light);
  border-radius: 3px;
}
