/**
 * Archivo: assets/css/citas_v7.css
 * Módulo: Citas
 * Proyecto: GestorTech / ClínicaSonrisas
 * Versión: 8.2 Limpieza y estructura completa
 *
 * Descripción:
 * Estilos específicos de Citas V7/V8.
 */

/*
 * citas_v7.css
 * ------------
 * Ajustes para Citas de hoy y Citas generales.
 */

.days-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 0 34px 20px;
}

.day-pill {
    border: 0;
    border-radius: 12px;
    padding: 14px 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 8px 18px rgba(15,23,42,.08);
}

.day-pill small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
}

.day-pill.selected {
    outline: 4px solid rgba(7,87,216,.22);
    transform: translateY(-1px);
}

.day-1 { background: #0757d8; }
.day-2 { background: #0ea5e9; }
.day-3 { background: #14b8a6; }
.day-4 { background: #22c55e; }
.day-5 { background: #f59e0b; }
.day-6 { background: #a855f7; }

.state-pendiente {
    color: #b91c1c !important;
    border-color: #fecaca !important;
    background: #fff7f7 !important;
}

.state-presente {
    color: #15803d !important;
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
}

.state-proximo {
    color: #fff !important;
    border-color: #0757d8 !important;
    background: #0757d8 !important;
}

.state-atendido {
    color: #166534 !important;
    border-color: #86efac !important;
    background: #dcfce7 !important;
}

.estado.pendiente {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.estado.presente {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.estado.proximo {
    background: #dbeafe !important;
    color: #0757d8 !important;
}

.estado.atendido {
    background: #bbf7d0 !important;
    color: #166534 !important;
}

.quick-card-v7 button {
    border: 0;
    border-radius: 10px;
    width: 100%;
    padding: 16px 18px;
    margin-top: 12px;
    text-align: left;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.35;
}

.quick-red { background: #dc2626; }
.quick-green { background: #0b8f38; }
.quick-blue { background: #0757d8; }
.quick-purple { background: #6d38c7; }

.txt-red { color:#dc2626; }
.txt-green { color:#15803d; }
.txt-blue { color:#0757d8; }

.row-menu-v7,
.cg-menu-compact {
    max-height: 430px;
    overflow-y: auto;
}

.row-menu .item-pendiente,
.cg-menu .item-pendiente { color:#b91c1c; }

.row-menu .item-presente,
.cg-menu .item-presente { color:#15803d; }

.row-menu .item-proximo,
.cg-menu .item-proximo { color:#0757d8; }

.row-menu .item-atendido,
.cg-menu .item-atendido { color:#166534; }

.cg-menu-sep {
    height: 1px;
    background: #e5ebf5;
    margin: 5px 0;
}

/* Citas generales */
.cg-general-layout {
    display: grid;
    grid-template-columns: 1fr 365px;
    gap: 26px;
    padding: 0 34px 42px;
}

.cg-toolbar {
    align-items: center;
}

.cg-toolbar input[type="date"] {
    max-width: 150px;
}

.cg-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.citas-generales-actions {
    min-width: 230px;
    position: relative;
}

.cg-action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cg-menu-wrap {
    position: relative;
    display: inline-block;
}

.cg-dots {
    width: 38px;
    height: 38px;
    border: 1px solid #dbe7fb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.cg-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 42px;
    width: 230px;
    background: #fff;
    border: 1px solid #e5ebf5;
    border-radius: 13px;
    box-shadow: 0 18px 45px rgba(15,23,42,.16);
    z-index: 80;
    overflow: hidden;
}

.cg-menu.open {
    display: block;
}

.cg-menu button {
    display: block;
    width: 100%;
    border: 0;
    background: #fff;
    text-align: left;
    padding: 11px 14px;
    cursor: pointer;
    font-weight: 800;
    color: #071847;
}

.cg-menu button:hover {
    background: #eff6ff;
}

.cg-menu button.danger {
    color: #b91c1c;
}

.cg-menu button.muted {
    color: #64748b;
}

.cg-detail-small {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 13px;
}

.row-anulada {
    opacity: .62;
}

.row-anulada td {
    background: #fff7f7;
}

/* Modal Citas generales */
.cg-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.cg-modal.open {
    display: flex;
}

.cg-modal-card {
    width: min(720px, 96vw);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(15,23,42,.25);
    overflow: hidden;
}

.cg-modal-head {
    display: flex;
    justify-content: space-between;
    padding: 22px;
    border-bottom: 1px solid #e5ebf5;
}

.cg-modal-head h3 {
    margin: 0 0 5px;
    font-size: 25px;
}

.cg-modal-head p {
    margin: 0;
    color: #667085;
}

.cg-modal-body {
    padding: 22px;
}

.cg-modal-body textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    font-family: Arial, Helvetica, sans-serif;
}

.cg-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.cg-modal-grid input {
    width: 100%;
    margin-top: 6px;
}

/* Calendario inicial */
.cg-calendar-card {
    padding: 18px;
}

.cg-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cg-calendar-head h3 {
    margin: 0;
    font-size: 18px;
    text-transform: capitalize;
}

.cg-calendar-week,
.cg-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cg-calendar-week {
    margin-top: 14px;
    color: #667085;
    font-weight: 900;
    text-align: center;
    font-size: 12px;
}

.cg-calendar-grid {
    margin-top: 8px;
}

.cg-calendar-day {
    min-height: 48px;
    border: 1px solid #e5ebf5;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    color: #071847;
}

.cg-calendar-day b {
    display: block;
    font-size: 15px;
}

.cg-calendar-day small {
    display: block;
    color: #667085;
    margin-top: 2px;
}

.cg-calendar-day.has-citas {
    border-color: #0757d8;
    background: #eff6ff;
}

.cg-calendar-day.today {
    outline: 3px solid rgba(7,87,216,.22);
}

.cg-calendar-day.empty {
    border: 0;
    background: transparent;
    cursor: default;
}

.cg-note {
    color: #667085;
    font-size: 13px;
    line-height: 1.4;
}

/* Observaciones grande */
.modal-grid .wide-field {
    grid-column: 1 / -1;
}

.modal-grid textarea,
#observaciones {
    width: 100%;
    min-height: 115px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    font-family: Arial, Helvetica, sans-serif;
}

@media(max-width: 1200px) {
    .days-row {
        grid-template-columns: repeat(2, 1fr);
        padding-left: 16px;
        padding-right: 16px;
    }

    .cg-general-layout {
        grid-template-columns: 1fr;
        padding-left: 16px;
        padding-right: 16px;
    }

    .cg-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cg-toolbar input,
    .cg-toolbar select,
    .cg-toolbar button {
        width: 100%;
        max-width: none;
    }

    .cg-modal-grid {
        grid-template-columns: 1fr;
    }
}
