:root {
    color-scheme: light;
    --navy: #0b1f33;
    --navy-hover: #14314d;
    --blue: #1769e0;
    --cyan: #16b8d4;
    --cyber-navy: #0b1f33;
    --security-blue: var(--blue);
    --security-blue-hover: var(--navy-hover);
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-blue: #f3f7ff;
    --text: #1e293b;
    --muted: #64748b;
    --subtle: #94a3b8;
    --danger: #b42318;
    --success: #067647;
    --warning: #b45309;
    --sidebar-width: 256px;
    --topbar-height: 72px;
    --app-footer-height: 64px;
    --shadow: 0 1px 3px rgba(15, 31, 51, .07);
    --shadow-raised: 0 10px 28px rgba(15, 31, 51, .10);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--security-blue); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: #cbd5e1; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.app-layout { min-height: 100vh; }
.nav-toggle { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sidebar { position: fixed; inset: var(--topbar-height) auto var(--app-footer-height) 0; z-index: 100; width: var(--sidebar-width); height: calc(100vh - var(--topbar-height) - var(--app-footer-height)); display: flex; flex-direction: column; border-right: 1px solid rgba(255, 255, 255, .1); background: linear-gradient(120deg, #063f62 0%, #07587d 62%, #0b78a0 100%); color: #d9edf6; box-shadow: 8px 0 24px rgba(5, 65, 96, .12); transform: translateX(0); transition: transform .22s ease; }
.nav-toggle:checked ~ .sidebar { transform: translateX(-105%); }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 12px 18px; scrollbar-color: rgba(255, 255, 255, .34) transparent; scrollbar-width: thin; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .34); }
.nav-group { margin-top: 6px; }
.sidebar .nav-section, .nav-collapsible > summary { padding: 15px 10px 7px; color: #91d8f4; font-size: 10px; font-weight: 750; letter-spacing: 1.05px; text-transform: uppercase; }
.nav-collapsible > summary { display: flex; min-height: 35px; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; transition: color .15s ease; }
.nav-collapsible > summary::-webkit-details-marker { display: none; }
.nav-collapsible > summary:hover { color: #fff; }
.nav-chevron { font-size: 15px; transition: transform .18s ease; }
.nav-collapsible[open] .nav-chevron { transform: rotate(180deg); }
.sidebar nav a { display: flex; min-height: 42px; align-items: center; gap: 11px; margin: 2px 0; padding: 9px 11px; border-radius: 8px; color: #e3f3f9; font-weight: 520; text-decoration: none; transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; transform: translateX(2px); }
.sidebar nav a.active { background: rgba(255, 255, 255, .96); color: #063f62; box-shadow: 0 6px 16px rgba(3, 40, 62, .18); }
.nav-icon { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-label { flex: 1; min-width: 0; }
.nav-badge { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #fff; color: #07587d; font-size: 10px; font-weight: 800; text-align: center; }
.sidebar nav a.active .nav-badge { background: #0b78a0; color: #fff; }
.sidebar-footer { padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .16); color: #b8dce9; font-size: 11px; }
.sidebar-footer > span { display: block; margin: 0 8px; }

.main-content { display: flex; min-height: 100vh; flex-direction: column; margin-left: var(--sidebar-width); padding-top: var(--topbar-height); transition: margin-left .22s ease; }
.nav-toggle:checked ~ .main-content { margin-left: 0; }
.topbar { position: fixed; inset: 0 0 auto; z-index: 400; height: var(--topbar-height); display: flex; align-items: center; gap: 16px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .98); box-shadow: 0 1px 3px rgba(15, 31, 51, .04); backdrop-filter: blur(8px); }
.nav-toggle-button { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--cyber-navy); cursor: pointer; }
.nav-toggle-button:hover { border-color: #bfdbfe; background: var(--surface-blue); color: var(--security-blue); }
.nav-toggle-button svg { width: 22px; height: 22px; }
.topbar-brand { display: flex; width: 180px; height: 48px; flex: 0 0 180px; align-items: center; text-decoration: none; }
.topbar-brand img { display: block; width: 100%; height: 45px; object-fit: contain; object-position: left center; }
.global-search { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; flex: 1; gap: 10px; width: auto; max-width: 760px; min-width: 180px; margin: 0; }
.global-search-icon { position: absolute; top: 50%; left: 13px; display: grid; width: 19px; height: 19px; color: #94a3b8; transform: translateY(-50%); pointer-events: none; }
.global-search-icon svg { width: 19px; height: 19px; }
.global-search input { min-height: 42px; padding: 9px 14px 9px 42px; border-color: var(--line-strong); border-radius: 9px; background: #f8fafc; font-size: 14px; }
.global-search input:focus { background: #fff; }
.global-search-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid var(--security-blue); border-radius: 9px; background: var(--security-blue); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px rgba(23, 105, 224, .14); }
.global-search-submit:hover { border-color: var(--security-blue-hover); background: var(--security-blue-hover); }
.global-search-submit svg { width: 17px; height: 17px; }
.search-button-short { display: none; }
.topbar-platform-label { flex: 1; color: var(--cyber-navy); font-size: 15px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.topbar-icon { position: relative; display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid transparent; border-radius: 8px; color: #7b8798; text-decoration: none; }
.topbar-icon:hover { border-color: var(--line); background: var(--surface-soft); color: var(--security-blue); }
.topbar-icon svg { width: 20px; height: 20px; }
.topbar-notification-badge { position: absolute; top: 1px; right: 0; min-width: 18px; padding: 1px 5px; border: 2px solid #fff; border-radius: 999px; background: var(--security-blue); color: #fff; font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; }
.user-menu { position: relative; }
.user-menu > summary { display: flex; min-height: 46px; align-items: center; gap: 9px; padding: 3px 8px 3px 4px; border: 1px solid transparent; border-radius: 10px; color: #334155; cursor: pointer; list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { border-color: var(--line); background: var(--surface-soft); }
.user-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; overflow: hidden; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--security-blue), var(--cyan)); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .4px; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-name { max-width: 150px; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-chevron { color: #94a3b8; font-size: 15px; transition: transform .18s ease; }
.user-menu[open] .user-menu-chevron { transform: rotate(180deg); }
.user-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 500; width: 250px; overflow: hidden; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-raised); }
.user-menu-identity { display: grid; gap: 1px; padding: 9px 10px 11px; border-bottom: 1px solid var(--line); }
.user-menu-identity strong { overflow: hidden; color: var(--cyber-navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-identity span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-panel a, .user-menu-panel button { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 4px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: #475569; box-shadow: none; font-size: 12px; font-weight: 650; text-decoration: none; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: #edf3fb; color: var(--cyber-navy); transform: none; }
.user-menu-panel svg { width: 18px; height: 18px; }
.user-menu-panel form { margin: 0; }
.nav-overlay { display: none; }

.page-body { width: 100%; max-width: 1440px; flex: 1 0 auto; margin: 0 auto; padding: 28px 32px 56px; }
.app-footer { position: fixed; bottom: 0; left: 0; z-index: 170; display: flex; width: var(--sidebar-width); min-height: var(--app-footer-height); flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 7px 12px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: rgba(255, 255, 255, .985); color: #718096; font-size: 9px; line-height: 1.25; }
.app-footer-product, .app-footer-slogan { display: flex; min-width: 0; align-items: center; gap: 7px; white-space: nowrap; }
.app-footer-product strong { color: var(--cyber-navy); font-weight: 800; }
.app-footer-product i { width: 1px; height: 13px; background: #cbd5e1; }
.app-footer-slogan { width: 100%; justify-content: flex-start; }
.app-footer-slogan span { overflow: hidden; text-overflow: ellipsis; }
.app-footer-slogan i { width: 48px; height: 2px; flex: 0 0 48px; border-radius: 999px; background: var(--security-blue); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-header h1 { margin: 5px 0 0; color: var(--cyber-navy); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -.02em; }
.breadcrumb { display: flex; align-items: center; gap: 8px; overflow: hidden; color: #94a3b8; font-size: 10px; font-weight: 750; letter-spacing: .75px; text-transform: uppercase; white-space: nowrap; }
.breadcrumb span { overflow: hidden; text-overflow: ellipsis; }
.breadcrumb span:last-child { color: #475569; }
.breadcrumb b { color: #aab4c2; font-size: 17px; font-weight: 400; }
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto 64px; }

.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.page-heading h1 { margin: 3px 0 0; color: var(--cyber-navy); font-size: clamp(26px, 3vw, 38px); }
.eyebrow { margin: 0; color: #7b8798; font-size: 10px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.card { grid-column: span 12; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.grid .card + .card { margin-top: 0; }
.card.half { grid-column: span 6; }
.card.third { grid-column: span 4; }
.card h2 { margin: 0 0 14px; color: var(--cyber-navy); font-size: 18px; line-height: 1.35; }
.card h3 { color: var(--cyber-navy); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 0 0 20px; }
.metric { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.metric strong { display: block; overflow: hidden; margin: 0 0 4px; color: var(--cyber-navy); font-size: 27px; line-height: 1.25; letter-spacing: -.02em; text-overflow: ellipsis; }
.metric:nth-child(2) strong { color: var(--security-blue); }
.metric span { color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.dashboard-welcome { display: flex; align-items: center; justify-content: space-between; gap: 26px; margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.dashboard-welcome h2 { margin: 5px 0 4px; color: var(--cyber-navy); font-size: 25px; }
.dashboard-welcome p:last-child { margin: 0; color: var(--muted); }
.dashboard-welcome img { width: min(30%, 300px); }
.branding-preview { display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; }
.branding-preview img { width: min(100%, 360px); max-height: 180px; object-fit: contain; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.branding-preview p, .help-text { color: var(--muted); }
.empty-state { padding: 42px 20px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }

form.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.folder-acl-config { margin-top: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.folder-acl-config .section-title { margin-bottom: 14px; }
.folder-acl-config h3, .folder-acl-management h3 { margin: 0 0 6px; color: var(--cyber-navy); }
.folder-acl-config .help-text { margin: 0; }
.folder-acl-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.folder-acl-row { display: grid; grid-template-columns: minmax(210px, 2fr) minmax(150px, 1fr) minmax(130px, .8fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.folder-acl-row .folder-acl-remove { min-width: 82px; }
.folder-acl-management { margin-top: 18px; }
.folder-acl-management > h3 { margin-top: 24px; }
label { display: flex; flex-direction: column; gap: 6px; color: #475569; font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; background: #fff; color: var(--text); font: inherit; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--security-blue); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
textarea { min-height: 86px; resize: vertical; }
.full { grid-column: 1 / -1; }

.button, button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; background: var(--security-blue); color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover, button:hover { background: var(--security-blue-hover); }
.button:active, button:active { transform: translateY(1px); }
.button.secondary { border-color: #bfdbfe; background: #eff6ff; color: #0f5bc6; }
.button.secondary:hover { background: #dbeafe; }
.button.ghost { border-color: var(--line-strong); background: #fff; color: #475569; }
.button.ghost:hover { background: var(--surface-soft); }
.button.ghost-dark { margin-top: 20px; border-color: var(--line); background: #eef2f7; color: var(--cyber-navy); }
.button.danger, button.danger { background: var(--danger); }
.inline { display: flex; align-items: center; gap: 8px; }
.inline label { min-width: 130px; }
.inline form { display: flex; align-items: center; gap: 7px; }

.notice { margin-bottom: 18px; padding: 11px 14px; border: 1px solid #a7f3d0; border-radius: 8px; background: #ecfdf5; color: var(--success); }
.notice.error { border-color: #fecaca; background: #fef2f2; color: var(--danger); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 14px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: middle; font-size: 12px; }
th { background: #f8fafc; color: #64748b; font-size: 10px; font-weight: 750; letter-spacing: .58px; text-transform: uppercase; white-space: nowrap; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f6f9fd; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 10px; font-weight: 750; }
.badge.inactive { background: #f1f5f9; color: #64748b; }
.empty { padding: 30px; color: var(--muted); text-align: center; }
.progress { height: 7px; overflow: hidden; margin-top: 8px; border-radius: 8px; background: #e2e8f0; }
.progress span { display: block; height: 100%; background: var(--security-blue); }
.checkboxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; max-height: 280px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.checkboxes label { display: flex; flex-direction: row; align-items: center; font-weight: 500; }
.checkboxes input { width: auto; min-height: auto; }
.reading-inline-action { margin: 0; }
.reading-inline-action button, .reading-evidence-link { min-height: 32px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }

/* Gobierno de roles y permisos */
.role-guide { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 18px; background: linear-gradient(115deg, #f8fbff, #eef8fc); }
.role-guide h2 { margin: 4px 0 6px; font-size: 22px; }
.role-guide p:last-child { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.55; }
.role-guide-legend { display: grid; grid-template-columns: auto minmax(145px, 1fr); align-items: center; gap: 8px 10px; min-width: 320px; color: #475569; font-size: 11px; }
.role-metrics { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.role-name-cell { display: grid; min-width: 190px; gap: 3px; }
.role-name-cell strong { color: var(--cyber-navy); font-size: 13px; }
.role-name-cell span, .table-secondary { color: var(--muted); font-size: 11px; }
.access-chips, .role-access-list { display: flex; flex-wrap: wrap; gap: 6px; }
.access-chip { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.access-chip.portal { border-color: #bae6fd; background: #ecfeff; color: #075985; }
.access-chip.repository { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.access-chip.governance { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.access-chip.administration { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.badge.role-system { background: #e0f2fe; color: #075985; }
.badge.role-custom { background: #f3e8ff; color: #7e22ce; }
.role-context { position: sticky; top: calc(var(--topbar-height) + 8px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -8px 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.role-context > a { color: var(--security-blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.role-context nav { display: flex; gap: 6px; }
.role-context nav a { padding: 6px 10px; border-radius: 6px; color: #475569; font-size: 11px; font-weight: 700; text-decoration: none; }
.role-context nav a:hover { background: var(--surface-soft); color: var(--security-blue); }
.role-summary { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 18px; border-color: #bfdbfe; background: linear-gradient(120deg, #fff, #f4f9ff); scroll-margin-top: calc(var(--topbar-height) + 70px); }
.role-summary h2 { margin: 4px 0; font-size: 25px; }
.role-summary p:not(.eyebrow) { margin: 0 0 14px; color: var(--muted); }
.role-summary-stats { display: flex; align-self: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.role-summary-stats div { display: grid; min-width: 105px; padding: 14px 18px; place-content: center; text-align: center; }
.role-summary-stats div + div { border-left: 1px solid var(--line); }
.role-summary-stats strong { color: var(--cyber-navy); font-size: 19px; }
.role-summary-stats span { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; }
.role-protected { border-color: #bae6fd; background: #f0f9ff; }
.role-protected p { margin-bottom: 0; color: #475569; }
.role-permissions, #role-users { scroll-margin-top: calc(var(--topbar-height) + 70px); }
.permission-counter { padding: 6px 10px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 10px; font-weight: 750; white-space: nowrap; }
.permission-groups { display: grid; gap: 14px; }
.permission-group { min-width: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 9px; }
.permission-group legend { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.permission-group legend span { display: grid; gap: 2px; }
.permission-group legend strong { color: var(--cyber-navy); font-size: 13px; }
.permission-group legend small { color: var(--muted); font-size: 10px; font-weight: 500; }
.permission-group legend b { padding: 4px 8px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 10px; }
.permission-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.permission-option { display: flex; min-width: 0; min-height: 90px; flex-direction: row; align-items: flex-start; gap: 10px; padding: 13px; background: #fff; cursor: pointer; }
.permission-option:hover { background: #f8fbff; }
.permission-option.selected { background: #f0f7ff; }
.permission-option input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--security-blue); }
.permission-option > span { display: grid; min-width: 0; gap: 2px; }
.permission-option strong { color: #334155; font-size: 11px; line-height: 1.35; }
.permission-option small { overflow-wrap: anywhere; color: var(--security-blue); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.permission-option em { margin-top: 3px; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; line-height: 1.35; }
.role-save-bar { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 9px; background: rgba(255,255,255,.97); box-shadow: 0 8px 24px rgba(15, 42, 73, .14); }
.role-save-bar span { color: var(--muted); font-size: 11px; }
.role-assignment-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }

.auth-page { min-height: 100vh; padding: 24px; background: linear-gradient(145deg, var(--cyber-navy), #133b62); }
.auth-shell { min-height: calc(100vh - 48px); display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.4); border-radius: 12px; background: #fff; box-shadow: 0 18px 48px rgba(0, 0, 0, .25); }
.auth-brand, .welcome-logo { display: block; margin: 0 auto 24px; }
.auth-brand img, .welcome-logo { display: block; width: min(100%, 320px); height: auto; }
.auth-card h1 { margin: 5px 0 6px; color: var(--cyber-navy); font-size: 27px; }
.tenant-name { margin: 0 0 20px; color: var(--muted); }
.auth-form { display: grid; gap: 14px; }
.auth-form button { width: 100%; margin-top: 3px; }
.auth-help { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.auth-links { margin: 16px 0 0; text-align: center; }
.auth-links a:not(.button) { color: var(--blue); font-weight: 700; text-decoration: none; }
.auth-links a:not(.button):hover { text-decoration: underline; }
.auth-message { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 8px; line-height: 1.45; }
.auth-message-error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.auth-message-success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.microsoft-button { width: 100%; margin-top: 11px; background: #42557e; }
.welcome-card { width: min(620px, 100%); text-align: center; }
.welcome-card .welcome-logo { width: min(100%, 360px); }
.welcome-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.welcome-actions, .dashboard-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.welcome-actions { justify-content: center; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; }
.profile-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.6fr); gap: 18px; }
.profile-layout .card + .card { margin-top: 0; }
.profile-summary { display: flex; align-items: center; gap: 18px; align-self: start; }
.profile-summary h2 { margin: 4px 0 2px; }
.profile-summary p:last-child { margin: 0; color: var(--muted); word-break: break-word; }
.profile-avatar-large { display: grid; width: 76px; height: 76px; flex: 0 0 76px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--security-blue), var(--cyan)); color: #fff; font-size: 23px; font-weight: 800; letter-spacing: .6px; }
.profile-details dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.profile-details dl > div { min-width: 0; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.profile-details dl > div:nth-child(odd) { border-right: 1px solid var(--line); }
.profile-details dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.profile-details dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .55px; text-transform: uppercase; }
.profile-details dd { overflow: hidden; margin: 4px 0 0; color: var(--cyber-navy); font-weight: 650; text-overflow: ellipsis; }

@media (max-width: 1050px) {
    .sidebar { z-index: 300; width: min(86vw, 310px); transform: translateX(-105%); box-shadow: var(--shadow-raised); }
    .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
    .nav-overlay { position: fixed; inset: var(--topbar-height) 0 0; z-index: 250; background: rgba(11, 31, 51, .44); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .nav-toggle:checked ~ .nav-overlay { display: block; opacity: 1; pointer-events: auto; }
    .main-content { margin-left: 0; }
    .topbar { gap: 12px; padding-inline: 16px; }
    .topbar-brand { width: 145px; flex-basis: 145px; }
    .user-menu-name { display: none; }
    .permission-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .role-guide { align-items: flex-start; flex-direction: column; }
    .role-guide-legend { width: 100%; min-width: 0; }
}

@media (max-width: 760px) {
    :root { --topbar-height: 122px; --app-footer-height: 64px; }
    .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "toggle brand actions" "search search search"; align-content: center; gap: 8px 10px; height: var(--topbar-height); padding: 8px 12px; }
    .nav-toggle-button { grid-area: toggle; width: 40px; height: 40px; }
    .topbar-brand { grid-area: brand; width: 150px; height: 42px; justify-self: start; }
    .topbar-brand img { height: 40px; }
    .global-search { grid-area: search; width: 100%; max-width: none; min-width: 0; }
    .global-search input { min-height: 40px; }
    .global-search-submit { min-height: 40px; padding-inline: 13px; }
    .topbar-platform-label { grid-area: search; }
    .topbar-actions { grid-area: actions; justify-self: end; margin-left: 0; }
    .user-menu-chevron { display: none; }
    .page-body { padding: 20px 16px 42px; }
    .page-header { align-items: flex-start; }
    .page-header h1 { font-size: 24px; }
    .card { padding: 17px; }
    .card.half, .card.third { grid-column: span 12; }
    form.form-grid { grid-template-columns: 1fr; }
    .folder-acl-row { grid-template-columns: 1fr; }
    .folder-acl-row .folder-acl-remove { width: 100%; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column-reverse; padding: 18px; }
    .dashboard-welcome img { width: min(70%, 260px); }
    .auth-page { padding: 12px; }
    .auth-shell { min-height: calc(100vh - 24px); }
    .auth-card { padding: 26px 22px; }
    .inline { align-items: stretch; flex-direction: column; }
    .profile-layout { grid-template-columns: 1fr; }
    .role-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .role-context { position: static; align-items: flex-start; flex-direction: column; }
    .role-context nav { width: 100%; overflow-x: auto; }
    .role-summary { align-items: stretch; flex-direction: column; }
    .role-summary-stats { width: 100%; }
    .role-summary-stats div { min-width: 0; flex: 1; padding-inline: 8px; }
    .permission-options { grid-template-columns: 1fr; }
    .role-assignment-form { grid-template-columns: 1fr; }
    .role-save-bar { align-items: stretch; flex-direction: column; }
    .app-footer { gap: 3px; padding: 7px 10px; }
}

@media (max-width: 520px) {
    .global-search input { font-size: 13px; }
    .search-button-full { display: none; }
    .search-button-short { display: inline; }
    .topbar-brand { width: 128px; }
    .topbar-actions { gap: 3px; }
    .topbar-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .user-menu > summary { padding-right: 3px; }
    .user-avatar { width: 35px; height: 35px; flex-basis: 35px; }
    .page-body { padding: 16px 12px 36px; }
    .page-header { margin-bottom: 18px; }
    .metrics { grid-template-columns: 1fr; }
    .welcome-actions, .dashboard-actions { align-items: stretch; flex-direction: column; }
    .welcome-actions .button, .dashboard-actions .button { width: 100%; }
    .auth-page { padding: 8px; }
    .auth-shell { min-height: calc(100vh - 16px); }
    .auth-card { padding: 24px 19px; }
    .auth-card h1 { font-size: 24px; }
    .profile-summary { align-items: flex-start; flex-direction: column; }
    .profile-details dl { grid-template-columns: 1fr; }
    .profile-details dl > div, .profile-details dl > div:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--line); }
    .profile-details dl > div:last-child { border-bottom: 0; }
    .app-footer { padding-inline: 10px; }
    .app-footer-product { flex-wrap: wrap; gap: 5px 8px; white-space: normal; }
    .app-footer-product i { display: none; }
    .app-footer-slogan i { width: 28px; flex-basis: 28px; }
}
/* Procesos y Formularios */
.process-tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:1rem}.process-tabs a{padding:.7rem 1rem;border:1px solid #d8e2ec;border-radius:.65rem;background:#f8fafc;color:#23405f;text-decoration:none;font-weight:700}.process-tabs a:hover{border-color:#0b6b91;color:#075985}.process-summary .metric strong{font-size:1rem;line-height:1.35}.process-task-list{display:grid;gap:1rem}.process-task{border-left:4px solid #0b6b91}.process-task .button{display:inline-flex;margin-top:1rem}.process-decision textarea{min-height:110px}.actions{display:flex;gap:.75rem;justify-content:flex-end;align-items:center;flex-wrap:wrap}.muted{color:#64748b;font-size:.9rem}.business-processes-page .card{margin-bottom:1rem}.business-processes-page details{position:relative}.business-processes-page details>summary{cursor:pointer;list-style:none}.business-processes-page details[open]>form{min-width:min(46rem,80vw);margin-top:.75rem;padding:1rem;border:1px solid #d8e2ec;border-radius:.8rem;background:#fff;box-shadow:0 12px 34px rgba(15,35,55,.12);position:relative;z-index:4}.process-filters{padding:1rem 0;border-top:1px solid #e5edf5;margin-top:1rem}.process-pagination{padding-top:1rem;border-top:1px solid #e5edf5;margin-top:1rem}.process-dashboard .metric{min-height:7rem}.process-dashboard .metric strong{font-size:1.85rem}.business-processes-page .badge{white-space:nowrap}

/* Administración de plataforma: carga y eliminación segura de datos de ejemplo. */
.demo-data-card{padding:0!important;overflow:hidden}.demo-data-heading{display:flex;align-items:center;gap:14px;padding:20px 22px;border-bottom:1px solid var(--line);background:#f8fafc}.demo-data-heading h2{margin:0 0 4px}.demo-data-heading p{margin:0;color:var(--muted)}.demo-data-icon{display:grid;width:42px;height:42px;flex:0 0 42px;place-items:center;background:#e8f3ff;color:var(--security-blue)}.demo-data-icon svg{width:24px;height:24px;stroke:currentColor;stroke-width:1.6}.demo-data-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}.demo-data-form{display:flex;min-width:0;align-items:flex-start;flex-direction:column;justify-content:space-between;gap:16px;margin:0;padding:22px}.demo-data-form+ .demo-data-form{border-left:1px solid var(--line)}.demo-data-form label{width:100%}.demo-data-form select{width:100%}.demo-data-form p{max-width:520px;margin:0;color:#53657a;line-height:1.55}.demo-data-form button{width:auto;max-width:100%;white-space:normal}.demo-data-delete{background:#fffafa}.demo-data-delete .danger{background:#bd271d}.demo-data-delete .danger:hover{background:#9f2018}
@media(max-width:760px){.demo-data-actions{grid-template-columns:1fr}.demo-data-form+ .demo-data-form{border-top:1px solid var(--line);border-left:0}.demo-data-form button{width:100%}}

/* Árbol de plantillas de correo por tipo de notificación. */
.email-template-layout{display:flex!important;flex-flow:row nowrap;align-items:stretch;width:100%;min-height:calc(100vh - var(--topbar-height) - 76px);gap:18px;overflow:visible}
.email-template-list{position:sticky;top:var(--topbar-height);width:320px;max-width:320px;max-height:calc(100vh - var(--topbar-height));flex:0 0 320px;align-self:flex-start;padding:0!important;overflow:auto}
.email-template-editor{width:0;min-width:0;flex:1 1 0;align-self:flex-start}
.email-template-tree-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 19px 15px;border-bottom:1px solid var(--line);background:#f8fafc}
.email-template-tree-heading h2{margin:0;color:var(--cyber-navy);font-size:17px}.email-template-tree-heading p{margin:4px 0 0;color:#718096;font-size:12px}.email-template-tree-heading>span{display:grid;width:36px;height:36px;flex:0 0 36px;place-items:center;background:#e8f3ff;color:var(--security-blue)}.email-template-tree-heading svg{width:19px;height:19px}
.email-template-tree{display:block;padding:10px 12px 14px}.email-template-tree-group{border-bottom:1px solid #edf1f5}.email-template-tree-group:last-child{border-bottom:0}
.email-template-tree-group>summary{display:flex;min-height:38px;align-items:center;gap:8px;padding:7px 6px;color:#20354b;cursor:pointer;list-style:none;font-size:12px}.email-template-tree-group>summary::-webkit-details-marker{display:none}.email-template-tree-group>summary:hover{background:#f1f7fb;color:var(--security-blue)}
.email-template-tree-toggle{width:0;height:0;flex:0 0 auto;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid #64748b;transition:transform .16s ease}.email-template-tree-group[open] .email-template-tree-toggle{transform:rotate(90deg)}
.email-template-group-icon,.email-template-item-icon{display:grid;width:18px;height:18px;flex:0 0 18px;place-items:center;color:var(--security-blue)}.email-template-group-icon svg,.email-template-item-icon svg{width:16px;height:16px}.email-template-tree-count{margin-left:auto;color:#8b9ab0;font-size:10px;font-variant-numeric:tabular-nums}
.email-template-tree-group ul{display:grid;gap:2px;margin:2px 0 8px 16px;padding:0 0 0 11px;border-left:1px solid #dbe5f0;list-style:none}.email-template-tree-item{display:grid;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:42px;padding:7px 8px;color:#334155;text-decoration:none}.email-template-tree-item:hover,.email-template-tree-item:focus-visible{background:#f1f7fb;color:var(--security-blue)}.email-template-tree-item.selected{background:#e2f2fa;color:var(--cyber-navy);box-shadow:inset 3px 0 0 var(--cyan)}
.email-template-tree-copy{display:grid;gap:2px;min-width:0}.email-template-tree-copy strong{overflow:hidden;font-size:12px;font-weight:680;text-overflow:ellipsis;white-space:nowrap}.email-template-tree-copy small{overflow:hidden;color:#7b8798;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.email-template-state{padding:3px 6px;background:#eef2f7;color:#64748b;font-size:9px;font-weight:750;white-space:nowrap}.email-template-state.custom{background:#e8f7f2;color:#08775f}
.email-template-help{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:24px;padding-top:20px;border-top:1px solid #d9e2ef}.email-template-help code{white-space:nowrap}.email-template-help pre{white-space:pre-wrap;padding:16px;background:#f6f8fb;border:1px solid #d9e2ef}
@media(max-width:980px){.email-template-list{width:240px;max-width:240px;flex-basis:240px}.email-template-tree-copy small{display:none}.email-template-state{display:none}}
@media(max-width:760px){.email-template-layout{gap:10px}.email-template-list{width:190px;max-width:190px;flex-basis:190px}.email-template-tree-heading{padding-inline:12px}.email-template-tree-heading>span{display:none}.email-template-tree{padding-inline:8px}.email-template-editor{padding-inline:12px}.email-template-help{grid-template-columns:1fr}}
.request-filter-disclosure{margin-bottom:1rem;border:1px solid var(--line);background:#fff}.request-filter-disclosure>summary{display:flex;min-height:48px;align-items:center;justify-content:space-between;padding:11px 16px;color:var(--cyber-navy);cursor:pointer;font-size:14px;font-weight:750;list-style:none}.request-filter-disclosure>summary::-webkit-details-marker{display:none}.request-filter-disclosure>summary::after{content:"+";color:var(--security-blue);font-size:20px;font-weight:500}.request-filter-disclosure[open]>summary::after{content:"−"}.request-filter-disclosure .standard-filter-card{margin:0;border-width:1px 0 0;box-shadow:none}
