* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: #4d5b6c; background: #fff; font-size: 13px; }
a { color: inherit; text-decoration: none; }

/* Login */
.login-page { background: #fff; }
.login-header { height: 174px; background: #2c5234; display: flex; align-items: center; justify-content: space-around; padding: 10px 18%; }
.login-brand { width: 50%; text-align: center; }
.login-brand.left img { max-height: 110px; max-width: 180px; }
.login-brand.right img { max-height: 100px; max-width: 300px; }
.login-pleca { height: 5px; background: #9c8412 url('../img/pleca.jpg') center/cover no-repeat; }
.login-card { width: 300px; margin: 22px auto 0; padding: 12px; border-radius: 8px; background: #fff; box-shadow: 0 30px 60px rgba(0,0,0,.30); }
.login-module { text-align: center; margin-bottom: 18px; }
.login-module img { width: 205px; max-width: 100%; }
.login-control { margin-bottom: 18px; text-align: center; }
.login-control label { display: block; padding-top: 10px; margin-bottom: 10px; color: rgba(13,13,13,.58); font-size: 14px; }
.login-control label strong { border-bottom: 2px solid #2a5135; padding: 5px 10px; }
.login-control input { width: 100%; border: 1px solid #ddd; border-radius: 3px; padding: 12px; text-align: center; font-size: 13px; }
.login-control input:focus { background: #e6eaee; outline: none; box-shadow: 0 0 2px rgba(53,64,79,.25); }
.login-submit { margin: 26px 0 18px; text-align: center; }
.login-submit button { width: 82%; padding: 10px 16px; background: #2a5135; color: #fff; font-weight: bold; border: 0; border-radius: 3px; box-shadow: 0 3px 0 #9c8412; cursor: pointer; }

/* Encabezado del sistema */
.institutional-header { min-height: 140px; display: flex; background: #fff; border-bottom: 2px solid #2c5234; }
.institutional-brand { width: 52%; display: flex; align-items: stretch; overflow: hidden; }
.institutional-brand img { width: 100%; object-fit: contain; object-position: left center; }
.user-summary { width: 48%; padding: 18px 30px; color: #00520b; font-weight: bold; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.user-summary div { display: grid; grid-template-columns: 105px 1fr; column-gap: 12px; }
.user-summary span { color: #00520b; }

/* Menú */
.main-nav { min-height: 43px; background: #343434; display: flex; align-items: stretch; color: #ddd; }
.nav-item { position: relative; }
.nav-item > a { display: block; padding: 14px 18px; }
.nav-item:hover > a { background: #26785d; color: #fff; }
.dropdown-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 260px; background: #414141; z-index: 50; box-shadow: 0 3px 7px rgba(0,0,0,.2); }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 11px 14px; color: #ddd; white-space: nowrap; }
.dropdown-menu a:hover { background: #343434; color: #fff; }

.page-content { min-height: calc(100vh - 210px); background: #fff; padding-bottom: 40px; }
.content-tabs { height: 38px; background: #f5f6f7; border-bottom: 1px solid #d7dce0; padding: 9px 12px; color: #597085; }

.panel { width: 82%; margin: 18px auto; background: #fff; box-shadow: 0 0 24px rgba(0,0,0,.04); padding-bottom: 25px; }
.panel-medium { width: 64%; }
.panel-title { min-height: 44px; background: #5ca25c; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; font-size: 12px; font-weight: bold; }
.toolbar { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 18px 18px 28px; }
.toolbar input { margin-right: auto; width: 150px; padding: 9px 12px; border: 1px solid #dfe4e8; border-radius: 3px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 4px; }
.btn-primary { background: #12c998; color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.12); }
.btn-secondary { background: #e8eef3; color: #405263; }

.table-wrap { overflow-x: auto; padding: 0 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { background: #eef2f6; color: #61758a; padding: 13px 12px; border: 1px solid #e1e6ea; font-weight: normal; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #e7ebef; color: #607284; }
.data-table tbody tr:hover { background: #fafcfd; }
.empty-row { text-align: center; padding: 28px !important; }
.placeholder-box { padding: 35px; text-align: center; color: #607284; }
.placeholder-box h2 { color: #455a6e; font-size: 18px; }
.alert { margin: 12px 18px; padding: 10px 14px; border-radius: 3px; }
.alert-error { background: #fbe9e9; color: #9b2c2c; border: 1px solid #efc4c4; }
.alert-success { background: #eaf7ee; color: #236b39; border: 1px solid #bfdfc9; }
.site-footer { position: fixed; left: 0; right: 0; bottom: 0; height: 25px; background: #fff; color: #a0a0a0; padding: 6px 4px; font-size: 11px; }

@media (max-width: 980px) {
    .institutional-header { flex-direction: column; }
    .institutional-brand, .user-summary { width: 100%; }
    .user-summary { padding: 12px 20px; }
    .panel, .panel-medium { width: 96%; }
    .main-nav { flex-wrap: wrap; }
    .login-header { padding: 10px 3%; }
}

/* Formularios S3 FNG */
.form-panel { padding-bottom: 34px; }
.stepper { display: flex; gap: 0; justify-content: center; padding: 22px 18px 10px; flex-wrap: wrap; }
.step { min-width: 180px; padding: 10px 16px; background: #eef2f4; color: #7a8996; border-right: 1px solid #fff; text-align: center; }
.step b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: #c8d0d6; color: #fff; margin-right: 5px; }
.step.active { background: #e2f0e2; color: #2d6c35; font-weight: bold; }
.step.active b { background: #5ca25c; }
.step.done { background: #edf7f2; color: #31745c; }
.step.done b { background: #12a779; }
.form-section-title { margin: 22px 28px 12px; padding: 10px 12px; background: #eef1f3; color: #526678; border-left: 4px solid #5ca25c; font-weight: bold; font-size: 12px; }
.section-with-action { display: flex; justify-content: space-between; align-items: center; }
.form-grid { display: grid; gap: 16px 18px; padding: 4px 28px 10px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-span-2 { grid-column: span 2; }
.form-span-3 { grid-column: span 3; }
.form-group { min-width: 0; }
.form-group label { display: block; margin: 0 0 6px; color: #5a6c7b; font-size: 12px; }
.form-control { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid #d5dde3; border-radius: 3px; background: #fff; color: #44586a; font-family: inherit; font-size: 12px; }
textarea.form-control { resize: vertical; }
.form-control:focus { outline: none; border-color: #73a979; box-shadow: 0 0 0 2px rgba(92,162,92,.10); }
.form-control.readonly, .form-control[readonly] { background: #f2f4f5; color: #7a8792; }
.field-help { display: block; margin-top: 5px; color: #98a3ac; font-size: 10px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; margin: 28px 28px 4px; padding-top: 18px; border-top: 1px solid #e4e9ec; }
.btn-success { background: #5ca25c; color: #fff; border: 0; cursor: pointer; }
button.btn { border: 0; font-family: inherit; cursor: pointer; }
.btn-small { padding: 6px 10px; font-size: 11px; }
.repeatable-container { padding: 0 28px 4px; }
.repeatable-card { border: 1px solid #dfe5e8; border-radius: 4px; margin: 0 0 16px; background: #fbfcfc; overflow: hidden; }
.repeatable-header { display: flex; justify-content: space-between; align-items: center; background: #f1f4f5; padding: 9px 12px; color: #506475; }
.btn-link-danger { background: transparent; border: 0; color: #b94b4b; cursor: pointer; font-size: 11px; }
.nested-title { display: flex; justify-content: space-between; align-items: center; margin: 4px 20px 10px; padding: 8px 10px; background: #f4f6f7; color: #667785; font-weight: bold; }
.normatividades-container { padding: 0 20px 14px; }
.normatividad-row { display: grid; grid-template-columns: 1fr 1fr 2.4fr 30px; gap: 12px; align-items: end; margin-bottom: 10px; }
.normatividad-row .btn-link-danger { height: 36px; font-size: 20px; }
.sancion-fields { display: none; border-top: 1px dashed #dfe5e8; padding: 12px 0 2px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 18px 28px; }
.summary-card { border: 1px solid #dfe5e8; border-radius: 4px; padding: 15px; position: relative; background: #fcfdfd; }
.summary-title { color: #426857; font-weight: bold; margin-bottom: 12px; padding-bottom: 7px; border-bottom: 2px solid #e4efea; }
.summary-card p { margin: 7px 0; line-height: 1.4; }
.summary-edit { display: inline-block; margin-top: 8px; color: #178866; font-weight: bold; }
.completion-note { margin: 0 28px 12px; padding: 12px 14px; background: #f3f7f4; border-left: 4px solid #5ca25c; color: #586b60; }

@media (max-width: 1100px) {
    .form-grid-4, .form-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .form-grid-3, .form-grid-4, .form-grid-5 { grid-template-columns: 1fr; }
    .form-span-2, .form-span-3 { grid-column: span 1; }
    .normatividad-row { grid-template-columns: 1fr; }
    .step { min-width: 100%; }
    .form-actions { gap: 12px; flex-direction: column-reverse; align-items: stretch; }
    .form-actions .btn { text-align: center; }
}


/* Consulta y detalle S3 */
.conditional-field[hidden] { display: none !important; }
.consulta-panel { width: 92%; }
.consulta-switch { display: flex; align-items: center; gap: 10px; padding: 18px 18px 2px; flex-wrap: wrap; }
.consulta-note { color: #7a8996; font-size: 11px; margin-left: 6px; }
.consulta-toolbar { padding-top: 12px; padding-bottom: 18px; justify-content: flex-start; }
.consulta-toolbar input { margin-right: 0; width: 175px; }
.detail-link { color: #3276b1; font-size: 17px; text-decoration: none; }
.detail-panel { width: 88%; padding-bottom: 34px; }
.detail-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px 2px; }
.status-badge { display: inline-block; border-radius: 12px; padding: 5px 10px; font-size: 10px; font-weight: bold; }
.status-completo { background: #e6f4e8; color: #2e6f36; }
.status-historico { background: #eef1f4; color: #5d6b78; }
.history-warning { margin: 16px 28px 6px; padding: 12px 14px; background: #fff7e6; border-left: 4px solid #d9a441; color: #765b22; font-size: 12px; }
.detail-section { margin: 22px 28px 0; border: 1px solid #e0e5e9; background: #fff; }
.detail-section > h3 { margin: 0; padding: 10px 12px; background: #eef1f3; color: #526678; border-left: 4px solid #5ca25c; font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.detail-grid > div { padding: 12px 14px; border-right: 1px solid #edf0f2; border-bottom: 1px solid #edf0f2; min-width: 0; }
.detail-grid b { display: block; color: #607284; font-size: 10px; margin-bottom: 5px; text-transform: uppercase; }
.detail-grid span { display: block; color: #3f5365; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.detail-span-2 { grid-column: span 2; }
.detail-span-3 { grid-column: span 3; }
.detail-subcard { margin: 14px; border: 1px solid #e4e8eb; background: #fbfcfc; }
.detail-subcard h4 { margin: 0; padding: 9px 12px; background: #f4f6f7; color: #526678; font-size: 11px; }
.detail-table { padding: 12px; }
.detail-empty { margin: 16px; color: #788793; }
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-span-2, .detail-span-3 { grid-column: span 1; }
    .detail-panel, .consulta-panel { width: 96%; }
}

/* =========================================================
   V2.4 - Responsive/zoom, navegación, requeridos y filtros
   ========================================================= */
.required-mark {
    color: #c62828;
    font-weight: bold;
    margin-left: 2px;
}
.required-legend {
    margin: 2px 28px 8px;
    color: #8b4a4a;
    font-size: 11px;
    text-align: right;
}

/* Los pasos funcionan como navegación cuando existe un folio. */
.step-link {
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.step-link:hover,
.step-link:focus {
    background: #d9ecdf;
    color: #245f35;
    box-shadow: inset 0 -3px 0 #5ca25c;
    outline: none;
}
.step.disabled {
    cursor: not-allowed;
    opacity: .72;
}

/* Encabezado: limitar el ancho máximo de la imagen evita que el zoom-out
   sea compensado por el aumento artificial del viewport CSS. */
.institutional-header {
    min-height: 0;
    align-items: center;
}
.institutional-brand {
    flex: 0 1 760px;
    width: min(52%, 760px);
    max-width: 760px;
    align-items: center;
    overflow: visible;
}
.institutional-brand img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}
.user-summary {
    flex: 1 1 520px;
    width: auto;
    min-width: 0;
    padding: clamp(10px, 1.4vw, 18px) clamp(16px, 2vw, 30px);
    gap: clamp(6px, .8vw, 12px);
    font-size: clamp(11px, .78vw, 13px);
}
.user-summary div {
    grid-template-columns: minmax(82px, 105px) minmax(0, 1fr);
}

/* El contenido mantiene un máximo razonable para que todo responda al zoom. */
.panel {
    width: calc(100% - 36px);
    max-width: 1450px;
}
.panel-medium {
    width: calc(100% - 36px);
    max-width: 1120px;
}
.consulta-panel {
    width: calc(100% - 36px);
    max-width: 1650px;
}
.detail-panel {
    width: calc(100% - 36px);
    max-width: 1500px;
}



/* Resaltado de coincidencias de la Búsqueda Rápida */
mark.search-highlight {
    background: #ffeb3b;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

/* Ajuste adicional para zoom/responsive. */
@media (max-width: 1180px) {
    .institutional-brand {
        flex-basis: 620px;
        max-width: 620px;
    }
    .user-summary {
        flex-basis: 420px;
    }
    .step {
        min-width: 155px;
    }
}

@media (max-width: 900px) {
    .institutional-header {
        flex-direction: column;
        align-items: stretch;
    }
    .institutional-brand {
        width: 100%;
        max-width: 760px;
        flex-basis: auto;
        margin: 0 auto;
    }
    .user-summary {
        width: 100%;
        flex-basis: auto;
    }
    .main-nav {
        overflow-x: auto;
    }
    .nav-item > a {
        white-space: nowrap;
    }
    .panel,
    .panel-medium,
    .consulta-panel,
    .detail-panel {
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
    }
}

@media (max-width: 620px) {
    .user-summary div {
        grid-template-columns: 82px minmax(0, 1fr);
        column-gap: 8px;
    }
    .table-wrap {
        padding-left: 8px;
        padding-right: 8px;
    }
    .toolbar {
        flex-wrap: wrap;
        gap: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }
    .toolbar input {
        width: 100%;
        margin-right: 0;
    }
    .required-legend {
        margin-left: 14px;
        margin-right: 14px;
    }
}

/* =========================================================
   V2.6 - Cierre visual corporativo y administración usuarios
   ========================================================= */
:root {
    --uaem-green: #285238;
    --uaem-green-2: #356d48;
    --uaem-green-soft: #edf4ef;
    --uaem-gold: #b59a32;
    --surface: #ffffff;
    --surface-soft: #f6f8f7;
    --ink: #33485a;
    --muted: #71808d;
    --border: #dfe6e2;
    --danger: #b44444;
}

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--surface-soft);
    -webkit-font-smoothing: antialiased;
}

/* Login con proporciones equivalentes al sistema anterior, pero más limpio. */
.login-page {
    min-height: 100vh;
    background: #fff;
}
.login-header {
    height: 228px;
    min-height: 228px;
    padding: 18px clamp(55px, 18vw, 360px);
    background: var(--uaem-green);
    justify-content: space-between;
    gap: 80px;
}
.login-brand {
    width: auto;
    flex: 1 1 0;
}
.login-brand.left { text-align: left; }
.login-brand.right { text-align: right; }
.login-brand.left img {
    width: auto;
    height: auto;
    max-height: 142px;
    max-width: 215px;
}
.login-brand.right img {
    width: auto;
    height: auto;
    max-height: 125px;
    max-width: 335px;
}
.login-pleca {
    height: 6px;
    box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.login-main {
    min-height: calc(100vh - 234px);
    padding: 30px 14px 70px;
}
.login-card {
    width: min(400px, calc(100vw - 28px));
    margin: 0 auto;
    padding: 17px 20px 22px;
    border: 1px solid rgba(40,82,56,.09);
    border-top: 4px solid var(--uaem-green);
    border-radius: 10px;
    box-shadow: 0 24px 55px rgba(29,48,37,.22);
}
.login-module {
    margin: 0 0 8px;
}
.login-module img {
    width: 270px;
    max-width: 100%;
}
.login-title {
    margin: 2px 0 2px;
    text-align: center;
    color: var(--uaem-green);
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}
.login-subtitle {
    margin: 0 0 14px;
    text-align: center;
    color: #738178;
    font-size: 12px;
}
.login-card .alert {
    margin: 10px 0 14px;
}
.login-control {
    margin-bottom: 18px;
}
.login-control label {
    padding-top: 5px;
    margin-bottom: 9px;
    color: #4f5f55;
    font-size: 15px;
}
.login-control label strong {
    border-bottom: 2px solid var(--uaem-green-2);
    padding: 5px 10px;
}
.login-control input {
    min-height: 47px;
    padding: 12px 14px;
    border: 1px solid #d3dbd6;
    border-radius: 5px;
    background: #fff;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-control input:focus {
    background: #f8fbf9;
    border-color: #6c9a79;
    box-shadow: 0 0 0 3px rgba(53,109,72,.10);
}
.login-submit {
    margin: 26px 0 6px;
}
.login-submit button {
    width: 84%;
    min-height: 46px;
    border-radius: 5px;
    background: var(--uaem-green);
    box-shadow: 0 3px 0 var(--uaem-gold);
    font-size: 14px;
    letter-spacing: .1px;
    transition: transform .12s ease, background .12s ease;
}
.login-submit button:hover {
    background: #21462f;
    transform: translateY(-1px);
}

/* Encabezado interior: marca a la izquierda, información desplazada a la derecha. */
.institutional-header {
    min-height: 142px;
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dce4df;
    box-shadow: 0 2px 8px rgba(35,68,47,.05);
}
.institutional-brand {
    flex: 0 1 760px;
    width: min(46%, 760px);
    max-width: 760px;
    min-width: 460px;
    align-self: stretch;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.institutional-brand img {
    width: 100%;
    height: auto;
    max-width: 760px;
    object-fit: contain;
    object-position: left center;
}
.user-summary {
    flex: 0 1 1020px;
    width: auto;
    max-width: 1020px;
    min-width: 520px;
    margin-left: auto;
    padding: 20px clamp(34px, 4.3vw, 86px) 20px 36px;
    gap: 9px;
    color: #114f24;
    font-size: 13px;
    line-height: 1.25;
}
.user-summary div {
    grid-template-columns: 112px minmax(0, 1fr);
    column-gap: 16px;
}
.user-summary strong {
    color: #154f27;
    font-weight: 700;
}
.user-summary span {
    color: #0c5a20;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Menú institucional sin emojis dependientes del sistema operativo. */
.main-nav {
    min-height: 46px;
    background: #303332;
    border-bottom: 3px solid #2c6040;
    box-shadow: 0 2px 5px rgba(0,0,0,.08);
}
.nav-item > a {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    color: #e3e7e4;
    font-weight: 500;
}
.nav-item:hover > a,
.nav-item:focus-within > a {
    background: #3b6549;
    color: #fff;
}
.nav-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    flex: 0 0 16px;
}
.nav-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.nav-logout .nav-icon { color: #e36a6a; }
.dropdown-menu {
    border-top: 2px solid var(--uaem-gold);
    background: #383c3a;
    border-radius: 0 0 5px 5px;
}
.dropdown-menu a {
    padding: 12px 16px;
}
.dropdown-menu a:hover {
    background: #2c5238;
}

.page-content {
    min-height: calc(100vh - 216px);
    background: #f8f9f8;
    padding-bottom: 54px;
}
.content-tabs {
    background: #f2f5f3;
    border-bottom-color: #dce4df;
}
.panel,
.panel-medium,
.consulta-panel,
.detail-panel {
    border: 1px solid rgba(40,82,56,.07);
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(35,68,47,.07);
    overflow: hidden;
}
.panel-title {
    min-height: 48px;
    padding: 0 18px;
    background: linear-gradient(90deg, #4b9155 0%, #61a45f 100%);
    border-bottom: 3px solid rgba(181,154,50,.55);
    letter-spacing: .1px;
}
.toolbar {
    background: #fff;
}
.toolbar input {
    min-height: 38px;
    border-color: #d9e1dc;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.toolbar input:focus {
    outline: none;
    border-color: #75a280;
    box-shadow: 0 0 0 3px rgba(53,109,72,.08);
}
.btn {
    border-radius: 4px;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: #0cbd91;
    box-shadow: 0 3px 8px rgba(12,189,145,.18);
}
.btn-secondary {
    background: #e9eeeb;
    color: #41564a;
}
.data-table th {
    background: #edf2ef;
    color: #526c5b;
    border-color: #dce5df;
    font-weight: 600;
}
.data-table td {
    color: #536675;
    border-bottom-color: #e6ebe8;
}
.data-table tbody tr:hover {
    background: #f7faf8;
}
.edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #356d48;
    font-size: 16px;
    transition: background .12s ease, color .12s ease;
}
.edit-link:hover {
    background: #e6f1e9;
    color: #1d5231;
}
.action-column {
    width: 44px;
    text-align: center;
}
.status-inactive {
    background: #f1f2f2;
    color: #7c8580;
}
.permission-badge {
    display: inline-block;
    min-width: 78px;
    padding: 5px 9px;
    border-radius: 12px;
    background: #eef2f0;
    color: #54665b;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}
.permission-1 { background: #e5f2e8; color: #256039; }
.permission-2 { background: #e8f2f7; color: #35677c; }
.permission-3 { background: #f1eff6; color: #625879; }

/* Catálogo de usuarios. */
.users-panel {
    width: calc(100% - 36px);
    max-width: 1660px;
}
.users-toolbar {
    justify-content: space-between;
    padding-bottom: 20px;
}
.users-toolbar input {
    margin-right: 0;
    width: 210px;
}
.user-editor-panel {
    width: calc(100% - 50px);
    max-width: 1500px;
}
.user-form {
    background: #fff;
    padding: 12px 0 22px;
}
.user-form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 20px;
    padding: 18px 30px 10px;
}
.user-span-2 { grid-column: span 2; }
.user-form .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #617567;
}
.user-form .form-control {
    min-height: 40px;
    border-color: #cfdad3;
    border-radius: 4px;
    font-size: 12px;
}
.user-form select.form-control {
    cursor: pointer;
}
.user-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 20px 30px 0;
    padding-top: 18px;
    border-top: 1px solid #e2e8e4;
}

@media (max-width: 1500px) {
    .institutional-brand {
        flex-basis: 690px;
        min-width: 400px;
    }
    .user-summary {
        flex-basis: 790px;
        min-width: 470px;
        padding-right: 42px;
    }
}

@media (max-width: 1180px) {
    .login-header {
        padding-left: 10%;
        padding-right: 10%;
        gap: 40px;
    }
    .institutional-brand {
        flex-basis: 610px;
        min-width: 360px;
    }
    .user-summary {
        flex-basis: 620px;
        min-width: 420px;
        padding-left: 24px;
        padding-right: 26px;
    }
    .user-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .user-span-2 { grid-column: span 1; }
}

@media (max-width: 900px) {
    .login-header {
        height: 190px;
        min-height: 190px;
        padding: 18px 8%;
    }
    .login-brand.left img { max-height: 120px; max-width: 190px; }
    .login-brand.right img { max-height: 105px; max-width: 285px; }
    .login-main { min-height: calc(100vh - 196px); }

    .institutional-header {
        flex-direction: column;
        align-items: stretch;
    }
    .institutional-brand {
        width: 100%;
        max-width: 760px;
        min-width: 0;
        flex-basis: auto;
        margin: 0;
    }
    .user-summary {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex-basis: auto;
        margin-left: 0;
        padding: 14px 20px;
    }
    .user-form-grid {
        grid-template-columns: 1fr;
    }
    .users-panel,
    .user-editor-panel {
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
    }
}

@media (max-width: 620px) {
    .login-header {
        height: auto;
        min-height: 178px;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 16px 20px;
    }
    .login-brand.left,
    .login-brand.right { text-align: center; }
    .login-brand.left img { max-height: 80px; max-width: 145px; }
    .login-brand.right img { max-height: 70px; max-width: 220px; }
    .login-main { min-height: auto; padding-top: 20px; }
    .login-card { width: calc(100vw - 24px); }

    .users-toolbar {
        align-items: stretch;
    }
    .users-toolbar input,
    .users-toolbar .btn {
        width: 100%;
        text-align: center;
    }
    .user-form-grid {
        padding-left: 16px;
        padding-right: 16px;
    }
    .user-form-actions {
        margin-left: 16px;
        margin-right: 16px;
        flex-direction: column-reverse;
    }
    .user-form-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Campos institucionales fijos: visibles pero no modificables. */
.form-control.institutional-fixed:disabled {
    background-color: #eef1f3;
    color: #52616b;
    border-color: #d3dbe0;
    cursor: not-allowed;
    opacity: 1;
    -webkit-text-fill-color: #52616b;
}
