/* =====================================
   CONTENEDOR GENERAL
===================================== */

.main,
.citas-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}


/* =====================================
   CABECERA
===================================== */

.citas-header {
    width: 100%;
    margin: 0 0 12px;
    text-align: center;
}

.citas-titulo {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    color: #1e293b;
}


/* =====================================
   FILTROS
===================================== */

.citas-header + form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 6px;
    margin: 0 0 15px;
    padding: 9px 10px;

    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}


/* =====================================
   CHIPS DE RANGO
===================================== */

.citas-header + form a {
    height: 34px;
    padding: 0 11px !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    white-space: nowrap;

    border: 1px solid transparent;

    font-size: 13px;
    font-weight: 600;

    transition: .2s ease;
}

.citas-header + form a:hover {
    transform: translateY(-1px);
    filter: brightness(.96);
}


/* =====================================
   SELECTORES
===================================== */

.citas-header + form select {
    height: 34px;
    min-width: 115px;

    padding: 0 8px !important;

    box-sizing: border-box;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    background: #f8fafc;
    color: #1e293b;

    font-family: inherit;
    font-size: 13px;

    outline: none;
    cursor: pointer;

    transition: .2s ease;
}

.citas-header + form select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}


/* =====================================
   FECHAS
===================================== */

.citas-header + form input[type="date"] {
    width: 135px;
    height: 34px;

    padding: 0 8px !important;

    box-sizing: border-box;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    background: #f8fafc;
    color: #1e293b;

    font-family: inherit;
    font-size: 13px;

    outline: none;

    transition: .2s ease;
}

.citas-header + form input[type="date"]:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}


/* =====================================
   BOTÓN FILTRAR
===================================== */

.citas-header + form button {
    height: 34px;

    padding: 0 12px !important;

    box-sizing: border-box;

    border: none;
    border-radius: 8px;

    background: #111827;
    color: #ffffff;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: .2s ease;
}

.citas-header + form button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}


/* =====================================
   GRID DE CITAS
===================================== */

.citas-grid {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    padding-bottom: 25px;
}


/* =====================================
   TARJETAS DE CITAS
===================================== */

.cita-item {
    position: relative;

    width: 100%;
    min-width: 0;
    min-height: 165px;

    box-sizing: border-box;

    padding: 18px 14px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;

    cursor: pointer;
    overflow: hidden;

    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fafc
        );

    border: 1px solid rgba(37,99,235,.10);

    box-shadow:
        0 6px 16px rgba(0,0,0,.06);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}


/* =====================================
   DECORACIÓN
===================================== */

.cita-item::before {
    content: "";

    position: absolute;

    width: 100px;
    height: 100px;

    top: -45px;
    right: -35px;

    border-radius: 50%;

    background: rgba(37,99,235,.07);

    transition: transform .3s ease;
}


/* =====================================
   HOVER TARJETA
===================================== */

.cita-item:hover {
    transform: translateY(-4px);

    border-color: rgba(37,99,235,.25);

    box-shadow:
        0 12px 25px rgba(0,0,0,.10);
}

.cita-item:hover::before {
    transform: scale(1.4);
}


/* =====================================
   CONTENIDO TARJETA
===================================== */

.cita-item > * {
    position: relative;
    z-index: 1;

    max-width: 100%;
}


/* =====================================
   NOMBRE CLIENTE
===================================== */

.cita-item h3 {
    width: 100%;

    margin: 0 0 8px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 16px;
    font-weight: 700;

    color: #1e293b;
}


/* =====================================
   FECHA Y HORA
===================================== */

.cita-item p {
    margin: 4px 0;

    font-size: 12px;
    line-height: 1.4;

    color: #64748b;
}


/* =====================================
   BOTÓN VER
===================================== */

.cita-ver {
    display: inline-block;

    margin-top: 9px;
    padding: 6px 10px;

    border-radius: 30px;

    color: #2563eb;
    background: rgba(37,99,235,.10);

    font-size: 11px;
    font-weight: 600;

    transition: .2s ease;
}

.cita-item:hover .cita-ver {
    color: #ffffff;
    background: #2563eb;
}


/* =====================================
   MODAL
===================================== */

.cita-modal {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 9999;

    padding: 15px;

    box-sizing: border-box;

    align-items: center;
    justify-content: center;

    background: rgba(15,23,42,.65);

    backdrop-filter: blur(6px);
}

.cita-modal.activo {
    display: flex;
}


/* =====================================
   CONTENIDO MODAL
===================================== */

.cita-modal-contenido {
    position: relative;

    width: 100%;
    max-width: 520px;
    max-height: 90vh;

    overflow-y: auto;

    box-sizing: border-box;

    padding: 22px;

    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 20px 50px rgba(0,0,0,.25);
}


/* =====================================
   TÍTULO MODAL
===================================== */

.cita-modal-contenido h2 {
    margin: 0 0 16px;

    padding-right: 30px;

    text-align: center;

    font-size: 20px;

    color: #1e293b;
}


/* =====================================
   BOTÓN CERRAR
===================================== */

.cita-modal-cerrar {
    position: absolute;

    top: 10px;
    right: 12px;

    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    background: #f1f5f9;
    color: #475569;

    font-size: 17px;

    cursor: pointer;

    transition: .2s ease;
}

.cita-modal-cerrar:hover {
    background: #ef4444;
    color: #ffffff;

    transform: rotate(90deg);
}


/* =====================================
   INFORMACIÓN MODAL
===================================== */

.cita-info p {
    margin: 7px 0;

    padding: 9px 10px;

    border-radius: 9px;

    background: #f8fafc;

    color: #475569;

    font-size: 13px;
}


/* =====================================
   ACCIONES MODAL
===================================== */

.cita-acciones {
    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    gap: 8px;

    margin-top: 18px;
}

.cita-acciones .btn {
    min-width: 130px;
}


/* =====================================
   TABLET
===================================== */

@media (max-width: 1100px) {

    .citas-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 12px;
    }

    .cita-item {
        min-height: 155px;
        padding: 16px 12px;
    }

    .citas-header + form {
        gap: 5px;
    }

    .citas-header + form select {
        min-width: 105px;
    }

    .citas-header + form input[type="date"] {
        width: 125px;
    }
}


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

@media (max-width: 768px) {

    .citas-titulo {
        font-size: 20px;
    }


    /* FILTROS EN 2 COLUMNAS */

    .citas-header + form {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 6px;

        padding: 8px;
    }

    .citas-header + form a,
    .citas-header + form select,
    .citas-header + form input[type="date"],
    .citas-header + form button {

        width: 100%;
        min-width: 0;

        box-sizing: border-box;
    }


    /* GRID DE CITAS */

    .citas-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }


    /* TARJETAS */

    .cita-item {
        min-height: 140px;

        padding: 12px 8px;

        border-radius: 13px;
    }

    .cita-item h3 {
        font-size: 13px;
    }

    .cita-item p {
        font-size: 10px;
    }

    .cita-ver {
        margin-top: 6px;

        padding: 5px 7px;

        font-size: 9px;
    }


    /* MODAL */

    .cita-modal-contenido {
        padding: 18px 14px;
        border-radius: 15px;
    }

    .cita-modal-contenido h2 {
        font-size: 18px;
    }

    .cita-info p {
        font-size: 12px;
    }

    .cita-acciones {
        flex-direction: column;
    }

    .cita-acciones .btn {
        width: 100%;
        min-width: 0;
    }
}


/* =====================================
   MÓVIL PEQUEÑO
===================================== */

@media (max-width: 480px) {

    .citas-grid {
        grid-template-columns: 1fr;
    }

    .cita-item {
        min-height: 135px;
    }
}