/* Padrão de portais Cygnus: componentes e casco. Cópia de aidata-reembolso-portal/src/styles/app.css + portal.css (implementação de referência). Não editar por tela; ajustes do ClaimProof ficam em auditor.css e styles.css. */

/* AI.DATA Reembolso Portal: estilos dos componentes. Valores vêm de tokens.css. */
.ad-root, .ad-root * { box-sizing: border-box; }
.ad-root { font-family: var(--font-sans); color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--surface-50); font-family: var(--font-sans); color: var(--ink); }
.ad-mono { font-family: var(--font-mono); font-size: 12.5px; }
.ad-num { font-variant-numeric: tabular-nums; }
.ad-muted { color: var(--ink-muted); }
.ad-subtle { color: var(--ink-subtle); }
.ad-overline { font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.ad-h1 { font-size: 22px; line-height: 30px; font-weight: 700; margin: 0; }
.ad-h2 { font-size: 17px; line-height: 24px; font-weight: 700; margin: 0; }
.ad-h3 { font-size: 14px; line-height: 20px; font-weight: 700; margin: 0; }
.ad-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ad-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.ad-pad { padding: var(--space-6); }
.ad-sig { height: var(--signature-bar); background: linear-gradient(90deg, var(--brand-blue), var(--brand-green)); }
:where(.ad-root) :focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ad-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ad-icon-sm { width: 14px; height: 14px; }
.ad-icon-lg { width: 22px; height: 22px; }

/* Card */
.ad-card { background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ad-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.ad-card-body { padding: var(--space-5); }

/* Button */
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 38px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.ad-btn:disabled { opacity: .5; cursor: not-allowed; }
.ad-btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.ad-btn-primary { background: var(--primary); color: var(--ink-inverse); }
.ad-btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.ad-btn-secondary { background: var(--surface-0); color: var(--ink); border-color: var(--border-control); }
.ad-btn-secondary:hover:not(:disabled) { background: var(--surface-100); }
.ad-btn-ghost { background: transparent; color: var(--ink-muted); }
.ad-btn-ghost:hover:not(:disabled) { background: var(--surface-100); color: var(--ink); }
.ad-btn-danger { background: var(--surface-0); color: var(--danger); border-color: var(--danger); }
.ad-btn-danger:hover:not(:disabled) { background: var(--danger-subtle); }
.ad-btn-block { width: 100%; }
.ad-iconbtn { width: 38px; padding: 0; }

/* Input */
.ad-field { display: flex; flex-direction: column; gap: 6px; }
.ad-label { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.ad-input { height: 40px; padding: 0 var(--space-3); border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--surface-0); font: inherit; color: var(--ink); width: 100%; }
.ad-input::placeholder { color: var(--ink-subtle); }
.ad-input:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.ad-inputwrap { position: relative; display: flex; align-items: center; }
.ad-inputwrap .ad-icon { position: absolute; left: 12px; color: var(--ink-subtle); pointer-events: none; }
.ad-inputwrap .ad-input { padding-left: 38px; }
.ad-hint { font-size: 12px; color: var(--ink-subtle); }

/* Badge */
.ad-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; white-space: nowrap; }
.ad-badge .ad-icon { width: 13px; height: 13px; stroke-width: 2.2; }
.ad-badge-neutral { background: var(--neutral-subtle); color: var(--ink-muted); }
.ad-badge-processing { background: var(--primary-subtle); color: var(--primary); }
.ad-badge-success { background: var(--success-subtle); color: var(--success); }
.ad-badge-warning { background: var(--warning-subtle); color: var(--warning); }
.ad-badge-danger { background: var(--danger-subtle); color: var(--danger); }
.ad-badge-info { background: var(--info-subtle); color: var(--info); }
.ad-spin { animation: ad-spin 1.1s linear infinite; }
@keyframes ad-spin { to { transform: rotate(360deg); } }

/* Logo */
.ad-logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ad-logo img { display: block; max-height: 100%; max-width: 100%; object-fit: contain; }
.ad-logo-product { padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--border); color: var(--ink-muted); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.6; white-space: nowrap; }
.ad-logo-word { font-weight: 800; letter-spacing: -0.02em; color: var(--brand-ink); line-height: 1; white-space: nowrap; }
.ad-logo-word b { color: var(--primary); font-weight: 800; }
.ad-logo-sub { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin-top: 4px; }
.ad-logo-mark { flex: none; border-radius: var(--radius-md); background: var(--brand-ink); display: grid; place-items: center; position: relative; overflow: hidden; }
.ad-logo-mark::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--brand-blue), var(--brand-green)); }
.ad-logo-mark span { color: var(--ink-inverse); font-weight: 800; font-size: 13px; letter-spacing: -0.02em; }
.ad-logo-edit { position: relative; display: inline-flex; border-radius: var(--radius-md); }
.ad-logo-edit-btn { position: absolute; inset: -6px; border: 1px dashed var(--border-control); border-radius: var(--radius-md); background: rgba(255,255,255,.88); color: var(--primary); font: inherit; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; opacity: 0; cursor: pointer; transition: opacity .12s; }
.ad-logo-edit:hover .ad-logo-edit-btn, .ad-logo-edit-btn:focus-visible { opacity: 1; }

/* Logo settings */
.ad-logoset { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.ad-logoslot { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-0); }
.ad-logoslot-prev { height: 104px; display: grid; place-items: center; background: var(--surface-50); border-bottom: 1px solid var(--border); padding: var(--space-4); background-image: linear-gradient(45deg, var(--surface-100) 25%, transparent 25%, transparent 75%, var(--surface-100) 75%), linear-gradient(45deg, var(--surface-100) 25%, transparent 25%, transparent 75%, var(--surface-100) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.ad-logoslot-foot { padding: var(--space-3) var(--space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* Sidebar */
.ad-sidebar { width: var(--sidebar-width); height: 100%; min-height: 560px; background: var(--surface-0); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.ad-sidebar.is-collapsed { width: var(--sidebar-collapsed); }
.ad-sidebar-brand { height: 72px; display: flex; align-items: center; padding: 0 var(--space-5); border-bottom: 1px solid var(--border); gap: var(--space-2); }
.ad-sidebar.is-collapsed .ad-sidebar-brand { justify-content: center; padding: 0; }
.ad-sidebar-nav { flex: 1; overflow: auto; padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; }
.ad-nav-group { padding: var(--space-4) var(--space-3) 6px; }
.ad-sidebar.is-collapsed .ad-nav-group { display: none; }
.ad-nav-item { display: flex; align-items: center; gap: var(--space-3); height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--ink-muted); font-weight: 600; text-decoration: none; border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; width: 100%; text-align: left; }
.ad-nav-item:hover { background: var(--surface-100); color: var(--ink); }
.ad-nav-item.is-active { background: var(--primary-subtle); color: var(--primary); font-weight: 700; }
.ad-nav-item .ad-nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-nav-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--surface-200); color: var(--ink-muted); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.ad-nav-item.is-active .ad-nav-count { background: var(--primary); color: var(--ink-inverse); }
.ad-sidebar.is-collapsed .ad-nav-item { justify-content: center; padding: 0; }
.ad-sidebar.is-collapsed .ad-nav-label, .ad-sidebar.is-collapsed .ad-nav-count { display: none; }
.ad-sidebar-foot { border-top: 1px solid var(--border); padding: var(--space-3) var(--space-4); display: flex; align-items: center; gap: var(--space-3); }
.ad-sidebar.is-collapsed .ad-sidebar-foot .ad-user-meta { display: none; }
.ad-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--surface-200); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 12.5px; flex: none; }
.ad-user-meta { min-width: 0; line-height: 16px; }
.ad-user-meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-user-meta span { font-size: 12px; color: var(--ink-subtle); }

/* Topbar */
.ad-topbar { height: var(--topbar-height); background: var(--surface-0); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-6); }
.ad-topbar-title { flex: 1; min-width: 0; }
.ad-topbar-search { width: 300px; max-width: 40%; }
.ad-topbar-search .ad-input { height: 36px; background: var(--surface-50); }

/* Notification bell */
.ad-bell { position: relative; display: inline-block; }
.ad-bell-btn { position: relative; width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-0); color: var(--ink-muted); display: grid; place-items: center; cursor: pointer; }
.ad-bell-btn:hover, .ad-bell-btn[aria-expanded="true"] { background: var(--surface-100); color: var(--ink); }
.ad-bell-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--radius-full); background: var(--danger); color: var(--ink-inverse); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface-0); }
.ad-bell-count.is-maint { background: var(--warning); }
.ad-bell-panel { position: absolute; right: 0; top: 48px; width: 400px; max-width: calc(100vw - 32px); background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); z-index: 50; overflow: hidden; }
.ad-bell-panel.is-static { position: static; box-shadow: var(--shadow-md); }
.ad-bell-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-4) var(--space-2); }
.ad-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 var(--space-3); border-bottom: 1px solid var(--border); }
.ad-tab { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-muted); padding: 10px 6px; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ad-tab:hover { color: var(--ink); }
.ad-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.ad-tab-n { font-size: 11px; background: var(--surface-100); color: var(--ink-muted); border-radius: var(--radius-full); padding: 0 6px; }
.ad-bell-list { max-height: 360px; overflow: auto; }
.ad-notif { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); position: relative; }
.ad-notif:last-child { border-bottom: 0; }
.ad-notif.is-unread { background: var(--surface-50); }
.ad-notif.is-unread::before { content: ""; position: absolute; left: 6px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.ad-notif-ico { width: 34px; height: 34px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; }
.ad-notif-ico.t-manutencao { background: var(--warning-subtle); color: var(--warning); }
.ad-notif-ico.t-portal { background: var(--info-subtle); color: var(--info); }
.ad-notif-ico.t-processo { background: var(--primary-subtle); color: var(--primary); }
.ad-notif-ico.t-erro { background: var(--danger-subtle); color: var(--danger); }
.ad-notif-title { font-size: 13.5px; font-weight: 700; line-height: 18px; }
.ad-notif-body { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: 2px; }
.ad-notif-meta { font-size: 12px; color: var(--ink-subtle); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.ad-bell-foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); display: flex; justify-content: center; }
.ad-empty { padding: var(--space-8) var(--space-4); text-align: center; color: var(--ink-subtle); font-size: 13px; }

/* Maintenance banner */
.ad-banner { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid; font-size: 13.5px; }
.ad-banner-warning { background: var(--warning-subtle); border-color: #f1d49c; color: var(--ink); }
.ad-banner-warning > .ad-icon { color: var(--warning); }
.ad-banner-info { background: var(--info-subtle); border-color: #d6cff8; }
.ad-banner-info > .ad-icon { color: var(--info); }
.ad-banner b { display: block; }
.ad-banner-x { margin-left: auto; }

/* KPI */
.ad-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.ad-kpi { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 6px; }
.ad-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.ad-kpi-ico { width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--surface-100); color: var(--ink-muted); display: grid; place-items: center; }
.ad-kpi-val { white-space: nowrap; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ad-kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.ad-kpi-delta { font-size: 12px; color: var(--ink-subtle); }
.ad-delta { font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.ad-delta.up { color: var(--success); }
.ad-delta.down { color: var(--danger); }
.ad-spark { width: 64px; flex: 0 1 64px; min-width: 24px; height: 28px; }

/* Pipeline */
.ad-pipe { display: grid; gap: 0; }
.ad-pipe-h { grid-auto-flow: column; grid-auto-columns: 1fr; }
.ad-step { position: relative; padding: 0 var(--space-2); text-align: center; }
.ad-step-node { width: 36px; height: 36px; margin: 0 auto; border-radius: var(--radius-full); display: grid; place-items: center; background: var(--surface-0); border: 2px solid var(--border); color: var(--ink-subtle); position: relative; z-index: 1; }
.ad-step.s-done .ad-step-node { background: var(--success); border-color: var(--success); color: var(--ink-inverse); }
.ad-step.s-active .ad-step-node { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); }
.ad-step.s-warning .ad-step-node { background: var(--warning-subtle); border-color: var(--warning); color: var(--warning); }
.ad-step.s-error .ad-step-node { background: var(--danger-subtle); border-color: var(--danger); color: var(--danger); }
.ad-step::before { content: ""; position: absolute; top: 17px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--border); }
.ad-step:first-child::before { display: none; }
.ad-step.s-done::before, .ad-step.s-active::before, .ad-step.s-warning::before, .ad-step.s-error::before { background: var(--success); }
.ad-step-name { font-size: 13px; font-weight: 700; margin-top: 10px; line-height: 17px; }
.ad-step-meta { font-size: 12px; color: var(--ink-subtle); margin-top: 2px; line-height: 16px; }
.ad-step-state { margin-top: 6px; }
.ad-pipe-v .ad-step { display: grid; grid-template-columns: 36px 1fr; gap: var(--space-3); text-align: left; padding: 0 0 var(--space-5); }
.ad-pipe-v .ad-step-node { margin: 0; }
.ad-pipe-v .ad-step::before { top: auto; bottom: 0; left: 17px; right: auto; width: 2px; height: auto; top: 38px; }
.ad-pipe-v .ad-step:first-child::before { display: block; }
.ad-pipe-v .ad-step:last-child::before { display: none; }
.ad-pipe-v .ad-step-name { margin-top: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ad-pipe-v .ad-step::before { background: var(--border); }
.ad-pipe-v .ad-step.s-done::before { background: var(--success); }
.ad-step-detail { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }

/* Integrations */
.ad-integ { display: flex; flex-direction: column; }
.ad-integ-row { display: grid; grid-template-columns: 38px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.ad-integ-row:last-child { border-bottom: 0; }
.ad-integ-ico { width: 38px; height: 38px; border-radius: var(--radius-md); background: var(--surface-100); color: var(--ink-muted); display: grid; place-items: center; }
.ad-integ-name { font-weight: 700; font-size: 13.5px; }
.ad-integ-meta { font-size: 12px; color: var(--ink-subtle); }
.ad-integ-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Table */
.ad-table-wrap { overflow: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ad-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-muted); background: var(--surface-100); padding: 10px var(--space-3); white-space: nowrap; border-bottom: 1px solid var(--border); }
.ad-table td { padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.ad-table tbody tr { cursor: pointer; }
.ad-table tbody tr:hover td { background: var(--surface-50); }
.ad-table tbody tr.is-selected td { background: var(--primary-subtle); }
.ad-table .ad-cell-file { display: flex; align-items: center; gap: 10px; }
.ad-filetype { width: 30px; height: 34px; border-radius: 4px; background: var(--surface-100); color: var(--ink-muted); font-size: 9.5px; font-weight: 800; display: grid; place-items: end center; padding-bottom: 5px; border: 1px solid var(--border); flex: none; }
.ad-toolbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.ad-chip { height: 30px; padding: 0 12px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface-0); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ad-chip:hover { border-color: var(--border-control); color: var(--ink); }
.ad-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--ink-inverse); }
.ad-pager { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); font-size: 12.5px; color: var(--ink-subtle); }
.ad-mini-steps { display: inline-flex; gap: 3px; }
.ad-mini-steps i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-200); display: block; }
.ad-mini-steps i.d { background: var(--success); }
.ad-mini-steps i.a { background: var(--primary); }
.ad-mini-steps i.w { background: var(--warning); }
.ad-mini-steps i.e { background: var(--danger); }

/* Document viewer */
.ad-docview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); min-height: 520px; }
.ad-docview-stage { background: var(--surface-100); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.ad-docview-tools { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); background: var(--surface-0); }
.ad-docview-canvas { flex: 1; overflow: auto; display: grid; place-items: center; padding: var(--space-6); }
.ad-docpage { position: relative; background: #fff; box-shadow: var(--shadow-md); transform-origin: center top; }
.ad-docpage img { display: block; width: 100%; }
.ad-bbox { position: absolute; border: 2px solid var(--primary); background: rgba(11, 99, 228, .08); border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.ad-bbox.is-warn { border-color: var(--warning); background: rgba(154, 91, 0, .08); }
.ad-bbox.is-hot { background: rgba(11, 99, 228, .22); box-shadow: 0 0 0 3px rgba(11, 99, 228, .25); }
.ad-bbox-tag { position: absolute; top: -20px; left: -2px; background: var(--primary); color: var(--ink-inverse); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 3px; white-space: nowrap; display: none; }
.ad-bbox.is-warn .ad-bbox-tag { background: var(--warning); }
.ad-bbox.is-hot .ad-bbox-tag { display: block; }
.ad-docview-side { display: flex; flex-direction: column; min-width: 0; background: var(--surface-0); }

/* Fields */
.ad-fields { display: flex; flex-direction: column; }
.ad-fgroup { padding: var(--space-3) var(--space-5) var(--space-1); }
.ad-fieldrow { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--space-3); padding: 10px var(--space-5); border-bottom: 1px solid var(--border); cursor: default; }
.ad-fieldrow.is-hot { background: var(--primary-subtle); }
.ad-fieldrow-k { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.ad-fieldrow-v { font-size: 14px; font-weight: 700; grid-column: 1; word-break: break-word; }
.ad-fieldrow-r { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; justify-content: center; }
.ad-conf { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-muted); }
.ad-conf-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--surface-200); overflow: hidden; }
.ad-conf-bar i { display: block; height: 100%; background: var(--success); }
.ad-conf.low .ad-conf-bar i { background: var(--warning); }
.ad-src { font-size: 11px; font-weight: 700; color: var(--success); display: inline-flex; align-items: center; gap: 4px; }
.ad-src.no { color: var(--warning); }

/* Upload */
.ad-drop { border: 2px dashed var(--border-control); border-radius: var(--radius-lg); background: var(--surface-0); padding: var(--space-8) var(--space-6); text-align: center; transition: border-color .12s, background .12s; cursor: pointer; }
.ad-drop:hover, .ad-drop.is-over { border-color: var(--primary); background: var(--primary-subtle); }
.ad-drop-ico { width: 48px; height: 48px; margin: 0 auto var(--space-3); border-radius: var(--radius-full); background: var(--primary-subtle); color: var(--primary); display: grid; place-items: center; }
.ad-drop b { font-size: 15px; }
.ad-drop p { margin: 4px 0 0; color: var(--ink-muted); font-size: 13px; }
.ad-uplist { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.ad-upitem { display: grid; grid-template-columns: 30px 1fr auto; gap: var(--space-3); align-items: center; padding: 10px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-0); }
.ad-progress { height: 5px; border-radius: 3px; background: var(--surface-200); overflow: hidden; margin-top: 6px; }
.ad-progress i { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.ad-progress.done i { background: var(--success); }

/* Report */
.ad-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.ad-report-opt { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; background: var(--surface-0); text-align: left; font: inherit; color: inherit; }
.ad-report-opt:hover { border-color: var(--border-control); }
.ad-report-opt.is-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-subtle); }
.ad-report-opt b { display: block; font-size: 13.5px; }
.ad-report-opt span { font-size: 12.5px; color: var(--ink-muted); }
.ad-seg { display: inline-flex; border: 1px solid var(--border-control); border-radius: var(--radius-md); overflow: hidden; }
.ad-seg button { border: 0; background: var(--surface-0); font: inherit; font-size: 13px; font-weight: 700; padding: 0 14px; height: 36px; color: var(--ink-muted); cursor: pointer; border-right: 1px solid var(--border); }
.ad-seg button:last-child { border-right: 0; }
.ad-seg button.is-on { background: var(--ink); color: var(--ink-inverse); }
.ad-select { height: 40px; padding: 0 var(--space-3); border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--surface-0); font: inherit; color: var(--ink); }

/* Login */
.ad-login { display: grid; grid-template-columns: minmax(360px, 480px) 1fr; min-height: 620px; background: var(--surface-0); }
.ad-login-form { padding: var(--space-12); display: flex; flex-direction: column; justify-content: center; gap: var(--space-6); position: relative; }
.ad-login-form .ad-sig { position: absolute; top: 0; left: 0; right: 0; }
.ad-login-title { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.ad-login-aside { background: var(--surface-50); border-left: 1px solid var(--border); padding: var(--space-12); display: flex; flex-direction: column; justify-content: center; gap: var(--space-6); position: relative; overflow: hidden; isolation: isolate; }
.ad-login-aside > :not(.ad-login-deco) { position: relative; z-index: 1; }
.ad-login-deco { position: absolute; pointer-events: none; z-index: 0; }
.ad-login-deco-a { width: 220px; top: -40px; right: -50px; opacity: .55; }
.ad-login-deco-b { width: 300px; bottom: -120px; right: -90px; opacity: .4; }
.ad-login-flow { display: flex; flex-direction: column; gap: var(--space-3); max-width: 420px; }
.ad-login-flow .ad-card { padding: var(--space-3) var(--space-4); display: flex; gap: var(--space-3); align-items: center; }
.ad-divider { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-subtle); font-size: 12px; }
.ad-divider::before, .ad-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ad-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.ad-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.ad-link { color: var(--primary); font-weight: 700; text-decoration: none; font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.ad-link:hover { text-decoration: underline; color: var(--primary-hover); }

/* Shell */
.ad-shell { display: grid; grid-template-columns: auto 1fr; min-height: 760px; background: var(--surface-50); }
.ad-shell-main { display: flex; flex-direction: column; min-width: 0; }
.ad-shell-content { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.ad-grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-6); }
.ad-chart { width: 100%; height: 180px; }
.ad-legend { display: flex; gap: var(--space-4); font-size: 12px; color: var(--ink-muted); font-weight: 600; flex-wrap: wrap; }
.ad-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

@media (max-width: 760px) {
  .ad-login { grid-template-columns: 1fr; }
  .ad-login-aside { display: none; }
  .ad-docview { grid-template-columns: 1fr; }
  .ad-grid-2 { grid-template-columns: 1fr; }
  .ad-topbar-search { display: none; }
}
/* Complementos do portal React sobre os estilos do design system (app.css). */
html, body, #root { min-height: 100%; }
a.ad-nav-item { text-decoration: none; }
a.ad-btn { text-decoration: none; }

/* Casco */
.ad-shell { min-height: 100vh; }
.ad-shell > .ad-sidebar { position: sticky; top: 0; height: 100vh; min-height: 0; }
.ad-shell-main { min-height: 100vh; }
.ad-shell-content { max-width: 1440px; width: 100%; }
.ad-sidebar-toggle { padding: 0 var(--space-3) var(--space-3); display: flex; }
.ad-sidebar.is-collapsed .ad-sidebar-toggle { justify-content: center; }
.ad-sidebar-foot .ad-user-meta.ad-btn { flex: none; }
.ad-only-mobile { display: none; }
.ad-card-sub { font-size: 12.5px; margin-top: 2px; }
.ad-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.ad-kpi-unit { font-size: 15px; font-weight: 700; color: var(--ink-muted); margin-left: 4px; }
.ad-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estados */
.ad-state { display: flex; align-items: center; justify-content: center; gap: var(--space-2); color: var(--ink-muted); font-size: 13.5px; }
.ad-state-pad { padding: var(--space-8) var(--space-4); }
.ad-state-error { color: var(--danger); flex-wrap: wrap; }
.ad-skel { display: block; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-100), var(--surface-200), var(--surface-100)); background-size: 200% 100%; animation: ad-shimmer 1.4s ease-in-out infinite; }
@keyframes ad-shimmer { to { background-position: -200% 0; } }
.ad-hint-error { color: var(--danger); }
.ad-input[aria-invalid="true"] { border-color: var(--danger); }

/* Banners extras */
.ad-banner-danger { background: var(--danger-subtle); border-color: #f3c2bd; }
.ad-banner-danger > .ad-icon { color: var(--danger); }
.ad-banner-flat { border-radius: 0; border-width: 1px 0 0; }

/* Busca global */
.ad-search { position: relative; }
.ad-search-panel { position: absolute; top: 44px; left: 0; right: 0; min-width: 360px; background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); z-index: 60; overflow: hidden; padding: 6px; }
.ad-search-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; font: inherit; color: var(--ink); }
.ad-search-item .ad-icon { color: var(--ink-subtle); }
.ad-search-item.is-active { background: var(--surface-100); }
.ad-search-empty { padding: 12px; color: var(--ink-subtle); font-size: 13px; }

/* Filtros */
.ad-filters { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.ad-chip-n { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.ad-table-static tbody tr { cursor: default; }
.ad-table-static tbody tr:hover td { background: transparent; }
.ad-table tbody tr:focus-visible td { background: var(--primary-subtle); outline: none; }

/* Detalhe do documento */
.ad-docmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-subtle); margin-top: 4px; }
.ad-fieldclass { padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); background: var(--surface-50); display: flex; flex-direction: column; gap: 4px; }
.ad-fieldrow-r .ad-btn { height: 26px; width: 26px; }
.ad-audit { list-style: none; margin: 0; padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.ad-audit li { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 2px solid var(--border); font-size: 13px; }
.ad-docview { min-height: 600px; }
.ad-docview-side { max-height: 760px; }

/* Listas simples */
.ad-list { display: flex; flex-direction: column; }
.ad-list-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); }
.ad-list-row:last-child { border-bottom: 0; }
.ad-steps-text { margin: 0; padding-left: 20px; color: var(--ink-muted); display: flex; flex-direction: column; gap: 6px; }
.ad-notif-page .ad-bell-list { max-height: none; }

/* Modal */
.ad-modal-overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 100; padding: var(--space-4); }
.ad-modal { background: var(--surface-0); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; }
.ad-modal-foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); }

/* Toast */
.ad-toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: calc(100vw - 32px); }
.ad-toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--ink); color: var(--ink-inverse); box-shadow: var(--shadow-pop); font-size: 13.5px; font-weight: 600; max-width: 420px; }
.ad-toast-success .ad-icon { color: var(--brand-green); }
.ad-toast-danger .ad-icon { color: #ff8a7d; }
.ad-toast-info .ad-icon { color: #9cc0ff; }

/* Login em tela cheia */
.ad-login-page { min-height: 100vh; grid-template-columns: minmax(400px, 5fr) 6fr; }
/* Cada painel centraliza o próprio conteúdo, para não ficar encostado à esquerda em telas largas. */
.ad-login-page .ad-login-form { align-items: center; padding-inline: var(--space-8); }
.ad-login-page .ad-login-form > :not(.ad-sig) { width: 100%; max-width: 400px; }
.ad-login-page .ad-login-aside { align-items: center; padding-inline: var(--space-8); }
.ad-login-page .ad-login-aside > :not(.ad-login-deco) { width: 100%; max-width: 480px; }
.ad-login-page .ad-login-aside .ad-login-flow { max-width: 480px; }
.ad-login-page .ad-login-aside .ad-h1 { max-width: none; }

@media (max-width: 960px) {
  .ad-shell { grid-template-columns: 1fr; }
  .ad-shell > .ad-sidebar { position: fixed; left: 0; top: 0; z-index: 80; transform: translateX(-100%); transition: transform .18s; width: var(--sidebar-width); box-shadow: var(--shadow-pop); }
  .ad-shell > .ad-sidebar.is-collapsed { width: var(--sidebar-width); }
  .ad-shell.is-menu-open > .ad-sidebar { transform: none; }
  .ad-only-mobile { display: inline-flex; }
  .ad-sidebar-toggle { display: none; }
  .ad-shell-content { padding: var(--space-4); }
  .ad-topbar { padding: 0 var(--space-4); gap: var(--space-2); }
  .ad-topbar .ad-btn-primary { display: none; }
}
@media (max-width: 760px) {
  .ad-login-page { grid-template-columns: 1fr; }
  .ad-login-form, .ad-login-page .ad-login-form { padding: var(--space-8) var(--space-4); }
}
@media (max-width: 760px) {
  .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .ad-kpi .ad-spark { display: none; }
}
