.calendario-wrapper {
    display: flex;
    align-items: stretch;
    padding: 0;
    gap: 10px;
    background: #000;
    max-width: 100%;
    height: 90vh; /* altura fija */
    overflow: hidden; /* evita que el contenido empuje */
}

.calendario-principal {
    flex: 1;
    background: #222222;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    overflow: hidden; /* evita desbordamientos */
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.calendario-principal::-webkit-scrollbar {
    width: 8px; /* Ancho del scroll */
}

.calendario-principal::-webkit-scrollbar-track {
    background: #1a1a1a; /* Fondo del "canal" */
}

.calendario-principal::-webkit-scrollbar-thumb {
    background-color: #555; /* Color del scroll */
    border-radius: 4px;
    border: 2px solid #1a1a1a; /* Borde opcional para efecto "acolchado" */
}

.calendario-principal::-webkit-scrollbar-thumb:hover {
    background-color: #888; /* Color al pasar el mouse */
}

.calendario-sidebar {
    width: 240px;
    background: #222222;
    padding: 30px 20px;
    border-left: 1px solid #333;
    box-sizing: border-box;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    overflow-y: auto; /* scroll si hay muchos eventos */
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.calendario-sidebar::-webkit-scrollbar {
    width: 8px; /* Ancho del scroll */
}

.calendario-sidebar::-webkit-scrollbar-track {
    background: #1a1a1a; /* Fondo del "canal" */
}

.calendario-sidebar::-webkit-scrollbar-thumb {
    background-color: #555; /* Color del scroll */
    border-radius: 4px;
    border: 2px solid #1a1a1a; /* Borde opcional para efecto "acolchado" */
}

.calendario-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #888; /* Color al pasar el mouse */
}



.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 1em;
}

.calendario-header h2 {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0;
    text-transform: capitalize;
}

.calendario-controles {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.view-toggles {
    display: flex;
    background: #333;
    border-radius: 25px;
    padding: 4px;
    gap: 5px;
}

.btn-toggle {
    padding: 0.5em 1em;
    background: transparent;
    color: #999;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-toggle.active {
    background: #6366f1;
    color: white;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.mes-anterior,
.mes-siguiente {
    width: 40px;
    height: 40px;
    background: transparent;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.mes-anterior:hover,
.mes-siguiente:hover {
    transform: scale(1.03);
    background: #333;
    border-color: #666;
}

.calendario-diasemana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 5px;
}

.diasemana {
    text-align: left;
    padding: 1em;
    color: #666;
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendario-grid {
    display: grid;
    padding: 5px;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(80px, 1fr); /* altura flexible */
    background: #2a2a2a;
    flex: 1;
    overflow-y: auto; /* scroll interno */
    box-shadow: 10px 10px 20px 0px rgba(0, 0, 0, 0.4);
}

.calendario-dia {
    background: #1a1a1a;
    padding: 0.5em;
    border-bottom: 1px solid #2a2a2a;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto; /* scroll si hay muchos eventos */
    position: relative;
}

.calendario-dia:hover {
    background: #222;
}

.dia-numero {
    color: #ffffff;
    font-weight: 400;
    font-size: 10px;
    margin-bottom: 0.5em;
}

.dia-mes-anterior,
.dia-mes-siguiente {
    color: #555;
}

.calendario-evento {
    border-radius: 15px;
    padding: 5px;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
    white-space: normal;
    line-height: 1.2em;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.calendario-evento:hover {
    transform: scale(1.03);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.calendario-evento a {
    color: white;
    text-decoration: none;
    display: block;
    text-align: center;
}

/* Colores específicos */
.evento-purple { background: #6256AB; }
.evento-cyan { background: #04AEC7; }
.evento-pink { background: #ec4899; }
.evento-orange { background: #F19332; }
.evento-green { background: #A8CF45; }

/* Sidebar */
.evento-sidebar {
    width: 180px;
    height: 120px;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.evento-sidebar:hover {
    background: #222;
}

/* Encabezado = número + tipo en fila */
.evento-encabezado {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

/* Número */
.evento-numero {
    background: rgba(255, 255, 255, 0.2); /* opcional */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Tipo */
.evento-tipo {
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 16px;
    text-transform: uppercase;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Título  */
.evento-titulo {
    margin-top: 10px;
    color: white;
    font-size: 0.7rem;
    line-height: 1.2em;
    overflow: hidden;
    max-height: 3.6em; /* 3 líneas */
    text-overflow: ellipsis;
}



.evento-sidebar:hover .evento-tipo {
    color: #bbb;
}

/* Responsive */
@media screen and (max-width: 1200px) {
    .calendario-wrapper {
        flex-direction: column;
        height: 100vh;
    }

    .calendario-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #333;
        height: 30vh;
    }

    .calendario-principal {
        flex: 1;
    }

    .calendario-grid {
        max-height: 60vh;
    }
}

@media screen and (max-width: 768px) {
    .calendario-principal {
        padding: 15px;
    }

    .calendario-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .calendario-header h2 {
        font-size: 2em;
    }

    .diasemana {
        padding: 10px 15px;
        font-size: 0.75em;
    }

    .evento-numero-sidebar {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
}
