body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #ffffff;
    margin: 0;
    padding: 2.5rem;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.kpi-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1.25rem;
}

.kpi-label {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.kpi-sub {
    font-size: 0.875rem;
    font-weight: 500;
}

.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1.25rem;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

/* Define color primario (puedes ajustar el valor hex según tu marca) */
:root {
    --color-primary: #007bff; /* Azul Bootstrap por defecto */
}

/* Enlaces de navegación */
.nav-link {
    color: var(--color-primary) !important;
    font-weight: 500;
    text-decoration: none;
    font-size: medium;
}

.nav-link:hover {
    color: darken(var(--color-primary), 10%) !important;
    text-decoration: underline;
}

/* Color del texto para el nav-link activo (pill seleccionado) */
.nav-pills .nav-link.active {
    color: white !important;
}

/* Color del texto para los nav-links inactivos */
.nav-pills .nav-link {
    color: #0d6efd;  /* Bootstrap primary */
}

/* Color primario para el botón de menú en pantallas pequeñas */
.navbar-dark .navbar-toggler {
    border-color: #0d6efd;
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230d6efd' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.waiting-cursor {
    cursor: wait !important;
}

/* Estilo general para todas las tabs */
.tab {
    background-color: white;
    color: #0d6efd;  /* Bootstrap primary */
    border: 1px solid #0d6efd;
    padding: 0.625rem 1.25rem;
    margin-right: 5px;
    font-weight: 500;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

/* Hover sobre tabs inactivas */
.tab:hover {
    text-decoration: underline;
    background-color: white; /* No cambia el fondo */
    color: #0a58ca; /* Azul más oscuro (opcional) */
}

/* Tab seleccionada */
.tab--selected {
    background-color: #0d6efd;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.Select-menu-outer {
    font-size: 0.875rem;
}

.Select-value-label {
    font-size: 0.875rem;
}

.Select-placeholder {
    font-size: 0.875rem;
}

.label-sm {
    font-size: 0.875rem;
}

.label-lg {
    font-size: 1.25rem;
}

/* assets/styles.css */

.date-picker-elegante {
    border: 1px solid #ced4da;
    border-radius: 12px;
    padding: 0.25rem 0.3125rem;
    background-color: #228be675;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1rem;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease-in-out;
}

.date-picker-elegante:hover,
.date-picker-elegante:focus-within {
    border-color: #228be6;
    box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.2);
    background-color: #ffffff;
}

/* assets/custom.css */
.VirtualizedSelectOption {
    white-space: normal !important;
    word-wrap: break-word;
    max-width: 300px;
}

/* Estilo personalizado para tooltips de Dash DataTable */
.dash-table-tooltip {
    font-size: 0.6875rem;
    max-width: 300px;
    white-space: normal;
    color: black;
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

.btn-open-filters-fixed {
    position: fixed;
    right: 1rem;
    top: 50%;
    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
    z-index: 1050;
    text-orientation: upright;
    white-space: nowrap;
}

/* 1) Forzar wrap en la lista de opciones */
.Select-menu-outer,
[class$="-menu-list"],
[class*="MenuList"] {
  white-space: normal !important;
  word-break: break-word !important;
  word-wrap: break-word !important;
  line-height: 1.3 !important;
  overflow: hidden !important;          /* oculta el desbordamiento */
  text-overflow: ellipsis !important;   /* muestra “…” */
}

/* 2) Cada opción dentro del menú */
.Select-menu-outer .select-option,
[class$="-option"],
[class*="Option"] {
  display: flex !important;
  align-items: center !important;
  height: auto !important;
  padding: 0.25rem 0.5rem !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: hidden !important;          /* oculta el desbordamiento */
  text-overflow: ellipsis !important;   /* muestra “…” */
}

/* 3) Wrap también en las "píldoras" multiselección */
.Select-value-label,
.css-1rhbuit-MultiValue,     /* clase genérica Dash vX */
[class*="multi-value__label"] {
  white-space: normal !important;
  word-break: break-word !important;
  max-width: 100% !important;
  overflow: hidden !important;          /* oculta el desbordamiento */
  text-overflow: ellipsis !important;   /* muestra “…” */
}

/* 4) Asegura que el menú esté por encima */
.Select-menu-outer,
[class*="menu-outer"] {
  z-index: 1000 !important;
  overflow-y: auto !important;          /* permite ver todas las opciones */
  overflow-x: hidden !important;
  text-overflow: ellipsis !important;   /* muestra “…” */
}

/* Opciones del menú: corte con puntos suspensivos */
.dropdown-fix .Select-menu-outer .select-option {
  white-space: nowrap !important;       /* sin wrap */
  overflow: hidden !important;          /* oculta el desbordamiento */
  text-overflow: ellipsis !important;   /* muestra “…” */
}

/* Etiquetas multiselección (“píldoras”) */
.dropdown-fix .Select-value-label,
.dropdown-fix .css-1rhbuit-MultiValue {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100%;      /* para que reserve todo el ancho posible */
}

@media (max-width: 1024px) {
  body {
    padding: 2rem;
  }
  .card {
    margin-bottom: 1rem;
  }
  .kpi-value {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  .card {
    margin-bottom: 0.75rem;
  }
  .kpi-value {
    font-size: 1rem;
  }
  .kpi-label,
  .kpi-sub,
  .card-title {
    font-size: 0.75rem;
  }
}

.print-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
}

.print-header__logo {
  max-height: 64px;
}

.print-header__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.print-header__title {
  margin: 0;
  font-size: 1.75rem;
  color: #1f2a44;
}

.print-header__subtitle {
  margin: 0;
  font-size: 1.125rem;
  color: #4a5568;
}

.print-section {
  width: 100%;
}

#financial-print-selection-controls,
#commercial-print-selection-controls {
  border-top: 1px solid #e2e8f0;
  margin-top: 1.5rem;
  padding-top: 1rem;
}

#financial-print-selection-controls .print-selection-options,
#commercial-print-selection-controls .print-selection-options {
  margin-top: 0.75rem;
}

#financial-print-selection-controls .print-selection-options label,
#commercial-print-selection-controls .print-selection-options label {
  font-weight: 500;
  cursor: pointer;
}

@page {
  size: A4 portrait;
  margin: 1.5cm;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-header {
    display: flex !important;
    border-bottom: 2px solid #1f2a44;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }

  .btn-open-filters-fixed,
  [data-action="print-dashboard"],
  #drawer-filtros,
  .mantine-Drawer-root,
  .mantine-Drawer-overlay,
  .mantine-Drawer-content {
    display: none !important;
  }

  body.printing-dashboard #drawer-filtros {
    display: none !important;
  }

  body.printing-dashboard .mantine-Drawer-root,
  body.printing-dashboard .mantine-Drawer-overlay,
  body.printing-dashboard .mantine-Drawer-content {
    display: none !important;
  }

  .dash-graph,
  .js-plotly-plot,
  .plotly {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .js-plotly-plot,
  .js-plotly-plot .plot-container,
  .js-plotly-plot .svg-container {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: visible !important;
  }

  .js-plotly-plot .main-svg {
    width: 100% !important;
  }

  .js-plotly-plot .modebar-container {
    display: none !important;
  }

  body.printing-dashboard .print-hidden,
  .print-hidden {
    display: none !important;
  }

  .container,
  .container-fluid,
  .dbc-container,
  .dbc,
  .print-section {
    max-width: 100% !important;
    width: 100% !important;
  }

  .print-section .dash-graph {
    min-height: 420px !important;
    height: auto !important;
  }

  [data-print-section="third-parties"],
  [data-print-section="third-parties"] .dash-graph,
  [data-print-section="third-parties"] .js-plotly-plot,
  [data-print-section="third-parties"] .plotly,
  [data-print-section="cost-centers"],
  [data-print-section="cost-centers"] .dash-graph,
  [data-print-section="cost-centers"] .js-plotly-plot,
  [data-print-section="cost-centers"] .plotly {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .card,
  .dbc,
  .row,
  .col,
  .dash-table-container,
  .dash-table {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .mantine-Drawer-root,
.mantine-Modal-root,
.modal {
  display: none !important;
}
}

/* Chatbot launcher */
.chatbot-launcher {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1100;
  pointer-events: none;
}

.chatbot-launcher__container {
  display: flex;
  justify-content: flex-end;
  pointer-events: all;
}

.chatbot-launcher__button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chatbot-launcher__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.chatbot-launcher__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chatbot-launcher__panel {
  max-width: 420px;
}

.chatbot-launcher__textarea {
  resize: vertical;
}
