/* =============================================================================
   custom.css — Estilos del Panel de Limpiadoras OKmystay
   Bootstrap 4 base + variables CSS para personalización sencilla
   ============================================================================= */

/* --- Variables de color: editar aquí para cambiar todo el tema --- */
:root {
    --sidebar-width:      220px;
    --sidebar-bg:         #2c3e50;
    --sidebar-text:       #ecf0f1;
    --sidebar-active-bg:  #1a252f;
    --sidebar-hover-bg:   #34495e;
    --brand-ok-color:     #27ae60;      /* Verde: diferencia del panel de propietarios */
    --accent-color:       #2ecc71;
    --border-color:       #dee2e6;
    --content-bg:         #f8f9fa;
}

/* --- Reset y base --- */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    background-color: var(--content-bg);
    margin: 0;
    padding: 0;
}

/* ===== LAYOUT: Sidebar + Contenido ===== */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--content-bg);
}

/* ===== SIDEBAR: Header con logo ===== */

.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Logo de la empresa (company_logo.py): silueta blanca, como en el admin */
.sidebar-company-logo {
    max-width: 150px;
    max-height: 45px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
    filter: brightness(0) invert(1);
}

/* Logo con fondo de color, degradado o foto: la silueta lo convertiría en un
   rectángulo blanco, así que va tal cual en una tarjeta. */
.sidebar-company-logo.sidebar-company-logo--card {
    filter: none;
    border-radius: 6px;
}

/* Fecha y hora bajo el logo (reloj JS en base.html) */
.sidebar-clock {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

/* Nombre del usuario bajo la cabecera */
.sidebar-user {
    padding: 10px 16px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-ok {
    color: var(--brand-ok-color);
}

.logo-mystay {
    color: var(--sidebar-text);
}

.sidebar-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== SIDEBAR: Menú de navegación ===== */

.sidebar-menu {
    flex: 1;
    padding: 12px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    transition: background-color 0.15s;
}

.sidebar-menu li a:hover {
    background-color: var(--sidebar-hover-bg);
    text-decoration: none;
    color: var(--sidebar-text);
}

.sidebar-menu li.active a {
    background-color: var(--sidebar-active-bg);
    border-left: 3px solid var(--brand-ok-color);
    color: #fff;
}

.sidebar-menu li a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

/* Puntito verde en el item Mi jornada cuando hay jornada abierta */
.jornada-dot {
    margin-left: auto;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--brand-ok-color, #28a745);
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.6);
    animation: jornada-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes jornada-dot-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.6); }
    70%  { box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

/* Badge numérico en el item Limpiezas cuando hay limpiezas activas */
.nav-badge {
    margin-left: auto;
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: var(--brand-ok-color, #28a745);
    border-radius: 9px;
}

.sidebar-separator {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 8px 0;
}

.sidebar-logout {
    color: rgba(255,255,255,0.6) !important;
}

.sidebar-logout:hover {
    color: #e74c3c !important;
}

/* ===== TOPBAR MÓVIL ===== */

.mobile-topbar {
    background-color: var(--sidebar-bg);
    color: #fff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.mobile-title {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

/* Sidebar abierto en móvil */
@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0;
    }
}

/* ===== CONTENIDO DE PÁGINA ===== */

.page-content {
    padding: 24px;
}

.flash-container {
    padding: 16px 24px 0;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

/* ===== TARJETAS DE ESTADÍSTICAS (dashboard) ===== */

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.1;
}

.stat-icon {
    font-size: 28px;
    opacity: 0.3;
}

/* Bordes de colores para las tarjetas del dashboard */
.border-left-primary { border-left: 4px solid #007bff !important; }
.border-left-success { border-left: 4px solid #28a745 !important; }
.border-left-info    { border-left: 4px solid #17a2b8 !important; }
.border-left-warning { border-left: 4px solid #ffc107 !important; }

/* ===== LOGIN ===== */

.login-body {
    background: linear-gradient(135deg, #2c3e50 0%, #3d5166 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 16px;
}

.login-card {
    border: none;
    border-radius: 8px;
}

.login-logo {
    font-size: 28px;
    font-weight: 700;
}

/* ===== BUSCADOR (propiedades) ===== */

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
    font-size: 14px;
    z-index: 1;
}

.search-box .form-control {
    padding-left: 32px;
    border-radius: 8px;
    font-size: 14px;
}

/* ===== FILTRO DE ACTIVIDAD (propiedades) ===== */

.activity-filter {
    display: flex;
    gap: 8px;
}

.btn-activity {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    text-align: center;
}

.btn-activity.active {
    background-color: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

.btn-activity:not(.active):hover {
    border-color: #2c3e50;
    color: #2c3e50;
}

/* ===== FILTRO DE LOCALIDAD (propiedades) ===== */

.locality-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-locality {
    background-color: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-locality:hover {
    border-color: var(--accent-color);
    color: #2c3e50;
}

.btn-locality.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
}

.locality-count {
    display: inline-block;
    background-color: rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 11px;
    margin-left: 4px;
    font-weight: 700;
    vertical-align: middle;
}

.btn-locality.active .locality-count {
    background-color: rgba(255,255,255,0.3);
}

/* ===== TARJETAS COMPACTAS DE PROPIEDADES ===== */

.place-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 100%;
}

.place-card-header {
    padding: 8px 10px;
    background: #f1f3f5;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.place-name {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    word-break: break-word;
}

.place-address {
    display: block;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.3;
    word-break: break-word;
}

.place-maps-link {
    display: inline-block;
    margin-left: 3px;
    padding: 0 4px;
    vertical-align: middle;
    margin-top: -2px;
}

.place-maps-link svg {
    display: block;
    width: 10px;
    height: 14px;
}

.place-card-body {
    padding: 3px;
}

/* ===== CERRADURAS (propiedades) ===== */

.lock-item {
    margin-bottom: 1px;
}

.lock-item:last-child {
    margin-bottom: 0;
}


.btn-abrir {
    display: block;
    width: 100%;
    padding: 5px 6px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.btn-abrir:hover,
.btn-abrir:active {
    background: var(--accent-color);
    color: #fff;
}

.btn-abrir:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lock-result {
    font-size: 11px;
    min-height: 16px;
    margin-top: 3px;
    text-align: center;
}

.no-locks {
    font-size: 11px;
    color: #adb5bd;
    margin: 0;
}

/* ===== RESERVAS DE HOY (tarjetas de propiedad) ===== */

.place-today {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.place-today-item {
    display: block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    margin-bottom: 2px;
    text-decoration: none;
}

.place-today-item:hover { opacity: 0.8; text-decoration: none; }

.place-today-checkout { background: #eafaf1; color: #1e8449; }
.place-today-checkin  { background: #fef5ec; color: #b7570e; }
.place-today-active   { background: #eaf4fb; color: #1a6fa0; }

.place-today-guests {
    font-weight: 400;
    opacity: 0.8;
}

/* ===== BOTÓN LIMPIEZA (tarjetas de propiedad) ===== */

.place-cleaning {
    border-top: 1px solid var(--border-color);
    padding-top: 4px;
}

/* Ficha de reserva: nombre de la propiedad enlazado a /propiedades?place_id */
.booking-place-link { color: #1a6fa0; text-decoration: none; }
.booking-place-link:hover { color: #124e72; text-decoration: underline; }
.booking-place-link i { font-size: 11px; margin-left: 3px; vertical-align: 1px; }

/* Aviso de limpieza en curso de otra persona sobre «Iniciar limpieza» */
.place-others-cleaning { margin: 2px 0 4px; }

.btn-start-cleaning,
.btn-cleaning-open {
    display: block;
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    line-height: 1.3;
}

.btn-start-cleaning {
    background: #fff;
    border: 1.5px solid #3498db;
    color: #3498db;
}

.btn-start-cleaning:hover:not(:disabled) {
    background: #3498db;
    color: #fff;
}

.btn-start-cleaning:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-cleaning-open {
    background: #eafaf1;
    border: 1.5px solid #27ae60;
    color: #1e8449;
}

.btn-cleaning-open:hover {
    background: #27ae60;
    color: #fff;
    text-decoration: none;
}

/* ===== TARJETAS DE LIMPIEZAS ===== */

.cleaning-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: background-color 0.15s;
}

.cleaning-card:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.cleaning-card-activa   { border-left: 4px solid #27ae60; }
.cleaning-card-pendiente { border-left: 4px solid #3498db; }

.cleaning-card-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
}

.cleaning-card-activa   .cleaning-card-state { color: #27ae60; }
.cleaning-card-pendiente .cleaning-card-state { color: #3498db; }

.cleaning-card-assigned {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
}

.cleaning-card-place {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.cleaning-card-locality {
    font-size: 11px;
    color: #6c757d;
}

.cleaning-card-type {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
}

.cleaning-card-time {
    font-size: 11px;
    color: #495057;
}

.cleaning-card-booking {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

/* Badges de estado en detalle de limpieza */
.cleaning-badge-activa    { background: #27ae60; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.cleaning-badge-pendiente { background: #3498db; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.cleaning-badge-finalizada { background: #6c757d; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.cleaning-badge-cancelada  { background: #adb5bd; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 12px; }

/* ===== LISTA DE LIMPIEZAS (historial) ===== */

.cleaning-list { display: flex; flex-direction: column; gap: 0; }

.cleaning-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #adb5bd;
    background: #f8f9fa;
    padding: 12px 12px 5px;
    border-bottom: 1px solid #e9ecef;
}
.cleaning-list .cleaning-group-header:first-child { padding-top: 6px; }

.cleaning-list-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid transparent;
    background: #fff;
}
.cleaning-list-row:hover { background: #f8f9fa; text-decoration: none; color: inherit; }

.cleaning-list-activa    { border-left-color: #27ae60; }
.cleaning-list-pendiente { border-left-color: #3498db; }
.cleaning-list-finalizada { border-left-color: #adb5bd; }
.cleaning-list-cancelada  { border-left-color: #dee2e6; background: #fafafa; }

.cleaning-list-state {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.cleaning-list-activa    .cleaning-list-state { color: #27ae60; }
.cleaning-list-pendiente .cleaning-list-state { color: #3498db; }
.cleaning-list-finalizada .cleaning-list-state { color: #6c757d; }
.cleaning-list-cancelada  .cleaning-list-state { color: #adb5bd; }

.cleaning-list-place { font-size: 14px; font-weight: 600; }
.cleaning-list-type  { font-size: 12px; color: #6c757d; margin-top: 1px; }

/* Badges de seguimiento por línea (una limpieza puede tener varios) */
.cleaning-list-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 2px 0 3px;
}
.cl-flag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.cl-flag-incidencia { background: #fdecea; color: #c0392b; }
.cl-flag-fuera      { background: #fdf0e3; color: #d35400; }
.cl-flag-pdteval    { background: #fff6da; color: #b8860b; }

/* Icono (i) de ayuda en los filtros de seguimiento */
.filter-info { font-size: 11px; opacity: 0.75; cursor: help; }

.cleaning-list-right { text-align: right; min-width: 48px; }
.cleaning-list-date  { font-size: 13px; font-weight: 600; color: #495057; }
.cleaning-list-time  { font-size: 12px; color: #6c757d; }
.cleaning-list-min   { font-size: 12px; color: #27ae60; font-weight: 600; margin-top: 2px; }

/* Duración + fotos + comentarios juntos en una sola línea, para que la card no
   crezca de alto. Si no caben, hacen wrap (raro: son 3 iconos pequeños). */
.cleaning-list-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 2px;
}
.cleaning-list-meta .cleaning-list-min { margin-top: 0; }

/* ===== DETALLE EDITABLE DE LIMPIEZA ===== */

/* Fila campo-valor */
.cleaning-field-row {
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cleaning-field-row:last-child { border-bottom: none; }

.cleaning-field-label {
    flex: 0 0 110px;
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-top: 6px;
    margin-bottom: 0;
}

.cleaning-field-value {
    flex: 1;
    font-size: 14px;
    padding-top: 2px;
}

/* Info de reserva: cifras centradas */
.cleaning-info-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.cleaning-info-value {
    font-size: 15px;
    font-weight: 600;
}

/* Botones de acción de estado */
.cleaning-actions .btn-lg {
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
}

/* ===== RESERVAS: FILTROS Y TARJETAS ===== */

.booking-filters {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-fdate, .btn-ftype {
    flex: 0.9;
    padding: 7px 6px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    color: #6c757d;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-fdate.active, .btn-ftype.active {
    background: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

.btn-ftype-salida.active  { background: #e67e22; border-color: #e67e22; color: #fff; }
.btn-ftype-entrada.active { background: #27ae60; border-color: #27ae60; color: #fff; }

.booking-date-input {
    flex: 1.3;
    padding: 7px 8px;
    font-size: 13px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    min-width: 0;
}

.booking-date-input.active {
    background: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
    color-scheme: dark;
}

.booking-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: background-color 0.15s;
}

.booking-card:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.booking-card-salida  { border-left: 4px solid #e67e22; }
.booking-card-entrada { border-left: 4px solid #27ae60; }

.booking-card-tipo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
}

.booking-card-salida  .booking-card-tipo { color: #e67e22; }
.booking-card-entrada .booking-card-tipo { color: #27ae60; }

.booking-card-time {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
}

.booking-card-place {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.booking-card-guests {
    font-size: 12px;
    color: #6c757d;
}

/* Horas extendidas de reserva: lo que dijo el huésped + late/early comprados */
.booking-extra-guest {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
    margin-left: 4px;
}
.booking-extra-purchase {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #d68910;
    margin-left: 4px;
}
/* En vistas de detalle aparecen en bloque propio */
.cleaning-info-value .booking-extra-guest,
.cleaning-info-value .booking-extra-purchase,
td .booking-extra-guest,
td .booking-extra-purchase {
    display: block;
    margin-left: 0;
    margin-top: 2px;
}

.badge-ambos {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border-radius: 4px;
    padding: 0px 4px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.2px;
}

.badge-ambos-entrada { background: #27ae60; }
.badge-ambos-salida  { background: #e67e22; }

/* Limpieza en curso (state=3 Activa) en la plaza de la reserva, con el nick */
.booking-card-live {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
    padding: 3px 6px;
    border-radius: 5px;
    background: #e8f6ee;
    color: #1e8449;
    font-size: 11.5px;
    line-height: 1.3;
}
.booking-card-live strong { font-weight: 700; }
.booking-card-live-txt { min-width: 0; overflow-wrap: anywhere; }
.booking-card-live-since {
    color: #6c757d;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.booking-card-live .live-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    align-self: center;
    animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(39,174,96,0.55); }
    50%      { box-shadow: 0 0 0 4px rgba(39,174,96,0); }
}
@media (prefers-reduced-motion: reduce) {
    .booking-card-live .live-dot { animation: none; }
}

/* Mi limpieza abierta (ev.my_cleaning_id): arriba del todo y destacada */
.booking-card.booking-card-mine {
    border: 2px solid #27ae60;
    border-left-width: 5px;
    background: #f0faf4;
    box-shadow: 0 2px 10px rgba(39, 174, 96, 0.18);
}
.booking-card.booking-card-mine:hover { background: #e6f6ec; }

/* Limpieza en curso de OTRA persona: mismo verde que «en curso», pero
   discontinuo (no es tuya). El gris queda para «Ya limpias». */
.booking-card.booking-card-others {
    border: 2px dashed #52be80;
    border-left: 5px solid #52be80;
    background: #f7fcf9;
}
.booking-card.booking-card-others:hover { background: #eef8f2; }
.booking-card-live.booking-card-live-mine {
    background: #27ae60;
    color: #fff;
    font-size: 12px;
}
.booking-card-live-mine .booking-card-live-since { color: rgba(255, 255, 255, 0.85); }
.booking-card-live-mine .live-dot {
    background: #fff;
    animation-name: live-pulse-white;
}
@keyframes live-pulse-white {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
    50%      { box-shadow: 0 0 0 4px rgba(255,255,255,0); }
}

/* Plaza ya limpia (ev.done_cleaning): tarjeta en gris al final del listado */
.booking-card.booking-card-done {
    background: #f1f3f5;
    border-color: #e1e5ea;
    border-left-color: #8fa3b8;
}
.booking-card.booking-card-done:hover { background: #e9ecef; }
.booking-card-done .booking-card-tipo,
.booking-card-done .booking-card-time,
.booking-card-done .booking-card-place { color: #7b8794; }
.booking-card-done .booking-card-guests { color: #98a2ad; }
.booking-card-done .badge-ambos { opacity: 0.55; }

.booking-card-clean {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
    padding: 3px 6px;
    border-radius: 5px;
    background: #e3ebf6;
    color: #2f5d8a;
    font-size: 11.5px;
    line-height: 1.3;
}
.booking-card-clean strong { font-weight: 700; }

/* Minimenú al tocar una tarjeta de Reservas: hoja inferior en móvil,
   caja centrada en escritorio. */
.bk-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 2040;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.bk-sheet-overlay.show { opacity: 1; }
.bk-sheet {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 14px 14px 0 0;
    padding: 16px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(24px);
    transition: transform 0.2s ease;
}
.bk-sheet-overlay.show .bk-sheet { transform: translateY(0); }
@media (min-width: 768px) {
    .bk-sheet-overlay { align-items: center; padding: 20px; }
    .bk-sheet { max-width: 360px; border-radius: 12px; padding-bottom: 12px; transform: scale(0.96); }
    .bk-sheet-overlay.show .bk-sheet { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .bk-sheet-overlay, .bk-sheet { transition: none; }
}
.bk-sheet-head { margin-bottom: 10px; }
.bk-sheet-title {
    font-weight: 700;
    font-size: 15px;
    color: #2c3e50;
}
.bk-sheet-sub {
    font-size: 12.5px;
    color: #6c757d;
    margin-top: 1px;
}
.bk-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bk-sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    background: #fff;
    color: #2c3e50;
    font-size: 14.5px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.bk-sheet-item:hover,
.bk-sheet-item:focus-visible {
    background: #f4f6f8;
    color: #2c3e50;
    text-decoration: none;
}
.bk-sheet-item i { font-size: 17px; width: 20px; text-align: center; color: #6c7a89; }
.bk-sheet-item-primary {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}
.bk-sheet-item-primary i { color: #fff; }
.bk-sheet-item-primary:hover,
.bk-sheet-item-primary:focus-visible { background: #229954; color: #fff; }
.bk-sheet-item:disabled { opacity: 0.75; cursor: default; }
.bk-sheet-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    background: #e8f6ee;
    color: #1e8449;
    font-size: 13px;
    font-weight: 600;
}
.bk-sheet-info .live-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
}
.bk-sheet-cancel {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
}
.bk-sheet-cancel:hover { color: #2c3e50; }

/* Separador entre pendientes y «Ya limpias» */
.bookings-done-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 14px;
    font-size: 12px;
    font-weight: 700;
    color: #6c7a89;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bookings-done-sep::after {
    content: "";
    flex: 1;
    border-top: 1px solid #d5dbe1;
}

/* ===== CALENDARIO ===== */

.calendar-wrapper {
    overflow-x: auto;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.calendar-table th {
    background-color: #f1f3f5;
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    border: 1px solid var(--border-color);
}

.calendar-table td {
    vertical-align: top;
    padding: 4px;
    border: 1px solid var(--border-color);
    height: 80px;
    width: calc(100% / 7);
    background: #fff;
}

.calendar-table td.today {
    background-color: #fffde7;
}

.calendar-table td.other-month {
    background-color: #fafafa;
    color: #ccc;
}

/* Número del día dentro de la celda */
.cal-day-number {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-align: right;
    margin-bottom: 2px;
}

.cal-day-number.today-number {
    color: #007bff;
}

/* Barra de reserva dentro de la celda del calendario */
.cal-booking {
    display: block;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    text-decoration: none;
}

.cal-booking:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

/* Leyenda de colores del calendario */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #495057;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* Navegación del mes en el calendario */
.calendar-nav {
    display: flex;
    align-items: center;
}

.calendar-month-label {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px;
    text-align: center;
}

/* ==========================================================================
   CHECKLIST DE TAREAS — layout en grid de etiquetas
   ========================================================================== */

.checklist-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.checklist-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    font-size: 0.85rem;
    line-height: 1.3;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.checklist-tag[onclick] {
    cursor: pointer;
}

.checklist-tag:not([onclick]) {
    cursor: default;
}

.checklist-tag:active {
    opacity: 0.75;
}

.checklist-tag.checked {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.checklist-tag i {
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ==========================================================================
   GASTOS / MATERIALES
   ========================================================================== */

.gasto-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gasto-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 44px;
}

.gasto-item:last-child {
    border-bottom: none;
}

.gasto-name {
    flex: 1;
    font-size: 0.88rem;
    padding-right: 8px;
}

.gasto-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.gasto-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gasto-qty {
    min-width: 28px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #ccc;
}

.gasto-qty.has-qty {
    color: #28a745;
}

.gasto-supplier-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(0,0,0,0.65);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}
.gasto-supplier-toggle:active { filter: brightness(0.93); }
.gasto-supplier-body {
    border: 1px solid rgba(0,0,0,0.08);
    border-top: none;
    border-radius: 0 0 4px 4px;
    margin-bottom: 2px;
}

.gasto-family-header {
    padding: 3px 12px;
    font-size: 0.72rem;
    color: #888;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-style: italic;
}

#gasto-search-results {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-height: 320px;
    overflow-y: auto;
}

/* =============================================================================
   Fotos / vídeos
   ============================================================================= */

.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-video-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 2.5rem;
    color: #555;
    background: #d0d4d8;
}

.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    color: #fff;
    width: 26px;
    height: 26px;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.photo-delete-btn:hover {
    background: rgba(200, 0, 0, 0.75);
}

.photo-thumb.uploading {
    background: #e9ecef;
    cursor: default;
}

.cleaning-list-photos {
    font-size: 0.72rem;
    color: #6c757d;
    white-space: nowrap;
}

/* ===== Avisos propios: toasts + confirmación (sustituyen alert/confirm) ===== */
.ok-toast-wrap {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 100%;
    max-width: 420px;
    padding: 0 12px;
    pointer-events: none;
}
.ok-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.3;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
    cursor: pointer;
}
.ok-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.ok-toast i {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ok-toast-success { background: #2e7d32; }
.ok-toast-danger  { background: #c62828; }
.ok-toast-warning { background: #ef6c00; }
.ok-toast-info    { background: #1565c0; }

.ok-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.ok-confirm-overlay.show { opacity: 1; }
.ok-confirm-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.96);
    transition: transform 0.2s ease;
}
.ok-confirm-overlay.show .ok-confirm-box { transform: scale(1); }
.ok-confirm-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
}
.ok-confirm-msg {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 18px;
}
.ok-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Nota de petición de cambio cruzada en la tarjeta del día/tramo */
.clavel-reqnote {
    font-size: 0.85rem;
    line-height: 1.35;
}
.clavel-reqnote-pending {
    background: #fff8e1;
    border: 1px solid #ffe082;
}
.clavel-reqnote-done {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}
.clavel-reqnote > div {
    color: #444;
}

/* Botón principal de fichar (Iniciar / Parar): alto y cuadrado, centrado,
   sin ocupar todo el ancho. El icono va encima del texto (clase d-block). */
.clavel-action-btn {
    min-width: 150px;
    padding: 1.1rem 2rem;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.15;
    border-radius: 14px;
}
.clavel-action-btn .bi {
    font-size: 2.2rem;
    margin-bottom: 0.2rem;
}

/* ============================================================
   MANDOS DE GARAJE — card del dashboard (garage-mando.js)
   Portado del panel admin. Ver MANDOS_GARAJE.md.
   ============================================================ */
.garage-mandos-toggle {
    cursor: pointer;
}
.garage-mando-tile {
    border: 1px solid rgba(40, 167, 69, 0.25);
    border-radius: 6px;
    padding: 0.75rem;
    background: rgba(40, 167, 69, 0.03);
    display: flex;
    flex-direction: column;
}
.garage-mando-tile .btn-open-mando {
    width: 100%;
}
.garage-mando-history li + li {
    margin-top: 2px;
}

/* =============================================================================
   Incidencias (helpdesk Camelia — lado limpiadora)
   ============================================================================= */

/* --- Lista --- */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease;
}
.ticket-item:hover {
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ticket-item-body { flex: 1; min-width: 0; }

.ticket-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ticket-subject {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-item-meta {
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 2px;
}

.ticket-chevron {
    color: #adb5bd;
    margin-left: 8px;
    flex-shrink: 0;
}

/* --- Chips de estado (espejo de las fases públicas) --- */
.ticket-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}
.ticket-status-received   { background: #fff3cd; color: #856404; }
.ticket-status-inprogress { background: #d1ecf1; color: #0c5460; }
.ticket-status-resolved   { background: #d4edda; color: #155724; }
.ticket-status-closed     { background: #e2e3e5; color: #495057; }

/* --- Formulario de alta: chips de fotos seleccionadas --- */
.ticket-photo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ticket-photo-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.78rem;
    max-width: 100%;
}
.ticket-photo-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}
.ticket-photo-remove {
    border: none;
    background: none;
    color: #dc3545;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

/* --- Línea de tiempo de fases --- */
.ticket-phases {
    display: flex;
}
.ticket-phase {
    flex: 1;
    text-align: center;
    position: relative;
    min-width: 0;
}
.ticket-phase::before {
    content: '';
    position: absolute;
    top: 13px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
}
.ticket-phase:first-child::before { display: none; }
.ticket-phase.done::before { background: var(--brand-ok-color); }

.ticket-phase-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dee2e6;
    color: #fff;
    margin: 0 auto 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}
.ticket-phase.done .ticket-phase-dot { background: var(--brand-ok-color); }

.ticket-phase-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
}
.ticket-phase.done .ticket-phase-label { color: #212529; }

.ticket-phase-at {
    font-size: 0.72rem;
    color: #6c757d;
    line-height: 1.3;
}

/* --- Hilo de conversación --- */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.ticket-msg { display: flex; }
.ticket-msg-in  { justify-content: flex-end; }   /* mensajes de la limpiadora */
.ticket-msg-out { justify-content: flex-start; } /* mensajes del equipo */

.ticket-bubble {
    max-width: 85%;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e4e7eb;
}
.ticket-msg-in .ticket-bubble {
    background: #e8f7ee;
    border-color: #cdeeda;
}

.ticket-msg-author {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 2px;
}
.ticket-msg-date {
    font-weight: 400;
    margin-left: 6px;
    color: #adb5bd;
}

/* --- Texto multilínea respetando saltos --- */
.ticket-prewrap {
    white-space: pre-wrap;
    word-break: break-word;
}

