/* ═══════════════════════════════════════════════════
   CUSTOM SELECT & DATEPICKER — componente global
   Variantes: --form (modales/formularios), --filter (toolbars)
   Default: searchbar
═══════════════════════════════════════════════════ */

/* ── Campo contenedor ── */
.cs-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.cs-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

.cs-label small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255,255,255,0.25);
    font-size: 10px;
}

/* ── Trigger ── */
.cs-inner {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    min-width: 0;
    overflow: hidden;
    user-select: none;
}

.cs-inner:hover,
.cs-inner.open {
    background: rgba(255,255,255,0.10);
    border-color: rgba(168,85,247,0.5);
}

.cs-inner.open {
    border-color: rgba(168,85,247,0.7);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}

/* Variante form */
.cs-field--form .cs-inner {
    height: 38px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
    padding: 0 12px;
    gap: 8px;
}

/* Variante filter */
.cs-field--filter .cs-inner {
    height: 44px;          /* era 38px */
    border-radius: 10px;   /* igual que los inputs del toolbar */
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
    padding: 0 12px;
    gap: 8px;
}

/* ── Partes internas ── */
.cs-icon {
    color: rgba(255,255,255,0.4);
    font-size: 16px;
    flex-shrink: 0;
}

.cs-field--form .cs-icon,
.cs-field--filter .cs-icon { font-size: 14px; }

.cs-value {
    min-width: 0;
    font-size: 14px;
    color: #fff;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-field--form .cs-value,
.cs-field--filter .cs-value { font-size: 13px; }

.cs-placeholder { color: rgba(255,255,255,0.3) !important; }

.cs-chevron {
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    transition: transform .2s;
    flex-shrink: 0;
}

.cs-inner.open .cs-chevron { transform: rotate(180deg); }

/* ── Texto input (location) ── */
.cs-text-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    flex: 1;
    min-width: 0;
    width: 100%;
}
.cs-text-input::placeholder { color: rgba(255,255,255,0.3); }

/* ── Botón geo ── */
.cs-geo-btn {
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 8px;
    color: #a855f7;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    padding: 0;
}
.cs-geo-btn:hover {
    background: rgba(168,85,247,0.3);
    color: #c084fc;
}

/* ── Dropdown ── */
/* ── Dropdown ── */
.cs-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #131836;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 8px;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all .2s;
    min-width: 180px;
    max-height: 220px;
    overflow-y: auto;
}

.cs-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dentro de modales — z-index alto, sin cambiar position */
.modal .cs-dropdown {
    z-index: 10060;
}

/* Permitir que el dropdown salga del cs-field */
.modal .cs-field {
    overflow: visible;
}

/* El modal-body necesita overflow visible para los dropdowns,
   pero modal-dialog-scrollable necesita scroll — se resuelve
   poniendo overflow en el modal-content, no en modal-body */
.modal-content {
    overflow: visible;
}

/* Bootstrap pone overflow:hidden en modal-content por defecto,
   esto lo restaura solo dentro de nuestros modales */
.modal-dialog-scrollable .modal-content {
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* ── Items lista ── */
.cs-item {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: background .15s;
}

.cs-item:hover  { background: rgba(168,85,247,0.15); color: #fff; }
.cs-item.cs-selected { background: rgba(168,85,247,0.2); color: #c084fc; }

.cs-item-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.cs-field--form .cs-item,
.cs-field--filter .cs-item {
    font-size: 13px;
    padding: 8px 10px;
}

/* ── Time grid ── */
.cs-time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}

.cs-time-grid::-webkit-scrollbar { width: 4px; }
.cs-time-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.cs-time-item {
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    transition: all .15s;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
}

.cs-time-item:hover { background: rgba(168,85,247,0.15); color: #fff; }
.cs-time-item.cs-selected {
    background: rgba(168,85,247,0.25);
    color: #c084fc;
    border-color: rgba(168,85,247,0.4);
}
.cs-time-any { grid-column: 1 / -1; background: rgba(255,255,255,0.04); }

/* ── Calendario ── */
.cs-cal-nav {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
}
.cs-cal-nav:hover { background: rgba(168,85,247,0.2); }

.cs-cal-day {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    padding: 6px 2px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    width: 100%;
}
.cs-cal-day:hover  { background: rgba(168,85,247,0.2); color: #fff; }
.cs-cal-day.today  { color: #a855f7; font-weight: 700; }
.cs-cal-day.selected {
    background: rgba(168,85,247,0.3);
    border-color: rgba(168,85,247,0.5);
    color: #c084fc;
    font-weight: 700;
}
.cs-cal-day.disabled {
    color: rgba(255,255,255,0.15);
    cursor: not-allowed;
}

/* ── Invalid state ── */
.cs-field--form.is-invalid .cs-inner {
    border-color: #dc3545;
}
.cs-field--form.is-invalid .cs-inner.open {
    box-shadow: 0 0 0 3px rgba(220,53,69,0.15);
}

/* ── Botón submit del search bar ── */
.cs-btn {
    height: 52px;
    padding: 0 28px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .2s;
    font-family: inherit;
}

.cs-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.4);
}

/* ── Label wrap (label + cs-field apilados) ── */
.cs-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}