:root {
    --sidebar-width: 260px;
    --menu-bg-color: #185766;
    --menu-hover-color: #1c6d80;
    --menu-selected-color: #218ba3;
    --menu-text-color: #ffffff;
    --transition-speed: 0.3s;
}

html,body {
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    margin: 0;
}

/* --- Estructura --- */
#wrapper {
    display: flex;
    min-height: calc(100vh - 72px); /* altura real bajo el header */
}

#sidebar-wrapper {
    width: var(--sidebar-width);
    background-color: var(--menu-bg-color) !important;
    transition: margin-left var(--transition-speed) ease;
    z-index: 1000;

    display: flex;
    flex-direction: column;

    box-sizing: border-box;
}

#sidebar-wrapper .RadPanelBar {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-footer {
    padding: 16px;
    margin-top: auto; /* CLAVE: lo empuja abajo correctamente */
    border-top: 1px solid rgba(255,255,255,0.15);
    background-color: var(--menu-bg-color);
}

#page-content-wrapper {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* Lógica de ocultar menú */
#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(var(--sidebar-width) * -1);
}

/* --- Encabezado --- */
.gov-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 10px 30px;
}

.gov-entity { font-weight: 700; font-size: 1.1rem; color: #333; }
.gov-area { font-size: 0.95rem; color: #666; }
.gov-program { font-size: 0.85rem; color: var(--menu-bg-color); font-weight: 600; }

/* --- Telerik RadPanelBar Customization --- */
/* Fondo general */
.RadPanelBar_BlackMetroTouch {
    background: transparent !important;
    border: none !important;
}

/* Ajuste de enlaces */
.RadPanelBar_BlackMetroTouch .rpLink,
.RadPanelBar_BlackMetroTouch .rpHeader {
    background-color: #185766 !important; /* El color solicitado */
    color: #ffffff !important;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 10px 15px !important;
    cursor: pointer !important;
}

.RadPanelBar_BlackMetroTouch .rpText {
    color: var(--menu-text-color) !important;
    font-size: 14px !important;
}

/* Estados */
.RadPanelBar_BlackMetroTouch .rpLink:hover {
    background-color: var(--menu-hover-color) !important;
}

.RadPanelBar_BlackMetroTouch .rpSelected .rpLink,
.RadPanelBar_BlackMetroTouch .rpExpanded .rpLink {
    background-color: var(--menu-selected-color) !important;
}

/* Sub-items */
.RadPanelBar_BlackMetroTouch .rpGroup .rpLink {
    padding-left: 40px !important;
    background-color: rgba(0,0,0,0.1) !important;
}

.RadPanelBar_BlackMetroTouch .rpItem:first-child .rpLink, 
.RadPanelBar_BlackMetroTouch .rpItem:last-child .rpLink {
    background-color: #185766 !important;
}

.RadPanelBar_BlackMetroTouch .rpExpanded + .rpGroup {
    display: block !important;
}

.RadPanelBar_BlackMetroTouch .rpLink .rpText {
    display: inline-block;
    vertical-align: middle;
}

.item-zoonotico > .rpLink::before {
    content: "\f3e1"; /* Código hexadecimal del icono gear en Bootstrap Icons */
    font-family: "bootstrap-icons";
    margin-right: 10px;
}

.rpLink i {
    color: #ffffff !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
}

#sidebar-wrapper .RadPanelBar::-webkit-scrollbar {
    width: 6px;
}

#sidebar-wrapper .RadPanelBar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

/* Base limpia */
.RadCalendar_Bootstrap {
    font-family: "Segoe UI", sans-serif;
}

/* Tabla principal */
.RadCalendar_Bootstrap .rcMainTable {
    width: 100% !important;
    border-collapse: collapse;
}

/* Días como cuadros institucionales */
.RadCalendar_Bootstrap .rcMainTable td {
    height: 75px;
    border: 1px solid #e5e5e5;
    vertical-align: top;
    padding: 6px;
    background-color: #ffffff;
    transition: background-color 0.2s ease;
}

/* Hover sobrio */
.RadCalendar_Bootstrap .rcMainTable td:hover {
    background-color: #f4f6f9;
}

/* Día seleccionado institucional */
.RadCalendar_Bootstrap .rcSelected {
    background-color: #0d6efd !important;
    color: white !important;
    font-weight: 600;
}

/* Encabezado mes */
.RadCalendar_Bootstrap .rcTitlebar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    padding: 10px;
}

/* Días de la semana */
.RadCalendar_Bootstrap .rcWeek th {
    background-color: #f1f3f5;
    font-weight: 600;
    border: 1px solid #e5e5e5;
    height: 40px;
}

.calendar-container {
    max-height: 500px;
    overflow-y: auto;
}

@media (max-width: 576px) {
    .RadCalendar_Bootstrap .rcMainTable td {
        height: 35px !important; /* Más compacto en celulares */
        font-size: 11px;
    }
    .gov-header {
        flex-direction: column; /* Apila los logos en móvil */
        text-align: center;
    }
}

.has-event-blue {
    background-color: #e7f1ff !important;
    border: 1px solid #0d6efd !important;
}

.event-text {
    color: #0d6efd;
    font-size: 11px;
}

.dia-evento-pro {
    background-color: #ffd700 !important; /* Dorado */
    color: black !important;
    border-radius: 50%;
    cursor: pointer;
}

.dia-evento-pro:hover {
    background-color: #e7f1ff !important;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.25);
}

.panel-documentacion {
    padding: 10px;
}

.titulo-documentacion {
    font-weight:400;
    color: #185766; /* tu primary */
    border-bottom: 1px solid #b0bec5;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.tabla-documentacion {
    width: 100%;
    font-size: 10px;
}

.tabla-documentacion th {
    text-align: left;
    border-bottom: 1px solid #b0bec5;
    padding: 8px;
    font-weight: 600;
    color: #263238;
}

.tabla-documentacion td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.btn-documento {
    color: #185766;
    text-decoration: none;
    font-weight: 500;
}

.btn-documento:hover {
    text-decoration: underline;
}

.dia-con-evento {
    background-color: #E3F2FD !important;
    font-weight: bold;
    position: relative;
}

.dia-con-evento a,
.dia-con-evento span {
    position: relative;
    z-index: 1;
}

.badge-evento {
    width: 6px;
    height: 6px;
    background-color: #1976D2;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
    right: 4px;
    z-index: 0;
}

.dia-con-evento::after {
    content: "";
    width: 6px;
    height: 6px;
    background-color: #1976D2;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
    right: 4px;
}
