/* ==========================================================================
   CORE SYSTEM — VARIAN 2: SLATE SAPPHIRE CORPORATE (PURE CLEAN STYLESHEET)
   Old template CSS 100% removed.
   Canvas: #0F172A | Sidebar/Topbar: #0B1120 | Card/Panel: #1E293B
   Border: #334155 | Primary Accent: #3B82F6 | Positive: #10B981
   Font: Inter | Primary Text: #F8FAFC | Secondary Text: #94A3B8
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root,
html,
html[data-bs-theme="dark"],
html[data-theme="dark"] {
  --lte-blue: #3b82f6 !important;
  --lte-blue-dark: #2563eb !important;
  --lte-blue-light: #60a5fa !important;
  --lte-sidebar-bg: #0b1120 !important;
  --lte-sidebar-dark: #070b14 !important;
  --lte-sidebar-hover: #1e293b !important;
  --lte-sidebar-text: #cbd5e1 !important;
  --lte-sidebar-active: #ffffff !important;
  --lte-content-bg: #0f172a !important;
  --lte-box-bg: #1e293b !important;
  --lte-surface-subtle: #0b1120 !important;
  --lte-border: #334155 !important;
  --lte-border-light: #263449 !important;
  --lte-text: #f8fafc !important;
  --lte-text-muted: #94a3b8 !important;
  --lte-radius: 8px !important;
  --lte-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;

  /* Override all sub-page custom variables (--md-*, --shopee-*, --wish-*, --bg-*) */
  --md-primary: #3b82f6 !important;
  --md-primary-hover: #2563eb !important;
  --md-primary-container: rgba(59, 130, 246, 0.16) !important;
  --md-on-primary-container: #60a5fa !important;
  --md-surface: #1e293b !important;
  --md-surface-variant: #162032 !important;
  --md-bg: #0f172a !important;
  --md-outline: #334155 !important;
  --md-text-primary: #f8fafc !important;
  --md-text-secondary: #94a3b8 !important;

  --bg-dark: #0f172a !important;
  --bg-page: #0f172a !important;
  --card-bg: #1e293b !important;
  --card-border: #334155 !important;
  --shopee-primary: #3b82f6 !important;
  --shopee-orange: #3b82f6 !important;
  --primary-ads: #3b82f6 !important;
  --primary-dark: #1e293b !important;
  --primary-light: #162032 !important;

  --wish-text-xs: 11.5px !important;
  --wish-text-sm: 13px !important;
  --wish-text-md: 14px !important;
  --wish-text-lg: 16px !important;
  --wish-text-xl: 20px !important;

  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  --bs-body-bg: #0f172a !important;
  --bs-body-color: #f8fafc !important;
  --bs-secondary-color: #94a3b8 !important;
  --bs-border-color: #334155 !important;
}

/* Global Reset & Single Unified Font (Inter) */
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  background: #0f172a !important;
  background-color: #0f172a !important;
  color: #f8fafc !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  -webkit-font-smoothing: antialiased;
}
body *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands):not([class*="fa-"]) {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-variant-numeric: tabular-nums;
}

/* Custom Clean Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0b1120; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* 1. ALL CARDS, BOXES, PANELS -> #1E293B */
.card, .box, .info-box, .small-box, .modal-content, .offcanvas, .dropdown-menu,
.wish-card, .kpi-box, .shopee-kpi-card, .stat-card, .bot-card, .header-box,
.filter-card, .panel-card, .panel-box, .section-card, .metric-card, .summary-card,
.config-card, .account-card, .store-card, .product-card, .table-card,
.unified-topbar, .warroom-card, .autopilot-card, .hsl-card, .spy-card,
.android-top-app-bar, .wb-panel, .wb-metric-cell, .wb-bot-card {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

/* 2. SUB-HEADERS, FILTER BARS, TOOLBARS -> #0B1120 */
.card-header, .box-header, .modal-header, .modal-footer, .card-footer,
.wb-panel-header, .store-filter-wrap, .filter-bar, .search-bar, .toolbar-box,
.sub-panel, .input-group-text, .list-group-item,
.bg-white, .bg-light, .bg-body, .bg-body-tertiary, .bg-body-secondary {
  background: #0b1120 !important;
  background-color: #0b1120 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* 3. TYPOGRAPHY HIERARCHY — NO DARK/BLACK TEXT ON DARK CARDS EVER! */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.card-title, .box-title, .wb-panel-title, .wb-metric-val,
.shopee-kpi-value, .info-box-number, .stat-value, .kpi-value,
.fs-1, .fs-2, .fs-3, .fs-4, .fs-5, .fw-bold, .fw-semibold,
.text-dark, .text-black, .text-body, .text-white, strong, b, td {
  color: #f8fafc !important;
}

.shopee-kpi-title, .wb-metric-head, .wb-metric-sub, .info-box-text,
.text-muted, .text-secondary, small, .small, .form-text, .card-subtitle,
th, .table thead th, .form-label, label {
  color: #94a3b8 !important;
}

p, li, span {
  color: inherit;
}

/* 4. STANDARDIZED BUTTONS, FILTER PILLS & TABS (VARIAN 2 SAPPHIRE) */
.btn, button.btn, a.btn, .seller-page-btn, .store-filter-btn, .btn-filter, .btn-filter-chip, .wb-action-btn {
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

/* Primary / Active Buttons -> Royal Sapphire #3B82F6 with #FFFFFF text */
.btn-primary, .btn-warning, .btn-info, .wb-action-btn.active,
.seller-page-btn.active, .store-filter-btn.active, .btn-filter.active,
.btn-filter-chip.active, .page-item.active .page-link,
.nav-pills .nav-link.active, .nav-tabs .nav-link.active {
  background: #3b82f6 !important;
  background-color: #3b82f6 !important;
  border: 1px solid #3b82f6 !important;
  color: #ffffff !important;
}
.btn-primary *, .btn-warning *, .btn-info *, .wb-action-btn.active *,
.seller-page-btn.active *, .store-filter-btn.active *, .nav-pills .nav-link.active * {
  color: #ffffff !important;
}
.btn-primary:hover, .btn-warning:hover, .btn-info:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

/* Success Buttons -> Emerald #10B981 with #FFFFFF text */
.btn-success {
  background: #10b981 !important;
  background-color: #10b981 !important;
  border: 1px solid #10b981 !important;
  color: #ffffff !important;
}
.btn-success * { color: #ffffff !important; }

/* Danger Buttons -> Red #EF4444 */
.btn-danger, .btn-outline-danger {
  background: rgba(239, 68, 68, 0.16) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}
.btn-danger:hover, .btn-outline-danger:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

/* Secondary / Default / White / Outline Buttons -> Dark Slate #162032 (NO WHITE BUTTONS!) */
.btn-light, .btn-default, .btn-white, .btn-secondary,
.btn-outline-secondary, .btn-outline-dark, .btn-outline-primary, .btn-outline-light,
.wb-action-btn:not(.active), .seller-page-btn:not(.active), .store-filter-btn:not(.active),
.btn-filter:not(.active), .btn-filter-chip:not(.active),
.page-link, .nav-pills .nav-link:not(.active), .nav-tabs .nav-link:not(.active) {
  background: #162032 !important;
  background-color: #162032 !important;
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}
.btn-light *, .btn-default *, .btn-white *, .btn-secondary *,
.btn-outline-secondary *, .btn-outline-dark *, .btn-outline-primary * {
  color: #cbd5e1 !important;
}
.btn-light:hover, .btn-default:hover, .btn-white:hover, .btn-secondary:hover,
.btn-outline-secondary:hover, .btn-outline-dark:hover, .btn-outline-primary:hover,
.wb-action-btn:hover, .seller-page-btn:hover, .store-filter-btn:hover {
  background: #263449 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

/* 5. BADGES & STATUS PILLS (NO LIGHT-ON-LIGHT OR DARK-ON-DARK!) */
.badge, .status-pill, .pill-badge {
  border-radius: 6px !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
}
.badge.bg-light, .badge.bg-white, .badge.text-dark, .bg-secondary-subtle, .bg-light-subtle {
  background: #162032 !important;
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}
.bg-primary-subtle { background: rgba(59, 130, 246, 0.16) !important; color: #60a5fa !important; border: 1px solid rgba(59, 130, 246, 0.3) !important; }
.bg-success-subtle { background: rgba(16, 185, 129, 0.16) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.3) !important; }
.bg-warning-subtle { background: rgba(245, 158, 11, 0.16) !important; color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.3) !important; }
.bg-info-subtle    { background: rgba(6, 182, 212, 0.16) !important; color: #38bdf8 !important; border: 1px solid rgba(6, 182, 212, 0.3) !important; }
.bg-danger-subtle  { background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; }

/* 6. FORMS & INPUTS */
.form-control, .form-select, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  background: #0b1120 !important;
  background-color: #0b1120 !important;
  border: 1px solid #334155 !important;
  border-radius: 6px !important;
  color: #f8fafc !important;
  font-size: 12.5px !important;
}
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
  outline: none !important;
}
::placeholder { color: #64748b !important; }

/* 7. TABLES */
table, .table {
  width: 100%;
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
.table thead th, table thead th {
  background: #0b1120 !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  border-bottom: 1px solid #334155 !important;
  padding: 10px 12px !important;
}
.table tbody tr, table tbody tr, .table-striped > tbody > tr:nth-of-type(odd) > * {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-bottom: 1px solid #263449 !important;
}
.table-hover > tbody > tr:hover > * {
  background: #263449 !important;
  color: #ffffff !important;
}
.table td, table td {
  padding: 10px 12px !important;
  vertical-align: middle !important;
}


[data-wish-feature-title], .android-top-app-bar *, .header-box * {
  color: #f8fafc !important;
}
.btn-outline-warning, .btn-outline-info, .btn-outline-success {
  background: #162032 !important;
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}
.btn-outline-warning:hover, .btn-outline-info:hover, .btn-outline-success:hover {
  background: #263449 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}


/* ==========================================================================
   CRISP HIGH-CONTRAST TEXT GUARANTEE (NO DIM/DARK SPANS OR LABELS)
   ========================================================================== */
body, div, p, span, li, a, td, label, dd, dt,
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.card-title, .box-title, .wb-panel-title, .wb-metric-val,
.shopee-kpi-value, .info-box-number, .stat-value, .kpi-value,
.text-dark, .text-black, .text-body, .text-white, strong, b {
  color: #F8FAFC !important;
}

th, .table thead th, .wb-metric-head, .wb-metric-sub,
.shopee-kpi-title, .info-box-text, .text-muted, .text-secondary,
small, .small, .form-text, .card-subtitle, .form-label {
  color: #CBD5E1 !important;
}

/* Sidebar, Topbar & Status Bar Explicit Bright Text */
#wbLeftNav .wb-nav-heading {
  color: #60A5FA !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
}
#wbLeftNav .wb-nav-item,
#wbLeftNav .wb-nav-item span {
  color: #F1F5F9 !important;
  font-weight: 500 !important;
}
#wbLeftNav .wb-nav-item i {
  color: #93C5FD !important;
}
#wbLeftNav .wb-nav-item:hover,
#wbLeftNav .wb-nav-item:hover span,
#wbLeftNav .wb-nav-item:hover i {
  background: #1e293b !important;
  color: #FFFFFF !important;
}
#wbLeftNav .wb-nav-item.active {
  background: #2563eb !important;
  border-left: 3px solid #60a5fa !important;
}
#wbLeftNav .wb-nav-item.active,
#wbLeftNav .wb-nav-item.active span,
#wbLeftNav .wb-nav-item.active i {
  color: #FFFFFF !important;
  font-weight: 700 !important;
}

#wbTopBar .wb-tab-item,
#wbTopBar .wb-tab-item span {
  color: #CBD5E1 !important;
}
#wbTopBar .wb-tab-item i {
  color: #93C5FD !important;
}
#wbTopBar .wb-tab-item.active,
#wbTopBar .wb-tab-item.active span,
#wbTopBar .wb-tab-item.active i {
  color: #FFFFFF !important;
}

#wbStatusBar,
#wbStatusBar span,
#wbStatusBar div {
  color: #E2E8F0 !important;
}

/* Preserve Semantic Colors */
.text-success, i.text-success, span.text-success { color: #34D399 !important; }
.text-warning, i.text-warning, span.text-warning { color: #FBBF24 !important; }
.text-danger,  i.text-danger,  span.text-danger  { color: #F87171 !important; }
.text-info,    i.text-info,    span.text-info    { color: #38BDF8 !important; }
.text-primary, i.text-primary, span.text-primary { color: #60A5FA !important; }


/* Fix .badge.bg-warning with .text-warning so it never renders yellow-on-yellow */
.badge.bg-warning, .bg-warning.bg-opacity-20, .bg-warning.bg-opacity-25, .bg-warning.bg-opacity-10 {
  background: rgba(59, 130, 246, 0.16) !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  color: #60A5FA !important;
}
