:root{color-scheme:light;--bg:#f3f6fb;--panel:#fff;--text:#14283f;--muted:#64758b;--line:#dde5f0;--blue:#2067df;--soft:#eaf1ff;--good:#147347;--bad:#c32635;--warn:#916000;--shadow:0 5px 22px #173b6507;--green-bg:#dcf7e8;--red-bg:#fee7ea;--amber-bg:#fff1cf;--neutral-bg:#edf1f6}
html[data-theme=dark]{color-scheme:dark;--bg:#0c1523;--panel:#142235;--text:#edf3fd;--muted:#a1b1c7;--line:#2b3c52;--blue:#8bb5ff;--soft:#203756;--good:#8ce9b3;--bad:#ff9ca6;--warn:#ffd477;--shadow:0 5px 22px #00000014;--green-bg:#173f32;--red-bg:#48252e;--amber-bg:#44371d;--neutral-bg:#253449}
*{box-sizing:border-box}html{min-width:280px}body{margin:0;min-height:100dvh;display:flex;flex-direction:column;background:var(--bg);color:var(--text);font:14px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,select,textarea{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.6;cursor:wait}[hidden]{display:none!important}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus,select:focus,textarea:focus{outline:3px solid var(--blue);outline-offset:3px}button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px}.icon{width:18px;height:18px;flex:none;vertical-align:middle}header,footer{width:min(1480px,calc(100% - 48px));margin-inline:auto;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-shrink:0}header{min-height:72px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:11px;color:var(--text);font-weight:800;font-size:23px;line-height:1.2;letter-spacing:-.6px;text-decoration:none}.mark{width:42px;height:42px;border-radius:12px;background:#2067df;color:white;display:grid;place-items:center;font-size:25px;box-shadow:0 5px 12px #2067df20}.brand small{display:block;font-size:8px;font-weight:750;letter-spacing:.17em;color:var(--muted);margin-top:5px}.accent{color:var(--blue)}main{width:min(1440px,calc(100% - 48px));margin:24px auto;flex:1;min-width:0}body[data-screen=login] main,body[data-screen=mfa] main{display:grid;align-items:center;margin-block:18px}.auth-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,440px);gap:clamp(28px,5vw,84px);align-items:center;width:min(1080px,100%);margin-inline:auto}.intro h1{font-size:clamp(35px,4vw,53px);line-height:1.12;letter-spacing:-.05em;margin:18px 0}.intro>p{max-width:440px;font-size:16px;color:var(--muted);line-height:1.7}.eyebrow{font-size:10px;letter-spacing:.16em;font-weight:800;color:var(--blue)}.trust{display:flex;flex-wrap:wrap;gap:14px;font-size:12px;color:var(--muted);margin-top:26px}.trust span:before{content:'✓ ';color:var(--good);font-weight:800}.panel{min-width:0;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:24px;box-shadow:var(--shadow);position:relative}.auth-layout>.panel{padding:30px}.panel h2{font-size:21px;line-height:1.3;margin:7px 0 13px;letter-spacing:-.025em}.auth-layout h2{font-size:29px;margin-top:12px}.muted{color:var(--muted)}.small{font-size:12px}.primary{width:100%;margin-top:20px;background:#2067df;color:white;border:1px solid transparent;padding:12px 16px;border-radius:9px;font-size:14px;font-weight:700}.primary:hover{background:#1956bc}.subtle{background:var(--panel);border:1px solid var(--line);color:var(--text);border-radius:8px;padding:8px 12px;font-size:12px;font-weight:600}.subtle:hover{background:var(--soft);border-color:var(--blue)}label{display:block;font-size:12px;font-weight:700;margin:16px 0 6px}input,select,textarea{width:100%;min-width:0;padding:10px 12px;background:var(--bg);border:1px solid var(--line);border-radius:8px;color:var(--text)}input[type=checkbox]{width:20px;min-height:20px;accent-color:#2067df}.auth-layout .small{margin-bottom:0}.narrow{width:min(420px,100%);margin:0 auto;padding:25px}.narrow h2{font-size:24px}.narrow .subtle{margin-top:14px}#qr{display:block;width:clamp(150px,23vh,190px);height:auto;aspect-ratio:1;margin:16px auto;background:white;border-radius:8px;padding:5px}code{overflow-wrap:anywhere}.dashboard-top{display:flex;justify-content:space-between;align-items:center;gap:20px}.dashboard-top h1{font-size:clamp(24px,2.4vw,34px);line-height:1.2;letter-spacing:-.04em;margin:7px 0}.dashboard-top p{margin:7px 0 0}.actions{display:flex;flex-wrap:wrap;gap:8px}.portal-nav{display:flex;flex-wrap:wrap;gap:6px;border-bottom:1px solid var(--line);padding:0 0 13px;margin:22px 0 12px}.portal-nav button{border-color:transparent;background:transparent}.portal-nav button[aria-current=true]{background:var(--soft);border-color:var(--line);color:var(--blue)}.account-meta{display:flex;flex-wrap:wrap;gap:5px 18px;margin-bottom:14px}.account-meta p{margin:0}.site-filter{max-width:340px}.site-filter label{margin-top:0}.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:18px 0 24px}.metrics .panel{padding:19px 22px}.metrics span:not(.spinner){font-size:12px;color:var(--muted)}.metrics strong{display:block;font-size:34px;line-height:1.3;font-weight:750;margin-top:6px;letter-spacing:-.04em}.metrics .metric-online strong{color:var(--good)}.metrics .metric-attention strong{color:var(--warn)}.metric-top{display:flex;align-items:center;justify-content:space-between}.metric-top .icon{color:var(--blue);width:21px;height:21px}.metric-online .metric-top .icon{color:var(--good)}.metric-attention .metric-top .icon{color:var(--warn)}.section-label{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:14px 0}.section-label h2,.history h2{font-size:18px;letter-spacing:-.02em;margin:0}.installations{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:16px;position:relative;min-height:110px}.installation{border-top:3px solid var(--line);padding:21px}.installation.status-online{border-top-color:#24a365}.installation.status-unreachable{border-top-color:#d54655}.installation.status-app_down{border-top-color:#dda431}.installation.status-pending{border-top-color:#dda431}.installation h3{font-size:16px;margin:6px 0 3px;overflow-wrap:anywhere}.installation p{font-size:12px;color:var(--muted);margin:5px 0}.installation .site-heading{display:flex;align-items:center;gap:9px}.site-heading>.icon{color:var(--blue)}.badge{display:inline-flex;align-items:center;gap:6px;border-radius:7px;padding:5px 9px;font-size:12px;font-weight:750;margin:12px 0;background:var(--soft);color:var(--blue);border:1px solid transparent}.badge .icon{width:14px;height:14px}.badge.good{background:var(--green-bg);color:var(--good)}.badge.bad{background:var(--red-bg);color:var(--bad)}.badge.warn{background:var(--amber-bg);color:var(--warn)}.badge.neutral{background:var(--neutral-bg);color:var(--muted)}.dashboard-note{margin:12px 0 22px}.history-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:18px;align-items:start}.chart-panel,.history{margin:0;min-width:0}.history-heading{display:flex;align-items:center;gap:8px;margin-bottom:15px}.history-heading>.icon{color:var(--blue)}.history-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,.6fr);gap:12px;margin-bottom:13px}.history-controls label{margin:0 0 5px}.chart-legend{display:flex;flex-wrap:wrap;gap:10px;font-size:11px;color:var(--muted);margin:12px 0}.legend-dot{width:8px;height:8px;border-radius:3px;display:inline-block;margin-right:5px}.red{background:#d54655}.amber{background:#dfa52b}.green{background:#24a365}.chart-box{min-height:205px;position:relative}.chart-box>svg{width:100%;height:auto;display:block}.chart-grid{stroke:var(--line);stroke-width:1}.chart-label{fill:var(--muted);font:11px system-ui,sans-serif}.chart-red{fill:#d54655}.chart-amber{fill:#dfa52b}.chart-green{fill:#24a365}.chart-empty{min-height:205px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:20px;color:var(--muted);font-size:13px}.chart-empty .icon{width:36px;height:36px;color:var(--good);background:var(--green-bg);padding:8px;border-radius:50%}.chart-data{max-height:230px;overflow:auto;margin-top:10px}.chart-data table{width:100%;border-collapse:collapse;font-size:12px}.chart-data th,.chart-data td{text-align:left;padding:9px;border-bottom:1px solid var(--line)}.chart-data th{position:sticky;top:0;background:var(--panel)}details summary{cursor:pointer;color:var(--blue);font-size:12px}#events{position:relative;max-height:390px;overflow:auto;min-height:100px}.event{padding:13px 0;border-top:1px solid var(--line);font-size:12px}.event:first-child{border-top:0}.event .event-title{display:flex;align-items:center;gap:8px;font-weight:650}.event .icon{width:16px;height:16px}.event.event-online .icon{color:var(--good)}.event.event-unreachable .icon{color:var(--bad)}.event.event-app_down .icon,.event.event-pending .icon{color:var(--warn)}.event time{display:block;font-size:11px;color:var(--muted);margin:4px 0 0 24px}#notice{background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--blue);padding:12px 15px;border-radius:9px;color:var(--text);font-size:13px;overflow-wrap:anywhere;margin-bottom:0}.admin-subnav{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0 20px}.admin-subnav button[aria-current=true]{background:var(--soft);color:var(--blue);border-color:var(--blue)}.admin-section{margin:0}.admin-section h2{font-size:20px}.admin-row{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.admin-row:first-child{border-top:0}.admin-row>div:first-child{min-width:0}.admin-row strong{font-size:13px}.admin-row p{margin:4px 0}.row-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end;max-width:500px}.row-actions .subtle{font-size:11px;min-height:33px;padding:6px 9px}.record-list{max-height:clamp(230px,52dvh,570px);overflow:auto;margin-top:15px;padding-right:6px}.audit-list{max-height:clamp(230px,52dvh,570px);overflow:auto}.form-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:20px}.form-actions .primary{width:auto;margin:0;min-width:100px}.edit-dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:15px;padding:25px;width:min(560px,calc(100% - 28px));max-height:calc(100dvh - 32px);overflow:auto;box-shadow:0 24px 100px #0003}.edit-dialog::backdrop{background:#071629a8}.edit-dialog h2{font-size:22px;margin:0}.form-error{color:var(--bad);overflow-wrap:anywhere}.profile-panel{max-width:720px}.profile-panel .subtle{margin:8px 8px 0 0}.audit-line{font-size:12px;padding:12px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.credential-dialog input{font-family:monospace;font-size:12px}.busy-overlay{position:absolute;right:12px;top:10px;display:flex;align-items:center;gap:6px;background:var(--panel);color:var(--muted);padding:5px 8px;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:20px;font-size:10px;z-index:2;pointer-events:none}.spinner,button.is-busy:after{content:'';width:13px;height:13px;border:2px solid var(--line);border-top-color:var(--blue);border-radius:50%;display:inline-block;flex:none;animation:spin .8s linear infinite}button.is-busy:after{border-top-color:currentColor}.is-busy{position:relative}footer{border-top:1px solid var(--line);min-height:46px;font-size:11px;color:var(--muted);padding-block:11px}footer a{color:var(--muted)}.prose{max-width:800px}.prose h1{font-size:30px}.prose h2{font-size:20px;margin-top:26px}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner,button.is-busy:after{animation-duration:2s}}@media(max-width:1000px){.history-grid{grid-template-columns:1fr}.history #events{max-height:270px}.auth-layout{gap:32px}.intro h1{font-size:40px}.auth-layout>.panel{padding:26px}}@media(max-width:720px){header,footer,main{width:calc(100% - 32px)}header{min-height:65px}.brand{font-size:20px}.mark{width:36px;height:36px}.brand small{font-size:7px}main{margin-block:18px}.auth-layout{grid-template-columns:1fr;gap:19px;max-width:440px}.intro h1{font-size:33px;margin:10px 0}.intro>p{font-size:13px;margin:0;line-height:1.6}.trust{margin-top:12px;font-size:10px}.auth-layout>.panel{padding:23px}.auth-layout h2{font-size:25px}.dashboard-top{align-items:flex-start;flex-direction:column;gap:13px}.dashboard-top h1{font-size:28px}.metrics{gap:8px;margin:16px 0}.metrics .panel{padding:14px 11px}.metrics strong{font-size:28px}.metrics span:not(.spinner){font-size:10px}.metric-top .icon{width:16px;height:16px}.panel{padding:20px}.section-label{align-items:flex-start;flex-wrap:wrap}.history-controls{grid-template-columns:1fr 120px}.admin-row{flex-direction:column;align-items:flex-start;gap:10px}.row-actions{justify-content:flex-start;max-width:none}.portal-nav .subtle{flex:1;padding-inline:8px;font-size:11px}.admin-subnav .subtle{flex:1;padding-inline:8px;font-size:11px}.record-list{max-height:55dvh}.edit-dialog{padding:21px}footer{flex-wrap:wrap;gap:4px 16px;font-size:10px}.narrow{padding:22px}}@media(max-height:720px)and(min-width:721px){header{min-height:61px}main{margin-block:16px}.auth-layout>.panel{padding:23px}.auth-layout label{margin-top:12px}.intro h1{font-size:40px}.narrow{padding:20px}#qr{width:150px;margin:12px auto}.narrow h2{font-size:21px}.narrow p{font-size:12px}.primary{padding:10px 14px}}
#management-view{position:relative;min-height:250px}
#management-view>.section-label{margin:6px 0}#management-view>.section-label>h2{font-size:16px;color:var(--muted)}.admin-subnav{margin:8px 0 14px}.record-list,.audit-list{max-height:clamp(180px,calc(100dvh - 570px),490px)}.dashboard-top .eyebrow{font-size:9px}.dashboard-top h1{margin:4px 0}.dashboard-top p{margin-top:4px}button{max-width:100%;overflow-wrap:anywhere}.event-title>span,#identity{min-width:0;overflow-wrap:anywhere}@media(max-width:720px){.record-list,.audit-list{max-height:48dvh}.row-actions .subtle{white-space:normal}}

/* Resumen comercial: mismas tarjetas y distribución responsive del portal. */
.license-summary{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--border,#dce4ef);min-width:0}
.license-summary h4{margin:0 0 .65rem;font-size:1rem}.license-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin:1rem 0}.license-grid dt{font-size:.75rem;opacity:.75}.license-grid dd{margin:.2rem 0 0;font-weight:650;overflow-wrap:anywhere}.license-summary progress{width:100%;height:.6rem;accent-color:#16a36a}.license-modules{display:flex;flex-wrap:wrap;gap:.5rem;margin:.8rem 0}.license-module{font-size:.75rem;padding:.45rem .6rem;border:1px solid var(--border,#dce4ef);border-radius:.5rem}.license-warning{color:#a76700}@media(max-width:420px){.license-grid{grid-template-columns:1fr}}

/* Filtros compartidos: disponibles en todas las pestañas de datos. */
.portal-filters{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:16px 0;padding:16px 18px}.portal-filters>div{flex:1 1 180px;min-width:0}.portal-filters>.search-field{flex:2 1 240px}.portal-filters label,.tab-filters label{margin-top:0}.portal-filters .filter-actions{display:flex;gap:8px;flex:0 1 auto;flex-wrap:wrap}.portal-filters .filter-scope{flex-basis:100%;margin:0}.tab-filters{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0}.tab-filters>div{flex:1 1 180px}.result-count{margin:10px 0}.badge.paused-badge{background:#fff0d9;color:#a34c00;border-color:#efc086}.installation.status-paused{border-top-color:#e38a23}.admin-row .badge{margin:7px 0}.chart-tooltip{min-height:48px;padding:10px 12px;margin-bottom:8px;border:1px solid var(--line);border-left:3px solid var(--blue);border-radius:8px;background:var(--soft);color:var(--text);font-size:12px;line-height:1.6;overflow-wrap:anywhere}.chart-tooltip[hidden]{display:block;visibility:hidden}.chart-hit{fill:transparent;cursor:pointer}.chart-hit:hover,.chart-hit:focus{fill:#2067df18;stroke:var(--blue);stroke-width:1;outline:none}[data-theme=dark] .badge.paused-badge{background:#4a2e12;color:#ffc77c;border-color:#95612f}@media(max-width:720px){.portal-filters{padding:14px}.portal-filters>div,.portal-filters>.search-field{flex-basis:100%}.portal-filters .filter-actions{flex-basis:100%}.portal-filters .filter-actions button{flex:1}.tab-filters>div{flex-basis:100%}}


/* Marca oficial. Dimensiones reservadas para evitar saltos al cargar el PNG. */
header .brand-official{flex:1 1 auto;min-width:0;gap:14px;max-width:calc(100% - 110px);text-decoration:none}
header .brand-official .brand-logo{display:block;flex:0 0 auto;width:84px;height:90px;object-fit:contain;background:transparent;border:0;box-shadow:none}
header .brand-caption{display:block;min-width:0;color:var(--text)}
header .brand-caption strong{display:block;font-size:17px;font-weight:750;line-height:1.3;letter-spacing:-.02em;overflow-wrap:normal}
header .brand-caption small{font-size:9px;line-height:1.6;letter-spacing:.12em;white-space:normal;margin-top:5px}
header.portal-header{min-height:110px;gap:12px;padding-block:8px}
header #theme{flex:0 0 auto;min-height:38px}
html[data-theme=dark] .brand-official .brand-logo{filter:brightness(1.4)}
@media(max-width:720px){header.portal-header{min-height:88px;gap:10px;padding-block:6px}header .brand-official{gap:10px;max-width:calc(100% - 96px)}header .brand-official .brand-logo{width:64px;height:69px}header .brand-caption strong{font-size:13px}header .brand-caption small{font-size:7px;letter-spacing:.08em}header #theme{font-size:11px;padding:7px 9px}}
@media(max-width:380px){header .brand-official{gap:7px;max-width:calc(100% - 88px)}header .brand-official .brand-logo{width:54px;height:58px}header .brand-caption strong{font-size:11px}header .brand-caption small{font-size:6px;letter-spacing:.03em}header #theme{font-size:10px;padding:6px 7px}}


/* Avisos por tipo: los mensajes se insertan como texto, con iconos SVG locales. */
.notice-box,#notice.notice-box{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:1px solid var(--line);border-left-width:4px;border-radius:9px;font-size:13px;line-height:1.55;overflow-wrap:anywhere}
.notice-box>span{min-width:0;flex:1}.notice-icon{width:20px;height:20px;flex:0 0 20px;margin-top:1px}
.notice-box[data-kind=error],#notice.notice-box[data-kind=error]{background:var(--red-bg);border-color:var(--bad);color:var(--bad)}
.notice-box[data-kind=warning],#notice.notice-box[data-kind=warning]{background:var(--amber-bg);border-color:var(--warn);color:var(--warn)}
.notice-box[data-kind=success],#notice.notice-box[data-kind=success]{background:var(--green-bg);border-color:var(--good);color:var(--good)}
.notice-box[data-kind=info],#notice.notice-box[data-kind=info]{background:var(--soft);border-color:var(--blue);color:var(--blue)}
@media(max-width:480px){.notice-box,#notice.notice-box{font-size:12px;padding:10px;gap:8px}.notice-icon{width:18px;height:18px;flex-basis:18px}}

/* Capa instalable. No cambia la lógica de acceso ni del dashboard. */
.portal-header .pwa-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;flex:0 1 auto;margin-left:auto}
#pwa-install svg{width:17px;height:17px;margin-right:5px;flex:none}
.portal-header{flex-wrap:wrap}.portal-header .brand-official{flex:1 1 240px;max-width:none}
.pwa-banner{display:flex;align-items:flex-start;gap:8px 12px;flex-wrap:wrap;padding:12px 14px;border:1px solid var(--warn);border-radius:10px;background:var(--amber-bg);color:var(--warn);font-size:12px;margin-bottom:14px}
.pwa-banner strong{flex-basis:100%}.pwa-banner span{min-width:0;flex:1 1 220px}.pwa-banner.pwa-update{border-color:var(--blue);background:var(--soft);color:var(--blue);align-items:center}
#pwa-install-help p{line-height:1.75;white-space:pre-line}
body[data-screen=login] .pwa-banner{margin-bottom:0}
@media(max-width:600px){.portal-header .brand-official{flex-basis:100%}.portal-header .pwa-actions{margin-left:auto}#pwa-install,.pwa-actions #theme{font-size:11px;padding:7px 9px}}
@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}header.portal-header,main,footer{max-width:calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 28px)}#pwa-install{display:none}}


/* Sistema visual único: acceso, MFA y panel de supervisión. */
:root{--bg:#f3f6fb;--panel:#fff;--text:#14283f;--muted:#64758b;--line:#dde5f0;--blue:#2067df;--soft:#eaf1ff;--shadow:0 5px 18px #173b6508;--brand-surface:#eaf3ff}
html[data-theme=dark]{--bg:#0c1523;--panel:#142235;--text:#edf3fd;--muted:#a1b1c7;--line:#2b3c52;--blue:#8bb5ff;--soft:#203756;--shadow:0 5px 18px #00000012;--brand-surface:#152b47}
body.portal-unified{font-family:"Inter","Segoe UI Variable Text","Segoe UI",-apple-system,BlinkMacSystemFont,Arial,sans-serif;-webkit-font-smoothing:antialiased}
.portal-unified h1,.portal-unified h2,.portal-unified h3{font-weight:600;letter-spacing:-.035em}
.portal-unified button{font-weight:600}.portal-unified .primary{background:#2067df;box-shadow:none}.portal-unified .primary:hover{background:#1956bc}
.portal-unified input,.portal-unified select,.portal-unified textarea{border-radius:9px;background:var(--bg);border-color:var(--line)}
.portal-unified label{font-weight:550}
.portal-unified header.portal-header{min-height:76px;padding-block:12px;border-bottom:1px solid var(--line);gap:14px}
.portal-unified header .brand-official{flex:1 1 190px;max-width:none;gap:11px}
.portal-unified header .brand-official .brand-logo{width:32px;height:32px;object-fit:contain;background:transparent;filter:none}
.portal-unified .brand-caption strong{font-size:18px;font-weight:650;letter-spacing:-.035em;line-height:1.2;color:var(--text)}
.portal-unified .brand-caption strong>span,.access-brand strong>span{color:var(--blue)}
.portal-unified .brand-caption small{font-size:8px;letter-spacing:.1em;margin-top:5px}
html[data-theme=dark] .portal-unified header .brand-logo,html[data-theme=dark] .access-brand img{filter:brightness(1.4)}
.access-brand{display:flex;align-items:center;gap:12px;min-width:0}
.access-brand>img{display:block;width:56px;height:56px;flex:0 0 56px;object-fit:contain;background:transparent}
.access-brand strong{display:block;font-size:25px;line-height:1.2;font-weight:650;letter-spacing:-.04em;color:var(--text)}
.access-brand small{display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.5}
.portal-unified[data-screen=login] header .brand-official,.portal-unified[data-screen=mfa] header .brand-official{display:none}
.portal-unified[data-screen=login] header.portal-header,.portal-unified[data-screen=mfa] header.portal-header{min-height:52px;width:min(1040px,calc(100% - 32px));border:0;justify-content:flex-end}
.portal-unified[data-screen=login] main,.portal-unified[data-screen=mfa] main{display:flex;flex-direction:column;align-items:stretch;justify-content:center;width:min(1040px,calc(100% - 32px));gap:14px;margin:8px auto 22px;min-width:0}
.portal-unified[data-screen=login] footer,.portal-unified[data-screen=mfa] footer{width:min(1040px,calc(100% - 32px))}
.portal-unified[data-screen=login] #notice,.portal-unified[data-screen=mfa] #notice{margin:0}
#login.access-layout{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1fr);gap:0;align-items:stretch;background:var(--panel);border:1px solid var(--line);border-radius:20px;box-shadow:0 18px 54px #182f4d0d;width:100%;margin:0;overflow:hidden;flex:0 0 auto;min-width:0}
.access-intro{display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;background:var(--brand-surface);padding:38px;min-width:0}
.access-intro-copy{margin:42px 0}
.access-intro .eyebrow{color:var(--muted);font-size:9px;letter-spacing:.12em;font-weight:600}
.access-intro h1{font-size:clamp(30px,3vw,39px);line-height:1.16;margin:14px 0 17px;color:var(--text);font-weight:600;letter-spacing:-.045em}
.access-intro p{max-width:300px;font-size:13px;line-height:1.75;color:var(--muted);margin:0}
.access-product{border-top:1px solid var(--line);padding-top:15px;width:100%;color:var(--muted);font-size:10px;font-weight:550;letter-spacing:.06em}
.access-form{padding:40px;min-width:0}
.access-form>.eyebrow{font-size:9px;font-weight:650;letter-spacing:.12em}
.access-form h2{font-size:28px;line-height:1.25;margin:13px 0 7px}
.access-description{font-size:13px;color:var(--muted);line-height:1.6;margin:0 0 10px}
#login #login-form label{font-size:12px;margin:17px 0 7px;font-weight:550}
.access-input{position:relative;min-width:0}.access-input>svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--muted);pointer-events:none}
#login .access-input input{height:47px;width:100%;min-width:0;padding:11px 12px 11px 40px;font-size:14px;font-weight:400;border-radius:9px;background:var(--bg);color:var(--text)}
#login input::placeholder{color:var(--muted);opacity:.85}
#login #login-form .primary{display:flex;align-items:center;justify-content:center;gap:9px;min-height:47px;margin-top:23px;padding:11px 12px;border-radius:9px;font-size:13px;color:#fff}
#login #login-form .primary>svg{width:17px;height:17px;flex:0 0 17px}#login #login-form .primary>span{flex:1;min-width:0}
.access-security{display:flex;justify-content:center;align-items:center;gap:6px;font-size:10px;color:var(--muted);margin:16px 0;line-height:1.6;text-align:center}
.access-security>svg{width:14px;height:14px;flex:0 0 14px}
.access-support{display:block;text-align:center;font-size:11px;color:var(--blue);text-decoration:none}.access-support:hover{text-decoration:underline}
#retry-session{width:100%;justify-content:center;margin-top:12px;white-space:normal}
/* MFA usa la misma marca y superficies. El QR conserva fondo blanco y sin filtros. */
#mfa.mfa-unified{width:min(480px,100%);margin:0 auto;padding:30px;border:1px solid var(--line);border-radius:20px;box-shadow:0 18px 54px #182f4d0d;text-align:center;min-width:0}
#mfa .access-brand{justify-content:center;text-align:left;margin-bottom:25px}
#mfa .access-brand>img{width:36px;height:36px;flex-basis:36px}#mfa .access-brand strong{font-size:20px}#mfa .access-brand small{font-size:9px}
.mfa-intro-icon{display:grid;place-items:center;width:43px;height:43px;border:1px solid var(--line);background:var(--soft);color:var(--blue);border-radius:12px;margin:0 auto 13px}.mfa-intro-icon svg{width:22px;height:22px}
#mfa h2{font-size:24px;margin:10px 0;line-height:1.25}#mfa #mfa-help{font-size:12px;line-height:1.75;color:var(--muted);max-width:340px;margin:0 auto 15px}
#mfa #qr{display:block;width:208px;max-width:100%;height:auto;aspect-ratio:1;object-fit:contain;box-sizing:border-box;background:#fff;padding:12px;border:1px solid #e0e5eb;border-radius:13px;margin:16px auto;filter:none;transform:none}
#mfa #enrollment>p{font-size:10px;color:var(--muted);line-height:1.6}#mfa details{text-align:left;margin:12px 0;background:var(--bg);border:1px solid var(--line);border-radius:9px;padding:11px 12px}
#mfa #totp-secret{display:block;white-space:normal;word-break:break-all;user-select:all;font-size:12px;margin-top:10px;line-height:1.7}
#mfa-form{text-align:left}#mfa-form label{font-size:12px;margin:15px 0 7px}#mfa #otp{width:100%;font:20px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.3em;text-align:center;padding:11px 10px;min-width:0}
#mfa-form .primary{min-height:45px;margin-top:16px;font-size:13px;border-radius:9px}#mfa #mfa-cancel{width:100%;justify-content:center;font-size:12px;min-height:40px}
/* Dashboard: navegación lateral real en escritorio y contenido en una columna móvil. */
.portal-unified[data-screen=dashboard] main{width:min(1480px,calc(100% - 40px));margin:24px auto}
#dashboard{display:grid;grid-template-columns:208px minmax(0,1fr);grid-template-areas:"top top" "nav meta" "nav filters" "nav content";gap:16px 24px;align-items:start;min-width:0}
#dashboard>.dashboard-top{grid-area:top;margin:0 0 5px;padding-bottom:18px;border-bottom:1px solid var(--line)}
#dashboard>.dashboard-top h1{font-size:29px;font-weight:600;margin:6px 0;line-height:1.2}#dashboard>.dashboard-top p{font-size:12px;margin:0}
#dashboard>#portal-nav{grid-area:nav;display:flex;flex-direction:column;gap:6px;margin:0;padding:15px 12px;border:1px solid var(--line);border-radius:13px;background:var(--panel);position:sticky;top:18px;min-width:0}
#portal-nav:before{content:'ESPACIO DE TRABAJO';font-size:8px;font-weight:650;letter-spacing:.12em;color:var(--muted);padding:4px 9px 12px}
#portal-nav:after{content:'LinkWich-Monitor';font-size:10px;color:var(--muted);padding:15px 9px 4px;border-top:1px solid var(--line);margin-top:10px}
#portal-nav button{display:flex;width:100%;justify-content:flex-start;gap:9px;padding:10px 11px;min-height:42px;font-size:12px;text-align:left;border:1px solid transparent;border-radius:8px;color:var(--muted);white-space:normal}
#portal-nav button[aria-current=true]{background:var(--soft);color:var(--blue);border-color:var(--line)}#portal-nav button .icon{width:17px;height:17px;flex:none}
#dashboard>.account-meta{grid-area:meta;margin:0;gap:5px 16px;align-items:center}#dashboard>.account-meta p{font-size:11px}
#dashboard>#portal-filters{grid-area:filters;margin:0;padding:15px 17px;border-radius:12px;box-shadow:none}
#dashboard>#overview-view,#dashboard>#management-view,#dashboard>#profile-view{grid-area:content;min-width:0}
#overview-view>.metrics{margin:0 0 21px;gap:14px}.portal-unified .metrics .panel{padding:19px 21px;border-radius:13px;box-shadow:var(--shadow)}.portal-unified .metrics strong{font-size:32px;font-weight:600;letter-spacing:-.035em;margin-top:10px}
.portal-unified .metric-top{gap:9px}.portal-unified .metric-top>span:first-child{min-width:0;flex:1;overflow-wrap:anywhere;font-size:11px}.portal-unified .metric-top>span:last-child{flex:0 0 32px;display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--soft)}.portal-unified .metric-top .icon{width:18px;height:18px}
.portal-unified .metric-online .metric-top>span:last-child{background:var(--green-bg)}.portal-unified .metric-attention .metric-top>span:last-child{background:var(--amber-bg)}
.portal-unified .panel{border-radius:13px;box-shadow:var(--shadow)}.portal-unified .installation{padding:21px}.portal-unified .installation h3{font-size:16px;font-weight:600}.portal-unified .badge{font-weight:600;border-radius:6px;font-size:11px}
.portal-unified .history-heading h2,.portal-unified .section-label h2{font-size:17px;font-weight:600}.portal-unified .history-heading{margin-bottom:15px}.portal-unified .chart-panel,.portal-unified .history{padding:22px}
.portal-unified .admin-subnav{gap:7px;margin:0 0 15px;padding-bottom:13px;border-bottom:1px solid var(--line)}.portal-unified .admin-subnav button{font-weight:550}
.portal-unified .admin-section{padding:23px}.portal-unified .admin-section h2{font-size:20px;font-weight:600}.portal-unified .admin-row{padding:17px 0}.portal-unified .admin-row strong{font-size:13px;font-weight:600}.portal-unified .record-list,.portal-unified .audit-list{max-width:100%}
.portal-unified .edit-dialog{border-radius:15px;max-width:calc(100vw - 28px);min-width:0}.portal-unified .edit-dialog h2{font-weight:600}.portal-unified .form-actions{flex-wrap:wrap}.portal-unified .form-actions>*{max-width:100%}
.portal-unified .panel,.portal-unified .admin-row,.portal-unified .row-actions{min-width:0;max-width:100%}.portal-unified .edit-dialog input,.portal-unified .edit-dialog select,.portal-unified .edit-dialog textarea{max-width:100%;min-width:0}
.portal-unified footer{font-size:10px;min-height:45px}.portal-unified .pwa-actions .subtle{font-size:11px;font-weight:550}
@media(max-width:1100px){#dashboard{grid-template-columns:180px minmax(0,1fr);column-gap:18px}#portal-nav button{font-size:11px;padding-inline:9px}.portal-unified .history-grid{grid-template-columns:1fr}}
@media(max-width:980px){#dashboard{grid-template-columns:minmax(0,1fr);grid-template-areas:"top" "nav" "meta" "filters" "content";gap:13px}#dashboard>#portal-nav{position:static;flex-direction:row;flex-wrap:wrap;padding:7px;gap:5px}#portal-nav:before,#portal-nav:after{display:none}#portal-nav button{width:auto;flex:1 1 130px;justify-content:center;padding:9px;font-size:12px}#dashboard>.dashboard-top h1{font-size:26px}}
@media(max-width:760px){.portal-unified header.portal-header{min-height:66px;width:calc(100% - 28px);padding-block:10px;gap:10px}.portal-unified header .brand-official{flex:1 1 160px;gap:8px}.portal-unified header .brand-official .brand-logo{width:28px;height:28px}.portal-unified .brand-caption strong{font-size:16px}.portal-unified .brand-caption small{font-size:6px}
.portal-unified[data-screen=login] main,.portal-unified[data-screen=mfa] main{width:min(470px,calc(100% - 28px));margin:5px auto 18px;justify-content:flex-start}.portal-unified[data-screen=login] header.portal-header,.portal-unified[data-screen=mfa] header.portal-header{width:min(470px,calc(100% - 28px));min-height:48px}
#login.access-layout{grid-template-columns:minmax(0,1fr);border-radius:17px}.access-intro{padding:23px 25px;gap:16px}.access-brand>img{width:45px;height:45px;flex-basis:45px}.access-brand strong{font-size:23px}.access-brand small{font-size:9px}.access-intro-copy{margin:0}.access-intro h1{font-size:26px;line-height:1.2;margin:12px 0 0}.access-intro h1 br{display:none}.access-intro p,.access-product{display:none}.access-intro .eyebrow{font-size:8px}.access-form{padding:26px 25px}.access-form h2{font-size:26px}.portal-unified input,.portal-unified select,.portal-unified textarea,#login .access-input input{font-size:16px}
#mfa.mfa-unified{padding:26px 22px;border-radius:17px}#mfa h2{font-size:22px}#mfa #qr{width:200px}#mfa .access-brand{margin-bottom:21px}
.portal-unified[data-screen=dashboard] main{width:calc(100% - 28px);margin:17px auto}#dashboard>.dashboard-top{align-items:flex-start;gap:12px;padding-bottom:14px}#dashboard>.dashboard-top h1{font-size:25px}#overview-view>.metrics{gap:8px}.portal-unified .metrics .panel{padding:14px 11px}.portal-unified .metrics strong{font-size:28px}.portal-unified .metric-top>span:last-child{display:none}.portal-unified .metric-top>span:first-child{font-size:10px}.portal-unified .metrics strong{margin-top:9px}.portal-unified .panel,.portal-unified .admin-section,.portal-unified .chart-panel,.portal-unified .history{padding:19px}.portal-unified .row-actions{width:100%;justify-content:flex-start}.portal-unified .row-actions .subtle{min-height:42px}.portal-unified footer{width:calc(100% - 28px);flex-wrap:wrap;gap:6px 12px}.portal-unified footer a{overflow-wrap:anywhere}}
@media(max-width:380px){.access-intro{padding:20px}.access-form{padding:24px 20px}.access-intro h1{font-size:24px}.access-brand strong{font-size:20px}#mfa.mfa-unified{padding:23px 18px}#mfa #qr{width:192px}.portal-unified .history-controls{grid-template-columns:1fr}.portal-unified .metrics .panel{padding:12px 9px}.portal-unified .metrics strong{font-size:25px}.portal-unified .metric-top>span:first-child{font-size:9px}#portal-nav button{flex-basis:100px;font-size:11px}}
@media(max-height:700px)and(min-width:761px){.access-intro{padding:29px 34px}.access-intro-copy{margin:29px 0}.access-form{padding:29px 34px}.access-intro h1{font-size:33px}#login #login-form label{margin-top:13px}.access-security{margin:13px 0}#mfa.mfa-unified{padding:23px 28px}#mfa .access-brand{margin-bottom:17px}#mfa #qr{width:180px;margin-block:12px}.mfa-intro-icon{margin-bottom:10px}}

.portal-unified .access-intro{border-right:1px solid var(--line)}
@media(max-width:760px){.portal-unified .access-intro{border-right:0;border-bottom:1px solid var(--line)}}

.portal-unified[data-screen=mfa] #notice{width:min(480px,100%);align-self:center}


/* Identificadores de marca y pequeño aumento del símbolo; QR sin cambios. */
.brand-registered{font-size:.36em;line-height:0;position:relative;top:-.68em;vertical-align:baseline;margin-left:.18em;letter-spacing:0;font-weight:500;color:inherit}
.access-product .brand-registered,footer .brand-registered{font-size:.6em;top:-.55em}
#login .access-brand>img{width:64px;height:64px;flex-basis:64px}
#mfa .access-brand>img{width:40px;height:40px;flex-basis:40px}
.portal-unified header .brand-official .brand-logo{width:36px;height:36px}
#portal-nav:after{content:'LinkWich-Monitor®'}
@media(max-width:760px){#login .access-brand>img{width:50px;height:50px;flex-basis:50px}.portal-unified header .brand-official .brand-logo{width:32px;height:32px}}


/* Barra única del dashboard: marca, identidad y acciones. */
.header-identity,.dashboard-header-control{display:none}
.portal-unified[data-screen=dashboard] .header-identity{display:block;flex:1 1 180px;min-width:0;text-align:right;margin-right:4px}
.header-identity #identity{margin:0;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.portal-unified[data-screen=dashboard] .dashboard-header-control{display:inline-flex;flex:0 0 auto}
.portal-unified[data-screen=dashboard] header.portal-header{align-items:center;min-height:76px;gap:14px}
.portal-unified[data-screen=dashboard] header .brand-official{flex:0 1 270px}
.portal-unified[data-screen=dashboard] .pwa-actions{margin-left:auto;align-items:center;gap:7px;flex:0 1 auto}
.portal-unified[data-screen=dashboard] .pwa-actions .subtle{min-height:38px;padding:8px 11px;font-size:11px}
.portal-unified[data-screen=dashboard] main{margin-top:20px}
#dashboard{grid-template-areas:"nav meta" "nav filters" "nav content"}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:1100px){.portal-unified[data-screen=dashboard] .header-identity{display:none}.portal-unified[data-screen=dashboard] header .brand-official{flex:1 1 180px}}
@media(max-width:980px){#dashboard{grid-template-areas:"nav" "meta" "filters" "content"}}
@media(max-width:760px){.portal-unified[data-screen=dashboard] header.portal-header{gap:10px;min-height:66px}.portal-unified[data-screen=dashboard] .pwa-actions{flex:1 1 auto;justify-content:flex-end;flex-wrap:wrap}.portal-unified[data-screen=dashboard] .pwa-actions .subtle{font-size:10px;padding:7px 9px;min-height:38px}.portal-unified[data-screen=dashboard] main{margin-top:15px}}
@media(max-width:480px){.portal-unified[data-screen=dashboard] header .brand-official{flex-basis:100%}.portal-unified[data-screen=dashboard] .pwa-actions{width:100%;justify-content:flex-start;margin-left:0}.portal-unified[data-screen=dashboard] .pwa-actions>.dashboard-header-control{flex:1 1 auto}.portal-unified[data-screen=dashboard] .dashboard-header-control>.subtle{width:100%}.portal-unified[data-screen=dashboard] .pwa-actions>#pwa-install,.portal-unified[data-screen=dashboard] .pwa-actions>#theme{flex:1 1 auto}}

/* Tarjetas de servicio: ayudas accesibles con clic, teclado y pantalla táctil. */
.site-status-description{font-size:13px;line-height:1.6;color:var(--muted);margin:12px 0}
.site-info{margin:12px 0;min-width:0}.site-info-line{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 14px;font-size:12px;margin:8px 0;min-width:0}.site-info-line>strong{font-size:12px;font-weight:600;overflow-wrap:anywhere}.site-technical-details>summary{font-size:12px;color:var(--blue);cursor:pointer;padding:6px 0}.site-technical-details .site-info-line{border-left:2px solid var(--line);padding-left:10px}
.license-summary{border-top-color:var(--line);padding-top:18px;margin-top:18px}.license-summary h4{font-size:17px;margin:0 0 12px}.license-grid{gap:16px 12px;margin:20px 0}.license-grid dt{opacity:1;color:var(--muted);font-size:12px;line-height:1.6}.license-grid dd{font-size:16px;margin-top:5px;line-height:1.4}.license-field{min-width:0}.license-capacity{margin:16px 0}.capacity-label{display:flex;align-items:center;gap:8px;font-size:12px;margin-bottom:8px;color:var(--muted)}.capacity-label>strong{margin-left:auto;color:var(--text)}.license-summary progress{display:block;height:10px;accent-color:var(--good);width:100%}.license-modules{display:grid;gap:8px;margin:20px 0 12px}.license-modules h5{margin:0 0 3px;font-size:13px}.license-modules .license-module{display:flex;align-items:center;justify-content:space-between;gap:12px;border-color:var(--line);border-radius:10px;background:var(--soft);padding:11px 12px;font-size:12px;min-width:0}.license-module>span:first-child{min-width:0;overflow-wrap:anywhere}.license-module .badge{margin:0;flex:none;padding:4px 7px;font-size:10px;white-space:nowrap}.license-received{margin-bottom:0;font-size:11px;line-height:1.7}.license-summary .license-warning{color:var(--warn)}

/* Tarjetas de licencia sin botones de ayuda. Iconos de la biblioteca existente. */
.installation .site-heading{align-items:center;gap:10px}.installation .site-heading h3{line-height:1.4;overflow-wrap:anywhere}
.installation .site-status-description{font-size:12px;line-height:1.65;margin:12px 0;color:var(--muted)}
.site-info-line>span:first-child{display:inline-flex;align-items:center;gap:7px}.site-info-line .icon{width:15px;height:15px;flex:none;color:var(--muted)}
.site-technical-details{margin-top:8px}.site-technical-details>summary{font-size:11px}.site-technical-details .site-info-line{margin-top:10px}
.license-summary{padding-top:20px;margin-top:18px}.license-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:18px}
.license-heading h4{display:flex;align-items:center;gap:8px;margin:0;font-size:17px;line-height:1.4}.license-heading h4 .icon{width:19px;height:19px;color:var(--blue);flex:none}.license-heading .badge{margin:0;font-size:10px;padding:6px 9px;line-height:1.4}
.license-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin:0 0 16px;gap:18px 14px}.license-grid dt{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);line-height:1.5}.license-grid dt .icon{width:14px;height:14px;color:var(--muted);flex:none}.license-grid dd{margin:6px 0 0;font-size:15px;font-weight:650;line-height:1.4}
.license-grid .license-field:last-child{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--soft)}.license-grid .license-field:last-child dd{margin:0;font-size:13px;text-align:right}
.license-capacity{border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--panel);margin:12px 0 18px}.capacity-label{font-size:11px;margin-bottom:10px;gap:8px}.capacity-label>span{display:flex;align-items:center;gap:6px}.capacity-label .icon{width:14px;height:14px;color:var(--muted);flex:none}.capacity-label>strong{font-size:13px}.license-summary progress{appearance:none;-webkit-appearance:none;height:7px;border:0;border-radius:8px;overflow:hidden;background:var(--line);accent-color:var(--good)}.license-summary progress::-webkit-progress-bar{background:var(--line);border-radius:8px}.license-summary progress::-webkit-progress-value{background:var(--good);border-radius:8px}.license-summary progress::-moz-progress-bar{background:var(--good);border-radius:8px}
.capacity-near-limit progress{accent-color:var(--warn)}.capacity-near-limit progress::-webkit-progress-value{background:var(--warn)}.capacity-near-limit progress::-moz-progress-bar{background:var(--warn)}.capacity-near-limit .capacity-label>strong{color:var(--warn)}
.capacity-exceeded progress{accent-color:var(--bad)}.capacity-exceeded progress::-webkit-progress-value{background:var(--bad)}.capacity-exceeded progress::-moz-progress-bar{background:var(--bad)}.capacity-exceeded .capacity-label>strong{color:var(--bad)}
.license-modules{gap:7px;margin:0 0 12px}.license-modules h5{display:flex;align-items:center;gap:7px;font-size:12px;margin:0 0 5px}.license-modules h5 .icon{width:15px;height:15px;color:var(--muted)}.license-modules .license-module{padding:10px 11px;background:var(--panel);border-radius:9px;gap:10px}.license-module>span:first-child{display:flex;align-items:center;gap:8px;font-size:11px;line-height:1.5}.license-module>span:first-child .icon{width:17px;height:17px;color:var(--blue);flex:none}.license-module .badge{font-size:9px;padding:4px 6px}
.license-summary>p.small{font-size:10px;line-height:1.7;margin:10px 0;color:var(--muted)}.license-summary>p.license-warning{color:var(--warn)}.license-summary .license-received{display:flex;align-items:flex-start;gap:6px;border-top:1px solid var(--line);padding-top:11px;margin:12px 0 0}.license-received .icon{width:13px;height:13px;flex:none;margin-top:2px;color:var(--muted)}
@media(max-width:520px){.site-info-line{align-items:flex-start}.license-heading{gap:8px}.license-heading h4{font-size:16px}.license-grid{gap:16px 10px}.license-grid dd{font-size:14px}.license-grid .license-field:last-child{padding:9px 10px}.license-modules .license-module{padding:10px}}
@media(max-width:340px){.license-grid{grid-template-columns:1fr}.license-grid .license-field:last-child{flex-wrap:wrap}.license-module{flex-wrap:wrap}}

/* Mensajes globales visibles en todas las pantallas, sin desplazar el contenido. */
#notice.notice-box{position:fixed;z-index:1200;top:18px;top:max(18px,env(safe-area-inset-top));right:20px;width:min(520px,calc(100vw - 40px));max-height:40vh;max-height:40dvh;overflow:auto;overscroll-behavior:contain;margin:0;box-sizing:border-box;box-shadow:0 12px 36px #0003;border-radius:12px;gap:10px;padding:15px 16px;isolation:isolate}
#notice[hidden]{display:none!important}
#notice .notice-message{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;flex:1}
#notice .notice-dismiss{display:inline-flex;align-items:center;justify-content:center;flex:0 0 30px;width:30px;height:30px;min-height:30px;margin:-3px -4px 0 0;padding:0;border:1px solid currentColor;border-radius:8px;background:transparent;color:inherit;cursor:pointer;box-shadow:none;position:sticky;top:0}
#notice .notice-dismiss svg{width:15px;height:15px;display:block;pointer-events:none}
#notice .notice-dismiss:hover{background:var(--panel)}
#notice .notice-dismiss:focus-visible{outline:2px solid currentColor;outline-offset:3px}
@media(max-width:600px){#notice.notice-box{top:10px;top:max(10px,env(safe-area-inset-top));right:12px;width:calc(100vw - 24px);max-height:36vh;max-height:36dvh;padding:12px;font-size:12px;line-height:1.55;border-radius:10px}#notice .notice-dismiss{flex-basis:32px;width:32px;height:32px;min-height:32px}}
@media print{#notice.notice-box{position:static;box-shadow:none;width:100%;max-height:none}#notice .notice-dismiss{display:none}}

/* Destinatarios de alertas: principal + hasta tres copias. */
.edit-dialog .email-copies{border:1px solid var(--line);border-radius:12px;margin:20px 0 6px;padding:14px;min-width:0}
.email-copies legend{font-size:13px;font-weight:650;color:var(--text);padding:0 5px;max-width:100%}
.email-copies>p{margin:0 0 12px;font-size:11px;line-height:1.6}
.email-copy-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;margin:12px 0;align-items:center;min-width:0}
.email-copy-row>label{grid-column:1/-1;font-size:12px;margin:0}
.email-copy-row>input{min-width:0;width:100%;box-sizing:border-box;margin:0}
.email-copy-row .remove-email-copy{padding:8px 10px;min-height:40px;font-size:11px;color:var(--bad);border-color:var(--line);align-self:stretch}
.email-copy-row>.form-error{grid-column:1/-1;margin:0;overflow-wrap:anywhere}
.email-copies-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:10px}
.email-copies-footer .add-email-copy{font-size:12px;color:var(--blue)}
.email-copies-footer .add-email-copy:disabled{opacity:.55;cursor:not-allowed}
.email-copies [hidden]{display:none!important}
@media(max-width:420px){.edit-dialog .email-copies{padding:11px}.email-copy-row{gap:6px}.email-copy-row>input{font-size:16px}.email-copy-row .remove-email-copy{padding:7px;font-size:11px}}

.personal-history{border-top:1px solid var(--line);margin-top:24px;padding-top:20px;min-width:0}
.personal-history h3{font-size:17px;margin:0 0 14px}
.personal-history .subtle{margin:0}
.personal-history-panel{border:1px solid var(--line);border-radius:11px;padding:12px 14px;margin:10px 0;background:var(--panel)}
.personal-history-panel>summary{cursor:pointer;font-size:13px;font-weight:600;line-height:1.7;overflow-wrap:anywhere}
.personal-history-panel>summary .icon{display:inline-block;width:17px;height:17px;vertical-align:middle;margin-right:7px;color:var(--blue)}
.personal-history-panel>p{font-size:11px;line-height:1.7;margin:12px 0}
.personal-history-controls{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin:14px 0}
.personal-history-controls>div{flex:1 1 140px;min-width:0}.personal-history-controls label{font-size:11px;margin:0 0 5px}
.personal-history-controls>button{flex:0 0 auto;font-size:11px}
.personal-history-list{max-height:clamp(200px,40dvh,420px);overflow:auto;overscroll-behavior:contain;padding-right:5px;min-width:0}
.personal-history-event{border-top:1px solid var(--line);padding:12px 0;overflow-wrap:anywhere}
.personal-history-event:first-child{border-top:0}.personal-history-event strong{display:flex;align-items:flex-start;gap:7px;font-size:12px;line-height:1.6}.personal-history-event strong .icon{width:16px;height:16px;flex:none;color:var(--blue);margin-top:2px}
.personal-history-event time{display:block;font-size:11px;color:var(--muted);margin:5px 0 0 23px}.personal-history-event p{font-size:11px;margin:5px 0 0 23px}
.personal-history-panel .form-actions{justify-content:space-between;gap:8px;flex-wrap:wrap}.personal-history-panel .form-actions button{font-size:11px}
@media(max-width:520px){.personal-history-panel{padding:11px}.personal-history-controls>div{flex-basis:100%}.personal-history-controls>button{width:100%}}

.row-actions .danger-action,.admin-row>.danger-action,.edit-dialog .danger-action{color:var(--bad);border-color:var(--bad);background:var(--panel)}
.danger-action:hover{background:var(--red-bg)}
.edit-dialog .delete-confirmation{border:1px solid var(--bad);border-radius:10px;background:var(--red-bg);color:var(--bad);padding:12px;font-size:12px;line-height:1.65}

/* Tutorial externo: comparte colores y adaptación del espacio de trabajo. */
#portal-nav .portal-tutorial{display:flex;align-items:center;width:100%;justify-content:flex-start;gap:9px;padding:10px 11px;min-height:42px;font-size:12px;font-weight:600;text-align:left;border:1px solid transparent;border-radius:8px;color:var(--muted);background:transparent;white-space:normal;text-decoration:none}
#portal-nav .portal-tutorial:hover{background:var(--soft);border-color:var(--line);color:var(--blue)}
#portal-nav .portal-tutorial .icon{width:17px;height:17px;flex:none}
@media(max-width:1100px){#portal-nav .portal-tutorial{font-size:11px;padding-inline:9px}}
@media(max-width:980px){#portal-nav .portal-tutorial{width:auto;flex:1 1 130px;justify-content:center;padding:9px;font-size:12px}}
@media(max-width:380px){#portal-nav .portal-tutorial{flex-basis:100px;font-size:11px}}
