/* Identidad visual institucional - Gobierno del Estado de Mexico */
:root {
    --edomex-black: #000000;
    --edomex-wine: #5c2137;
    --edomex-wine-dark: #451728;
    --edomex-wine-soft: #f2efe9;
    --edomex-gold: #a57f3c;
    --edomex-gold-dark: #84652f;
    --edomex-beige: #c6a77b;
    --edomex-warm-gray: #d6d1ca;
    --edomex-canvas: #f2f0ec;
    --edomex-surface: #fbfaf8;
    --edomex-surface-muted: #f6f3ef;
    --edomex-text: #373234;
    --edomex-muted: #736d6f;
    --edomex-border: #ddd8d2;
    --edomex-success: #287a55;
    --edomex-danger: #a33a46;
    --edomex-info: #416c82;
    --ui-radius: 10px;
    --ui-shadow: 0 4px 18px rgba(53, 38, 43, .08);
}
/* Selector y temas globales */
:root {
    color-scheme: light;
    --theme-canvas: #f2f0ec;
    --theme-surface: #fbfaf8;
    --theme-surface-raised: #ffffff;
    --theme-surface-muted: #f5f2ee;
    --theme-text: #312a2c;
    --theme-muted: #756b6d;
    --theme-border: #ded8d2;
    --theme-header: #542236;
    --theme-accent: #6f1d3b;
    --theme-accent-hover: #58162f;
    --theme-selection: #eee9e1;
    --theme-input: #ffffff;
    --theme-shadow: rgba(53, 38, 43, .08);
}

[data-theme="dark"] {
    color-scheme: dark;
    --theme-canvas: #202327;
    --theme-surface: #292d32;
    --theme-surface-raised: #30353b;
    --theme-surface-muted: #25292e;
    --theme-text: #eef0f2;
    --theme-muted: #b8bec5;
    --theme-border: #454b52;
    --theme-header: #3d202c;
    --theme-accent: #c89aab;
    --theme-accent-hover: #ddb4c2;
    --theme-selection: #3a3735;
    --theme-input: #25292e;
    --theme-shadow: rgba(0, 0, 0, .24);
    --edomex-canvas: var(--theme-canvas);
    --edomex-surface: var(--theme-surface);
    --edomex-surface-muted: var(--theme-surface-muted);
    --edomex-text: var(--theme-text);
    --edomex-muted: var(--theme-muted);
    --edomex-border: var(--theme-border);
    --edomex-wine: #c89aab;
    --edomex-wine-dark: #3d202c;
    --edomex-wine-soft: #3a3735;
    --edomex-gold: #c5a56e;
    --edomex-gold-dark: #d1b57f;
    --edomex-beige: #9f8357;
    --ui-shadow: 0 6px 20px var(--theme-shadow);
}

.ui-theme-control {
    display: flex !important;
    align-items: center;
    min-height: 50px;
}

.ui-theme-toggle {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: inherit;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease;
}

.ui-theme-toggle:hover,
.ui-theme-toggle:focus {
    border-color: rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .16);
    color: #fff;
    outline: 0;
}

.ui-theme-toggle-auth {
    position: fixed;
    z-index: 1050;
    top: 18px;
    right: 18px;
    border-color: var(--theme-border);
    background: var(--theme-surface-raised);
    color: var(--theme-text);
    box-shadow: 0 4px 14px var(--theme-shadow);
}

.ui-theme-toggle-auth:hover,
.ui-theme-toggle-auth:focus {
    border-color: var(--edomex-gold);
    background: var(--theme-selection);
    color: var(--theme-text);
}

[data-theme="dark"] body,
[data-theme="dark"] .content-wrapper,
[data-theme="dark"] .right-side,
[data-theme="dark"] .main-footer,
[data-theme="dark"] .ui-auth-page {
    background: var(--theme-canvas) !important;
    color: var(--theme-text);
}

[data-theme="dark"] .ui-auth-page {
    background-image: linear-gradient(rgba(28, 31, 35, .9), rgba(28, 31, 35, .94)), url("../../../assets/img/portada.png");
}

[data-theme="dark"] .main-header .logo,
[data-theme="dark"] .main-header .navbar,
[data-theme="dark"] .skin-green .main-header .logo,
[data-theme="dark"] .skin-green .main-header .navbar,
[data-theme="dark"] .skin-green-light .main-header .logo,
[data-theme="dark"] .skin-green-light .main-header .navbar {
    background: var(--theme-header) !important;
}

[data-theme="dark"] .main-sidebar,
[data-theme="dark"] .left-side,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .skin-green .main-sidebar,
[data-theme="dark"] .skin-green-light .main-sidebar {
    background: #25292e !important;
    border-color: var(--theme-border);
}

[data-theme="dark"] .main-sidebar .user-panel,
[data-theme="dark"] .main-sidebar .user-panel > .info > p,
[data-theme="dark"] .main-sidebar .user-panel > .info > a {
    color: var(--theme-text) !important;
    border-color: var(--theme-border);
}

[data-theme="dark"] .sidebar-menu > li > a,
[data-theme="dark"] .sidebar-menu .treeview-menu > li > a {
    color: #dce0e4 !important;
}

[data-theme="dark"] .main-sidebar .sidebar-menu > li:hover > a,
[data-theme="dark"] .main-sidebar .sidebar-menu > li.active > a,
[data-theme="dark"] .main-sidebar .sidebar-menu > li.menu-open > a {
    background: #38363a !important;
    color: #f1dce4 !important;
}

[data-theme="dark"] .main-sidebar .sidebar-menu .treeview-menu {
    background: #22262a !important;
}

[data-theme="dark"] .main-sidebar .sidebar-menu .treeview-menu > li.active > a,
[data-theme="dark"] .main-sidebar .sidebar-menu .treeview-menu > li > a:hover {
    background: #3a3837 !important;
    color: #f0e2e7 !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] label,
[data-theme="dark"] legend,
[data-theme="dark"] .content-header > h1,
[data-theme="dark"] .box-header .box-title,
[data-theme="dark"] .panel-title {
    color: var(--theme-text);
}

[data-theme="dark"] .content-header > h1 > small,
[data-theme="dark"] small,
[data-theme="dark"] .help-block,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .breadcrumb > li,
[data-theme="dark"] .breadcrumb > li > a {
    color: var(--theme-muted) !important;
}

[data-theme="dark"] .box,
[data-theme="dark"] .panel,
[data-theme="dark"] .well,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .popover,
[data-theme="dark"] .ui-filter-panel,
[data-theme="dark"] .ui-form-section,
[data-theme="dark"] .ui-dynamic-form-card,
[data-theme="dark"] .ui-catalog-form-card {
    border-color: var(--theme-border);
    background: var(--theme-surface) !important;
    color: var(--theme-text);
    box-shadow: 0 5px 18px var(--theme-shadow);
}

[data-theme="dark"] .box-header,
[data-theme="dark"] .box-header.with-border,
[data-theme="dark"] .box-footer,
[data-theme="dark"] .panel-heading,
[data-theme="dark"] .panel-footer,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--theme-border);
    background: var(--theme-surface) !important;
    color: var(--theme-text);
}

[data-theme="dark"] .modal-backdrop { background: #111418; }
[data-theme="dark"] .close { color: #fff; text-shadow: none; opacity: .75; }

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-control,
[data-theme="dark"] .select2-selection,
[data-theme="dark"] .select2-dropdown,
[data-theme="dark"] .input-group-addon {
    border-color: var(--theme-border) !important;
    background: var(--theme-input) !important;
    color: var(--theme-text) !important;
    box-shadow: none;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #8f969e; }

[data-theme="dark"] input:disabled,
[data-theme="dark"] select:disabled,
[data-theme="dark"] textarea:disabled,
[data-theme="dark"] .form-control[readonly] {
    background: #343940 !important;
    color: #aeb4ba !important;
}

[data-theme="dark"] .table,
[data-theme="dark"] .table > tbody > tr,
[data-theme="dark"] .table > tbody > tr > td {
    border-color: var(--theme-border);
    background: transparent;
    color: var(--theme-text);
}

[data-theme="dark"] .table > thead > tr > th {
    border-color: #96794c;
    background: #35383c;
    color: #f0dde4;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
[data-theme="dark"] .table-hover > tbody > tr:hover {
    background: #34383d;
}

[data-theme="dark"] .dataTables_wrapper,
[data-theme="dark"] .dataTables_info,
[data-theme="dark"] .dataTables_length,
[data-theme="dark"] .dataTables_filter,
[data-theme="dark"] .dataTables_empty {
    color: var(--theme-text);
}

[data-theme="dark"] .pagination > li > a,
[data-theme="dark"] .pagination > li > span {
    border-color: var(--theme-border);
    background: var(--theme-surface-raised);
    color: var(--theme-text);
}

[data-theme="dark"] .pagination > .disabled > a,
[data-theme="dark"] .pagination > .disabled > span {
    background: #292d32;
    color: #7f878f;
}

[data-theme="dark"] .pagination > .active > a,
[data-theme="dark"] .pagination > .active > span {
    border-color: #a78352;
    background: #72562f;
    color: #fff;
}

[data-theme="dark"] .dropdown-menu > li > a,
[data-theme="dark"] .dropdown-menu > li > form > button {
    color: var(--theme-text);
}

[data-theme="dark"] .dropdown-menu > li > a:hover,
[data-theme="dark"] .dropdown-menu > li > a:focus,
[data-theme="dark"] .dropdown-menu > li > form > button:hover {
    background: var(--theme-selection);
    color: #f1dce4;
}

[data-theme="dark"] .btn-default {
    border-color: #555c64;
    background: #383d43;
    color: #eef0f2;
}

[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-default:focus {
    border-color: #727a83;
    background: #444a51;
    color: #fff;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .bg-teal,
[data-theme="dark"] .bg-purple {
    border-color: #8b5c70 !important;
    background: #744157 !important;
    color: #fff !important;
}

[data-theme="dark"] a { color: #d3adbb; }
[data-theme="dark"] a:hover { color: #efd6df; }

[data-theme="dark"] .ui-required-note,
[data-theme="dark"] .alert-warning {
    border-color: #6f6047;
    background: #3a342a;
    color: #ead8b8;
}

[data-theme="dark"] .alert-success {
    border-color: #426a53;
    background: #273a30;
    color: #bfe3cc;
}

[data-theme="dark"] .alert-danger,
[data-theme="dark"] .box-danger .box-header {
    border-color: #784b52;
    background: #402d31 !important;
    color: #f0c3c9;
}

[data-theme="dark"] .alert-info,
[data-theme="dark"] .box-primary .box-header {
    border-color: #496778;
    background: #293840 !important;
    color: #c5dce8;
}

[data-theme="dark"] .box-success .box-header {
    background: #293a31 !important;
    color: #c7e3d1 !important;
}

[data-theme="dark"] .box-warning .box-header {
    background: #3b352a !important;
    color: #ead8b7 !important;
}

[data-theme="dark"] .ui-catalog-form .box-body > .form-group,
[data-theme="dark"] .ui-dynamic-form .table > tbody > tr,
[data-theme="dark"] .ui-settings-section > .form-group,
[data-theme="dark"] .ui-template-mode,
[data-theme="dark"] .comment {
    border-color: var(--theme-border);
    background: var(--theme-surface-raised);
    color: var(--theme-text);
}

[data-theme="dark"] .ui-dynamic-form .table > tbody > tr.grupo-campos,
[data-theme="dark"] .ui-mode-section,
[data-theme="dark"] .ui-template-mode.is-selected {
    background: #393735;
}

[data-theme="dark"] .ui-dynamic-form label,
[data-theme="dark"] .ui-catalog-form .control-label,
[data-theme="dark"] .ui-catalog-form .checkbox label {
    color: var(--theme-text);
}

[data-theme="dark"] .nav-tabs { border-color: var(--theme-border); }
[data-theme="dark"] .nav-tabs > li > a { color: var(--theme-muted); }
[data-theme="dark"] .nav-tabs > li.active > a,
[data-theme="dark"] .nav-tabs > li.active > a:hover,
[data-theme="dark"] .nav-tabs > li.active > a:focus {
    border-color: var(--theme-border);
    background: var(--theme-surface);
    color: #efd6df;
}

[data-theme="dark"] .cke,
[data-theme="dark"] .cke_top,
[data-theme="dark"] .cke_bottom,
[data-theme="dark"] .cke_chrome {
    border-color: var(--theme-border) !important;
    background: #34393f !important;
}

[data-theme="dark"] hr { border-color: var(--theme-border); }



html, body { background: var(--edomex-canvas); color: var(--edomex-text); font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.5; }
.ui-auth-page { background-image: linear-gradient(rgba(247,245,242,.86), rgba(247,245,242,.9)), url("../../../assets/img/portada.png"); background-position: center; background-size: cover; min-height: 100vh; }
a { color: var(--edomex-wine); }
a:hover, a:focus { color: var(--edomex-wine-dark); text-decoration: none; }
.wrapper, .content-wrapper, .right-side, .main-footer { background-color: var(--edomex-canvas); }
.content-wrapper { min-height: calc(100vh - 101px); }
.content { padding: 20px 22px 30px; }
.content-header { padding: 24px 22px 10px; }
.content-header > h1 { color: #542236; font-size: 26px; font-weight: 650; letter-spacing: -.25px; }
.content-header > h1 > small { color: var(--edomex-muted); display: block; font-size: 13px; font-weight: 400; margin-top: 6px; }
.content-header > .breadcrumb { background: transparent; color: var(--edomex-muted); padding: 8px 0; top: 24px; }
.content-header > .breadcrumb > li > a, .content-header > .breadcrumb > li.active { color: var(--edomex-muted); }
.content-header > .breadcrumb > li > a:hover { color: var(--edomex-wine); }

/* Cabecera */
.main-header { box-shadow: 0 2px 12px rgba(35, 20, 25, .16); }
.skin-green .main-header .logo, .skin-green .main-header .navbar,
.skin-green-light .main-header .logo, .skin-green-light .main-header .navbar,
.main-header .logo, .main-header .navbar { background-color: #542236; }
.skin-green .main-header .logo:hover, .skin-green .main-header .navbar .sidebar-toggle:hover,
.skin-green-light .main-header .logo:hover, .skin-green-light .main-header .navbar .sidebar-toggle:hover,
.main-header .logo:hover, .main-header .navbar .sidebar-toggle:hover { background-color: var(--edomex-wine-dark); }
.main-header .logo { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.main-header .navbar .nav > li > a, .main-header .navbar .sidebar-toggle,
.main-header .logo, .ui-logo-text { color: #fff; }
.main-header .navbar-custom-menu .nav-item { align-items: center; display: flex; gap: 10px; min-height: 50px; padding: 5px 14px; }
.main-header .navbar-custom-menu .nav-item img { height: 34px; object-fit: contain; width: 90px; }
.navbar-nav > .user-menu > .dropdown-menu { border: 0; border-radius: 0 0 var(--ui-radius) var(--ui-radius); box-shadow: var(--ui-shadow); overflow: hidden; }
.skin-green .main-header li.user-header, .skin-green-light .main-header li.user-header, .main-header li.user-header { background: var(--edomex-wine-soft); color: var(--edomex-text); }
.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p,
.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p > small,
.ui-user-name, .ui-user-role { color: var(--edomex-text); }
.navbar-nav > .user-menu > .dropdown-menu > .user-footer { background: #fff; border-top: 1px solid var(--edomex-border); padding: 12px; }

/* Navegacion lateral clara */
.main-sidebar, .left-side, .skin-green .main-sidebar, .skin-green-light .main-sidebar { background: #faf9f7; border-right: 1px solid var(--edomex-border); box-shadow: 3px 0 16px rgba(53, 38, 43, .04); }
.sidebar { padding-top: 8px; }
.user-panel { border-bottom: 1px solid var(--edomex-border); margin: 0 12px 8px; padding: 14px 4px 16px; }
.user-panel > .info, .user-panel > .info > p, .user-panel > .info > a { color: var(--edomex-text); }
.user-panel > .info > a { color: var(--edomex-muted); }
.sidebar-menu > li.header, .skin-green .sidebar-menu > li.header, .skin-green-light .sidebar-menu > li.header { background: transparent; color: var(--edomex-gold-dark); font-size: 11px; font-weight: 700; letter-spacing: 1.15px; padding: 18px 18px 8px; }
.sidebar-menu > li > a, .skin-green .sidebar-menu > li > a, .skin-green-light .sidebar-menu > li > a, .sidebar-menu .treeview-menu > li > a { color: var(--edomex-text); }
.sidebar-menu > li > a { border-left: 3px solid transparent; border-radius: 0 7px 7px 0; margin: 2px 10px 2px 0; padding: 12px 15px; }
.sidebar-menu > li:hover > a, .sidebar-menu > li.active > a, .sidebar-menu > li.menu-open > a,
.skin-green .sidebar-menu > li:hover > a, .skin-green .sidebar-menu > li.active > a,
.skin-green-light .sidebar-menu > li:hover > a, .skin-green-light .sidebar-menu > li.active > a { background: var(--edomex-wine-soft); border-left-color: var(--edomex-wine); color: var(--edomex-wine); }
.sidebar-menu > li > a > .fa, .sidebar-menu > li > a > .glyphicon, .sidebar-menu > li > a > .ion { color: var(--edomex-gold-dark); margin-right: 6px; }
.sidebar-menu > li > .treeview-menu, .skin-green .sidebar-menu > li > .treeview-menu, .skin-green-light .sidebar-menu > li > .treeview-menu { background: #fbfaf8; margin: 0 10px 5px 0; padding: 5px 0 7px 20px; }
.sidebar-menu .treeview-menu > li > a { border-radius: 6px; font-size: 13px; padding: 9px 12px; }
.sidebar-menu .treeview-menu > li.active > a, .sidebar-menu .treeview-menu > li > a:hover { background: #ece7df; color: var(--edomex-wine); }

/* Navegacion lateral: legibilidad, seleccion y contencion */
.main-sidebar,
.main-sidebar .sidebar,
.main-sidebar .user-panel,
.main-sidebar .sidebar-menu,
.main-header .logo { box-sizing: border-box; }

.main-sidebar,
.main-sidebar .sidebar { overflow-x: hidden; }

.main-sidebar .sidebar { width: 100%; }

.main-sidebar .user-panel {
    position: relative;
    width: auto;
    min-height: 78px;
    overflow: hidden;
}

.main-sidebar .user-panel > .image {
    position: absolute;
    top: 14px;
    left: 4px;
}

.main-sidebar .user-panel > .image > img {
    width: 46px;
    height: 46px;
    object-fit: cover;
}

.main-sidebar .user-panel > .info {
    position: static;
    width: auto;
    margin-left: 62px;
    padding: 7px 4px 0;
    overflow: hidden;
}

.main-sidebar .user-panel > .info > p,
.main-sidebar .user-panel > .info > a {
    display: block;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-sidebar .user-panel > .info > p {
    margin-bottom: 6px;
    color: #3f3537 !important;
    font-size: 14px;
    font-weight: 650;
}

.main-sidebar .user-panel > .info > a {
    color: #68716b !important;
    font-size: 11px;
}

.main-sidebar .user-panel > .info > a .fa-circle {
    margin-right: 6px;
    color: #43815f !important;
    font-size: 9px;
}

.main-sidebar .sidebar-menu { padding-bottom: 24px; }

.main-sidebar .sidebar-menu > li > a {
    min-height: 44px;
    overflow: hidden;
}

.main-sidebar .sidebar-menu > li > a > span:not(.pull-right-container),
.main-sidebar .treeview-menu > li > a > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-sidebar .sidebar-menu > li:hover > a,
.main-sidebar .sidebar-menu > li.active > a,
.main-sidebar .sidebar-menu > li.menu-open > a,
.skin-green .main-sidebar .sidebar-menu > li:hover > a,
.skin-green .main-sidebar .sidebar-menu > li.active > a,
.skin-green .main-sidebar .sidebar-menu > li.menu-open > a,
.skin-green-light .main-sidebar .sidebar-menu > li:hover > a,
.skin-green-light .main-sidebar .sidebar-menu > li.active > a,
.skin-green-light .main-sidebar .sidebar-menu > li.menu-open > a {
    background: #eee9e1 !important;
    border-left-color: #6f1d3b !important;
    color: #5d1933 !important;
}

.main-sidebar .sidebar-menu > li.active > a .fa,
.main-sidebar .sidebar-menu > li.menu-open > a .fa,
.main-sidebar .sidebar-menu > li:hover > a .fa {
    color: #8a6734 !important;
}

.main-sidebar .sidebar-menu .treeview-menu {
    padding: 6px 8px 7px 20px;
    border-radius: 0 0 8px 0;
    background: #faf8f6 !important;
}

.main-sidebar .sidebar-menu .treeview-menu > li > a {
    margin: 2px 0;
    border-left: 3px solid transparent;
    color: #62585a !important;
}

.main-sidebar .sidebar-menu .treeview-menu > li.active > a,
.main-sidebar .sidebar-menu .treeview-menu > li > a:hover,
.skin-green .main-sidebar .sidebar-menu .treeview-menu > li.active > a,
.skin-green-light .main-sidebar .sidebar-menu .treeview-menu > li.active > a {
    border-left-color: #a57f3c;
    background: #ece7df !important;
    color: #5d1933 !important;
    font-weight: 650;
}

.main-sidebar .sidebar-menu .treeview-menu > li.active > a .fa,
.main-sidebar .sidebar-menu .treeview-menu > li > a:hover .fa {
    color: #8a6734 !important;
}

.main-header .logo,
.main-header .logo .logo-lg,
.main-header .logo .logo-mini {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    body:not(.sidebar-collapse) .main-sidebar,
    body:not(.sidebar-collapse) .left-side,
    body:not(.sidebar-collapse) .main-header .logo { width: 230px; }

    body:not(.sidebar-collapse) .content-wrapper,
    body:not(.sidebar-collapse) .main-footer,
    body:not(.sidebar-collapse) .main-header .navbar { margin-left: 230px; }

    .sidebar-mini.sidebar-collapse .main-sidebar .user-panel {
        min-height: 58px;
        margin-right: 4px;
        margin-left: 4px;
        padding: 8px 0;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar .user-panel > .image {
        position: static;
        float: none !important;
        text-align: center;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar .user-panel > .image > img {
        width: 34px;
        height: 34px;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar .user-panel > .info { display: none !important; }
}


/* Contenedores */
.box, .panel, .well, .callout, .modal-content { border: 1px solid var(--edomex-border); border-radius: var(--ui-radius); box-shadow: 0 3px 14px rgba(53, 38, 43, .055); }
.box { background: var(--edomex-surface); margin-bottom: 22px; overflow: visible; }
.box.box-success, .box.box-info, .box.box-primary, .box.box-warning, .box.box-danger { border-top: 3px solid var(--edomex-wine); }
.box-header, .panel-heading { border-radius: var(--ui-radius) var(--ui-radius) 0 0; padding: 16px 18px; }
.box-header.with-border, .panel-default > .panel-heading { background: var(--edomex-surface); border-bottom: 1px solid var(--edomex-border); }
.box-header .box-title, .panel-title { color: var(--edomex-wine); font-size: 17px; font-weight: 650; }
.box-body, .panel-body { padding: 18px; }
.box-footer, .panel-footer { background: #fbfaf8; border-color: var(--edomex-border); border-radius: 0 0 var(--ui-radius) var(--ui-radius); padding: 14px 18px; }
.box-tools .btn-box-tool { border-radius: 6px; color: var(--edomex-muted); }
.box-tools .btn-box-tool:hover { background: var(--edomex-wine-soft); color: var(--edomex-wine); }

/* Formularios */
.form-group { margin-bottom: 18px; }
.control-label, label { color: #494345; font-weight: 600; }
.form-control, .select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple, .input-group-addon { border-color: #d8d1cc; border-radius: 7px; min-height: 38px; }
.form-control { background-color: #fdfcfb; box-shadow: none; color: var(--edomex-text); font-size: 14px; padding: 8px 11px; }
.form-control:focus, .select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--edomex-gold); box-shadow: 0 0 0 3px rgba(165, 127, 60, .13); }
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #f3f0ed; }
.help-block, .text-muted { color: var(--edomex-muted); }
.has-error .form-control { border-color: var(--edomex-danger); }
.has-error .help-block, .text-danger, .error-msg { color: var(--edomex-danger); }
.input-group-addon { background: #f5f2ef; color: var(--edomex-wine); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--edomex-wine); }

/* Botones */
.btn { border-radius: 7px; font-weight: 600; min-height: 36px; padding: 7px 14px; transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.btn:hover, .btn:focus { box-shadow: 0 3px 10px rgba(53, 38, 43, .14); }
.btn-primary, .btn-success, .bg-purple, .btn.bg-purple, .bg-teal, .btn.bg-teal { background-color: var(--edomex-wine); border-color: var(--edomex-wine); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-success:hover, .btn-success:focus, .bg-purple:hover, .btn.bg-purple:hover, .bg-teal:hover, .btn.bg-teal:hover { background-color: var(--edomex-wine-dark); border-color: var(--edomex-wine-dark); color: #fff; }
.btn-info { background-color: var(--edomex-info); border-color: var(--edomex-info); }
.btn-warning { background-color: var(--edomex-gold); border-color: var(--edomex-gold); color: #fff; }
.btn-warning:hover, .btn-warning:focus { background-color: var(--edomex-gold-dark); border-color: var(--edomex-gold-dark); color: #fff; }
.btn-danger { background-color: var(--edomex-danger); border-color: var(--edomex-danger); }
.bg-blue, .btn.bg-blue { background-color: var(--edomex-wine) !important; border-color: var(--edomex-wine) !important; color: #fff; }
.text-purple, .text-blue { color: var(--edomex-wine) !important; }
.text-orange { color: #9a651c !important; }
.text-green { color: var(--edomex-success) !important; }
.text-red { color: var(--edomex-danger) !important; }
.btn-default { background: #fff; border-color: #cfc7c1; color: #494144; }
.btn-default:hover, .btn-default:focus { background: #f5f1ee; border-color: var(--edomex-beige); color: var(--edomex-wine); }
.btn-flat { border-radius: 7px; }

/* Tablas y filtros */
.table-responsive { border: 0; overflow-x: auto; }
.table { background: var(--edomex-surface); margin-bottom: 0; }
.table > thead > tr > th { background: #eee9e4; border-bottom: 2px solid var(--edomex-beige); color: #63283e; font-size: 12px; font-weight: 700; letter-spacing: .2px; padding: 13px 10px; text-transform: uppercase; vertical-align: middle; }
.table > tbody > tr > td { border-top-color: #eee9e4; padding: 11px 10px; vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) { background-color: #f7f4f1; }
.table-hover > tbody > tr:hover, .table-striped > tbody > tr:hover { background-color: var(--edomex-wine-soft); }
.dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length { color: var(--edomex-muted); margin-bottom: 14px; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border: 1px solid #d8d1cc; border-radius: 7px; min-height: 34px; padding: 5px 9px; }
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--edomex-gold); outline: 0; }
.pagination > li > a, .pagination > li > span { border-color: var(--edomex-border); color: var(--edomex-wine); }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:hover { background: var(--edomex-wine); border-color: var(--edomex-wine); }

/* Menus, alertas y modales */
.dropdown-menu { border: 1px solid var(--edomex-border); border-radius: 8px; box-shadow: var(--ui-shadow); padding: 6px; }
.dropdown-menu > li > a, .dropdown-menu > li > form > button { border-radius: 5px; color: var(--edomex-text); padding: 8px 12px; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-menu > li > form > button:hover { background: var(--edomex-wine-soft); color: var(--edomex-wine); }
.ui-actions-menu { left: auto; right: 0; }
.ui-action-trigger { cursor: pointer; display: inline-flex; font-size: 20px; padding: 5px; }
.ui-dropdown-form { margin: 0; }
.ui-dropdown-button { background: none; border: 0; display: block; text-align: left; width: 100%; }
.ui-spinner { font-size: 16px; }
.editor-page { background: #fff; border: 1px solid var(--edomex-border); border-radius: 8px; padding: 15px; }
.variable-list { max-height: 520px; overflow: auto; }
.variable-item { border-bottom: 1px solid var(--edomex-border); padding: 7px 0; }
.variable-btn { text-align: left; white-space: normal; width: 100%; }
.variable-code { color: var(--edomex-muted); display: block; font-family: Consolas, monospace; font-size: 11px; }
.fuente-Sistema { background: var(--edomex-info); }
.fuente-Captura { background: var(--edomex-gold); }
.fuente-Calculado { background: var(--edomex-success); }
.fuente-Configuracion-institucional { background: var(--edomex-wine); }
.ui-inline-form { display: inline-block; }
.ui-inline-form-spaced { margin-left: 15px; }
.ui-source-legend { margin-top: 8px; }
.ui-background-preview { border: 1px solid var(--edomex-border); border-radius: 7px; max-height: 180px; max-width: 100%; }
.alert { border: 1px solid transparent; border-radius: 8px; box-shadow: none; padding: 13px 16px; }
.alert-success { background: #eaf5ef; border-color: #bcdcc9; color: #235f43; }
.alert-info { background: #edf4f7; border-color: #c4d8e1; color: #315c70; }
.alert-warning { background: #faf3e6; border-color: #e6cca0; color: #79501a; }
.alert-danger { background: #f9ebed; border-color: #e2bbc0; color: #8d2e3a; }
.label-success, .badge-success { background: var(--edomex-success); }
.label-warning, .badge-warning { background: var(--edomex-gold); }
.label-danger, .badge-danger { background: var(--edomex-danger); }
.modal-backdrop.in { opacity: .38; }
.modal-content { border: 0; overflow: hidden; }
.modal-header { background: #fbfaf8; border-bottom: 1px solid var(--edomex-border); padding: 17px 20px; }
.modal-title { color: var(--edomex-wine); font-weight: 650; }
.modal-body { padding: 20px; }
.modal-footer { background: #fbfaf8; border-top-color: var(--edomex-border); padding: 14px 20px; }
.nav-tabs { border-bottom-color: var(--edomex-border); }
.nav-tabs > li > a { border-radius: 7px 7px 0 0; color: var(--edomex-muted); }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { border-top: 3px solid var(--edomex-wine); color: var(--edomex-wine); font-weight: 600; }

/* Utilidades compartidas */
.small-box { border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); overflow: hidden; }
.small-box.bg-green, .small-box.bg-aqua, .small-box.bg-purple { background: var(--edomex-wine) !important; }
.small-box.bg-yellow { background: var(--edomex-gold) !important; }
.ui-overflow-visible { overflow-x: visible; }
.ui-clear-surface { background-color: var(--edomex-canvas); }
.ui-text-wine, .ui-module-services .sidebar a, .ui-module-services .sidebar .info > p { color: var(--edomex-wine); }
.ui-text-gold { color: var(--edomex-gold-dark); }
.ui-status-active { color: var(--edomex-success); font-weight: 600; }
.ui-status-inactive { color: var(--edomex-muted); font-weight: 600; }
.main-footer { background: #f8f6f3; border-top: 1px solid var(--edomex-border); color: var(--edomex-muted); padding: 16px 22px; }

/* Mejora progresiva de componentes existentes */
.ui-ready .content-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
}

.ui-ready .content-header > h1 {
    margin: 0;
    max-width: 72%;
}

.ui-ready .content-header > .breadcrumb {
    margin: 2px 0 0;
    position: static;
}

.ui-data-table > tbody > tr {
    transition: background-color .15s ease;
}

.ui-data-table > tbody > tr:focus-within {
    background: var(--edomex-wine-soft);
    outline: 2px solid rgba(165, 127, 60, .35);
    outline-offset: -2px;
}

.ui-form .form-group:last-child {
    margin-bottom: 0;
}

.ui-action-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.ui-action-bar .btn {
    margin: 0;
}

.ui-modal-dialog {
    margin-bottom: 28px;
    margin-top: 28px;
}

.modal .close {
    color: var(--edomex-muted);
    font-size: 25px;
    opacity: .75;
}

.modal .close:hover,
.modal .close:focus {
    color: var(--edomex-wine);
    opacity: 1;
}

.tooltip-inner {
    background: #40383b;
    border-radius: 6px;
    padding: 7px 10px;
}

.pace .pace-progress {
    background: var(--edomex-gold);
}

.ui-filter-panel {
    background: var(--edomex-surface-muted);
    border: 1px solid var(--edomex-border);
    border-radius: 9px;
    margin-bottom: 22px;
    padding: 16px 18px 2px;
}

.ui-filter-heading {
    align-items: center;
    color: var(--edomex-wine);
    display: flex;
    gap: 10px;
    margin-bottom: 13px;
}

.ui-filter-heading > .fa {
    background: var(--edomex-wine-soft);
    border-radius: 50%;
    font-size: 16px;
    padding: 9px;
}

.ui-filter-heading strong,
.ui-filter-heading small {
    display: block;
}

.ui-filter-heading small {
    color: var(--edomex-muted);
    font-size: 12px;
    font-weight: 400;
    margin-top: 2px;
}

.ui-filter-actions {
    align-items: flex-end;
    display: flex;
    gap: 8px;
    min-height: 68px;
}

.ui-export-button .fa {
    color: var(--edomex-success);
    margin-right: 4px;
}

.ui-action-bar .ui-export-button {
    margin-left: auto;
}

.ui-table-actions-visible {
    overflow-x: auto;
    overflow-y: visible;
}

.ui-list-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ui-list-footer .ui-export-button {
    margin-left: auto;
}

.ui-actions-icon {
    color: var(--edomex-wine);
    font-size: 20px;
    cursor: pointer;
}

.ui-actions-menu {
    right: 0;
    left: auto;
    border: 1px solid var(--edomex-border);
    box-shadow: var(--ui-shadow);
}

.ui-sort-value {
    display: none;
}

/* Pantallas de detalle, comentarios y documentos */
.ui-evidence-list > .col-sm-12 {
    float: none;
    padding-right: 0;
    padding-left: 0;
}

.ui-evidence-list .box {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--edomex-border);
    border-top: 3px solid var(--edomex-wine);
    border-radius: 10px;
    background: var(--edomex-surface);
    box-shadow: 0 5px 16px rgba(69, 43, 51, .05);
}

.ui-evidence-list .box-header,
.ui-evidence-list .box-header.bg-green,
.ui-evidence-list .box-header.bg-yellow,
.ui-evidence-list .box-header.bg-red,
.ui-evidence-list .box-header.bg-light-blue {
    min-height: 54px;
    padding: 15px 16px;
    border-bottom: 1px solid transparent;
    background: #fbfaf8 !important;
    color: var(--edomex-text) !important;
}

.ui-evidence-list .box-success {
    border-top-color: #43815f;
}

.ui-evidence-list .box-success .box-header {
    background: #eef6f1 !important;
}

.ui-evidence-list .box-warning {
    border-top-color: #b88b43;
}

.ui-evidence-list .box-warning .box-header {
    background: #faf4e9 !important;
}

.ui-evidence-list .box-danger {
    border-top-color: #a84d58;
}

.ui-evidence-list .box-danger .box-header {
    background: #faeff0 !important;
}

.ui-evidence-list .box-primary {
    border-top-color: #6589a0;
}

.ui-evidence-list .box-primary .box-header {
    background: #eff5f8 !important;
}

.ui-evidence-list .box-title,
.ui-evidence-list .box-title #pro-estatus {
    color: inherit !important;
}

.ui-evidence-list .box-title {
    font-size: 15px;
    font-weight: 650;
}

.ui-evidence-list .box-tools .btn,
.ui-evidence-list .box-tools .ui-white-text {
    color: #766a6c !important;
}

.ui-evidence-list .box-header[data-widget="collapse"]:hover {
    filter: brightness(.985);
}

.ui-evidence-list .box-body {
    padding: 16px 18px;
    color: #554c4e;
    font-size: 14px;
    line-height: 1.55;
}

.ui-evidence-list .box-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--edomex-border);
    background: #fff;
}

.content-wrapper .box-header[data-widget="collapse"] {
    cursor: pointer;
}

.content-wrapper .box-header[data-widget="collapse"]:hover {
    background: var(--edomex-surface-muted);
}

.content-wrapper .box-header[data-widget="collapse"] .box-title::before {
    color: var(--edomex-gold-dark);
    content: "\f0da";
    font-family: FontAwesome;
    font-size: 13px;
    margin-right: 8px;
}

.content-wrapper .box-header[data-widget="collapse"] + .box-body .table th {
    color: var(--edomex-muted);
    font-weight: 600;
    width: 38%;
}

.content-wrapper .box-body > .table-responsive:first-child:last-child {
    border-radius: 7px;
}

.comment {
    background: var(--edomex-surface-muted);
    border-left: 3px solid var(--edomex-beige);
    border-radius: 0 8px 8px 0;
    list-style: none;
    margin: 14px 0;
    padding: 12px 15px;
}

.aut {
    color: var(--edomex-wine);
    font-size: 105%;
    font-weight: 700;
}

.timestamp {
    color: var(--edomex-muted);
    float: right;
    font-size: 85%;
}

.comment-body {
    display: block;
    margin: 8px 0 0;
    width: 100%;
}

.reply {
    margin-left: 18px;
}

.ui-inline-hidden { display: none; }
.ui-inline-offset { margin-left: 20px; }
.ui-full-field { width: 100%; }
.ui-pdf-frame { border: 0; height: 78vh; width: 100%; }
.ui-pdf-modal { max-width: 1120px; width: calc(100% - 30px); }
.ui-section-title { font-size: 16px; }
.ui-white-text { color: #fff; }
.ui-action-spaced { margin-right: 8px; }
.ui-document-link { margin-left: 18px; }

/* Selector de modalidad en alta y edición de plantillas */
.ui-mode-section {
    border-bottom: 1px solid var(--edomex-border);
    margin: 4px 0 24px;
    padding-bottom: 22px;
}

.ui-field-heading {
    align-items: center;
    color: var(--edomex-text);
    display: flex;
    gap: 11px;
    margin-bottom: 14px;
}

.ui-field-heading strong,
.ui-field-heading small { display: block; }
.ui-field-heading strong { color: var(--edomex-wine); font-size: 17px; }
.ui-field-heading small { color: var(--edomex-muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.ui-step-number { align-items: center; background: var(--edomex-wine); border-radius: 50%; color: #fff; display: inline-flex; flex: 0 0 30px; font-size: 13px; font-weight: 700; height: 30px; justify-content: center; }
.ui-template-modes { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-template-mode { align-items: center; background: #fdfcfb; border: 1px solid var(--edomex-border); border-radius: 10px; cursor: pointer; display: flex; gap: 13px; margin: 0; min-height: 108px; padding: 17px 46px 17px 17px; position: relative; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.ui-template-mode:hover { background: var(--edomex-surface-muted); border-color: var(--edomex-beige); }
.ui-template-mode:focus-within { box-shadow: 0 0 0 3px rgba(165, 127, 60, .18); outline: 0; }
.ui-template-mode.is-selected { background: var(--edomex-wine-soft); border-color: var(--edomex-wine); box-shadow: 0 3px 12px rgba(92, 33, 55, .1); }
.ui-template-mode-input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.ui-mode-icon { align-items: center; background: #eee8e3; border-radius: 9px; color: var(--edomex-gold-dark); display: inline-flex; flex: 0 0 46px; font-size: 21px; height: 46px; justify-content: center; }
.is-selected .ui-mode-icon { background: var(--edomex-wine); color: #fff; }
.ui-mode-copy { min-width: 0; }
.ui-mode-copy strong, .ui-mode-copy small { display: block; }
.ui-mode-copy strong { color: #4a4144; font-size: 15px; margin-bottom: 5px; }
.ui-mode-copy small { color: var(--edomex-muted); font-size: 12px; font-weight: 400; line-height: 1.45; }
.ui-mode-check { color: #bcb4b0; font-size: 20px; position: absolute; right: 16px; top: 16px; }
.is-selected .ui-mode-check { color: var(--edomex-wine); }
.ui-recommended { background: #eee4d3; border-radius: 10px; bottom: 10px; color: #735724; font-size: 10px; font-weight: 700; padding: 2px 7px; position: absolute; right: 12px; text-transform: uppercase; }
.ui-mode-help { background: var(--edomex-surface-muted); border-radius: 6px; margin: 10px 0 0; padding: 8px 11px; }
.ui-dependent-field { background: #faf7f5; border-left: 3px solid var(--edomex-beige); border-radius: 0 8px 8px 0; margin-left: 0; margin-right: 0; padding: 14px 8px; }
/* Altas de catalogos con la misma presentacion de Plantillas */
.ui-catalog-form-card { overflow: hidden; }
.ui-catalog-form-card > .box-header { padding: 18px 22px; }
.ui-catalog-form-card > .box-header .box-title::before { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; margin-right: 9px; border-radius: 50%; background: #eee9e1; color: var(--edomex-wine); content: "\f067"; font-family: FontAwesome; font-size: 12px; }
.ui-catalog-form .box-body { max-width: 1080px; padding: 22px 28px 28px; }
.ui-catalog-form .box-body > .form-group { margin: 0 0 12px; padding: 14px; border: 1px solid var(--edomex-border); border-radius: 8px; background: #fdfcfb; }
.ui-catalog-form .box-body > .form-group::before, .ui-catalog-form .box-body > .form-group::after { display: table; content: " "; }
.ui-catalog-form .box-body > .form-group::after { clear: both; }
.ui-catalog-form .control-label { padding-top: 9px; color: #4d4244; font-size: 13px; font-weight: 650; text-align: left; }
.ui-catalog-form .form-control, .ui-catalog-form input[type="text"], .ui-catalog-form input[type="email"], .ui-catalog-form input[type="password"], .ui-catalog-form input[type="date"], .ui-catalog-form input[type="number"], .ui-catalog-form select, .ui-catalog-form textarea { min-height: 40px; border-color: #d7d0ca; border-radius: 6px; background: #fff; box-shadow: none; }
.ui-catalog-form textarea { min-height: 92px; resize: vertical; }
.ui-catalog-form .form-control:focus, .ui-catalog-form input:focus, .ui-catalog-form select:focus, .ui-catalog-form textarea:focus { border-color: #9b7a48; outline: 0; box-shadow: 0 0 0 3px rgba(165, 127, 60, .13); }
.ui-catalog-form .checkbox { margin-top: 7px; margin-bottom: 3px; }
.ui-catalog-form .checkbox label { color: #504648; font-weight: 500; }
.ui-catalog-form .text-danger { margin-top: 5px; font-size: 12px; text-align: left; }
.ui-catalog-form .text-danger ul { margin: 0; padding-left: 18px; }
.ui-catalog-form-card .ui-template-form-actions { padding: 16px 28px; }
@media (max-width: 767px) {
    .ui-catalog-form .box-body { padding: 16px 12px 20px; }
    .ui-catalog-form .box-body > .form-group { padding: 12px; }
    .ui-catalog-form .control-label { padding-top: 0; padding-bottom: 7px; }
    .ui-catalog-form-card .ui-template-form-actions { flex-direction: column-reverse; padding: 14px; }
    .ui-catalog-form-card .ui-template-form-actions .btn { width: 100%; }
}

.ui-template-form .box-body { margin: 0 auto; max-width: 1080px; padding: 22px 28px 28px; }
.ui-required-note { background: #f7f2e8; border: 1px solid #e7d7bb; border-radius: 7px; color: #665333; font-size: 13px; margin-bottom: 20px; padding: 9px 12px; }
.ui-required-note .fa { color: var(--edomex-gold-dark); margin-right: 5px; }
.ui-form-section { background: var(--edomex-surface-muted); border: 1px solid var(--edomex-border); border-radius: 10px; margin-bottom: 22px; padding: 19px 20px 3px; }
.ui-form-section-heading { align-items: center; border-bottom: 1px solid var(--edomex-border); display: flex; gap: 11px; margin-bottom: 18px; padding-bottom: 13px; }
.ui-form-section-heading strong, .ui-form-section-heading small { display: block; }
.ui-form-section-heading strong { color: var(--edomex-wine); font-size: 16px; }
.ui-form-section-heading small { color: var(--edomex-muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.ui-template-form .ui-form-section > .form-group, .ui-template-form .ui-form-row { align-items: start; display: grid; gap: 6px 18px; grid-template-columns: 190px minmax(0, 1fr); margin-left: 0; margin-right: 0; }
.ui-template-form .ui-form-section > .form-group > .control-label, .ui-template-form .ui-form-row > .control-label { float: none; padding: 9px 0 0; text-align: left; width: auto; }
.ui-template-form .ui-form-section > .form-group > .col-sm-9, .ui-template-form .ui-form-row > .col-sm-9 { float: none; padding: 0; width: auto; }
.ui-template-form .ui-form-section > .form-group > .col-sm-12, .ui-template-form .ui-form-row > .col-sm-12 { float: none; grid-column: 2; padding: 0; text-align: left; width: auto; }
.ui-template-form textarea.form-control { min-height: 86px; resize: vertical; }
.ui-template-form .ui-mode-section > .col-sm-12 { float: none; padding: 0; width: 100%; }
.ui-settings-section { display: grid; gap: 0 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 17px; }
.ui-settings-section .ui-form-section-heading { grid-column: 1 / -1; }
.ui-template-form .ui-settings-section > .form-group { background: #fdfcfb; border: 1px solid var(--edomex-border); border-radius: 8px; display: block; margin: 0; min-height: 58px; padding: 10px 13px; }
.ui-settings-section .col-sm-offset-3, .ui-settings-section .col-sm-9, .ui-settings-section .col-sm-12 { float: none; margin: 0; padding: 0; text-align: left; width: auto; }
.ui-settings-section .checkbox { margin: 0; }
.ui-settings-section .checkbox label { align-items: center; display: flex; gap: 7px; min-height: 34px; }
.ui-template-form-actions { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.ui-template-form-actions .btn:last-child { min-width: 130px; }

@media (max-width: 767px) {
    .timestamp { display: block; float: none; margin-top: 3px; }
    .reply { margin-left: 8px; }
    .ui-pdf-modal { margin: 10px auto; width: calc(100% - 20px); }
    .content-wrapper .box-header[data-widget="collapse"] + .box-body .table th { width: auto; }
    .ui-template-modes { grid-template-columns: 1fr; }
    .ui-template-mode { min-height: 96px; }
    .ui-template-form .box-body { padding: 18px 14px 22px; }
    .ui-form-section { padding: 16px 14px 2px; }
    .ui-template-form .ui-form-section > .form-group, .ui-template-form .ui-form-row { grid-template-columns: 1fr; }
    .ui-template-form .ui-form-section > .form-group > .control-label, .ui-template-form .ui-form-row > .control-label { padding-top: 0; }
    .ui-template-form .ui-form-section > .form-group > .col-sm-12, .ui-template-form .ui-form-row > .col-sm-12 { grid-column: 1; }
    .ui-settings-section { grid-template-columns: 1fr; }
    .ui-settings-section > .form-group + .form-group { margin-top: 10px; }
}

/* Lectura prolongada: evita negro puro, líneas excesivamente compactas y reflejos. */
.content-wrapper p,
.content-wrapper li,
.content-wrapper td,
.content-wrapper .form-control {
    line-height: 1.48;
}

.content-wrapper p {
    color: #454043;
}

.box-body {
    color: #403b3d;
}

@media (prefers-contrast: more) {
    :root { --edomex-text: #201d1e; --edomex-muted: #514b4d; --edomex-border: #bdb6b0; }
}

@media (max-width: 991px) {
    .content-header > .breadcrumb { background: transparent; float: none; margin-top: 8px; position: static; }
    .content-header, .content { padding-left: 15px; padding-right: 15px; }
    .table-responsive { margin-bottom: 0; width: 100%; }
    .ui-ready .content-header { display: block; }
    .ui-ready .content-header > h1 { max-width: 100%; }
}

@media (max-width: 767px) {
    .content-header { padding-top: 18px; }
    .content-header > h1 { font-size: 22px; }
    .box-header, .box-body, .box-footer, .panel-heading, .panel-body { padding-left: 14px; padding-right: 14px; }
    .btn { margin-bottom: 4px; white-space: normal; }
    .modal-dialog { margin: 12px; }
    .main-header .navbar-custom-menu .nav-item { display: none; }
    .ui-filter-actions { align-items: stretch; flex-direction: column; min-height: 0; }
    .ui-filter-actions .btn { width: 100%; }
    .ui-action-bar .ui-export-button { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}


/* Formularios dinámicos de captura y edición de plantillas */
.ui-dynamic-form-page .content {
    padding-top: 8px;
}

.ui-dynamic-form-page .ui-dynamic-form-column {
    float: none;
    padding: 0;
}

.ui-dynamic-form-card {
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #e3ded8;
    border-top: 3px solid #6f1d3b;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(62, 44, 49, .06);
}

.ui-dynamic-form-card > h3,
.ui-dynamic-form-card > .box-header {
    margin: 0;
    padding: 20px 24px 14px;
    color: #5d1933;
    font-size: 19px;
    font-weight: 700;
}

.ui-dynamic-form-card > h3::before,
.ui-dynamic-form-card .box-title::before {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    border-radius: 50%;
    background: #eee9e1;
    color: #6f1d3b;
    content: "\f044";
    font-family: FontAwesome;
    font-size: 13px;
}

.ui-dynamic-form-card .box-header {
    position: relative;
    border-bottom: 0;
}

.ui-dynamic-form-card .box-header .box-title {
    color: #5d1933;
    font-size: 19px;
    font-weight: 700;
}

.ui-dynamic-form-card .box-tools {
    top: 14px;
    right: 18px;
}

.ui-dynamic-form-card .progress-container {
    height: 5px;
    margin: 14px 24px 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #eee9e5;
}

.ui-dynamic-form-card > .progress-container {
    margin-top: 0;
}

.ui-dynamic-form-card #progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #bc955b, #8f2047);
    transition: width .25s ease;
}

.ui-dynamic-form .box-body {
    padding: 10px 18px 20px;
}

.ui-dynamic-form .table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    box-shadow: none;
}

.ui-dynamic-form .table > thead {
    display: none;
}

.ui-dynamic-form .table > tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.ui-dynamic-form .table > tbody > tr {
    display: block;
    width: auto;
    min-width: 0;
    margin: 0;
    border: 1px solid #ebe6e1;
    border-radius: 9px;
    background: #fcfbfa;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ui-dynamic-form .table > tbody > tr:not(.grupo-campos):focus-within {
    border-color: #c8a571;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(188, 149, 91, .12);
}

.ui-dynamic-form .table > tbody > tr.grupo-campos {
    grid-column: 1 / -1;
    margin-top: 14px;
    overflow: hidden;
    border: 0;
    border-radius: 9px;
    background: #f3efe7;
}

.ui-dynamic-form .table > tbody > tr.grupo-campos:first-child {
    margin-top: 0;
}

.ui-dynamic-form .table > tbody > tr.grupo-campos > td {
    display: block;
    padding: 14px 18px !important;
    border: 0 !important;
    border-left: 4px solid #6f1d3b !important;
    border-radius: 9px;
    background: transparent;
    color: #5d1933;
}

.ui-dynamic-form .grupo-campos h4 {
    margin: 0;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
}

.ui-dynamic-form .grupo-campos .fa {
    margin-right: 7px;
    color: #a47c40;
}

.ui-dynamic-form .table > tbody > tr:not(.grupo-campos) > td {
    display: grid;
    width: auto;
    min-height: 76px;
    grid-template-columns: minmax(160px, .9fr) minmax(180px, 1.1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px !important;
    border: 0 !important;
    border-radius: 9px;
    background: transparent;
}

.ui-dynamic-form td > .col-sm-5,
.ui-dynamic-form td > .col-sm-6,
.ui-dynamic-form td > .col-sm-7 {
    float: none;
    width: auto;
    min-width: 0;
    padding: 0;
}

.ui-dynamic-form label {
    margin: 0;
    color: #42383a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.ui-dynamic-form input[type="text"],
.ui-dynamic-form input[type="email"],
.ui-dynamic-form input[type="date"],
.ui-dynamic-form input[type="time"],
.ui-dynamic-form input[type="number"],
.ui-dynamic-form select,
.ui-dynamic-form textarea,
.ui-dynamic-form .input-dinamico {
    width: 100% !important;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #d7d0ca;
    border-radius: 6px;
    background: #fff;
    color: #2f292a;
    font-size: 14px;
    box-shadow: none;
}

.ui-dynamic-form textarea {
    min-height: 84px;
    resize: vertical;
}

.ui-dynamic-form input:focus,
.ui-dynamic-form select:focus,
.ui-dynamic-form textarea:focus {
    border-color: #9f6f82;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(111, 29, 59, .1);
}

.ui-dynamic-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px !important;
    border-top: 1px solid #ebe6e1 !important;
    background: #fbfaf9;
}

.ui-dynamic-form-actions .btn-regresar,
.ui-dynamic-form-actions .btn-guardar {
    float: none !important;
    min-width: 110px;
    margin: 0;
    padding: 10px 18px;
    border-radius: 7px;
    font-size: 14px !important;
    font-weight: 600;
    text-align: center;
}

.ui-dynamic-form-actions .btn-regresar {
    border: 1px solid #cfc6bf;
    background: #fff;
    color: #64595b;
}

.ui-dynamic-form-actions .btn-guardar {
    border: 1px solid #6f1d3b;
    background: #6f1d3b;
    color: #fff;
    box-shadow: 0 4px 10px rgba(111, 29, 59, .16);
}

.ui-dynamic-form-actions .btn-guardar:hover,
.ui-dynamic-form-actions .btn-guardar:focus {
    background: #58162f;
    color: #fff;
    transform: none;
}

.ui-page-subtitle {
    margin: 4px 0 0;
    color: #756a6c;
    font-size: 14px;
    font-weight: 400;
}

@media (max-width: 991px) {
    .ui-dynamic-form .table > tbody {
        grid-template-columns: 1fr;
    }

    .ui-dynamic-form .table > tbody > tr.grupo-campos {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    .ui-dynamic-form-card > h3,
    .ui-dynamic-form-card > .box-header {
        padding-right: 16px;
        padding-left: 16px;
    }

    .ui-dynamic-form .box-body {
        padding-right: 10px;
        padding-left: 10px;
    }

    .ui-dynamic-form .table > tbody > tr:not(.grupo-campos) > td {
        display: block;
        min-height: 0;
    }

    .ui-dynamic-form td > div + div {
        margin-top: 8px;
    }

    .ui-dynamic-form-actions {
        flex-direction: column-reverse;
    }

    .ui-dynamic-form-actions .btn {
        width: 100%;
    }
}

/* Ajustes finales de contraste para tema oscuro */
[data-theme="dark"] .ui-dynamic-form .table > tbody > tr:not(.grupo-campos):focus-within,
[data-theme="dark"] .ui-catalog-form .box-body > .form-group:focus-within {
    border-color: #c5a56e !important;
    background: #353a40 !important;
    box-shadow: 0 0 0 3px rgba(197, 165, 110, .2) !important;
}
[data-theme="dark"] .ui-dynamic-form .table > tbody > tr:not(.grupo-campos) > td { background: transparent !important; }
[data-theme="dark"] .ui-dynamic-form-card > h3,
[data-theme="dark"] .ui-dynamic-form-card .box-title,
[data-theme="dark"] .ui-dynamic-form .grupo-campos h4,
[data-theme="dark"] .ui-form-section-heading strong,
[data-theme="dark"] .ui-field-heading strong,
[data-theme="dark"] .content-wrapper .box-header .box-title,
[data-theme="dark"] .panel-title,
[data-theme="dark"] .modal-title { color: #f3e8ec !important; }
[data-theme="dark"] .ui-dynamic-form .grupo-campos {
    border-color: #9f8357 !important;
    background: #393735 !important;
}
[data-theme="dark"] .ui-dynamic-form .grupo-campos .fa,
[data-theme="dark"] .content-wrapper .box-header[data-widget="collapse"] .box-title::before { color: #d1b57f !important; }
[data-theme="dark"] .content-wrapper a:not(.btn),
[data-theme="dark"] .content-wrapper .text-purple,
[data-theme="dark"] .content-wrapper .text-green { color: #efc7d5 !important; }
[data-theme="dark"] .content-wrapper a:not(.btn):hover,
[data-theme="dark"] .content-wrapper a:not(.btn):focus { color: #ffe7ef !important; }
[data-theme="dark"] .ui-status-active { color: #9fd4b3 !important; }
[data-theme="dark"] .ui-status-inactive { color: #c0c5ca !important; }
[data-theme="dark"] .ui-evidence-list .box-header,
[data-theme="dark"] .ui-evidence-list .box-header.bg-green,
[data-theme="dark"] .ui-evidence-list .box-header.bg-yellow,
[data-theme="dark"] .ui-evidence-list .box-header.bg-red,
[data-theme="dark"] .ui-evidence-list .box-header.bg-light-blue {
    border-color: var(--theme-border) !important;
    background: #30353b !important;
    color: #eef0f2 !important;
}
[data-theme="dark"] .ui-evidence-list .box-success .box-header { background: #293a31 !important; color: #c7e3d1 !important; }
[data-theme="dark"] .ui-evidence-list .box-warning .box-header { background: #3b352a !important; color: #ead8b7 !important; }
[data-theme="dark"] .ui-evidence-list .box-danger .box-header { background: #402d31 !important; color: #f0c3c9 !important; }
[data-theme="dark"] .ui-evidence-list .box-primary .box-header { background: #293840 !important; color: #c5dce8 !important; }
[data-theme="dark"] .ui-evidence-list .box-body,
[data-theme="dark"] .ui-evidence-list .box-footer {
    border-color: var(--theme-border) !important;
    background: #292d32 !important;
    color: #dfe3e6 !important;
}

/* Catalogo de variables */
.ui-variable-catalog { max-width: 1640px; margin: 0 auto; }
.ui-variable-editor { overflow: hidden; }
.ui-variable-editor > .box-header { padding: 18px 22px 14px; }
.ui-box-description { margin: 5px 0 0; color: var(--edomex-muted); font-size: 13px; }
.ui-variable-editor > .box-body { padding: 0; }
.ui-variable-form { padding: 20px 22px 0; }
.ui-variable-form > .row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 0 0 18px !important;
    padding: 52px 10px 8px;
    border: 1px solid var(--edomex-border);
    border-radius: 10px;
    background: var(--edomex-surface-muted);
}
.ui-variable-form > .row::before {
    position: absolute;
    top: 0; right: 0; left: 0;
    padding: 13px 16px;
    border-bottom: 1px solid var(--edomex-border);
    color: var(--edomex-wine);
    font-size: 14px;
    font-weight: 700;
}
.ui-variable-form > .row:nth-of-type(1)::before { content: "1  Identificación de la variable"; }
.ui-variable-form > .row:nth-of-type(2)::before { content: "2  Captura y organización"; }
.ui-variable-form > .row:nth-of-type(3)::before { content: "3  Configuración avanzada"; }
.ui-variable-form > .row:nth-of-type(4)::before { content: "4  Formato de salida"; }
.ui-variable-form > .row > [class*="col-"] { margin-bottom: 12px; }
.ui-variable-form label { display: block; margin-bottom: 7px; color: var(--edomex-text); font-size: 13px; font-weight: 650; }
.ui-variable-form .form-control { min-height: 40px; border-radius: 6px; }
.ui-variable-form textarea.form-control { min-height: 84px; resize: vertical; }
.ui-variable-form #var-obligatoria {
    width: 18px; height: 18px; margin-top: 9px;
    accent-color: var(--edomex-wine);
}
.ui-variable-form .input-group-addon { min-width: 38px; color: var(--edomex-wine); font-weight: 700; }
.ui-variable-form .help-block { min-height: 18px; margin: 6px 0 0; line-height: 1.35; }
.ui-variable-form > div:last-child:not(.row) {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 10px;
    margin: 0 -22px !important;
    padding: 16px 22px;
    border-top: 1px solid var(--edomex-border);
    background: var(--edomex-surface-muted);
}
.ui-variable-form > div:last-child:not(.row) .btn-success {
    border-color: var(--edomex-wine);
    background: var(--edomex-wine);
    color: #fff;
}
.ui-variable-editor + .box { overflow: visible; margin-top: 22px; }
.ui-variable-editor + .box > .box-header {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--edomex-border);
}
.ui-variable-editor + .box > .box-header form { float: none !important; display: flex; align-items: center; gap: 10px; margin: 0; }
.ui-variable-editor + .box > .box-header form::before { content: "Filtrar por plantilla"; color: var(--edomex-muted); font-size: 13px; white-space: nowrap; }
.ui-variable-editor + .box > .box-header select { width: min(440px, 38vw); min-height: 38px; border: 1px solid var(--edomex-border); border-radius: 6px; background: var(--theme-input, #fff); }
.ui-variable-editor + .box code { display: inline-block; padding: 4px 7px; border-radius: 5px; color: var(--edomex-wine); background: var(--edomex-wine-soft); font-weight: 650; white-space: nowrap; }
.ui-variable-editor + .box .label-info { display: inline-block; margin-top: 5px; background: #6d7f87; }
.ui-variable-editor + .box td:last-child { white-space: nowrap; }
.ui-variable-editor + .box td:last-child form { display: inline-block !important; margin-left: 4px; }
[data-theme="dark"] .ui-variable-form > .row { background: #292d32; }
[data-theme="dark"] .ui-variable-form > .row::before { color: #f3e8ec; }
[data-theme="dark"] .ui-variable-editor + .box code { color: #f1cbd8; background: #3b3538; }
@media (max-width: 767px) {
    .ui-variable-form { padding: 14px 12px 0; }
    .ui-variable-form > .row { display: block; padding-right: 2px; padding-left: 2px; }
    .ui-variable-form > div:last-child:not(.row) { margin-right: -12px !important; margin-left: -12px !important; padding: 14px 12px; }
    .ui-variable-editor + .box > .box-header { display: block; }
    .ui-variable-editor + .box > .box-header form { display: block; margin-top: 12px; }
    .ui-variable-editor + .box > .box-header form::before { display: block; margin-bottom: 5px; }
    .ui-variable-editor + .box > .box-header select { width: 100%; }
}
