/************************************************************
 * styles.css (MODIFICADO)
 *
 * Se añaden o mantienen estilos requeridos, incluyendo:
 *  - Mejoras en la responsividad del sidebar (QUINTA MODIFICACIÓN).
 *  - Colores e iconos de inactividad.
 *  - Estilos para subpanel activo (OCTAVA MODIFICACIÓN).
 *  - Ajustes en la sección "Links de interés" (CUARTA MODIFICACIÓN).
 ************************************************************/

/* VARIABLES DE COLOR (valores iniciales) */
:root {
    --color-primario: #0d6efd;
    --color-subfondo: rgba(13, 110, 253, 0.1);

    /* Colores post-it (se modifican vía JS) */
    --color-postit1: rgba(13, 110, 253, 0.15);
    --color-postit2: rgba(13, 110, 253, 0.25);
    --color-postit3: rgba(13, 110, 253, 0.35);
    --color-postit4: rgba(13, 110, 253, 0.45);
    --color-postit5: rgba(13, 110, 253, 0.55);
}

/* RESET BÁSICO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/************************************************************
 * SIDEBAR
 ************************************************************/
.sidebar {
    width: 250px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px 10px;
    background: var(--color-primario);
    color: #fff;
}

.sidebar-logo {
    display: block;
    margin: 0 auto 15px auto;
    max-width: 120px;
    border-radius: 4px;
}

.sidebar h1 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.sidebar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-weight: 500;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: #fff;
    color: var(--color-primario);
}

.sidebar-links-interes {
    margin-top: 20px;
}

/* (CUARTA MODIFICACIÓN) Botones para Links de interés */
.sidebar-links-interes a {
    display: block;
    background-color: var(--color-subfondo);
    color: #ffffff;
    text-decoration: none;
    margin: 5px 0;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s ease;
}

.sidebar-links-interes a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}


/************************************************************
 * MAIN CONTENT
 ************************************************************/
.main-content {
    margin-left: 250px;
    padding: 20px;
}

.main-header {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/************************************************************
 * CARD CUSTOM
 ************************************************************/
.card-custom {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 20px;
}

/************************************************************
 * COLORED SUBSECTION
 ************************************************************/
.colored-subsection {
    background: var(--color-subfondo);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

/************************************************************
 * TABLAS
 ************************************************************/
.table {
    background: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
}

.table th,
.table td {
    vertical-align: middle;
}

/************************************************************
 * CALENDARIO (Vista Mensual, Diaria, 5 Días)
 ************************************************************/
.calendar-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f1f3f5;
    text-align: center;
    font-weight: bold;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #fff;
}

.calendar-month-cell {
    min-height: 100px;
    border: 1px solid #ccc;
    position: relative;
    padding: 4px;
    overflow: hidden;
}

.calendar-month-cell .day-number {
    font-weight: bold;
    text-align: right;
    cursor: pointer;
}

.calendar-month-cell:hover {
    background: #f7f7f7;
}

.day-today {
    background: #e0f7fa !important;
    border: 2px solid #26c6da !important;
}

.event-item {
    background: var(--color-subfondo);
    border: 1px solid var(--color-primario);
    color: var(--color-primario);
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.75rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.more-link {
    font-size: 0.75rem;
    color: var(--color-primario);
    cursor: pointer;
}

.hover-label {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
    z-index: 999;
}

/* Vista Diaria */
.calendar-daily-container {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
}

.daily-row {
    display: flex;
    border: 1px solid #ddd;
    margin-bottom: 5px;
    border-radius: 4px;
}

.daily-time {
    min-width: 60px;
    font-weight: bold;
    background: #f1f3f5;
    text-align: center;
    padding: 5px;
    border-right: 1px solid #ccc;
}

.daily-events {
    flex: 1;
    padding: 5px;
}

/* Vista 5 Días */
.calendar-5days-container {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
}

.five-days-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
}

.five-days-col {
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fafafa;
    min-height: 200px;
    padding: 5px;
    position: relative;
}

.five-days-col-header {
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
}

.five-days-event {
    background: var(--color-subfondo);
    border: 1px solid var(--color-primario);
    color: var(--color-primario);
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

/************************************************************
 * PERFIL CLIENTE
 ************************************************************/
.perfil-cliente-nombre {
    font-size: 3rem;
    font-weight: bold;
}

/************************************************************
 * BITÁCORA / QUILL
 ************************************************************/
.ql-editor p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.0 !important;
}

.ql-editor p+p {
    margin-top: 0 !important;
}

/************************************************************
 * CONTABILIDAD - Movimientos
 ************************************************************/
.tr-ingreso {
    background: #dafbe1 !important;
}

.tr-egreso {
    background: #fddddd !important;
}

/************************************************************
 * BOTONES DE PALETAS Y PERSONALIZADOS
 ************************************************************/
.btn-palette {
    background: #ccc;
    border: none;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
}

.btn-palette:hover {
    opacity: 0.8;
}

.btn-custom-sidebar {
    background-color: var(--color-primario);
    border: 1px solid var(--color-primario);
    color: #fff;
    font-weight: 500;
}

.btn-custom-sidebar:hover {
    opacity: 0.9;
}

/************************************************************
 * SUB-PANEL BOTONES (OCTAVA MODIFICACIÓN)
 ************************************************************/
.sub-panel-btn.active-subpanel {
    background-color: var(--color-primario);
    color: #fff;
}

/************************************************************
 * RESPONSIVE SIDEBAR (QUINTA MODIFICACIÓN)
 ************************************************************/
@media (max-width: 992px) {

    /* Con ancho reducido, transformamos la sidebar en una especie de barra horizontal */
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 10px;
        justify-content: center;
    }

    .sidebar-logo {
        margin: 5px;
    }

    .sidebar h1 {
        display: none;
        /* ocultamos el título grande para ahorrar espacio */
    }

    .sidebar a {
        margin: 5px;
        padding: 6px 10px;
        text-align: center;
    }

    .main-content {
        margin-left: 0;
        margin-top: 10px;
        padding: 10px;
    }
}

/************************************************************
 * LOGIN CONTAINER Y LOGO
 ************************************************************/
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-logo {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 150px;
    border-radius: 6px;
}

/************************************************************
 * NOTAS ADHESIVAS (Post-it)
 ************************************************************/
#seccionNotasAdhesivas {
    margin-left: 250px;
}

.notas-adhesivas-container {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #ccc;
}

.notas-adhesivas-container h5 {
    margin-bottom: 15px;
}

.postit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.postit-item {
    border: 1px solid #ccc;
    width: 200px;
    min-height: 100px;
    padding: 10px;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.postit-item p {
    font-size: 0.84rem;
    font-family: "Comic Sans MS", cursive, sans-serif;
    white-space: pre-wrap;
    line-height: 1.2;
    margin-bottom: 30px;
}

.postit-delete-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    color: #d33;
    cursor: pointer;
}

.postit-edit-btn {
    display: none;
}

/************************************************************
 * PIE DE PÁGINA EN CONTRATO (Impresión)
 ************************************************************/
.footer-logo {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    text-align: center;
    opacity: 0;
    display: none;
}

.footer-logo img {
    max-width: 200px;
}

@media print {
    .footer-logo {
        position: fixed;
        bottom: -150px;
        left: 0;
        width: 100%;
        text-align: center;
        opacity: 0;
        display: block !important;
    }

    .footer-logo img {
        max-width: 200px;
    }
}