/* ============================================================
   views/assets/css/custom/customcitasmedicas.css
   Citas Médicas — Estilos compartidos (Paciente, Doctor, Agenda)
   Última actualización: 2026-06-02 4:50 pm (VET)
   ============================================================ */

/* ============================================================
   ENCABEZADOS PREMIUM (COMPARTIDOS)
   ============================================================ */

.cm-header {
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 18px;
}

.cm-header h5 {
    font-weight: 700;
    color: #333;
    margin: 0;
    font-size: 1.1rem;
}

/* ============================================================
   BOTONES PREMIUM (COMPARTIDOS)
   ============================================================ */

.cm-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cm-buttons .btn {
    width: 75%;
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

/* Botón morado premium (compartido) */
.btn-premium-purple {
    background-color: #6f42c1 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-premium-purple:hover {
    background-color: #5a36a3 !important;
}

.btn-premium-purple:active {
    background-color: #4b2e87 !important;
    transform: scale(0.97) !important;
}

/* ============================================================
   SELECT2 — AJUSTES COMPARTIDOS
   ============================================================ */

.cm-form .select2-container {
    width: 100% !important;
}

.cm-form .select2-selection {
    border-radius: 10px !important;
    border: 1px solid #d8d8d8 !important;
    background: #fafafa !important;
    transition: all 0.2s ease-in-out;
}

.cm-form .select2-selection:hover {
    border-color: #bcbcbc !important;
}

/* ============================================================
   CAMPOS COMPARTIDOS
   ============================================================ */

.cm-form label {
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.cm-form input,
.cm-form select,
.cm-form textarea {
    font-size: 0.85rem;
    padding: 6px 8px;
    border-radius: 10px !important;
}

/* ============================================================
   RESPONSIVE COMPARTIDO
   ============================================================ */

@media (max-width: 576px) {

    .cm-header {
        padding: 12px 14px;
    }

    .cm-buttons .btn {
        width: 90%;
    }

    .cm-form .col-12,
    .cm-form .col-md-6 {
        margin-bottom: 12px;
    }
}

/* ============================================================
   TABLAS Y MODALES COMPARTIDOS
   ============================================================ */

.cm-table img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cm-table thead input,
.cm-table thead select {
    height: 26px !important;
    padding: 2px 4px !important;
    font-size: 0.70rem !important;
    line-height: 1 !important;
}

.cm-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.cm-table tbody tr:hover {
    background-color: #f1f5ff !important;
    cursor: pointer;
}

.cm-table .btn-select {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
}

/* ============================================================
   CALENDARIO DE DISPONIBILIDAD (PREMIUM)
   ============================================================ */

.calendar-container {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eef0f3;
}

.calendar-header span {
    font-size: 1rem;
    color: #333;
}

.grid-7 {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-weekdays div {
    font-size: 0.8rem;
    padding: 6px 0;
}

.calendar-days div {
    font-size: 0.85rem;
    padding: 10px 0;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    background: #fafafa;
    border: 1px solid transparent;
    user-select: none;
}

/* Día vacío (relleno de inicio de mes) */
.calendar-days div.empty-day {
    background: transparent !important;
    cursor: default !important;
    border: none !important;
}

/* Día no laborable (el doctor no trabaja) */
.calendar-days div.non-working-day {
    background: #f1f3f5 !important;
    color: #adb5bd !important;
    cursor: not-allowed !important;
}

/* Día laborable con horas disponibles */
.calendar-days div.available-day {
    background: #e3f2fd !important;
    color: #0d6efd !important;
    border: 1px solid #bbdefb !important;
}

.calendar-days div.available-day:hover {
    background: #0d6efd !important;
    color: #ffffff !important;
    transform: scale(1.05);
}

/* Día bloqueado o reservado completo */
.calendar-days div.busy-day {
    background: #fde8e8 !important;
    color: #f8b4b4 !important;
    border: 1px solid #fbd5d5 !important;
    cursor: not-allowed !important;
}

/* Día con ausencia / bloqueo configurado del doctor */
.calendar-days div.absence-day {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba !important;
    cursor: not-allowed !important;
}

.calendar-days div.absence-day:hover {
    background: #ffeeba !important;
    transform: scale(1.05);
}

/* Día disponible con ausencia parcial */
.calendar-days div.available-day.partial-absence-day {
    background: #e3f2fd !important;
    color: #0d6efd !important;
    border: 2px dashed #ffc107 !important;
}

.calendar-days div.available-day.partial-absence-day:hover {
    background: #0d6efd !important;
    color: #ffffff !important;
    transform: scale(1.05);
}

/* Día seleccionado */
.calendar-days div.selected-day {
    background: #0d6efd !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Panel de horas disponibles */
.hours-container {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eef0f3;
}

/* Píldoras de horas */
.hour-pill {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    min-width: 70px;
    user-select: none;
}

.hour-pill:hover {
    background: #6f42c1;
    color: #ffffff;
    border-color: #6f42c1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(111, 66, 193, 0.2);
}

.hour-pill.selected-hour {
    background: #6f42c1 !important;
    color: #ffffff !important;
    border-color: #6f42c1 !important;
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}

.hour-pill.booked-hour {
    background-color: #f8d7da !important;
    color: #842029 !important;
    border-color: #f5c2c7 !important;
    cursor: not-allowed !important;
    opacity: 0.85;
}

.hour-pill.booked-hour:hover {
    background-color: #f5c2c7 !important;
    color: #842029 !important;
    border-color: #f1aeb5 !important;
}

/* ===== Modal Buscar Cita Médica (Fotos) ===== */
#modalSearchAppointment table td img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   REPORTE DE AGENDA (MEDIC REPORTS)
   ============================================================ */

.report-body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.report-body .report-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 30px auto;
    padding: 40px;
    max-width: 900px;
    border-top: 5px solid #0d6efd;
}

.report-body .clinic-header {
    border-bottom: 2px solid #eef2f5;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.report-body .clinic-title {
    font-weight: 800;
    color: #0d6efd;
    letter-spacing: 1px;
    font-size: 1.6rem;
    text-transform: uppercase;
}

.report-body .meta-label {
    font-weight: 700;
    color: #555;
    min-width: 100px;
    display: inline-block;
}

.report-body .doctor-avatar-wrap img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #0d6efd;
}

.report-body .table-appointments {
    margin-top: 25px;
}

.report-body .table-appointments th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #cbd5e1;
}

.report-body .table-appointments td {
    vertical-align: middle;
    font-size: 0.9rem;
    color: #334155;
    padding: 12px 8px;
}

.report-body .badge-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Barra de control flotante */
.report-body .control-bar {
    background-color: #334155;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Reglas de impresión */
@media print {
    .report-body {
        background-color: #ffffff !important;
    }

    .report-body .control-bar {
        display: none !important;
    }

    .report-body .report-card {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-top: none !important;
        max-width: 100% !important;
    }

    /* Forzar salto de página adecuado y mantener colores */
    .report-body tr {
        page-break-inside: avoid !important;
    }

    .report-body thead {
        display: table-header-group !important;
    }
}