/* =====================================================================
   Deglar Web 2 — Look & Feel Deglar (spec relevado de LoginDeglar.aspx
   y DeglarMainContext.aspx). Paleta: azul corporativo #003366.
   ===================================================================== */
:root {
    --dgl-primary: #003366;
    --dgl-primary-dark: #002244;
    --dgl-brand-bg: #F4F6F8;
    --dgl-brand-border: #dce1e6;
    --dgl-text: #333;
    --dgl-input-border: #ced4da;
    --dgl-error-bg: #fdecea;
    --dgl-error-border: #f5c2c0;
    --dgl-error-text: #b00020;
    --dgl-topbar-border: #e0e0e0;
    --dgl-topbar-brand: #2061B7;
    --dgl-muted-ui: #5f6368;
    --dgl-muted-section: #80868b;
    --dgl-hover: #f1f3f4;
    --dgl-active-bg: #e8f0fe;
    --dgl-active-fg: #1a73e8;
    /* Neutros (Design System 1.1). Bordes: neutro, azulado suave y azulado marcado.
       Texto secundario: neutro, pizarra y pizarra oscuro. */
    --dgl-bg: #f7f9fc;
    --dgl-surface: #ffffff;
    --dgl-border: #e0e0e0;
    --dgl-border-cool: #dce1e6;
    --dgl-border-strong: #d5dbe3;
    --dgl-muted: #5f6368;
    --dgl-text-muted: #5f6368;
    --dgl-text-secondary: #5f6368;
    --dgl-text-slate: #64748b;
    --dgl-text-slate-strong: #526173;
    /* Interactivo (= accent del theme DevExpress, --dxds-primary-90) y sus derivados. */
    --dgl-interactive: #1a73e8;
    /* El token del portal (dgl-portal-interactive) NO se define aca a proposito. Lo usan las reglas
       que nacieron apuntando al interactivo sin que estuviera definido (vinculos de grilla, solapa
       activa, foco de campos, hover de contorno...). Sin definicion el navegador descarta esas
       declaraciones y la aplicacion corporativa se ve como siempre. Solo lo define la hoja de tema
       de un portal con marca (DGL-V8-MARCA-POR-SITIO 9.5). */
    --dgl-interactive-accent: #dce8fb;
    --dgl-interactive-tint: rgba(26,115,232,.10);
    --dgl-focus-bg: #edf4fd;
    --dgl-active-border: #c5d7ec;
    --dgl-icon-accent: #dce8fb;
    --dgl-icon-well: #eef2f7;
    --dgl-icon-actions: #7c4dbe;
    --dgl-icon-actions-accent: #e9defa;
    --dgl-avatar-from: #667eea;
    --dgl-avatar-to: #764ba2;
    --dgl-reconnect: #6b9ed2;
    --dgl-reconnect-hover: #3b6ea2;
    --dgl-reconnect-ring: #0087ff;
    /* Info semantico: mismo valor que el interactivo, pero NO es de marca (el tema no lo toca). */
    --dgl-info-bg: #e8f0fe;
    --dgl-info-accent: #1a73e8;
    /* Acceso (login, 2FA, recupero, cambio de contrasena, passkey). */
    --dgl-auth-primary: var(--dgl-primary);
    --dgl-auth-primary-dark: var(--dgl-primary-dark);
    --dgl-auth-brand-bg: var(--dgl-brand-bg);
    --dgl-auth-focus-ring: rgba(0, 51, 102, 0.15);
    --dgl-auth-focus-border: var(--dgl-auth-primary);
    /* Cinta de ambiente (marca por sitio §4.7): alto que suma al encabezado. Sin cinta vale 0. */
    --dgl-shell-ribbon: 0px;
    --dgl-shell-top: calc(64px + var(--dgl-shell-ribbon));
    --dgl-auth-action: #2f6fed;
    --dgl-auth-action-fg: #1d4fb8;
    --dgl-auth-action-bg: #eef3fe;
    --dgl-auth-action-bg-hover: #e2eafd;
    /* Barra superior y sus islas (campanas, selector de menu). Valores para barra oscura. */
    --dgl-topbar-bg: var(--dgl-primary);
    --dgl-topbar-rule: var(--dgl-primary-dark);
    --dgl-topbar-rule-w: 1px;
    --dgl-topbar-title: #fff;
    --dgl-topbar-fg: #dbe4f0;
    --dgl-topbar-fg-strong: #fff;
    --dgl-topbar-fg-soft: #e8eef5;
    --dgl-topbar-fg-muted: #c3cfde;
    --dgl-topbar-fg-dim: rgba(219, 228, 240, .62);
    --dgl-topbar-fg-dim-hover: rgba(235,241,248,.82);
    --dgl-topbar-focus: rgba(219,228,240,.72);
    --dgl-topbar-hover-faint: rgba(255,255,255,.07);
    --dgl-topbar-hover: rgba(255,255,255,.14);
    --dgl-topbar-hover-strong: rgba(255,255,255,.22);
    --dgl-topbar-user-hover: rgba(255,255,255,.12);
    --dgl-topbar-line: rgba(255,255,255,.22);
    --dgl-topbar-line-strong: rgba(255,255,255,.4);
    --dgl-topbar-line-kbd: rgba(255,255,255,.35);
    --dgl-topbar-line-chip: rgba(255,255,255,.28);
    --dgl-topbar-chip-bg: rgba(255,255,255,.10);
    --dgl-topbar-chip-hover: rgba(255,255,255,.20);
    --dgl-topbar-chip-hover-soft: rgba(255,255,255,.18);
    --dgl-topbar-open-bg: #fff;
    --dgl-topbar-open-fg: var(--dgl-primary);
}

/* ============ AUTH: split 45/55 (login, 2FA, recupero, cambio) ============ */
.deglar-auth-split {
    display: flex; min-height: 100vh; background: #fff;
    font-family: 'Roboto', sans-serif; color: var(--dgl-text);
}
.deglar-auth-brand {
    flex: 0 0 45%;
    background: var(--dgl-auth-brand-bg);
    border-right: 1px solid var(--dgl-brand-border);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem;
}
.deglar-auth-brand-logo { width: 60%; min-width: 250px; max-width: 450px; }
.deglar-auth-brand-title {
    margin-top: 1.5rem;
    font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1.4rem;
    letter-spacing: 1px; color: var(--dgl-auth-primary); text-align: center;
}
.deglar-auth-brand-bar { width: 40px; height: 3px; background: var(--dgl-auth-primary); border-radius: 2px; margin-top: 12px; }
.deglar-auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.deglar-auth-footer { margin-top: 1.5rem; text-align: center; font-size: 0.75rem; line-height: 1.5; }
.deglar-auth-footer a { color: #999; text-decoration: none; font-weight: 600; }
.deglar-auth-footer a:hover { text-decoration: underline; }
.deglar-auth-version { color: #ccc; }

@media (max-width: 900px) {
    .deglar-auth-split { flex-direction: column; min-height: 100svh; }
    .deglar-auth-brand {
        flex: 0 0 auto; background: transparent; border: 0;
        padding: clamp(24px, 6svh, 48px) 24px 12px;
    }
    .deglar-auth-brand-logo {
        width: 168px; min-width: 0; max-width: 100%; max-height: 72px; object-fit: contain;
    }
    .deglar-auth-brand-title {
        max-width: 28ch; margin-top: 16px;
        font-size: 20px; line-height: 1.35; letter-spacing: 0; overflow-wrap: anywhere;
    }
    .deglar-auth-brand-bar { display: none; }
    .deglar-auth-main { justify-content: flex-start; padding: 12px 24px 28px; }
}

/* ---- acceso con tema de marca (DGL-V8-MARCA-POR-SITIO §4.1 a §4.3). Sólo clases nuevas: sin tema no aplican. ---- */
.deglar-auth-brand-tagline {
    margin-top: .5rem; max-width: 34ch; text-align: center;
    font-family: 'Roboto', sans-serif; font-size: .95rem; line-height: 1.4; color: var(--dgl-text-secondary);
}
.deglar-auth-themed .deglar-auth-brand { border-right: 0; }
.deglar-auth-panel-color .deglar-auth-brand {
    background: linear-gradient(160deg, var(--dgl-auth-primary) 0%, var(--dgl-auth-primary-dark) 100%);
}
.deglar-auth-panel-photo .deglar-auth-brand {
    position: relative; justify-content: flex-end; align-items: flex-start;
    background-color: var(--dgl-auth-primary-dark); background-size: cover; background-repeat: no-repeat;
}
.deglar-auth-panel-photo .deglar-auth-brand::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.62) 100%);
}
.deglar-auth-panel-photo .deglar-auth-brand > * { position: relative; }
.deglar-auth-themed .deglar-auth-brand .deglar-auth-brand-title { margin-top: 0; color: #fff; font-size: 1.7rem; }
/* Tipografía de marca (§4.10): sólo los títulos de marca. Sin tipografía en el tema, queda la de Deglar. */
.deglar-auth-themed .deglar-auth-brand-title, .deglar-auth-themed .deglar-auth-head-title {
    font-family: var(--dgl-brand-font, 'Montserrat', sans-serif); font-weight: var(--dgl-brand-font-weight, 600);
}
.deglar-auth-themed .deglar-auth-brand .deglar-auth-brand-tagline { color: rgba(255,255,255,.88); }
.deglar-auth-themed .deglar-auth-brand .deglar-auth-brand-bar { background: rgba(255,255,255,.75); }
.deglar-auth-panel-photo .deglar-auth-brand .deglar-auth-brand-title,
.deglar-auth-panel-photo .deglar-auth-brand .deglar-auth-brand-tagline { text-align: left; }
.deglar-auth-head { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 400px; margin-bottom: 1.75rem; }
.deglar-auth-head-logo { max-width: 240px; max-height: 84px; object-fit: contain; }
.deglar-auth-head-title, .deglar-auth-head-tagline { display: none; }
.deglar-auth-head-title {
    margin-top: 1rem; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1.25rem;
    color: var(--dgl-auth-primary); text-align: center;
}
.deglar-auth-head-tagline { margin-top: .35rem; font-size: .9rem; color: var(--dgl-text-secondary); text-align: center; max-width: 32ch; overflow-wrap: anywhere; }
.deglar-auth-panel-light { background: var(--dgl-auth-brand-bg); }
.deglar-auth-panel-light .deglar-auth-head-title, .deglar-auth-panel-light .deglar-auth-head-tagline { display: block; }
.deglar-auth-panel-light .deglar-login-card {
    box-sizing: border-box; max-width: 456px; padding: 28px; background: #fff;
    border: 1px solid var(--dgl-brand-border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
/* Panel LOGO (§4.2): logo y nombre sobre el fondo de marca. El logo ya está en el panel: la cabecera de la
   tarjeta se oculta en escritorio y vuelve en celular, donde el panel no existe. */
.deglar-auth-panel-logo .deglar-auth-brand { background: var(--dgl-auth-brand-bg); }
.deglar-auth-themed.deglar-auth-panel-logo .deglar-auth-brand .deglar-auth-brand-title { margin-top: 1.5rem; color: var(--dgl-auth-primary); }
.deglar-auth-themed.deglar-auth-panel-logo .deglar-auth-brand .deglar-auth-brand-tagline { color: var(--dgl-text-secondary); }
.deglar-auth-themed.deglar-auth-panel-logo .deglar-auth-brand .deglar-auth-brand-bar { background: var(--dgl-auth-primary); }
.deglar-auth-panel-logo .deglar-auth-head { display: none; }
.deglar-auth-help { width: 100%; max-width: 400px; margin-top: 1.25rem; text-align: center; font-size: 12px; line-height: 1.5; color: var(--dgl-text-secondary); }
.deglar-auth-help p { margin: 0 0 .35rem; white-space: pre-line; }
.deglar-auth-help a { color: var(--dgl-auth-primary); text-decoration: none; margin: 0 .5rem; }
.deglar-auth-help a:hover { text-decoration: underline; }
.deglar-auth-sitecode { display: block; color: #bbb; font-size: .65rem; letter-spacing: .3px; }

@media (max-width: 900px) {
    /* Geometría de acceso de v26.11.13: sin panel, logo centrado de 168 px y título de 20 px. */
    .deglar-auth-themed .deglar-auth-brand { display: none; }
    .deglar-auth-themed.deglar-auth-panel-light { background: #fff; }
    .deglar-auth-themed .deglar-auth-main { padding-top: clamp(24px, 6svh, 48px); }
    .deglar-auth-head { margin-bottom: 12px; }
    .deglar-auth-panel-logo .deglar-auth-head { display: flex; }
    .deglar-auth-head-logo { width: 168px; max-width: 100%; max-height: 72px; }
    .deglar-auth-head-title { display: block; max-width: 28ch; margin-top: 16px; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
    .deglar-auth-head-tagline { display: block; }
    .deglar-auth-panel-light .deglar-login-card { max-width: 400px; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* ---- card del formulario ---- */
.deglar-login-card { width: 100%; max-width: 400px; }
.deglar-login-card h1 {
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 18px;
    color: var(--dgl-text); margin: 0 0 6px;
}
.deglar-login-card h1::after {
    content: ""; display: block; width: 40px; height: 3px;
    background: var(--dgl-auth-primary); border-radius: 2px; margin-top: 10px;
}
.deglar-login-card label {
    display: block; font-size: 13px; font-weight: 500; color: var(--dgl-text);
    margin: 1rem 0 0;
}
.deglar-login-card input:not([type="checkbox"]) {
    display: block; width: 100%; box-sizing: border-box;
    height: 40px; padding: 0 15px; margin-top: 6px;
    border: 1px solid var(--dgl-input-border); border-radius: 4px;
    font-family: 'Roboto', sans-serif; font-size: 14px; color: var(--dgl-text);
    outline: none;
}
.deglar-login-card input:not([type="checkbox"]):focus {
    border-color: var(--dgl-auth-focus-border);
    box-shadow: 0 0 0 3px var(--dgl-auth-focus-ring);
}
/* Autocompletado del navegador: pinta el campo de celeste. Se tapa con una sombra interior blanca, que es
   lo único que el navegador deja cambiar, y se conserva el anillo de foco. */
.deglar-login-card input:not([type="checkbox"]):-webkit-autofill,
.deglar-login-card input:not([type="checkbox"]):autofill {
    -webkit-text-fill-color: var(--dgl-text); caret-color: var(--dgl-text);
    box-shadow: 0 0 0 1000px #fff inset;
}
.deglar-login-card input:not([type="checkbox"]):-webkit-autofill:focus,
.deglar-login-card input:not([type="checkbox"]):autofill:focus {
    box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px var(--dgl-auth-focus-ring);
}
.deglar-login-card button[type="submit"] {
    width: 100%; height: 45px; margin-top: 1.25rem;
    background: var(--dgl-auth-primary); color: #fff; border: 0; border-radius: 4px;
    font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 600;
    letter-spacing: .5px; cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.deglar-login-card button[type="submit"]:hover { background: var(--dgl-auth-primary-dark); }
.deglar-login-card a { color: var(--dgl-auth-primary); font-size: 13px; font-weight: 500; text-decoration: none; }
.deglar-login-card a:hover { text-decoration: underline; }
.deglar-login-card code { background: var(--dgl-auth-brand-bg); padding: .15rem .35rem; border-radius: 4px; }
.deglar-remember { font-weight: 400 !important; display: flex; align-items: center; gap: .5rem; font-size: 13px; margin-top: 1rem !important; }

/* Código de un solo uso (DeglarCodeInput): un único input monoespaciado sobre --cells casillas.
   Paso de casilla 3.2ch = 1ch del dígito + 2.2ch de letter-spacing; casilla 2.6ch + separación .6ch.
   El input es más ancho que el grupo para que el cursor tras el último dígito no desplace el texto.
   El recorte es `clip` y no `hidden`: con `hidden` el grupo sigue siendo desplazable y, al completar el
   último dígito, el navegador lo corre para mostrar el cursor (que queda fuera) y descuadra las casillas. */
.deglar-code-boxes {
    --cells: 6;
    position: relative; display: block; overflow: hidden; overflow: clip;
    width: calc(var(--cells) * 3.2ch - .6ch); height: 2.1em; margin: 8px auto 0;
    font: 600 clamp(22px, 7vw, 28px)/1 Consolas, 'Cascadia Mono', ui-monospace, Menlo, 'Roboto Mono', 'Courier New', monospace;
}
.deglar-code-cells { position: absolute; inset: 0; display: flex; gap: .6ch; pointer-events: none; }
.deglar-code-cells > span {
    flex: 0 0 2.6ch; box-sizing: border-box;
    border: 1px solid var(--dgl-input-border); border-radius: 8px; background: #fff;
}
.deglar-code-boxes:focus-within .deglar-code-cells > span {
    border-color: var(--dgl-auth-focus-border); box-shadow: inset 0 0 0 1px var(--dgl-auth-focus-border);
}
.deglar-login-card .deglar-code-boxes input.deglar-code-input {
    position: relative; display: block; box-sizing: border-box;
    width: calc(var(--cells) * 3.2ch + 1ch); height: 100%; margin: 0; padding: 0 0 0 .8ch;
    border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none;
    font: inherit; letter-spacing: 2.2ch; color: var(--dgl-text); caret-color: var(--dgl-auth-primary);
}

.deglar-login-error {
    background: var(--dgl-error-bg); color: var(--dgl-error-text);
    border: 1px solid var(--dgl-error-border); border-radius: 4px;
    padding: .6rem .75rem; margin-top: 1rem; font-size: 13px;
}
.deglar-login-info {
    background: #eef6ec; color: #1e5631; border: 1px solid #cce3c4;
    border-radius: 4px; padding: .6rem .75rem; margin-top: 1rem; font-size: 13px;
}
.deglar-captcha-note { font-size: 11px; color: #999; margin: .5rem 0 0; }
.deglar-ext-btn {
    display: block; width: 100%; box-sizing: border-box; text-align: center; text-decoration: none;
    height: 42px; line-height: 42px; margin-bottom: .5rem;
    border: 1px solid var(--dgl-input-border); border-radius: 4px;
    background: #fff; color: var(--dgl-text) !important;
    font-family: 'Roboto', sans-serif; font-size: 14px !important; font-weight: 500;
}
.deglar-ext-btn:hover { background: var(--dgl-auth-brand-bg); text-decoration: none !important; }
.deglar-login-sep { display: flex; align-items: center; color: #999; font-size: 12px; margin: 1.25rem 0 1rem; }
.deglar-login-sep::before, .deglar-login-sep::after { content: ""; flex: 1; border-bottom: 1px solid var(--dgl-brand-border); }
.deglar-login-sep span { padding: 0 .75rem; }

/* Auth móvil: marca centrada y formulario próximo; conservar el h1 accesible del login. */
@media (max-width: 900px) {
    .deglar-login-card:has(#deglar-login-form) > h1 {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    .deglar-login-card label { font-size: 14px; }
    .deglar-login-card input:not([type="checkbox"]) { height: 48px; font-size: 16px; border-radius: 8px; }
    .deglar-login-card button[type="submit"] { height: 48px; border-radius: 8px; box-shadow: none; }
    .deglar-login-card .deglar-remember {
        display: flex; min-height: 44px; gap: 8px; margin-top: 8px !important;
    }
    .deglar-remember input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
    .deglar-login-card .deglar-ext-btn {
        min-height: 48px; height: auto; line-height: 1.4; padding: 12px;
        border-radius: 8px; white-space: normal;
    }
    .deglar-auth-footer { margin-top: 28px; }
}

/* ============ SHELL: top bar 64px + sidebar 300px (DeglarMainContext) ============ */
/* Reset del margen default del <body> (8px): sin esto el shell (height:100vh) arranca en y=8/x=8,
   deja un borde blanco alrededor del app y se pasa 8px de alto (overflow). La topbar debe ir full-bleed. */
html, body { margin: 0; }
/* Alto del shell = viewport VISIBLE (100dvh). En celulares 100vh mide el viewport con la barra de
   direcciones oculta: mientras está visible, el shell queda más alto que la pantalla y, como no scrollea,
   recorta lo que una pantalla Fill fija abajo (p. ej. «Firmar recibo» del portal). 100vh queda de respaldo
   para navegadores sin dvh. */
.deglar-shell { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; font-family: 'Segoe UI', 'Roboto', sans-serif; }
.deglar-topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; flex-shrink: 0; padding: 0 16px;
    background: var(--dgl-topbar-bg); border-bottom: var(--dgl-topbar-rule-w) solid var(--dgl-topbar-rule);
}
.deglar-topbar-left { display: flex; align-items: center; gap: 16px; }
.deglar-topbar-home { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; cursor: pointer; }
.deglar-topbar-logo { height: 36px; }
/* Logo de marca en la barra del portal (§4.5) y cinta de ambiente (§4.7). */
.deglar-topbar-brand-logo { display: block; height: 36px; max-width: 200px; object-fit: contain; }
.deglar-env-ribbon {
    flex: 0 0 var(--dgl-shell-ribbon); height: var(--dgl-shell-ribbon); box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
    background: #fff4d6; border-bottom: 1px solid #edd9a3; color: #6b4e00;
    font-family: 'Roboto', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
}
/* Tipografía de marca en el nombre del portal (§4.10). La variable sólo existe con barra de marca; sin ella
   valen los respaldos, que son la tipografía y el peso de .deglar-topbar-brand. */
.deglar-employee-shell .deglar-topbar-brand { font-family: var(--dgl-topbar-font, 'Helvetica Neue', 'Segoe UI', sans-serif); font-weight: var(--dgl-topbar-font-weight, 700); }
/* Acentos sobrios (§4.6): los títulos del portal van en tinta, no en el primario del tema. */
html.dgl-brand-accent-sober .employee-portal h2 { color: var(--dgl-text); }
.deglar-topbar-brand {
    font-family: 'Helvetica Neue', 'Segoe UI', sans-serif; font-size: 24px; font-weight: 700;
    letter-spacing: -0.5px; color: var(--dgl-topbar-title);
}
.deglar-body { flex: 1; display: flex; min-height: 0; background: #f7f9fc; }
.deglar-sidebar {
    width: 300px; flex-shrink: 0; background: #fff;
    border-right: 1px solid var(--dgl-topbar-border);
    padding: .5rem 0 1rem; overflow-y: auto;
}
.deglar-content { flex: 1; padding: 1.5rem; overflow: auto; }
.deglar-muted { color: var(--dgl-muted-ui); }

/* ---- user menu / avatar ---- */
/* El menu de usuario ocupa SIEMPRE la franja --dgl-topbar-user-w (deglar-ds.css): es el ancla
   derecha de las islas fijas y la reserva que el header le hace al buscador. Si midiera su
   contenido, la franja real no coincidiria con el ancla y las islas volverian a superponerse.
   La caja es fija; el boton (summary) se alinea a la derecha y conserva su hover ajustado. */
.deglar-usermenu { position: relative; width: calc(var(--dgl-topbar-user-w) - 16px); flex: 0 0 auto; }
.deglar-usermenu > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px; border-radius: 24px; width: max-content; max-width: 100%; margin-left: auto; }
.deglar-usermenu > summary::-webkit-details-marker { display: none; }
.deglar-usermenu > summary:hover { background: var(--dgl-topbar-user-hover); }
/* El nombre se acota a la franja: un nombre largo estiraba el menu de usuario por encima de
   --dgl-topbar-user-w y pisaba las islas. */
.deglar-usermenu-name { font-size: 14px; color: var(--dgl-topbar-fg-soft); min-width: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deglar-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--dgl-avatar-from), var(--dgl-avatar-to));
    color: #fff; font-weight: 600; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.deglar-usermenu-panel {
    position: absolute; right: 0; top: 110%; min-width: 200px; z-index: 50;
    background: #fff; color: var(--dgl-text);
    border: 1px solid var(--dgl-topbar-border); border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    display: flex; flex-direction: column; padding: .4rem;
}
.deglar-usermenu-panel a { padding: 12px 16px; text-decoration: none; color: var(--dgl-text); border-radius: 6px; font-size: 14px; }
.deglar-usermenu-panel a:hover { background: #f8f9fa; }
.deglar-usermenu-logout { border-top: 1px solid var(--dgl-topbar-border); margin-top: 4px; }
.deglar-usermenu-role { font-size: 11px; color: var(--dgl-muted-section); padding: 6px 16px 8px; text-transform: uppercase; letter-spacing: .8px; }

/* ---- nav (sidebar) ---- */
.deglar-nav-section {
    font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--dgl-muted-section);
    padding: 10px 16px; border-bottom: 1px solid var(--dgl-topbar-border); margin-bottom: 4px;
}
.deglar-nav-section:not(:first-child) { margin-top: 12px; }
.deglar-nav-group > summary {
    list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 8px 12px 8px 16px;
    font-size: 13px; font-weight: 600; color: var(--dgl-muted-ui);
    transition: background 0.15s;
}
.deglar-nav-group > summary::-webkit-details-marker { display: none; }
.deglar-nav-group > summary:hover { background: var(--dgl-hover); }
.deglar-nav-arrow {
    display: inline-block; width: 0; height: 0;
    border-left: 5px solid var(--dgl-muted-ui);
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    transition: transform .15s;
}
.deglar-nav-group[open] > summary .deglar-nav-arrow { transform: rotate(90deg); }
.deglar-nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px 6px 28px;
    font-size: 13px; font-weight: 500; color: var(--dgl-muted-ui); text-decoration: none;
}
.deglar-nav-item:hover { background: var(--dgl-hover); color: var(--dgl-text); }
.deglar-nav-item.active { background: var(--dgl-active-bg); color: var(--dgl-active-fg); }
.deglar-nav-empty { color: var(--dgl-muted-section); font-size: 12px; padding: 8px 16px; }

/* ============ Browse auditoría ============ */
.deglar-audit-filters {
    background: #fff; border: 1px solid var(--dgl-topbar-border); border-radius: 8px;
    padding: 1rem 1.25rem; margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(16,24,40,.06);
}
.deglar-audit-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .5rem; align-items: flex-end; }
.deglar-audit-row label { font-size: 12px; font-weight: 600; color: var(--dgl-muted-ui); display: flex; flex-direction: column; gap: .25rem; min-width: 170px; }
.deglar-audit-actions { display: flex; align-items: flex-end; }
.deglar-audit-grid { height: calc(100vh - 340px - var(--dgl-shell-ribbon, 0px)); min-height: 300px; }

h1 { font-family: 'Montserrat', 'Segoe UI', sans-serif; font-size: 20px; font-weight: 700; color: var(--dgl-text); }

/* Mi cuenta: autogestión en anchos móviles. El menú de espacios y el de usuario
   siguen disponibles; el panel lateral de 300px cede el ancho al formulario. */
@media (max-width: 700px) {
    .deglar-shell:has(.account-page) .deglar-sidebar { display: none; }
    .deglar-shell:has(.account-page) .deglar-content { min-width: 0; padding: 16px 12px; }
    .deglar-shell:has(.account-page) .deglar-topbar-tools { display: none; }
    .deglar-shell:has(.account-page) .deglar-topbar-left { min-width: 0; gap: 10px; }
    .deglar-shell:has(.account-page) .deglar-topbar-home { min-width: 0; }
    .deglar-shell:has(.account-page) .deglar-topbar-brand { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .deglar-shell:has(.account-page) .deglar-usermenu-name { display: none; }
    /* Sin nombre y sin buscador, el menu de usuario vuelve a medir su contenido: la franja fija
       de la topbar le robaria el ancho a la marca. */
    .deglar-shell:has(.account-page) .deglar-usermenu { flex-shrink: 0; margin-left: 12px; width: auto; }
}
/* Login: ingreso sin contraseña con llave de acceso (nivel PASSKEY del sitio, DGL-V8-PASSKEYS §11). */
.deglar-passwordless { margin-top: .25rem; }
button.deglar-passwordless-button { width: 100%; font: inherit; font-weight: 600; cursor: pointer; }
button.deglar-passwordless-button:disabled { opacity: .6; cursor: progress; }
.deglar-passwordless .deglar-login-error[hidden] { display: none; }

/* Recordatorio post-login: registrar la huella (DGL-V8-PASSKEYS §12). */
.deglar-passkey-offer p { font-size: 13px; line-height: 1.6; }
.deglar-passkey-offer label { display: block; margin: 1rem 0; font-size: 13px; }
.deglar-passkey-offer label input { display: block; width: 100%; box-sizing: border-box; margin-top: .35rem; height: 38px; padding: 0 .6rem; border: 1px solid var(--dgl-input-border); border-radius: 4px; font: inherit; }
button.deglar-passkey-offer-primary { display: block; width: 100%; height: 42px; margin-bottom: .5rem; border: 1px solid var(--dgl-auth-action); border-radius: 4px; background: var(--dgl-auth-action); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
button.deglar-passkey-offer-primary:disabled { opacity: .6; cursor: progress; }
.deglar-passkey-offer button.deglar-ext-btn { font: inherit; cursor: pointer; }
.deglar-passkey-offer .deglar-login-error[hidden] { display: none; }

/* Human-session deadline warning, rendered by deglar-session-activity.js. */
.deglar-session-expiry-warning { position: fixed; inset: auto 1rem 1rem; z-index: 20000; padding: 1rem; border: 1px solid #946200; border-radius: .5rem; color: #392600; background: #fff2cc; box-shadow: 0 2px 12px #0003; }
