/*
 * AllInvestView Premium Light Theme
 * A modern, fintech-inspired light theme with professional styling
 * Built on Bootstrap 5.3 CSS variables
 * Designed to complement the Premium Dark theme
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* =============================================
   CSS Variables - Premium Light Color Palette
   ============================================= */

:root {
  /* Core Background Colors */
  --premium-bg-primary: #ffffff;
  --premium-bg-secondary: #f8fafc;
  --premium-bg-tertiary: #f1f5f9;
  --premium-bg-elevated: #e2e8f0;

  /* Text Colors */
  --premium-text-primary: #0f172a;
  --premium-text-secondary: #475569;
  --premium-text-muted: #94a3b8;
  --premium-text-link: #2563eb;

  /* Brand Colors */
  --premium-brand-primary: #3b82f6;
  --premium-brand-primary-hover: #2563eb;
  --premium-brand-primary-rgb: 59, 130, 246;

  /* Semantic Colors */
  --premium-success: #16a34a;
  --premium-success-bg: rgba(22, 163, 74, 0.1);
  --premium-danger: #dc2626;
  --premium-danger-bg: rgba(220, 38, 38, 0.1);
  --premium-warning: #d97706;
  --premium-warning-bg: rgba(217, 119, 6, 0.1);
  --premium-info: #0891b2;
  --premium-info-bg: rgba(8, 145, 178, 0.1);

  /* Border Colors */
  --premium-border: #e2e8f0;
  --premium-border-subtle: #f1f5f9;
  --premium-border-muted: #cbd5e1;

  /* Shadows */
  --premium-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --premium-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --premium-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --premium-shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);

  /* DataTables variables */
  --dt-html-background: #ffffff;
  --dtfc_background: #ffffff;
  --dtfc-thead-cell_background: #f8fafc;
  --dtfc-tbody-cell_background: #ffffff;
  --dt-row-background: #ffffff;
  --dt-row-stripe: #f8fafc;

  /* Bootstrap Variable Overrides */
  --bs-body-bg: var(--premium-bg-primary);
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-body-color: var(--premium-text-primary);
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --bs-primary: var(--premium-brand-primary);
  --bs-primary-rgb: var(--premium-brand-primary-rgb);
  --bs-secondary: #64748b;
  --bs-secondary-rgb: 100, 116, 139;
  --bs-success: var(--premium-success);
  --bs-success-rgb: 22, 163, 74;
  --bs-danger: var(--premium-danger);
  --bs-danger-rgb: 220, 38, 38;
  --bs-warning: var(--premium-warning);
  --bs-warning-rgb: 217, 119, 6;
  --bs-info: var(--premium-info);
  --bs-info-rgb: 8, 145, 178;

  --bs-link-color: var(--premium-text-link);
  --bs-link-hover-color: #1d4ed8;
  --bs-code-color: #be185d;

  --bs-border-color: var(--premium-border);
  --bs-border-color-translucent: rgba(0, 0, 0, 0.1);

  --bs-card-bg: var(--premium-bg-primary);
  --bs-card-border-color: var(--premium-border);

  --bs-modal-bg: var(--premium-bg-primary);

  --bs-tertiary-bg: var(--premium-bg-tertiary);
  --bs-secondary-bg: var(--premium-bg-secondary);
}

/* =============================================
   Base Styles
   ============================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--premium-bg-secondary);
  color: var(--premium-text-primary);
  font-family: var(--bs-body-font-family);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Typography
   ============================================= */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--premium-text-primary);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h1, .h1 { font-size: 2.25rem; }
h2, .h2 { font-size: 1.875rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.25rem; }
h5, .h5 { font-size: 1.125rem; }
h6, .h6 { font-size: 1rem; }

p {
  color: var(--premium-text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--premium-text-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1d4ed8;
}

.text-muted {
  color: var(--premium-text-muted) !important;
}

.text-secondary {
  color: var(--premium-text-secondary) !important;
}

/* =============================================
   Cards
   ============================================= */

.card {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.75rem;
  box-shadow: var(--premium-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--premium-shadow-md);
}

.card-header {
  background: var(--premium-bg-secondary);
  border-bottom: 1px solid var(--premium-border);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  background: var(--premium-bg-secondary);
  border-top: 1px solid var(--premium-border);
  padding: 1rem 1.25rem;
}

.card-title {
  color: var(--premium-text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-subtitle {
  color: var(--premium-text-secondary);
}

.card-text {
  color: var(--premium-text-secondary);
}

/* =============================================
   Buttons
   ============================================= */

.btn {
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--premium-brand-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--premium-brand-primary-hover);
  color: #fff;
  box-shadow: var(--premium-shadow-md), var(--premium-shadow-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--premium-bg-tertiary);
  border: 1px solid var(--premium-border);
  color: var(--premium-text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--premium-bg-elevated);
  border-color: var(--premium-border-muted);
  color: var(--premium-text-primary);
}

.btn-success {
  background: var(--premium-success);
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
  color: #fff;
  box-shadow: var(--premium-shadow-md);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--premium-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
  box-shadow: var(--premium-shadow-md);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--premium-warning);
  color: #fff;
}

.btn-warning:hover {
  background: #b45309;
  color: #fff;
}

.btn-info {
  background: var(--premium-info);
  color: #fff;
}

.btn-info:hover {
  background: #0e7490;
  color: #fff;
}

.btn-outline-primary {
  border: 1px solid var(--premium-brand-primary);
  color: var(--premium-brand-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--premium-brand-primary);
  color: #fff;
  box-shadow: var(--premium-shadow-glow);
}

.btn-outline-secondary {
  border: 1px solid var(--premium-border-muted);
  color: var(--premium-text-secondary);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--premium-bg-tertiary);
  border-color: var(--premium-border-muted);
  color: var(--premium-text-primary);
}

.btn-link {
  color: var(--premium-text-link);
}

.btn-link:hover {
  color: #1d4ed8;
}

/* =============================================
   Forms
   ============================================= */

.form-control,
.form-select {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border-muted);
  border-radius: 0.5rem;
  color: var(--premium-text-primary);
  padding: 0.625rem 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  background: var(--premium-bg-primary);
  border-color: var(--premium-brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  color: var(--premium-text-primary);
  outline: none;
}

.form-control::placeholder {
  color: var(--premium-text-muted);
}

.form-control:disabled,
.form-select:disabled {
  background: var(--premium-bg-tertiary);
  color: var(--premium-text-muted);
  cursor: not-allowed;
}

.form-label {
  color: var(--premium-text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-text {
  color: var(--premium-text-muted);
  font-size: 0.875rem;
}

.form-check-input {
  background-color: var(--premium-bg-primary);
  border: 1px solid var(--premium-border-muted);
}

.form-check-input:checked {
  background-color: var(--premium-brand-primary);
  border-color: var(--premium-brand-primary);
}

.form-check-input:focus {
  border-color: var(--premium-brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-check-label {
  color: var(--premium-text-secondary);
}

.input-group-text {
  background: var(--premium-bg-tertiary);
  border: 1px solid var(--premium-border-muted);
  color: var(--premium-text-secondary);
}

/* =============================================
   Tables
   ============================================= */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--premium-text-primary);
  --bs-table-border-color: var(--premium-border);
  --bs-table-striped-bg: var(--premium-bg-secondary);
  --bs-table-hover-bg: var(--premium-bg-tertiary);
  color: var(--premium-text-primary);
  margin-bottom: 0;
}

.table > thead {
  background: var(--premium-bg-secondary);
}

.table > thead > tr > th {
  border-bottom: 1px solid var(--premium-border);
  color: var(--premium-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  text-transform: uppercase;
}

.table > tbody > tr > td {
  border-bottom: 1px solid var(--premium-border-subtle);
  padding: 0.875rem 1rem;
  vertical-align: middle;
}

.table > tbody > tr:last-child > td {
  border-bottom: none;
}

.table-hover > tbody > tr:hover {
  background: var(--premium-bg-tertiary);
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--premium-bg-secondary);
}

/* =============================================
   Navigation
   ============================================= */

.navbar {
  background: var(--premium-bg-primary) !important;
  border-bottom: 1px solid var(--premium-border);
  box-shadow: var(--premium-shadow-sm);
}

.navbar-brand {
  color: var(--premium-text-primary) !important;
  font-weight: 600;
}

.navbar-nav .nav-link {
  color: var(--premium-text-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--premium-text-primary) !important;
}

.navbar-toggler {
  border-color: var(--premium-border);
}

/* =============================================
   Navigation - Premium Light Theme Overrides
   (Handles navbar-dark class and inline styles)
   ============================================= */

/* Override navbar-dark bg-dark when premium-light-theme is active */
.premium-light-theme .navbar,
.premium-light-theme .navbar.navbar-dark,
.premium-light-theme .navbar.bg-dark,
.premium-light-theme #main-navbar {
  background: var(--premium-bg-primary) !important;
  border-bottom: 1px solid var(--premium-border) !important;
  box-shadow: var(--premium-shadow-sm) !important;
}

/* Brand text - override white text - CRITICAL: target the span directly */
.premium-light-theme .navbar-brand,
.premium-light-theme .navbar .webpage-name,
.premium-light-theme .navbar-brand .webpage-name,
.premium-light-theme #main-navbar .webpage-name {
  color: var(--premium-text-primary) !important;
}

/* Keep the "View" part blue */
.premium-light-theme .navbar .webpage-name span,
.premium-light-theme #main-navbar .webpage-name span {
  color: var(--premium-brand-primary) !important;
}

/* Nav links - override navbar-dark white text */
.premium-light-theme .navbar-dark .nav-link,
.premium-light-theme .navbar .nav-link,
.premium-light-theme #main-navbar .nav-link {
  color: var(--premium-text-secondary) !important;
}

.premium-light-theme .navbar-dark .nav-link:hover,
.premium-light-theme .navbar-dark .nav-link.active,
.premium-light-theme .navbar .nav-link:hover,
.premium-light-theme .navbar .nav-link.active {
  color: var(--premium-text-primary) !important;
}

/* Dropdown toggle text - override inline white/gray colors */
.premium-light-theme .navbar .dropdown-toggle,
.premium-light-theme #main-navbar .dropdown-toggle {
  color: var(--premium-text-secondary) !important;
}

.premium-light-theme .navbar .dropdown-toggle:hover,
.premium-light-theme #main-navbar .dropdown-toggle:hover {
  color: var(--premium-text-primary) !important;
}

/* Dropdown menus - light background instead of dark #2a2a2a */
.premium-light-theme .navbar .dropdown-menu,
.premium-light-theme #main-navbar .dropdown-menu {
  background-color: var(--premium-bg-primary) !important;
  border: 1px solid var(--premium-border) !important;
  box-shadow: var(--premium-shadow-lg) !important;
}

/* Dropdown items - dark text on light background */
.premium-light-theme .navbar .dropdown-item,
.premium-light-theme #main-navbar .dropdown-item,
.premium-light-theme .navbar .dropdown-menu a,
.premium-light-theme #main-navbar .dropdown-menu a {
  color: var(--premium-text-primary) !important;
}

.premium-light-theme .navbar .dropdown-item:hover,
.premium-light-theme .navbar .dropdown-item:focus,
.premium-light-theme #main-navbar .dropdown-item:hover {
  background-color: var(--premium-bg-tertiary) !important;
  color: var(--premium-text-primary) !important;
}

/* Dropdown headers */
.premium-light-theme .navbar .dropdown-header,
.premium-light-theme #main-navbar .dropdown-header {
  color: var(--premium-text-primary) !important;
}

/* Dropdown dividers */
.premium-light-theme .navbar .dropdown-divider,
.premium-light-theme #main-navbar .dropdown-divider {
  border-top-color: var(--premium-border) !important;
}

/* Dropdown icons */
.premium-light-theme .navbar .dropdown-item i,
.premium-light-theme .navbar .dropdown-item .fa,
.premium-light-theme .navbar .dropdown-item .fas,
.premium-light-theme .navbar .dropdown-item .far,
.premium-light-theme #main-navbar .dropdown-item i {
  color: var(--premium-text-muted) !important;
}

/* =============================================
   Right Side Navbar Elements - Portfolio/Currency/User
   ============================================= */

/* Portfolio dropdown button and text */
.premium-light-theme #main-navbar .btn.dropdown-toggle,
.premium-light-theme #main-navbar button.dropdown-toggle {
  color: var(--premium-text-secondary) !important;
}

.premium-light-theme #main-navbar #currentPortfolioName,
.premium-light-theme #main-navbar #currentCurrency {
  color: var(--premium-text-secondary) !important;
}

/* Briefcase and other icons in navbar buttons */
.premium-light-theme #main-navbar .btn i,
.premium-light-theme #main-navbar .btn .fas,
.premium-light-theme #main-navbar .btn .fa {
  color: var(--premium-text-muted) !important;
}

/* User icon button */
.premium-light-theme #main-navbar #userDropdown,
.premium-light-theme #main-navbar #userDropdown i {
  color: var(--premium-text-secondary) !important;
}

/* User dropdown menu specific */
.premium-light-theme #main-navbar #portfolioMenu,
.premium-light-theme #main-navbar #currencyMenu {
  background-color: var(--premium-bg-primary) !important;
  border-color: var(--premium-border) !important;
}

/* Portfolio menu items styling */
.premium-light-theme #main-navbar #portfolioMenu li,
.premium-light-theme #main-navbar #portfolioMenu a,
.premium-light-theme #main-navbar #portfolioMenu span,
.premium-light-theme #main-navbar #currencyMenu li,
.premium-light-theme #main-navbar #currencyMenu a,
.premium-light-theme #main-navbar #currencyMenu span {
  color: var(--premium-text-primary) !important;
}

/* Dark mode toggle label in navbar */
.premium-light-theme .navbar .switchdarkmode + span,
.premium-light-theme #main-navbar .switchdarkmode + span {
  color: var(--premium-text-secondary) !important;
}

/* Subscribe/Upgrade button - keep distinct */
.premium-light-theme .navbar .upgrade-btn,
.premium-light-theme #main-navbar .upgrade-btn {
  background-color: var(--premium-brand-primary) !important;
  color: #fff !important;
}

.premium-light-theme .navbar .upgrade-btn:hover {
  background-color: var(--premium-brand-primary-hover) !important;
}

/* Navbar toggler (hamburger) icon for mobile - invert for light bg */
.premium-light-theme .navbar-toggler-icon {
  filter: invert(1) !important;
}

/* =============================================
   AGGRESSIVE OVERRIDES for inline styles
   These use very high specificity to beat inline styles
   ============================================= */

/* Override ALL elements in navbar with light gray/white inline colors */
body.premium-light-theme #main-navbar span,
body.premium-light-theme #main-navbar a,
body.premium-light-theme #main-navbar button {
  color: var(--premium-text-secondary) !important;
}

/* But keep dropdown items with primary text color */
body.premium-light-theme #main-navbar .dropdown-item,
body.premium-light-theme #main-navbar .dropdown-menu a {
  color: var(--premium-text-primary) !important;
}

/* Keep the View span blue */
body.premium-light-theme #main-navbar .webpage-name span {
  color: var(--premium-brand-primary) !important;
}

/* Keep upgrade button white text */
body.premium-light-theme #main-navbar .upgrade-btn {
  color: #fff !important;
}

.nav-tabs {
  border-bottom: 1px solid var(--premium-border);
}

.nav-tabs .nav-link {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--premium-text-secondary);
  font-weight: 500;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
  border-bottom-color: var(--premium-border-muted);
  color: var(--premium-text-primary);
}

.nav-tabs .nav-link.active {
  background: transparent;
  border-bottom-color: var(--premium-brand-primary);
  color: var(--premium-brand-primary);
}

.nav-pills .nav-link {
  background: transparent;
  border-radius: 0.5rem;
  color: var(--premium-text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.nav-pills .nav-link:hover {
  background: var(--premium-bg-tertiary);
  color: var(--premium-text-primary);
}

.nav-pills .nav-link.active {
  background: var(--premium-brand-primary);
  color: #fff;
}

/* =============================================
   Dropdowns
   ============================================= */

.dropdown-menu {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.5rem;
  box-shadow: var(--premium-shadow-lg);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 0.375rem;
  color: var(--premium-text-primary);
  padding: 0.5rem 0.75rem;
  transition: background 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--premium-bg-tertiary);
  color: var(--premium-text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--premium-brand-primary);
  color: #fff;
}

.dropdown-divider {
  border-top-color: var(--premium-border);
  margin: 0.5rem 0;
}

.dropdown-header {
  color: var(--premium-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem;
  text-transform: uppercase;
}

/* =============================================
   Modals
   ============================================= */

.modal-content {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.75rem;
  box-shadow: var(--premium-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--premium-border);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  color: var(--premium-text-primary);
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--premium-border);
  padding: 1rem 1.5rem;
}

.btn-close {
  opacity: 0.5;
}

.btn-close:hover {
  opacity: 1;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* =============================================
   Date Range Picker - Premium Light Theme
   ============================================= */

.daterangepicker {
  background-color: var(--premium-bg-primary) !important;
  border: 1px solid var(--premium-border) !important;
  border-radius: 0.5rem !important;
  box-shadow: var(--premium-shadow-lg) !important;
  color: var(--premium-text-primary) !important;
}

.daterangepicker::before,
.daterangepicker::after {
  border-bottom-color: var(--premium-bg-primary) !important;
}

.daterangepicker .calendar-table {
  background-color: var(--premium-bg-primary) !important;
  border: none !important;
}

.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td {
  color: var(--premium-text-primary) !important;
  border-radius: 4px !important;
}

.daterangepicker .calendar-table th {
  color: var(--premium-text-secondary) !important;
  font-weight: 500 !important;
}

.daterangepicker .calendar-table td.available:hover {
  background-color: var(--premium-bg-tertiary) !important;
  color: var(--premium-text-primary) !important;
}

.daterangepicker .calendar-table td.active,
.daterangepicker .calendar-table td.active:hover {
  background-color: var(--premium-brand-primary) !important;
  color: #fff !important;
}

.daterangepicker .calendar-table td.in-range {
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: var(--premium-text-primary) !important;
}

.daterangepicker .calendar-table td.start-date,
.daterangepicker .calendar-table td.end-date {
  background-color: var(--premium-brand-primary) !important;
  color: #fff !important;
  border-radius: 4px !important;
}

.daterangepicker .calendar-table td.off {
  color: var(--premium-text-muted) !important;
  background-color: transparent !important;
}

/* Month/Year selectors */
.daterangepicker select.monthselect,
.daterangepicker select.yearselect {
  background-color: var(--premium-bg-secondary) !important;
  border: 1px solid var(--premium-border) !important;
  color: var(--premium-text-primary) !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
}

.daterangepicker select.monthselect:focus,
.daterangepicker select.yearselect:focus {
  border-color: var(--premium-brand-primary) !important;
  outline: none !important;
}

/* Navigation arrows */
.daterangepicker th.prev,
.daterangepicker th.next {
  color: var(--premium-text-secondary) !important;
}

.daterangepicker th.prev:hover,
.daterangepicker th.next:hover {
  background-color: var(--premium-bg-tertiary) !important;
  color: var(--premium-text-primary) !important;
}

/* Ranges sidebar */
.daterangepicker .ranges {
  border-right: 1px solid var(--premium-border) !important;
}

.daterangepicker .ranges ul {
  padding: 0.5rem !important;
}

.daterangepicker .ranges li {
  color: var(--premium-text-secondary) !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  margin-bottom: 2px !important;
  transition: all 0.15s ease !important;
}

.daterangepicker .ranges li:hover {
  background-color: var(--premium-bg-tertiary) !important;
  color: var(--premium-text-primary) !important;
}

.daterangepicker .ranges li.active {
  background-color: var(--premium-brand-primary) !important;
  color: #fff !important;
}

/* Buttons */
.daterangepicker .drp-buttons {
  border-top: 1px solid var(--premium-border) !important;
  padding: 0.75rem 1rem !important;
}

.daterangepicker .drp-selected {
  color: var(--premium-text-secondary) !important;
  font-size: 0.875rem !important;
}

.daterangepicker .applyBtn {
  background-color: var(--premium-brand-primary) !important;
  border-color: var(--premium-brand-primary) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 6px 16px !important;
  font-weight: 500 !important;
}

.daterangepicker .applyBtn:hover {
  background-color: var(--premium-brand-primary-hover) !important;
  border-color: var(--premium-brand-primary-hover) !important;
}

.daterangepicker .cancelBtn {
  background-color: var(--premium-bg-secondary) !important;
  border-color: var(--premium-border) !important;
  color: var(--premium-text-secondary) !important;
  border-radius: 6px !important;
  padding: 6px 16px !important;
  font-weight: 500 !important;
}

.daterangepicker .cancelBtn:hover {
  background-color: var(--premium-bg-tertiary) !important;
  color: var(--premium-text-primary) !important;
}

/* =============================================
   Date Picker Container Cards (Dashboard)
   ============================================= */

.date-picker-container {
  background-color: transparent !important;
}

.date-picker-container .card {
  background-color: var(--premium-bg-primary) !important;
  border: 1px solid var(--premium-border) !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
}

.date-picker-container .card:hover {
  border-color: var(--premium-brand-primary) !important;
  box-shadow: var(--premium-shadow-sm) !important;
}

/* =============================================
   Alerts
   ============================================= */

.alert {
  border: none;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.alert-primary {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border-left: 4px solid var(--premium-brand-primary);
}

.alert-secondary {
  background: var(--premium-bg-tertiary);
  color: var(--premium-text-secondary);
}

.alert-success {
  background: var(--premium-success-bg);
  color: #166534;
  border-left: 4px solid var(--premium-success);
}

.alert-danger {
  background: var(--premium-danger-bg);
  color: #991b1b;
  border-left: 4px solid var(--premium-danger);
}

.alert-warning {
  background: var(--premium-warning-bg);
  color: #92400e;
  border-left: 4px solid var(--premium-warning);
}

.alert-info {
  background: var(--premium-info-bg);
  color: #155e75;
  border-left: 4px solid var(--premium-info);
}

/* =============================================
   Badges
   ============================================= */

.badge {
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
}

.bg-primary {
  background-color: var(--premium-brand-primary) !important;
}

.bg-secondary {
  background-color: var(--premium-bg-elevated) !important;
  color: var(--premium-text-secondary) !important;
}

.bg-success {
  background-color: var(--premium-success) !important;
}

.bg-danger {
  background-color: var(--premium-danger) !important;
}

.bg-warning {
  background-color: var(--premium-warning) !important;
  color: #fff !important;
}

.bg-info {
  background-color: var(--premium-info) !important;
  color: #fff !important;
}

/* =============================================
   Progress Bars
   ============================================= */

.progress,
.progress-stacked {
  --bs-progress-bar-bg: transparent;
  background: var(--premium-bg-tertiary);
  border-radius: 0.5rem;
  overflow: hidden;
}

.progress-bar {
  transition: width 0.3s ease;
  background-color: transparent;
}

/* =============================================
   List Groups
   ============================================= */

.list-group {
  border-radius: 0.5rem;
}

.list-group-item {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  color: var(--premium-text-primary);
  padding: 0.875rem 1.25rem;
}

.list-group-item:first-child {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.list-group-item:last-child {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.list-group-item + .list-group-item {
  border-top: none;
}

.list-group-item:hover {
  background: var(--premium-bg-secondary);
}

.list-group-item.active {
  background: var(--premium-brand-primary);
  border-color: var(--premium-brand-primary);
}

/* =============================================
   Pagination
   ============================================= */

.pagination {
  gap: 0.25rem;
}

.page-link {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.375rem;
  color: var(--premium-text-primary);
  padding: 0.5rem 0.875rem;
  transition: all 0.15s ease;
}

.page-link:hover {
  background: var(--premium-bg-tertiary);
  border-color: var(--premium-border);
  color: var(--premium-text-primary);
}

.page-item.active .page-link {
  background: var(--premium-brand-primary);
  border-color: var(--premium-brand-primary);
  color: #fff;
}

.page-item.disabled .page-link {
  background: var(--premium-bg-secondary);
  border-color: var(--premium-border);
  color: var(--premium-text-muted);
}

/* =============================================
   Breadcrumbs
   ============================================= */

.breadcrumb {
  background: transparent;
  margin-bottom: 1rem;
  padding: 0;
}

.breadcrumb-item {
  color: var(--premium-text-secondary);
}

.breadcrumb-item a {
  color: var(--premium-text-link);
}

.breadcrumb-item.active {
  color: var(--premium-text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--premium-text-muted);
}

/* =============================================
   Tooltips & Popovers
   ============================================= */

.tooltip-inner {
  background: var(--premium-text-primary);
  border-radius: 0.375rem;
  box-shadow: var(--premium-shadow-md);
  color: var(--premium-bg-primary);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: var(--premium-text-primary);
}

.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: var(--premium-text-primary);
}

.popover {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.5rem;
  box-shadow: var(--premium-shadow-lg);
}

.popover-header {
  background: var(--premium-bg-secondary);
  border-bottom: 1px solid var(--premium-border);
  color: var(--premium-text-primary);
}

.popover-body {
  color: var(--premium-text-secondary);
}

/* =============================================
   Accordion
   ============================================= */

.accordion {
  --bs-accordion-bg: var(--premium-bg-primary);
  --bs-accordion-border-color: var(--premium-border);
  --bs-accordion-btn-color: var(--premium-text-primary);
  --bs-accordion-btn-bg: var(--premium-bg-primary);
  --bs-accordion-active-color: var(--premium-brand-primary);
  --bs-accordion-active-bg: var(--premium-bg-secondary);
}

.accordion-button {
  font-weight: 500;
}

.accordion-button:not(.collapsed) {
  background: var(--premium-bg-secondary);
  box-shadow: none;
  color: var(--premium-brand-primary);
}

.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* =============================================
   Spinners
   ============================================= */

.spinner-border {
  color: var(--premium-brand-primary);
}

.spinner-grow {
  color: var(--premium-brand-primary);
}

/* =============================================
   Offcanvas & Sidebar
   ============================================= */

.offcanvas {
  background: var(--premium-bg-primary);
  border-color: var(--premium-border);
}

.offcanvas-header {
  border-bottom: 1px solid var(--premium-border);
}

.offcanvas-title {
  color: var(--premium-text-primary);
}

/* =============================================
   Code & Pre
   ============================================= */

code {
  background: var(--premium-bg-tertiary);
  border-radius: 0.25rem;
  color: #be185d;
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
}

pre {
  background: var(--premium-bg-secondary);
  border: 1px solid var(--premium-border);
  border-radius: 0.5rem;
  color: var(--premium-text-primary);
  padding: 1rem;
}

pre code {
  background: transparent;
  padding: 0;
}

/* =============================================
   Scrollbars
   ============================================= */

::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--premium-bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--premium-border-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--premium-text-muted);
}

/* =============================================
   Selection
   ============================================= */

::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--premium-text-primary);
}

/* =============================================
   Utility Classes
   ============================================= */

.border {
  border-color: var(--premium-border) !important;
}

.border-top {
  border-top-color: var(--premium-border) !important;
}

.border-bottom {
  border-bottom-color: var(--premium-border) !important;
}

.border-start {
  border-left-color: var(--premium-border) !important;
}

.border-end {
  border-right-color: var(--premium-border) !important;
}

.shadow {
  box-shadow: var(--premium-shadow-md) !important;
}

.shadow-sm {
  box-shadow: var(--premium-shadow-sm) !important;
}

.shadow-lg {
  box-shadow: var(--premium-shadow-lg) !important;
}

/* Background utilities */
.bg-body {
  background-color: var(--premium-bg-primary) !important;
}

.bg-body-secondary {
  background-color: var(--premium-bg-secondary) !important;
}

.bg-body-tertiary {
  background-color: var(--premium-bg-tertiary) !important;
}

/* Text color utilities */
.text-body {
  color: var(--premium-text-primary) !important;
}

.text-body-secondary {
  color: var(--premium-text-secondary) !important;
}

.text-body-tertiary {
  color: var(--premium-text-muted) !important;
}

/* =============================================
   Finance-specific Styles
   ============================================= */

/* Positive/Negative values */
.text-positive,
.text-gain,
.text-profit {
  color: var(--premium-success) !important;
}

.text-negative,
.text-loss {
  color: var(--premium-danger) !important;
}

/* Stat cards */
.stat-card {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--premium-shadow-md);
  transform: translateY(-2px);
}

.stat-value {
  color: var(--premium-text-primary);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  color: var(--premium-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Chart containers */
.chart-container {
  background: var(--premium-bg-primary);
  border: 1px solid var(--premium-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

/* Data highlights */
.highlight-box {
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--premium-brand-primary);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
}

/* =============================================
   DataTables Specific Overrides
   ============================================= */

/* DataTables wrapper */
.dataTables_wrapper {
  background-color: transparent !important;
  color: var(--premium-text-primary) !important;
}

/* DataTables info, length, filter */
.dataTables_info,
.dataTables_length,
.dataTables_filter,
.dataTables_paginate {
  color: var(--premium-text-secondary) !important;
}

.dataTables_length select,
.dataTables_filter input {
  background-color: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
  border: 1px solid var(--premium-border) !important;
  border-radius: 0.375rem !important;
  padding: 0.375rem 0.75rem !important;
}

.dataTables_length select:focus,
.dataTables_filter input:focus {
  border-color: var(--premium-brand-primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
  outline: none !important;
}

/* DataTables pagination */
.dataTables_paginate .paginate_button {
  background-color: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
  border: 1px solid var(--premium-border) !important;
  border-radius: 0.375rem !important;
  padding: 0.375rem 0.75rem !important;
  margin: 0 2px !important;
}

.dataTables_paginate .paginate_button:hover {
  background-color: var(--premium-bg-tertiary) !important;
  color: var(--premium-text-primary) !important;
}

.dataTables_paginate .paginate_button.current {
  background-color: var(--premium-brand-primary) !important;
  color: #fff !important;
  border-color: var(--premium-brand-primary) !important;
}

.dataTables_paginate .paginate_button.disabled {
  color: var(--premium-text-muted) !important;
  cursor: not-allowed;
}

/* DataTables sorting icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
  background-color: var(--premium-bg-secondary) !important;
}

/* =============================================
   Table Overrides for Consistency
   ============================================= */

.table,
.table-bordered,
.table-striped,
.table-hover,
.dataTable {
  background-color: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
}

.table td,
.table th,
.dataTable td,
.dataTable th {
  border-color: var(--premium-border) !important;
}

/* Table header styling */
.table-light,
.table-light th,
.table-light td,
.table-light thead th,
thead.table-light th {
  background-color: var(--premium-bg-secondary) !important;
  color: var(--premium-text-primary) !important;
  border-color: var(--premium-border) !important;
}

/* Table responsive wrapper */
.table-responsive {
  background-color: var(--premium-bg-primary) !important;
  border-radius: 0.5rem;
}

/* =============================================
   Trades Widget (Stock Details Page)
   ============================================= */

.trades-widget {
  --tw-bg: var(--premium-bg-primary) !important;
  --tw-bg-subtle: var(--premium-bg-secondary) !important;
  --tw-text: var(--premium-text-primary) !important;
  --tw-muted: var(--premium-text-secondary) !important;
  --tw-border: var(--premium-border) !important;
  --tw-green: var(--premium-success) !important;
  --tw-green-soft: rgba(22, 163, 74, 0.1) !important;
  --tw-red: var(--premium-danger) !important;
  --tw-red-soft: rgba(220, 38, 38, 0.1) !important;
  --tw-blue: var(--premium-brand-primary) !important;
  --tw-blue-soft: rgba(59, 130, 246, 0.1) !important;
  --tw-purple: #7c3aed !important;
  --tw-purple-soft: rgba(124, 58, 237, 0.1) !important;
}

.trades-widget .trades-card {
  background: var(--premium-bg-primary) !important;
  border-color: var(--premium-border) !important;
}

.trades-widget .trade-item {
  background: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
  border-color: var(--premium-border) !important;
}

.trades-widget .trade-item:hover {
  background: var(--premium-bg-secondary) !important;
}

/* =============================================
   Dividend Tables & Sections
   ============================================= */

.dividend-section,
.dividends-widget,
.dividend-container,
.tabledividends,
.table-dividends {
  background: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
}

.dividend-summary-card,
.dividend-stat-card {
  background: var(--premium-bg-secondary) !important;
  border-color: var(--premium-border) !important;
}

.total-dividends-row,
.total-dividends-row td {
  background-color: var(--premium-bg-secondary) !important;
  color: var(--premium-text-primary) !important;
  font-weight: 600;
}

/* =============================================
   Calendar Component
   ============================================= */

.calendar-cell,
.dividend-calendar,
.dividend-calendar td,
.dividend-calendar th {
  background-color: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
  border-color: var(--premium-border) !important;
}

.calendar-cell:hover {
  background-color: var(--premium-bg-tertiary) !important;
}

.calendar-header,
.dividend-calendar-header {
  background-color: var(--premium-bg-secondary) !important;
  color: var(--premium-text-primary) !important;
}

.calendar-cell.has-dividend,
.dividend-day {
  background-color: rgba(59, 130, 246, 0.1) !important;
  border-color: var(--premium-brand-primary) !important;
}

/* =============================================
   SweetAlert2 Overrides
   ============================================= */

.swal2-popup,
.swal2-modal {
  background-color: var(--premium-bg-primary) !important;
  color: var(--premium-text-primary) !important;
  border: 1px solid var(--premium-border) !important;
  border-radius: 0.75rem !important;
}

.swal2-title {
  color: var(--premium-text-primary) !important;
}

.swal2-html-container {
  color: var(--premium-text-secondary) !important;
}

/* =============================================
   Responsive Adjustments
   ============================================= */

@media (max-width: 768px) {
  body {
    font-size: 0.9375rem;
  }

  .card-body {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  h1, .h1 { font-size: 1.875rem; }
  h2, .h2 { font-size: 1.5rem; }
  h3, .h3 { font-size: 1.25rem; }
}

/* =============================================
   Print Styles
   ============================================= */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .btn {
    border: 1px solid #000;
  }

  .no-print {
    display: none !important;
  }
}
