@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600 900;
    font-display: swap;
}

:root {
    --primary: #005b84;
    --primary-dark: #062b49;
    --primary-light: #0878a7;
    --sidebar: #00577c;
    --accent: #d71920;
    --bg: #f5f8fb;
    --surface: #fff;
    --surface-muted: #f8fbfd;
    --soft-blue: #eef6fa;
    --border: #d7e3ec;
    --border-strong: #bfd2de;
    --text: #082f49;
    --text-muted: #64748b;
    --ok: #166534;
    --ok-bg: #ecfdf3;
    --warn: #854d0e;
    --warn-bg: #fef9c3;
    --err: #991b1b;
    --err-bg: #fef2f2;
    --info: #075985;
    --info-bg: #e0f2fe;
    --sidebar-w: 252px;
    --topbar-h: 66px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 4px 16px rgb(8 47 73 / .05);
    --shadow: 0 10px 28px rgb(8 47 73 / .07);
    --shadow-lg: 0 24px 70px rgb(8 47 73 / .18);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
html { background: var(--bg); }
body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }

.topbar {
    position: fixed;
    inset: 0 0 auto var(--sidebar-w);
    z-index: 40;
    display: flex;
    min-width: 0;
    height: var(--topbar-h);
    align-items: center;
    gap: 14px;
    padding: 8px 24px;
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / .96);
    box-shadow: 0 1px 0 rgb(8 47 73 / .03);
    color: var(--text);
    backdrop-filter: blur(10px);
}
.topbar::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    content: "";
    background: linear-gradient(90deg, var(--accent) 0 14%, var(--primary) 14% 58%, var(--primary-dark));
}
.topbar .brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}
.brand-logo { width: 132px; height: 46px; object-fit: contain; object-position: left center; }
.brand-copy { min-width: 0; }
.brand-title { display: block; font-size: 13px; font-weight: 800; line-height: 1.25; text-transform: uppercase; }
.brand-subtitle { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .user-chip { display: flex; min-width: 0; align-items: center; gap: 10px; }
.user-copy { min-width: 0; text-align: right; }
.topbar .user-chip a.user-name { display: block; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: block; overflow: hidden; max-width: 240px; color: var(--text-muted); font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--primary-dark); color: #fff; font-size: 11px; font-weight: 800; box-shadow: var(--shadow-sm); }
.logout-button { color: var(--text-muted) !important; }
.logout-button:hover { color: var(--accent) !important; text-decoration: none !important; }
.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--primary-dark);
    cursor: pointer;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: var(--sidebar-w);
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #005b84 0%, #005174 56%, #063a5c 100%);
    color: #fff;
}
.sidebar-brand { min-height: 126px; padding: 20px 18px 16px; border-bottom: 1px solid rgb(255 255 255 / .13); }
.sidebar-brand-mark { padding-left: 13px; border-left: 4px solid var(--accent); }
.sidebar-brand-kicker { margin: 0; color: rgb(255 255 255 / .68); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-brand-title { margin: 7px 0 0; color: #fff; font-size: 14px; font-weight: 800; line-height: 1.3; }
.sidebar-brand-subtitle { margin: 2px 0 0; color: rgb(255 255 255 / .78); font-size: 11px; font-weight: 600; }
.sidebar-context { margin: 14px 0 0; color: rgb(255 255 255 / .88); font-size: 11px; font-weight: 600; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 12px 18px; scrollbar-color: rgb(255 255 255 / .22) transparent; scrollbar-width: thin; }
.sidebar .section { padding: 14px 8px 5px; color: rgb(255 255 255 / .55); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.sidebar a.item {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: rgb(255 255 255 / .84);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.sidebar a.item:hover { background: rgb(255 255 255 / .11); color: #fff; }
.sidebar a.item.active { background: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 10px 22px rgb(0 0 0 / .16); }
.nav-icon { display: inline-flex; width: 19px; height: 19px; flex: 0 0 19px; align-items: center; justify-content: center; }
.nav-icon svg { width: 17px; height: 17px; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgb(255 255 255 / .13); }
.sidebar-footer a.item, .sidebar-footer .btn-link { width: 100%; color: rgb(255 255 255 / .8); text-align: left; }
.sidebar-overlay { display: none; }

.content {
    width: auto;
    max-width: 1480px;
    min-width: 0;
    margin-left: var(--sidebar-w);
    padding: calc(var(--topbar-h) + 25px) 28px 40px;
}
body.guest .content { max-width: none; margin-left: 0; padding: 0; }
.password-required .topbar { left: 0; }
.password-required .content { max-width: 760px; margin: 0 auto; padding: calc(var(--topbar-h) + 32px) 20px 40px; }
body.guest > .content > .alert { position: fixed; top: 16px; right: 16px; left: 16px; z-index: 200; max-width: 620px; margin: 0 auto; }
.content > .error-page { min-height: calc(100dvh - var(--topbar-h) - 25px); margin: -25px -28px -40px; }
body.guest .content > .error-page { min-height: 100dvh; margin: 0; }

h1, h2, h3 { color: var(--primary-dark); line-height: 1.25; }
h1 { margin: 0 0 18px; font-size: clamp(22px, 2vw, 29px); font-weight: 800; letter-spacing: -.025em; }
h2 { margin: 0 0 13px; font-size: 16px; font-weight: 800; }
h3 { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
p { overflow-wrap: anywhere; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-header h1 { margin: 0; }
.page-eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.card {
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.stat-card { position: relative; min-height: 110px; padding-left: 22px; }
.stat-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--primary); }

.btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary-dark); color: #fff; box-shadow: 0 8px 18px rgb(6 43 73 / .16); }
.btn-primary:hover { background: var(--primary); color: #fff; }
.btn-secondary { border-color: var(--border); background: #fff; color: var(--primary-dark); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #7f1d1d; color: #fff; }
.btn-success { background: #15803d; color: #fff; }
.btn-sm { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: 11px; }
.btn-link { padding: 3px; border: 0; background: transparent; color: var(--primary); font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

label { display: block; margin: 0 0 6px; color: var(--primary-dark); font-size: 12px; font-weight: 800; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 92px; resize: vertical; }
textarea[style] {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--surface-muted) !important;
    color: var(--text) !important;
    font-family: "Montserrat", Arial, Helvetica, sans-serif !important;
    font-size: 13px !important;
}
select { cursor: pointer; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgb(0 91 132 / .13); }
input:disabled, select:disabled, textarea:disabled, input[readonly], textarea[readonly] { background: #eef2f5; color: var(--text-muted); cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 2px 16px; }
.form-section { margin-bottom: 18px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-muted); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding-top: 8px; }

.alert { position: relative; margin: 0 0 16px; padding: 13px 16px 13px 18px; border: 1px solid transparent; border-left-width: 4px; border-radius: 10px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm); }
.alert-error { border-color: #fecaca; border-left-color: var(--err); background: var(--err-bg); color: var(--err); }
.alert-success { border-color: #bbf7d0; border-left-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.alert-warning { border-color: #fde68a; border-left-color: #ca8a04; background: var(--warn-bg); color: var(--warn); }
.alert-info { border-color: #bae6fd; border-left-color: var(--info); background: var(--info-bg); color: var(--info); }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
.table-wrap::after { display: none; }
table.tabla { width: 100%; border-collapse: collapse; color: var(--text); font-size: 12px; text-align: left; }
table.tabla th { padding: 11px 12px; border: 0; background: var(--soft-blue); color: #52677a; font-size: 10px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
table.tabla td { padding: 12px; border-top: 1px solid var(--border); border-bottom: 0; vertical-align: top; overflow-wrap: anywhere; }
table.tabla tbody tr { transition: background-color .14s ease; }
table.tabla tbody tr:hover { background: var(--surface-muted); }
table.tabla strong { color: var(--primary-dark); }
.table-wrap + .paginacion, .table-wrap + nav { margin-top: 14px; }
.actions { white-space: nowrap; }
.actions form { display: inline-flex; }

.badge { display: inline-flex; min-height: 24px; align-items: center; justify-content: center; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1.2; vertical-align: middle; }
.badge-ok { border-color: #bbf7d0; background: var(--ok-bg); color: var(--ok); }
.badge-warn { border-color: #fde68a; background: var(--warn-bg); color: var(--warn); }
.badge-err { border-color: #fecaca; background: var(--err-bg); color: var(--err); }
.badge-neutral { border-color: var(--border); background: var(--soft-blue); color: #334155; }
.nivel-rojo { border-color: #fecaca; background: #fee2e2; color: #991b1b; }
.nivel-naranja { border-color: #fed7aa; background: #ffedd5; color: #9a3412; }
.nivel-amarillo { border-color: #fde68a; background: #fef9c3; color: #854d0e; }
.nivel-verde { border-color: #bbf7d0; background: #dcfce7; color: #166534; }
.nivel-azul { border-color: #bfdbfe; background: #dbeafe; color: #1e40af; }

.muted { color: var(--text-muted); font-size: 12px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.module-card { position: relative; display: flex; min-height: 150px; flex-direction: column; overflow: hidden; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.module-card::before { position: absolute; inset: 0 0 auto; height: 3px; content: ""; background: linear-gradient(90deg, var(--accent) 0 28%, var(--primary) 28% 58%, #e5eef4 58%); }
.module-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); color: var(--text); transform: translateY(-2px); }
.module-card .icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: var(--soft-blue); color: var(--primary); font-size: 20px; }
.module-card .icon svg { width: 21px; height: 21px; }
.module-card .name { margin: 14px 0 5px; color: var(--primary-dark); font-size: 14px; font-weight: 800; }
.module-card .desc { color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.module-card .open-label { margin-top: auto; padding-top: 14px; color: var(--primary); font-size: 11px; font-weight: 800; text-align: right; }

.dashboard-shell { display: grid; gap: 18px; }
.dashboard-hero { position: relative; min-height: 210px; overflow: hidden; border: 1px solid #c9dae5; border-radius: 14px; background: var(--primary-dark); box-shadow: 0 18px 46px rgb(8 47 73 / .12); }
.dashboard-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dashboard-hero-overlay { position: absolute; inset: 0; background: linear-gradient(105deg, rgb(6 43 73 / .96) 0%, rgb(0 91 132 / .8) 54%, rgb(6 43 73 / .32)); }
.dashboard-hero-content { position: relative; z-index: 1; display: flex; min-height: 210px; flex-direction: column; justify-content: flex-end; padding: 26px 30px; color: #fff; }
.dashboard-hero-content::before { position: absolute; inset: 0 auto 0 0; width: 5px; content: ""; background: var(--accent); }
.dashboard-hero-kicker { margin: 0 0 8px; color: rgb(255 255 255 / .72); font-size: 10px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.dashboard-hero h1 { max-width: 760px; margin: 0; color: #fff; font-size: clamp(26px, 3.5vw, 42px); }
.dashboard-hero p { max-width: 760px; margin: 8px 0 0; color: rgb(255 255 255 / .87); font-size: 12px; font-weight: 600; }
.dashboard-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.dashboard-meta span { padding: 6px 10px; border: 1px solid rgb(255 255 255 / .2); border-radius: 8px; background: rgb(255 255 255 / .12); color: #fff; font-size: 10px; font-weight: 700; backdrop-filter: blur(5px); }

.paginacion { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.paginacion a, .paginacion span { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font-size: 11px; font-weight: 700; text-decoration: none; }
.paginacion a:hover { border-color: var(--primary); color: var(--primary); }
.paginacion span.current { border-color: var(--primary); background: var(--primary); color: #fff; }
.paginacion span.disabled { color: #a8b4c0; }

.login-page { position: relative; display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 3fr) minmax(420px, 2fr); overflow: hidden; background: var(--bg); }
.login-visual { position: relative; display: flex; min-height: 100dvh; flex-direction: column; overflow: hidden; padding: 52px clamp(28px, 5vw, 76px) 42px; background: var(--primary-dark); }
.login-visual-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: subtle-zoom 18s ease-in-out infinite alternate; }
.login-visual-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(3 27 52 / .96), rgb(3 27 52 / .86) 45%, rgb(0 67 100 / .58)); }
.login-visual-content { position: relative; z-index: 1; display: flex; height: 100%; flex: 1; flex-direction: column; color: #fff; }
.login-white-logo { width: min(260px, 65%); }
.login-message { max-width: 680px; margin: auto 0; }
.login-message-kicker { display: flex; align-items: center; gap: 12px; color: rgb(255 255 255 / .72); font-size: 11px; font-weight: 800; letter-spacing: .21em; text-transform: uppercase; }
.login-message-kicker::before { width: 42px; height: 4px; border-radius: 99px; background: var(--accent); content: ""; }
.login-message h1 { margin: 18px 0 0; color: #fff; font-size: clamp(34px, 4vw, 54px); line-height: 1.06; }
.login-message p { max-width: 620px; margin: 20px 0 0; color: rgb(255 255 255 / .88); font-size: 16px; font-weight: 600; }
.login-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-top: 28px; color: rgb(255 255 255 / .84); font-size: 10px; font-weight: 700; }
.login-form-panel { position: relative; display: flex; min-height: 100dvh; align-items: center; justify-content: center; padding: 34px; overflow: hidden; }
.login-form-panel::before { position: absolute; inset: 0; background: linear-gradient(rgb(245 248 251 / .9), rgb(245 248 251 / .9)), url("../brand/photos/campus-aereo-unl.jpg") center / cover; content: ""; }
.login-card { position: relative; width: 100%; max-width: 500px; overflow: hidden; padding: 0; border: 1px solid rgb(215 227 236 / .88); border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); }
.login-card-accent { display: flex; height: 6px; }
.login-card-accent span:first-child { width: 34%; background: var(--accent); }
.login-card-accent span:last-child { flex: 1; background: var(--primary); }
.login-card-body { padding: 30px 36px 34px; }
.login-logo { width: 150px; margin: 0 auto; }
.login-heading { margin: 22px 0 0; text-align: center; }
.login-heading h1 { margin: 0; font-size: 30px; }
.login-heading p { margin: 9px 0 0; color: var(--text-muted); font-size: 12px; }
.login-form { margin-top: 24px; }
.login-form input:not([type=checkbox]) { min-height: 52px; }
.login-submit { width: 100%; min-height: 52px; margin-top: 8px; font-size: 14px; }

.error-page { display: flex; min-height: 100dvh; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(rgb(245 248 251 / .92), rgb(245 248 251 / .92)), url("../brand/photos/campus-aereo-unl.jpg") center / cover; }
.error-card { width: 100%; max-width: 620px; padding: 42px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); text-align: center; }
.error-logo { width: 170px; margin: 0 auto 26px; }
.error-code { margin: 0; color: var(--primary); font-size: clamp(60px, 12vw, 96px); font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.error-title { margin: 12px 0 0; font-size: 23px; }
.error-copy { margin: 12px auto 24px; color: var(--text-muted); }

.ubu-modal-overlay { position: fixed; inset: 0 0 0 var(--sidebar-w); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; background: rgb(15 23 42 / .46); backdrop-filter: blur(2px); }
.ubu-modal { display: flex; width: 100%; max-height: calc(100dvh - 48px); flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-lg); }
.ubu-modal-sm { max-width: 420px; } .ubu-modal-md { max-width: 680px; } .ubu-modal-lg { max-width: 980px; } .ubu-modal-xl { max-width: 1280px; }
.ubu-modal-header, .ubu-modal-footer { flex: 0 0 auto; padding: 18px 26px; background: #fff; }
.ubu-modal-header { border-bottom: 1px solid var(--border); }
.ubu-modal-body { min-height: 0; flex: 1; overflow: auto; padding: 24px 26px; }
.ubu-modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); }

:focus-visible { outline: 3px solid rgb(0 91 132 / .25); outline-offset: 2px; }

@media (max-width: 1023px) {
    .menu-toggle { display: inline-flex; }
    .topbar { left: 0; padding: 8px 16px; }
    .sidebar { width: min(84vw, 268px); transform: translateX(-102%); box-shadow: var(--shadow-lg); transition: transform .22s ease; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 45; display: block; border: 0; background: rgb(6 43 73 / .48); opacity: 0; pointer-events: none; backdrop-filter: blur(1px); transition: opacity .2s ease; }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .content { width: auto; max-width: none; margin-left: 0; padding: calc(var(--topbar-h) + 22px) 18px 32px; }
    .content > .error-page { min-height: calc(100dvh - var(--topbar-h) - 22px); margin: -22px -18px -32px; }
    body.guest .content > .error-page { min-height: 100dvh; margin: 0; }
    .ubu-modal-overlay { left: 0; padding: 20px; }
}

@media (max-width: 767px) {
    .brand-logo { width: 105px; height: 39px; }
    .brand-copy, .user-copy, .logout-button { display: none; }
    .topbar { gap: 9px; padding-right: 12px; padding-left: 12px; }
    .topbar .user-chip { gap: 0; }
    .content { padding-right: 13px; padding-left: 13px; }
    .page-header { flex-direction: column; }
    .page-actions { width: 100%; justify-content: stretch; }
    .page-actions .btn { flex: 1 1 auto; }
    .card { padding: 16px; }
    .card[style*="max-width"] { max-width: 100% !important; }
    form[style*="display:flex"], form[style*="display: flex"] { align-items: stretch !important; }
    form[style*="display:flex"] > div, form[style*="display: flex"] > div { min-width: 0 !important; }
    form[style*="display:flex"] .btn, form[style*="display: flex"] .btn { min-height: 44px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .actions { white-space: normal; }
    .table-wrap { position: relative; margin-right: 0; margin-left: 0; }
    table.tabla { font-size: 11px; }
    table.tabla th, table.tabla td { padding: 10px; }
    table.tabla td[style*="width:200px"], table.tabla td[style*="width: 200px"], table.tabla td[style*="width:220px"], table.tabla td[style*="width: 220px"] { width: min(38vw, 145px) !important; min-width: 112px; }
    table.tabla .btn { min-height: 34px; padding: 7px 10px; }
    input[style*="width:90px"], input[style*="width: 90px"] { width: 78px !important; min-width: 78px; }
    .grid-cards { grid-template-columns: minmax(0, 1fr); }
    .dashboard-hero, .dashboard-hero-content { min-height: 190px; }
    .dashboard-hero-content { padding: 22px 20px; }
    .login-page { display: block; min-height: 100dvh; }
    .login-visual { min-height: 230px; padding: 24px 22px; }
    .login-white-logo { width: 170px; }
    .login-message { margin: auto 0 0; }
    .login-message h1 { margin-top: 12px; font-size: 29px; }
    .login-message p { margin-top: 10px; font-size: 12px; }
    .login-values { display: none; }
    .login-form-panel { min-height: auto; padding: 0 14px 28px; margin-top: -18px; overflow: visible; }
    .login-card-body { padding: 24px 20px 26px; }
    .login-logo { width: 126px; }
    .login-heading { margin-top: 16px; }
    .login-heading h1 { font-size: 25px; }
    .error-card { padding: 30px 20px; }
}

@media (max-width: 640px) {
    .ubu-modal-overlay { padding: 0; align-items: stretch; }
    .ubu-modal { height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .ubu-modal-header, .ubu-modal-body, .ubu-modal-footer { padding-right: 16px; padding-left: 16px; }
    .ubu-modal-footer { flex-direction: column-reverse; }
    .ubu-modal-footer .btn { width: 100%; }
}

@keyframes subtle-zoom { from { transform: scale(1); } to { transform: scale(1.045); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
