@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top, #1b1f3a 0%, #0b1120 50%, #05060f 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

.page-shell {
    background: transparent;
    color: inherit;
    padding-bottom: 48px;
}

.page-hero-container {
    padding-top: 48px;
    padding-bottom: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-hero-surface {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,116,144,0.12));
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 24px;
    padding: 32px;
    max-height: 320px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15,23,42,0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


.page-hero-surface {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,116,144,0.12));
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 18px 45px rgba(15,23,42,0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.page-hero-copy {
    flex: 1 1 320px;
    min-width: 260px;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56,189,248,0.12);
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 12px;
}

.page-hero-title {
    font-size: 2.6rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
}

.page-hero-description {
    max-width: 640px;
    font-size: 1rem;
    line-height: 1.6;
    color: #cbd5f5;
    margin: 0;
}

.page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 768px) {
    .page-hero-surface {
        padding: 24px;
    }
    .page-hero-title {
        font-size: 2.05rem;
    }
    .page-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


.page-body-container {
    padding-bottom: 40px;
}

.section-card {
    background: rgba(10,14,25,0.95);
    border: 1px solid rgba(148,163,184,0.14);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(8,15,40,0.45);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(148,163,184,0.12);
}

.section-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0;
}

.section-card-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
}

.section-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.section-card .card-body {
    padding: 24px;
    color: #e2e8f0;
}

.card {
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(12,17,30,0.92);
    box-shadow: 0 16px 40px rgba(8,15,40,0.35);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(8,15,40,0.4);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #f8fafc;
    margin-bottom: 0.6rem;
    text-transform: none;
    background: none;
    padding: 0;
}

.card-body {
    color: #e2e8f0;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 0.25rem;
}

.section-divider {
    border: none;
    border-top: 1px solid rgba(148,163,184,0.16);
    margin: 3rem 0;
}


.glass-panel {
  background: linear-gradient(135deg, rgba(15,23,42,0.78), rgba(37,99,235,0.24));
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 22px;
  box-shadow: 0 24px 55px rgba(8,15,40,0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-panel > .card-body,
.glass-panel .card-body {
  background: transparent;
  color: #e2e8f0;
}
.glass-panel h4,
.glass-panel h5 {
  color: #f8fafc;
}

/* Themed Dash DataTable */
.dash-table-container {
  background: rgba(11,17,29,0.96);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(8,15,40,0.35);
  padding: 12px;
}
.dash-table-container .dash-table {
  background: transparent !important;
}
.dash-table-container .dash-table-container {
  background: transparent !important;
}
.dash-table-container .dash-header {
  background: rgba(59,130,246,0.18) !important;
  color: #f8fafc !important;
  border-color: rgba(148,163,184,0.18) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dash-table-container .dash-header span {
  color: inherit !important;
}
.dash-table-container .dash-cell {
  color: #e2e8f0 !important;
  border-color: rgba(148,163,184,0.18) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.92rem;
  padding: 10px 12px !important;
}

.dash-table-container .dash-filter {
  background: rgba(11,17,29,0.9) !important;
  border-color: rgba(148,163,184,0.18) !important;
  color: #e2e8f0 !important;
}
.dash-table-container .dash-table-tooltip {
  background: rgba(15,23,42,0.92);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.18);
}

/* Graph surface styling */
.dash-graph {
  background: rgba(11,17,29,0.96);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(8,15,40,0.35);
}
.dash-graph .js-plotly-plot,
.dash-graph .plot-container {
  background: transparent !important;
}

/* Form controls */
input, select, textarea, .form-control, .Select-control, .Select__control, .select__control {
  background: rgba(13,19,33,0.88) !important;
  border: 1px solid rgba(148,163,184,0.24) !important;
  color: #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
input:focus, select:focus, textarea:focus, .form-control:focus, .Select-control:focus, .Select__control--is-focused, .select__control--is-focused {
  border-color: rgba(59,130,246,0.45) !important;
  box-shadow: 0 0 0 0.15rem rgba(59,130,246,0.25) !important;
}
.form-label {
  color: #cbd5f5 !important;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dccRadioItems, .form-check-input {
  accent-color: #38bdf8;
}

/* Loading overlay */
.dash-loading .dash-loading-outer {
  background: rgba(11,17,29,0.88);
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.12);
}

.app-loading-parent {
  position: relative;
  isolation: isolate;
}

.app-loading-parent .app-skeleton {
  min-height: var(--app-loading-min-height, 220px);
}

.app-loading-overlay.dash-loading {
  transition: opacity 0.2s ease;
}

.app-loading-overlay .dash-spinner {
  width: 100%;
  height: 100%;
  min-height: var(--app-loading-min-height, 220px);
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.14);
  background: linear-gradient(140deg, rgba(15,23,42,0.92), rgba(30,41,59,0.92));
  box-shadow: 0 24px 48px rgba(8,15,40,0.38);
  overflow: hidden;
  position: relative;
}

.app-loading-overlay .dash-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(148,191,255,0.18) 45%, rgba(103,232,249,0.12) 55%, transparent 100%);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.app-loading-overlay .dash-spinner > div {
  display: none;
}

.app-skeleton {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.14);
  background: linear-gradient(140deg, rgba(15,23,42,0.92), rgba(30,41,59,0.92));
  box-shadow: 0 24px 48px rgba(8,15,40,0.38);
  overflow: hidden;
}

.app-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(148,191,255,0.18) 45%, rgba(103,232,249,0.12) 55%, transparent 100%);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.app-skeleton--compact {
  border-radius: 14px;
  min-height: 140px;
}

.app-skeleton--text {
  border-radius: 12px;
  min-height: 80px;
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Styling for risk metrics, ratios, and other outputs */
.output-text {
    color: #ffffff; /* Set to white */
    font-size: 16px; /* Optional: Adjust size for readability */
}


.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border: none;
    color: #f8fafc;
    box-shadow: 0 10px 24px rgba(37,99,235,0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(30,64,175,0.35);
}

/* Secondary Button */
.btn-secondary {
    background: rgba(148,163,184,0.18);
    border: 1px solid rgba(148,163,184,0.28);
    color: #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(148,163,184,0.28);
    border-color: rgba(148,163,184,0.45);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(148,163,184,0.18);
}

.page-hero-actions .btn {
    border-radius: 999px;
    padding: 0.55rem 1.4rem;
}

#money-symbol {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: #4caf50;
    opacity: 0;
    animation: moneyAnimation 2s ease-in-out;
}

@keyframes moneyAnimation {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(180deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(360deg); }
}

/* General styles for better readability */
h4, h5 {
    color: #ffffff;
}

label {
    color: #ffffff;
}

.output-text {
    color: #ffffff; /* White text for high contrast */
    font-size: 16px; /* Optional: Adjust size for readability */
    font-weight: 400; /* Optional: Adjust weight */
    padding: 5px; /* Optional: Add padding for spacing */
}

.navbar .nav-link {
    color: white !important; /* Make navbar links white */
}

.navbar .nav-link:hover {
    color: #dcdcdc !important; /* Optional: Light gray on hover for better UX */
}

/* Larger, responsive navbar logo */
.navbar-logo { height: 96px; width: auto; }          /* roughly ~2x of current */
@media (max-width: 991.98px) { .navbar-logo { height: 64px; } }
@media (max-width: 575.98px) { .navbar-logo { height: 48px; } }

.navbar-brand {
    color: white !important; /* Set the app name text color to white */
    font-size: 20px; /* Optional: Adjust font size if needed */
    font-weight: bold; /* Optional: Make it bold */
}


.navbar-brand:hover {
    color: #dcdcdc !important; /* Optional: Light gray on hover */
}

.navbar-brand-text {
    font-size: 3rem; /* Adjust size as needed */
    color: white;    /* Ensure it matches the existing navbar text color */
    font-weight: bold; /* Optional for bolder text */
}

.custom-nav-link {
    font-size: 1.2rem; /* Adjust size as needed */
    font-weight: bold; /* Optional for stronger emphasis */
    color: white !important; /* Ensure white text color */
    text-transform: uppercase; /* Optional to make text uppercase */
    padding: 10px 15px; /* Add some spacing */
}

.ratios-window {
    max-height: 300px; /* Adjust this height to match the risk metrics window */
    overflow-y: auto;  /* Add a vertical scroll bar if content overflows */
    background-color: rgba(12,17,30,0.92); /* Ensure consistent styling */
    padding: 10px;
    border: 1px solid rgba(37,99,235,0.35); /* Match other card styles */
    border-radius: 10px;
    color: white !important;
}

.risk-metrics-window {
    max-height: 300px; /* Same height as ratios for alignment */
    overflow-y: hidden; /* No scroll bar for risk metrics */
    background-color: rgba(12,17,30,0.92);
    padding: 10px;
    border: 1px solid rgba(37,99,235,0.35);
    border-radius: 10px;
    color: white !important;
}

.analysis-json {
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word; /* Break long words */
    overflow: auto;        /* Add scrolling for large content */
    font-family: monospace; /* Use a monospace font for JSON */
    font-size: 14px;        /* Adjust size to fit content */
    padding: 10px;          /* Add spacing */
    background-color: rgba(15,23,42,0.7); /* Optional: Dark background for better contrast */
    color: white;           /* Set font color to white */
    border: 1px solid rgba(148,163,184,0.18); /* Optional: Border for differentiation */
}

.analysis-markdown {
    color: white;           /* Set font color to white */
    font-size: 16px;        /* Adjust font size for readability */
    line-height: 1.5;       /* Increase line height for better spacing */
    white-space: pre-wrap;  /* Preserve Markdown formatting */
    background-color: rgba(15,23,42,0.7); /* Optional: Dark background */
    padding: 10px;          /* Add spacing */
    border: 1px solid rgba(148,163,184,0.18); /* Optional: Border for differentiation */
}

#chat-window {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 5px;
    background-color: #ffffff;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

#portfolio-manager-heading {
    text-align: center; /* Center the text */
    margin: 20px 0; /* Add spacing above and below */
    font-size: 24px; /* Adjust font size */
    font-weight: bold; /* Make it bold */
    color: white; /* Set text color */
}

.styled-table {
    margin: 20px auto;
    border-collapse: collapse;
    width: 100%;
    background-color: #1E1E2E;
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
}

.styled-table th {
    background-color: #27293D;
    color: #FFD700;
    font-weight: bold;
    padding: 12px;
    border: 1px solid #2E2E3E;
}

.styled-table td {
    padding: 12px;
    border: 1px solid #2E2E3E;
    background-color: #2B2B40;
    color: #D3D3D3;
}

.styled-table tr:nth-child(even) {
    background-color: #2E2E3E;
}

.styled-table tr:nth-child(odd) {
    background-color: #3E3E55;
}

.styled-table tr:hover {
    background-color: #48486B;
    color: white;
    border: 1px solid #FFD700;
}

.my-portfolio-header {
    font-weight: bold;
    font-size: 1.5rem;
    color: #ffffff;  /* or some theme color */
  }
  
  .my-portfolio-row {
    margin-bottom: 1rem;
  }
  
  .my-portfolio-label {
    font-weight: bold;
    color: #a0aec0; /* A slightly softer white */
  }
  
  .my-portfolio-card {
    background-color: #2d3748; /* A darker card background */
    border: 1px solid #4a5568;
  }
  
  .my-portfolio-card-title {
    color: #ffffff;
    border-bottom: 1px solid #4a5568;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }

.portfolio-summary-table,
.portfolio-summary-table th,
.portfolio-summary-table td {
  border: none;
}

.portfolio-summary-table th.col-instrument,
.portfolio-summary-table td.col-instrument {
    width: 40%;
    text-align: left;
    padding-left: 1rem;
}

.portfolio-summary-table th.col-allocation,
.portfolio-summary-table td.col-allocation {
    width: 20%;
    text-align: right;
    padding-right: 1rem;
}

.portfolio-summary-table th.col-value,
.portfolio-summary-table td.col-value {
    width: 40%;
    text-align: right;
    padding-right: 1rem;
}

.portfolio-summary-table th,
.portfolio-summary-table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #4a5568; /* A slightly lighter border */
}

.portfolio-summary-table th:first-child,
.portfolio-summary-table td:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
}

.portfolio-summary-table th:last-child,
.portfolio-summary-table td:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
}

.analysis-markdown p,
.analysis-markdown h1,
.analysis-markdown h2,
.analysis-markdown h3,
.analysis-markdown h4,
.analysis-markdown h5,
.analysis-markdown h6,
.analysis-markdown ul,
.analysis-markdown ol,
.analysis-markdown li {
    color: white !important; /* Force all text elements within markdown to be white */
}

.tab-content .tab-pane .analysis-markdown * { /* Target all descendants */
    background-color: transparent !important; /* Ensure no unwanted background colors on child elements */
}


/* --- FINAL STYLES for Dark Theme Accordion --- */

/* Style for the button (header) of each accordion item */
.accordion-button {
    background-color: rgba(37,99,235,0.35) !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 0 !important;
}

/* Style for the button when the accordion item is OPEN */
.accordion-button:not(.collapsed) {
    background-color: #2563eb !important;
    color: white !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Remove the default blue outline on focus */
.accordion-button:focus {
    box-shadow: none !important;
    border-color: rgba(0,0,0,.125) !important;
}

/* Style for the content area of the accordion */
.accordion-body {
    background-color: rgba(12,17,30,0.92) !important;
    color: white !important;
    padding: 1.5rem;
}

/* Style for the accordion item itself (the container) */
.accordion-item {
    background-color: rgba(12,17,30,0.92) !important;
    border: 1px solid rgba(37,99,235,0.35) !important;
    margin-bottom: 5px;
    border-radius: 5px;
    overflow: hidden;
}

/* This targets the default SVG icon (the arrow) and makes it white */
.accordion-button::after {
    filter: brightness(0) invert(1);
}

.accordion-dark-theme .accordion-item {
    background-color: rgba(12,17,30,0.92) !important;
    border: 1px solid rgba(37,99,235,0.35) !important;
    margin-bottom: 5px;
    border-radius: 5px;
    overflow: hidden;
}

.accordion-dark-theme .accordion-header .accordion-button {
    background-color: rgba(37,99,235,0.35) !important;
    color: white !important;
    font-weight: bold !important;
    box-shadow: none !important;
}

.accordion-dark-theme .accordion-header .accordion-button:not(.collapsed) {
    background-color: #2563eb !important;
    color: white !important;
}

.accordion-dark-theme .accordion-body {
    background-color: rgba(12,17,30,0.92) !important;
    color: white !important;
}

/* This targets the default SVG icon (the arrow) and makes it white */
.accordion-dark-theme .accordion-button::after {
    filter: brightness(0) invert(1);
}

/* --- Fix for 'View Saved Analysis' Dropdown Options --- */

/* This styles the container that holds the list of options */
.view-analysis-dropdown .Select-menu-outer {
    background-color: rgba(12,17,30,0.92); /* Dark background for the dropdown menu */
    border: 1px solid #555;
  }
  
  /* This styles each individual option in the dropdown */
  .view-analysis-dropdown .Select-option {
    background-color: rgba(12,17,30,0.92); /* Dark background for the option */
    color: #d6d6d6;             /* Light grey text color for readability */
  }
  
  /* This styles the option when you hover over it */
  .view-analysis-dropdown .Select-option.is-focused {
    background-color: #0d6efd; /* A blue highlight color on hover */
    color: white;               /* White text on hover */
  }
  
  /* This styles the currently selected value shown in the dropdown box */
  .view-analysis-dropdown .Select-value-label {
      color: white !important; /* Ensures the selected text is always white */
  }

/* Responsive tweaks */
@media (max-width: 991.98px) {
    .custom-nav-link { font-size: 1rem; padding: 8px 10px; }
    .navbar-brand-text { font-size: 1.5rem; }
  }
  
  @media (max-width: 767.98px) {
    #assistant-chatbox {
      right: 8px;
      left: 8px;
      width: auto;         /* full width minus margins */
      max-width: none;
      bottom: 70px;
      height: 60vh;        /* taller on mobile */
    }
    #chat-window { height: calc(60vh - 160px); }
    #toggle-assistant { bottom: 12px; right: 12px; }
  }
  
  img.img-fluid { max-width: 100%; height: auto; }

/* Compact navbar with logo filling the bar */
:root { --nav-height: 72px; }               /* desktop height */

.app-navbar { padding-top: 0; padding-bottom: 0; }
.app-navbar .container { min-height: var(--nav-height); }

.app-navbar .app-navbar-logo { height: var(--nav-height); width: auto; display: block; }

.app-navbar .navbar-brand,
.app-navbar .navbar-nav .nav-link {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

/* reduce custom link extra vertical padding */
.app-navbar .custom-nav-link { padding-top: 0; padding-bottom: 0; }

/* Responsive: slightly shorter bar on tablets/phones */
@media (max-width: 991.98px) { :root { --nav-height: 60px; } }
@media (max-width: 575.98px) { :root { --nav-height: 52px; } }

/* Allow wrapping for the long nav item only */
.navbar .custom-nav-link-wrap { 
    white-space: normal !important; 
    line-height: 1.1; 
    text-align: center;
  }

/* ===========================
   NEW: Global Dark UI Overrides
   =========================== */

/* NEW: Form controls (Dash dcc.Input, dbc.Input, <input>, <select>, <textarea>) */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="password"],
.form-control,
select,
textarea {
  background-color: rgba(12,17,30,0.92) !important; /* NEW */
  color: #ffffff !important;            /* NEW */
  border: 1px solid rgba(148,163,184,0.18) !important;    /* NEW */
}
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #bdbdbd !important;            /* NEW */
}
input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  border-color: #2563eb !important;     /* NEW */
  box-shadow: 0 0 0 .15rem rgba(14,86,193,.25) !important; /* NEW */
  outline: none !important;             /* NEW */
}

/* ===========================
   NEW: Dash dcc.Dropdown (React-Select v1 class names)
   =========================== */
.Select-control {                         /* NEW */
  background-color: rgba(12,17,30,0.92) !important;   /* NEW */
  border: 1px solid rgba(148,163,184,0.18) !important;      /* NEW */
  color: #fff !important;                 /* NEW */
}
.Select-placeholder,
.Select-value,
.Select-value-label,
.Select-clear-zone,
.Select-arrow-zone {
  color: #e5e5e5 !important;              /* NEW */
}
.Select-input > input {                   /* NEW */
  color: #fff !important;
}
.Select-menu-outer {                      /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
  color: #fff !important;
}
.Select-option {                          /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
}
.Select-option.is-focused {               /* NEW */
  background-color: rgba(15,23,42,0.7) !important;
}
.Select-option.is-selected {              /* NEW */
  background-color: #2563eb !important;
  color: #fff !important;
}

/* ===========================
   NEW: React-Select v2/v3+ fallback (Dash newer versions)
   =========================== */
[class*="Select__control"], [class*="select__control"] {  /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  border-color: rgba(148,163,184,0.18) !important;
  color: #fff !important;
}
[class*="Select__single-value"], [class*="select__single-value"],
[class*="Select__placeholder"],   [class*="select__placeholder"] {  /* NEW */
  color: #e5e5e5 !important;
}
[class*="Select__menu"], [class*="select__menu"] {          /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}
[class*="Select__option"], [class*="select__option"] {       /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
}
[class*="Select__option--is-focused"], [class*="select__option--is-focused"] { /* NEW */
  background-color: rgba(15,23,42,0.7) !important;
}
[class*="Select__option--is-selected"], [class*="select__option--is-selected"] { /* NEW */
  background-color: #2563eb !important;
  color: #fff !important;
}

/* ===========================
   NEW: Bootstrap menus / Offcanvas / Accordion
   =========================== */
.dropdown-menu {                          /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  color: #fff !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}
.dropdown-item {                          /* NEW */
  color: #fff !important;
}
.dropdown-item:hover,
.dropdown-item:focus {                     /* NEW */
  background-color: rgba(15,23,42,0.7) !important;
  color: #fff !important;
}
.dropdown-item.active,
.dropdown-item:active {                    /* NEW */
  background-color: #2563eb !important;
  color: #fff !important;
}
.offcanvas,
.offcanvas-header,
.offcanvas-body {                          /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
  border-color: rgba(15,23,42,0.7) !important;
}
.accordion-item,
.accordion-button,
.accordion-body {                          /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  color: #fff !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}
.accordion-button:not(.collapsed) {        /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ===========================
   NEW: Plotly graph placeholders & chrome
   =========================== */
.js-plotly-plot,
.plot-container,
.svg-container {
  background-color: rgba(12,17,30,0.92) !important;    /* NEW */
}
.js-plotly-plot .plotly .bg {              /* NEW */
  fill: rgba(12,17,30,0.92) !important;                /* makes empty/placeholder charts dark */
}
.modebar {                                 /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}

/* ===========================
   NEW: dcc.Loading spinner color tweak (optional)
   =========================== */
.dash-spinner * {                          /* NEW */
  border-color: #2563eb !important;
}

/* ===========================
   NEW: Subtle dark scrollbars (optional)
   =========================== */
::-webkit-scrollbar { width: 8px; height: 8px; }              /* NEW */
::-webkit-scrollbar-track { background: rgba(9,13,24,0.9); }            /* NEW */
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.18); border-radius: 4px; } /* NEW */
::-webkit-scrollbar-thumb:hover { background: #555; }         /* NEW */


.app-navbar {
    background: linear-gradient(135deg, rgba(13,19,33,0.95), rgba(30,64,175,0.45)) !important;
    border-bottom: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 12px 30px rgba(8,15,40,0.35);
}

.app-navbar .navbar-brand,
.app-navbar .navbar-nav .nav-link {
    color: #e2e8f0 !important;
}

.app-navbar .navbar-nav .nav-link:hover,
.app-navbar .navbar-brand:hover {
    color: #38bdf8 !important;
}



.login-card .form-control {
    background-color: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f8fafc;
}

.login-card .form-control:focus {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: #38bdf8;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25);
}

.login-card .form-label {
    color: #94a3b8;
}
.navbar-user-label {
    color: #cbd5f5;
    padding: 0.5rem 0;
    margin: 0 0.75rem;
    pointer-events: none;
}

.nav-logout-button {
    color: #38bdf8 !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.nav-logout-button:hover,
.nav-logout-button:focus {
    color: #0ea5e9 !important;
    text-decoration: none;
}
.login-container {
    min-height: 100vh;
    width: 100%;
    padding: 3rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell-row {
    width: 100%;
    max-width: 1100px;
}

.login-copy {
    align-items: center;
}

.login-copy-surface {
    background: linear-gradient(150deg, rgba(59,130,246,0.18), rgba(14,116,144,0.14));
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: 32px;
    padding: 48px;
    box-shadow: 0 30px 60px rgba(8,11,30,0.45);
    backdrop-filter: blur(16px);
}

.login-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(79,70,229,0.15);
    border: 1px solid rgba(165,180,252,0.35);
    border-radius: 999px;
    color: #cbd5f5;
    margin-bottom: 20px;
}

.login-title {
    font-size: clamp(2rem, 2.8vw, 3rem);
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 18px;
}

.login-subtitle {
    font-size: 1.05rem;
    color: #cbd5f5;
    max-width: 420px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: rgba(13, 25, 45, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 38px 48px rgba(4, 10, 30, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 28px;
}

.login-card .card-body {
    padding: 2.75rem;
}

.login-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.65);
    padding: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 12px 24px rgba(15,23,42,0.4);
}

.login-card-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.35rem;
}

.login-card-caption {
    color: #cbd5f5;
    font-size: 0.95rem;
}

.login-toggle .btn {
    flex: 1;
    border-radius: 999px !important;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.auth-toggle-button {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: #cbd5f5;
}

.auth-toggle-button.active {
    background: linear-gradient(120deg, #3b82f6, #6366f1);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(59,130,246,0.4);
}

.auth-primary-button {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 16px 30px rgba(59,130,246,0.35);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    color: #94a3b8;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), transparent);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
    transform: rotate(180deg);
}

.auth-divider-text {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.google-button {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.google-button:hover,
.google-button:focus {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.55);
}

.google-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: conic-gradient(#4285F4 0deg 90deg, #34A853 90deg 180deg, #FBBC05 180deg 270deg, #EA4335 270deg 360deg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.85rem;
    position: relative;
}

.google-icon::after {
    content: "G";
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #0f172a;
}

.google-label {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .login-card .card-body {
        padding: 2rem;
    }

    .login-container {
        padding: 2rem 1.25rem;
    }
}
.chart-wrapper,
.macro-chart-container {
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.chart-wrapper .js-plotly-plot,
.chart-wrapper .plot-container,
.chart-wrapper .svg-container,
.macro-chart-container .js-plotly-plot,
.macro-chart-container .plot-container,
.macro-chart-container .svg-container {
    width: 100% !important;
    max-width: 100% !important;
}
