/* Personal: calendario anual de vacaciones y festivos. Colores del tema de
   Bootstrap (subtle) para que se lea igual en claro y en oscuro. */
.cal-table { border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.cal-table td, .cal-table th { padding: 0; width: 14.28%; }
.cal-day { cursor: default; border-radius: 0.35rem; vertical-align: top; height: 2.6rem; }
[data-selectable="true"] .cal-day { cursor: pointer; }
[data-selectable="true"] .cal-day:hover { outline: 1px solid var(--bs-primary); }
.cal-num { font-size: 0.8rem; line-height: 1; padding: 0.15rem 0.2rem 0; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 0.2rem 0.15rem; min-height: 0.6rem; }
.cal-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--dot, var(--bs-secondary)); }
.cal-dot-pending { background: transparent; border: 2px solid var(--dot, var(--bs-secondary)); }
.cal-dot-half { background: linear-gradient(90deg, var(--dot) 50%, transparent 50%); border: 1px solid var(--dot); }
.cal-more { font-size: 0.6rem; color: var(--bs-secondary-color); line-height: 0.6rem; }
.cal-weekend { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.cal-holiday-nacional { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.cal-holiday-autonomico { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.cal-holiday-local { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); }
.cal-today .cal-num { font-weight: 700; text-decoration: underline; }
.cal-selected { box-shadow: inset 0 0 0 2px var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.cal-swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 0.2rem; vertical-align: -0.1rem; border: 1px solid var(--bs-border-color); }
.cal-swatch.cal-weekend { background: var(--bs-tertiary-bg); }
.cal-selection-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1050; max-width: calc(100vw - 2rem); }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

:root {
  --app-accent: #1f7a8c;
  --app-accent-strong: #0f4c5c;
  --app-warm: #b45f06;
  --app-soft: #f6f8fb;
}

/* intl-tel-input (formulario de contactos): a todo lo ancho y con los colores del tema */
.iti { width: 100%; --iti-border-color: var(--bs-border-color); --iti-country-selector-bg: var(--bs-body-bg); --iti-icon-color: var(--bs-body-color); }
.iti__country-selector, .iti__search-input { color: var(--bs-body-color); background-color: var(--bs-body-bg); }
.iti__selected-dial-code { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .iti { --iti-hover-color: rgba(255, 255, 255, .08); }
.iti__tel-input.is-invalid, .iti__tel-input.is-valid { background-position: right calc(.375em + .1875rem) center; }

[data-bs-theme="dark"] {
  --app-accent: #43b0c9;
  --app-accent-strong: #7ac7d8;
  --app-warm: #f0a84b;
  --app-soft: #151a21;
}

.app-body {
  background: var(--app-soft);
  min-height: 100vh;
}

.app-navbar {
  background: var(--bs-body-bg);
}

.page-title {
  color: var(--app-accent-strong);
}

.status-pill {
  border: 1px solid color-mix(in srgb, var(--app-accent) 55%, transparent);
  color: var(--app-accent-strong);
}

.table-card,
.form-panel,
.detail-panel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
}

.money {
  color: var(--app-warm);
}

.email-row + .email-row {
  margin-top: .5rem;
}

.table > tbody > tr.lead-row-confirmed > * {
  background-color: #dff3e4;
  color: #17492a;
}

.table > tbody > tr.lead-row-waiting > * {
  background-color: #fff1df;
  color: #8a4b08;
}

.table > tbody > tr.lead-row-lost > * {
  background-color: #f8dddd;
  color: #6f1d1b;
}

.table > tbody > tr.lead-row-confirmed a,
.table > tbody > tr.lead-row-confirmed .money {
  color: #0f3f24;
}

.table > tbody > tr.lead-row-waiting a,
.table > tbody > tr.lead-row-waiting .money {
  color: #7a4307;
}

.table > tbody > tr.lead-row-lost a,
.table > tbody > tr.lead-row-lost .money {
  color: #5f1615;
}

.table > tbody > tr.lead-row-confirmed .status-pill {
  background-color: #c6ead0;
  border-color: #4b9662;
  color: #17492a;
}

.table > tbody > tr.lead-row-waiting .status-pill {
  background-color: #ffd9ad;
  border-color: #d28b36;
  color: #8a4b08;
}

.table > tbody > tr.lead-row-lost .status-pill {
  background-color: #f2c4c4;
  border-color: #bc6262;
  color: #6f1d1b;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-confirmed > * {
  background-color: #203c2a;
  color: #d8f4df;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-waiting > * {
  background-color: #4d3418;
  color: #ffe2b7;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-lost > * {
  background-color: #452627;
  color: #f7dada;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-confirmed a,
[data-bs-theme="dark"] .table > tbody > tr.lead-row-confirmed .money {
  color: #bdebc8;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-waiting a,
[data-bs-theme="dark"] .table > tbody > tr.lead-row-waiting .money {
  color: #ffd39b;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-lost a,
[data-bs-theme="dark"] .table > tbody > tr.lead-row-lost .money {
  color: #f0bcbc;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-confirmed .status-pill {
  background-color: #294f37;
  border-color: #79c58d;
  color: #d8f4df;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-waiting .status-pill {
  background-color: #70491f;
  border-color: #f0b25f;
  color: #ffe2b7;
}

[data-bs-theme="dark"] .table > tbody > tr.lead-row-lost .status-pill {
  background-color: #5a3032;
  border-color: #dd8e8e;
  color: #f7dada;
}

/* Bootstrap no adapta .table-danger al tema oscuro (el fondo se queda fijo
   en rosa claro); sin esto, el texto claro del tema oscuro queda casi
   ilegible encima (taquillas offline en /taquillas). Mismo tono que
   lead-row-lost, por coherencia. */
[data-bs-theme="dark"] .table-danger {
  --bs-table-bg: #452627;
  --bs-table-color: #f7dada;
  --bs-table-border-color: #6f3a3c;
  --bs-table-hover-bg: #52302f;
  --bs-table-hover-color: #f7dada;
}

[data-bs-theme="dark"] .table-danger a,
[data-bs-theme="dark"] .table-danger .text-body-secondary {
  color: #f0bcbc;
}

/* Lo mismo con .table-warning (webs que fallaron una vez en el monitor, piezas
   con poco stock…): en oscuro, ámbar oscuro con texto claro en vez del
   amarillo claro fijo, sobre el que el gris del tema no se leía. */
[data-bs-theme="dark"] .table-warning {
  --bs-table-bg: #3d3214;
  --bs-table-color: #f5e7c1;
  --bs-table-border-color: #6b5823;
  --bs-table-hover-bg: #4a3d19;
  --bs-table-hover-color: #f5e7c1;
}

[data-bs-theme="dark"] .table-warning a,
[data-bs-theme="dark"] .table-warning .text-body-secondary {
  color: #e9d39a;
}

.lead-section-tabs .nav-link {
  color: var(--app-accent-strong);
}

.lead-section-tabs .nav-link.active {
  font-weight: 600;
}

.lead-history-toggle {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.lead-history-toggle:hover,
.lead-history-toggle:focus {
  color: inherit;
  text-decoration: underline;
}

.lead-history-panel {
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  border-bottom: 1px solid var(--bs-border-color);
}

.lead-management-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lead-management-form {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
}

.lead-management-top-fields {
  flex: 0 0 auto;
}

.lead-management-action {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
}

.lead-management-action-input {
  min-height: 6rem;
}

/* Gestiones apuntadas bajo el formulario (solo PC): ocupan el alto que sobra
   junto a «Datos del lead». El contenido va en absoluto para no estirar el
   panel; con muchas gestiones, scroll propio. */
.lead-management-history {
  flex: 1 1 auto;
  min-height: 14rem;
}

.lead-management-history-scroll {
  position: relative;
  flex: 1 1 auto;
}

.lead-management-history-inner {
  position: absolute;
  inset: 0;
  overflow-y: auto;
}

.lead-management-history-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bs-body-bg);
}

.statistics-range-tabs .nav-link {
  border: 1px solid var(--bs-border-color);
  color: var(--app-accent-strong);
}

.statistics-range-tabs .nav-link.active {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: #fff;
}

.stats-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bs-body-bg) 92%, var(--app-soft)), var(--bs-body-bg));
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.stats-label {
  color: var(--bs-secondary-color);
  font-size: .85rem;
  margin-bottom: .45rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stats-value {
  color: var(--app-accent-strong);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

/* Botones de la barra que son solo un icono (notificaciones, tema). */
.nav-icon-button {
  line-height: 1.2;
  padding: .2rem .5rem;
  font-size: 1rem;
}

/* Campos secundarios plegados (alta de incidencias y llamadas del SAT). */
.incident-more > summary {
  cursor: pointer;
  color: var(--app-accent-strong);
  font-weight: 600;
  list-style: none;
  padding: .35rem 0;
}

.incident-more > summary::-webkit-details-marker { display: none; }

.incident-more > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .15s ease;
}

.incident-more[open] > summary::before { content: "▾ "; }

.incident-more > summary:hover { text-decoration: underline; }

/* Filas resaltadas de tablas (p. ej. stock bajo con .table-warning): Bootstrap
   mantiene el fondo claro también en modo oscuro, pero los enlaces con
   .link-body-emphasis usan el color del tema (casi blanco) y no se leen.
   El !important hace falta porque .link-body-emphasis también lo lleva. */
.table-warning a {
  color: var(--bs-table-color) !important;
}
