/* ============================================================================
   Winledger · Portal SSO — sistema de diseño
   Paleta de marca (logo Winledger): azul marino #00396E, oro #FFD900, rojo #961826.
   Tema claro/oscuro por variables CSS (clases theme-dark / theme-light en <html>).
   ============================================================================ */

:root {
    --radius: 10px;
    --radius-lg: 16px;
    --topbar-h: 58px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
    --maxw: 1040px;

    /* Colores de marca fijos (para el emblema, no cambian con el tema) */
    --wl-navy: #0e63b0;
    --wl-gold: #FFD900;
    --wl-red: #c11f30;
}

/* ─── Tema oscuro (por defecto) ─────────────────────────────────────────── */
html.theme-dark {
    --bg: #0a1120;
    --surface: #121c2e;
    --surface-2: #1a2740;
    --surface-3: #22314e;
    --border: #243350;
    --border-2: #33456a;

    --text: #e7edf6;
    --text-muted: #9fb0c9;
    --text-faint: #63748f;

    --brand-navy: #0b4f8c;
    --brand-navy-h: #0d5ca3;
    --accent: #4a97e0;
    --accent-strong: #2f79c4;
    --accent-soft: rgba(74, 151, 224, .16);
    --gold: #FFD900;
    --gold-soft: rgba(255, 217, 0, .14);
    --red: #e5484d;
    --red-soft: rgba(229, 72, 77, .15);
    --green: #3fb950;

    --on-accent: #ffffff;
    --brand-text: #ffffff;
    --shadow: 0 18px 50px rgba(0, 0, 0, .55);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --auth-bg: radial-gradient(1100px 620px at 50% -12%, #12325c 0%, #0a1120 58%);
}

/* ─── Tema claro ─────────────────────────────────────────────────────────── */
html.theme-light {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-2: #f4f7fb;
    --surface-3: #e8edf4;
    --border: #dbe3ec;
    --border-2: #c3cedb;

    --text: #0e2338;
    --text-muted: #5a6b7e;
    --text-faint: #95a3b3;

    --brand-navy: #00396E;
    --brand-navy-h: #012a53;
    --accent: #00396E;
    --accent-strong: #012a53;
    --accent-soft: rgba(0, 57, 110, .08);
    --gold: #d9b800;
    --gold-soft: rgba(217, 184, 0, .16);
    --red: #c0392b;
    --red-soft: rgba(192, 57, 43, .10);
    --green: #1a7f37;

    --on-accent: #ffffff;
    --brand-text: #00396E;
    --shadow: 0 16px 44px rgba(6, 26, 51, .14);
    --shadow-sm: 0 2px 10px rgba(6, 26, 51, .08);
    --auth-bg: radial-gradient(1100px 620px at 50% -12%, #e3ecf8 0%, #eef2f7 58%);
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

h1 { font-size: 1.5rem; font-weight: 650; margin: 0; letter-spacing: -.01em; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* FocusOnNavigate enfoca el <h1> (le añade tabindex="-1") al cambiar de página.
   Es foco programático, no del usuario → no debe pintar el anillo dorado. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

/* ─── Marca / emblema ────────────────────────────────────────────────────── */
.wl-brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; }
.wl-brand:hover { color: inherit; }

.wl-brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.wl-brand-mark i {
    width: 4px; border-radius: 2px; display: block;
    background: var(--wl-navy);
}
.wl-brand-mark i:nth-child(1) { height: 16px; background: var(--wl-navy); }
.wl-brand-mark i:nth-child(2) { height: 22px; background: var(--wl-gold); }
.wl-brand-mark i:nth-child(3) { height: 13px; background: var(--wl-red); }

.wl-brand-mark--lg { height: 40px; gap: 5px; }
.wl-brand-mark--lg i { width: 7px; }
.wl-brand-mark--lg i:nth-child(1) { height: 29px; }
.wl-brand-mark--lg i:nth-child(2) { height: 40px; }
.wl-brand-mark--lg i:nth-child(3) { height: 23px; }

.wl-brand-text { font-weight: 700; font-size: 1.05rem; color: var(--brand-text); letter-spacing: -.01em; }
.wl-brand-suffix { font-size: .78rem; font-weight: 600; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }

/* Logos reales: logo-blanco (wordmark blanco) en tema oscuro; logo-color en claro.
   Ambos 1789x496 → se escalan por altura. El swap por tema usa content: url(). */
.wl-topbar-logo { height: 26px; width: auto; display: block; }
.wl-auth-logo   { height: 42px; width: auto; display: block; }
.wl-auth-card--center .wl-auth-logo { margin: 0 auto 6px; }
html.theme-light .wl-topbar-logo,
html.theme-light .wl-sidebar-wordmark,
html.theme-light .wl-auth-logo { content: url('/images/logo-color.png'); }

/* ─── Layout: sidebar + contenido ────────────────────────────────────────── */
.wl-layout { display: flex; min-height: 100vh; }

.wl-sidebar {
    width: 236px; flex: 0 0 236px;
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--border);
    transition: width .2s cubic-bezier(.4,0,.2,1), flex-basis .2s cubic-bezier(.4,0,.2,1), transform .2s cubic-bezier(.4,0,.2,1);
    z-index: 30;
}
.wl-sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.wl-sidebar-logo { display: flex; align-items: center; min-width: 0; flex: 1; overflow: hidden; }
.wl-sidebar-icon { width: 26px; height: 26px; display: none; flex: 0 0 auto; }
.wl-sidebar-wordmark { height: 24px; width: auto; display: block; }

.wl-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.wl-nav-section { padding: 12px 10px 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.wl-nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--text-muted); font-size: .9rem; font-weight: 550; position: relative; white-space: nowrap; transition: background .12s, color .12s; }
.wl-nav-link:hover { background: var(--surface-2); color: var(--text); }
.wl-nav-link--active { background: var(--accent-soft); color: var(--accent); }
.wl-nav-icon { flex: 0 0 auto; }
.wl-nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.wl-nav-tip { display: none; position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--surface-3); color: var(--text); padding: 5px 11px; border-radius: 7px; font-size: .8rem; white-space: nowrap; box-shadow: var(--shadow-sm); z-index: 40; pointer-events: none; border: 1px solid var(--border); }
.wl-nav-footer { flex: 0 0 auto; padding: 12px 14px; border-top: 1px solid var(--border); font-size: .75rem; color: var(--text-faint); }
.wl-sidebar-overlay { display: none; }

.wl-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.wl-topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(14px, 3vw, 28px);
    background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.wl-topbar-left { display: flex; align-items: center; gap: 10px; }
.wl-topbar-title { font-size: .95rem; font-weight: 600; color: var(--text); }
.wl-topbar-right { display: flex; align-items: center; gap: 12px; }
.wl-user { font-size: .88rem; color: var(--text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wl-main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px); }

/* Desktop: sidebar sticky + colapso a iconos */
@media (min-width: 901px) {
    .wl-sidebar { position: sticky; top: 0; height: 100vh; }
    html.sidebar-collapsed .wl-sidebar { width: 62px; flex-basis: 62px; }
    /* Colapsado: solo el ícono de marca, centrado. La marca conserva la altura de
       la topbar (base), así el borde inferior alinea (esquina superior izquierda
       cuadrada). El toggle único vive en la topbar (hamburguesa). */
    html.sidebar-collapsed .wl-sidebar-brand { justify-content: center; padding: 0; }
    html.sidebar-collapsed .wl-sidebar-wordmark { display: none; }
    html.sidebar-collapsed .wl-sidebar-icon { display: block; margin: 0 auto; }
    html.sidebar-collapsed .wl-nav-link { justify-content: center; padding: 9px; }
    html.sidebar-collapsed .wl-nav-label { display: none; }
    html.sidebar-collapsed .wl-nav-section { font-size: 0; text-align: center; padding: 10px 0 4px; }
    html.sidebar-collapsed .wl-nav-section::after { content: "···"; font-size: .85rem; letter-spacing: 0; }
    html.sidebar-collapsed .wl-nav-footer { display: none; }
    html.sidebar-collapsed .wl-nav-link:hover .wl-nav-tip { display: block; }
}

/* Móvil: sidebar deslizable */
@media (max-width: 900px) {
    .wl-topbar-title { display: none; }
    .wl-sidebar { position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); box-shadow: var(--shadow); }
    html.sidebar-mobile-open .wl-sidebar { transform: translateX(0); }
    html.sidebar-mobile-open .wl-sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(3,9,20,.5); z-index: 25; }
}

/* ─── Botones ────────────────────────────────────────────────────────────── */
.wl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
    text-decoration: none;
}
.wl-btn:active { transform: translateY(1px); }
.wl-btn--sm { padding: 7px 13px; font-size: .85rem; }
.wl-btn--block { width: 100%; }

.wl-btn--primary {
    background: linear-gradient(180deg, var(--brand-navy-h), var(--brand-navy));
    color: var(--on-accent); box-shadow: var(--shadow-sm);
}
.wl-btn--primary:hover {
    background: linear-gradient(180deg, var(--accent-strong), var(--brand-navy-h));
    color: var(--on-accent); box-shadow: 0 8px 20px rgba(11, 79, 140, .32);
}

.wl-btn--ghost { background: transparent; border-color: var(--border-2); color: var(--text-muted); }
.wl-btn--ghost:hover { background: var(--surface-2); color: var(--text); }

.wl-icon-btn {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-2); border-radius: var(--radius); background: transparent;
    color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s;
}
.wl-icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Toggle de tema: se muestra el ícono según la clase ya presente en <html>. */
.wl-theme-toggle svg { display: block; }
html.theme-dark  .wl-theme-toggle .wl-icon-moon { display: none; }
html.theme-light .wl-theme-toggle .wl-icon-sun  { display: none; }

/* ─── Formularios ────────────────────────────────────────────────────────── */
.wl-form { display: flex; flex-direction: column; }
.wl-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); margin: 14px 0 6px; }
.wl-form .wl-label:first-child { margin-top: 4px; }

.wl-input {
    width: 100%; padding: 12px 14px; font: inherit; font-size: .97rem;
    color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.wl-input:hover { border-color: var(--border-2); }
.wl-input::placeholder { color: var(--text-faint); }
.wl-input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.wl-form .wl-btn { margin-top: 22px; }

/* ─── Alertas ────────────────────────────────────────────────────────────── */
.wl-alert { border-radius: var(--radius); padding: 11px 14px; font-size: .88rem; margin-bottom: 4px; }
.wl-alert--error { background: var(--red-soft); border: 1px solid var(--red); color: var(--red); }

/* ─── Tarjetas ───────────────────────────────────────────────────────────── */
.wl-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px 24px;
}

/* ─── Pantallas de autenticación (login / reset / logout / denegado) ─────── */
.wl-auth-shell {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 24px; background: var(--auth-bg);
}
.wl-auth-card {
    width: 100%; max-width: 400px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 18px;
    padding: 40px 38px 32px; box-shadow: var(--shadow);
    /* franja de marca superior (oro · azul · rojo, tercios iguales) */
    position: relative; overflow: hidden;
}
.wl-auth-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--wl-gold) 0 33.34%, var(--wl-navy) 33.34% 66.67%, var(--wl-red) 66.67% 100%);
}
.wl-auth-card--center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wl-auth-card--center .wl-form, .wl-auth-card--center > a { width: 100%; }
.wl-auth-card--center .wl-brand-mark { margin-bottom: 8px; }

.wl-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-bottom: 18px; }
.wl-auth-brand .wl-brand-suffix { letter-spacing: .14em; }

.wl-auth-title { font-size: 1.4rem; font-weight: 650; margin: 2px 0 5px; text-align: center; }
.wl-auth-sub { font-size: .9rem; color: var(--text-muted); margin: 0 0 22px; text-align: center; }
.wl-auth-foot { font-size: .8rem; color: var(--text-faint); margin: 16px 0 0; text-align: center; }
.wl-auth-copy { font-size: .78rem; color: var(--text-faint); margin: 0; }
.wl-auth-card--center .wl-form + a { margin-top: 4px; }

/* ─── Launcher ───────────────────────────────────────────────────────────── */
.wl-launcher-head { margin-bottom: 26px; }
.wl-launcher-head h1 { font-size: 1.65rem; margin-bottom: 5px; }
.wl-launcher-head p { color: var(--text-muted); margin: 0; }

.wl-app-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.wl-app-card {
    display: flex; align-items: center; gap: 15px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    color: var(--text); position: relative; overflow: hidden;
    transition: border-color .16s, transform .16s, box-shadow .16s;
}
.wl-app-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--wl-gold); transform: scaleY(0); transform-origin: bottom; transition: transform .18s;
}
.wl-app-card:hover {
    color: var(--text); border-color: var(--accent);
    transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.wl-app-card:hover::before { transform: scaleY(1); }

.wl-app-icon {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 700; color: var(--on-accent);
    background: linear-gradient(135deg, var(--brand-navy-h), var(--brand-navy));
    box-shadow: 0 4px 12px rgba(11, 79, 140, .28);
}
.wl-app-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wl-app-name { font-weight: 650; font-size: .98rem; transition: color .16s; }
.wl-app-card:hover .wl-app-name { color: var(--accent); }
.wl-app-desc { font-size: .82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-app-go { color: var(--text-faint); font-size: 1.1rem; transition: color .16s, transform .16s; }
.wl-app-card:hover .wl-app-go { color: var(--accent); transform: translateX(3px); }

/* ─── Administración ─────────────────────────────────────────────────────── */
.wl-admin-head { margin-bottom: 18px; }
.wl-admin-head h1 { font-size: 1.55rem; margin-bottom: 4px; }
.wl-admin-head p { color: var(--text-muted); margin: 0; }

.wl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.wl-tab { padding: 9px 16px; font-size: .9rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.wl-tab:hover { color: var(--text); }
.wl-tab--active { color: var(--accent); border-bottom-color: var(--accent); }

.wl-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.wl-input--search { flex: 1; min-width: 200px; max-width: 380px; }

.wl-alert--ok { background: rgba(46, 160, 67, .13); border: 1px solid var(--green); color: var(--green); }

/* Tabla */
.wl-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.wl-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.wl-table th {
    text-align: left; padding: 12px 16px; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.wl-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wl-table tbody tr:last-child td { border-bottom: none; }
.wl-table tbody tr:hover td { background: var(--surface-2); }
.wl-strong { font-weight: 650; }
.wl-muted { color: var(--text-muted); }
.wl-col-num { text-align: center; width: 1%; white-space: nowrap; }
.wl-url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges */
.wl-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600; background: var(--surface-3); color: var(--text-muted); margin-right: 4px; }
.wl-badge--green { background: rgba(46, 160, 67, .15); color: var(--green); }
.wl-badge--red { background: var(--red-soft); color: var(--red); }
.wl-badge--amber { background: rgba(210, 153, 34, .16); color: #c98a1a; }
.wl-badge--gold { background: var(--gold-soft); color: #a98600; }
html.theme-dark .wl-badge--amber { color: #e3b341; }
html.theme-dark .wl-badge--gold { color: #e3b341; }

/* Acciones de fila */
.wl-row-actions { display: inline-flex; gap: 5px; }
.wl-icon-btn--sm { width: 30px; height: 30px; border-radius: 8px; }
.wl-icon-btn svg { display: block; }
.wl-icon-btn.wl-danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }

/* Botón peligro */
.wl-btn--danger { background: var(--red); color: #fff; }
.wl-btn--danger:hover { background: var(--red-strong, #961826); color: #fff; }

/* Inputs deshabilitados */
.wl-input:disabled { opacity: .55; cursor: not-allowed; }

/* Modal */
.wl-modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(3, 9, 20, .6); backdrop-filter: blur(2px); padding: 20px; }
.wl-modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 26px 22px; box-shadow: var(--shadow); max-height: 88vh; overflow-y: auto; }
.wl-modal--sm { max-width: 400px; }
.wl-modal-title { font-size: 1.15rem; font-weight: 650; margin: 0 0 6px; }
.wl-modal-sub { font-size: .88rem; color: var(--text-muted); margin: 0 0 16px; }
.wl-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.wl-field { margin-bottom: 14px; }
.wl-field .wl-label { margin: 0 0 6px; }

.wl-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); cursor: pointer; margin-top: 4px; }
.wl-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Chips de selección múltiple (roles, compañías del cliente) */
.wl-chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px;
    border: 1px solid var(--border-2); background: var(--surface-2);
    color: var(--text-muted); font-size: .85rem; font-weight: 550; cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.wl-chip:hover { color: var(--text); border-color: var(--accent); }
.wl-chip--on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.wl-chip-check { font-weight: 700; font-size: .8rem; line-height: 1; }

/* Control segmentado (tipo de cuenta: interno / cliente) */
.wl-segmented { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden; }
.wl-seg {
    padding: 8px 18px; background: transparent; color: var(--text-muted);
    font-size: .88rem; font-weight: 600; cursor: pointer; border: none;
    border-right: 1px solid var(--border-2); transition: background .12s, color .12s;
}
.wl-seg:last-child { border-right: none; }
.wl-seg:hover { color: var(--text); }
.wl-seg--on { background: var(--accent); color: #fff; }

.wl-hint { margin: 8px 0 0; font-size: .8rem; color: var(--text-faint); }

/* Chips compactos en línea (columna Roles de la tabla) */
.wl-chips-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.wl-chip-sm { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 20px; font-size: .72rem; font-weight: 600; background: var(--surface-3); color: var(--text-muted); }
.wl-chip-sm--more { background: var(--accent-soft); color: var(--accent); cursor: default; }

/* Badge azul (tipo Cliente) */
.wl-badge--blue { background: var(--accent-soft); color: var(--accent); }

/* Lista de accesos */
.wl-access-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; margin: 2px 0; }
.wl-access-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); cursor: pointer; transition: background .12s; }
.wl-access-item:hover { background: var(--surface-2); }
.wl-access-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.wl-access-name { font-weight: 550; }
.wl-access-clave { margin-left: auto; font-size: .78rem; color: var(--text-faint); }

/* Accesos agrupados por compañía */
.wl-access-group { margin-bottom: 10px; }
.wl-access-group-head {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint);
}

/* Editor de despliegues (compañía → sistemas + URLs) */
.wl-modal--wide { max-width: 640px; }
.wl-desplieg-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; margin: 2px 0; }
.wl-desplieg-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); transition: opacity .12s; }
.wl-desplieg-row.is-off { opacity: .55; }
.wl-desplieg-row:hover { background: var(--surface-2); }
.wl-desplieg-check { display: flex; align-items: center; gap: 8px; min-width: 190px; cursor: pointer; }
.wl-desplieg-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.wl-desplieg-name { font-weight: 550; }
.wl-desplieg-url { flex: 1; font-size: .85rem; padding: 8px 10px; }

/* ─── Launcher: grupos por compañía ──────────────────────────────────────── */
.wl-launcher-group { margin-bottom: 22px; }
.wl-group-head { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; cursor: pointer; list-style: none; user-select: none; }
.wl-group-head::-webkit-details-marker { display: none; }
.wl-group-head::marker { content: ""; }
.wl-group-chevron { flex: 0 0 auto; color: var(--text-muted); transition: transform .18s; }
details[open] > .wl-group-head .wl-group-chevron { transform: rotate(90deg); }
.wl-group-name { font-size: 1.05rem; font-weight: 650; color: var(--text); }
.wl-group-head:hover .wl-group-name { color: var(--accent); }
.wl-group-count { font-size: .8rem; color: var(--text-faint); margin-left: auto; }

/* Buscador del launcher */
.wl-launcher-tools { margin: 0 0 20px; }
.wl-launcher-search { max-width: 420px; }
.wl-launcher-empty { padding: 24px 0; }

/* Accesos directos a compañías en el sidebar */
.wl-nav-company-badge {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: var(--on-accent);
    background: linear-gradient(135deg, var(--brand-navy-h), var(--brand-navy));
}
.wl-nav-company .wl-nav-label { font-weight: 500; }

/* ─── Utilidades ─────────────────────────────────────────────────────────── */
.wl-center-muted { color: var(--text-muted); padding: 40px 0; text-align: center; }
.wl-empty { display: flex; flex-direction: column; gap: 6px; color: var(--text-muted); }
.wl-empty strong { color: var(--text); font-size: 1rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .wl-brand-suffix { display: none; }
    .wl-user { display: none; }
    .wl-app-grid { grid-template-columns: 1fr; }
    .wl-auth-card { padding: 26px 22px 24px; }
}

/* ─── Compatibilidad Blazor (validación / error boundary) ────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--green); }
.invalid { outline: 1px solid var(--red); }
.validation-message { color: var(--red); font-size: .82rem; }

.blazor-error-boundary { background: var(--red-strong, #961826); padding: 1rem; color: #fff; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "Ocurrió un error."; }
