/* ============================================================
   COLEGIO JUAN PABLO II
   STYLE.CSS
   LOGIN + DASHBOARD + MODALES CRUD
   ============================================================ */


/* ============================================================
   VARIABLES CORPORATIVAS
   ============================================================ */

:root {
    --azul-principal: #0047ba;
    --azul-oscuro: #001c71;

    --rojo: #f5333f;
    --amarillo: #ffd000;

    --gris: #636569;
    --gris-medio: #a7a8a9;
    --gris-claro: #d9d8d6;

    --gris-fondo: #f5f7fa;

    --blanco: #ffffff;

    --texto: #636569;

    --rosa-acciones: #e88998;

    --borde: #e7e9ec;

    --sidebar-width: 262px;

    --radius-bar: 30px;
}


/* ============================================================
   RESET
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family:
        'Montserrat',
        'Segoe UI',
        Tahoma,
        Geneva,
        Verdana,
        sans-serif;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-body {
    width: 100%;
    height: 100vh;
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.login-overlay {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    background:
        rgba(0, 81, 152, .70);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.login-modal {
    position: relative;

    z-index: 10;

    width: 500px;
    max-width: calc(100vw - 40px);

    padding: 60px 50px;

    background: var(--blanco);

    border-radius: 10px;

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

    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo img {
    display: block;

    width: 100%;
    max-width: 250px;

    height: auto;

    margin-bottom: 50px;
}

.login-form {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;

    background: var(--blanco);

    border: 2px solid #eaeaea;

    border-radius: 30px;

    padding: 10px 20px;

    margin-bottom: 20px;

    box-shadow:
        inset
        0 2px 5px
        rgba(0, 0, 0, .05);

    transition:
        border-color .3s ease,
        box-shadow .3s ease;
}

.input-group:focus-within {
    border-color: var(--azul-principal);

    box-shadow:
        0 0 0 3px
        rgba(0, 71, 186, .08);
}

.input-group .icon {
    color: var(--gris-medio);

    margin-right: 15px;

    font-size: 1.2rem;
}

.input-group input {
    width: 100%;

    border: none;
    outline: none;

    background: transparent;

    color: #2c3e4e;

    font-family: inherit;

    font-size: 1.1rem;
}

.btn-login {
    background: var(--azul-principal);

    color: var(--blanco);

    border: none;

    padding: 12px 50px;

    font-family: inherit;

    font-size: 1.1rem;

    font-weight: 500;

    border-radius: 30px;

    cursor: pointer;

    margin-top: 15px;

    transition:
        background .3s ease,
        transform .2s ease;

    box-shadow:
        0 4px 15px
        rgba(0, 71, 186, .20);
}

.btn-login:hover {
    background: var(--azul-oscuro);

    transform: translateY(-2px);
}

.btn-login:disabled {
    opacity: .65;

    cursor: not-allowed;

    transform: none;
}


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

body.dashboard-body {
    width: 100%;
    height: 100vh;

    min-height: 100vh;

    overflow: hidden;

    background: var(--gris-fondo);

    color: var(--texto);
}

.dashboard-layout {
    width: 100%;
    height: 100vh;

    min-height: 100vh;

    display: flex;

    overflow: hidden;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.dashboard-layout .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);

    height: 100vh;
    min-height: 100vh;

    flex: 0 0 var(--sidebar-width);

    background: var(--azul-principal);

    display: flex;
    flex-direction: column;
    align-items: center;

    overflow: hidden;
}

.dashboard-layout .sidebar-nav,
.dashboard-layout .nav-item,
.dashboard-layout .mobile-menu-btn {
    display: none !important;
}

.dashboard-layout .sidebar-logo {
    width: 100%;

    padding: 65px 28px 20px;

    display: flex;

    justify-content: center;
    align-items: flex-start;
}

.dashboard-layout .sidebar-logo img {
    display: block;

    width: 175px;
    max-width: 100%;

    height: auto;

    object-fit: contain;
}


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

.dashboard-layout .main-content {
    flex: 1 1 auto;

    min-width: 0;

    width:
        calc(100% - var(--sidebar-width));

    height: 100vh;

    min-height: 100vh;

    padding: 34px 48px 22px;

    display: flex;

    flex-direction: column;

    overflow: hidden;
}


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

.dashboard-layout .main-header {
    width: 100%;

    height: 66px;
    min-height: 66px;

    flex: 0 0 66px;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;
}

.dashboard-layout .main-header h1 {
    margin-top: 5px;

    color: var(--azul-principal);

    font-size: 2.05rem;

    line-height: 1;

    font-weight: 400;
}


/* ============================================================
   USUARIO
   ============================================================ */

.dashboard-layout .user-info {
    display: flex;

    align-items: center;

    gap: 14px;

    text-align: right;
}

.dashboard-layout .user-info-text {
    display: flex;

    flex-direction: column;

    align-items: flex-end;

    line-height: 1.08;
}

.dashboard-layout .user-info-text .welcome {
    color: var(--azul-principal);

    font-size: 1rem;

    font-weight: 400;
}

.dashboard-layout .user-info-text strong {
    color: var(--azul-principal);

    font-size: 1rem;

    font-weight: 500;
}

.dashboard-layout .user-role {
    color: var(--gris-medio);

    font-size: .85rem;

    font-weight: 400;

    border-bottom:
        1px solid
        var(--gris-medio);

    padding-bottom: 2px;

    margin-top: 2px;
}

.dashboard-layout .user-photo {
    width: 72px;
    height: 72px;

    min-width: 72px;

    border-radius: 50%;

    overflow: hidden;

    background: var(--gris-claro);
}

.dashboard-layout .user-photo img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* ============================================================
   BARRAS
   ============================================================ */

.dashboard-layout .management-bar {
    width: min(820px, 100%);

    height: 56px;
    min-height: 56px;

    flex: 0 0 56px;

    margin: 0 0 10px;

    padding:
        0 18px 0 20px;

    border-radius:
        var(--radius-bar);

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.dashboard-layout .management-bar-users {
    background: var(--gris);
}

.dashboard-layout .management-bar-activities {
    background: var(--azul-principal);
}

.dashboard-layout .management-bar h2 {
    color: var(--blanco);

    font-size: 1.22rem;

    line-height: 1;

    font-weight: 400;
}

.dashboard-layout .management-button {
    height: 34px;

    min-width: 170px;

    padding: 0 18px;

    border: none;

    border-radius: 20px;

    background: var(--blanco);

    color: var(--azul-principal);

    font-family: inherit;

    font-size: .82rem;

    font-weight: 500;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.dashboard-layout .management-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 3px 8px
        rgba(0, 0, 0, .12);
}

.dashboard-layout .management-button span {
    font-size: 1rem;

    margin-right: 5px;
}


/* ============================================================
   ACTIVIDADES
   ============================================================ */

.dashboard-layout .activities-panel {
    width: 100%;

    flex: 1 1 auto;

    min-height: 0;

    background: var(--blanco);

    border:
        1px solid
        #edf0f3;

    border-radius: 10px;

    overflow: hidden;

    display: flex;

    flex-direction: column;
}

.dashboard-layout .activities-table-header {
    width: 100%;

    height: 42px;
    min-height: 42px;

    flex: 0 0 42px;

    display: grid;

    grid-template-columns:
        12%
        18%
        40%
        12%
        18%;

    background: var(--gris);

    color: var(--blanco);

    padding-right: 9px;
}

.dashboard-layout .activities-table-header div {
    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0 8px;

    font-size: .78rem;

    font-weight: 400;
}

.dashboard-layout .activities-scroll {
    flex: 1 1 auto;

    min-height: 0;

    width: 100%;

    overflow-y: auto;

    overflow-x: hidden;

    scrollbar-width: thin;

    scrollbar-color:
        var(--gris-medio)
        #f0f1f2;
}

.dashboard-layout .activities-scroll::-webkit-scrollbar {
    width: 9px;
}

.dashboard-layout .activities-scroll::-webkit-scrollbar-track {
    background: #f0f1f2;
}

.dashboard-layout .activities-scroll::-webkit-scrollbar-thumb {
    background: var(--gris-medio);

    border-radius: 8px;
}

.dashboard-layout .activities-table {
    width: 100%;

    min-width: 760px;

    border-collapse: separate;

    border-spacing: 0;

    table-layout: fixed;
}

.dashboard-layout .activities-table thead {
    display: none;
}

.dashboard-layout .activities-table tbody tr {
    height: 82px;
}

.dashboard-layout .activities-table tbody tr:nth-child(odd) {
    background: #d1d1d1;
}

.dashboard-layout .activities-table tbody tr:nth-child(even) {
    background: #f1f1f1;
}

.dashboard-layout .activities-table td {
    padding: 10px 12px;

    border-right:
        3px solid
        var(--gris);

    border-bottom:
        3px solid
        var(--gris);

    color: #707070;

    font-size: .78rem;

    font-weight: 400;

    vertical-align: middle;

    text-align: center;

    overflow: hidden;
}

.dashboard-layout .activities-table td:nth-child(1) {
    width: 12%;
}

.dashboard-layout .activities-table td:nth-child(2) {
    width: 18%;
}

.dashboard-layout .activities-table td:nth-child(3) {
    width: 40%;

    text-align: left;
}

.dashboard-layout .activities-table td:nth-child(4) {
    width: 12%;
}

.dashboard-layout .activities-table td:nth-child(5) {
    width: 18%;
}

.dashboard-layout .activity-image {
    width: 48px;
    height: 48px;

    object-fit: cover;

    border-radius: 6px;
}

.dashboard-layout .image-placeholder {
    color: var(--gris-medio);
}

.dashboard-layout .activity-actions {
    white-space: nowrap;

    text-align: center !important;
}

.dashboard-layout .activity-actions button {
    width: 32px;
    height: 32px;

    padding: 0;

    margin: 0 4px;

    border: none;

    background: transparent;

    color: var(--rosa-acciones);

    font-size: 1.35rem;

    line-height: 32px;

    cursor: pointer;

    transition:
        transform .2s ease,
        color .2s ease;
}

.dashboard-layout .activity-actions button:hover {
    color: var(--rojo);

    transform: scale(1.1);
}

.dashboard-layout .table-message {
    height: 100px;

    color: var(--gris-medio);

    text-align: center !important;

    vertical-align: middle;
}

.dashboard-layout .table-message.error {
    color: var(--rojo);
}


/* ============================================================
   MODALES CRUD
   ============================================================ */

dialog.crud-modal:not([open]) {
    display: none;
}

dialog.crud-modal[open] {
    position: fixed;

    top: 50%;
    left: 50%;

    transform:
        translate(-50%, -50%);

    width: 900px;
    height: 750px;

    max-width: 900px;
    max-height: 750px;

    margin: 0;
    padding: 0;

    border: none;
    outline: none;

    border-radius: 18px;

    background: var(--blanco);

    color: var(--texto);

    overflow: hidden;

    box-shadow:
        0 25px 70px
        rgba(0, 0, 0, .32);

    display: flex;

    flex-direction: column;

    z-index: 1000;
}

dialog.crud-modal::backdrop {
    background:
        rgba(
            0,
            28,
            113,
            .58
        );

    backdrop-filter: blur(5px);

    -webkit-backdrop-filter: blur(5px);
}


/* ============================================================
   CABECERA MODAL
   ============================================================ */

.crud-modal .modal-header {
    width: 100%;

    height: 72px;
    min-height: 72px;

    flex: 0 0 72px;

    padding: 0 28px;

    background:
        var(--azul-principal);

    border-bottom:
        4px solid
        var(--amarillo);

    color: var(--blanco);

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.crud-modal .modal-header h2 {
    margin: 0;

    color: var(--blanco);

    font-size: 1.4rem;

    font-weight: 500;
}

.crud-modal .close-modal {
    width: 38px;
    height: 38px;

    min-width: 38px;

    padding: 0;

    border: none;

    border-radius: 50%;

    background:
        rgba(
            255,
            255,
            255,
            .15
        );

    color: var(--blanco);

    font-family: inherit;

    font-size: 1.2rem;

    line-height: 38px;

    text-align: center;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.crud-modal .close-modal:hover {
    background: var(--rojo);

    transform: rotate(90deg);
}


/* ============================================================
   MODAL USUARIOS
   ============================================================ */

.crud-modal .modal-user-list {
    width: 100%;

    flex: 0 0 320px;

    min-height: 320px;

    padding:
        18px 26px 12px;

    overflow: hidden;
}

.crud-modal .modal-list-header {
    width: 100%;

    height: 34px;

    margin-bottom: 10px;

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.crud-modal .modal-list-header h3 {
    margin: 0;

    color: var(--azul-principal);

    font-size: 1rem;

    font-weight: 600;
}


/* ============================================================
   BOTÓN NUEVO
   ============================================================ */

.crud-modal .btn-primary {
    height: 36px;

    min-width: 125px;

    padding: 0 18px;

    border: none;

    border-radius: 20px;

    background: var(--azul-principal);

    color: var(--blanco);

    font-family: inherit;

    font-size: .72rem;

    font-weight: 500;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.crud-modal .btn-primary:hover {
    background: var(--azul-oscuro);

    transform: translateY(-1px);
}


/* ============================================================
   SCROLL TABLA USUARIOS
   ============================================================ */

.crud-modal .user-list-scroll {
    width: 100%;

    height: 265px;
    max-height: 265px;

    overflow: auto;

    border:
        1px solid
        var(--borde);

    border-radius: 10px;

    background: var(--blanco);

    scrollbar-width: thin;

    scrollbar-color:
        var(--gris-medio)
        #f1f2f4;
}

.crud-modal .user-list-scroll::-webkit-scrollbar {
    width: 8px;
}

.crud-modal .user-list-scroll::-webkit-scrollbar-track {
    background: #f1f2f4;
}

.crud-modal .user-list-scroll::-webkit-scrollbar-thumb {
    background: var(--gris-medio);

    border-radius: 10px;
}


/* ============================================================
   TABLA USUARIOS
   ============================================================ */

.crud-modal .users-crud-table {
    width: 100%;

    min-width: 780px;

    border-collapse: collapse;

    table-layout: fixed;
}

.crud-modal .users-crud-table thead th {
    position: sticky;

    top: 0;

    z-index: 5;

    height: 40px;

    padding: 0 8px;

    background: var(--gris);

    color: var(--blanco);

    font-size: .67rem;

    font-weight: 600;

    text-align: center;
}

.crud-modal .users-crud-table th:nth-child(1),
.crud-modal .users-crud-table td:nth-child(1) {
    width: 75px;
}

.crud-modal .users-crud-table th:nth-child(2),
.crud-modal .users-crud-table td:nth-child(2) {
    width: 175px;
}

.crud-modal .users-crud-table th:nth-child(3),
.crud-modal .users-crud-table td:nth-child(3) {
    width: 245px;
}

.crud-modal .users-crud-table th:nth-child(4),
.crud-modal .users-crud-table td:nth-child(4) {
    width: 100px;
}

.crud-modal .users-crud-table th:nth-child(5),
.crud-modal .users-crud-table td:nth-child(5) {
    width: 95px;
}

.crud-modal .users-crud-table th:nth-child(6),
.crud-modal .users-crud-table td:nth-child(6) {
    width: 100px;
}

.crud-modal .users-crud-table tbody tr {
    height: 58px;

    transition:
        background .15s ease;
}

.crud-modal .users-crud-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.crud-modal .users-crud-table tbody tr:nth-child(even) {
    background: #f7f8fa;
}

.crud-modal .users-crud-table tbody tr:hover {
    background: #eef4ff;
}

.crud-modal .users-crud-table td {
    height: 58px;

    padding: 6px 8px;

    border-bottom:
        1px solid
        #e8eaed;

    color: var(--texto);

    font-size: .70rem;

    text-align: center;

    vertical-align: middle;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ============================================================
   FOTO USUARIO
   ============================================================ */

.crud-modal .usuario-mini-foto {
    display: block;

    width: 42px;
    height: 42px;

    margin: auto;

    object-fit: cover;

    border-radius: 50%;

    border:
        2px solid
        var(--blanco);

    box-shadow:
        0 2px 7px
        rgba(0, 0, 0, .15);
}


/* ============================================================
   BADGES
   ============================================================ */

.crud-modal .usuario-rol-badge {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 78px;

    height: 24px;

    padding: 0 9px;

    border-radius: 14px;

    color: var(--blanco);

    font-size: .57rem;

    font-weight: 700;

    text-transform: uppercase;
}

.crud-modal .usuario-rol-badge.superadmin {
    background: var(--rojo);
}

.crud-modal .usuario-rol-badge.usuario {
    background: var(--azul-principal);
}

.crud-modal .usuario-rol-badge.editor {
    background: var(--azul-principal);
}


/* ============================================================
   ESTADO USUARIO
   ============================================================ */

.crud-modal .usuario-estado {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 68px;

    height: 24px;

    padding: 0 9px;

    border-radius: 14px;

    font-size: .59rem;

    font-weight: 600;
}

.crud-modal .usuario-estado.activo {
    color: #008f91;

    background: #e1f6f5;
}

.crud-modal .usuario-estado.inactivo {
    color: var(--gris);

    background: #e9eaec;
}


/* ============================================================
   ACCIONES USUARIOS
   ============================================================ */

.crud-modal .usuario-acciones {
    white-space: nowrap;
}

.crud-modal .usuario-acciones button {
    width: 30px;
    height: 30px;

    padding: 0;

    margin: 0 2px;

    border:
        1px solid
        #e1e4e8;

    border-radius: 50%;

    background: var(--blanco);

    color: var(--azul-principal);

    font-size: .82rem;

    cursor: pointer;

    transition:
        all .2s ease;
}

.crud-modal .usuario-acciones button:hover {
    background: var(--azul-principal);

    border-color: var(--azul-principal);

    color: var(--blanco);

    transform: translateY(-1px);
}


/* ============================================================
   FORMULARIO USUARIO
   ============================================================ */

.crud-modal .usuario-form-container {
    flex: 1 1 auto;

    min-height: 0;

    padding:
        14px 26px 20px;

    border-top:
        1px solid
        var(--borde);

    overflow: hidden;
}

.crud-modal .usuario-form-container h3 {
    margin: 0 0 10px;

    color: var(--azul-principal);

    font-size: .98rem;

    font-weight: 600;
}


/* ============================================================
   FILAS FORMULARIO
   ============================================================ */

.crud-modal .form-row {
    width: 100%;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 16px;
}

.crud-modal .form-group {
    display: flex;

    flex-direction: column;

    gap: 5px;

    margin-bottom: 9px;
}

.crud-modal .form-group label {
    color: var(--gris);

    font-size: .67rem;

    font-weight: 600;
}

.crud-modal .form-group input,
.crud-modal .form-group select,
.crud-modal .form-group textarea {
    width: 100%;

    border:
        1px solid
        #dfe3e8;

    border-radius: 8px;

    background: var(--blanco);

    color: #4f5358;

    font-family: inherit;

    font-size: .74rem;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.crud-modal .form-group input,
.crud-modal .form-group select {
    height: 34px;

    padding: 0 10px;
}

.crud-modal .form-group textarea {
    min-height: 70px;

    padding: 9px 10px;

    resize: vertical;
}

.crud-modal .form-group input:focus,
.crud-modal .form-group select:focus,
.crud-modal .form-group textarea:focus {
    border-color: var(--azul-principal);

    box-shadow:
        0 0 0 3px
        rgba(0, 71, 186, .08);
}


/* ============================================================
   ARCHIVOS
   ============================================================ */

.crud-modal input[type="file"] {
    height: 34px;

    padding: 6px;

    font-size: .65rem;
}

.crud-modal input[type="file"]::file-selector-button {
    border: none;

    border-radius: 14px;

    padding: 5px 11px;

    margin-right: 7px;

    background: var(--azul-principal);

    color: var(--blanco);

    font-family: inherit;

    font-size: .62rem;

    cursor: pointer;
}


/* ============================================================
   FOOTER
   ============================================================ */

.crud-modal .modal-footer {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 9px;

    padding: 2px 0 0;
}

.crud-modal .btn-cancel {
    height: 36px;

    min-width: 105px;

    padding: 0 18px;

    border:
        1px solid
        var(--gris-medio);

    border-radius: 20px;

    background: var(--blanco);

    color: var(--gris);

    font-family: inherit;

    font-size: .72rem;

    cursor: pointer;
}

.crud-modal .btn-cancel:hover {
    background: #f2f3f5;
}


/* ============================================================
   MODAL ACTIVIDADES
   ============================================================ */

.crud-modal .actividad-form-container {
    flex: 1 1 auto;

    min-height: 0;

    width: 100%;

    padding:
        28px 34px 24px;

    overflow-y: auto;

    overflow-x: hidden;
}

.crud-modal .actividad-form-container::-webkit-scrollbar {
    width: 8px;
}

.crud-modal .actividad-form-container::-webkit-scrollbar-track {
    background: #f1f2f4;
}

.crud-modal .actividad-form-container::-webkit-scrollbar-thumb {
    background: var(--gris-medio);

    border-radius: 10px;
}


/* ============================================================
   GRID ACTIVIDAD
   ============================================================ */

.crud-modal .actividad-form-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    column-gap: 24px;

    row-gap: 8px;
}

.crud-modal .actividad-form-grid .full {
    grid-column: 1 / -1;
}


/* ============================================================
   FORMULARIO ACTIVIDAD
   ============================================================ */

.crud-modal .actividad-form-container .form-group {
    margin-bottom: 14px;
}

.crud-modal .actividad-form-container .form-group label {
    font-size: .74rem;

    margin-bottom: 2px;
}

.crud-modal .actividad-form-container input,
.crud-modal .actividad-form-container select {
    height: 44px;

    font-size: .82rem;
}

.crud-modal .actividad-form-container textarea {
    height: 130px;

    min-height: 130px;

    resize: vertical;

    font-size: .82rem;
}

.crud-modal #actividadImagenActual {
    display: block;

    margin-top: 6px;

    color: var(--gris-medio);

    font-size: .68rem;
}

.crud-modal .actividad-form-container input[type="file"] {
    height: 44px;

    padding: 8px;
}


/* ============================================================
   EDITOR
   ============================================================ */

body.editor-dashboard
.management-bar-users {
    display: none;
}


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

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 210px;
    }

    .dashboard-layout .main-content {
        padding: 28px 25px 18px;
    }

    .dashboard-layout .sidebar-logo img {
        width: 145px;
    }

    .dashboard-layout .management-bar {
        width: 100%;
    }

    .dashboard-layout .main-header h1 {
        font-size: 1.8rem;
    }
}


/* ============================================================
   MODALES EN PANTALLAS PEQUEÑAS
   ============================================================ */

@media (max-width: 768px) {

    body.dashboard-body {
        overflow: hidden;
    }

    .dashboard-layout {
        display: block;

        height: 100vh;
    }

    .dashboard-layout .sidebar {
        width: 100%;
        min-width: 100%;

        height: 76px;
        min-height: 76px;

        flex: none;

        justify-content: flex-start;

        align-items: center;
    }

    .dashboard-layout .sidebar-logo {
        width: auto;

        padding: 8px 20px;

        justify-content: flex-start;

        align-items: center;
    }

    .dashboard-layout .sidebar-logo img {
        width: 105px;

        max-height: 60px;
    }

    .dashboard-layout .main-content {
        width: 100%;

        height:
            calc(100vh - 76px);

        min-height: 0;

        padding:
            20px 18px 15px;
    }

    .dashboard-layout .main-header {
        height: 58px;

        min-height: 58px;

        flex-basis: 58px;
    }

    .dashboard-layout .main-header h1 {
        font-size: 1.55rem;
    }

    .dashboard-layout .user-photo {
        width: 52px;
        height: 52px;

        min-width: 52px;
    }

    .dashboard-layout .management-bar {
        height: 48px;

        min-height: 48px;

        flex-basis: 48px;

        padding:
            0 12px 0 16px;
    }

    .dashboard-layout .management-bar h2 {
        font-size: .92rem;
    }

    .dashboard-layout .management-button {
        min-width: 135px;

        height: 30px;

        padding: 0 10px;

        font-size: .68rem;
    }

    /* ========================================================
       MODAL FULLSCREEN
       ======================================================== */

    dialog.crud-modal[open] {
        top: 0;
        left: 0;

        transform: none;

        width: 100vw;
        height: 100vh;

        max-width: 100vw;
        max-height: 100vh;

        border-radius: 0;
    }

    .crud-modal .modal-header {
        height: 64px;

        min-height: 64px;

        flex-basis: 64px;

        padding:
            0 18px;
    }

    .crud-modal .modal-header h2 {
        font-size: 1.15rem;
    }

    .crud-modal .modal-user-list {
        flex: 0 0 320px;

        padding: 15px;
    }

    .crud-modal .user-list-scroll {
        height: 250px;

        max-height: 250px;
    }

    .crud-modal .usuario-form-container {
        padding: 15px;

        overflow-y: auto;
    }

    .crud-modal .form-row {
        grid-template-columns: 1fr;

        gap: 0;
    }

    .crud-modal .actividad-form-container {
        padding:
            20px 18px;
    }

    .crud-modal .actividad-form-grid {
        grid-template-columns: 1fr;
    }

    .crud-modal .actividad-form-grid .full {
        grid-column: auto;
    }

    .crud-modal .actividad-form-container textarea {
        height: 150px;

        min-height: 150px;
    }
}


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

@media (max-width: 600px) {

    .login-modal {
        width:
            calc(100vw - 30px);

        padding:
            40px 25px;
    }

    .login-logo img {
        max-width: 200px;

        margin-bottom: 35px;
    }

    .input-group input {
        font-size: 1rem;
    }

    .btn-login {
        width: 100%;

        padding:
            12px 25px;
    }
}


/* ============================================================
   SIDEBAR - MENÚ PRINCIPAL
   ============================================================ */

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 30px 18px;
}

.sidebar-menu-button {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    padding: 13px 18px;

    box-sizing: border-box;

    background-color: #003b73;
    color: #ffffff;

    border-radius: 12px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.sidebar-menu-button:hover {
    background-color: #005198;

    transform:
        translateX(5px);

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.18);
}

.sidebar-menu-button.active {
    background-color: #005198;
    color: #ffffff;
}

.sidebar-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    font-size: 16px;
    color: #ffffff;
}


/* ============================================================
   CONTACTOS
   POPUP DEPURADO
   ============================================================ */


/* ============================================================
   MODAL CONTACTO
   ============================================================ */

#modalCrudContacto {
    position: fixed;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: min(760px, calc(100vw - 40px));
    max-width: 760px;

    height: auto;
    max-height: calc(100vh - 40px);

    margin: 0;
    padding: 0;

    border: none;
    outline: none;
    border-radius: 14px;

    background: var(--blanco);
    color: var(--texto);

    /*
       IMPORTANTE:
       El popup completo es ahora el área de desplazamiento.
       Esto permite acceder a los botones inferiores.
    */
    overflow-y: auto;
    overflow-x: hidden;

    box-sizing: border-box;

    scrollbar-width: auto;
    scrollbar-color:
        var(--gris-medio)
        #f0f1f2;
}


/* ============================================================
   SCROLLBAR DEL MODAL DE CONTACTOS
   ============================================================ */

#modalCrudContacto::-webkit-scrollbar {
    width: 10px;
}

#modalCrudContacto::-webkit-scrollbar-track {
    background: #f0f1f2;
}

#modalCrudContacto::-webkit-scrollbar-thumb {
    background: var(--gris-medio);

    border-radius: 8px;

    border: 2px solid #f0f1f2;
}

#modalCrudContacto::-webkit-scrollbar-thumb:hover {
    background: var(--gris);
}


/* ============================================================
   CABECERA DEL MODAL
   ============================================================ */

#modalCrudContacto .modal-header {
    width: 100%;

    min-height: 72px;
    height: 72px;

    padding: 0 20px;

    box-sizing: border-box;

    background: var(--azul-principal);

    border-bottom:
        4px solid
        var(--amarillo);

    display: flex;

    align-items: center;

    justify-content: space-between;

    /*
       La cabecera permanece visible mientras se desplaza
       el contenido del popup.
    */
    position: sticky;

    top: 0;

    z-index: 20;
}

#modalCrudContacto .modal-header h2 {
    margin: 0;

    color: var(--blanco);

    font-size: 1.4rem;

    font-weight: 500;
}

#modalCrudContacto .close-modal {
    flex: 0 0 auto;
}


/* ============================================================
   DATOS DEL CONTACTO
   ============================================================ */

#modalCrudContacto .contacto-form-container {
    width: 100%;

    padding:
        20px 24px 10px;

    box-sizing: border-box;
}

#modalCrudContacto .contacto-form-container h3 {
    margin:
        0 0 16px;

    color: var(--gris);

    font-size: 1rem;

    font-weight: 600;
}


/* ============================================================
   FILAS Y CAMPOS
   ============================================================ */

#modalCrudContacto .form-row {
    width: 100%;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 18px;

    margin-bottom: 16px;
}

#modalCrudContacto .form-group {
    min-width: 0;

    margin-bottom: 0;
}

#modalCrudContacto .form-group label {
    display: block;

    margin-bottom: 6px;

    color: var(--gris);

    font-size: .67rem;

    font-weight: 600;
}

#modalCrudContacto .form-group input,
#modalCrudContacto .form-group select,
#modalCrudContacto .form-group textarea {
    width: 100%;

    box-sizing: border-box;

    border:
        1px solid
        #dfe3e8;

    border-radius: 8px;

    background: var(--blanco);

    color: #4f5358;

    font-family: inherit;

    font-size: .74rem;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

#modalCrudContacto .form-group input,
#modalCrudContacto .form-group select {
    height: 34px;

    padding:
        0 10px;
}

#modalCrudContacto .form-group textarea {
    min-height: 110px;

    padding:
        9px 10px;

    resize: vertical;
}

#modalCrudContacto .form-group input:focus,
#modalCrudContacto .form-group select:focus,
#modalCrudContacto .form-group textarea:focus {
    border-color:
        var(--azul-principal);

    box-shadow:
        0 0 0 3px
        rgba(0, 71, 186, .08);
}


/* ============================================================
   FOOTER DE BOTONES
   ============================================================ */

#modalCrudContacto .modal-footer {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 9px;

    margin-top: 18px;

    padding:
        2px 0 0;

    box-sizing: border-box;
}

#modalCrudContacto .modal-footer button {
    position: relative;

    z-index: 2;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 36px;

    cursor: pointer;
}


/* ============================================================
   HISTORIAL DE COMUNICACIONES
   ============================================================ */

#modalCrudContacto .contacto-historial {
    width: 100%;

    padding:
        8px 24px 18px;

    box-sizing: border-box;
}

#modalCrudContacto .modal-list-header {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 14px;
}

#modalCrudContacto .modal-list-header h3 {
    margin: 0;

    color:
        var(--azul-principal);

    font-size: 1rem;

    font-weight: 600;
}

#modalCrudContacto .contact-history-scroll {
    width: 100%;

    max-height: 220px;

    overflow-y: auto;

    overflow-x: auto;

    border-radius: 8px;
}

#modalCrudContacto .contact-history-scroll::-webkit-scrollbar {
    width: 8px;

    height: 8px;
}

#modalCrudContacto .contact-history-scroll::-webkit-scrollbar-track {
    background: #f1f2f4;
}

#modalCrudContacto .contact-history-scroll::-webkit-scrollbar-thumb {
    background: var(--gris-medio);

    border-radius: 8px;
}

#modalCrudContacto .contact-history-table {
    width: 100%;

    min-width: 500px;

    border-collapse: collapse;
}

#modalCrudContacto .contact-history-table th {
    padding:
        9px 12px;

    color: #60656b;

    font-size: 13px;

    font-weight: 600;

    text-align: left;

    white-space: nowrap;
}

#modalCrudContacto .contact-history-table td {
    padding:
        10px 12px;

    color: #555;

    font-size: 13px;

    border-top:
        1px solid
        #e5e7eb;

    vertical-align: top;

    word-break: break-word;
}


/* ============================================================
   NUEVA COMUNICACIÓN
   ============================================================ */

#modalCrudContacto .contact-message-container {
    width: auto;

    margin:
        0 24px 24px;

    padding:
        20px 24px 22px;

    box-sizing: border-box;

    background:
        #f7f9fc;

    border:
        1px solid
        #e1e6ed;

    border-radius: 12px;

    overflow: visible;
}


/*
   FUNDAMENTAL:
   El atributo HTML hidden debe ocultar completamente
   este bloque hasta que JavaScript lo muestre.
*/

#modalCrudContacto .contact-message-container[hidden] {
    display: none !important;
}

#modalCrudContacto .contact-message-container h3 {
    margin:
        0 0 16px;

    color:
        #60656b;

    font-size: 18px;

    font-weight: 600;
}

#modalCrudContacto .contact-message-container .form-group {
    margin-bottom: 15px;
}

#modalCrudContacto .contact-message-container label {
    display: block;

    margin-bottom: 7px;

    color:
        #60656b;

    font-size: 12px;

    font-weight: 500;
}

#modalCrudContacto .contact-message-container input {
    width: 100%;

    min-height: 44px;

    padding:
        10px 13px;

    box-sizing: border-box;

    border:
        1px solid
        #d6dce5;

    border-radius: 8px;

    background:
        var(--blanco);

    font-family: inherit;
}

#modalCrudContacto .contact-message-container textarea {
    width: 100%;

    min-height: 130px;

    padding:
        11px 13px;

    box-sizing: border-box;

    border:
        1px solid
        #d6dce5;

    border-radius: 8px;

    background:
        var(--blanco);

    resize: vertical;

    font-family: inherit;
}

#modalCrudContacto .contact-message-container input:focus,
#modalCrudContacto .contact-message-container textarea:focus {
    outline: none;

    border-color:
        var(--azul-principal);

    box-shadow:
        0 0 0 3px
        rgba(0, 81, 152, .10);
}

#modalCrudContacto .contact-message-container .modal-footer {
    margin-top: 18px;

    padding-top: 4px;
}

#modalCrudContacto #btnGuardarMensajeContacto {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 40px;

    padding:
        10px 18px;

    background:
        var(--azul-principal);

    color:
        var(--blanco);

    border: none;

    border-radius: 22px;

    font-weight: 600;

    cursor: pointer;
}

#modalCrudContacto #btnGuardarMensajeContacto:hover {
    background:
        var(--azul-oscuro);

    transform:
        translateY(-1px);
}

#modalCrudContacto #btnCancelarMensajeContacto {
    min-height: 40px;

    padding:
        10px 18px;

    background:
        var(--blanco);

    color:
        #666666;

    border:
        1px solid
        #bfc3c8;

    border-radius: 22px;

    cursor: pointer;
}


/* ============================================================
   RESPETAR EL ATRIBUTO HIDDEN
   ============================================================ */

#modalCrudContacto [hidden] {
    display: none !important;
}


/* ============================================================
   CONTACTO - RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {

    #modalCrudContacto {
        top: 50%;

        left: 50%;

        transform:
            translate(-50%, -50%);

        width:
            calc(100vw - 24px);

        max-width:
            calc(100vw - 24px);

        height: auto;

        max-height:
            calc(100vh - 24px);

        border-radius: 12px;
    }

    #modalCrudContacto .modal-header {
        min-height: 64px;

        height: 64px;

        padding:
            0 16px;
    }

    #modalCrudContacto .modal-header h2 {
        font-size: 1.15rem;
    }

    #modalCrudContacto .contacto-form-container {
        padding:
            18px 18px 8px;
    }

    #modalCrudContacto .form-row {
        grid-template-columns:
            1fr;

        gap: 14px;
    }

    #modalCrudContacto .contacto-historial {
        padding:
            0 18px 18px;
    }

    #modalCrudContacto .modal-list-header {
        align-items:
            flex-start;

        flex-direction:
            column;

        gap:
            12px;
    }

    #modalCrudContacto .contact-message-container {
        margin:
            16px 18px 18px;

        padding:
            18px;
    }

    #modalCrudContacto .contact-message-container .modal-footer {
        flex-direction:
            column-reverse;

        align-items:
            stretch;
    }

    #modalCrudContacto .contact-message-container .modal-footer button {
        width:
            100%;
    }
}