@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* Estilo para el campo status (gasto eliminado) */
.field-boolean.form-group .form-check-input[name$="[status]"]:checked {
    background-color: #2ecc71;
    border-color: #2ecc71;
}

.field-boolean.form-group .form-check-input[name$="[status]"]:not(:checked) {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

/* Estilo para el badge cuando está eliminado */
.badge.bg-secondary {
    background-color: #dc3545 !important;
}

/* Cashless online — un color distinto por estado */
.badge.cashless-status-not-started { background-color: #6c757d; color: #fff; }
.badge.cashless-status-active-recharge { background-color: #0d6efd; color: #fff; }
.badge.cashless-status-end-recharge { background-color: #0dcaf0; color: #000; }
.badge.cashless-status-active-return { background-color: #198754; color: #fff; }
.badge.cashless-status-end-return { background-color: #212529; color: #fff; }
.badge.cashless-status-sepa-send { background-color: #fd7e14; color: #fff; }
.badge.cashless-status-devolutions-pending { background-color: #dc3545; color: #fff; }
.badge.cashless-status-completed { background-color: #6f42c1; color: #fff; }

/* Estilo para el texto de ayuda del campo status */
.field-boolean.form-group .form-check-label[for$="status"]::after {
    content: "Si se desmarca, el registro se eliminará y no se volverá a mostrar";
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.875em;
    font-style: italic;
}

/* --- LOGIN PAGE STYLES --- */
.login-wrapper {
    background: #f7f7f8;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    color: #000000;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

#login-header-logo {
    width: auto;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.login-logo {
    width: clamp(140px, 42vw, 260px);
    max-width: 90vw;
    display: block;
    filter: grayscale(100%) brightness(0);
}

.login-form {
    background: #fff;
    padding: 2.5rem 2rem 2rem 2rem;
    border-radius: 14px;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.06);
    width: 100%;
    max-width: 370px;
    margin: 0 auto;
    border: 1px solid #ececec;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.login-form-group {
    margin-bottom: 1.3rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.login-form-group label {
    margin-bottom: 0.4rem;
    color: #222;
    font-weight: 500;
    font-size: 1rem;
}

.login-form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background: #fafbfc;
    color: #222;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none;
    box-sizing: border-box;
}
.login-form-control:focus {
    border-color: #222;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 2px #2221;
}

.login-form-remember {
    display: flex;
    align-items: center;
    margin-bottom: 1.3rem;
}
.login-form-check-label {
    display: flex;
    align-items: center;
    font-weight: 400;
    font-size: 1rem;
    gap: 0.5rem;
    cursor: pointer;
}
.login-form-check-input {
    margin: 0 0.5rem 0 0;
    accent-color: #222;
}

.login-btn,
.login-btn-primary,
.login-btn-secondary {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    margin-bottom: 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: none;
    letter-spacing: 0.01em;
    outline: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn-primary {
    background: #D8F037;
    color: #000000;
}
.login-btn-primary:hover {
    background: #84931e;
}

.login-btn-secondary {
    background: #000000;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 0;
    box-shadow: none;
    border: none;
    text-decoration: none;
}
.login-btn-secondary:hover {
    background: #6c6c6c;
    color: #ffffff;
}
.login-btn-secondary i {
    font-size: 1.1em;
    margin-right: 0.5em;
    vertical-align: middle;
}
.login-btn-secondary span {
    vertical-align: middle;
}

.login-text-center {
    text-align: center;
}
.login-language-switch {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.alert {
    padding: 1rem;
    margin-bottom: 1.2rem;
    border-radius: 6px;
    font-size: 0.98rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #b00020;
    text-align: center;
}

.alert-danger {
    background: #fff0f1;
    border: 1px solid #f5c6cb;
    color: #b00020;
}

.login-alert {
    padding: 1rem;
    margin-bottom: 1.2rem;
    border-radius: 6px;
    font-size: 0.98rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #b00020;
    text-align: center;
}
.login-alert-danger {
    background: #fff0f1;
    border: 1px solid #f5c6cb;
    color: #b00020;
}

@media (max-width: 600px) {
    .login-form {
        padding: 1.2rem 0.7rem;
        max-width: 98vw;
    }
}

.login-header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.3rem;
}

.collapse {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.login-form-group.login-text-center > span {
    display: inline-block;
    padding: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .login-wrapper {
        padding: 1rem;
    }

    .login-content {
        padding: 0.5rem;
    }

    .login-form {
        padding: 1.5rem 1rem !important;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .login-form-group {
        margin-bottom: 1rem;
    }

    .login-btn,
    .login-btn-primary,
    .login-btn-secondary {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .login-btn span {
        font-size: 0.95rem;
    }

    .login-form-control {
        padding: 0.85rem 1rem;
        font-size: 16px;
        min-height: 48px;
    }

    .login-form-group.login-text-center > span {
        padding: 0.3rem 0;
        font-size: 0.85rem;
    }

    .collapse > div {
        padding: 0.8rem 0 !important;
        margin-top: 0.8rem !important;
    }

    .login-alert,
    .login-alert-danger {
        padding: 0.85rem;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .login-form {
        padding: 1.2rem 0.8rem !important;
        margin: 0.25rem;
    }

    .login-btn,
    .login-btn-primary,
    .login-btn-secondary {
        padding: 0.85rem 0.9rem;
        font-size: 0.9rem;
    }

    .login-btn i {
        font-size: 1em;
    }

    .login-form-control {
        padding: 0.8rem 0.9rem;
    }

    .login-form-group label {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .login-wrapper {
        padding: 0.5rem;
    }

    .login-form {
        padding: 1rem 0.8rem !important;
    }

}

/* Details and Index view */

.modern-header {
    background: linear-gradient(135deg,rgb(44, 62, 80),rgba(44, 62, 80, 0.42));
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.40);
}

.modern-header h1 {
    color: white;
    margin: 0;
    font-size: 24px;
    font-weight: 500;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.card-header {
    background: linear-gradient(135deg,#e2e8f0, #f8fafc);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-radius: 15px 15px 0 0 !important;
    padding: 15px;
}

.card-title {
    color: #5368d5;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 25px;
}

.second-header {
    background: linear-gradient(to top, #dde5ef, #f8fafc00);
    padding: 15px;
    border-bottom: 1px solid #5369d582;
}

.second-header h2 {
    color: #5368d5;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.second-header h5 {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

dl.row {
    margin-bottom: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
}

dt.col-sm-4 {
    color: #2c3e50;
    font-weight: 700;
    font-size: 14px;
    text-align: right;
    padding-right: 15px;
    margin-bottom: 0;
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

dd.col-sm-8 {
    color: #2c3e50;
    font-weight: 400;
    text-align: left;
    margin-left: 0;
    padding-left: 15px;
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    margin-bottom: 15px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-active {
    background-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.status-inactive {
    background-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

/* Action buttons container */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 1rem;
}

.action-buttons .btn {
    min-width: 100px;
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: #5368d5;
    box-shadow: 0 0 0 0.2rem rgba(83, 104, 213, 0.25);
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.events-operator-select {
    width: 58px;
    min-width: 58px;
    text-align: center;
    text-align-last: center;
    padding-right: 1.75rem;
    background-position: right 0.45rem center;
}

#noResults {
    padding: 2rem;
}

#noResults i {
    color: #6c757d;
}

/* --- EVENTOS: Filtros y dropdown de servicios --- */
.dropdown-menu {
    min-width: 100%;
}
.dropdown-item {
    cursor: pointer;
}
.dropdown-item:hover {
    background-color: #f8f9fa;
}
.dropdown-item.active {
    background-color: #5368d5;
    color: white;
}
#servicesDropdown, #servicesDropdown:focus {
    box-shadow: none;
    border: 1px solid #ced4da;
    background-color: #fff;
    color: #212529;
    font-size: 1rem;
    height: 38px;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    border-radius: 0.375rem;
}
#servicesDropdown {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#servicesDropdownText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- CALENDAR FIELD STYLES --- */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background-color: #5368d5 !important;
    border-radius: 20% !important;
}

/* Estilos para campos de fecha y hora */
input[type="datetime-local"] {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: #fff;
    color: #212529;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="datetime-local"]:focus {
    border-color: #5368d5;
    box-shadow: 0 0 0 0.2rem rgba(83, 104, 213, 0.25);
    outline: none;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background-color: #5368d5 !important;
    border-radius: 20% !important;
    filter: brightness(1.1);
}

/* Estilos para campos de fecha */
input[type="date"] {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: #fff;
    color: #212529;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="date"]:focus {
    border-color: #5368d5;
    box-shadow: 0 0 0 0.2rem rgba(83, 104, 213, 0.25);
    outline: none;
}

/* Estilos para campos de tiempo */
input[type="time"] {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: #fff;
    color: #212529;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="time"]:focus {
    border-color: #5368d5;
    box-shadow: 0 0 0 0.2rem rgba(83, 104, 213, 0.25);
    outline: none;
}

/* Estilos para campos de fecha y hora en formularios */
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="time"] {
    width: 100%;
    box-sizing: border-box;
}

/* Estilos para labels de campos de fecha */
.form-group label[for*="start"],
.form-group label[for*="end"],
.form-group label[for*="date"] {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

/* Estilos para campos de fecha en cards */
.card-body input[type="date"],
.card-body input[type="datetime-local"],
.card-body input[type="time"] {
    background-color: #fafbfc;
}

.card-body input[type="date"]:focus,
.card-body input[type="datetime-local"]:focus,
.card-body input[type="time"]:focus {
    background-color: #fff;
}

/* Estilos para campos de fecha deshabilitados */
input[type="date"]:disabled,
input[type="datetime-local"]:disabled,
input[type="time"]:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Estilos para campos de fecha con errores */
input[type="date"].is-invalid,
input[type="datetime-local"].is-invalid,
input[type="time"].is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Estilos para campos de fecha válidos */
input[type="date"].is-valid,
input[type="datetime-local"].is-valid,
input[type="time"].is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* --- EVENTOS TABLE STYLES --- */

/* Encabezados de semana */
.semana {
    font-weight: bold;
    background-color: #c5d0da !important;
    background: #c5d0da !important;
}

.semana th,
.semana td {
    padding: 10px 8px;
    vertical-align: middle;
}

/* Forzar color en todas las celdas del encabezado de semana */
#eventsTable .semana td,
#eventsTable .semana th {
    background-color: #c5d0da !important;
    background: #c5d0da !important;
}

/* Filas de eventos */
.funcion {
    transition: background-color 0.2s ease;
}

/* Hover para filas de eventos con mayor especificidad */
#eventsTable .funcion:hover {
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2) !important;
}

#eventsTable .funcion.week-color-1:hover {
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2) !important;
}

#eventsTable .funcion.week-color-2:hover {
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2) !important;
}

/* Hover para las celdas individuales */
#eventsTable .funcion:hover td {
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2) !important;
}

/* Deshabilitar hover en las filas de semana */
#eventsTable .semana:hover {
    box-shadow: none !important;
}

#eventsTable .semana:hover td,
#eventsTable .semana:hover th {
    box-shadow: none !important;
}

/* Colores alternados para las semanas */
.week-color-1 {
    background-color: #FAD7A0 !important;
    background: #FAD7A0 !important;
}

.week-color-2 {
    background-color: #f3f3f3 !important;
    background: #f3f3f3 !important;
}

/* Forzar colores con mayor especificidad */
#eventsTable .funcion.week-color-1 {
    background-color: #FAD7A0 !important;
    background: #FAD7A0 !important;
}

#eventsTable .funcion.week-color-2 {
    background-color: #f3f3f3 !important;
    background: #f3f3f3 !important;
}

/* Forzar colores en todas las celdas de la fila */
#eventsTable .funcion.week-color-1 td {
    background-color: #FAD7A0 !important;
    background: #FAD7A0 !important;
}

#eventsTable .funcion.week-color-2 td {
    background-color: #f3f3f3 !important;
    background: #f3f3f3 !important;
}

/* Forzar colores en la fila completa */
#eventsTable tbody tr.funcion.week-color-1 {
    background-color: #FAD7A0 !important;
    background: #FAD7A0 !important;
}

#eventsTable tbody tr.funcion.week-color-2 {
    background-color: #f3f3f3 !important;
    background: #f3f3f3 !important;
}

/* Solo bordes entre eventos, no en encabezados de semana */
#eventsTable .funcion td {
    border-bottom: 1px solid rgb(131, 131, 131);
}

/* Estructura general de la tabla */
#eventsTable tbody tr {
    border: none;
}

#eventsTable tbody tr td {
    border: none;
    padding: 10px 8px;
    vertical-align: middle;
}

#eventsTable thead th {
    border: none;
    background-color: white;
    font-weight: 600;
    padding: 12px 8px;
    vertical-align: middle;
}

/* Eliminar bordes de la tabla */
#eventsTable {
    border: none;
}

#eventsTable td,
#eventsTable th {
    border: none;
}

/* Quitar borde inferior del último evento de cada semana */
#eventsTable .funcion + .semana {
    border-top: none;
}

/* Quitar borde inferior del último evento de cada semana */
#eventsTable .funcion + .semana td {
    border-bottom: none;
}

/* Quitar borde inferior del último evento de la tabla */
#eventsTable .funcion:last-of-type td {
    border-bottom: none;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.inventory-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border: none;
}
.inventory-table thead th.text-center {
    text-align: center;
}
.inventory-table thead th.text-end {
    text-align: right;
}
.inventory-table tbody td.product-name-cell {
    background-color: #1a237e;
    font-weight: 600;
    color: white;
}
.inventory-table tbody tr.subtotal-row {
    background-color: #b3d9ff !important;
    color: #000 !important;
    font-weight: bold;
}

.inventory-table tbody tr.subtotal-row td {
    background-color: #b3d9ff !important;
    color: #000 !important;
    padding: 12px 15px;
}
.inventory-table tbody tr.subtotal-row td:first-child {
    font-size: 14px;
}
.inventory-table tbody td.size-name {
    padding-left: 30px;
}

/* CALENDAR STYLES */
.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    overflow-x: hidden;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    width: 100%;
}

.calendar-week-header {
    margin-bottom: 0;
}

.calendar-day-header {
    padding: 8px 4px;
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
    color: #70757a;
    background: #fff;
    border-radius: 0;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid #dadce0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 0;
    overflow: hidden;
    width: 100%;
}

.calendar-day {
    min-height: 100px;
    background: #fff;
    padding: 4px;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border-right: 1px solid #dadce0;
    border-bottom: 1px solid #dadce0;
}

.calendar-day:last-child,
.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day-empty {
    background: #f8f9fa;
    min-height: 100px;
    border-right: 1px solid #dadce0;
    border-bottom: 1px solid #dadce0;
}

.calendar-day-today {
    background: #fef7e0;
}

.calendar-day-today .calendar-day-number {
    background: #1a73e8;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-number {
    font-weight: 400;
    font-size: 0.75rem;
    margin-bottom: 4px;
    color: #70757a;
    padding: 2px 4px;
    align-self: flex-start;
}

.calendar-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    max-height: 100%;
}

.calendar-event {
    color: #3c4043;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s;
    text-decoration: none;
    display: block;
    margin-bottom: 1px;
    line-height: 1.3;
    border-left: 3px solid;
    background: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.calendar-event:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    z-index: 1;
    position: relative;
}

/* Colores distintivos para eventos multi-día */
.calendar-event-color-1 { 
    border-left-color: #4caf50; /* Verde */
    background: #e8f5e9;
}
.calendar-event-color-2 { 
    border-left-color: #f44336; /* Rojo */
    background: #ffebee;
}
.calendar-event-color-3 { 
    border-left-color: #2196f3; /* Azul */
    background: #e3f2fd;
}
.calendar-event-color-4 { 
    border-left-color: #9c27b0; /* Morado */
    background: #f3e5f5;
}
.calendar-event-color-5 { 
    border-left-color: #ff9800; /* Naranja */
    background: #fff3e0;
}
/* Color especial para eventos de 1 solo día */
.calendar-event-color-single { 
    border-left-color: #00bcd4; /* Cyan */
    background: #e0f7fa;
}

/* Cashless: Recargas (verde) y Devoluciones (rojo) */
.calendar-event-cashless-recharge {
    border-left-color: #2e7d32;
    background: #e8f5e9;
}
.calendar-event-cashless-return {
    border-left-color: #c62828;
    background: #ffebee;
}
.event-color-indicator.calendar-event-cashless-recharge-indicator { background: #2e7d32; }
.event-color-indicator.calendar-event-cashless-return-indicator { background: #c62828; }
.calendar-event-color-6 { 
    border-left-color: #ffb878;
    background: #fff3e0;
}
.calendar-event-color-7 { 
    border-left-color: #46d6db;
    background: #e0f7fa;
}
.calendar-event-color-8 { 
    border-left-color: #e1e1e1;
    background: #f5f5f5;
}
.calendar-event-color-9 { 
    border-left-color: #51b749;
    background: #e8f5e9;
}
.calendar-event-color-10 { 
    border-left-color: #fdcfe8;
    background: #fce4ec;
}
.calendar-event-color-11 { 
    border-left-color: #b39ddb;
    background: #ede7f6;
}
.calendar-event-color-12 { 
    border-left-color: #ffab91;
    background: #fbe9e7;
}
.calendar-event-color-13 { 
    border-left-color: #81c784;
    background: #e8f5e9;
}
.calendar-event-color-14 { 
    border-left-color: #f48fb1;
    background: #fce4ec;
}
.calendar-event-color-15 { 
    border-left-color: #90caf9;
    background: #e3f2fd;
}
.calendar-event-color-16 { 
    border-left-color: #a5d6a7;
    background: #e8f5e9;
}
.calendar-event-color-17 { 
    border-left-color: #ce93d8;
    background: #f3e5f5;
}
.calendar-event-color-18 { 
    border-left-color: #ffcc80;
    background: #fff3e0;
}
.calendar-event-color-19 { 
    border-left-color: #80deea;
    background: #e0f7fa;
}
.calendar-event-color-20 { 
    border-left-color: #c5e1a5;
    background: #f1f8e9;
}
.calendar-event-color-21 { 
    border-left-color: #ef9a9a;
    background: #ffebee;
}
.calendar-event-color-22 { 
    border-left-color: #9fa8da;
    background: #e8eaf6;
}
.calendar-event-color-23 { 
    border-left-color: #b2dfdb;
    background: #e0f2f1;
}
.calendar-event-color-24 { 
    border-left-color: #ffe082;
    background: #fffde7;
}
.calendar-event-color-25 { 
    border-left-color: #ffb74d;
    background: #fff3e0;
}
.calendar-event-color-26 { 
    border-left-color: #ba68c8;
    background: #f3e5f5;
}
.calendar-event-color-27 { 
    border-left-color: #64b5f6;
    background: #e3f2fd;
}
.calendar-event-color-28 { 
    border-left-color: #4db6ac;
    background: #e0f2f1;
}
.calendar-event-color-29 { 
    border-left-color: #ff8a65;
    background: #fbe9e7;
}
.calendar-event-color-30 { 
    border-left-color: #9575cd;
    background: #ede7f6;
}
.calendar-event-color-31 { 
    border-left-color: #7986cb;
    background: #e8eaf6;
}
.calendar-event-color-32 { 
    border-left-color: #4fc3f7;
    background: #e1f5fe;
}
.calendar-event-color-33 { 
    border-left-color: #81c784;
    background: #e8f5e9;
}
.calendar-event-color-34 { 
    border-left-color: #ffb74d;
    background: #fff3e0;
}
.calendar-event-color-35 { 
    border-left-color: #a1887f;
    background: #efebe9;
}
.calendar-event-color-36 { 
    border-left-color: #90a4ae;
    background: #eceff1;
}
.calendar-event-color-37 { 
    border-left-color: #f06292;
    background: #fce4ec;
}
.calendar-event-color-38 { 
    border-left-color: #4dd0e1;
    background: #e0f7fa;
}
.calendar-event-color-39 { 
    border-left-color: #ba68c8;
    background: #f3e5f5;
}
.calendar-event-color-40 { 
    border-left-color: #ffa726;
    background: #fff3e0;
}
.calendar-event-default { 
    border-left-color: #9aa0a6;
    background: #f1f3f4;
}

.calendar-event-start {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.calendar-event-end {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.calendar-event-continued {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
}

.calendar-event-name {
    font-weight: 400;
    font-size: 0.7rem;
    color: #3c4043;
}

.calendar-event-more {
    background: transparent;
    color: #1a73e8;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 400;
    text-align: left;
    margin-top: 2px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    width: 100%;
}

.calendar-event-more:hover {
    background: #f1f3f4;
    color: #1557b0;
}

.event-color-indicator {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

/* Indicadores de color para el modal - Colores distintivos */
.event-color-indicator.event-color-1 { background-color: #4caf50 !important; } /* Verde */
.event-color-indicator.event-color-2 { background-color: #f44336 !important; } /* Rojo */
.event-color-indicator.event-color-3 { background-color: #2196f3 !important; } /* Azul */
.event-color-indicator.event-color-4 { background-color: #9c27b0 !important; } /* Morado */
.event-color-indicator.event-color-5 { background-color: #ff9800 !important; } /* Naranja */
.event-color-indicator.event-color-single { background-color: #00bcd4 !important; } /* Cyan para eventos de 1 día */

.modal-sm {
    max-width: 400px;
}

/* Modal "+N más" del calendario: ancho según contenido (título y filas) */
.calendar-events-day-modal {
    width: fit-content;
    max-width: min(92vw, 42rem);
    min-width: min(92vw, 16rem);
    margin-left: auto;
    margin-right: auto;
}

.calendar-events-day-modal .modal-content {
    width: auto;
}

.calendar-events-day-modal .list-group-item {
    white-space: nowrap;
}

.modal .card {
    margin-bottom: 0;
    border-radius: 15px;
}

.modal .card-header {
    border-radius: 15px 15px 0 0 !important;
}

.modal .card-footer {
    border-radius: 0 0 15px 15px;
}

.modal .card-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.modal .list-group-item {
    border-left: none;
    border-right: none;
    transition: background-color 0.15s;
}

.modal .list-group-item:hover {
    background-color: #f8f9fa;
}

.modal .list-group-item:first-child {
    border-top: none;
}

.modal .list-group-item .fw-medium {
    font-size: 0.875rem;
    line-height: 1.3;
    color: #2c3e50;
}

.modal .list-group-item .small {
    font-size: 0.75rem;
    line-height: 1.2;
}

.event-color-1 { background: #a4bdfc; }
.event-color-2 { background: #7ae7bf; }
.event-color-3 { background: #dbadff; }
.event-color-4 { background: #ff887c; }
.event-color-5 { background: #fbd75b; }
.event-color-6 { background: #ffb878; }
.event-color-7 { background: #46d6db; }
.event-color-8 { background: #e1e1e1; }
.event-color-0 { background: #9aa0a6; }

.calendar-day-events {
    max-height: 100%;
    overflow-y: auto;
}

.calendar-day-events::-webkit-scrollbar {
    width: 4px;
}

.calendar-day-events::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* Tooltips reutilizables para labels de formulario */
.vm-tooltip-label {
    position: relative;
    display: inline-block;
}

.vm-tooltip-label:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 10px;
    border: 6px solid transparent;
    border-bottom-color: #1f2937;
    z-index: 1050;
}

.vm-tooltip-label:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: max-content;
    min-width: 420px;
    max-width: min(760px, 80vw);
    background: #1f2937;
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.98rem;
    line-height: 1.4;
    font-weight: 400;
    white-space: normal;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.card-body {
    /* Dejar que los desplegables de selects puedan sobresalir del card */
    overflow: visible;
    width: 100%;
}

/* Asegurar que los modales estén por encima de todo */
.modal {
    z-index: 1055 !important;
}
.modal-backdrop {
    z-index: 1050 !important;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        padding: 2px;
    }

    .calendar-day-number {
        font-size: 0.7rem;
    }

    .calendar-event {
        font-size: 0.6rem;
        padding: 1px 2px;
    }

    .calendar-day-header {
        padding: 4px 1px;
        font-size: 0.7rem;
    }

    .calendar-event-name {
        font-size: 0.6rem;
    }

    .calendar-event-more {
        font-size: 0.6rem;
        padding: 1px 2px;
    }
}

/* Event detail — índice lateral (solo escritorio) */
.content-panel .card[id],
.content-panel #top {
    scroll-margin-top: 80px;
}

/* Franja derecha de EasyAdmin (ancho contenido) desactivada globalmente */
#content-resizer-handler {
    display: none !important;
}

@media (max-width: 991.98px) {
    body.ea-has-content-sidebar .ea-content-sidebar-slot,
    body.ea-has-content-sidebar .ea-content-sidebar-reopen-slot {
        display: none !important;
    }
}

@media (min-width: 992px) {
    body.ea-has-content-sidebar .content-wrapper {
        display: grid !important;
        align-items: start !important;
        column-gap: 0 !important;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
    }

    body.ea-has-content-sidebar:not(.ea-content-sidebar-visible) .content-wrapper {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.ea-has-content-sidebar .content-wrapper > .content {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        padding-inline-end: 8px !important;
    }

    body.ea-has-content-sidebar .ea-content-sidebar-slot {
        grid-column: 2 !important;
        grid-row: 1 !important;
        position: sticky;
        top: 16px;
        align-self: start;
        width: 100%;
        max-width: 280px;
        padding-inline: 16px 8px;
        padding-top: 0;
        max-height: calc(100vh - 32px);
        z-index: 2;
        box-sizing: border-box;
        /* margin-top se sincroniza con .content-header vía JS */
    }

    body.ea-has-content-sidebar:not(.ea-content-sidebar-visible) .ea-content-sidebar-slot {
        display: none !important;
    }

    body.ea-has-content-sidebar .ea-content-sidebar {
        width: 100%;
        max-height: calc(100vh - 32px);
        box-sizing: border-box;
    }

    body.ea-has-content-sidebar .ea-content-sidebar-reopen-slot {
        grid-column: 2 !important;
        grid-row: 1 !important;
        position: sticky;
        top: 16px;
        align-self: start;
        display: none;
        padding-inline: 16px 8px;
        box-sizing: border-box;
    }

    body.ea-has-content-sidebar:not(.ea-content-sidebar-visible) .ea-content-sidebar-reopen-slot {
        display: block;
    }

    body.ea-has-content-sidebar .ea-content-sidebar-reopen {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(83, 104, 213, 0.2);
        border-radius: 10px;
        background: #fff;
        color: #5368d5;
        box-shadow: 0 4px 14px rgba(44, 62, 80, 0.12);
        cursor: pointer;
    }

    body.ea-has-content-sidebar .ea-content-sidebar-reopen[hidden] {
        display: none !important;
    }

    body.ea-has-content-sidebar .ea-content-sidebar-reopen:hover {
        background: rgba(83, 104, 213, 0.08);
        color: #2c3e50;
    }
}

.ea-content-sidebar .event-detail-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border-radius: 15px;
    margin: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.14);
    border: 1px solid rgba(83, 104, 213, 0.12);
}

.ea-content-sidebar .event-detail-nav .card-header {
    padding: 15px;
    border-bottom: 1px solid rgba(83, 104, 213, 0.12);
}

.event-detail-nav-header {
    flex-shrink: 0;
}

.event-detail-nav-header .card-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.event-detail-nav-toggle {
    color: #5368d5;
    line-height: 1;
    text-decoration: none;
    font-size: 14px;
}

.event-detail-nav-toggle:hover {
    color: #2c3e50;
}

.event-detail-nav-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 88px);
}

.event-detail-nav-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.event-detail-nav-link {
    display: block;
    padding: 8px 14px;
    color: #2c3e50;
    font-size: 12.5px;
    line-height: 1.35;
    font-weight: 500;
    text-decoration: none;
    border-inline-start: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.event-detail-nav-link:hover {
    background: rgba(83, 104, 213, 0.06);
    color: #5368d5;
}

.event-detail-nav-link.is-active {
    background: rgba(83, 104, 213, 0.1);
    color: #5368d5;
    font-weight: 600;
    border-inline-start-color: #5368d5;
}

.event-detail-nav-link-top {
    font-size: 11.5px;
    color: #6c757d;
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 10px;
}

.event-detail-nav-link-top:hover {
    color: #5368d5;
}

