.fgj-app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.fgj-sidebar { position: sticky; top: 0; height: 100vh; z-index: 40; display: flex; flex-direction: column; overflow: hidden; color: var(--fgj-white); background: radial-gradient(circle at 10% 0%, rgba(200, 162, 96, .12), transparent 26%), var(--fgj-navy); border-right: 1px solid rgba(255, 255, 255, .06); }
.fgj-sidebar-head { min-height: 96px; display: flex; align-items: center; padding: 22px 22px 18px; }
.fgj-brand { display: inline-flex; align-items: center; width: 174px; }
.fgj-brand img { display: block; width: 100%; height: auto; }
.fgj-sidebar-close, .fgj-menu-button, .fgj-sidebar-overlay { display: none; }
.fgj-nav { padding: 4px 12px; }
.fgj-nav-label { margin: 18px 12px 7px; color: #738398; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.fgj-nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; margin: 3px 0; color: #B8C3D0; text-decoration: none; font-size: 13px; font-weight: 500; border-radius: 9px; transition: color var(--fgj-transition), background var(--fgj-transition); }
.fgj-nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fgj-nav a:first-of-type svg { fill: currentColor; stroke: none; }
.fgj-nav a:hover { color: var(--fgj-white); background: rgba(255, 255, 255, .05); }
.fgj-nav a.active { color: var(--fgj-white); background: linear-gradient(90deg, rgba(200, 162, 96, .16), rgba(255, 255, 255, .06)); box-shadow: inset 3px 0 var(--fgj-gold); }
.fgj-nav a.active svg { color: var(--fgj-gold-soft); }
.fgj-sidebar-help { margin: auto 16px 18px; padding: 15px; border: 1px solid rgba(200, 162, 96, .22); border-radius: var(--fgj-radius-md); background: rgba(255, 255, 255, .045); }
.fgj-sidebar-help .fgj-help-kicker { display: block; color: var(--fgj-gold-soft); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fgj-sidebar-help strong { display: block; margin-top: 5px; font-size: 12px; }
.fgj-sidebar-help p { margin: 5px 0 10px; color: #9EADBE; font-size: 11px; line-height: 1.45; }
.fgj-sidebar-help a { color: var(--fgj-gold-soft); font-size: 11px; font-weight: 600; text-decoration: none; }
.fgj-sidebar-user { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 15px 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.fgj-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--fgj-gold); color: var(--fgj-navy); font-size: 12px; font-weight: 700; }
.fgj-user-copy { min-width: 0; display: flex; flex-direction: column; }
.fgj-user-copy strong { overflow: hidden; color: #E8EDF2; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.fgj-user-copy small { color: #748599; font-size: 9px; }
.fgj-main { min-width: 0; background: var(--fgj-canvas); }
.fgj-topbar { height: 68px; display: flex; align-items: center; gap: 18px; padding: 0 clamp(20px, 3vw, 42px); background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--fgj-border); backdrop-filter: blur(10px); }
.fgj-topbar-context { min-width: 0; display: flex; flex-direction: column; }
.fgj-topbar-context span { color: var(--fgj-gray); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.fgj-topbar-context strong { color: var(--fgj-navy); font-size: 13px; font-weight: 600; }
.fgj-topbar-action { margin-left: auto; }
.fgj-content { width: min(1520px, 100%); margin: 0 auto; padding: 32px clamp(20px, 3vw, 42px) 54px; }
.fgj-icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: inherit; background: transparent; cursor: pointer; }
.fgj-icon-button:hover { background: rgba(255, 255, 255, .08); }

.fgj-page-header, .fgj-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.fgj-eyebrow { display: block; margin-bottom: 6px; color: var(--fgj-gold); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.fgj-page-header h1, .fgj-header h1 { margin: 0; color: var(--fgj-navy); font-family: var(--fgj-font-title); font-size: clamp(26px, 3vw, 34px); font-weight: 600; line-height: 1.15; }
.fgj-page-header .sub, .fgj-header .sub { max-width: 720px; margin-top: 7px; color: var(--fgj-slate); font-size: 13px; }
.fgj-header-actions, .fgj-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.fgj-btn, .fgj-btn-primary, .fgj-btn-secondary, .fgj-btn-ghost { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: var(--fgj-radius-sm); font-size: 12px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; transition: transform var(--fgj-transition), box-shadow var(--fgj-transition), background var(--fgj-transition); }
.fgj-btn:hover, .fgj-btn-primary:hover, .fgj-btn-secondary:hover, .fgj-btn-ghost:hover { transform: translateY(-1px); }
.fgj-btn-primary, .fgj-btn.fgj-btn-primary { color: var(--fgj-white); background: var(--fgj-navy); box-shadow: 0 5px 14px rgba(8, 27, 46, .14); }
.fgj-btn-primary:hover { background: var(--fgj-navy-deep); }
.fgj-btn-secondary, .fgj-btn.fgj-btn-secondary { color: var(--fgj-navy); background: var(--fgj-white); border-color: var(--fgj-border-strong); }
.fgj-btn-secondary:hover { border-color: var(--fgj-gold-soft); box-shadow: var(--fgj-shadow-sm); }
.fgj-btn-ghost { min-height: 34px; padding: 7px 10px; color: var(--fgj-navy-deep); background: transparent; }
.fgj-link-button { display: inline-flex; align-items: center; padding: 5px 0; border: 0; color: var(--fgj-navy-deep); background: none; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; }
.fgj-link-button:hover { color: var(--fgj-gold); }

.fgj-kpi-grid, .fgj-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.fgj-kpi, .fgj-card { position: relative; min-width: 0; padding: 18px; overflow: hidden; background: var(--fgj-white); border: 1px solid var(--fgj-border); border-radius: var(--fgj-radius-md); box-shadow: var(--fgj-shadow-sm); }
.fgj-kpi::before, .fgj-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--kpi-accent, var(--fgj-navy-deep)); opacity: .72; }
.fgj-kpi.success { --kpi-accent: var(--fgj-green); } .fgj-kpi.warning { --kpi-accent: var(--fgj-amber); } .fgj-kpi.danger { --kpi-accent: var(--fgj-red); } .fgj-kpi.gold, .fgj-card.gold { --kpi-accent: var(--fgj-gold); }
.fgj-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fgj-kpi .label, .fgj-card .label { color: var(--fgj-slate); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.fgj-kpi .value, .fgj-card .value { margin-top: 6px; color: var(--fgj-navy); font-size: clamp(24px, 3vw, 31px); font-weight: 650; letter-spacing: -.03em; }
.fgj-kpi small, .fgj-card small { display: block; margin-top: 4px; color: var(--fgj-gray); font-size: 10px; }
.fgj-kpi.gold .value, .fgj-card.gold .value { color: #A8813F; }
.fgj-progress { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: var(--fgj-gray-soft); }
.fgj-progress span { display: block; height: 100%; border-radius: inherit; background: var(--fgj-green); }

.fgj-panel { margin-bottom: 20px; background: var(--fgj-white); border: 1px solid var(--fgj-border); border-radius: var(--fgj-radius-md); box-shadow: var(--fgj-shadow-sm); }
.fgj-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 19px; border-bottom: 1px solid var(--fgj-border); }
.fgj-panel-head h2, .fgj-panel-head h3 { margin: 0; color: var(--fgj-navy); font-size: 14px; font-weight: 650; }
.fgj-panel-head p { margin: 2px 0 0; color: var(--fgj-gray); font-size: 11px; }
.fgj-panel-body { padding: 20px; }
.fgj-table-wrap { width: 100%; overflow-x: auto; border-radius: 0 0 var(--fgj-radius-md) var(--fgj-radius-md); }
.fgj-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fgj-table th { padding: 11px 12px; color: #748191; background: #FAFBFC; border-bottom: 1px solid var(--fgj-border); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.fgj-table td { padding: 12px; color: var(--fgj-graphite); border-bottom: 1px solid #EDF0F2; vertical-align: middle; }
.fgj-table tbody tr:last-child td { border-bottom: 0; }
.fgj-table tbody tr:hover td { background: #FCFBF8; }
.fgj-table .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fgj-table .history { min-width: 260px; max-width: 520px; color: var(--fgj-slate); }
.fgj-table .actions { min-width: 118px; }
.fgj-table details summary, .fgj-help-details summary { color: var(--fgj-navy-deep); font-size: 11px; font-weight: 600; cursor: pointer; }
.fgj-table details p { max-width: 300px; margin: 7px 0; color: var(--fgj-slate); font-size: 10px; line-height: 1.45; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--fgj-green); background: var(--fgj-green-soft); } .pill.suggest { color: var(--fgj-navy-deep); background: #E9EFF5; } .pill.pending { color: var(--fgj-amber); background: var(--fgj-amber-soft); } .pill.diverg { color: var(--fgj-red); background: var(--fgj-red-soft); } .pill.neutral { color: var(--fgj-slate); background: var(--fgj-gray-soft); }

.fgj-filter-bar { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, .7fr)) auto; align-items: end; gap: 10px; padding: 16px 18px; background: var(--fgj-white); border: 1px solid var(--fgj-border); border-radius: var(--fgj-radius-md); box-shadow: var(--fgj-shadow-sm); margin-bottom: 14px; }
.fgj-field { min-width: 0; }
.fgj-field label, .fgj-form label { display: block; margin: 0 0 5px; color: var(--fgj-slate); font-size: 10px; font-weight: 650; }
.fgj-field input, .fgj-field select, .fgj-form input:not([type="checkbox"]):not([type="file"]), .fgj-form select { width: 100%; min-height: 40px; padding: 8px 10px; color: var(--fgj-graphite); background: var(--fgj-white); border: 1px solid var(--fgj-border-strong); border-radius: var(--fgj-radius-sm); font-size: 12px; transition: border var(--fgj-transition), box-shadow var(--fgj-transition); }
.fgj-field input:focus, .fgj-field select:focus, .fgj-form input:focus, .fgj-form select:focus { border-color: var(--fgj-gold); box-shadow: 0 0 0 3px rgba(200, 162, 96, .12); outline: 0; }
.fgj-form-help, .helptext { display: block; margin-top: 5px; color: var(--fgj-gray); font-size: 10px; }
.errorlist { margin: 5px 0 0; padding: 0; color: var(--fgj-red); font-size: 10px; list-style: none; }
.fgj-filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 12px; color: var(--fgj-slate); font-size: 11px; }
.fgj-filter-summary a { color: var(--fgj-navy-deep); font-weight: 600; text-decoration: none; }
.fgj-status-tabs { display: flex; gap: 7px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.fgj-status-tabs a { flex: 0 0 auto; padding: 7px 11px; color: var(--fgj-slate); background: var(--fgj-white); border: 1px solid var(--fgj-border); border-radius: 999px; font-size: 10px; font-weight: 600; text-decoration: none; }
.fgj-status-tabs a.active, .fgj-status-tabs a:hover { color: var(--fgj-white); background: var(--fgj-navy); border-color: var(--fgj-navy); }
.fgj-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--fgj-border); }
.fgj-pagination a, .fgj-pagination span { font-size: 10px; text-decoration: none; }

.fgj-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; padding: 0; list-style: none; }
.fgj-stepper li { position: relative; display: flex; align-items: center; gap: 9px; color: var(--fgj-gray); font-size: 10px; font-weight: 600; }
.fgj-stepper li::after { content: ""; position: absolute; z-index: 0; top: 13px; left: 30px; right: 8px; height: 1px; background: var(--fgj-border); }
.fgj-stepper li:last-child::after { display: none; }
.fgj-step-number { position: relative; z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--fgj-border-strong); border-radius: 50%; background: var(--fgj-white); }
.fgj-stepper li.active, .fgj-stepper li.done { color: var(--fgj-navy); }
.fgj-stepper li.active .fgj-step-number { color: var(--fgj-white); background: var(--fgj-navy); border-color: var(--fgj-navy); }
.fgj-stepper li.done .fgj-step-number { color: var(--fgj-green); background: var(--fgj-green-soft); border-color: #BEDFCC; }
.fgj-two-column { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); align-items: start; gap: 20px; }
.fgj-upload-zone { position: relative; min-height: 190px; display: flex; align-items: center; justify-content: center; padding: 28px; border: 1.5px dashed #BBC5CF; border-radius: var(--fgj-radius-md); background: linear-gradient(145deg, #FBFCFD, #F7F4EE); text-align: center; transition: border var(--fgj-transition), background var(--fgj-transition); }
.fgj-upload-zone:hover { border-color: var(--fgj-gold); background: var(--fgj-gold-pale); }
.fgj-upload-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fgj-upload-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 50%; color: var(--fgj-navy); background: var(--fgj-white); border: 1px solid var(--fgj-border); box-shadow: var(--fgj-shadow-sm); font-size: 19px; }
.fgj-upload-zone strong { display: block; color: var(--fgj-navy); font-size: 13px; }
.fgj-upload-zone p { margin: 5px 0 0; color: var(--fgj-gray); font-size: 10px; }
.fgj-file-name { display: inline-block; max-width: 100%; margin-top: 10px; overflow: hidden; color: var(--fgj-gold); font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.fgj-help-card, .fgj-callout { padding: 17px; color: var(--fgj-slate); background: var(--fgj-gold-pale); border: 1px solid #E8D9BC; border-radius: var(--fgj-radius-md); }
.fgj-help-card h3, .fgj-callout strong { display: block; margin: 0 0 6px; color: var(--fgj-navy); font-size: 12px; }
.fgj-help-card p, .fgj-callout p { margin: 0; font-size: 11px; line-height: 1.55; }
.fgj-help-list { margin: 12px 0 0; padding: 0; list-style: none; }
.fgj-help-list li { position: relative; padding: 7px 0 7px 20px; border-top: 1px solid rgba(200, 162, 96, .18); font-size: 10px; }
.fgj-help-list li::before { content: "✓"; position: absolute; left: 0; color: var(--fgj-green); font-weight: 700; }
.fgj-mapping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fgj-mapping-field { padding: 13px; border: 1px solid var(--fgj-border); border-radius: var(--fgj-radius-sm); background: #FCFDFD; }
.fgj-mapping-field.required label::after { content: " obrigatório"; margin-left: 4px; color: var(--fgj-gold); font-size: 8px; text-transform: uppercase; }
.fgj-column-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fgj-column-tag { padding: 4px 7px; color: var(--fgj-slate); background: var(--fgj-gray-soft); border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.fgj-preview-table { max-height: 260px; overflow: auto; }

.fgj-empty-state { padding: 42px 24px; color: var(--fgj-slate); text-align: center; }
.fgj-empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--fgj-gold); background: var(--fgj-gold-pale); border-radius: 50%; font-size: 20px; }
.fgj-empty-state h3 { margin: 0; color: var(--fgj-navy); font-size: 14px; }
.fgj-empty-state p { max-width: 480px; margin: 6px auto 16px; font-size: 11px; }
.fgj-alert, .fgj-messages { margin: 0 0 16px; padding: 12px 14px; color: var(--fgj-navy-deep); background: var(--fgj-gold-pale); border: 1px solid #E8D9BC; border-radius: var(--fgj-radius-sm); font-size: 11px; list-style: none; }
.fgj-toast-stack { position: fixed; z-index: 100; top: 18px; right: 18px; width: min(380px, calc(100vw - 36px)); display: grid; gap: 8px; }
.fgj-toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; color: var(--fgj-graphite); background: rgba(255, 255, 255, .97); border: 1px solid var(--fgj-border); border-radius: 10px; box-shadow: var(--fgj-shadow-md); font-size: 11px; }
.fgj-toast-dot { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--fgj-navy-deep); }
.fgj-toast.success .fgj-toast-dot { background: var(--fgj-green); } .fgj-toast.error .fgj-toast-dot { background: var(--fgj-red); }

.fgj-company-list { display: grid; gap: 10px; }
.fgj-company-row { display: grid; grid-template-columns: minmax(200px, 1.3fr) repeat(3, minmax(100px, .45fr)) auto; align-items: center; gap: 16px; padding: 15px 17px; border: 1px solid var(--fgj-border); border-radius: var(--fgj-radius-md); background: var(--fgj-white); }
.fgj-company-row h3 { margin: 0; color: var(--fgj-navy); font-size: 13px; }
.fgj-company-row p { margin: 2px 0 0; color: var(--fgj-gray); font-size: 10px; }
.fgj-company-metric span { display: block; color: var(--fgj-gray); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.fgj-company-metric strong { color: var(--fgj-navy); font-size: 16px; }
.fgj-anchor-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px; margin-bottom: 18px; color: var(--fgj-white); background: var(--fgj-navy); border-radius: var(--fgj-radius-md); }
.fgj-anchor-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--fgj-gold-soft); background: rgba(255, 255, 255, .08); }
.fgj-anchor-card h2 { margin: 0 0 4px; font-size: 13px; }
.fgj-anchor-card p { margin: 0; color: #AAB8C7; font-size: 10px; }
.fgj-anchor-value { text-align: right; }
.fgj-anchor-value strong { display: block; color: var(--fgj-white); font-size: 18px; }
.fgj-anchor-value span { color: var(--fgj-gold-soft); font-size: 9px; text-transform: uppercase; }
.fgj-review-totals { position: sticky; bottom: 12px; display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)) auto; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 14px; color: var(--fgj-white); background: rgba(8, 27, 46, .96); border-radius: var(--fgj-radius-md); box-shadow: var(--fgj-shadow-md); backdrop-filter: blur(8px); }
.fgj-review-metric span { display: block; color: #95A5B7; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.fgj-review-metric strong { color: var(--fgj-white); font-size: 16px; }
.fgj-review-metric.difference strong { color: var(--fgj-gold-soft); }

.fgj-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr); background: var(--fgj-navy); }
.fgj-auth-card-wrap { display: grid; place-items: center; padding: 32px; background: var(--fgj-white); }
.fgj-auth-card { width: min(390px, 100%); }
.fgj-auth-card .brand img { width: 190px; display: block; margin-bottom: 34px; }
.fgj-auth-card h1 { margin: 0; color: var(--fgj-navy); font-family: var(--fgj-font-title); font-size: 29px; }
.fgj-auth-card > p { margin: 7px 0 24px; color: var(--fgj-slate); font-size: 12px; }
.fgj-auth-card label { display: block; margin: 14px 0 5px; color: var(--fgj-slate); font-size: 10px; font-weight: 600; }
.fgj-auth-card input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--fgj-border-strong); border-radius: var(--fgj-radius-sm); }
.fgj-auth-card .fgj-btn-primary { width: 100%; margin-top: 20px; }
.fgj-auth-visual { position: relative; display: flex; align-items: flex-end; padding: clamp(38px, 7vw, 90px); overflow: hidden; background: radial-gradient(circle at 70% 25%, rgba(200, 162, 96, .18), transparent 23%), linear-gradient(145deg, var(--fgj-navy-deep), var(--fgj-navy)); }
.fgj-auth-visual::before, .fgj-auth-visual::after { content: ""; position: absolute; border: 1px solid rgba(200, 162, 96, .15); border-radius: 50%; }
.fgj-auth-visual::before { width: 420px; height: 420px; right: -150px; top: -120px; } .fgj-auth-visual::after { width: 230px; height: 230px; right: 40px; top: 80px; }
.fgj-auth-quote { position: relative; z-index: 1; max-width: 500px; }
.fgj-auth-quote span { color: var(--fgj-gold-soft); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.fgj-auth-quote h2 { margin: 10px 0 12px; color: var(--fgj-white); font-family: var(--fgj-font-title); font-size: clamp(30px, 4vw, 49px); font-weight: 500; line-height: 1.1; }
.fgj-auth-quote p { max-width: 440px; color: #AEBBC9; font-size: 13px; }

@media (max-width: 1180px) {
  .fgj-filter-bar { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .fgj-filter-bar .fgj-search-field { grid-column: span 2; }
  .fgj-kpi-grid, .fgj-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .fgj-app-shell { display: block; }
  .fgj-sidebar { position: fixed; left: 0; width: 270px; transform: translateX(-102%); transition: transform 200ms ease; }
  .sidebar-open .fgj-sidebar { transform: translateX(0); }
  .fgj-sidebar-close, .fgj-menu-button { display: inline-grid; }
  .fgj-sidebar-close { margin-left: auto; }
  .fgj-sidebar-overlay { position: fixed; inset: 0; z-index: 30; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(8, 27, 46, .55); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .sidebar-open .fgj-sidebar-overlay { display: block; opacity: 1; pointer-events: auto; }
  .fgj-two-column { grid-template-columns: 1fr; }
  .fgj-company-row { grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(90px, auto)) auto; }
  .fgj-company-row .optional-metric { display: none; }
}
@media (max-width: 680px) {
  .fgj-content { padding: 22px 14px 40px; }
  .fgj-topbar { height: 60px; padding: 0 14px; }
  .fgj-topbar-action { display: none; }
  .fgj-page-header, .fgj-header { align-items: flex-start; flex-direction: column; }
  .fgj-header-actions { width: 100%; } .fgj-header-actions .fgj-btn { flex: 1; }
  .fgj-kpi-grid, .fgj-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgj-kpi, .fgj-card { padding: 14px; }
  .fgj-filter-bar { grid-template-columns: 1fr 1fr; padding: 13px; }
  .fgj-filter-bar .fgj-search-field { grid-column: 1 / -1; }
  .fgj-filter-bar .fgj-filter-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .fgj-mapping-grid { grid-template-columns: 1fr; }
  .fgj-stepper li span:last-child { display: none; } .fgj-stepper li::after { right: 4px; }
  .fgj-company-row { grid-template-columns: 1fr auto; } .fgj-company-row .fgj-company-metric { display: none; }
  .fgj-anchor-card { grid-template-columns: auto 1fr; }
  .fgj-anchor-value { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .1); text-align: left; }
  .fgj-review-totals { grid-template-columns: 1fr 1fr; } .fgj-review-totals .fgj-btn { grid-column: 1 / -1; }
  .fgj-auth { display: block; background: var(--fgj-white); }
  .fgj-auth-card-wrap { min-height: 100vh; padding: 28px 20px; }
  .fgj-auth-visual { display: none; }
}

/* Detalhe da conciliação (carregado sob demanda ao abrir "Por que o FGJ conciliou isso?") */
.fgj-match-details > summary { cursor: pointer; color: var(--fgj-azul, #081B2E); font-weight: 600; }
.fgj-group-detail { margin-top: 10px; padding: 12px; background: var(--fgj-marfim, #F7F3EC); border-radius: 8px; }
.fgj-group-criteria { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.fgj-group-table { font-size: 13px; }
.fgj-group-table tfoot td { border-top: 2px solid rgba(8, 27, 46, .18); }
/* A linha de onde o usuário clicou: num grupo 1xN ela se perde no meio das outras. */
.fgj-group-table tr.esta-linha { background: rgba(200, 162, 96, .22); }
/* Diferença só ganha destaque quando existe de fato — em conciliação exata ela é zero. */
.fgj-group-table tfoot tr.diferenca td { color: #B3261E; }
.fgj-loading { margin: 8px 0 0; font-size: 13px; opacity: .7; }
