
body{font-family:system-ui,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}
h1,h2,.metric,header strong{font-family:inherit;letter-spacing:-.025em}
.card,form.card{border-color:var(--line);border-radius:12px}
header:not(.shell header),.shell>aside{background:var(--navy)}
.button:not(.secondary),button.primary,nav button.active{background:var(--blue);color:var(--on-accent)}
.shell nav a.active,.shell nav a:hover{background:var(--nav-hover);color:var(--on-accent)}
.brand>b,.login-brand{background:var(--success);color:var(--on-accent)}
.shell nav p,.brand small{color:var(--nav-muted)}
:where(a,button,select,input,textarea,summary):focus-visible{outline:3px solid var(--warning);outline-offset:2px}
.card[role="status"]{background:var(--surface);color:var(--success);border-inline-start:4px solid var(--success);padding:12px 16px;font-weight:600}
#prompt{border-inline-start:4px solid var(--erp-ai)}
.sla-queue{display:inline-block;border-radius:20px;padding:4px 8px;font-size:12px;font-weight:650}.sla-queue.ok{background:var(--success-bg);color:var(--success)}.sla-queue.soon{background:var(--warning-bg);color:var(--warning)}.sla-queue.late{background:var(--danger-bg);color:var(--danger)}.sla-queue.neutral{background:var(--surface-soft);color:var(--text-muted)}.sla-detail{display:block;margin-top:4px;color:var(--text-muted);font-size:12px;white-space:nowrap}.sla-note{color:var(--text-muted);font-size:12px}.table-wrap{overflow-x:auto}.filters input{min-width:180px}

.ticket-title .status{font-weight:700}

.ticket-assignee-column{min-width:130px;overflow-wrap:anywhere}.ticket-assignee-mobile{display:none}
@media(max-width:767px){.ticket-assignee-column{display:none}.ticket-assignee-mobile{display:block;margin-top:6px;color:var(--muted);font-size:12px}}
.ticket-filters{display:grid;grid-template-columns:minmax(220px,1fr) 200px auto;align-items:center}.ticket-filters input,.ticket-filters select{min-width:0;width:100%}.search-message{padding:0 18px}.dashboard-metrics{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px}.dashboard-metrics article{padding:12px;gap:8px;min-width:0}.dashboard-metrics article>div{min-width:0}.dashboard-metrics i{width:26px;height:26px;flex-shrink:0}.dashboard-metrics strong{font-size:20px;overflow-wrap:anywhere}.dashboard-metrics small{line-height:1.4}
@media(max-width:700px){.ticket-filters{grid-template-columns:minmax(0,1fr) auto}.ticket-filters input{grid-column:1/-1}.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-metrics article{flex-direction:column}}
@media(max-width:380px){.dashboard-metrics{grid-template-columns:1fr}}
/* Tarjetas KPI: centrar el grupo completo, sin alturas fijas ni recorte. */
.dashboard-metrics article{flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:120px;padding:10px 8px;gap:5px}
.dashboard-metrics article>div{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.dashboard-metrics i{width:24px;height:24px;margin:0}
.dashboard-metrics strong{font-size:24px;font-weight:750;line-height:1.2;font-variant-numeric:tabular-nums;max-width:100%;overflow-wrap:normal;word-break:normal}
.dashboard-metrics small{max-width:100%;line-height:1.35}
@media(max-width:700px){.dashboard-metrics article{min-height:120px}.dashboard-metrics strong{font-size:22px}}

/* La ultima tarjeta de Inicio corresponde a satisfaccion. */
.dashboard-metrics article:last-child strong{font-size:16px;font-weight:650;line-height:1.25}

/* Navegacion local: iconos SVG y panel adaptable. */
.nav-icon{width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.shell nav a{display:flex;align-items:center;gap:10px;position:relative}.shell>aside{overflow-y:auto}.shell .menu{display:none;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin-right:12px;color:var(--ink);border:1px solid var(--line);border-radius:8px;background:var(--surface)}.shell header>div:first-of-type{margin-right:auto}
#sidebar-close{display:none}#sidebar-overlay[hidden]{display:none}#sidebar-overlay{position:fixed;inset:0;background:var(--overlay);border:0;z-index:9}
@media(max-width:1023px){#sidebar-close{display:block;background:transparent;border:1px solid var(--nav-muted);border-radius:8px;color:var(--on-accent);padding:10px;margin-bottom:16px}.shell>aside{max-width:85vw}}
@media(prefers-reduced-motion:reduce){.shell>aside{transition:none}}

@media(max-width:1023px){.shell .menu{display:inline-flex}.shell>aside{transform:translateX(-100%);visibility:hidden;z-index:10;max-width:85vw}.shell>aside.open{transform:translateX(0);visibility:visible}.shell>main{margin-left:0;width:100%}}
@media(min-width:1024px){.shell>aside{transform:none;visibility:visible}.shell .menu{display:none}}
/* Sidebar: scroll navigation while keeping identity and logout readable. */
.shell>aside{overflow:hidden}
.shell>aside>nav{flex:1 1 auto;min-height:0;overflow-y:auto;align-content:start}
.shell>aside>.brand,.shell>aside>.service,.shell>aside>.user-box,.shell>aside>.logout,#sidebar-close{flex-shrink:0}
.shell>aside>.service{margin-top:12px}
.shell>aside>.user-box{min-height:48px;overflow:visible}
.shell>aside>.user-box>span{min-width:0;overflow:visible;overflow-wrap:anywhere}
@media(max-height:480px){.shell>aside{overflow-y:auto}.shell>aside>nav{flex:none;overflow:visible}}
.rrhh-filters input{min-width:0}.rrhh-filters .button{flex:0 0 auto}.rrhh-filters>a{align-self:center}
.rrhh-ticket-link{display:inline-block;padding:8px 10px;border:1px solid var(--line);border-radius:7px;white-space:nowrap;font-weight:600}
#rrhh-results tr{cursor:default}#rrhh-results a:focus-visible{outline:3px solid var(--info);outline-offset:2px}
#rrhh-results tr[data-ticket-url]:not([data-ticket-url=""]){cursor:pointer}
#rrhh-search button[hidden],#ticket-search button[hidden]{display:none!important}
@media(min-width:701px){#ticket-search:has(button[hidden]){grid-template-columns:minmax(220px,1fr) 200px}}
/* Acción principal compartida: icono vectorial local, coherente con Tickets. */
.header-actions .new-ticket-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;white-space:nowrap}
.new-ticket-icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.new-ticket-button:focus-visible{outline:3px solid var(--info);outline-offset:3px}
.attachment-drop{border:2px dashed var(--success);border-radius:12px;padding:18px;background:var(--surface);transition:background .15s,border-color .15s}
.attachment-drop p{margin:0 0 10px;overflow-wrap:anywhere}
.attachment-drop.is-dragging,.attachment-drop:focus-within{border-color:var(--success);background:var(--border)}
.attachment-drop input[type=file]{max-width:100%;font:inherit}
.attachment-drop input::file-selector-button{border:1px solid var(--success);border-radius:6px;padding:8px;margin-right:10px;background:var(--surface);color:var(--success);cursor:pointer}
.attachment-drop [hidden]{display:none!important}

/* Shared account controls and footer. */
.shell > main { display:flex; flex-direction:column; }
.app-footer { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:auto; padding:24px 0 4px; color:var(--muted); font-size:12px; line-height:1.6; }
.shell > main > .app-footer { border-top:1px solid var(--line); margin-top:32px; }
.login-page { grid-template-rows:1fr auto; padding-top:28px; gap:24px; }
.login-page > .app-footer { width:min(720px,calc(100% - 32px)); justify-content:center; padding:16px 0; text-align:center; }
.shell .account-security,.shell .account-signout { display:flex; align-items:center; gap:10px; min-height:44px; padding:10px 12px; font-weight:600; text-align:left; color:var(--nav-muted); border:1px solid var(--success); transition:background .15s,border-color .15s; }
.shell .account-security { background:var(--nav-hover); }
.shell .account-signout { margin-top:8px; border-color:transparent; }
.shell .account-security::before { content:""; width:18px; height:20px; flex-shrink:0; border:2px solid currentColor; border-radius:8px 8px 10px 10px; }
.shell .account-signout::before { content:"↪"; width:18px; font-size:22px; line-height:1; }
.shell .account-security:hover,.shell .account-signout:hover { background:var(--success); border-color:var(--success); color:var(--on-accent); }
.shell .account-security:focus-visible,.shell .account-signout:focus-visible { outline:3px solid var(--success-bg); outline-offset:2px; }
@media(max-width:600px) { .app-footer { flex-direction:column; gap:4px; } }
#sidebar nav a, #sidebar .account-security, #sidebar .account-signout {
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.4;
}
.recovery-key-form {
    display: grid;
    gap: .5rem;
    width: min(100%, 25rem);
    margin-top: 1.25rem;
}
.recovery-key-form .validation-summary-valid { display: none; }
.recovery-key-form label { font-weight: 600; }
.recovery-key-form input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: .65rem .85rem;
    border: 1px solid var(--success);
    border-radius: 8px;
    font: inherit;
}
.recovery-key-form .button {
    justify-self: start;
    margin-top: .5rem;
    min-height: 44px;
}
@media (max-width: 600px) {
    .recovery-key-form .button { justify-self: stretch; }
    #sidebar nav a { min-height: 44px; }
}

.ticket-assistant { margin:20px 0; padding:20px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.ticket-assistant h2 { margin:0; font-size:18px; }
.ticket-assistant p { line-height:1.6; }
.ticket-assistant button { min-height:44px; }
.ticket-assistant button:disabled { opacity:.65; cursor:wait; }
.assistant-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:16px; }
@media(max-width:600px) { .assistant-actions button { width:100%; } }

/* UX05: consistent navigation rhythm, compact account area and subtle scrolling. */
#sidebar {padding:20px 16px 12px;gap:0}
#sidebar > .brand {margin:0 4px 20px}
#sidebar > nav {padding:2px 6px 4px 2px;scrollbar-width:thin;scrollbar-color:var(--success) transparent;overscroll-behavior:contain}
#sidebar > nav::-webkit-scrollbar {width:6px}
#sidebar > nav::-webkit-scrollbar-track {background:transparent}
#sidebar > nav::-webkit-scrollbar-thumb {background:var(--success);border-radius:8px}
#sidebar nav p {font-size:10px;font-weight:650;letter-spacing:.12em;margin:18px 12px 8px;color:var(--nav-muted)}
#sidebar nav p:first-child {margin-top:4px}
#sidebar nav a {min-height:44px;margin:2px 0;padding:10px 12px;border-radius:9px;gap:12px;color:var(--nav-muted);font-size:14px;box-sizing:border-box}
#sidebar nav a.active {background:var(--nav-hover);color:var(--on-accent);box-shadow:inset 3px 0 var(--nav-muted);font-weight:650}
#sidebar nav a:hover {background:var(--nav-hover);color:var(--on-accent)}
#sidebar nav a:focus-visible {outline:2px solid var(--nav-muted);outline-offset:-2px}
#sidebar > .service {margin-top:10px;padding:8px 10px;border:1px solid var(--success);background:var(--nav);font-size:11px;border-radius:8px}
#sidebar > .service small {color:var(--nav-muted);font-size:9px;margin-top:2px}
#sidebar > .user-box {margin-top:10px;padding:10px 4px 0;min-height:42px;border-color:var(--success)}
#sidebar > .user-box small {color:var(--nav-muted)}
#sidebar .account-security,#sidebar .account-signout {min-height:44px;margin-top:6px;padding:10px 12px;font-size:13px;border-radius:9px;background:transparent;border-color:transparent}
#sidebar .account-security:hover,#sidebar .account-signout:hover {background:var(--nav-hover)}
@media(max-height:600px){
 #sidebar {padding-top:12px}
 #sidebar > .brand {margin-bottom:10px}
 #sidebar nav p {margin-top:12px}
}
@media(max-height:480px){
 #sidebar {overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--success) transparent}
 #sidebar > nav {flex:none;overflow:visible}
}
.brand .company-brand-logo{width:40px;height:40px;object-fit:contain;flex-shrink:0;background:var(--surface);border-radius:8px}.brand>span{min-width:0;overflow-wrap:anywhere}.brand>span small{white-space:normal}
/* Company names may span multiple lines without being clipped by the sidebar. */
#sidebar > a.brand{display:flex;align-items:center;gap:10px;min-width:0;max-width:100%;height:auto;overflow:visible}
#sidebar > a.brand > span{display:block;flex:1 1 0;width:0;min-width:0;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.35;font-size:16px}
#sidebar > a.brand > span small{white-space:normal;overflow-wrap:anywhere;line-height:1.4;margin-top:4px}
#sidebar > a.brand > b,#sidebar > a.brand > img{flex:0 0 36px;width:36px;height:36px}
#sidebar>.user-box{align-items:flex-start;height:auto}#sidebar>.user-box>b{flex-shrink:0}#sidebar>.user-box>span{flex:1;white-space:normal;min-width:0}#sidebar .account-display-name{display:block;font-size:13px;line-height:1.4;font-weight:650;white-space:normal;overflow-wrap:anywhere}#sidebar>.user-box small{display:block;margin-top:3px;font-size:11px}
.module-assets .shell main .inventory-states a[aria-current="page"],.module-assets .shell main .inventory-states a:hover{background:var(--accent);color:var(--on-accent);border-color:var(--accent);font-weight:700}
.module-users main a:not(.button),.service-tile-actions>a:not(.button){color:var(--link)}
.service-description,.service-facts dt,.chart-card .bar-row>span{color:var(--text-secondary)}
.service-tile{min-width:0;overflow:visible}.service-tile .service-tile-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}
.service-tile .service-tile-actions>form{display:flex;margin:0;padding:0;flex:0 1 auto}.service-tile .service-tile-actions .module-text-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;border:1px solid var(--border);border-radius:9px;color:var(--text-muted);background:transparent;font:inherit;font-size:13px}.service-tile .service-tile-actions .module-text-button:hover{color:var(--text);background:var(--surface-soft)}

/* White-label header: bounded mark and one-line client identity. */
#sidebar>a.brand.a2core-brand{display:flex;flex-direction:row;align-items:center;gap:12px;min-height:48px;height:48px;overflow:hidden}
#sidebar>a.brand.a2core-brand>.brand-mark{display:flex;align-items:center;justify-content:center;flex:0 0 36px;width:36px;height:36px;background:var(--surface-soft);border-radius:8px;overflow:hidden}
#sidebar>a.brand.a2core-brand>.brand-mark img{display:block;width:36px;height:36px;object-fit:contain}
#sidebar>a.brand.a2core-brand>.brand-copy{display:block;flex:1 1 auto;width:auto;min-width:0;overflow:hidden;white-space:nowrap;overflow-wrap:normal}
#sidebar>a.brand.a2core-brand>.brand-copy strong,#sidebar>a.brand.a2core-brand>.brand-copy small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;line-height:1.4}
#sidebar>a.brand.a2core-brand>.brand-copy strong{font-size:14px}#sidebar>a.brand.a2core-brand>.brand-copy small{font-size:11px;margin-top:2px}
.shell.nav-compact #sidebar>a.brand.a2core-brand{justify-content:center;gap:0}
.shell.nav-compact #sidebar>a.brand.a2core-brand>.brand-copy{display:none}
.shell.nav-compact #sidebar>a.brand.a2core-brand>.brand-mark{display:flex}
.appearance-preferences{margin-bottom:24px}.appearance-preferences select{font-size:16px;min-height:44px;max-width:100%;padding:8px 12px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:8px}

/* Report KPI and distribution polish; native progress semantics preserved. */
.module-reports .metrics .report-kpi-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 40px;border-radius:10px;background:var(--success-bg);color:var(--success)}
.module-reports .metrics .report-kpi-icon.orange,.module-reports .metrics .report-kpi-icon.purple{background:var(--warning-bg);color:var(--warning)}
.report-kpi-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.report-export{display:inline-flex;align-items:center;gap:8px}.report-export svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.module-reports .report-bar{--report-fill:var(--accent);color:var(--report-fill)}
.module-reports .report-bar[data-priority=critical]{--report-fill:var(--danger)}
.module-reports .report-bar[data-priority=high]{--report-fill:var(--warning)}
.module-reports .report-bar::-webkit-progress-value{background:var(--report-fill)}
.module-reports .report-bar::-moz-progress-bar{background:var(--report-fill)}
.module-reports .report-bar[data-positive=true]::-webkit-progress-value{min-width:6px}
.module-reports .report-bar[data-positive=true]::-moz-progress-bar{min-width:6px}
.module-reports .bar-row>b,.module-reports .metrics strong{font-variant-numeric:tabular-nums}
