/* =====================================================================
   Catalogados design system v2  (owner: P2-CORE)
   Loaded after ~/Content/css. Values follow docs/Plan/Phase2/02-Visual-Direction.md.
   Literal values are used everywhere; --ui-* custom properties are a convenience
   layer only. Script-owned state (display, plugin geometry, menu state classes)
   is never overridden here.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens and base
   --------------------------------------------------------------------- */
body.ui-modern {
    --ui-canvas: #f5f7fb;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f8fafc;
    --ui-border: #e4e7ec;
    --ui-border-strong: #d0d5dd;
    --ui-border-input: #8a94a6;
    --ui-text: #101828;
    --ui-text-secondary: #475467;
    --ui-text-muted: #667085;
    --ui-primary: #2563eb;
    --ui-primary-hover: #1d4ed8;
    --ui-primary-pressed: #1e40af;
    --ui-primary-tint: #eff6ff;
    --ui-ring: 0 0 0 3px rgba(37,99,235,.30);
    --ui-shadow-card: 0 1px 2px rgba(16,24,40,.05);
    --ui-shadow-raised: 0 4px 12px rgba(16,24,40,.08);
    --ui-shadow-overlay: 0 12px 32px rgba(16,24,40,.18);
    color: #101828;
    background: #f5f7fb;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.ui-modern a { color: #1d4ed8; }
body.ui-modern a:hover,
body.ui-modern a:focus { color: #1e40af; }
body.ui-modern h1, body.ui-modern h2, body.ui-modern h3,
body.ui-modern h4, body.ui-modern h5, body.ui-modern h6 { color: #101828; font-weight: 600; letter-spacing: -.005em; }
body.ui-modern h1 { font-size: 22px; }
body.ui-modern h2 { font-size: 20px; }
body.ui-modern h3 { font-size: 18px; }
body.ui-modern h4 { font-size: 16px; }
body.ui-modern h5 { font-size: 14px; }
body.ui-modern hr { border-color: #e4e7ec; }
body.ui-modern small, body.ui-modern .small { font-size: 12px; }
body.ui-modern .text-muted { color: #667085; }
body.ui-modern .text-primary { color: #1d4ed8; }
body.ui-modern .text-success { color: #067647; }
body.ui-modern .text-warning { color: #93370d; }
body.ui-modern .text-danger { color: #b42318; }
body.ui-modern .text-info { color: #175cd3; }
body.ui-modern ::selection { background: #bfdbfe; color: #101828; }

/* Focus: keep :focus (old browsers), refine with :focus-visible. Inputs use a ring. */
body.ui-modern a:focus,
body.ui-modern button:focus,
body.ui-modern [tabindex]:focus,
body.ui-modern .btn:focus,
body.ui-modern input[type=checkbox]:focus,
body.ui-modern input[type=radio]:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
body.ui-modern a:focus:not(:focus-visible),
body.ui-modern button:focus:not(:focus-visible),
body.ui-modern .btn:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------------------
   2. Shell: top bar, sidebar, content, footer
   Offsets: header 56px, sidebar 240px. Menu state classes stay authoritative.
   --------------------------------------------------------------------- */
body.ui-modern.ui-shell { padding-top: 0; padding-bottom: 0; }
body.ui-modern .magic-page { padding-top: 56px; min-height: 100vh; }
body.ui-modern .magic-page > header { z-index: 2000; }
body.ui-modern .magic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    line-height: normal;
    padding: 0 16px 0 12px;
    background: #ffffff;
    border-bottom: 1px solid #e4e7ec;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
    color: #101828;
}
body.ui-modern .ui-topbar-start,
body.ui-modern .ui-topbar-end { display: flex; align-items: center; gap: 4px; min-width: 0; }
body.ui-modern .ui-topbar-start { gap: 8px; }
body.ui-modern .ui-topbar-account { display: flex; align-items: center; gap: 4px; }
body.ui-modern .ui-topbar-account > form { float: none !important; margin: 0; }
body.ui-modern .ui-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #101828;
    text-decoration: none;
}
body.ui-modern .ui-brand:hover,
body.ui-modern .ui-brand:focus { color: #101828; text-decoration: none; }
body.ui-modern .ui-brand-mark {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    font-size: 15px;
    box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
body.ui-modern .ui-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
body.ui-modern .ui-brand-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.ui-modern .ui-brand-product { font-size: 12px; color: #667085; white-space: nowrap; }
body.ui-modern .ui-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 4px 0 8px;
    padding-left: 12px;
    border-left: 1px solid #e4e7ec;
    color: #475467;
    font-size: 13px;
    white-space: nowrap;
}
body.ui-modern .ui-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}
/* Legacy header helpers (Site.css hover colours, header.css fa-2x alignment). */
body.ui-modern #btn-mostrar-buscador:hover i,
body.ui-modern #btn-cerrar-buscador:hover i { color: inherit !important; font-size: inherit; }
body.ui-modern .magic-header i.fa.fa-2x { font-size: 16px; }
/* Header title search (shown by app.js). */
body.ui-modern #buscador-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    background: #ffffff !important;
    border-bottom: 1px solid #e4e7ec;
    text-align: left !important;
}
body.ui-modern #buscador-header .select2-container { max-width: calc(100% - 48px); }

/* Sidebar */
body.ui-modern .magic-page > aside {
    top: 56px;
    bottom: 0;
    height: auto;
    width: 240px;
    padding-bottom: 0;
    background: #0f172a;
    border-right: 0;
    box-shadow: none;
}
body.ui-modern .magic-page > aside-right {
    top: 56px;
    bottom: 0;
    height: auto;
    background: #ffffff;
    border-left: 1px solid #e4e7ec;
    border-right: 0;
    box-shadow: none;
}
body.ui-modern aside nav { height: 100%; overflow: hidden; }
body.ui-modern .magic-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 12px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 14px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
body.ui-modern .magic-menu ul { padding: 0; margin: 0; }
body.ui-modern .magic-menu > ul { flex: 1 0 auto; padding: 0 12px 12px; }
body.ui-modern .magic-menu li { list-style: none; }
body.ui-modern .magic-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0;
    padding: 8px 10px;
    border-radius: 8px;
    color: #cbd5e1;
    line-height: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .14s ease, color .14s ease;
}
body.ui-modern .magic-menu a > i:first-child {
    flex: none;
    width: 18px;
    font-size: 15px;
    text-align: center;
    color: #94a3b8;
    transition: color .14s ease;
}
body.ui-modern .magic-menu a > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ui-modern .magic-menu a > b { flex: none; margin-left: auto; font-weight: 400; }
body.ui-modern .magic-menu li:not(.parent) a b > i,
body.ui-modern .magic-menu li.parent a b > i { float: none; font-size: 13px; line-height: 20px; color: #64748b; }
/* Chevrons replace the +/- squares that menu.js toggles. */
body.ui-modern .magic-menu li.parent > a > b > i:before { content: "\f105"; }
body.ui-modern .magic-menu li.parent.open > a > b > i:before { content: "\f107"; }
body.ui-modern .magic-menu a:hover,
body.ui-modern .magic-menu a:focus { background: #1e293b; color: #ffffff; }
body.ui-modern .magic-menu a:hover > i:first-child,
body.ui-modern .magic-menu a:focus > i:first-child { color: #e2e8f0; }
body.ui-modern .magic-menu a:focus { outline: 2px solid #60a5fa; outline-offset: -2px; }
body.ui-modern .magic-menu a:focus:not(:focus-visible) { outline: none; }
body.ui-modern .magic-menu li.parent:hover > a,
body.ui-modern .magic-menu li.parent.open > a { color: #ffffff; }
body.ui-modern .magic-menu li.parent ul {
    position: relative;
    margin: 2px 0 6px 19px;
    padding: 0 0 0 10px;
    background: transparent;
    border: 0;
    border-left: 1px solid #1e293b;
}
body.ui-modern .magic-menu li.parent li { padding-left: 0; }
body.ui-modern .magic-menu li.parent li a { padding: 6px 10px; font-size: 13.5px; color: #a7b3c6; }
body.ui-modern .magic-menu li.parent li a > i:first-child { display: none; }
body.ui-modern .magic-menu li.parent li:hover > a { color: #ffffff; }
/* app.js paints the item matching location.pathname with inline styles; neutralise them. */
body.ui-modern .magic-menu li[style] { background-color: transparent !important; border: 0 !important; }
body.ui-modern .magic-menu li a span[style] { color: inherit !important; }
/* Active item: _Menu.cshtml emits a <style> matching the current controller href
   (tint rgba(59,130,246,.16), white text, 3px #60a5fa accent bar). */
body.ui-modern .ui-menu-section {
    padding: 4px 22px 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
body.ui-modern .ui-menu-footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 12px;
    background: #0f172a;
    border-top: 1px solid #1e293b;
}
body.ui-modern .magic-menu a.ui-menu-cta {
    justify-content: center;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid rgba(96,165,250,.35);
    border-radius: 8px;
    background: rgba(59,130,246,.16);
    color: #dbeafe;
    font-weight: 600;
    white-space: nowrap;
}
body.ui-modern .magic-menu a.ui-menu-cta > i:first-child { color: #93c5fd; }
body.ui-modern .magic-menu a.ui-menu-cta:hover,
body.ui-modern .magic-menu a.ui-menu-cta:focus { background: #2563eb; border-color: #2563eb; color: #ffffff; }
body.ui-modern .magic-menu a.ui-menu-cta:hover > i:first-child,
body.ui-modern .magic-menu a.ui-menu-cta:focus > i:first-child { color: #ffffff; }

/* Content */
body.ui-modern.ui-shell .magic-content {
    margin-top: 0;
    margin-left: 240px;
    padding: 24px;
    min-height: calc(100vh - 56px);
    background: #f5f7fb;
}
body.ui-modern.ui-shell .magic-menu-hide .magic-content { margin-left: 0; }
body.ui-modern.ui-shell .magic-aside-right-hide .magic-content { margin-right: 0; }
body.ui-modern .magicwin { top: 57px; }

/* Footer */
body.ui-modern .magic-content > footer,
body.ui-modern > main > .magic-contents > footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 24px;
    clear: both;
    margin-top: 32px;
    padding: 16px 0 0;
    border-top: 1px solid #e4e7ec;
    color: #667085;
    font-size: 12px;
    overflow-wrap: anywhere;
}
body.ui-modern .magic-content > footer p,
body.ui-modern > main > .magic-contents > footer p { margin: 0; }
body.ui-modern .magic-content > footer .pull-left,
body.ui-modern .magic-content > footer .pull-right,
body.ui-modern > main > .magic-contents > footer .pull-left,
body.ui-modern > main > .magic-contents > footer .pull-right { float: none !important; }
body.ui-modern footer a { color: #475467; }
body.ui-modern footer b { font-weight: 600; }
body.ui-modern .ui-footer-meta { color: #667085; font-variant-numeric: tabular-nums; } /* v2.4: was #98a2b3 (2.40:1, failed contrast) */

/* Auth layout (_LayoutLogin) */
body.ui-modern.ui-auth {
    padding: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, rgba(219,234,254,0) 60%),
        radial-gradient(900px 500px at 110% 110%, #e0e7ff 0%, rgba(224,231,255,0) 55%),
        #f5f7fb;
}
body.ui-modern.ui-auth > main > .magic-contents { max-width: 1100px; margin: 0 auto; padding: 48px 24px 24px; }
body.ui-modern .ui-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    color: #101828;
    font-size: 18px;
    font-weight: 700;
}
body.ui-modern .ui-auth-brand .ui-brand-mark { width: 36px; height: 36px; font-size: 17px; }
body.ui-modern .ui-auth-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 32px;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .ui-auth-header { margin-bottom: 24px; text-align: center; }
body.ui-modern .ui-auth-header .ui-icon-chip { margin-bottom: 12px; }
body.ui-modern .ui-auth-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; }
body.ui-modern .ui-auth-subtitle { margin: 4px 0 0; color: #475467; }
/* Login keeps its form-horizontal class (Razor line); labels stay above fields. */
body.ui-modern .ui-auth-card .form-horizontal .control-label { padding-top: 0; text-align: left; }
body.ui-modern .ui-auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eaecf0;
    font-size: 13px;
}
body.ui-modern .ui-auth-links p { margin: 0; }
body.ui-modern.ui-auth > main > .magic-contents > footer { justify-content: center; text-align: center; border-top: 0; }

/* MagicWindow layout (_LayoutMagicWindow) */
body.ui-modern.ui-window { padding: 0; background: #f5f7fb; }
body.ui-modern.ui-window > main > .magic-contents { padding: 16px 16px 0; }
body.ui-modern.ui-window > main > .magic-contents > footer { margin-top: 16px; padding: 10px 0; }
body.ui-modern.ui-window .ui-page-header { display: none; }

/* ---------------------------------------------------------------------
   3. Page header
   --------------------------------------------------------------------- */
body.ui-modern .ui-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 24px;
}
body.ui-modern .ui-page-header:before,
body.ui-modern .ui-page-header:after { display: none; }
body.ui-modern .ui-page-heading { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 320px; }
body.ui-modern .ui-page-heading > div { min-width: 0; }
body.ui-modern .ui-page-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; color: #101828; }
body.ui-modern .ui-page-subtitle { margin: 2px 0 0; color: #475467; font-size: 14px; }
body.ui-modern .ui-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.ui-modern .ui-page-actions > .btn { float: none; margin: 0; }
body.ui-modern .ui-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    padding: 0;
    list-style: none;
    color: #667085;
    font-size: 13px;
}
body.ui-modern .ui-breadcrumb a { color: #475467; text-decoration: none; }
body.ui-modern .ui-breadcrumb a:hover { color: #1d4ed8; }
body.ui-modern .ui-breadcrumb .fa { font-size: 11px; color: #98a2b3; }

/* ---------------------------------------------------------------------
   4. Icon chip
   --------------------------------------------------------------------- */
body.ui-modern .ui-icon-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 16px;
    line-height: 1;
}
body.ui-modern .ui-icon-chip--lg { width: 44px; height: 44px; border-radius: 12px; font-size: 19px; }
body.ui-modern .ui-icon-chip--sm { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
body.ui-modern .ui-icon-chip--primary { background: #eff6ff; color: #1d4ed8; box-shadow: inset 0 0 0 1px #dbeafe; }
body.ui-modern .ui-icon-chip--success { background: #ecfdf3; color: #067647; box-shadow: inset 0 0 0 1px #d1fadf; }
body.ui-modern .ui-icon-chip--warning { background: #fffaeb; color: #b54708; box-shadow: inset 0 0 0 1px #fef0c7; }
body.ui-modern .ui-icon-chip--danger { background: #fef3f2; color: #b42318; box-shadow: inset 0 0 0 1px #fee4e2; }
body.ui-modern .ui-icon-chip--neutral { background: #f2f4f7; color: #475467; box-shadow: inset 0 0 0 1px #eaecf0; }

/* ---------------------------------------------------------------------
   5. Cards (and Bootstrap panels restyled as cards)
   --------------------------------------------------------------------- */
body.ui-modern .panel,
body.ui-modern .ui-card {
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .panel > .panel-heading {
    padding: 14px 20px;
    border-bottom: 1px solid #eaecf0;
    border-radius: 11px 11px 0 0;
}
body.ui-modern .panel-default > .panel-heading { background: #ffffff; color: #101828; border-color: #eaecf0; }
body.ui-modern .panel-primary { border-color: #bfdbfe; }
body.ui-modern .panel-primary > .panel-heading { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
body.ui-modern .panel-success, body.ui-modern .panel-green { border-color: #abefc6; }
body.ui-modern .panel-success > .panel-heading,
body.ui-modern .panel-green > .panel-heading { background: #ecfdf3; color: #067647; border-color: #abefc6; }
body.ui-modern .panel-warning, body.ui-modern .panel-yellow { border-color: #fedf89; }
body.ui-modern .panel-warning > .panel-heading,
body.ui-modern .panel-yellow > .panel-heading { background: #fffaeb; color: #93370d; border-color: #fedf89; }
body.ui-modern .panel-danger, body.ui-modern .panel-red { border-color: #fecdca; }
body.ui-modern .panel-danger > .panel-heading,
body.ui-modern .panel-red > .panel-heading { background: #fef3f2; color: #b42318; border-color: #fecdca; }
body.ui-modern .panel-info { border-color: #b2ddff; }
body.ui-modern .panel-info > .panel-heading { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }
body.ui-modern .panel-green a, body.ui-modern .panel-red a, body.ui-modern .panel-yellow a { color: inherit; }
body.ui-modern .panel-heading h3,
body.ui-modern .panel-heading h4,
body.ui-modern .panel-title { margin-top: 2px; margin-bottom: 2px; font-size: 16px; font-weight: 600; line-height: 1.5; color: inherit; }
body.ui-modern .panel-body { padding: 20px; }
body.ui-modern .panel-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #eaecf0;
    border-radius: 0 0 11px 11px;
}
/* MagicGrid pagers use a Bootstrap .container inside panels; let it fit. */
body.ui-modern .panel-footer > .container,
body.ui-modern .magicgrid-footer > .container { width: auto; max-width: 100%; }
body.ui-modern .panel > .table-responsive:last-child,
body.ui-modern .panel > .table:last-child { border-radius: 0 0 11px 11px; }

body.ui-modern .ui-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #eaecf0;
    border-radius: 11px 11px 0 0;
}
body.ui-modern .ui-card-header:before,
body.ui-modern .ui-card-header:after { display: none; }
body.ui-modern .ui-card-heading { flex: 1 1 200px; min-width: 0; }
body.ui-modern .ui-card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #101828;
}
body.ui-modern .ui-card-title > h2,
body.ui-modern .ui-card-title > h3 { margin: 0; color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }
body.ui-modern .ui-card-subtitle { margin: 2px 0 0; color: #667085; font-size: 13px; line-height: 1.45; }
body.ui-modern .ui-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
body.ui-modern .ui-card-actions > .pull-right,
body.ui-modern .ui-card-actions > .pull-left { float: none !important; }
body.ui-modern .ui-card-body { padding: 20px; }
body.ui-modern .ui-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #eaecf0;
    border-radius: 0 0 11px 11px;
}
body.ui-modern .ui-card-footer:before,
body.ui-modern .ui-card-footer:after { display: none; }
body.ui-modern .ui-card--flush > .table-responsive,
body.ui-modern .ui-card--flush > .ui-table-scroll { margin: 0; border: 0; }
body.ui-modern .ui-card--flush > .table-responsive > .table,
body.ui-modern .ui-card--flush > .ui-table-scroll > .table,
body.ui-modern .ui-card--flush > .table { margin: 0; }
/* Wrapper that should not look like a card (keeps .panel for scripts). */
body.ui-modern .panel.ui-bare,
body.ui-modern .ui-bare { margin: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
body.ui-modern .ui-stack > * + * { margin-top: 20px; }

/* ---------------------------------------------------------------------
   6. Buttons
   --------------------------------------------------------------------- */
body.ui-modern .btn {
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    border-radius: 8px;
    border-width: 1px;
    background-image: none;
    text-shadow: none;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
    transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
body.ui-modern .btn:active,
body.ui-modern .btn.active { box-shadow: inset 0 1px 2px rgba(16,24,40,.12); }
body.ui-modern .btn-lg, body.ui-modern .ui-btn-lg { padding: 9px 18px; font-size: 15px; line-height: 22px; }
body.ui-modern .btn-sm { padding: 4px 10px; font-size: 13px; line-height: 20px; }
body.ui-modern .btn-xs { padding: 3px 7px; font-size: 12px; line-height: 20px; border-radius: 6px; }
body.ui-modern .btn-block { display: block; width: 100%; }
body.ui-modern .btn:not(.btn-xs):not(.ui-icon-btn) > .fa:first-child { margin-right: 6px; }
body.ui-modern .btn .fa-2x,
body.ui-modern .btn .fa-lg,
body.ui-modern .btn .fa-3x { font-size: 14px; line-height: inherit; vertical-align: baseline; }

body.ui-modern .btn-default,
body.ui-modern .btn-secondary {
    background: #ffffff;
    border-color: #d0d5dd;
    color: #344054;
}
body.ui-modern .btn-default:hover,
body.ui-modern .btn-default:focus,
body.ui-modern .btn-secondary:hover,
body.ui-modern .btn-secondary:focus { background: #f8fafc; border-color: #b9c0cc; color: #101828; }
body.ui-modern .btn-default:active,
body.ui-modern .btn-default.active,
body.ui-modern .open > .dropdown-toggle.btn-default { background: #f2f4f7; border-color: #b9c0cc; color: #101828; }
body.ui-modern .btn-primary { background: #2563eb; border-color: #2563eb; color: #ffffff; }
body.ui-modern .btn-primary:hover,
body.ui-modern .btn-primary:focus { background: #1d4ed8; border-color: #1d4ed8; color: #ffffff; }
body.ui-modern .btn-primary:active,
body.ui-modern .btn-primary.active,
body.ui-modern .open > .dropdown-toggle.btn-primary { background: #1e40af; border-color: #1e40af; color: #ffffff; }
body.ui-modern .btn-success { background: #067647; border-color: #067647; color: #ffffff; }
body.ui-modern .btn-success:hover,
body.ui-modern .btn-success:focus,
body.ui-modern .btn-success:active { background: #05603a; border-color: #05603a; color: #ffffff; }
body.ui-modern .btn-warning { background: #f79009; border-color: #f79009; color: #1d2939; }
body.ui-modern .btn-warning:hover,
body.ui-modern .btn-warning:focus,
body.ui-modern .btn-warning:active { background: #fdb022; border-color: #fdb022; color: #1d2939; }
body.ui-modern .btn-danger { background: #d92d20; border-color: #d92d20; color: #ffffff; }
body.ui-modern .btn-danger:hover,
body.ui-modern .btn-danger:focus,
body.ui-modern .btn-danger:active { background: #b42318; border-color: #b42318; color: #ffffff; }
body.ui-modern .btn-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; box-shadow: none; }
body.ui-modern .btn-info:hover,
body.ui-modern .btn-info:focus,
body.ui-modern .btn-info:active { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
body.ui-modern .btn-link { color: #1d4ed8; box-shadow: none; font-weight: 500; }
body.ui-modern .btn-link:hover,
body.ui-modern .btn-link:focus { color: #1e40af; }
body.ui-modern .btn.disabled,
body.ui-modern .btn[disabled],
body.ui-modern fieldset[disabled] .btn { opacity: .5; box-shadow: none; }
/* MagicGrid exporter (generated: a.btn.btn-warning with fa-save) reads as a secondary action. */
body.ui-modern a.btn[href*="export=true"] {
    background: #ffffff;
    border-color: #d0d5dd;
    color: #344054;
}
body.ui-modern a.btn[href*="export=true"]:hover,
body.ui-modern a.btn[href*="export=true"]:focus { background: #f8fafc; border-color: #b9c0cc; color: #101828; }
body.ui-modern a.btn[href*="export=true"] > .fa-save:before { content: "\f019"; }
body.ui-modern a.btn[href*="export=true"] > .fa { margin-right: 6px; color: #475467; }

body.ui-modern .ui-btn-soft { background: #eff6ff; border-color: #eff6ff; color: #1e40af; box-shadow: none; }
body.ui-modern .ui-btn-soft:hover,
body.ui-modern .ui-btn-soft:focus { background: #dbeafe; border-color: #dbeafe; color: #1e40af; }
body.ui-modern .ui-btn-ghost { background: transparent; border-color: transparent; color: #475467; box-shadow: none; }
body.ui-modern .ui-btn-ghost:hover,
body.ui-modern .ui-btn-ghost:focus { background: #f2f4f7; border-color: transparent; color: #101828; }

body.ui-modern .ui-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    font-size: 14px;
    line-height: 1;
    vertical-align: middle;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
body.ui-modern .ui-icon-btn > .fa { margin: 0; }
body.ui-modern .ui-icon-btn:hover,
body.ui-modern .ui-icon-btn:focus { background: #f2f4f7; border-color: #e4e7ec; color: #101828; text-decoration: none; }
body.ui-modern .ui-icon-btn--primary:hover,
body.ui-modern .ui-icon-btn--primary:focus { background: #eff6ff; border-color: #dbeafe; color: #1d4ed8; }
body.ui-modern .ui-icon-btn--danger:hover,
body.ui-modern .ui-icon-btn--danger:focus { background: #fef3f2; border-color: #fee4e2; color: #b42318; }
body.ui-modern .ui-icon-btn--md { width: 36px; height: 36px; border-radius: 8px; font-size: 16px; }

/* ---------------------------------------------------------------------
   7. Forms
   --------------------------------------------------------------------- */
body.ui-modern label,
body.ui-modern .control-label {
    margin-bottom: 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}
body.ui-modern .smart-form { line-height: 1.5; }
body.ui-modern fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
body.ui-modern legend {
    margin: 4px 0 16px;
    padding: 0 0 8px;
    border-bottom: 1px solid #eaecf0;
    color: #101828;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
body.ui-modern .form-control {
    height: 38px;
    padding: 8px 12px;
    border: 1px solid #8a94a6;
    border-radius: 8px;
    background-color: #ffffff;
    color: #101828;
    font-size: 14px;
    line-height: 20px;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
    transition: border-color .14s ease, box-shadow .14s ease;
}
body.ui-modern .form-control:hover { border-color: #667085; }
body.ui-modern .form-control:focus {
    border-color: #2563eb;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(37,99,235,.30);
}
body.ui-modern textarea.form-control,
body.ui-modern select.form-control[multiple],
body.ui-modern select.form-control[size] { height: auto; padding: 10px 12px; }
body.ui-modern textarea.form-control { min-height: 80px; resize: vertical; }
body.ui-modern .form-control.input-sm { height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 6px; }
body.ui-modern .form-control.input-lg { height: 46px; font-size: 16px; }
body.ui-modern .form-control::placeholder { color: #667085; opacity: 1; }
body.ui-modern .form-control[disabled],
body.ui-modern .form-control[readonly],
body.ui-modern fieldset[disabled] .form-control { background: #f2f4f7; border-color: #d0d5dd; color: #475467; box-shadow: none; }
body.ui-modern .has-error .form-control,
body.ui-modern .form-control.input-validation-error { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217,45,32,.12); }
body.ui-modern .has-error .form-control:focus,
body.ui-modern .form-control.input-validation-error:focus { box-shadow: 0 0 0 3px rgba(217,45,32,.25); }
body.ui-modern .field-validation-error,
body.ui-modern .has-error .help-block,
body.ui-modern .has-error .control-label { color: #b42318; }
body.ui-modern .field-validation-error { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; }
body.ui-modern .has-success .form-control { border-color: #067647; }
body.ui-modern .has-warning .form-control { border-color: #b54708; }
body.ui-modern .help-block { color: #667085; font-size: 12px; }
body.ui-modern .form-group { margin-bottom: 16px; }
body.ui-modern .input-group-addon { background: #f8fafc; color: #475467; border-color: #8a94a6; border-radius: 8px; }
body.ui-modern input[type=checkbox],
body.ui-modern input[type=radio] { width: 16px; height: 16px; margin-top: 2px; accent-color: #2563eb; vertical-align: -3px; }
body.ui-modern .checkbox label,
body.ui-modern .radio label,
body.ui-modern .checkbox-inline,
body.ui-modern .radio-inline { color: #344054; font-weight: 400; }
/* Joined control geometry after the radius override. */
body.ui-modern .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; }
body.ui-modern .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle),
body.ui-modern .input-group .form-control:first-child,
body.ui-modern .input-group-addon:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.ui-modern .btn-group > .btn:last-child:not(:first-child),
body.ui-modern .btn-group > .dropdown-toggle:not(:first-child),
body.ui-modern .input-group .form-control:last-child,
body.ui-modern .input-group-addon:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Form sections, grid and fields */
body.ui-modern .ui-form-section > .ui-card-body { padding-bottom: 4px; }
body.ui-modern .ui-form-section-header { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
body.ui-modern .ui-form-grid { display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; }
body.ui-modern .ui-form-grid:before,
body.ui-modern .ui-form-grid:after { display: none; }
body.ui-modern .ui-form-grid > [class*="col-"] { float: none; padding-left: 8px; padding-right: 8px; }
:where(body.ui-modern .ui-form-grid > [class*="col-"]) { width: 100%; }
body.ui-modern .ui-field { margin-bottom: 16px; min-width: 0; }
body.ui-modern .ui-field > label,
body.ui-modern .ui-field > .control-label { display: block; }
body.ui-modern .ui-field > p:empty { display: none; }
/* v2.1 (Stage C promotion of P2-ADM-REQ-001 and the P2-CAT-A copy): legacy helper output (Html.labeledtextbox, smartCheckBoxFor, unclassed text inputs and selects) inside a ui-field looks like a .form-control. */
body.ui-modern .ui-field label.label { display: block; margin: 0 0 4px; padding: 0; text-align: left; font-size: 13px; font-weight: 500; color: #475467; }
body.ui-modern .ui-field label.input { display: block; width: 100%; margin: 0; }
body.ui-modern .ui-field label.checkbox { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; padding-left: 12px; }
body.ui-modern .ui-field input[type=text]:not(.form-control):not([class*="select2"]):not([class*="xelect"]),
body.ui-modern .ui-field select:not(.form-control):not([class*="select2"]):not([class*="xelect"]) {
    display: block; width: 100%; height: 38px; padding: 8px 12px;
    border: 1px solid #8a94a6; border-radius: 8px; background-color: #ffffff;
    color: #101828; font-size: 14px; line-height: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .ui-field input[type=text]:not(.form-control):not([class*="select2"]):not([class*="xelect"]):focus,
body.ui-modern .ui-field select:not(.form-control):not([class*="select2"]):not([class*="xelect"]):focus {
    border-color: #2563eb; outline: 2px solid transparent; box-shadow: 0 0 0 3px rgba(37,99,235,.30);
}
/* v2.2: selects classed "select2" that the plugin never initialises (plain DropDownListFor with class select2, e.g. MenuSistema/Edit) look like a .form-control. An initialised Select2 keeps its own inline display:none and is unaffected. */
body.ui-modern .ui-field select.select2:not(.form-control) { display: block; width: 100%; height: 38px; padding: 8px 12px; border: 1px solid #8a94a6; border-radius: 8px; background-color: #ffffff; color: #101828; font-size: 14px; line-height: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
body.ui-modern .ui-field select.select2:not(.form-control):focus { border-color: #2563eb; outline: 2px solid transparent; box-shadow: 0 0 0 3px rgba(37,99,235,.30); }
body.ui-modern .ui-required > label:after,
body.ui-modern label.ui-required:after,
body.ui-modern span.ui-required:after { content: " *"; color: #d92d20; font-weight: 600; }
body.ui-modern .ui-form-columns > [class*="col-"] { display: flex; flex-direction: column; }
body.ui-modern .ui-form-columns > [class*="col-"] > .ui-card { flex: 1 1 auto; }
body.ui-modern .ui-help { display: block; margin-top: 4px; color: #667085; font-size: 12px; line-height: 1.45; }
body.ui-modern .ui-check { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; }
body.ui-modern .ui-check label { display: flex; align-items: center; gap: 8px; margin: 0; color: #344054; font-size: 14px; font-weight: 400; cursor: pointer; }
body.ui-modern .ui-check input[type=checkbox] { position: static; margin: 0; }
body.ui-modern .ui-input-icon { position: relative; }
body.ui-modern .ui-input-icon > .fa {
    position: absolute;
    top: 0;
    left: 12px;
    z-index: 3;
    height: 38px;
    line-height: 38px;
    color: #667085;
    font-size: 15px;
    pointer-events: none;
}
body.ui-modern .ui-input-icon > .form-control { padding-left: 38px; }

/* Form action bar */
body.ui-modern .ui-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 4px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid #e4e7ec;
}
body.ui-modern .ui-form-actions:before,
body.ui-modern .ui-form-actions:after { display: none; }
body.ui-modern .ui-form-actions > .btn { float: none; margin: 0; }
body.ui-modern .ui-form-actions-hint { margin-right: auto; color: #667085; font-size: 13px; }
body.ui-modern .ui-form-actions--sticky {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    margin: 0;
    padding: 12px 16px;
    background: rgba(255,255,255,.97);
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16,24,40,.08);
}
body.ui-modern.ui-window .ui-form-actions--sticky { bottom: 8px; }

/* ---------------------------------------------------------------------
   8. Filter panel and toolbar
   --------------------------------------------------------------------- */
body.ui-modern .ui-filter { margin-bottom: 20px; }
body.ui-modern .ui-filter .ui-card-body { padding-bottom: 4px; }
body.ui-modern .ui-filter-actions { justify-content: flex-end; }
body.ui-modern .ui-filter-actions > .btn { float: none; margin: 0; }
body.ui-modern .ui-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.ui-modern .ui-toolbar > .btn,
body.ui-modern .ui-toolbar > .btn-group { float: none; margin: 0; }

/* ---------------------------------------------------------------------
   9. Tables (Bootstrap .table and MagicGrid output)
   --------------------------------------------------------------------- */
body.ui-modern .table { margin-bottom: 0; color: #101828; background: #ffffff; }
body.ui-modern .table > thead > tr > th,
body.ui-modern .magic-grid-header > th {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 0;
    border-bottom: 1px solid #e4e7ec;
    color: #475467;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 18px;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}
body.ui-modern .table > thead > tr > th a,
body.ui-modern .magic-grid-header > th a { color: inherit; text-decoration: none; }
body.ui-modern .table > thead > tr > th a:hover,
body.ui-modern .magic-grid-header > th a:hover { color: #101828; }
body.ui-modern .table > tbody > tr > td,
body.ui-modern .table > tbody > tr > th,
body.ui-modern .table > tfoot > tr > td,
body.ui-modern .magic-grid-body-td {
    padding: 10px 16px;
    border-top: 1px solid #eaecf0;
    vertical-align: middle;
    line-height: 22px;
}
body.ui-modern .table > tbody > tr:first-child > td { border-top: 0; }
body.ui-modern .table-condensed > thead > tr > th,
body.ui-modern .table-condensed > tbody > tr > td { padding: 6px 10px; }
body.ui-modern .table > tbody > tr:not(.danger):not(.success):not(.warning):not(.info):not(.active):not(.row-selected):hover > td { background-color: #f8fafc; }
body.ui-modern .table-striped > tbody > tr:nth-of-type(odd) { background-color: #fcfcfd; }
body.ui-modern .table-bordered,
body.ui-modern .table-bordered > thead > tr > th,
body.ui-modern .table-bordered > tbody > tr > td { border-color: #eaecf0; }
body.ui-modern .table > tbody > tr.danger > td { background: #fef3f2; }
body.ui-modern .table > tbody > tr.success > td { background: #ecfdf3; }
body.ui-modern .table > tbody > tr.warning > td { background: #fffaeb; }
body.ui-modern .table > tbody > tr.info > td,
body.ui-modern .table > tbody > tr.active > td,
body.ui-modern .table > tbody > tr.row-selected > td { background: #eff6ff; }
body.ui-modern .magic-grid-footer-td { background: #f8fafc; font-weight: 600; }
/* Align the first/last cell with card padding. */
body.ui-modern .panel > .table-responsive > .table > * > tr > :first-child,
body.ui-modern .panel > .table > * > tr > :first-child,
body.ui-modern .ui-card--flush .table > * > tr > :first-child { padding-left: 20px; }
body.ui-modern .panel > .table-responsive > .table > * > tr > :last-child,
body.ui-modern .panel > .table > * > tr > :last-child,
body.ui-modern .ui-card--flush .table > * > tr > :last-child { padding-right: 20px; }
body.ui-modern .table-responsive { border: 0; }
body.ui-modern .ui-table-actions { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
body.ui-modern .ui-table-scroll { max-width: 100%; overflow-x: auto; }
body.ui-modern .ui-num { text-align: right; font-variant-numeric: tabular-nums; }
body.ui-modern [magicgrid-group-drag][dropped] { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; border-radius: 999px; padding: 2px 10px; }

/* Pager */
body.ui-modern .pagination { margin: 0; }
body.ui-modern .pagination > li > a,
body.ui-modern .pagination > li > span,
body.ui-modern .pagination > li:first-child > a,
body.ui-modern .pagination > li:last-child > a,
body.ui-modern .pagination > li:first-child > span,
body.ui-modern .pagination > li:last-child > span {
    min-width: 32px;
    height: 32px;
    margin: 0 2px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475467;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    text-align: center;
}
body.ui-modern .pagination > li > a:hover,
body.ui-modern .pagination > li > a:focus { background: #f2f4f7; border-color: #e4e7ec; color: #101828; }
body.ui-modern .pagination > .active > a,
body.ui-modern .pagination > .active > span,
body.ui-modern .pagination > .active > a:hover,
body.ui-modern .pagination > .active > a:focus { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; font-weight: 600; }
body.ui-modern .pagination > .disabled > a,
body.ui-modern .pagination > .disabled > span { color: #98a2b3; background: transparent; }
body.ui-modern .ui-pager { justify-content: space-between; }
body.ui-modern .ui-pager .pagination { display: flex; flex-wrap: wrap; gap: 2px 0; float: none !important; }
body.ui-modern .ui-pager-info .pagination > li > a,
body.ui-modern .ui-pager-info .pagination > li > span {
    margin: 0;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: #475467;
    font-weight: 500;
    cursor: default;
}
body.ui-modern .ui-pager-info .container { width: auto; padding: 0; margin: 0; text-align: left !important; }
/* MagicGrid total records rendered as a pill (ul.pagination > li > a without href). */
body.ui-modern .ui-count { display: inline-flex; }
body.ui-modern .ui-count .pagination { display: inline-flex; float: none !important; margin: 0; }
body.ui-modern .ui-count .pagination > li > a,
body.ui-modern .ui-count .pagination > li > span {
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 1px 10px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    cursor: default;
}

/* ---------------------------------------------------------------------
   10. Status pills / badges / labels
   --------------------------------------------------------------------- */
body.ui-modern .badge,
body.ui-modern .ui-badge {
    display: inline-block;
    min-width: 24px;
    padding: 1px 9px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}
body.ui-modern .ui-badge--neutral { background: #f2f4f7; border-color: #e4e7ec; color: #344054; }
body.ui-modern .ui-badge--primary { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
body.ui-modern .ui-badge--success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
body.ui-modern .ui-badge--warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
body.ui-modern .ui-badge--danger { background: #fef3f2; border-color: #fecdca; color: #b42318; }
body.ui-modern .ui-badge--dot:before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 999px; background: currentColor; vertical-align: middle; }
body.ui-modern .label { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
body.ui-modern .label-default { background: #f2f4f7; color: #344054; }
body.ui-modern .label-primary { background: #eff6ff; color: #1e40af; }
body.ui-modern .label-success { background: #ecfdf3; color: #067647; }
body.ui-modern .label-warning { background: #fffaeb; color: #93370d; }
body.ui-modern .label-danger { background: #fef3f2; color: #b42318; }
body.ui-modern .label-info { background: #eff8ff; color: #175cd3; }

/* ---------------------------------------------------------------------
   11. Callouts (ui-callout, Bootstrap .alert, validation summary)
   --------------------------------------------------------------------- */
body.ui-modern .ui-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid #b2ddff;
    border-left-width: 4px;
    border-radius: 8px;
    background: #eff8ff;
    color: #175cd3;
}
body.ui-modern .ui-callout-icon { flex: none; margin-top: 2px; font-size: 17px; line-height: 1; }
body.ui-modern .ui-callout-title { margin: 0 0 2px; color: inherit; font-size: 14px; font-weight: 600; }
body.ui-modern .ui-callout-body { color: #344054; }
body.ui-modern .ui-callout-body > :last-child { margin-bottom: 0; }
body.ui-modern .ui-callout--info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
body.ui-modern .ui-callout--success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
body.ui-modern .ui-callout--warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
body.ui-modern .ui-callout--danger { background: #fef3f2; border-color: #fecdca; color: #b42318; }

body.ui-modern .alert,
body.ui-modern .validation-summary-errors {
    position: relative;
    margin: 0 0 20px;
    padding: 13px 16px 13px 44px;
    border: 1px solid #b2ddff;
    border-left-width: 4px;
    border-radius: 8px;
    background: #eff8ff;
    color: #175cd3;
    font-weight: 500;
}
body.ui-modern .alert:before,
body.ui-modern .validation-summary-errors:before {
    position: absolute;
    top: 14px;
    left: 16px;
    font: normal normal normal 17px/1 FontAwesome;
    content: "\f05a";
}
body.ui-modern .alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
body.ui-modern .alert-success:before { content: "\f058"; }
body.ui-modern .alert-warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
body.ui-modern .alert-warning:before { content: "\f071"; }
body.ui-modern .alert-danger,
body.ui-modern .validation-summary-errors { background: #fef3f2; border-color: #fecdca; color: #b42318; }
body.ui-modern .alert-danger:before,
body.ui-modern .validation-summary-errors:before { content: "\f057"; }
body.ui-modern .alert-info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
body.ui-modern .alert .alert-link { color: inherit; text-decoration: underline; }
body.ui-modern .alert .close { top: 0; right: -4px; }
body.ui-modern .validation-summary-errors > ul { margin: 0; padding-left: 18px; color: #7a271a; font-weight: 400; }
body.ui-modern .validation-summary-errors > ul:before {
    content: "Revisá los datos ingresados";
    display: block;
    margin: 0 0 4px -18px;
    color: #b42318;
    font-weight: 600;
}
/* An empty, valid summary (Bootstrap alert class) must stay invisible. */
body.ui-modern .validation-summary-valid.alert { display: none !important; }

/* ---------------------------------------------------------------------
   12. Stat card, description list, empty state
   --------------------------------------------------------------------- */
body.ui-modern .ui-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    margin-bottom: 20px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .ui-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.ui-modern .ui-stat-label { color: #475467; font-size: 13px; font-weight: 500; }
body.ui-modern .ui-stat-value { color: #101828; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
body.ui-modern .ui-stat-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid #eaecf0; color: #667085; font-size: 12px; }
body.ui-modern .ui-stat-footer a { font-weight: 500; text-decoration: none; }
body.ui-modern .ui-dl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px 24px;
    margin: 0;
}
body.ui-modern .ui-dl dt { color: #667085; font-size: 12px; font-weight: 500; }
body.ui-modern .ui-dl dd { margin: 2px 0 0; color: #101828; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
body.ui-modern .ui-empty { padding: 40px 20px; text-align: center; }
body.ui-modern .ui-empty .ui-icon-chip { margin-bottom: 12px; }
body.ui-modern .ui-empty-title { margin: 0 0 4px; color: #101828; font-size: 16px; font-weight: 600; }
body.ui-modern .ui-empty-text { max-width: 420px; margin: 0 auto; color: #475467; }
body.ui-modern .ui-empty .btn { margin-top: 16px; }
body.ui-modern .ui-message-card { max-width: 560px; margin: 40px auto; padding: 32px; text-align: center; }
body.ui-modern .ui-message-card .ui-icon-chip { margin-bottom: 16px; }
body.ui-modern .ui-message-card h1 { margin: 0 0 6px; font-size: 22px; }
body.ui-modern .ui-message-card p { margin: 0; color: #475467; }

/* ---------------------------------------------------------------------
   13. Tabs, dropdowns, list groups, wells, breadcrumbs, progress
   --------------------------------------------------------------------- */
body.ui-modern .nav-tabs { border-bottom: 1px solid #e4e7ec; }
body.ui-modern .nav-tabs > li { margin-bottom: -1px; }
body.ui-modern .nav-tabs > li > a {
    margin-right: 4px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #475467;
    font-weight: 500;
}
body.ui-modern .nav-tabs > li > a:hover,
body.ui-modern .nav-tabs > li > a:focus { background: transparent; border-bottom-color: #d0d5dd; color: #101828; }
body.ui-modern .nav-tabs > li.active > a,
body.ui-modern .nav-tabs > li.active > a:hover,
body.ui-modern .nav-tabs > li.active > a:focus { background: transparent; border: 0; border-bottom: 2px solid #2563eb; color: #1d4ed8; font-weight: 600; }
body.ui-modern .tab-content > .tab-pane { padding-top: 20px; }
body.ui-modern .nav-pills > li > a { border-radius: 8px; color: #475467; font-weight: 500; }
body.ui-modern .nav-pills > li > a:hover { background: #f2f4f7; color: #101828; }
body.ui-modern .nav-pills > li.active > a,
body.ui-modern .nav-pills > li.active > a:hover,
body.ui-modern .nav-pills > li.active > a:focus { background: #eff6ff; color: #1e40af; }
body.ui-modern .dropdown-menu {
    padding: 4px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16,24,40,.08);
}
body.ui-modern .dropdown-menu > li > a { padding: 7px 12px; border-radius: 6px; color: #101828; }
body.ui-modern .dropdown-menu > li > a:hover,
body.ui-modern .dropdown-menu > li > a:focus { background: #f2f4f7; color: #101828; }
body.ui-modern .dropdown-menu > .active > a,
body.ui-modern .dropdown-menu > .active > a:hover { background: #eff6ff; color: #1e40af; }
body.ui-modern .dropdown-menu > .disabled > a { color: #98a2b3; }
body.ui-modern .list-group-item { border-color: #eaecf0; }
body.ui-modern .list-group-item:first-child { border-radius: 8px 8px 0 0; }
body.ui-modern .list-group-item:last-child { border-radius: 0 0 8px 8px; }
body.ui-modern .list-group-item.active { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
body.ui-modern .well { background: #f8fafc; border: 1px solid #e4e7ec; border-radius: 12px; box-shadow: none; }
body.ui-modern .breadcrumb { padding: 0; margin-bottom: 8px; background: transparent; font-size: 13px; }
body.ui-modern .progress { height: 10px; margin-bottom: 8px; background: #eaecf0; border-radius: 999px; box-shadow: none; }
body.ui-modern .progress-bar { background-color: #2563eb; box-shadow: none; }
body.ui-modern .progress-bar-success { background-color: #067647; }
body.ui-modern .progress-bar-warning { background-color: #f79009; }
body.ui-modern .progress-bar-danger { background-color: #d92d20; }

/* ---------------------------------------------------------------------
   14. Modal and MagicWindow
   v1.1: Bootstrap modals (z 1050) opened under the fixed header (z 2000).
   :where() keeps Bootstrap-level specificity so page-raised modals
   (Dashboard/Cubos 99999) still win; xelect drop is lifted above modals.
   --------------------------------------------------------------------- */
:where(body.ui-modern.ui-shell) .modal-backdrop { z-index: 2040; }
:where(body.ui-modern.ui-shell) .modal { z-index: 2050; }
body.ui-modern #xelect-result-container { z-index: 2060; }
body.ui-modern .modal-backdrop.in { opacity: .45; }
body.ui-modern .modal-backdrop { background: #0f172a; }
body.ui-modern .modal-content {
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16,24,40,.18);
    overflow: hidden;
}
body.ui-modern .modal-header { padding: 16px 20px; border-bottom: 1px solid #eaecf0; background: #ffffff; }
body.ui-modern .modal-title { font-size: 16px; font-weight: 600; line-height: 1.5; }
body.ui-modern .modal-body { padding: 20px; }
body.ui-modern .modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #eaecf0;
    background: #f8fafc;
}
body.ui-modern .modal-footer:before,
body.ui-modern .modal-footer:after { display: none; }
body.ui-modern .modal-footer .btn + .btn { margin-left: 0; }
body.ui-modern .close { color: #475467; font-size: 22px; font-weight: 400; opacity: .8; text-shadow: none; }
body.ui-modern .close:hover,
body.ui-modern .close:focus { color: #101828; opacity: 1; }
body.ui-modern .magicwin-win {
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(16,24,40,.18);
    overflow: hidden;
}
body.ui-modern .magicwin-win-title { background: #1e293b; color: #f8fafc; }
body.ui-modern .magicwin-win-title-span { color: #f8fafc; font-size: 12px; font-weight: 600; }
body.ui-modern .magicwin-win-content { background: #f5f7fb; border-color: #e4e7ec; }
body.ui-modern .magicwin-win-title-btn:focus { outline: 2px solid #93c5fd; outline-offset: 1px; }

/* ---------------------------------------------------------------------
   15. Widgets: Select2 3.5, xelect, jQuery UI datepicker, tri-state toggles
   No position, width or display overrides on plugin-built elements.
   --------------------------------------------------------------------- */
body.ui-modern .select2-container .select2-choice {
    height: 38px !important;
    padding: 0 0 0 12px;
    border: 1px solid #8a94a6;
    border-radius: 8px;
    background: #ffffff;
    background-image: none;
    color: #101828;
    font-size: 14px;
    line-height: 36px !important;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .select2-container .select2-choice:hover { border-color: #667085; }
body.ui-modern .select2-container .select2-choice > .select2-chosen { margin-right: 52px; }
body.ui-modern .select2-container .select2-choice .select2-arrow {
    width: 32px;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: transparent;
    background-image: none;
}
body.ui-modern .select2-container .select2-choice .select2-arrow b { background: none !important; }
body.ui-modern .select2-container .select2-choice .select2-arrow b:after {
    content: "\f107";
    display: block;
    color: #667085;
    font: normal normal normal 16px/36px FontAwesome;
    text-align: center;
}
body.ui-modern .select2-container .select2-choice abbr { top: 12px; right: 34px; }
body.ui-modern .select2-container .select2-choice.select2-default,
body.ui-modern .select2-container .select2-default .select2-chosen { color: #667085 !important; }
body.ui-modern .select2-container-active .select2-choice,
body.ui-modern .select2-container-active .select2-choices,
body.ui-modern .select2-dropdown-open .select2-choice {
    border-color: #2563eb;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(37,99,235,.30);
}
body.ui-modern .select2-dropdown-open .select2-choice { background: #ffffff; border-radius: 8px 8px 0 0; }
body.ui-modern .select2-dropdown-open.select2-drop-above .select2-choice { border-radius: 0 0 8px 8px; background-image: none; }
body.ui-modern .select2-container-multi .select2-choices {
    min-height: 38px;
    padding: 3px 6px;
    border: 1px solid #8a94a6;
    border-radius: 8px;
    background: #ffffff;
    background-image: none;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .select2-container-multi .select2-choices .select2-search-choice {
    margin: 3px 4px 3px 0;
    padding: 3px 8px 3px 20px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    background-image: none;
    color: #1e40af;
    box-shadow: none;
}
body.ui-modern .select2-drop {
    border: 1px solid #2563eb;
    border-radius: 0 0 8px 8px;
    background: #ffffff;
    color: #101828;
    box-shadow: 0 4px 12px rgba(16,24,40,.08);
}
body.ui-modern .select2-drop.select2-drop-above { border-radius: 8px 8px 0 0; }
body.ui-modern .select2-search { padding: 6px 6px 0; }
body.ui-modern .select2-search input,
body.ui-modern .xelect-search > input {
    min-height: 32px;
    border: 1px solid #8a94a6;
    border-radius: 6px;
    color: #101828;
}
body.ui-modern .select2-results { padding: 4px; margin: 4px 0; }
body.ui-modern .select2-results .select2-result-label { padding: 6px 8px; border-radius: 6px; }
body.ui-modern .select2-results .select2-highlighted { background: #eff6ff; color: #1e40af; border-radius: 6px; }
body.ui-modern .select2-results .select2-no-results,
body.ui-modern .select2-results .select2-searching,
body.ui-modern .select2-results .select2-selection-limit { background: transparent; color: #667085; padding: 6px 8px; }
body.ui-modern .select2-container.select2-container-disabled .select2-choice,
body.ui-modern .select2-container-multi.select2-container-disabled .select2-choices { background: #f2f4f7; border-color: #d0d5dd; color: #475467; box-shadow: none; }
body.ui-modern .select2.input-validation-error a,
body.ui-modern .input-validation-error-for-select2 { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217,45,32,.12); }
body.ui-modern .xelect-single,
body.ui-modern .xelect-multi {
    min-height: 38px;
    border-color: #8a94a6;
    border-radius: 8px;
    background: #ffffff;
    color: #101828;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
body.ui-modern .xelect-multi-focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.30); outline: 2px solid transparent; }
body.ui-modern #xelect-result-container { color: #101828; background: #ffffff; border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(16,24,40,.08); }
body.ui-modern .ui-datepicker {
    padding: 8px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #ffffff;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(16,24,40,.08);
}
body.ui-modern .ui-datepicker .ui-datepicker-header { background: #ffffff; border: 0; border-bottom: 1px solid #eaecf0; border-radius: 0; color: #101828; font-weight: 600; }
body.ui-modern .ui-datepicker th { color: #667085; font-size: 12px; font-weight: 600; }
body.ui-modern .ui-datepicker .ui-state-default { background: #ffffff; border: 1px solid transparent; border-radius: 6px; color: #344054; text-align: center; }
body.ui-modern .ui-datepicker .ui-state-hover { background: #f2f4f7; }
body.ui-modern .ui-datepicker .ui-state-highlight { border-color: #bfdbfe; color: #1e40af; }
body.ui-modern .ui-datepicker .ui-state-active { background: #2563eb; border-color: #2563eb; color: #ffffff; }
body.ui-modern .checkOnNullOff { background: #f2f4f7; border: 1px solid #d0d5dd; border-radius: 8px; box-shadow: none; }
body.ui-modern .checkOnNullOff span { color: #475467; }
body.ui-modern .checkOnNullOff.yes span.yes { background: #ecfdf3; color: #067647; box-shadow: inset 0 0 0 1px #abefc6; }
body.ui-modern .checkOnNullOff.no span.no { background: #fef3f2; color: #b42318; box-shadow: inset 0 0 0 1px #fecdca; }
body.ui-modern .checkOnNullOffContainer:focus-within { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 8px; }
body.ui-modern .checkOnOff { background: #eaecf0; }
body.ui-modern .checkOnOff:before { color: #067647; }

/* ---------------------------------------------------------------------
   16. Responsive
   --------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
    body.ui-modern .ui-topbar-user .ui-topbar-user-name { display: none; }
}
@media screen and (max-width: 767px) {
    body.ui-modern .ui-brand-product { display: none; }
    body.ui-modern .ui-topbar-user { display: none; }
    body.ui-modern .ui-page-title { font-size: 20px; }
    body.ui-modern .ui-page-heading .ui-icon-chip--lg { width: 40px; height: 40px; font-size: 17px; }
    body.ui-modern .ui-page-actions { width: 100%; }
    body.ui-modern .ui-page-actions > .btn { flex: 1 1 auto; text-align: center; }
    body.ui-modern .ui-pager { justify-content: center; }
    body.ui-modern .ui-form-actions-hint { display: none; }
    body.ui-modern .ui-form-actions > .btn { flex: 1 1 0; text-align: center; }
    body.ui-modern .ui-filter-actions > .btn { flex: 1 1 0; }
}
/* <=700px: MagicTemplate turns the sidebar into an 80px icon rail with hover
   flyouts. v2 shows it as a labelled drawer over the content instead (same
   element, same toggle and state classes). */
@media screen and (max-width: 700px) {
    body.ui-modern.ui-shell .magic-content { margin-left: 0; padding: 16px; overflow: visible; }
    body.ui-modern .magic-page > aside {
        width: 272px;
        max-width: 85vw;
        background: #0f172a;
        box-shadow: 0 12px 32px rgba(16,24,40,.35);
    }
    body.ui-modern .magic-menu { text-align: left; }
    body.ui-modern .magic-menu ul { position: static; width: auto; }
    body.ui-modern .magic-menu a { padding-top: 10px; padding-bottom: 10px; }
    body.ui-modern .magic-menu > ul > li > a > i,
    body.ui-modern .magic-menu > ul > li.parent > a > i { width: 18px; font-size: 15px !important; }
    body.ui-modern .magic-menu > ul > li.parent > a > span { display: block; }
    body.ui-modern .magic-menu > ul > li.parent > a > b { display: inline-block; }
    body.ui-modern .magic-menu li.parent:hover > ul {
        position: static;
        display: none !important;
        width: auto;
        border: 0;
        border-left: 1px solid #1e293b;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        animation: none;
    }
    body.ui-modern .magic-menu li.parent.open > ul,
    body.ui-modern .magic-menu li.parent.open:hover > ul { display: block !important; }
    body.ui-modern .magic-menu li.parent li b > i:before { content: ""; }
    body.ui-modern .ui-card-header,
    body.ui-modern .ui-card-body,
    body.ui-modern .ui-card-footer,
    body.ui-modern .panel-body,
    body.ui-modern .panel > .panel-heading,
    body.ui-modern .panel-footer { padding-left: 16px; padding-right: 16px; }
    body.ui-modern .ui-card-body,
    body.ui-modern .panel-body { padding-top: 16px; }
    body.ui-modern .panel > .table-responsive > .table > * > tr > :first-child,
    body.ui-modern .ui-card--flush .table > * > tr > :first-child { padding-left: 16px; }
    body.ui-modern.ui-auth > main > .magic-contents { padding: 24px 16px 16px; }
    body.ui-modern .ui-auth-card { padding: 24px 20px; }
    body.ui-modern.ui-window > main > .magic-contents { padding: 12px 12px 0; }
    body.ui-modern .magic-header { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
    body.ui-modern *, body.ui-modern *:before, body.ui-modern *:after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------------
   17. Print: no shell, no shadows, cards become bordered blocks.
   Bootstrap visibility helpers (.hidden-print) remain authoritative.
   --------------------------------------------------------------------- */
@media print {
    body.ui-modern { background: #ffffff; padding: 0; }
    body.ui-modern .magic-page { padding-top: 0; }
    body.ui-modern .magic-page > header,
    body.ui-modern .magic-page > aside,
    body.ui-modern .magic-page > aside-right { display: none; }
    body.ui-modern.ui-shell .magic-content { margin: 0; padding: 0; min-height: 0; overflow: visible; background: #ffffff; }
    body.ui-modern .panel,
    body.ui-modern .ui-card,
    body.ui-modern .ui-stat,
    body.ui-modern .modal-content { box-shadow: none; border-color: #d0d5dd; break-inside: avoid; }
    body.ui-modern .ui-page-actions,
    body.ui-modern .ui-form-actions { display: none; }
    body.ui-modern .ui-form-actions--sticky { position: static; box-shadow: none; }
    body.ui-modern .ui-table-scroll,
    body.ui-modern .table-responsive { overflow: visible; }
}

/* ---------------------------------------------------------------------
   18. v2.4 additions (2026-10-26)
   --------------------------------------------------------------------- */
/* Results card around MagicGrid's all-in-one @mg.GetGrid() output: the generated
   footer (pager, page-size dropdown, "Page x of y") becomes the card footer.
   magicgrid.css forces footer padding with !important, hence the !important here. */
body.ui-modern .ui-card--flush > .magicgrid { margin: 0; }
body.ui-modern .ui-card--flush > .magicgrid .table-responsive { margin: 0; border: 0; }
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 12px 20px !important;
    background: #f8fafc;
    border-top: 1px solid #eaecf0;
    border-radius: 0 0 11px 11px;
}
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer:before,
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer:after { display: none; }
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer > .pull-left,
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer > .pull-right { float: none !important; }
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer > .pagination { display: flex; flex-wrap: wrap; gap: 2px 0; }
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer > .container { flex: 1 1 auto; width: auto; margin: 0; padding: 0 8px; text-align: center; }
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer > .pull-right { order: 3; } /* page-size dropdown at the far right (not a form field) */
body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer > .container .pagination > li > a {
    margin: 0;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: #475467;
    font-weight: 500;
    cursor: default;
}

/* Filter bar: the page's first card holds the title and the page actions; the filter
   form sits in a collapsed body (#filterPanel, toggled by the page's own handler). */
body.ui-modern .ui-filterbar > .ui-card-header { border-bottom: 0; border-radius: 11px; }
body.ui-modern .ui-filterbar .ui-card-heading > .ui-card-title { font-size: 18px; line-height: 1.4; }
body.ui-modern .ui-filterbar .ui-card-actions > .btn { float: none; margin: 0; }
body.ui-modern .ui-filterbar-body { border-top: 1px solid #eaecf0; }
body.ui-modern .ui-filterbar-body .ui-card-body { padding-bottom: 4px; }

/* Promoted from module CSS (identical module copies may remain). */
body.ui-modern .ui-stat-icon { flex: none; }
body.ui-modern .ui-field-list { columns: 2 220px; column-gap: 24px; margin: 8px 0 0; padding-left: 20px; }
body.ui-modern .ui-field-list li { break-inside: avoid; margin-bottom: 2px; }
body.ui-modern .ui-field input[type=file] { display: block; width: 100%; max-width: 560px; padding: 8px; background: #f8fafc; border: 1px dashed #8a94a6; border-radius: 8px; color: #475467; font-size: 14px; }

@media screen and (max-width: 767px) {
    body.ui-modern .ui-filterbar .ui-card-actions { width: 100%; margin-left: 0; }
    body.ui-modern .ui-filterbar .ui-card-actions > .btn { flex: 1 1 auto; text-align: center; }
    body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer { justify-content: center; }
}
@media screen and (max-width: 700px) {
    body.ui-modern .ui-card--flush > .magicgrid .magicgrid-footer { padding: 12px 16px !important; }
}
@media print {
    body.ui-modern .ui-filterbar .ui-card-actions,
    body.ui-modern .ui-filterbar-body { display: none !important; }
}

/* v2.5: filter bars whose toggle is [data-action=search] (app.js toggles the panel's [data-search],
   e.g. Remito's form) start closed; jQuery's toggle() overrides this with an inline display. */
body.ui-modern .ui-filterbar > [data-search] { display: none; border-top: 1px solid #eaecf0; }
body.ui-modern .ui-filterbar > [data-search] .ui-card-body { padding-bottom: 4px; }
@media print {
    body.ui-modern .ui-filterbar > [data-search] { display: none !important; }
}

/* v2.5: collapsible card on native <details open> (no script). The flex header sits inside <summary>
   (flex directly on <summary> is unreliable in older Safari). Keep it open by default so charts draw at full width. */
body.ui-modern details.ui-collapsible > summary.ui-collapsible-summary { display: block; list-style: none; cursor: pointer; }
body.ui-modern details.ui-collapsible > summary.ui-collapsible-summary::-webkit-details-marker { display: none; }
body.ui-modern details.ui-collapsible > summary.ui-collapsible-summary::marker { content: ""; }
body.ui-modern details.ui-collapsible > summary:focus { outline: none; }
body.ui-modern details.ui-collapsible > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; border-radius: 11px; }
body.ui-modern .ui-collapsible-icon { flex: none; margin-left: auto; color: #667085; font-size: 13px; transition: transform .14s ease; }
body.ui-modern details.ui-collapsible:not([open]) .ui-collapsible-icon { transform: rotate(-90deg); }
body.ui-modern details.ui-collapsible:not([open]) > summary > .ui-card-header { border-bottom: 0; border-radius: 11px; }
body.ui-modern details.ui-collapsible > summary:hover .ui-collapsible-icon { color: #101828; }

/* v2.6: sticky action bar keeps the 20px card gap when it docks at the end of the form (the next card
   no longer touches it) and carries a 12px canvas band, so scrolled content does not show behind or
   under the floating bar. Owner-approved value change (was: margin 0, raised shadow only). */
body.ui-modern .ui-form-actions--sticky { margin-bottom: 20px; box-shadow: 0 4px 12px rgba(16,24,40,.08), 0 0 0 12px #f5f7fb; }
@media print {
    body.ui-modern .ui-form-actions--sticky { box-shadow: none; }
}
