:root {
    --mada-dark: #225f78;
    --mada-mid: #2f7891;
    --mada-light: #3b8fa4;
    --mada-pale: #eaf6fa;
    --mada-title: #135c75;
    --text-main: #263238;
    --border-soft: #dfe6ee;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--text-main);
    background: #ffffff;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-size: 12px;
    overflow-x: hidden;
}

/* Login inspirado en la portada original de MADA. */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.32)),
        url("/assets/images/area5-fondo.jpg") center center / cover no-repeat;
}

.login-shell {
    width: 100%;
    max-width: 1060px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 70px;
}

.login-box {
    width: 340px;
    flex: 0 0 auto;
    padding: 22px 24px 20px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(8px);
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
    text-align: center;
}

.hero-title h1 {
    margin: 0;
    color: var(--mada-mid);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1.6px;
    line-height: 1;
}

.hero-line {
    width: 145px;
    height: 2px;
    margin: 8px auto 6px;
    background: rgba(0, 0, 0, 0.22);
}

.hero-title span {
    color: #111111;
    font-size: 13px;
    font-weight: 600;
}

.login-box .input-group {
    margin-bottom: 10px;
}

.login-box .input-group-text {
    min-width: 92px;
    height: 37px;
    display: flex;
    align-items: center;
    border: 1px solid #d7dee7;
    background: #f7f8fa;
    color: #343a40;
    font-size: 13px;
    font-weight: 700;
}

.login-box .form-control {
    height: 37px;
    border: 1px solid #d7dee7;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    box-shadow: none;
}

.login-box .form-control:focus {
    border-color: var(--mada-mid);
    box-shadow: 0 0 0 3px rgba(47, 120, 145, 0.12);
}

.login-message {
    margin-bottom: 12px;
    padding: 8px 10px;
    border-left: 3px solid var(--mada-mid);
    border-radius: 4px;
    background: var(--mada-pale);
    color: var(--mada-title);
    font-size: 12px;
}

.btn-login {
    width: 100%;
    height: 39px;
    margin-top: 7px;
    border: 1px solid var(--mada-dark);
    border-radius: 999px;
    color: #ffffff;
    background: var(--mada-mid);
    box-shadow: 0 5px 14px rgba(34, 95, 120, 0.24);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.7px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    background: var(--mada-dark);
}

.login-hero {
    flex: 1;
    display: flex;
    justify-content: center;
}

.login-hero-card {
    width: 100%;
    max-width: 480px;
    padding: 30px 34px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(34, 95, 120, 0.94), rgba(59, 143, 164, 0.90));
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(8px);
}

.login-hero-kicker {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.1px;
    opacity: 0.82;
}

.login-hero h2 {
    margin: 8px 0 10px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.16;
}

.login-hero p {
    max-width: 390px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
}

/* Navbar calcada del lenguaje visual de menues.scala.html de MADA. */
.app-navbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    position: sticky;
    top: 0;
    z-index: 1000;
    color: #ffffff;
    background: linear-gradient(90deg, var(--mada-dark) 0%, var(--mada-mid) 55%, var(--mada-light) 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.navbar-brand-app {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-right: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.13);
    transition: 0.2s ease;
}

.navbar-brand-app:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.22);
}

.navbar-brand-app img {
    width: 21px;
    height: auto;
}

.navbar-menu {
    height: 32px;
    display: flex;
    align-items: center;
}

.navbar-dropdown {
    height: 100%;
    position: relative;
}

.navbar-link {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 7px 8px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.18s ease;
}

.navbar-link:hover,
.navbar-link.active,
.navbar-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    outline: none;
}

.dropdown-arrow {
    margin-left: 6px;
    font-size: 10px;
}

.navbar-dropdown-menu {
    min-width: 220px;
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1100;
    padding: 8px;
    border: 0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.navbar-dropdown-menu[hidden] {
    display: none !important;
}

.navbar-dropdown-menu.is-open {
    display: block;
}

.navbar-dropdown-menu a {
    display: block;
    padding: 5px 10px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.16s ease;
}

.navbar-dropdown-menu a:hover,
.navbar-dropdown-menu a:focus {
    color: var(--mada-title);
    background: var(--mada-pale);
    text-decoration: none;
}

.navbar-dropdown-action {
    display: block;
    width: 100%;
    padding: 5px 10px;
    border: 0;
    border-radius: 10px;
    color: var(--text-main);
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.16s ease;
}

.navbar-dropdown-action:hover,
.navbar-dropdown-action:focus {
    color: var(--mada-title);
    background: var(--mada-pale);
    outline: none;
}

.navbar-dropdown-action.active {
    color: var(--mada-title);
    background: var(--mada-pale);
}

.navbar-submenu {
    position: relative;
}

.navbar-submenu-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-submenu-arrow {
    margin-left: 14px;
    font-size: 12px;
}

.navbar-submenu-menu {
    top: -8px;
    left: calc(100% + 8px);
    margin: 0;
}

.contacto-datos {
    font-size: 12px;
    line-height: 1.5;
}

.ayuda-visor-pdf {
    width: 100%;
    height: min(76vh, 820px);
    border: 0;
}

.ayuda-video-contenedor {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #101820;
}

.ayuda-video {
    width: 100%;
    max-height: 76vh;
    background: #000000;
}

/* Separa los grupos funcionales dentro de un menu desplegable. */
.navbar-dropdown-separator {
    height: 1px;
    margin: 6px 8px;
    background: rgba(38, 50, 56, 0.22);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.navbar-user-name,
.exit-link {
    padding: 7px 9px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.navbar-user-name {
    background: rgba(255, 255, 255, 0.10);
}

.navbar-user-button {
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

.navbar-user-button:hover,
.navbar-user-button:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.20);
    outline: none;
}

.navbar-divider {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.25);
}

.exit-link {
    color: #ffffff;
    background: rgba(220, 53, 69, 0.82);
    text-decoration: none;
}

.exit-link:hover {
    color: #ffffff;
    background: rgba(220, 53, 69, 1);
    text-decoration: none;
}

.blank-content {
    min-height: calc(100vh - 42px);
    background: #ffffff;
}

/* Inicio con la misma imagen utilizada por el acceso. */
.home-page {
    min-height: calc(100vh - 42px);
    background:
        linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.32)),
        url("/assets/images/area5-fondo.jpg") center center / cover no-repeat;
}

.home-page .barra-titulo-wrapper {
    margin-bottom: 0;
}

/* Listados compactos siguiendo las vistas administrativas de MADA. */
.table-responsive {
    width: 100%;
    max-width: 1380px;
    margin-right: auto;
    margin-left: auto;
}

/* Extiende los mantenedores del modulo Tablas al ancho disponible. */
.tablas-ancho-completo .table-responsive {
    max-width: none;
}

.tablas-ancho-completo .dataTables_wrapper,
.tablas-ancho-completo table.dataTable {
    width: 100% !important;
}

.tablas-ancho-completo table.dataTable th,
.tablas-ancho-completo table.dataTable td {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Distribuye el ancho de las columnas principales de la entidad. */
.tablas-ancho-completo table.dataTable.tabla-entes-principal th:nth-child(1),
.tablas-ancho-completo table.dataTable.tabla-entes-principal td:nth-child(1) {
    width: 5% !important;
    min-width: 90px;
}

.tablas-ancho-completo table.dataTable.tabla-entes-principal th:nth-child(2),
.tablas-ancho-completo table.dataTable.tabla-entes-principal td:nth-child(2) {
    width: 8% !important;
    max-width: 150px;
}

.tablas-ancho-completo table.dataTable.tabla-entes-principal th:nth-child(9),
.tablas-ancho-completo table.dataTable.tabla-entes-principal td:nth-child(9) {
    width: 7% !important;
    max-width: 150px;
}

.dataTables_wrapper table.dataTable {
    margin-bottom: 0 !important;
    font-size: 11px;
    line-height: 1.15;
}

.dataTables_wrapper table.dataTable th,
.dataTables_wrapper table.dataTable td {
    padding: 4px 7px;
    vertical-align: middle;
}

.dataTables_wrapper table.dataTable .btn-mada-xs {
    white-space: nowrap;
}

.table-page {
    min-height: calc(100vh - 42px);
    padding: 0 16px 24px;
    background: #ffffff;
}

.table-page-header {
    min-height: 56px;
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    align-items: center;
    margin: 0 -16px 16px;
    padding: 8px 26px;
    border-radius: 0 0 16px 16px;
    color: #12303f;
    background: linear-gradient(180deg, rgba(235, 247, 253, 0.96), rgba(224, 240, 250, 0.92));
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.035);
}

.table-page-context {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.table-page-header h1 {
    margin: 0;
    color: #0b4f93;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.45px;
    text-align: center;
    text-transform: uppercase;
}

.record-count {
    color: #12303f;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    opacity: 0.82;
}

.table-message {
    margin-bottom: 12px;
    padding: 8px 10px;
    border-left: 3px solid var(--mada-mid);
    border-radius: 4px;
    color: var(--mada-title);
    background: var(--mada-pale);
}

.data-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.data-table {
    width: 100%;
    margin: 0;
    color: var(--text-main);
    background: #ffffff;
    font-size: 12px;
    white-space: nowrap;
}

.data-table thead th {
    padding: 6px 8px;
    border-color: #d6e2e8;
    color: #ffffff;
    background: var(--mada-mid);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
}

.data-table tbody td {
    max-width: 280px;
    padding: 5px 7px;
    overflow: hidden;
    border-color: #e2e8ec;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: #f8fbfc;
}

.data-table tbody tr:hover {
    background: var(--mada-pale);
}

.data-table tbody tr.registro-modificable {
    cursor: pointer;
}

.empty-table {
    padding: 26px !important;
    color: #6b7280;
    text-align: center;
}

.vigente-checkbox {
    width: 17px;
    height: 17px;
    display: block;
    margin: 0 auto;
    accent-color: var(--mada-mid);
    cursor: pointer;
}

.vigente-checkbox:disabled {
    cursor: wait;
    opacity: 0.55;
}

.crud-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.crud-button {
    min-width: 82px;
    padding: 4px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.10);
}

.crud-create,
.crud-save { background: #20994a; border-color: #168654; }
.crud-edit { background: #0ea5e9; border-color: #0284c7; }
.crud-delete { background: #dc3545; border-color: #b02a37; }
.crud-cancel { background: #64748b; border-color: #475569; }

.crud-button:hover { filter: brightness(0.94); transform: translateY(-1px); }

.registro-select {
    width: 16px;
    height: 16px;
    display: block;
    margin: 0 auto;
    accent-color: var(--mada-mid);
    cursor: pointer;
}

.data-table tbody td.table-action-cell {
    padding: 4px 6px;
    display: table-cell;
    overflow: visible;
    text-align: center;
    vertical-align: middle;
}

/* Anchos independientes para los catalogos de cuatro atributos. */
#tablaTiposEnte td[data-campo="descripcion"], #tablaTiposEnte th:nth-child(3),
#tablaCategoriasEnte td[data-campo="descripcion"], #tablaCategoriasEnte th:nth-child(3),
#tablaTamanosEnte td[data-campo="descripcion"], #tablaTamanosEnte th:nth-child(3),
#tablaCargosEnte td[data-campo="descripcion"], #tablaCargosEnte th:nth-child(3),
#tablaAtributosEnte td[data-campo="descripcion"], #tablaAtributosEnte th:nth-child(3) {
    width: 36%;
    min-width: 260px;
    max-width: 420px;
}

#tablaTiposEnte td[data-campo="vigente"], #tablaTiposEnte th:nth-child(4),
#tablaCategoriasEnte td[data-campo="vigente"], #tablaCategoriasEnte th:nth-child(4),
#tablaTamanosEnte td[data-campo="vigente"], #tablaTamanosEnte th:nth-child(4),
#tablaCargosEnte td[data-campo="vigente"], #tablaCargosEnte th:nth-child(4),
#tablaAtributosEnte td[data-campo="vigente"], #tablaAtributosEnte th:nth-child(4) {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

/* Anchos independientes para tablas con mayor cantidad de atributos. */
#tablaEntes td[data-campo="descripcion"], #tablaEntes th:nth-child(12),
#tablaProyectos td[data-campo="descripcion"], #tablaProyectos th:nth-child(14) {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
}

#tablaEntes td[data-campo="vigente"], #tablaEntes th:nth-child(13),
#tablaProyectos td[data-campo="vigente"], #tablaProyectos th:nth-child(15),
#tablaEvaluadores td[data-campo="vigente"], #tablaEvaluadores th:nth-child(7) {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

#tablaPerfiles td[data-campo="descripcion"], #tablaPerfiles th:nth-child(2) {
    width: 260px;
    min-width: 260px;
    max-width: 320px;
}

/* Edit y Delete consideran tanto encabezados como celdas. */
#tablaTiposEnte th:nth-last-child(-n+2), #tablaTiposEnte td.table-action-cell,
#tablaCategoriasEnte th:nth-last-child(-n+2), #tablaCategoriasEnte td.table-action-cell,
#tablaTamanosEnte th:nth-last-child(-n+2), #tablaTamanosEnte td.table-action-cell,
#tablaCargosEnte th:nth-last-child(-n+2), #tablaCargosEnte td.table-action-cell,
#tablaAtributosEnte th:nth-last-child(-n+2), #tablaAtributosEnte td.table-action-cell,
#tablaEntes th:nth-last-child(-n+2), #tablaEntes td.table-action-cell,
#tablaProyectos th:nth-last-child(-n+2), #tablaProyectos td.table-action-cell,
#tablaEvaluadores th:nth-last-child(-n+2), #tablaEvaluadores td.table-action-cell,
#tablaPerfiles th:nth-last-child(-n+2), #tablaPerfiles td.table-action-cell,
#tablaModelosEvaluacion th:nth-last-child(-n+2), #tablaModelosEvaluacion td.table-action-cell,
#tablaAmbitosModelo th:nth-last-child(-n+2), #tablaAmbitosModelo td.table-action-cell,
#tablaItemsModelo th:nth-last-child(-n+2), #tablaItemsModelo td.table-action-cell,
#tablaPerfilesModelo th:nth-last-child(-n+2), #tablaPerfilesModelo td.table-action-cell {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    text-align: center;
}

#tablaModelosEvaluacion th:nth-child(4), #tablaModelosEvaluacion td:nth-child(4),
#tablaAmbitosModelo th:nth-child(3), #tablaAmbitosModelo td:nth-child(3),
#tablaItemsModelo th:nth-child(4), #tablaItemsModelo td:nth-child(4),
#tablaPerfilesModelo th:nth-child(4), #tablaPerfilesModelo td:nth-child(4) {
    width: 260px;
    min-width: 220px;
    max-width: 320px;
}

#tablaModelosEvaluacion th:nth-child(5), #tablaModelosEvaluacion td:nth-child(5),
#tablaAmbitosModelo th:nth-child(6), #tablaAmbitosModelo td:nth-child(6),
#tablaItemsModelo th:nth-child(7), #tablaItemsModelo td:nth-child(7) {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

.data-table .table-action-button {
    min-width: 54px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 4px 11px;
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.16);
}

.data-table .table-action-edit {
    border-color: #0284c7;
    background: #0ea5e9 !important;
}

.data-table .table-action-delete {
    border-color: #b02a37;
    background: #dc3545 !important;
}

.data-table .table-action-button:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
}

.crud-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
}

.crud-modal[hidden] { display: none !important; }

.crud-modal-dialog {
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

.crud-modal-header,
.crud-modal-footer {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-color: #e5edf1;
}

.crud-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid #e5edf1;
    background: var(--mada-pale);
}

.crud-modal-header h2 { margin: 0; color: var(--mada-title); font-size: 15px; font-weight: 800; }
.crud-modal-close { border: 0; background: transparent; color: #52616a; font-size: 24px; cursor: pointer; }
.crud-modal-body { max-height: calc(90vh - 126px); overflow-y: auto; padding: 16px; }
.crud-modal-footer { justify-content: flex-end; gap: 8px; border-top: 1px solid #e5edf1; }
.crud-form-group { margin-bottom: 10px; }
.crud-form-group label { display: block; margin-bottom: 4px; color: #34454e; font-size: 12px; font-weight: 700; }
.crud-form-check { display: flex; align-items: center; gap: 10px; }
.crud-form-check label { margin: 0; }

.crud-form-table {
    padding: 0;
    border-top: 1px solid #dbe4e9;
}

.crud-form-table .crud-form-group {
    display: grid;
    grid-template-columns: minmax(150px, 34%) 1fr;
    align-items: stretch;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid #dbe4e9;
}

.crud-form-table .crud-form-group > label {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 8px 12px;
    border-right: 1px solid #dbe4e9;
    color: #34454e;
    background: #f7fafb;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.crud-form-table .crud-form-group > input,
.crud-form-table .crud-form-group > select,
.crud-form-table .crud-form-group > textarea {
    width: calc(100% - 12px);
    margin: 5px 6px;
}

.crud-form-table textarea {
    min-height: 72px;
    resize: vertical;
    line-height: 1.4;
}

.crud-form-table .crud-form-check {
    display: grid;
}

.crud-form-table .crud-form-check > input {
    align-self: center;
    justify-self: start;
    width: 17px;
    margin: 7px 12px;
}

@media (max-width: 768px) {
    .login-shell {
        justify-content: center;
    }

    .login-hero {
        display: none;
    }

    .app-navbar {
        flex-wrap: wrap;
    }

    .navbar-user {
        margin-left: auto;
    }

    .navbar-dropdown-menu {
        position: fixed;
        top: 42px;
        right: 10px;
        left: 10px;
    }

    .table-page-header {
        grid-template-columns: 70px 1fr 70px;
        padding: 7px 12px;
    }

    .table-page-header h1 {
        font-size: 12px;
    }

    .table-page-context,
    .record-count {
        font-size: 12px;
    }

    .crud-form-table .crud-form-group {
        grid-template-columns: 125px 1fr;
    }
}

@media (max-width: 420px) {
    .login-page {
        padding: 16px;
    }

    .login-box {
        width: 100%;
        padding: 20px;
    }
}

/* Distribucion visual de evaluaciones con las fuentes alrededor del tablero central. */
.evaluation-assignment-page {
    min-height: calc(100vh - 42px);
    padding: 0 18px 34px;
    color: #203036;
    background: #f4f7f8;
}

.evaluation-assignment-header {
    margin: 0 -18px 14px;
    padding: 13px 24px;
    text-align: center;
    background: linear-gradient(180deg, #ebf7fd, #e0f0fa);
    border-radius: 0 0 16px 16px;
}

.evaluation-assignment-header h1 { margin: 0; color: #0b4f93; font-size: 16px; font-weight: 900; text-transform: uppercase; }
.evaluation-assignment-header p { margin: 4px 0 0; color: #516773; font-size: 12px; }

.evaluation-event-selector {
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 12px;
    padding: 14px 18px;
    border: 2px solid var(--mada-title);
    border-radius: 12px;
    background: var(--mada-pale);
    box-shadow: 0 7px 18px rgba(34, 95, 120, .18);
}

.evaluation-event-selector label { flex: 0 0 auto; margin: 0; font-weight: 800; }
.evaluation-event-selector select { min-width: 0; border-color: var(--mada-title); font-weight: 600; }

.evaluation-assignment-guide {
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 0 auto 14px;
    padding: 9px 14px;
    border: 1px solid #dce6e8;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
}

.evaluation-assignment-guide div { display: flex; flex-direction: column; gap: 2px; }
.evaluation-assignment-guide strong { color: #225f78; font-size: 12px; }
.evaluation-assignment-guide span { color: #68797f; font-size: 12px; }
.evaluation-guide-arrow { font-size: 16px !important; }

.evaluation-assignment-workspace {
    width: 100%;
    max-width: 1600px;
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(500px, 1.45fr) minmax(280px, .9fr);
    grid-template-rows: minmax(300px, 1fr) minmax(300px, 1fr);
    grid-template-areas:
        "entes board proyectos"
        "entes board evaluadores";
    gap: 16px;
    margin: 0 auto;
    align-items: stretch;
}

.evaluation-source-panel,
.evaluation-board-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dce6e8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(30, 62, 69, .08);
}

.evaluation-assignment-workspace.is-readonly {
    display: block;
    max-width: 1000px;
}

.evaluation-assignment-workspace.is-readonly .evaluation-board-panel {
    width: 100%;
}

.evaluation-source-entes { grid-area: entes; }
.evaluation-source-evaluadores { grid-area: evaluadores; }
.evaluation-source-proyectos { grid-area: proyectos; }
.evaluation-board-panel {
    grid-area: board;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    align-self: center;
    justify-self: center;
    display: flex;
    flex-direction: column;
}

.evaluation-panel-heading {
    min-height: 64px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px 10px;
    border-bottom: 1px solid #dce6e8;
}

.evaluation-panel-heading h2 { margin: 0 0 2px; font-size: 14px; font-weight: 800; }
.evaluation-panel-heading p { margin: 0; color: #68797f; font-size: 12px; line-height: 1.35; }
.evaluation-panel-counter { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: #52666b; background: #f0f4f5; font-size: 12px; font-weight: 800; white-space: nowrap; }

.evaluation-datatable-container { padding: 9px 10px; }
.evaluation-datatable-container .dataTables_wrapper { font-size: 12px; }
.evaluation-datatable-container .dataTables_length,
.evaluation-datatable-container .dataTables_filter { margin-bottom: 8px; }
.evaluation-datatable-container .dataTables_length select { min-width: 54px; }
.evaluation-datatable-container .dataTables_filter input { width: 118px; margin-left: 4px; }
.evaluation-datatable-container table { font-size: 12px; }
.evaluation-datatable-container tbody tr { cursor: grab; }
.evaluation-datatable-container tbody tr:hover { background: #f7fbfc; }
.evaluation-datatable-container tbody tr.is-dragging { opacity: .45; }

.evaluation-board { flex: 1; padding: 12px; background: linear-gradient(rgba(17, 71, 76, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 71, 76, .025) 1px, transparent 1px), #fbfcfd; background-size: 22px 22px; }
.evaluation-assignment-root { min-height: 560px; display: grid; grid-template-columns: 1fr; align-content: start; gap: 13px; padding: 13px; border: 1px solid #cbd8dc; border-radius: 13px; background: #ffffff; transition: .15s; }
.evaluation-assignment-root.is-empty { grid-template-columns: 1fr; place-items: center; }
.evaluation-assignment-root.is-over { border-color: #5059c9; background: #eef0fc; }
.evaluation-board-empty { max-width: 300px; display: flex; flex-direction: column; gap: 5px; color: #68797f; text-align: center; }
.evaluation-board-empty strong { color: #203036; font-size: 13px; }
.evaluation-board-empty span { font-size: 12px; }

.evaluation-entity-card { min-height: 150px; overflow: hidden; border: 1px solid #daddf5; border-radius: 12px; background: #ffffff; }
.evaluation-entity-card.is-over { box-shadow: inset 0 0 0 1px #5059c9; }
.evaluation-card-heading { display: flex; align-items: center; gap: 7px; padding: 9px 10px; }
.evaluation-entity-heading { border-bottom: 1px solid #daddf5; background: #eef0fc; }
.evaluation-project-heading { border-bottom: 1px solid #cce9e4; background: #e7f5f3; }
.evaluation-card-badge { padding: 3px 6px; border-radius: 5px; color: #ffffff; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.evaluation-card-badge-ente { background: #5059c9; }
.evaluation-card-badge-project { background: #287363; }
.evaluation-card-title { font-size: 12px; font-weight: 800; }
.evaluation-card-spacer { flex: 1; }
.evaluation-card-count { color: #68797f; font-size: 12px; }
.evaluation-card-remove { width: 25px; height: 25px; border: 0; border-radius: 6px; color: #74858a; background: transparent; font-size: 16px; cursor: pointer; }
.evaluation-card-remove:hover { color: #b94747; background: #fff0f0; }
.evaluation-card-body { padding: 11px; }
.evaluation-evaluator-zone { min-height: 44px; display: flex; flex-direction: column; gap: 6px; padding: 0 0 9px; border-bottom: 1px solid #e1e9ec; transition: .15s; }
.evaluation-evaluator-zone.is-over { background: #fbefe3; box-shadow: inset 0 0 0 1px #c5792e; }
.evaluation-direct-label { color: #68797f; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.evaluation-project-zone { display: flex; flex-direction: column; gap: 7px; }
.evaluation-project-card { overflow: hidden; border: 1px solid #cce9e4; border-radius: 9px; }
.evaluation-project-card .evaluation-evaluator-zone { padding: 8px; border-bottom: 0; }
.evaluation-evaluator-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.evaluation-evaluator-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px 4px 9px; border: 1px solid #ecd4bb; border-radius: 999px; color: #975819; background: #fbefe3; font-size: 12px; font-weight: 700; }
.evaluation-evaluator-tag button { border: 0; color: #9f754d; background: transparent; cursor: pointer; }

.evaluation-assignment-summary { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 12px; border-top: 1px solid #dce6e8; background: #f8fbfb; }
.evaluation-assignment-summary span { padding: 4px 8px; border: 1px solid #dce6e8; border-radius: 999px; color: #53676c; background: #ffffff; font-size: 12px; font-weight: 700; }
.evaluation-assignment-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #dce6e8; }
.evaluation-assignment-output { display: none; max-height: 240px; margin: 0; padding: 12px; overflow: auto; border-top: 1px solid #25464b; color: #d7f4ef; background: #102327; font-size: 12px; }

@media (max-width: 1200px) {
    .evaluation-assignment-workspace {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 360px 360px;
        grid-template-areas: "board board" "entes proyectos" "entes evaluadores";
    }

    .evaluation-assignment-root { min-height: 400px; }
}

@media (max-width: 760px) {
    .evaluation-assignment-page { padding-right: 10px; padding-left: 10px; }
    .evaluation-assignment-header { margin-right: -10px; margin-left: -10px; }
    .evaluation-event-selector { display: block; }
    .evaluation-event-selector select { margin-top: 5px; }
    .evaluation-assignment-guide { grid-template-columns: 1fr; }
    .evaluation-guide-arrow { transform: rotate(90deg); }
    .evaluation-assignment-workspace { display: flex; flex-direction: column; }
    .evaluation-board-panel { order: 1; }
    .evaluation-source-entes { order: 2; }
    .evaluation-source-proyectos { order: 3; }
    .evaluation-source-evaluadores { order: 4; }
}

/* Formulario de respuesta de evaluaciones. */
.rating-page { color: #173241; }
.rating-selector,
.rating-form { max-width: 820px; }
.rating-form { margin: 0 auto; }
.rating-scope { margin-bottom: 13px; padding: 5px 16px 9px; border: 1px solid #d8e5eb; border-radius: 12px; background: #ffffff; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.rating-scope h2 { margin: 11px 0 2px; color: #225f78; font-size: 14px; font-weight: 900; }
.rating-scope-description { margin-bottom: 7px; color: #71858f; font-size: 12px; }
.rating-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; border-top: 1px solid #e3ebef; }
.rating-item-text { flex: 1; min-width: 0; }
.rating-item-name { font-size: 13px; font-weight: 800; }
.rating-item-description { color: #71858f; font-size: 12px; }
.rating-item-missing { margin-top: 3px; color: #c0392b; font-size: 12px; font-weight: 700; }
.rating-item.rating-item-faltante { padding-right: 10px; padding-left: 10px; border-left: 3px solid #c0392b; border-radius: 8px; background: #fdf0ee; }
.rating-item.rating-item-faltante .rating-star { color: #efb7b0; }
.rating-faltantes { margin: 8px 0 0; padding-left: 20px; text-align: left; }
.rating-control { display: flex; align-items: center; flex-shrink: 0; gap: 9px; }
.rating-stars { position: relative; display: inline-flex; outline: 0; font-size: 25px; line-height: 1; cursor: pointer; touch-action: none; }
.rating-stars:focus-visible { border-radius: 5px; box-shadow: 0 0 0 3px rgba(59, 143, 164, .28); }
.rating-star { position: relative; width: 1em; height: 1em; color: #d3dde2; }
.rating-star::before { position: absolute; inset: 0; content: "★"; }
.rating-star-fill { position: absolute; inset: 0; width: 0; overflow: hidden; color: #edae35; }
.rating-star-fill::before { content: "★"; }
.rating-meta { min-width: 105px; font-size: 12px; }
.rating-value { font-size: 14px; font-weight: 900; }
.rating-label { color: #71858f; }
.rating-meta.empty .rating-value { color: #71858f; font-size: 12px; }
.rating-actions { display: flex; justify-content: center; gap: 9px; margin-top: 15px; }
.rating-output { display: none; margin-top: 14px; padding: 12px; overflow: auto; border-radius: 8px; color: #dff4ec; background: #173241; font-size: 12px; }

/* Reportes compactos: priorizan mostrar grafico, tabla y acciones sin desplazamiento innecesario. */
.reporte-resultados { margin-top: 8px !important; padding-bottom: 10px !important; }
.reporte-resultados > .d-print-none { margin-bottom: 8px !important; }
.reporte-resultados .card { margin-bottom: 8px !important; }
.reporte-resultados .card-header { padding: 5px 12px; font-size: 12px; }
.reporte-resultados .card-body { padding: 7px 12px; }
.reporte-resultados #graficoResultados { height: 270px; min-height: 270px !important; }
.reporte-ambitos #graficoResultados { height: 360px; min-height: 360px !important; }
.reporte-resultados .table { margin-bottom: 0; font-size: 11px; line-height: 1.15; }
.reporte-resultados .table th,
.reporte-resultados .table td { padding: 4px 7px; vertical-align: middle; }
.reporte-resultados .table-responsive { max-width: 1380px; margin-right: auto; margin-left: auto; }
.reporte-resultados .dataTables_wrapper { font-size: 11px; }
.reporte-resultados .dataTables_wrapper .row { margin-top: 4px; margin-bottom: 4px; }
.reporte-resultados .nota-etiqueta { min-width: 80px; padding: 3px 8px; font-size: 11px; }

.reporte-resumen { margin-top: 8px !important; padding-right: 18px !important; padding-bottom: 10px !important; padding-left: 18px !important; }
.reporte-resumen .mb-3 { margin-bottom: 8px !important; }
.reporte-resumen .card-header { padding: 5px 12px; font-size: 12px; }
.reporte-resumen .card-body { padding: 7px 12px; }
.reporte-resumen #graficoPromedioEnte,
.reporte-resumen #graficoPromedioAmbito { height: 250px; min-height: 250px !important; }

.reporte-selector { max-width: 1380px; }

.reporte-evento,
.reporte-modelo { padding-right: 18px !important; padding-bottom: 12px !important; padding-left: 18px !important; }
.reporte-evento .rating-scope,
.reporte-modelo .rating-scope { margin-bottom: 8px; padding: 4px 12px 7px; }
.reporte-evento .rating-scope h2,
.reporte-modelo .rating-scope h2 { margin-top: 6px; font-size: 13px; }
.reporte-evento .rating-scope-description,
.reporte-modelo .rating-scope-description { margin-bottom: 4px; font-size: 11px; }
.reporte-evento table,
.reporte-modelo table { font-size: 11px; line-height: 1.1; }
.reporte-evento th,
.reporte-evento td,
.reporte-modelo th,
.reporte-modelo td { padding: 4px 6px; }

.survey-response-page { width: 100%; max-width: 900px; min-height: 100vh; margin: 0 auto; padding: 28px 20px 44px; background: #f7fafc; }
.survey-response-header { margin-bottom: 18px; padding: 18px 20px; border-radius: 12px; background: linear-gradient(180deg, #ebf7fd, #e0f0fa); text-align: center; }
.survey-response-header h1 { margin: 0; color: #0b4f93; font-size: 18px; font-weight: 900; text-transform: uppercase; }
.survey-response-context { margin-top: 6px; color: #225f78; font-size: 12px; }
.survey-response-header p { margin: 6px 0 0; color: #526c78; font-size: 12px; }

@media (max-width: 680px) {
    .rating-item { align-items: flex-start; flex-direction: column; }
    .rating-control { width: 100%; justify-content: space-between; }
}
