.rep-dashboard,.rep-admin{--accent:var(--portal-blue);--previous:var(--portal-muted);--projection:var(--portal-warning);color:var(--portal-text)}
.rep-toolbar,.rep-tabs,.rep-actions,.rep-segment{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.rep-toolbar{margin-bottom:20px;align-items:end}.rep-toolbar label,.rep-admin label{display:grid;gap:6px;min-width:0}.rep-toolbar label:has(select){flex:1;min-width:150px}.rep-toolbar select{max-width:100%;width:100%}
.rep-dashboard button,.rep-admin button,.rep-dashboard input,.rep-admin input,.rep-dashboard select,.rep-admin select{font:inherit;font-size:16px;min-height:44px;padding:10px 12px;border:1px solid var(--portal-border);border-radius:8px;color:var(--portal-text);background:var(--portal-input-bg,var(--portal-surface))}
.rep-dashboard button,.rep-admin button{cursor:pointer}.rep-dashboard button:focus-visible,.rep-admin button:focus-visible,.rep-dashboard input:focus-visible,.rep-admin input:focus-visible,.rep-dashboard select:focus-visible{outline:3px solid var(--portal-blue);outline-offset:3px}
.rep-tabs{gap:4px;border-bottom:1px solid var(--portal-border);margin-bottom:24px}.rep-tabs button{flex:1;border:0;border-radius:0;background:transparent;border-bottom:3px solid transparent;font-weight:600}.rep-tabs button[aria-selected=true]{color:var(--portal-blue);border-bottom-color:var(--portal-blue)}
.rep-card{background:var(--portal-surface);border:1px solid var(--portal-border);border-radius:10px;padding:20px;margin-bottom:20px;min-width:0}.rep-card h2{font-size:18px;margin:0 0 16px;font-weight:600}.rep-card h3{font-size:16px;margin:0 0 12px}.rep-card p,.rep-muted{color:var(--portal-muted)}
.rep-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:16px}.rep-kpi{min-width:0;padding:8px 0}.rep-kpi span{display:block;color:var(--portal-muted);font-size:13px;line-height:1.5}.rep-kpi strong{display:block;font-size:clamp(19px,2vw,27px);font-weight:650;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;margin:4px 0}
.rep-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.rep-grid>.rep-card{margin-bottom:0}.rep-panel[hidden],.rep-dashboard [hidden],.rep-admin [hidden]{display:none!important}
.rep-table{overflow:auto;max-width:100%;max-height:580px;border:1px solid var(--portal-border);border-radius:8px}.rep-table table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}.rep-table th,.rep-table td{padding:12px;text-align:right;border-bottom:1px solid var(--portal-border);background:var(--portal-surface);white-space:nowrap}.rep-table th{position:sticky;top:0;z-index:2;background:var(--portal-surface-soft)}.rep-table th:first-child,.rep-table td:first-child{text-align:left;white-space:normal;min-width:160px;max-width:300px}.rep-table th button{font-size:13px;padding:4px;min-height:44px;background:transparent;border:0}.rep-table .rep-name{color:var(--portal-blue);text-align:left;white-space:normal;max-width:300px;font-size:14px;border:0;background:transparent}.rep-table small{display:block;color:var(--portal-muted);margin-top:4px}.rep-table tr[aria-selected=true] td{background:var(--portal-surface-soft)}
.rep-positive{color:var(--portal-success)!important}.rep-negative{color:var(--portal-danger)!important}.rep-segment button[aria-pressed=true]{border-color:var(--portal-blue);color:var(--portal-blue);font-weight:600}.rep-segment{margin-bottom:16px}.rep-search{flex:1;min-width:130px;max-width:400px}.rep-chart svg{display:block;width:100%;height:auto;min-height:190px}.rep-chart text{fill:var(--portal-muted);font-size:12px}.rep-chart .grid{stroke:var(--portal-border)}.rep-chart [role=button]{cursor:pointer;outline:none}.rep-chart [role=button]:focus rect{stroke:var(--portal-text);stroke-width:2}.rep-chart-tip{min-height:42px;font-size:13px;margin:8px 0!important;color:var(--portal-text)!important}.rep-legend{display:flex;gap:16px;flex-wrap:wrap;font-size:13px;color:var(--portal-muted);margin:12px 0}.rep-legend i{display:inline-block;width:12px;height:12px;margin-right:5px;background:var(--accent)}.rep-legend .prev{background:var(--previous)}.rep-legend .projection{background:var(--projection)}
.rep-progress{height:10px;background:var(--portal-surface-soft);border-radius:8px;overflow:hidden;margin-top:16px}.rep-progress span{display:block;height:100%;background:var(--portal-blue)}.rep-status{min-height:24px;margin:12px 0;color:var(--portal-muted);font-size:13px}.rep-identity{margin:0 0 16px;color:var(--portal-muted);overflow-wrap:anywhere}.rep-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.rep-form .full{grid-column:1/-1}.rep-admin pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}.rep-admin input[type=checkbox]{min-height:24px;width:24px;vertical-align:middle}.rep-scope-choice{display:flex!important;align-items:center;gap:10px;padding:8px 0}.rep-admin .primary{background:var(--portal-blue);color:white}.rep-login{max-width:480px!important;margin:10vh auto;padding:24px}.rep-login a{display:block;min-height:44px;padding:12px;background:var(--portal-blue);color:#fff;border-radius:8px;text-decoration:none;text-align:center}
@media(max-width:768px){.rep-grid{grid-template-columns:1fr}.rep-card{padding:16px}.rep-tabs{margin-bottom:16px}.rep-tabs button{font-size:14px;padding:10px 6px}.rep-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.rep-form{grid-template-columns:1fr}.rep-chart svg{min-height:170px}.rep-toolbar{gap:10px}.rep-toolbar input{max-width:100%}.rep-card h2{font-size:17px}}
@media(max-width:375px){.rep-kpi strong{font-size:18px}.rep-tabs button{font-size:13px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.rep-chart{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}.rep-chart svg{min-width:600px;min-height:0}

/* Preserve the source dashboard's bordered metric matrix within Portal tokens. */
html .rep-dashboard{--accent:var(--portal-blue);font-variant-numeric:tabular-nums;max-width:1280px}
html .rep-dashboard .rep-card{display:flex;flex-direction:column;gap:14px;padding:18px 20px;margin-bottom:16px}
html .rep-dashboard .rep-card h2{font-size:16px;font-weight:600;line-height:1.4;margin:0}
html .rep-dashboard .rep-sub{font-size:12.5px;line-height:1.5;color:var(--portal-muted);margin:-8px 0 0}
html .rep-dashboard .rep-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:0;border:1px solid var(--portal-border);border-radius:8px;overflow:hidden}
html .rep-dashboard .rep-kpi{padding:12px 14px;display:flex;flex-direction:column;gap:4px;min-width:0;border-right:1px solid var(--portal-border);border-bottom:1px solid var(--portal-border);margin:0 -1px -1px 0}
html .rep-dashboard .rep-kpi .rep-kpi-label{font-size:11px;line-height:1.4;letter-spacing:.035em;text-transform:uppercase;font-weight:500;color:var(--portal-muted)}
html .rep-dashboard .rep-kpi strong{font-size:21px;font-weight:650;line-height:1.35;white-space:nowrap;overflow-wrap:normal;word-break:normal;margin:0}
html .rep-dashboard .rep-kpi .rep-kpi-note{font-size:12px;line-height:1.4;color:var(--portal-muted)}
html .rep-dashboard .rep-accent{color:var(--portal-blue)!important}
html .rep-dashboard .rep-warning{color:var(--portal-warning)!important}
html .rep-dashboard .rep-tabs{display:grid;grid-template-columns:1fr 1.5fr 1fr;gap:0;margin-bottom:16px;padding:0;align-items:stretch;border-bottom:1px solid var(--portal-border)}
html .rep-dashboard .rep-tabs button{background:transparent!important;border:0;border-bottom:3px solid transparent;border-radius:0;box-shadow:none;color:var(--portal-muted);min-height:48px;font-size:14px;line-height:1.3;padding:10px 8px;white-space:normal}
html .rep-dashboard .rep-tabs button[aria-selected=true]{color:var(--portal-blue)!important;border-bottom-color:var(--portal-blue)}
html .rep-dashboard .rep-tabs button:hover{background:var(--portal-surface-soft)!important}
html .rep-dashboard .rep-grid{gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(100%,480px),1fr))}
html .rep-dashboard .rep-detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr));gap:16px}
html .rep-dashboard .rep-detail-grid>*{min-width:0}
html .rep-dashboard .rep-chart{overflow:visible;min-width:0}
html .rep-dashboard .rep-chart-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
html .rep-dashboard .rep-chart svg{min-width:600px}
html .rep-dashboard .rep-chart-tip{margin:10px 0 0!important;font-size:12px;line-height:1.5;min-height:18px}
html .rep-dashboard .rep-legend{margin:0;gap:8px 16px;font-size:12px}
html .rep-dashboard .rep-legend>span{display:inline-flex;align-items:center}
html .rep-dashboard .rep-legend .projection{height:3px}
html .rep-dashboard .rep-progress{display:flex;height:10px;margin:0}
html .rep-dashboard .rep-progress span{flex:none}
html .rep-dashboard .released{background:color-mix(in srgb,var(--portal-blue) 45%,var(--portal-surface))!important}
html .rep-dashboard .remaining{background:var(--portal-surface-soft)!important;border:1px solid var(--portal-border)}
html .rep-dashboard .rep-switch{display:inline-flex;max-width:100%;border:1px solid var(--portal-border);border-radius:8px;overflow:hidden}
html .rep-dashboard .rep-switch button{min-height:44px;font-size:13px;padding:8px 12px;line-height:1.3;border:0;border-radius:0;box-shadow:none;background:var(--portal-surface);color:var(--portal-muted)}
html .rep-dashboard .rep-switch button+button{border-left:1px solid var(--portal-border)}
html .rep-dashboard .rep-switch button[aria-pressed=true]{background:var(--portal-blue)!important;color:#fff!important}
html .rep-dashboard .rep-segment{gap:10px;margin:0}
html .rep-dashboard .rep-search{font-size:16px;width:260px;min-width:120px;max-width:100%}
html .rep-dashboard .rep-hint{margin:0;color:var(--portal-muted);font-size:12px;line-height:1.5}
html .rep-dashboard .rep-status:empty{display:none}
html .rep-dashboard #updated{margin:0 0 12px;min-height:0;font-size:12px}
html .rep-dashboard .rep-toolbar{margin-bottom:12px}
html .rep-dashboard .rep-table{position:relative;isolation:isolate;scrollbar-width:thin}
html .rep-dashboard .rep-table td,html .rep-dashboard .rep-table th{padding:10px 12px}
html .rep-dashboard .rep-table td:first-child,html .rep-dashboard .rep-table th:first-child{position:sticky;left:0;min-width:180px;max-width:280px;z-index:1}
html .rep-dashboard .rep-table th:first-child{z-index:3}
html .rep-dashboard .rep-table .rep-name{background:transparent!important;box-shadow:none;min-height:44px;padding:4px 0}
html .rep-dashboard .rep-table th button{background:transparent!important;box-shadow:none;color:var(--portal-text)}
html .rep-dashboard .rep-table tfoot td{position:sticky;bottom:0;background:var(--portal-surface-soft);font-weight:600;z-index:2}
html .rep-dashboard .rep-table tfoot td:first-child{z-index:3}
html .rep-dashboard .rep-table tr[aria-selected=true] td:first-child{box-shadow:inset 3px 0 var(--portal-blue)}
html .rep-dashboard .rep-badge:before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:currentColor;margin-right:6px}
@media(max-width:600px){
 html body .page-container.rep-dashboard{padding-left:12px;padding-right:12px;width:100%;max-width:100%;box-sizing:border-box}
 html .rep-dashboard .portal-page-heading{margin-bottom:10px}
 html .rep-dashboard .portal-page-heading h1{font-size:22px;line-height:1.3}
 html .rep-dashboard .rep-identity{font-size:12px;line-height:1.5;margin-bottom:8px}
 html .rep-dashboard .rep-card{padding:14px 12px;gap:12px}
 html .rep-dashboard .rep-card h2{font-size:15px}
 html .rep-dashboard .rep-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 html .rep-dashboard .rep-kpi{padding:11px 10px}
 html .rep-dashboard .rep-kpi strong{font-size:18px;letter-spacing:-.015em}
 html .rep-dashboard .rep-kpi .rep-kpi-label{font-size:10px;letter-spacing:.025em}
 html .rep-dashboard .rep-kpi .rep-kpi-note{font-size:11px}
 html .rep-dashboard .rep-kpi-wide{grid-column:1/-1}
 html .rep-dashboard .rep-tabs button{font-size:13px;padding:8px 4px}
 html .rep-dashboard .rep-sub{font-size:12px;margin-top:-6px}
 html .rep-dashboard .rep-switch button{padding:8px 10px}
 html .rep-dashboard .rep-table td:first-child,html .rep-dashboard .rep-table th:first-child{min-width:145px;max-width:170px}
 html .rep-dashboard .rep-table td,html .rep-dashboard .rep-table th{padding:9px 10px}
 html .rep-dashboard .rep-search{flex-basis:100%;width:100%;max-width:100%}
}
@media(max-width:375px){html .rep-dashboard .rep-kpi strong{font-size:16px}html .rep-dashboard .rep-tabs button{font-size:12px}}
@media(min-width:601px) and (max-width:900px){html .rep-dashboard .rep-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Local component rules take precedence over Portal's generic dark buttons. */
html[data-portal-theme] .rep-dashboard .rep-positive{color:var(--portal-success)!important}
html[data-portal-theme] .rep-dashboard .rep-negative{color:var(--portal-danger)!important}
html[data-portal-theme] .rep-dashboard #tabs button{background:transparent!important;border-bottom-color:transparent!important;color:var(--portal-muted)!important}
html[data-portal-theme] .rep-dashboard #tabs button[aria-selected=true]{color:var(--portal-blue)!important;border-bottom-color:var(--portal-blue)!important}
html[data-portal-theme] .rep-dashboard .rep-segment .rep-switch button{background:var(--portal-surface)!important;color:var(--portal-muted)!important}
html[data-portal-theme] .rep-dashboard .rep-segment .rep-switch button[aria-pressed=true]{background:var(--portal-blue)!important;color:#fff!important}
html[data-portal-theme] .rep-dashboard .rep-table button.rep-name,html[data-portal-theme] .rep-dashboard .rep-table th button{background:transparent!important}
@media(max-width:600px){
 html body.portal-unified-header-shell>main.page-container.rep-dashboard{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;padding-left:12px!important;padding-right:12px!important}
}

/* Representative dashboard usability, 2026-09-30. */
html[data-portal-theme] .rep-dashboard .rep-table th .rep-sort-button{position:relative;display:block;width:100%;border:0!important;border-radius:0;font:inherit!important;text-align:inherit;line-height:inherit;box-shadow:none!important;background:transparent!important}
html[data-portal-theme] .rep-dashboard .rep-table th .rep-sort-button:not([data-sort-table=groups]){min-height:0!important;padding:0!important}
.rep-sort-arrow{position:absolute;right:-8px;top:0;font-size:10px;pointer-events:none}
html[data-portal-theme] .rep-dashboard .rep-table td:first-child{background:var(--portal-surface)!important;overflow-wrap:anywhere}
html[data-portal-theme] .rep-dashboard .rep-table th:first-child,html[data-portal-theme] .rep-dashboard .rep-table tfoot td{background:var(--portal-surface-soft)!important}
html[data-portal-theme] .rep-dashboard .rep-table tr[aria-selected=true] td:first-child{background:var(--portal-surface-soft)!important}
html[data-portal-theme] .rep-dashboard .rep-table .rep-name{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.rep-picker{position:relative;flex:1;min-width:200px;display:grid;gap:6px}.rep-picker input{width:100%;box-sizing:border-box}
.rep-picker-options{position:absolute;z-index:20;top:100%;left:0;right:0;max-height:320px;overflow:auto;margin-top:4px;padding:4px;border:1px solid var(--portal-border);border-radius:8px;background:var(--portal-surface);box-shadow:var(--portal-shadow)}
.rep-picker-options [role=option]{cursor:pointer;min-height:44px;padding:10px 12px;display:flex;align-items:center;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.rep-picker-options [role=option]:hover,.rep-picker-options [aria-selected=true]{background:var(--portal-surface-soft);box-shadow:inset 3px 0 var(--portal-blue)}
.rep-picker-options p{margin:12px;color:var(--portal-muted)}
.rep-mobile-controls,.rep-mobile-list{display:none}
html[data-portal-context=representantes] .topbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}
html[data-portal-context=representantes] .portal-theme-toggle{width:44px;min-width:44px;height:44px;min-height:44px}
.rep-admin #external-link{width:100%;box-sizing:border-box}
@media(max-width:600px){
 .rep-picker{flex-basis:100%;min-width:0}
 html .rep-dashboard .rep-mobile-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:0}
 html .rep-dashboard .rep-mobile-controls .rep-switch{grid-column:1/-1;display:flex}
 html .rep-dashboard .rep-mobile-controls .rep-switch button{flex:1;min-height:44px}
 html[data-portal-theme] .rep-dashboard .rep-mobile-controls .rep-switch button[aria-pressed=true]{background:var(--portal-blue)!important;color:#fff!important}
 html .rep-dashboard .rep-mobile-controls select,html .rep-dashboard .rep-mobile-controls>button{font-size:13px;min-width:0;max-width:100%;padding:8px}
 html .rep-dashboard .rep-mobile-controls>button:disabled{opacity:.6}
 html .rep-dashboard .rep-adaptive-table[data-mobile-view=list]{display:none}
 html .rep-dashboard .rep-mobile-list[data-mobile-view=list]{display:grid;gap:8px}
 html .rep-dashboard .rep-mobile-list[data-mobile-view=table]{display:none}
 html .rep-dashboard .rep-mobile-row{min-width:0;border:1px solid var(--portal-border);border-radius:8px;background:var(--portal-surface);overflow:hidden}
 html .rep-dashboard .rep-mobile-row summary{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;list-style:none;min-height:44px;padding:12px 26px 12px 12px;cursor:pointer;font-size:13px;line-height:1.45}
 html .rep-dashboard .rep-mobile-row summary::-webkit-details-marker{display:none}
 html .rep-dashboard .rep-mobile-row summary:after{content:'+';position:absolute;right:10px;top:12px;font-size:16px;color:var(--portal-muted)}
 html .rep-dashboard .rep-mobile-row[open] summary:after{content:'−'}
 html .rep-dashboard .rep-mobile-row summary:focus-visible{outline:3px solid var(--portal-blue);outline-offset:-3px}
 html .rep-dashboard .rep-mobile-name{font-weight:600;min-width:0;overflow-wrap:anywhere}
 html .rep-dashboard .rep-mobile-name small{display:block;font-size:11px;color:var(--portal-muted);font-weight:400;margin-top:3px}
 html .rep-dashboard .rep-mobile-value{font-weight:600;white-space:nowrap;color:var(--portal-blue);font-variant-numeric:tabular-nums}
 html .rep-dashboard .rep-mobile-row dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:0;border-top:1px solid var(--portal-border);gap:0}
 html .rep-dashboard .rep-mobile-row dl>div{padding:10px 12px;min-width:0;border-bottom:1px solid var(--portal-border)}
 html .rep-dashboard .rep-mobile-row dl>div:nth-child(odd){border-right:1px solid var(--portal-border)}
 html .rep-dashboard .rep-mobile-row dt{font-size:11px;color:var(--portal-muted);margin-bottom:4px}
 html .rep-dashboard .rep-mobile-row dd{font-size:13px;margin:0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
 html .rep-dashboard .rep-mobile-row>button{margin:10px 12px;min-height:44px;font-size:13px}
 html .rep-dashboard .rep-adaptive-table[data-mobile-view=table]{display:block;max-height:none;overflow-x:auto;-webkit-overflow-scrolling:touch}
 html .rep-dashboard .rep-adaptive-table table{min-width:680px}
 html .rep-dashboard .rep-adaptive-table td:first-child,html .rep-dashboard .rep-adaptive-table th:first-child{min-width:130px;max-width:150px;width:150px;box-sizing:border-box}
 html .rep-dashboard .rep-adaptive-table tfoot td{position:static}
 html .rep-dashboard .rep-adaptive-table tfoot td:first-child{position:sticky;left:0}
}

/* Local states must remain visible over generic dark-theme button rules. */
html[data-portal-theme] #dashboard-content .rep-switch button[aria-pressed=true]{background:var(--portal-blue)!important;color:#fff!important}
html[data-portal-theme] #dashboard-content .rep-table th .rep-sort-button,html[data-portal-theme] #dashboard-content .rep-table button.rep-name{background:transparent!important;box-shadow:none!important}

/* Match the base padding of the Portal Home logout component. */
html[data-portal-context=representantes] .btn-sair{padding:8px 16px;cursor:pointer}

/* External Home uses the Portal greeting component; identity is not repeated in the dashboard. */
html[data-portal-context=representantes][data-rep-page=home] .portal-appbar .topbar-user:not([hidden]){display:block!important;font-size:14px;max-width:min(38vw,480px);white-space:normal;overflow-wrap:anywhere;text-align:right}
html[data-portal-context=representantes][data-rep-page=home] #rep-user-name{font-weight:500}
@media(max-width:600px){
 html[data-portal-context=representantes][data-rep-page=home] .portal-appbar .topbar-right{grid-column:1/-1;width:100%!important;flex-wrap:nowrap!important}
 html[data-portal-context=representantes][data-rep-page=home] .portal-appbar .topbar-user:not([hidden]){flex:1;min-width:0;max-width:none;font-size:12px;text-align:left}
}
