/* Referência visual: docs/ux/telas. Componentes Microsoft Fluent UI Blazor. */
:root { --brand:#0f6cbd; --brand-hover:#115ea3; --surface:#fff; --page:#f5f5f5; --text:#242424; --muted:#616161; --border:#e0e0e0; }
* { box-sizing:border-box; }
html,body { margin:0; min-height:100%; font-family:"Segoe UI","Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif; font-size:14px; color:var(--text); background:var(--page); }
a { color:var(--brand); text-underline-offset:3px; }
a:hover { color:var(--brand-hover); }
:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
h1[tabindex="-1"]:focus { outline:none; }
h1 { font-size:28px; font-weight:600; margin:0 0 4px; line-height:1.25; }
h2 { font-size:18px; font-weight:600; margin:24px 0 12px; }
h3 { font-size:15px; font-weight:600; margin:0; }
p { line-height:1.45; }
.muted,.page-description,.page-heading p { color:var(--muted); }
.eyebrow { font-size:12px; font-weight:600; letter-spacing:.06em; color:var(--muted); margin:0 0 10px; }
.app-shell { min-height:100dvh; display:flex; flex-direction:column; }
.app-header { color:white; }
.header-content { display:flex; flex-wrap:wrap; align-items:center; gap:12px; width:100%; min-height:48px; font-weight:400; }
.brand { display:flex; align-items:center; gap:12px; color:white; font-size:16px; font-weight:600; text-decoration:none; min-height:44px; }
.brand:hover,.user-menu a:hover { color:white; }
.environment-badge { color:white; background:#ffffff2e; border-radius:4px; padding:2px 8px; font-size:12px; }
.user-menu { display:flex; gap:12px; align-items:center; margin-left:auto; min-width:0; font-size:14px; }
.user-menu a { min-height:44px; display:inline-flex; align-items:center; color:white; }
.user-name { overflow-wrap:anywhere; font-weight:400; }
.app-body { display:flex; flex:1; min-width:0; }
.sidebar { flex:0 0 248px; min-width:0; background:var(--surface); border-right:1px solid var(--border); padding:12px 8px; display:flex; flex-direction:column; }
.nav-content { flex:1; }
.menu-version { padding:16px 12px 4px; margin-top:auto; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.menu-toggle { display:none; }
.sidebar .fluent-nav-menu { padding:0; }
.sidebar .fluent-nav-menu .fluent-nav-item { margin:0; }
.sidebar .fluent-nav-menu .fluent-nav-link { min-height:44px; line-height:1.4; }
.sidebar .fluent-nav-menu .fluent-nav-text { width:auto; flex:1; margin:0; padding:7px 12px; white-space:normal; overflow:visible; text-overflow:clip; }
.sidebar .fluent-nav-menu .content-region { min-width:0; margin:0; white-space:normal; }
.sidebar .fluent-nav-menu .fluent-nav-item .positioning-region { min-height:44px; background:transparent; border:0; border-radius:4px; }
.sidebar .fluent-nav-menu .fluent-nav-group .fluent-nav-item .content-region { padding-inline-start:28px; }
.sidebar .fluent-nav-menu span.fluent-nav-icon { display:none; }
.sidebar .fluent-nav-menu svg.fluent-nav-icon { margin-left:12px; }
.sidebar .fluent-nav-menu .active .positioning-region { background:#ebf3fc; color:var(--brand); font-weight:600; }
.sidebar .fluent-nav-menu .active .positioning-region::before { display:none; }
.sidebar .nav-section > .fluent-nav-link { min-height:32px; color:var(--muted); font-size:12px; font-weight:600; margin-top:8px; }
.sidebar .nav-section > .fluent-nav-link .positioning-region { min-height:32px; }
.sidebar .nav-section > .fluent-nav-link .expand-collapse-button { display:none; }
.page-content { flex:1; min-width:0; padding:28px 32px 40px; max-width:1800px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:24px; }
.page-heading p { margin:0; }
.toolbar,.related-links { display:flex; gap:12px; flex-wrap:wrap; }
.related-links { margin:16px 0; }
.summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
fluent-card,.fluent-card { background:white; border-radius:8px; box-shadow:0 1px 2px #0000001f,0 0 2px #00000014; }
.summary-card { display:flex; flex-direction:column; gap:8px; padding:16px; width:100%; height:100%; min-width:0; overflow-wrap:anywhere; }
.summary-card>span { font-size:12px; color:var(--muted); font-weight:600; }
.summary-card strong { font-size:20px; font-weight:600; }
.summary-card small { font-size:13px; line-height:1.3; color:var(--muted); }
.api-online { display:flex; gap:6px; align-items:center; color:#0e700e; }
.surface { border-radius:8px; background:white; box-shadow:0 1px 2px #0000001f,0 0 2px #00000014; min-width:0; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 20px; border-bottom:1px solid var(--border); }
.section-heading h2,.home-shortcuts h2 { margin:0; font-size:16px; }
.home-shortcuts { margin-top:24px; }
.shortcut-buttons { display:flex; gap:12px; flex-wrap:wrap; margin-top:12px; }
.compact-action { max-width:100%; }
.report-heading { margin-bottom:28px; }
.report-heading h1 { margin:4px 0; }
.report-heading p { margin:0; color:var(--muted); }
.breadcrumb { font-size:13px; color:var(--muted); }
.report-section { display:flex; flex-direction:column; gap:12px; margin-bottom:28px; }
.report-section h2 { margin:0; }
.section-description { margin:2px 0 0; color:var(--muted); font-size:13px; }
/* auto-fill preserva as colunas vazias: um único relatório não vira um painel de largura inteira. */
.card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr)); gap:16px; margin:16px 0 24px; align-items:start; }
.card-grid > .report-card { max-width:360px; }
.download-grid > .report-card,.send-grid > .report-card { max-width:none; }
.report-section .card-grid { margin:0; }
.download-grid { grid-template-columns:repeat(4,minmax(0,1fr)); max-width:1280px; }
.send-grid { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:960px; }
.report-card { display:flex; flex-direction:column; align-items:stretch; padding:16px; gap:12px; width:100%; height:100%; min-width:0; }
.report-description { display:flex; flex-direction:column; gap:4px; flex:1; }
.report-card-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.report-help-button { flex:none; }
.report-help-button::part(control) { min-width:40px; min-height:40px; padding:0; font-weight:600; }
.report-description p { font-size:13px; line-height:1.3; color:var(--muted); margin:0; }
.report-description .last-send { margin-top:4px; }
.report-card .report-button { align-self:flex-start; }
.download-card .report-button { align-self:stretch; width:100%; margin-top:auto; }
.send-card { border-top:3px solid var(--brand); }
.test-card { border-top:3px solid #d1d1d1; }
.report-button::part(control) { font-size:14px; font-weight:600; border-radius:4px; }
.report-button::part(content) { display:flex; align-items:center; gap:8px; }
.report-button.accent::part(control) { background:var(--brand); color:white; }
.report-button.accent:hover::part(control) { background:var(--brand-hover); }
.report-button.accent svg { fill:white!important; }
.action-result { overflow-wrap:anywhere; font-size:13px; margin-top:4px; }
.send-section { border-top:1px solid var(--border); padding-top:8px; }
.table-scroll { width:100%; max-width:100%; overflow-x:auto; }
.table-scroll .fluent-data-grid { width:100%; }
.table-scroll .fluent-data-grid td { padding:12px 20px; white-space:normal; overflow-wrap:anywhere; align-content:start; }
.table-scroll .fluent-data-grid .col-title { padding:10px 20px; color:var(--muted); font-size:12px; }
.table-scroll .fluent-data-grid .col-title-text { white-space:normal; overflow:visible; text-overflow:clip; }
pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:16rem; overflow:auto; }
.tab-content { padding:16px 20px; min-width:0; }
.tab-content h2:first-child { margin-top:0; }
.diagnostic-tabs .fluent-tabs { max-width:100%; }
.diagnostic-tabs [role="tablist"] { overflow-x:auto; max-width:100%; }
.client-form { display:flex; flex-wrap:wrap; gap:16px; align-items:end; margin-bottom:20px; }
.badge-success,.badge-warning,.badge-neutral,.badge-error { border-radius:4px; padding:2px 8px; font-size:12px; font-weight:600; }
.badge-success { color:#0e700e!important; background:#f1faf1!important; border:1px solid #9fd89f; }
.badge-error { color:#b10e1c!important; background:#fdf3f4!important; border:1px solid #eeacb2; }
.badge-warning { color:#8a3707!important; background:#fff9f5!important; border:1px solid #fdcfb4; }
.badge-neutral { color:#424242!important; background:#f5f5f5!important; border:1px solid #d1d1d1; }
.fluent-messagebar[animation] { animation:none!important; }
.fluent-messagebar .fluent-messagebar-message { color:var(--text); font-size:14px; line-height:20px; }
.fluent-messagebar.intent-warning { background:#fff9f5; border:1px solid #fdcfb4; }
/* O <fluent-button> tem 32px de altura própria; só aumentar o desenho (part control) fazia o botão vazar 12px para fora
   do elemento e encostar na borda do card. O elemento cresce junto com o desenho: 40px, como na proposta (docs/ux). */
fluent-button { height:auto; }
fluent-button::part(control) { min-height:40px; }
fluent-text-field::part(control),fluent-select::part(control),fluent-number-field::part(control) { min-height:44px; }
fluent-dialog::part(overlay) { background:rgba(0,0,0,.4); }
fluent-dialog::part(control) { max-width:calc(100vw - 32px); border-radius:8px; background:white; }
.fluent-dialog-header h2 { font-size:20px; }
.confirmation-details { margin:0; padding-left:20px; line-height:22px; color:#424242; }
.auth-page { min-height:100dvh; display:grid; place-items:center; padding:40px 16px; }
.auth-card { width:100%; max-width:400px; padding:32px; background:white; border-radius:8px; box-shadow:0 8px 16px #00000024,0 0 2px #0000001f; }
.auth-brand { display:flex; align-items:center; gap:10px; color:var(--text); font-size:16px; font-weight:600; text-decoration:none; margin-bottom:20px; }
.auth-card h1 { font-size:24px; margin:0; }
.auth-card>p { margin:4px 0 20px; color:var(--muted); }
.auth-card .eyebrow { display:none; }
.auth-card form { display:flex; flex-direction:column; gap:16px; }
.auth-fields { margin-top:20px; }
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-weight:600; }
.auth-input { width:100%; min-height:44px; padding:0 12px; border:1px solid #d1d1d1; border-bottom-color:#616161; border-radius:4px; font:inherit; color:var(--text); background:white; }
.auth-input:focus { border-bottom:2px solid var(--brand); }
.primary-button,.primary-link { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:0 16px; border:1px solid var(--brand); border-radius:4px; background:var(--brand); color:white; font:inherit; font-weight:600; text-decoration:none; cursor:pointer; }
.primary-button:hover,.primary-link:hover { background:var(--brand-hover); color:white; }
.auth-error { padding:10px 12px; border-radius:4px; background:#fdf3f4; border:1px solid #eeacb2; color:#b10e1c; margin:16px 0; }
.validation-message,.validation-errors { color:#b10e1c; }
.invalid { outline:1px solid #b10e1c; }
.skip-link { position:absolute; left:12px; top:-100px; padding:12px; background:white; z-index:2000; }
.skip-link:focus { top:8px; }
#blazor-error-ui { display:none; position:fixed; inset:auto 0 0; padding:16px; background:#fff9f5; z-index:2000; }
#blazor-error-ui .dismiss { float:right; cursor:pointer; }
#components-reconnect-modal { display:none; position:fixed; inset:0; background:#0008; z-index:2100; place-items:center; padding:16px; }
#components-reconnect-modal.components-reconnect-show,#components-reconnect-modal.components-reconnect-failed,#components-reconnect-modal.components-reconnect-rejected { display:grid; }
.reconnect-panel { padding:24px; max-width:440px; background:white; border-radius:8px; }
.reconnect-panel p { display:none; }
.components-reconnect-show .reconnecting,.components-reconnect-failed .reconnect-failed,.components-reconnect-rejected .reconnect-rejected { display:block; }
@media(max-width:1100px) { .summary-grid,.download-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .page-content { padding:24px; } }
@media(max-width:760px) { .app-body { flex-direction:column; } .sidebar { flex-basis:auto; border-right:0; border-bottom:1px solid var(--border); } .menu-toggle { display:inline-flex; align-self:flex-start; } .nav-content { display:none; } .nav-content.open { display:block; } .menu-version { padding:8px 12px; } .page-content { padding:20px 16px 32px; } .header-content { gap:8px; padding:4px 0; } .user-menu { width:100%; margin:0; justify-content:space-between; } .tab-content { padding:16px 8px; } .download-grid,.send-grid { grid-template-columns:1fr; } h1 { font-size:24px; } }
@media(max-width:420px) { .summary-grid { grid-template-columns:1fr; } .auth-card { padding:24px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; } }

/* Ajustes nos elementos internos do Fluent para corresponder às medidas do protótipo. */
.app-shell .app-header .header-gutters { margin:0; }
.page-content fluent-card.summary-card,.page-content fluent-card.report-card { padding:16px; }
.report-button::part(control) { padding:0 16px; }
fluent-badge.badge-success::part(control),fluent-badge.badge-error::part(control),fluent-badge.badge-warning::part(control),fluent-badge.badge-neutral::part(control),fluent-badge.environment-badge::part(control) { border-radius:4px; }
fluent-badge.badge-success,fluent-badge.badge-error,fluent-badge.badge-warning,fluent-badge.badge-neutral,fluent-badge.environment-badge { padding:0; }
fluent-badge.badge-success::part(control),fluent-badge.badge-error::part(control),fluent-badge.badge-warning::part(control),fluent-badge.badge-neutral::part(control) { padding:2px 8px; }
fluent-badge.environment-badge::part(control) { padding:2px 8px; }
.confirmation-title { margin:0 0 16px; font-size:20px; font-weight:600; }
.confirmation-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
body .position-topright { top:64px; }
body .fluent-toast { width:360px; max-width:calc(100vw - 48px); border-radius:8px; }
.app-shell .app-header.header .header-gutters { margin:0; }
fluent-badge.badge-success::part(control) { background:#f1faf1; color:#0e700e; }
fluent-badge.badge-error::part(control) { background:#fdf3f4; color:#b10e1c; }
fluent-badge.badge-warning::part(control) { background:#fff9f5; color:#8a3707; }
fluent-badge.badge-neutral::part(control) { background:#f5f5f5; color:#424242; }
fluent-badge.environment-badge::part(control) { background:rgba(255,255,255,.18); color:white; }
fluent-dialog:has(.confirmation-title) .fluent-dialog-header { display:none; }
fluent-dialog:has(.confirmation-title) .fluent-dialog-footer:empty { display:none; }
body .position-topright { top:64px!important; }
h2,h3 { line-height:1.2; }
.report-heading p,.page-heading p,.breadcrumb { line-height:1.2; }
.report-button.outline::part(control) { background:white; }
.sidebar .fluent-nav-menu .active .positioning-region { background:#ebf3fc!important; }

/* Aviso enquanto a interface conecta (App.razor); some quando o layout é renderizado */
.carregando-inicial { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; gap:12px; color:var(--muted); font-size:14px; background:var(--page); z-index:1; }
.carregando-inicial-anel { width:20px; height:20px; border:2px solid #d1d1d1; border-top-color:var(--brand); border-radius:50%; animation:carregando-giro 0.8s linear infinite; }
body:has(.app-shell) .carregando-inicial { display:none; }
@keyframes carregando-giro { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .carregando-inicial-anel { animation:none; } }

/* Progresso operacional: percentual pertence somente à etapa mensurável. */
.job-progress { display:flex; flex-direction:column; gap:6px; margin-top:8px; min-width:180px; max-width:100%; font-size:13px; }
.job-progress fluent-progress { width:100%; }
.job-progress small { color:var(--muted); }

fluent-badge.badge-warning > span { white-space:normal!important; text-align:left; }
