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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #f1f5f9;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */

.sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Scrollbar discreto para el menú lateral */
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 20px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #475569; }

.logo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
}

.sidebar button {
    border: none;
    background: #1e293b;
    color: white;
    padding: 15px;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 15px;
}

.sidebar button:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.sidebar button.sidebar-active {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* MAIN */

.main {
    flex: 1;
    padding: 25px;
    overflow: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.topbar h1 {
    font-size: 28px;
    color: #0f172a;
}

.btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.3s;
}

.btn:hover {
    background: #1d4ed8;
}

/* CALENDARIO */

#calendar {
    background: white;
    padding: 20px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.modal-content {
    background: white;
    width: 400px;
    max-width: 90%;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modal 0.3s ease;
}

@keyframes modal {

    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }

}

.modal-content h2 {
    margin-bottom: 20px;
    color: #0f172a;
}

.input {
    width: 100%;
    padding: 15px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    margin-bottom: 15px;
    outline: none;
    font-size: 14px;
}

.input:focus {
    border-color: #2563eb;
}

/* PACIENTE CARD */

.card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.actions a {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: white;
}

.call {
    background: #dc2626;
}

.whatsapp {
    background: #16a34a;
}

.fc {
    background: white;
    border-radius: 20px;
    padding: 10px;
}

.fc-toolbar-title {
    font-size: 24px;
    font-weight: 600;
}

.fc-button {
    background: #2563eb !important;
    border: none !important;
    border-radius: 10px !important;
}

#calendar {

    width: 100%;

    height: 700px;

    background: white;

    padding: 20px;

    border-radius: 20px;

    margin-top: 20px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

}

.cerrar {

    float: right;

    border: none;

    background: none;

    font-size: 20px;

    cursor: pointer;

}

.btnEliminar {

    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;

}

.btnEliminar:hover {

    background: #b91c1c;

}

.listaPacientes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

/* ===== Pacientes — barra de controles (orden / filtros) ===== */

.px-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.px-select {
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    background: white;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.px-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.px-controlsSep {
    width: 1px;
    align-self: stretch;
    background: #e2e8f0;
    margin: 2px 4px;
}

.px-chip {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.px-chip:hover {
    background: #f1f5f9;
}
.px-chip.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* ===== Pacientes — fila compacta ===== */

.px-row {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 8px 10px 8px 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.px-row:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    border-color: #e2e8f0;
}

.px-rowBody {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.px-rowInfo {
    flex: 1;
    min-width: 0;
}

.px-rowNombre {
    margin: 0 0 2px 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.px-rowMeta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.px-rowMeta span {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.px-rowChevron {
    font-size: 18px;
    color: #cbd5e1;
}

.px-rowActions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
    margin-left: 4px;
    border-left: 1px solid #f1f5f9;
}

.px-iconBtn {
    border: none;
    background: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.px-iconBtn.px-edit:hover { background: #eff6ff; }
.px-iconBtn.px-wa:hover   { background: #f0fdf4; }
.px-iconBtn.px-del:hover  { background: #fef2f2; }

/* ===== Pacientes — encabezado de grupo alfabético ===== */

.px-groupHeader {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 4px 2px 6px;
}

/* ===== Ficha del paciente — datos ===== */

.ficha-dato {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: white;
    border-radius: 10px;
    padding: 10px 14px;
}
.ficha-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ficha-valor {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* ===== Pacientes — header, badge, búsqueda ===== */

.px-badge {
    background: #eff6ff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

.px-searchWrap {
    position: relative;
    margin-top: 6px;
}

.px-searchIcon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    opacity: 0.6;
}

.px-searchWrap input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    background: white;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.px-searchWrap input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cardPaciente h3 {
    margin: 0;
    font-size: 16px;
}

.cardPaciente {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: white;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    gap: 20px;
}

.cardPaciente>div:first-child {
    display: flex;
    flex-direction: column;
}

.cardPaciente .acciones {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Separación entre tarjetas de la lista de servicios */
#listaServicios {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================= */
/* TARJETAS PACIENTES (nueva) */
/* ========================= */

.cardPx {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.2s;
    margin-bottom: 10px;
}
.cardPx:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.1); }

.cardPx-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
}

.cardPx-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.cardPx-info {
    flex: 1;
    min-width: 0;
}

.cardPx-nombre {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cardPx-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cardPx-tags span {
    font-size: 12px;
    color: #64748b;
}

.cardPx-arrow {
    font-size: 22px;
    color: #cbd5e1;
    flex-shrink: 0;
}

.cardPx-actions {
    display: flex;
    border-top: 1px solid #f1f5f9;
}

.cardPx-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}
.cardPx-btn + .cardPx-btn { border-left: 1px solid #f1f5f9; }
.cardPx-btn-edit  { color: #2563eb; }
.cardPx-btn-edit:hover  { background: #eff6ff; }
.cardPx-btn-wa    { color: #16a34a; }
.cardPx-btn-wa:hover    { background: #f0fdf4; }
.cardPx-btn-del   { color: #dc2626; }
.cardPx-btn-del:hover   { background: #fef2f2; }

#resultadoPacientes{
    background:white;
    border-radius:10px;
    overflow:hidden;
    margin-top:-10px;
    margin-bottom:15px;
    box-shadow:0 5px 15px rgba(0,0,0,0.08);
}

.itemPacienteBusqueda{
    padding:12px;
    cursor:pointer;
    border-bottom:1px solid #eee;
    transition:0.2s;
}

.itemPacienteBusqueda:hover{
    background:#eff6ff;
}
#resultadoPacientes{

    max-height: 250px;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 10px;

    margin-top: 10px;
}
.itemPacienteBusqueda{

    padding: 12px;
    border-radius: 10px;
    background: #f1f5f9;

    cursor: pointer;

    transition: 0.2s;
}

.itemPacienteBusqueda:hover{

    background: #dbeafe;
}
#historialPaciente{

    max-height: 400px;
    overflow-y: auto;

    padding-right: 10px;

}

#historialPaciente::-webkit-scrollbar,
#resultadoPacientes::-webkit-scrollbar{

    width: 8px;

}

#historialPaciente::-webkit-scrollbar-thumb,
#resultadoPacientes::-webkit-scrollbar-thumb{

    background: #94a3b8;
    border-radius: 10px;

}
#listaPacientes{

    max-height: 80vh;
    overflow-y: auto;

    padding-right: 10px;

    display:flex;
    flex-direction:column;
    gap:8px;

}
#historialPaciente{

    max-height: 400px;
    overflow-y: auto;

    padding-right: 10px;

}
#listaPacientes::-webkit-scrollbar,
#historialPaciente::-webkit-scrollbar,
#resultadoPacientes::-webkit-scrollbar{

    width: 8px;

}

#listaPacientes::-webkit-scrollbar-thumb,
#historialPaciente::-webkit-scrollbar-thumb,
#resultadoPacientes::-webkit-scrollbar-thumb{

    background:#94a3b8;
    border-radius:10px;

}
.cardDia{

    background:#f8fafc;
    padding:15px;
    border-radius:15px;
    margin-bottom:15px;
    border:1px solid #e2e8f0;

}

.cardDia h3{

    color:#2563eb;
    margin-bottom:10px;

}

.cardDia p{

    margin-top:5px;
    font-size:14px;

}.accionesEstado{

    display:flex;
    gap:10px;
    margin-top:15px;

}

.btnAsistio{

    background:#22c55e;
    color:white;
    border:none;
    padding:8px 12px;
    border-radius:10px;
    cursor:pointer;

}

.btnNoAsistio{

    background:#ef4444;
    color:white;
    border:none;
    padding:8px 12px;
    border-radius:10px;
    cursor:pointer;

}

.estadoTexto{

    font-weight:bold;

}

.estadoTexto.Asistió{

    color:#22c55e;

}

.estadoTexto.No{

    color:#ef4444;

}

.estadoTexto.Pendiente{

    color:#f59e0b;

}
.estadoTexto.Asistió{
    color:green;
    font-weight:bold;
}

.estadoTexto.No\ asistió{
    color:red;
    font-weight:bold;
}

.estadoTexto.Pendiente{
    color:orange;
    font-weight:bold;
}
#servicioCita{

    width: 100%;

    padding: 14px;

    border-radius: 12px;

    border: 1px solid #dbe2ea;

    background: white;

    font-size: 15px;

    margin-top: 12px;

    outline: none;

    transition: 0.2s;

    color: #1e293b;

    cursor: pointer;

}

#servicioCita:focus{

    border-color: #2563eb;

    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);

}
#servicioCita{

    width:100%;

    height:60px;

    padding:0 18px;

    border:1px solid #dbeafe;

    border-radius:18px;

    background:white;

    font-size:16px;

    color:#334155;

    outline:none;

    margin-top:12px;

    appearance:none;

    cursor:pointer;

    transition:0.2s;

    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    background-repeat:no-repeat;

    background-position:right 18px center;

    background-size:18px;

}

#servicioCita:focus{

    border-color:#2563eb;

    box-shadow:0 0 0 4px rgba(37,99,235,0.12);

}
.input{

    width:100%;

    height:60px;

    border-radius:18px;

    padding:0 18px;

    border:1px solid #dbeafe;

    outline:none;

    font-size:16px;

    margin-top:12px;

    box-sizing:border-box;

}

textarea.input{

    height:120px;

    padding-top:16px;

}

#contenido{

    flex:1;

    display:flex;

    flex-direction:column;

    width:100%;

    height:100vh;

    overflow:hidden;

}

#contenedorAgenda{
    position:relative;
    z-index:1;
}
.listaPacienteDia{
    cursor:pointer;
    position:relative;
    z-index:30;
}
.listaPacienteDia{
    background:red;
    padding:20px;
    margin-bottom:10px;
    cursor:pointer;
    position:relative;
    z-index:9999;
}
#listaPacientesDia{
    position:relative;
    z-index:9999;
}
.cardDia{
    cursor:pointer;
    position:relative;
    z-index:9999;
}

/* ========================= */
/* VISTA CUENTAS             */
/* ========================= */

#cuentasVista {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    padding: 30px;
    background: #f1f5f9;
    padding-bottom: 60px;
    box-sizing: border-box;
}

#cuentasVista::-webkit-scrollbar { width: 8px; }
#cuentasVista::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 20px; }
#cuentasVista::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 20px; }
#cuentasVista::-webkit-scrollbar-thumb:hover { background: #64748b; }


/* ========================= */
/* HEADER CUENTAS            */
/* ========================= */

.cuentasHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.cuentasTitulo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cuentasTitulo h1 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
}

.labelPeriodo {
    background: #dbeafe;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.cuentasHeaderRight {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Filtro período */
.filtroPeriodoWrap {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.btnPeriodo {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: .2s;
}

.btnPeriodo.active {
    background: #2563eb;
    color: white;
}

.btnPeriodo:hover:not(.active) {
    background: #f1f5f9;
}

.btnCierre {
    background: #0f172a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: .2s;
}

.btnCierre:hover { background: #1e293b; }


/* ========================= */
/* TARJETAS RESUMEN          */
/* ========================= */

.topCaja {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.cardCaja {
    background: white;
    padding: 22px 24px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: .2s;
}

.cardCaja:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }

.cardCajaIcon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.cardIngresos .cardCajaIcon { background: #dcfce7; color: #16a34a; }
.cardGastos   .cardCajaIcon { background: #fee2e2; color: #dc2626; }
.cardUtilidad .cardCajaIcon { background: #dbeafe; color: #2563eb; }
.cardPendientes .cardCajaIcon { background: #fef9c3; color: #ca8a04; }

.cardCajaLabel {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 4px;
}

.cardCaja h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}


/* ========================= */
/* METODOS DE PAGO           */
/* ========================= */

.metodosPagoWrap {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.cardMetodo {
    background: white;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    min-width: 160px;
}

.metodoIcono {
    font-size: 22px;
}

.metodoNombre {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.metodoValor {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}


/* ========================= */
/* TABS                      */
/* ========================= */

.tabsCaja {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: 14px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.tabCaja {
    border: none;
    background: transparent;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: .2s;
}

.tabCaja.active {
    background: #2563eb;
    color: white;
}

.tabCaja:hover:not(.active) {
    background: #f1f5f9;
}


/* ========================= */
/* CONTENIDO TABS            */
/* ========================= */

.tabContenido { animation: fadeIn .2s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.seccionCaja {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}

.headerCaja {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.headerCaja h2 {
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.badgeContador {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.badgeVerde { background: #dcfce7; color: #16a34a; }
.badgeRojo  { background: #fee2e2; color: #dc2626; }


/* ========================= */
/* FORMULARIO GASTOS         */
/* ========================= */

.formCaja {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.inputCaja {
    flex: 1;
    min-width: 180px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    outline: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: .2s;
}

.inputCaja:focus { border-color: #2563eb; }

.btnGuardarCaja {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: .2s;
    white-space: nowrap;
}

.btnGuardarCaja:hover { background: #1d4ed8; }


/* ========================= */
/* TABLAS                    */
/* ========================= */

.tablaResponsive { overflow-x: auto; }

.tablaCaja {
    width: 100%;
    border-collapse: collapse;
}

.tablaCaja thead tr {
    background: #f8fafc;
}

.tablaCaja th {
    padding: 13px 15px;
    text-align: left;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.tablaCaja td {
    padding: 14px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}

.tablaCaja tbody tr:hover { background: #f8fafc; }

.tablaCaja tbody tr:last-child td { border-bottom: none; }

.tdVacio {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 40px !important;
}

/* Barra de progreso pago */
.barraProgreso {
    background: #e2e8f0;
    border-radius: 20px;
    height: 6px;
    width: 100px;
    margin-bottom: 4px;
}

.barraProgresoFill {
    background: #16a34a;
    border-radius: 20px;
    height: 6px;
    transition: .4s;
}

/* Badges estado */
.badgePagado {
    background: #dcfce7;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.badgePendiente {
    background: #fef9c3;
    color: #ca8a04;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Botones tabla */
.btnAbonar {
    background: #2563eb;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
}

.btnAbonar:hover { background: #1d4ed8; }

.btnEliminarChico {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: .2s;
}

.btnEliminarChico:hover { background: #fecaca; }


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

#modalAbono .modal-content { width: 420px; }

#modalAbono h2 { margin-bottom: 20px; color: #0f172a; }

#modalAbono select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
    margin-bottom: 20px;
    outline: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

#modalAbono select:focus { border-color: #2563eb; }


/* ========================= */
/* RESPONSIVE                */
/* ========================= */

@media (max-width: 900px) {
    .topCaja { grid-template-columns: 1fr 1fr; }
    .cuentasHeader { flex-direction: column; align-items: flex-start; }
    .tabsCaja { gap: 6px; }
}

@media (max-width: 600px) {
    .topCaja { grid-template-columns: 1fr; }
    #cuentasVista { padding: 15px; }
    .tabCaja { padding: 9px 14px; font-size: 13px; }
}

/* ========================= */
/* INVENTARIO */
/* ========================= */

#inventarioVista,
#reportesVista,
#notificacionesVista {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 30px;
    background: #f1f5f9;
    box-sizing: border-box;
    z-index: 10;
}

/* Barra de búsqueda inventario */
#buscarInventario {
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    outline: none;
    box-sizing: border-box;
}
#buscarInventario:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Filtros de stock */
.filtrosInventario {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.filtrosInventario .btnFiltro {
    padding: 7px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
    color: #334155;
}
.filtrosInventario .btnFiltro.active,
.filtrosInventario .btnFiltro:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

#listaInventario {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#listaInventario .cardPaciente {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
}

#listaInventario .cardPaciente:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#listaInventario .cardPaciente h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1e293b;
    font-weight: 600;
}

#listaInventario .cardPaciente p {
    margin: 3px 0;
    font-size: 13px;
    color: #64748b;
}

/* ========================= */
/* AJUSTES                   */
/* ========================= */

#ajustesVista {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 30px;
    background: #f1f5f9;
    box-sizing: border-box;
    z-index: 10;
}

/* ========================= */
/* PRESUPUESTOS              */
/* ========================= */

#presupuestosVista {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 30px;
    background: #f1f5f9;
    box-sizing: border-box;
    z-index: 10;
}
#modalPresupuesto .modal-content {
    max-height: 92vh;
    overflow-y: auto;
}

/* ========================= */
/* ASISTENTE IA              */
/* ========================= */

#asistenteVista {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    background: #f1f5f9;
    box-sizing: border-box;
    z-index: 10;
    padding: 24px;
}

.ia-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 820px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    overflow: hidden;
}

.ia-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.ia-banner {
    font-size: 12px;
    font-weight: 600;
}
.ia-banner.on  { color: #16a34a; }
.ia-banner.off { color: #dc2626; }

.ia-mensajes {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.ia-msg {
    max-width: 78%;
    padding: 11px 15px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.ia-msg.ia-user {
    align-self: flex-end;
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}
.ia-msg.ia-bot {
    align-self: flex-start;
    background: white;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}
.ia-msg.ia-typing {
    color: #94a3b8;
    font-style: italic;
}

.ia-inputbar {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #f1f5f9;
}
.ia-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.ia-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.ia-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

/* Switch del toggle de IA en Ajustes */
.ia-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.ia-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.ia-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: background 0.2s;
}
.ia-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.ia-switch input:checked + .ia-slider {
    background: #16a34a;
}
.ia-switch input:checked + .ia-slider::before {
    transform: translateX(20px);
}

/* ========================= */
/* HISTORIA CLÍNICA          */
/* ========================= */

.hc-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin: 10px 0 4px 0;
}

.hc-textarea {
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hc-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

#modalHistoriaClinica .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* ========================= */
/* DASHBOARD / INICIO        */
/* ========================= */

#dashboardVista { padding: 0 4px; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 8px 0 22px 0;
}

.dash-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.15s, transform 0.15s;
}
.dash-kpi:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.dash-kpi-ico {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.dash-kpi-val {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-kpi-lbl {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.dash-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}
@media (max-width: 900px) {
    .dash-charts { grid-template-columns: 1fr; }
}

.dash-canvas-wrap {
    position: relative;
    height: 240px;
}

.dash-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding-bottom: 30px;
}

.dash-panel {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dash-panel h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #0f172a;
}

.dash-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}
.dash-row:last-child { border-bottom: none; }
.dash-row-main {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-empty {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 18px 0;
    margin: 0;
}

/* Próximas citas: scroll con tope de ~5 filas visibles */
#dashProximas {
    max-height: 215px;
    overflow-y: auto;
}

/* ========================= */
/* MODAL CONFIRMACIÓN        */
/* ========================= */

.btnConfirmCancel {
    flex: 1;
    padding: 11px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}
.btnConfirmCancel:hover { background: #f8fafc; }

.btnConfirmOk {
    flex: 1;
    padding: 11px;
    border: none;
    background: #dc2626;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: filter 0.15s;
}
.btnConfirmOk:hover { filter: brightness(0.92); }

