.nfas-wrap .nfas-card { background:#fff; padding:16px; border:1px solid #dcdcde; max-width:1100px; }
.nfas-inline { display:inline-block; margin-right:6px; }
.nfas-badge { display:inline-block; padding:2px 6px; background:#f0f0f1; border-radius:4px; font-size:11px; }
.nfas-sev { display:inline-block; padding:2px 6px; border-radius:4px; font-weight:600; }
.nfas-alta, .nfas-critica { background:#ffe1e1; color:#8a0000; }
.nfas-media { background:#fff3cd; color:#664d03; }
.nfas-baixa { background:#e7f1ff; color:#084298; }


.nfas-status {
    display:inline-block;
    padding:2px 6px;
    border-radius:4px;
    background:#f0f0f1;
    font-weight:600;
}
.nfas-status-confirmado { background:#d1e7dd; color:#0a3622; }
.nfas-status-falso_positivo { background:#f8d7da; color:#58151c; }
.nfas-status-corrigido { background:#cff4fc; color:#055160; }
.nfas-status-ignorado { background:#e2e3e5; color:#41464b; }
.nfas-status-pendente { background:#fff3cd; color:#664d03; }

/* Relatório de auditoria — layout compacto v0.3.6
   Agrupa colunas pequenas para dar espaço real às colunas que exigem leitura. */
.nfas-card {
    box-sizing: border-box;
}
.nfas-wrap .nfas-card {
    max-width: 1320px;
}
.nfas-report-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dcdcde;
    background: #fff;
}
.nfas-report-scroll .widefat {
    border: 0;
}
.nfas-report-table {
    table-layout: fixed;
    width: 100% !important;
    min-width: 1380px !important;
    max-width: none !important;
}
.nfas-report-table th,
.nfas-report-table td {
    vertical-align: top;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    padding: 8px 8px;
    line-height: 1.35;
}
.nfas-report-table th {
    font-weight: 600;
}
.nfas-report-table .nfas-col-check { width: 34px; }
.nfas-report-table .nfas-col-linha { width: 64px; }
.nfas-report-table .nfas-col-registro { width: 74px; }
.nfas-report-table .nfas-col-identificacao { width: 300px; }
.nfas-report-table .nfas-col-tributacao { width: 170px; }
.nfas-report-table .nfas-col-auditoria { width: 155px; }
.nfas-report-table .nfas-col-mensagem { width: 280px; }
.nfas-report-table .nfas-col-acao { width: 330px; }
.nfas-report-table .nfas-col-status { width: 105px; }
.nfas-report-table .nfas-cell-small {
    text-align: center;
}
.nfas-report-table .nfas-cell-nowrap,
.nfas-report-table .nfas-code {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}
.nfas-report-table .nfas-meta-line {
    display:block;
    margin:0 0 2px 0;
}
.nfas-report-table .nfas-meta-line strong {
    font-weight:600;
}
.nfas-report-table .nfas-ident {
    font-size:12px;
}
.nfas-report-table .nfas-text {
    font-size:12px;
}
.nfas-report-table .nfas-audit {
    font-size:12px;
}
.nfas-report-table .nfas-audit .nfas-sev {
    margin-top:3px;
}
@media (min-width: 1600px) {
    .nfas-wrap .nfas-card {
        max-width: 1500px;
    }
    .nfas-report-table {
        min-width: 1520px !important;
    }
    .nfas-report-table .nfas-col-identificacao { width: 340px; }
    .nfas-report-table .nfas-col-mensagem { width: 330px; }
    .nfas-report-table .nfas-col-acao { width: 390px; }
}


/* Detalhe da ocorrência v0.3.7 */
.nfas-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin: 12px 0;
    max-width: 1320px;
}
.nfas-detail-card,
.nfas-detail-section {
    background: #fff;
    border: 1px solid #dcdcde;
    padding: 16px;
    box-sizing: border-box;
}
.nfas-detail-section {
    max-width: 1320px;
    margin: 12px 0;
}
.nfas-detail-card h2,
.nfas-detail-section h2 {
    margin-top: 0;
}
.nfas-detail-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.nfas-detail-table th {
    width: 180px;
    vertical-align: top;
}
.nfas-detail-table td {
    word-break: break-word;
}
.nfas-sped-line,
.nfas-code-block {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    padding: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 360px;
}
.nfas-detail-button {
    margin-top: 6px !important;
}
@media (max-width: 1200px) {
    .nfas-detail-grid,
    .nfas-detail-columns {
        grid-template-columns: 1fr;
    }
}


/* Painel do Auditor v0.4.0 */
.nfas-actions-bar {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
    margin: 14px 0 18px;
}
.nfas-kpi-grid {
    display:grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    max-width: 1320px;
    margin: 14px 0;
}
.nfas-kpi {
    background:#fff;
    border:1px solid #dcdcde;
    border-left:4px solid #2271b1;
    padding:14px 16px;
    box-sizing:border-box;
}
.nfas-kpi-warn {
    border-left-color:#dba617;
}
.nfas-kpi-label {
    color:#50575e;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.02em;
}
.nfas-kpi-value {
    font-size:30px;
    font-weight:700;
    margin:6px 0;
}
.nfas-kpi-hint {
    color:#646970;
    font-size:12px;
}
.nfas-dashboard-grid {
    display:grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    max-width: 1320px;
    margin: 14px 0;
}
.nfas-dashboard .nfas-card {
    margin: 14px 0;
}
.nfas-severity-grid {
    display:grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 10px;
}
.nfas-severity-grid > div {
    border:1px solid #dcdcde;
    background:#f6f7f7;
    padding:10px;
}
.nfas-severity-grid strong {
    display:block;
    font-size:24px;
    margin-top:8px;
}
.nfas-badge-ok { background:#d1e7dd; color:#0a3622; }
.nfas-badge-test { background:#fff3cd; color:#664d03; }
.nfas-compact-table td,
.nfas-compact-table th {
    vertical-align:top;
}
.nfas-next-steps ul {
    margin-left: 18px;
    list-style: disc;
}
@media (max-width: 1100px) {
    .nfas-kpi-grid,
    .nfas-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .nfas-severity-grid {
        grid-template-columns: repeat(2, minmax(90px, 1fr));
    }
}


/* Resumo Fiscal v0.4.1 */
.nfas-summary-selector {
    display:flex;
    gap:10px;
    align-items:end;
    flex-wrap:wrap;
    margin: 12px 0;
}
.nfas-summary-selector select {
    min-width: 520px;
    max-width: 100%;
}
.nfas-summary .nfas-card {
    margin: 12px 0;
}
.nfas-summary-kpis .nfas-kpi-value {
    font-size: 22px;
}
.nfas-erp-grid {
    display:grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    max-width: 980px;
}
.nfas-erp-grid input {
    width: 100%;
}
.nfas-summary-list {
    margin-left: 18px;
    list-style: disc;
}
.nfas-summary-card .widefat td,
.nfas-summary-card .widefat th {
    white-space: nowrap;
}
@media (max-width: 1100px) {
    .nfas-erp-grid {
        grid-template-columns: 1fr;
    }
    .nfas-summary-selector select {
        min-width: 280px;
    }
}


/* Resumo Fiscal v0.4.4 */
.nfas-summary-actions {
    max-width: 1320px;
}
@media print {
    #adminmenumain,
    #wpadminbar,
    .notice,
    .nfas-summary-selector,
    .nfas-summary-actions,
    .nfas-erp-compare .button,
    .nfas-actions-bar,
    .update-nag {
        display: none !important;
    }
    #wpcontent,
    #wpbody-content,
    .wrap {
        margin: 0 !important;
        padding: 0 !important;
    }
    .nfas-card,
    .nfas-kpi {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #999 !important;
        box-shadow: none !important;
    }
    .nfas-dashboard-grid,
    .nfas-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    body {
        background: #fff !important;
    }
}


/* Detalhe por CFOP v0.4.5 */
.nfas-cfop-detail .nfas-card {
    margin: 12px 0;
}
.nfas-cfop-filters {
    display:flex;
    flex-wrap:wrap;
    align-items:end;
    gap: 10px;
}
.nfas-cfop-filters input[type="search"] {
    min-width: 260px;
}
.nfas-cfop-kpis .nfas-kpi-value {
    font-size: 22px;
}
.nfas-cfop-items-table th,
.nfas-cfop-items-table td {
    vertical-align: top;
}
.nfas-cfop-items-table th:nth-child(1),
.nfas-cfop-items-table td:nth-child(1) { width: 56px; }
.nfas-cfop-items-table th:nth-child(2),
.nfas-cfop-items-table td:nth-child(2) { width: 230px; }
.nfas-cfop-items-table th:nth-child(3),
.nfas-cfop-items-table td:nth-child(3) { width: 280px; }
.nfas-cfop-items-table th:nth-child(4),
.nfas-cfop-items-table td:nth-child(4) { width: 150px; }
.nfas-cfop-items-table th:nth-child(5),
.nfas-cfop-items-table td:nth-child(5),
.nfas-cfop-items-table th:nth-child(6),
.nfas-cfop-items-table td:nth-child(6),
.nfas-cfop-items-table th:nth-child(7),
.nfas-cfop-items-table td:nth-child(7) { width: 145px; }
.nfas-cfop-items-table th:nth-child(8),
.nfas-cfop-items-table td:nth-child(8) { width: 210px; }
.nfas-mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    word-break: break-all;
}
.nfas-pagination {
    float:right;
}
@media (max-width: 1100px) {
    .nfas-pagination {
        float:none;
        display:block;
        margin-top: 8px;
    }
}


/* Relatório por CFOP agrupado por nota v0.4.6 */
.nfas-cfop-doc-scroll {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #dcdcde;
}
.nfas-cfop-doc-table {
    min-width: 1320px;
    border: 0;
}
.nfas-cfop-doc-table th,
.nfas-cfop-doc-table td {
    vertical-align: top;
    line-height: 1.35;
}
.nfas-cfop-doc-table .nfas-col-toggle {
    width: 38px;
    text-align: center;
}
.nfas-toggle-doc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #2271b1;
    border-radius: 3px;
    color: #2271b1;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    background: #fff;
}
.nfas-toggle-doc:hover,
.nfas-toggle-doc:focus {
    background: #f0f6fc;
    color: #135e96;
}
.nfas-cfop-doc-row.nfas-doc-open {
    background: #e7f1ff !important;
}
.nfas-cfop-items-row > td {
    padding: 0 !important;
    background: #f6f7f7;
}
.nfas-cfop-items-panel {
    padding: 12px 14px 16px;
    border-left: 4px solid #2271b1;
}
.nfas-cfop-doc-meta {
    margin: 0 0 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.nfas-cfop-inner-table {
    background: #fff;
}
.nfas-cfop-inner-table th,
.nfas-cfop-inner-table td {
    vertical-align: top;
    font-size: 12px;
}
.nfas-mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    word-break: break-all;
}
.nfas-cfop-doc-table tfoot th {
    background: #dbeafe;
    font-weight: 700;
}
@media (max-width: 1400px) {
    .nfas-cfop-doc-table {
        min-width: 1500px;
    }
}


/* UX refresh v0.4.7 — interface administrativa mais confiável */
.nfas-wrap {
    --nfas-primary: #1d4ed8;
    --nfas-primary-dark: #1e40af;
    --nfas-primary-soft: #eff6ff;
    --nfas-border: #d9e2ef;
    --nfas-border-strong: #b8c7dc;
    --nfas-bg: #f8fafc;
    --nfas-card: #ffffff;
    --nfas-text: #162033;
    --nfas-muted: #64748b;
    --nfas-radius: 10px;
    --nfas-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    max-width: 1560px;
    margin-right: 24px;
    color: var(--nfas-text);
}
.nfas-wrap h1 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 22px 0 6px;
    color: #0f172a;
}
.nfas-wrap h1 + p,
.nfas-wrap > p.description,
.nfas-wrap > p {
    color: var(--nfas-muted);
    font-size: 14px;
    margin-top: 6px;
}
.nfas-wrap h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
}
.nfas-wrap code {
    background: #eef2ff;
    color: #1e3a8a;
    border-radius: 5px;
    padding: 2px 6px;
}
.nfas-wrap .nfas-card,
.nfas-detail-card,
.nfas-detail-section {
    background: var(--nfas-card);
    border: 1px solid var(--nfas-border);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow);
    padding: 18px;
    max-width: 1400px;
}
.nfas-wrap .nfas-card + .nfas-card,
.nfas-dashboard .nfas-card,
.nfas-summary .nfas-card,
.nfas-cfop-detail .nfas-card {
    margin-top: 16px;
}
.nfas-table-card {
    padding: 0 !important;
    overflow: hidden;
}
.nfas-table-card .widefat {
    border: 0 !important;
}
.nfas-wrap .widefat {
    border: 1px solid var(--nfas-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.nfas-wrap .widefat thead th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    border-bottom: 1px solid var(--nfas-border);
}
.nfas-wrap .widefat td,
.nfas-wrap .widefat th {
    padding: 10px 12px;
    vertical-align: middle;
}
.nfas-wrap .widefat.striped > tbody > :nth-child(odd) {
    background-color: #fbfdff;
}
.nfas-wrap .widefat.striped > tbody > :nth-child(even) {
    background-color: #fff;
}
.nfas-wrap .button,
.nfas-wrap .button-secondary {
    border-color: #bfdbfe;
    color: var(--nfas-primary);
    background: #fff;
    border-radius: 7px;
    font-weight: 600;
    min-height: 36px;
    padding: 4px 14px;
    box-shadow: none;
}
.nfas-wrap .button:hover,
.nfas-wrap .button-secondary:hover {
    border-color: var(--nfas-primary);
    color: var(--nfas-primary-dark);
    background: var(--nfas-primary-soft);
}
.nfas-wrap .button-primary {
    background: var(--nfas-primary);
    border-color: var(--nfas-primary);
    color: #fff;
}
.nfas-wrap .button-primary:hover,
.nfas-wrap .button-primary:focus {
    background: var(--nfas-primary-dark);
    border-color: var(--nfas-primary-dark);
    color: #fff;
}
.nfas-actions-bar {
    background: #fff;
    border: 1px solid var(--nfas-border);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow);
    padding: 12px;
}
.nfas-actions-bar .button {
    min-width: 126px;
    text-align: center;
}
.nfas-kpi-grid {
    gap: 14px;
}
.nfas-kpi {
    border: 1px solid var(--nfas-border);
    border-left: 5px solid var(--nfas-primary);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow);
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
    padding: 16px 18px;
}
.nfas-kpi-warn {
    border-left-color: #d97706;
}
.nfas-kpi-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .055em;
    color: #475569;
}
.nfas-kpi-value {
    color: #0f172a;
    font-size: 32px;
    line-height: 1.05;
}
.nfas-kpi-hint {
    color: var(--nfas-muted);
}
.nfas-dashboard-grid {
    gap: 16px;
}
.nfas-severity-grid > div {
    border: 1px solid var(--nfas-border);
    background: #fff;
    border-radius: 9px;
}
.nfas-badge,
.nfas-status,
.nfas-sev {
    border-radius: 999px;
    font-size: 11px;
    padding: 4px 8px;
}
.nfas-baixa {
    background:#dbeafe;
    color:#1d4ed8;
}
.nfas-media {
    background:#fef3c7;
    color:#92400e;
}
.nfas-alta {
    background:#fee2e2;
    color:#991b1b;
}
.nfas-critica {
    background:#7f1d1d;
    color:#fff;
}
.nfas-status-pendente {
    background:#fef3c7;
    color:#92400e;
}
.nfas-status-confirmado {
    background:#dcfce7;
    color:#166534;
}
.nfas-status-corrigido {
    background:#e0f2fe;
    color:#075985;
}
.nfas-status-ignorado,
.nfas-status-falso_positivo {
    background:#e5e7eb;
    color:#374151;
}
.nfas-form-card {
    max-width: 1280px !important;
    padding: 20px 22px !important;
}
.nfas-wrap .form-table {
    margin-top: 0;
}
.nfas-wrap .form-table th {
    width: 220px;
    padding: 16px 18px 16px 0;
    color: #334155;
    font-weight: 700;
}
.nfas-wrap .form-table td {
    padding: 12px 0;
}
.nfas-wrap input[type="text"],
.nfas-wrap input[type="number"],
.nfas-wrap input[type="search"],
.nfas-wrap input[type="file"],
.nfas-wrap select,
.nfas-wrap textarea {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    min-height: 36px;
    box-shadow: none;
}
.nfas-wrap input[type="text"]:focus,
.nfas-wrap input[type="number"]:focus,
.nfas-wrap input[type="search"]:focus,
.nfas-wrap select:focus,
.nfas-wrap textarea:focus {
    border-color: var(--nfas-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
    outline: none;
}
.nfas-wrap input.regular-text {
    width: min(520px, 100%);
}
.nfas-wrap input.large-text,
.nfas-wrap textarea.large-text {
    width: min(960px, 100%);
}
.nfas-wrap textarea.large-text {
    min-height: 92px;
}
.nfas-wrap .description {
    color: var(--nfas-muted);
    margin-top: 6px;
}
.nfas-conditions {
    display: grid;
    gap: 8px;
    max-width: 760px;
}
.nfas-conditions p {
    margin: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.nfas-conditions input {
    min-width: 160px;
}
.nfas-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 8px 8px 0;
}
.nfas-inline .description {
    flex-basis: 100%;
    margin: 2px 0 0 0;
}
.nfas-summary-selector,
.nfas-cfop-filters,
.nfas-report-filters {
    background: #fff;
    border: 1px solid var(--nfas-border);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow);
    padding: 14px 16px;
}
.nfas-summary-selector label,
.nfas-cfop-filters label {
    font-weight: 700;
    color: #334155;
}
.nfas-summary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--nfas-border);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow);
    padding: 12px 14px;
}
.nfas-summary-card .widefat,
.nfas-cfop-detail .widefat {
    border-radius: 8px;
}
.nfas-report-scroll,
.nfas-cfop-doc-scroll {
    border: 1px solid var(--nfas-border);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow);
    overflow: auto;
}
.nfas-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}
.nfas-report-table td,
.nfas-cfop-doc-table td,
.nfas-cfop-inner-table td {
    border-color: #edf2f7;
}
.nfas-report-table tbody tr:hover,
.nfas-cfop-doc-table tbody tr:hover {
    background: #f8fbff !important;
}
.nfas-cfop-doc-row.nfas-doc-open {
    background: #eaf2ff !important;
}
.nfas-toggle-doc {
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
.nfas-cfop-items-panel {
    background: #f8fafc;
    border-left: 5px solid var(--nfas-primary);
}
.nfas-detail-grid,
.nfas-detail-section {
    max-width: 1400px;
}
.nfas-sped-line,
.nfas-code-block {
    border-radius: 8px;
    background: #0f172a;
    color: #e5e7eb;
    border-color: #0f172a;
}
.nfas-mono {
    color: #334155;
}
.nfas-pagination {
    margin: 10px 0;
}
.nfas-pagination .button {
    margin-left: 4px;
}
.notice-success,
.nfas-wrap .notice-success {
    border-left-color: #22c55e;
}
@media (max-width: 782px) {
    .nfas-wrap {
        margin-right: 10px;
    }
    .nfas-wrap .form-table th,
    .nfas-wrap .form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
    .nfas-actions-bar,
    .nfas-summary-actions {
        align-items: stretch;
    }
    .nfas-actions-bar .button,
    .nfas-summary-actions .button {
        width: 100%;
        text-align: center;
    }
    .nfas-wrap input.regular-text,
    .nfas-wrap input.large-text,
    .nfas-wrap textarea.large-text,
    .nfas-wrap select {
        width: 100%;
        max-width: 100%;
    }
}



/* ============================================================
   UX Pro refresh v0.4.8
   Objetivo: reduzir aparência de protótipo, padronizar telas,
   melhorar hierarquia visual, alinhamento, legibilidade e confiança.
   ============================================================ */

body.wp-admin {
    background: #f3f6fb;
}

.nfas-wrap {
    --nfas-primary: #174ea6;
    --nfas-primary-2: #2563eb;
    --nfas-primary-soft: #eef5ff;
    --nfas-primary-soft-2: #f7fbff;
    --nfas-ink: #0f172a;
    --nfas-text: #1f2937;
    --nfas-muted: #667085;
    --nfas-line: #d7e0ec;
    --nfas-line-soft: #e8eef6;
    --nfas-success: #15803d;
    --nfas-warning: #b45309;
    --nfas-danger: #b91c1c;
    --nfas-radius: 12px;
    --nfas-radius-sm: 8px;
    --nfas-shadow: 0 8px 22px rgba(15,23,42,.065);
    --nfas-shadow-soft: 0 2px 8px rgba(15,23,42,.045);
    max-width: 1680px;
    margin: 24px 28px 48px 20px;
    color: var(--nfas-text);
    font-size: 13px;
    line-height: 1.45;
}

/* Cabeçalho de página mais institucional */
.nfas-wrap > h1 {
    position: relative;
    margin: 0 0 6px;
    padding: 0;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -.02em;
    font-weight: 750;
    color: var(--nfas-ink);
}
.nfas-wrap > h1::after {
    content: "";
    display: block;
    width: 52px;
    height: 4px;
    margin-top: 10px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--nfas-primary), #60a5fa);
}
.nfas-wrap > h1 + p,
.nfas-wrap > .description,
.nfas-wrap > p.description {
    max-width: 1040px;
    margin: 10px 0 18px;
    color: var(--nfas-muted);
    font-size: 13.5px;
}

/* Cards */
.nfas-wrap .nfas-card,
.nfas-detail-card,
.nfas-detail-section {
    background: #fff;
    border: 1px solid var(--nfas-line);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow-soft);
    padding: 18px 20px;
    max-width: none;
    box-sizing: border-box;
}
.nfas-wrap .nfas-card:hover,
.nfas-detail-card:hover,
.nfas-detail-section:hover {
    border-color: #c7d4e6;
}
.nfas-wrap .nfas-card h2,
.nfas-detail-card h2,
.nfas-detail-section h2 {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.3;
    color: var(--nfas-ink);
    font-weight: 750;
}

/* Botões */
.nfas-wrap .button,
.nfas-wrap .button-secondary,
.nfas-wrap a.button,
.nfas-wrap button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 14px;
    border-radius: 8px;
    border: 1px solid #b8cdf3;
    background: #fff;
    color: var(--nfas-primary);
    font-weight: 650;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    text-decoration: none;
}
.nfas-wrap .button:hover,
.nfas-wrap .button-secondary:hover {
    background: var(--nfas-primary-soft);
    border-color: var(--nfas-primary-2);
    color: var(--nfas-primary);
}
.nfas-wrap .button-primary,
.nfas-wrap .button.button-primary,
.nfas-wrap button.button-primary {
    background: linear-gradient(180deg, #2b67e8, var(--nfas-primary));
    border-color: var(--nfas-primary);
    color: #fff;
    box-shadow: 0 6px 14px rgba(37,99,235,.18);
}
.nfas-wrap .button-primary:hover {
    background: linear-gradient(180deg, #1f5bd5, #123f8f);
    border-color: #123f8f;
    color: #fff;
}

/* Formulários com cara de produto */
.nfas-form-card {
    max-width: 1380px !important;
}
.nfas-wrap .form-table {
    border-collapse: separate;
    border-spacing: 0 10px;
}
.nfas-wrap .form-table th {
    width: 210px;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
    padding: 12px 16px 12px 0;
}
.nfas-wrap .form-table td {
    padding: 8px 0;
}
.nfas-wrap input[type="text"],
.nfas-wrap input[type="number"],
.nfas-wrap input[type="search"],
.nfas-wrap input[type="file"],
.nfas-wrap select,
.nfas-wrap textarea {
    min-height: 38px;
    border: 1px solid #cbd6e6;
    border-radius: 8px;
    background: #fff;
    color: var(--nfas-text);
    box-shadow: none;
    padding: 5px 10px;
}
.nfas-wrap select {
    padding-right: 32px;
}
.nfas-wrap input[type="text"]:focus,
.nfas-wrap input[type="number"]:focus,
.nfas-wrap input[type="search"]:focus,
.nfas-wrap input[type="file"]:focus,
.nfas-wrap select:focus,
.nfas-wrap textarea:focus {
    border-color: var(--nfas-primary-2);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.nfas-wrap input.regular-text {
    width: min(520px, 100%);
}
.nfas-wrap input.large-text,
.nfas-wrap textarea.large-text {
    width: min(1000px, 100%);
}
.nfas-wrap textarea.large-text {
    min-height: 96px;
}
.nfas-wrap .description {
    color: var(--nfas-muted);
    font-size: 12.5px;
}

/* Barras de ação e filtros */
.nfas-actions-bar,
.nfas-summary-selector,
.nfas-summary-actions,
.nfas-cfop-filters,
.nfas-report-filters,
.nfas-wrap form.nfas-card[method="get"] {
    background: #fff;
    border: 1px solid var(--nfas-line);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow-soft);
    padding: 14px 16px;
}
.nfas-actions-bar,
.nfas-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.nfas-actions-bar .button {
    min-width: 132px;
}

/* KPIs */
.nfas-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 14px;
    max-width: none;
}
.nfas-kpi {
    border: 1px solid var(--nfas-line);
    border-radius: var(--nfas-radius);
    background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
    box-shadow: var(--nfas-shadow-soft);
    border-left: 5px solid var(--nfas-primary);
    padding: 16px 18px;
}
.nfas-kpi-warn {
    border-left-color: #d97706;
}
.nfas-kpi-label {
    color: #475467;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.nfas-kpi-value {
    margin: 8px 0 4px;
    color: var(--nfas-ink);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.05;
}
.nfas-summary-kpis .nfas-kpi-value,
.nfas-cfop-kpis .nfas-kpi-value {
    font-size: 24px;
}
.nfas-kpi-hint {
    color: var(--nfas-muted);
    font-size: 12px;
    line-height: 1.35;
}

/* Grids */
.nfas-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: none;
    margin: 16px 0;
}

/* Tabelas */
.nfas-wrap .widefat {
    border: 1px solid var(--nfas-line);
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
}
.nfas-wrap .widefat thead th {
    background: #f3f7fc;
    border-bottom: 1px solid var(--nfas-line);
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    text-transform: none;
}
.nfas-wrap .widefat td,
.nfas-wrap .widefat th {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}
.nfas-wrap .widefat tbody tr:nth-child(odd) {
    background: #fcfdff;
}
.nfas-wrap .widefat tbody tr:hover {
    background: #f5f9ff !important;
}
.nfas-table-card {
    padding: 0 !important;
    overflow: hidden;
}
.nfas-table-card .widefat {
    border: 0;
    border-radius: 0;
}

/* Badges */
.nfas-badge,
.nfas-status,
.nfas-sev {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.1;
    padding: 5px 9px;
    white-space: nowrap;
}
.nfas-baixa {
    background: #dbeafe;
    color: #1d4ed8;
}
.nfas-media {
    background: #fef3c7;
    color: #92400e;
}
.nfas-alta {
    background: #fee2e2;
    color: #991b1b;
}
.nfas-critica {
    background: #7f1d1d;
    color: #fff;
}
.nfas-status-pendente {
    background: #fef3c7;
    color: #92400e;
}
.nfas-status-confirmado {
    background: #dcfce7;
    color: #166534;
}
.nfas-status-corrigido {
    background: #e0f2fe;
    color: #075985;
}
.nfas-status-ignorado,
.nfas-status-falso_positivo {
    background: #e5e7eb;
    color: #374151;
}

/* Painel inicial */
.nfas-dashboard .nfas-actions-bar {
    margin: 16px 0 18px;
}
.nfas-severity-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 12px;
}
.nfas-severity-grid > div {
    background: #f8fafc;
    border: 1px solid var(--nfas-line);
    border-radius: 10px;
    padding: 14px;
}
.nfas-severity-grid strong {
    display: block;
    margin-top: 8px;
    color: var(--nfas-ink);
    font-size: 24px;
    line-height: 1;
}

/* Resumo fiscal */
.nfas-summary-selector {
    display: grid;
    grid-template-columns: 120px minmax(360px, 1fr) auto;
    gap: 10px;
    align-items: center;
    max-width: 1400px;
}
.nfas-summary-selector select {
    min-width: 0;
    width: 100%;
}
.nfas-summary .nfas-card {
    margin: 14px 0;
}
.nfas-summary-card .widefat th,
.nfas-summary-card .widefat td {
    white-space: nowrap;
}
.nfas-inline-warning {
    border-left: 4px solid #f59e0b !important;
    background: #fffbeb !important;
    padding: 10px 12px !important;
    border-radius: 8px;
}
.nfas-erp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 12px 16px;
    max-width: 1120px;
}
.nfas-erp-grid label {
    font-weight: 700;
    color: #344054;
}
.nfas-erp-grid input {
    width: 100%;
    margin-top: 4px;
}

/* Relatório de auditoria */
.nfas-report-scroll {
    border: 1px solid var(--nfas-line);
    border-radius: var(--nfas-radius);
    background: #fff;
    box-shadow: var(--nfas-shadow-soft);
}
.nfas-report-table {
    width: 100% !important;
    min-width: 1220px !important;
}
.nfas-report-table th {
    white-space: nowrap;
}
.nfas-report-table td {
    line-height: 1.42;
}
.nfas-report-table .nfas-col-identificacao { width: 310px; }
.nfas-report-table .nfas-col-tributacao { width: 150px; }
.nfas-report-table .nfas-col-auditoria { width: 140px; }
.nfas-report-table .nfas-col-mensagem { width: 300px; }
.nfas-report-table .nfas-col-acao { width: 360px; }
.nfas-report-table .nfas-col-status { width: 110px; }
.nfas-meta-line {
    display: block;
    margin-bottom: 3px;
}
.nfas-meta-line strong {
    color: #475467;
}

/* CFOP detalhe agrupado */
.nfas-cfop-doc-scroll {
    border: 1px solid var(--nfas-line);
    border-radius: var(--nfas-radius);
    box-shadow: var(--nfas-shadow-soft);
}
.nfas-cfop-doc-table {
    min-width: 1450px;
}
.nfas-toggle-doc {
    border-radius: 999px;
    width: 26px;
    height: 26px;
    color: var(--nfas-primary);
    border-color: #bfdbfe;
    background: #fff;
}
.nfas-toggle-doc:hover {
    background: var(--nfas-primary-soft);
}
.nfas-cfop-doc-row.nfas-doc-open {
    background: #eaf2ff !important;
}
.nfas-cfop-items-panel {
    background: #f8fafc;
    border-left: 5px solid var(--nfas-primary);
}

/* Regras */
.nfas-conditions {
    display: grid;
    gap: 8px;
    max-width: 820px;
}
.nfas-conditions p {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 120px minmax(160px, 1fr);
    gap: 8px;
}
.nfas-conditions input,
.nfas-conditions select {
    width: 100%;
}

/* Configurações */
.nfas-wrap input[type="number"] {
    max-width: 220px;
}

/* Código e detalhes */
.nfas-mono,
.nfas-code,
.nfas-report-table .nfas-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: #334155;
}
.nfas-sped-line,
.nfas-code-block {
    border-radius: 10px;
    background: #0f172a;
    color: #e5e7eb;
    border-color: #0f172a;
    padding: 14px;
}

/* Links com aparência mais discreta/profissional */
.nfas-wrap a {
    color: var(--nfas-primary);
    text-decoration: none;
}
.nfas-wrap a:hover {
    color: var(--nfas-primary-dark, #123f8f);
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 1280px) {
    .nfas-kpi-grid {
        grid-template-columns: repeat(2, minmax(210px, 1fr));
    }
    .nfas-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .nfas-summary-selector {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 782px) {
    .nfas-wrap {
        margin: 16px 10px 36px;
    }
    .nfas-wrap .form-table th,
    .nfas-wrap .form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
    .nfas-kpi-grid,
    .nfas-severity-grid,
    .nfas-erp-grid {
        grid-template-columns: 1fr;
    }
    .nfas-conditions p {
        grid-template-columns: 1fr;
    }
    .nfas-wrap input.regular-text,
    .nfas-wrap input.large-text,
    .nfas-wrap textarea.large-text,
    .nfas-wrap select {
        width: 100%;
        max-width: 100%;
    }
}

/* Impressão mantém layout limpo */
@media print {
    .nfas-wrap {
        max-width: none;
        margin: 0;
    }
    .nfas-wrap .nfas-card,
    .nfas-kpi {
        box-shadow: none !important;
        border-color: #bdbdbd !important;
    }
}


/* Detalhe da ocorrência 0.5.0 */
.nfas-detail-v2 {
    --nfas-danger: #b42318;
    --nfas-danger-soft: #fff1f3;
    --nfas-danger-line: #fda29b;
}
.nfas-focus-alert {
    border-left: 5px solid var(--nfas-primary);
    margin-bottom: 16px;
}
.nfas-focus-alert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.nfas-focus-alert-head > div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.nfas-focus-message {
    font-size: 15px;
    margin: 12px 0 10px;
    color: var(--nfas-ink);
}
.nfas-focus-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nfas-focus-meta span {
    background: #f8fafc;
    border: 1px solid var(--nfas-line);
    border-radius: 999px;
    padding: 5px 10px;
    color: #475467;
}

.nfas-note-review-card {
    margin: 16px 0;
    border-top: 4px solid var(--nfas-primary);
}
.nfas-note-review-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.nfas-note-review-head h2 {
    margin: 0 0 4px;
}
.nfas-note-review-head p {
    margin: 0;
    color: #475467;
}
.nfas-note-review-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.nfas-note-review-stats span {
    display: inline-flex;
    align-items: center;
    background: var(--nfas-primary-soft);
    color: var(--nfas-primary-dark);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 700;
}

.nfas-note-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 8px 12px;
    background: #f8fafc;
    border: 1px solid var(--nfas-line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 18px;
}
.nfas-note-meta-grid .nfas-kv {
    margin: 0;
}

.nfas-note-items-stack {
    display: grid;
    gap: 12px;
}
.nfas-note-item {
    border: 1px solid var(--nfas-line);
    border-radius: 14px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.04);
}
.nfas-note-item-alert {
    border-color: var(--nfas-danger-line);
    background: var(--nfas-danger-soft);
    box-shadow: 0 8px 24px rgba(180, 35, 24, 0.10);
}
.nfas-note-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}
.nfas-note-item-title {
    display: grid;
    gap: 4px;
    font-size: 14px;
    margin-bottom: 12px;
}
.nfas-note-item-alert .nfas-note-item-title,
.nfas-note-item-alert .nfas-note-item-title strong {
    color: var(--nfas-danger);
}
.nfas-alert-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #d92d20;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
}
.nfas-muted {
    color: #667085;
    margin-left: 8px;
    font-weight: 500;
}
.nfas-note-item-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 12px;
}
.nfas-note-item-grid h4 {
    margin: 0 0 6px;
    color: #344054;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.nfas-kv {
    display: block;
    margin: 0 0 4px;
    color: #475467;
    line-height: 1.45;
}
.nfas-kv strong {
    color: #344054;
}
.nfas-kv-alert,
.nfas-kv-alert strong,
.nfas-note-item-alert .nfas-kv-alert,
.nfas-note-item-alert .nfas-kv-alert strong {
    color: var(--nfas-danger) !important;
    font-weight: 800;
}

.nfas-c190-stack {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.nfas-c190-pill {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid var(--nfas-line);
    background: #fff;
    border-radius: 10px;
    padding: 9px 10px;
}
.nfas-c190-pill span {
    background: #f8fafc;
    border-radius: 999px;
    padding: 4px 8px;
}
.nfas-c190-alert {
    border-color: var(--nfas-danger-line);
    background: var(--nfas-danger-soft);
}
.nfas-c190-alert span {
    color: var(--nfas-danger);
    font-weight: 700;
}

.nfas-accordion {
    margin: 12px 0;
}
.nfas-accordion > summary {
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--nfas-line);
    border-radius: 12px;
    background: #fff;
    padding: 13px 16px;
    font-weight: 800;
    color: var(--nfas-ink);
    box-shadow: var(--nfas-shadow-soft);
}
.nfas-accordion > summary::-webkit-details-marker {
    display: none;
}
.nfas-accordion > summary:before {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    margin-right: 9px;
    background: var(--nfas-primary-soft);
    color: var(--nfas-primary);
    font-weight: 900;
}
.nfas-accordion[open] > summary:before {
    content: '−';
}
.nfas-accordion-card {
    margin-top: 10px;
}
.nfas-form-grid {
    display: grid;
    grid-template-columns: 260px minmax(360px, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 1280px) {
    .nfas-note-meta-grid,
    .nfas-note-item-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
    .nfas-form-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 782px) {
    .nfas-focus-alert-head,
    .nfas-note-review-head {
        display: block;
    }
    .nfas-note-meta-grid,
    .nfas-note-item-grid {
        grid-template-columns: 1fr;
    }
}


/* Editor assistido do SPED v0.5.1 */
.nfas-detail-actions {
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    margin:12px 0 16px;
}
.nfas-edit-card {
    border-left:4px solid #2271b1;
}
.nfas-edit-warning {
    background:#fff8e5;
    border:1px solid #f0d98c;
    color:#5c4100;
    padding:10px 12px;
    border-radius:8px;
    margin-bottom:14px;
}
.nfas-edit-grid {
    display:grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap:12px;
    margin:12px 0;
}
.nfas-edit-field {
    display:block;
    background:#fff;
    border:1px solid #dbe3ef;
    border-radius:10px;
    padding:10px;
}
.nfas-edit-field-alert {
    border-color:#d63638;
    box-shadow:0 0 0 1px rgba(214,54,56,.12);
}
.nfas-edit-field-changed {
    border-color:#1d7f45;
    background:#f6fff8;
}
.nfas-edit-label {
    display:flex;
    gap:6px;
    align-items:center;
    flex-wrap:wrap;
    font-weight:700;
    color:#172033;
}
.nfas-edit-label code {
    font-weight:400;
    color:#4c5f7a;
    background:#f3f6fb;
}
.nfas-edit-label em {
    display:inline-block;
    font-style:normal;
    font-size:11px;
    padding:2px 6px;
    border-radius:999px;
    background:#ffe1e1;
    color:#8a0000;
}
.nfas-edit-original {
    display:block;
    color:#667085;
    font-size:12px;
    margin:5px 0;
    min-height:18px;
}
.nfas-edit-field input[type="text"] {
    width:100%;
    min-height:34px;
}
@media (max-width: 1280px) {
    .nfas-edit-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 782px) {
    .nfas-edit-grid { grid-template-columns: 1fr; }
}

/* v0.5.2 - seletor de arquivo no relatório */
.nfas-report-file-picker {
    margin: 14px 0 18px;
}
.nfas-file-select-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.nfas-file-select-form select {
    min-width: min(720px, 100%);
    max-width: 100%;
}
@media (max-width: 782px) {
    .nfas-file-select-form {
        display: grid;
        grid-template-columns: 1fr;
    }
    .nfas-file-select-form select,
    .nfas-file-select-form .button {
        width: 100%;
        text-align: center;
    }
}


/* v0.5.4 - Edições pendentes */
.nfas-select-wide { min-width: 420px; max-width: 100%; }
.nfas-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.nfas-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.nfas-kpi-grid-small { grid-template-columns: repeat(2, minmax(160px, 1fr)); max-width: 520px; }
.nfas-alert-soft { border-left:4px solid #f59e0b; background:#fff7ed; }
.nfas-edit-review-card { margin-top:16px; }
.nfas-edit-review-header { display:flex; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-bottom:14px; }
.nfas-edit-review-header h2 { margin:0 0 8px; font-size:18px; }
.nfas-edit-review-header p { margin:0 0 6px; }
.nfas-diff-new { background:#ecfdf5; color:#047857; border-color:#a7f3d0; font-weight:700; }
.nfas-before-after { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin-top:12px; }
.nfas-before-after h3 { margin:0 0 8px; }
.nfas-before-after pre { white-space:pre-wrap; word-break:break-word; background:#0f172a; color:#e5e7eb; border-radius:10px; padding:14px; max-height:260px; overflow:auto; font-size:12px; line-height:1.5; }
@media (max-width: 1100px) {
  .nfas-before-after { grid-template-columns:1fr; }
  .nfas-select-wide { min-width: 260px; }
}

/* v0.5.5 - fluxo de revisão da ocorrência */
.nfas-detail-toolbar {
    background: #fff;
    border: 1px solid var(--nfas-line);
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--nfas-shadow-soft);
}
.nfas-detail-toolbar .button.disabled {
    opacity: .45;
    pointer-events: none;
    background: #f3f6fb;
    color: #64748b;
    border-color: var(--nfas-line);
}
.nfas-nav-counter {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid var(--nfas-line);
    font-size: 12px;
    font-weight: 700;
}
.nfas-quick-status-card {
    display: grid;
    grid-template-columns: minmax(220px, 340px) 1fr;
    gap: 18px;
    align-items: center;
    margin: 14px 0;
}
.nfas-quick-status-card h2 {
    margin: 0 0 6px;
    font-size: 16px;
}
.nfas-quick-status-card p {
    margin: 0;
}
.nfas-quick-status-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nfas-status-button {
    border-radius: 999px !important;
    font-weight: 800 !important;
}
.nfas-status-button.is-current {
    border-color: var(--nfas-primary) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .16) !important;
    color: var(--nfas-primary) !important;
}
.nfas-status-button-confirmado {
    background: #ecfdf5 !important;
    border-color: #bbf7d0 !important;
    color: #047857 !important;
}
.nfas-status-button-corrigido {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}
.nfas-status-button-ignorado,
.nfas-status-button-falso_positivo {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
.nfas-status-button-pendente {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #c2410c !important;
}
@media (max-width: 1100px) {
    .nfas-quick-status-card {
        grid-template-columns: 1fr;
    }
    .nfas-quick-status-form {
        justify-content: flex-start;
    }
}


/* Pré-validação da exportação v0.5.6 */
.nfas-prevalidation .nfas-prev-kpis .nfas-kpi-value {
    font-size: 26px;
}
.nfas-prev-actions {
    box-shadow: none;
    margin: 12px 0 0;
}
.nfas-prev-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.nfas-prev-check {
    border: 1px solid var(--nfas-border, #d9e2ef);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
}
.nfas-prev-check-ok {
    border-left: 5px solid #16a34a;
}
.nfas-prev-check-warn {
    border-left: 5px solid #d97706;
    background: #fffbeb;
}
.nfas-prev-check-block {
    border-left: 5px solid #dc2626;
    background: #fef2f2;
}
.nfas-prev-check-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.nfas-prev-check p {
    margin: 0;
    color: #475569;
}
.nfas-prev-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}
.nfas-prev-ok {
    background: #dcfce7;
    color: #166534;
}
.nfas-prev-warn {
    background: #fef3c7;
    color: #92400e;
}
.nfas-prev-block {
    background: #fee2e2;
    color: #991b1b;
}
.nfas-prev-reg-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
}
.nfas-prev-reg-card {
    border: 1px solid var(--nfas-border, #d9e2ef);
    border-radius: 10px;
    padding: 12px;
    background: #f8fafc;
}
.nfas-prev-reg-card strong {
    display: block;
    font-size: 18px;
    color: #0f172a;
}
.nfas-prev-reg-card span {
    color: #64748b;
    font-size: 12px;
}
.nfas-prev-warning-card {
    border-left: 5px solid #d97706 !important;
}
.nfas-prev-edit-line {
    margin-bottom: 5px;
    font-size: 12px;
}
.nfas-prev-old {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 5px;
    padding: 1px 6px;
    margin: 0 3px;
}
.nfas-prev-new {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    border-radius: 5px;
    padding: 1px 6px;
    margin: 0 3px;
}
.nfas-card-title-inline {
    padding: 16px 18px 0;
}
@media (max-width: 1100px) {
    .nfas-prev-checklist,
    .nfas-prev-reg-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.6.0 - Revisão e Estabilidade */
.nfas-stability code { background: #f6f7f7; padding: 2px 5px; border-radius: 4px; }
.nfas-prev-ok { background: #e7f7ed; color: #116329; border: 1px solid #b8e6c8; }
.nfas-prev-warn { background: #fff7e6; color: #7a4b00; border: 1px solid #f5d28a; }
.nfas-prev-block { background: #fdecec; color: #8a1f11; border: 1px solid #f0b8b1; }
.nfas-checklist { margin: 8px 0 0 18px; list-style: disc; }
.nfas-checklist li { margin: 7px 0; }


/* v0.6.1 - Pré-validação: seletor de arquivo mais usável */
.nfas-prevalidation-picker {
    max-width: 1400px;
    padding: 18px 20px !important;
}
.nfas-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.nfas-picker-head h2 {
    margin: 0 0 5px;
    font-size: 17px;
    color: var(--nfas-ink);
}
.nfas-picker-head p {
    margin: 0;
    color: var(--nfas-muted);
}
.nfas-picker-row {
    display: grid;
    grid-template-columns: minmax(460px, 1fr) 220px;
    gap: 12px;
    align-items: end;
}
.nfas-picker-field {
    display: block;
}
.nfas-picker-field span {
    display: block;
    margin: 0 0 6px;
    font-weight: 750;
    color: #334155;
}
.nfas-picker-field select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 44px;
    font-size: 14px;
}
.nfas-picker-row .button-primary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.nfas-compact-table th,
.nfas-compact-table td {
    vertical-align: middle;
}
@media (max-width: 980px) {
    .nfas-picker-head {
        display: grid;
        grid-template-columns: 1fr;
    }
    .nfas-picker-row {
        grid-template-columns: 1fr;
    }
    .nfas-picker-row .button,
    .nfas-picker-head .button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}


.nfas-export-alert{
    margin-top:14px;
    padding:12px 14px;
    border-left:4px solid #d97706;
    background:#fff7ed;
    color:#7c2d12;
    border-radius:10px;
    line-height:1.45;
}
.nfas-table-card code{
    word-break:break-all;
    white-space:normal;
}


/* Arquivos importados v0.6.3 — layout em cards para evitar linhas gigantes e ações desalinhadas */
.nfas-page-intro {
    max-width: 980px;
    margin: 0 0 16px 0;
    color: #4b5f7a;
}
.nfas-empty-state {
    max-width: 760px;
}
.nfas-files-list {
    max-width: 1380px;
    display: grid;
    gap: 14px;
}
.nfas-file-card {
    background: #fff;
    border: 1px solid #d9e3f2;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 18px;
    padding: 16px;
    align-items: stretch;
}
.nfas-file-card__main {
    min-width: 0;
}
.nfas-file-card__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef3fb;
}
.nfas-file-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #0f172a;
}
.nfas-file-title strong {
    font-size: 15px;
}
.nfas-file-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    border-radius: 999px;
    background: #eef5ff;
    color: #0b4eb3;
    font-weight: 700;
}
.nfas-file-subtitle {
    margin-top: 6px;
    color: #475569;
    font-size: 13px;
}
.nfas-badge-muted {
    background: #f1f5f9;
    color: #64748b;
}
.nfas-file-status {
    flex: 0 0 auto;
}
.nfas-file-meta {
    margin: 14px 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
}
.nfas-file-meta div {
    background: #f8fbff;
    border: 1px solid #e8f0fb;
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
}
.nfas-file-meta dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 4px;
}
.nfas-file-meta dd {
    margin: 0;
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}
.nfas-file-card__actions {
    display: grid;
    gap: 10px;
    align-content: start;
}
.nfas-audit-box {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 12px;
}
.nfas-test-rule-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 2px;
    font-weight: 600;
}
.nfas-audit-box .description {
    display: block;
    margin: 0 0 10px 24px;
    color: #64748b;
    font-size: 12px;
}
.nfas-btn {
    border-radius: 8px !important;
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: none !important;
}
.nfas-btn-audit {
    width: 100%;
}
.nfas-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.nfas-btn-danger {
    color: #b42318 !important;
    border-color: #fecaca !important;
    background: #fff !important;
}
.nfas-btn-danger:hover {
    border-color: #f87171 !important;
    color: #7f1d1d !important;
}
@media (max-width: 1280px) {
    .nfas-file-card {
        grid-template-columns: 1fr;
    }
    .nfas-file-card__actions {
        grid-template-columns: 1fr;
    }
    .nfas-action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 782px) {
    .nfas-file-meta {
        grid-template-columns: 1fr 1fr;
    }
    .nfas-action-grid {
        grid-template-columns: 1fr;
    }
    .nfas-file-card__head {
        flex-direction: column;
    }
}


/* Relatório 0.7.0 — Conferência fiscal por nota */
.nfas-view-switch {
    margin: 14px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.nfas-view-switch h2 {
    margin: 0 0 4px;
}
.nfas-view-switch p {
    margin: 0;
}
.nfas-view-switch-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.nfas-note-view {
    max-width: 1500px;
    display: grid;
    gap: 16px;
    margin: 14px 0;
}
.nfas-note-card {
    background: #fff;
    border: 1px solid #d9e3f2;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    padding: 16px;
}
.nfas-note-card-cadastro {
    border-left: 4px solid #2563eb;
}
.nfas-note-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.nfas-note-header h3 {
    margin: 4px 0 4px;
    color: #0f172a;
    font-size: 18px;
}
.nfas-note-type {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.nfas-note-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 650px;
}
.nfas-note-totals span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid #e3ecf8;
    color: #334155;
}
.nfas-muted {
    color: #64748b;
    font-size: 12px;
}
.nfas-note-alert-list {
    display: grid;
    gap: 8px;
    margin: 10px 0 12px;
}
.nfas-note-alert {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 10px;
    padding: 10px 12px;
    color: #7c2d12;
    line-height: 1.45;
}
.nfas-note-alert .button-small {
    margin-left: 8px;
}
.nfas-note-columns {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 16px;
}
.nfas-note-columns h4 {
    margin: 0 0 8px;
}
.nfas-note-items-wrap {
    overflow-x: auto;
    border: 1px solid #e3ecf8;
    border-radius: 12px;
    background: #fff;
}
.nfas-note-items-table {
    border: 0 !important;
    min-width: 1180px;
}
.nfas-note-items-table th {
    background: #f8fbff;
    color: #334155;
    font-weight: 800;
}
.nfas-note-items-table th,
.nfas-note-items-table td {
    vertical-align: top;
    line-height: 1.35;
}
.nfas-note-item-row-alert td {
    background: #fff1f2 !important;
    color: #7f1d1d;
    font-weight: 600;
}
.nfas-alert-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 800;
    margin-top: 3px;
}
.nfas-code {
    font-family: Consolas, Monaco, monospace;
}
.nfas-note-details {
    margin-top: 12px;
    border: 1px solid #e3ecf8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fbff;
}
.nfas-note-details summary {
    cursor: pointer;
    font-weight: 800;
    color: #0f172a;
}
@media (max-width: 1000px) {
    .nfas-view-switch,
    .nfas-note-header {
        flex-direction: column;
    }
    .nfas-note-totals {
        justify-content: flex-start;
    }
    .nfas-note-columns {
        grid-template-columns: 1fr;
    }
}


.nfas-row-alert td{background:#fff7f7!important;border-top:1px solid #fecaca;border-bottom:1px solid #fecaca}
.nfas-book-table td{vertical-align:top}
.nfas-book-table tfoot th{background:#eef4ff;font-weight:800}



/* Bulk correction */
.nfas-bulk-correction-card {
    margin: 14px 0;
    padding: 18px;
    border-left: 4px solid #d97706;
}
.nfas-bulk-correction-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) minmax(280px, 1.3fr);
    gap: 12px;
    align-items: end;
    margin: 12px 0;
}
.nfas-bulk-correction-grid select,
.nfas-bulk-correction-grid input[type="text"] {
    width: 100%;
}
.nfas-checkline {
    display: block;
    margin: 8px 0;
    font-weight: 500;
}
.nfas-bulk-correction-disabled {
    border-left-color: #94a3b8;
    opacity: 0.95;
}
@media (max-width: 960px) {
    .nfas-bulk-correction-grid {
        grid-template-columns: 1fr;
    }
}


/* Relatório Montável v0.7.4 */
.nfas-builder .nfas-builder-filter {
    max-width: 1600px;
    border-radius: 12px;
    border: 1px solid #d6e0ef;
    box-shadow: 0 6px 18px rgba(20, 44, 84, .06);
}
.nfas-builder-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(140px, 1fr));
    gap: 12px;
    align-items: end;
}
.nfas-builder-grid label span {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #0f172a;
}
.nfas-builder-grid select,
.nfas-builder-grid input[type="search"] {
    width: 100%;
    min-height: 42px;
    border-color: #b8c7dc;
    border-radius: 8px;
}
.nfas-builder-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.nfas-builder-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 12px;
    max-width: 1600px;
    margin: 14px 0;
}
.nfas-builder-kpis .nfas-kpi {
    background: #fff;
    border: 1px solid #d6e0ef;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(20, 44, 84, .06);
}
.nfas-builder-kpis .nfas-kpi span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
    font-weight: 700;
}
.nfas-builder-kpis .nfas-kpi strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
    color: #0f172a;
}
.nfas-builder-help {
    max-width: 1600px !important;
    border-radius: 10px;
    border-left: 4px solid #2563eb !important;
}
.nfas-note-card {
    max-width: 1600px;
    background: #fff;
    border: 1px solid #d6e0ef;
    border-radius: 14px;
    margin: 14px 0;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(20, 44, 84, .07);
}
.nfas-note-card.has-alert {
    border-color: #f1b7b7;
}
.nfas-note-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
    border-bottom: 1px solid #d6e0ef;
}
.nfas-note-head h2 {
    margin: 6px 0 4px;
    font-size: 20px;
}
.nfas-note-type {
    display: inline-block;
    background: #e7f0ff;
    color: #0b4aa2;
    font-weight: 800;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
}
.nfas-note-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
    min-width: 360px;
}
.nfas-note-totals span {
    background: #fff;
    border: 1px solid #d6e0ef;
    border-radius: 10px;
    padding: 8px 10px;
    color: #64748b;
    font-size: 12px;
}
.nfas-note-totals strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    margin-top: 2px;
}
.nfas-alert-count {
    color: #b42318 !important;
}
.nfas-simple-items {
    padding: 0;
    overflow-x: auto;
}
.nfas-simple-items table {
    border: 0;
    min-width: 1120px;
}
.nfas-simple-items th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 800;
}
.nfas-simple-items td {
    vertical-align: top;
    padding: 10px 12px;
}
.nfas-item-alert td {
    background: #fff7f7 !important;
}
.nfas-item-alert td:first-child {
    border-left: 4px solid #dc2626;
}
.nfas-mini-alert {
    border: 1px solid #f1b7b7;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
    color: #7f1d1d;
    margin-bottom: 6px;
    max-width: 340px;
}
@media (max-width: 1320px) {
    .nfas-builder-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
    .nfas-builder-kpis {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
    .nfas-note-head {
        flex-direction: column;
    }
    .nfas-note-totals {
        min-width: 0;
    }
}


/* Workspace Fiscal v0.8.0 */
.nfas-workspace-page { margin: 0 0 0 -20px; }
.nfas-ws-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 280px;
    min-height: calc(100vh - 32px);
    background: #eef3f9;
}
.nfas-ws-left,
.nfas-ws-right {
    background: #fff;
    border-right: 1px solid #d7e1ee;
    padding: 14px;
    overflow-y: auto;
    position: sticky;
    top: 32px;
    height: calc(100vh - 32px);
    box-sizing: border-box;
}
.nfas-ws-right {
    border-right: 0;
    border-left: 1px solid #d7e1ee;
}
.nfas-ws-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px 14px;
    border-bottom: 1px solid #e5ebf3;
}
.nfas-ws-brand strong { font-size: 18px; color: #0f172a; }
.nfas-ws-brand span { color: #64748b; font-size: 12px; }
.nfas-ws-section-title {
    margin: 16px 0 8px;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
}
.nfas-ws-tree details { margin-bottom: 6px; }
.nfas-ws-tree summary {
    cursor: pointer;
    font-weight: 800;
    color: #1e293b;
    padding: 6px 4px;
}
.nfas-ws-tree summary span {
    float: right;
    background: #eef3f9;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10px;
    color: #64748b;
}
.nfas-ws-file {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    text-decoration: none;
    color: #334155;
    padding: 8px;
    border-radius: 8px;
    margin: 3px 0;
}
.nfas-ws-file:hover { background: #f5f8fc; color: #0f4aa3; }
.nfas-ws-file.is-active { background: #eaf2ff; color: #0f4aa3; box-shadow: inset 3px 0 #2563eb; }
.nfas-ws-file small { display: block; color: #7b8798; margin-top: 2px; line-height: 1.2; }
.nfas-ws-nav { display: grid; gap: 3px; }
.nfas-ws-nav a,
.nfas-ws-nav .is-disabled {
    display: flex;
    gap: 7px;
    align-items: center;
    padding: 8px 9px;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
}
.nfas-ws-nav a:hover,
.nfas-ws-nav a.is-active { background: #eef5ff; color: #0f4aa3; }
.nfas-ws-nav .is-disabled { color: #94a3b8; }
.nfas-ws-nav em {
    margin-left: auto;
    font-size: 10px;
    font-style: normal;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 999px;
}
.nfas-ws-main {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}
.nfas-ws-top {
    background: #fff;
    border-bottom: 1px solid #d7e1ee;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nfas-ws-top h1 { margin: 0; font-size: 19px; color: #0f172a; }
.nfas-ws-top p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.nfas-ws-top-actions { display: flex; gap: 8px; }
.nfas-ws-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #d7e1ee;
}
.nfas-ws-result-count { color: #475569; }
.nfas-ws-result-count strong { color: #0f172a; }
.nfas-ws-alert-total {
    margin-left: 8px;
    background: #fff1f1;
    color: #b42318;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: 3px 8px;
    font-weight: 700;
    font-size: 11px;
}
.nfas-ws-toolbar-buttons { display: flex; gap: 6px; }
.nfas-ws-toolbar .dashicons { font-size: 16px; width: 16px; height: 16px; margin-top: 3px; }
.nfas-ws-column-popover {
    position: absolute;
    right: 296px;
    top: 100px;
    width: 320px;
    max-height: 72vh;
    overflow: auto;
    z-index: 50;
    background: #fff;
    border: 1px solid #cbd7e6;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(15,23,42,.18);
    padding: 14px;
}
.nfas-ws-column-popover[hidden] { display: none !important; }
.nfas-ws-column-popover-head {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.nfas-ws-column-list { margin-top: 10px; display: grid; gap: 4px; }
.nfas-ws-col-item {
    display: flex; align-items: center; gap: 7px;
    border: 1px solid #e2e8f0;
    padding: 7px 8px;
    border-radius: 7px;
    background: #fff;
    cursor: grab;
}
.nfas-ws-col-item.dragging { opacity: .45; }
.nfas-ws-col-item .dashicons { color: #94a3b8; }
.nfas-ws-grid-wrap {
    overflow: auto;
    height: calc(100vh - 178px);
    background: #fff;
}
.nfas-ws-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    color: #334155;
}
.nfas-ws-grid thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom: 1px solid #cbd5e1;
    padding: 8px 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 800;
}
.nfas-ws-grid th[data-col],
.nfas-ws-grid td[data-col] { min-width: 88px; }
.nfas-ws-grid th[data-col="produto"],
.nfas-ws-grid td[data-col="produto"] { min-width: 280px; max-width: 420px; }
.nfas-ws-grid th[data-col="participante"],
.nfas-ws-grid td[data-col="participante"] { min-width: 220px; max-width: 330px; }
.nfas-ws-grid th[data-col="alerta"],
.nfas-ws-grid td[data-col="alerta"] { min-width: 150px; }
.nfas-ws-grid td {
    padding: 7px 10px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: top;
    background: #fff;
}
.nfas-ws-grid .nfas-ws-item-row:hover td { background: #f8fbff; }
.nfas-ws-grid .nfas-ws-item-row.has-alert td { background: #fffafa; }
.nfas-ws-grid .nfas-ws-item-row.has-alert:hover td { background: #fff4f4; }
.nfas-ws-select { width: 34px !important; min-width: 34px !important; text-align: center !important; }
.nfas-ws-doc-row td {
    background: #eef5ff !important;
    border-top: 1px solid #cbdcf6;
    border-bottom: 1px solid #cbdcf6;
    padding: 6px 10px;
}
.nfas-ws-docline {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
    color: #475569;
}
.nfas-ws-doc-number { color: #0f4aa3; font-weight: 900; }
.nfas-ws-doc-value { margin-left: auto; font-weight: 800; color: #0f172a; }
.nfas-ws-doc-alert {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
}
.nfas-ws-product-code {
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    margin-right: 5px;
}
.nfas-ws-alert-btn {
    border: 1px solid #fecaca;
    background: #fff1f1;
    color: #b42318;
    border-radius: 7px;
    padding: 4px 7px;
    cursor: pointer;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nfas-ws-alert-btn:hover { background: #ffe4e4; }
.nfas-ws-alert-btn .dashicons { font-size: 15px; width: 15px; height: 15px; }
.nfas-ws-ok { color: #7c8a9e; font-size: 11px; }
.nfas-ws-empty { padding: 30px !important; text-align: center; color: #64748b; }
.nfas-ws-pagination {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #d7e1ee;
}
.nfas-ws-filter-form label {
    display: block;
    font-weight: 700;
    color: #334155;
    font-size: 12px;
    margin-bottom: 10px;
}
.nfas-ws-filter-form select,
.nfas-ws-filter-form input[type="search"] {
    width: 100%;
    margin-top: 5px;
    min-height: 36px;
    border-radius: 7px;
}
.nfas-ws-filter-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
}
.nfas-ws-filter-divider {
    margin: 15px 0 9px;
    padding-top: 11px;
    border-top: 1px solid #e5ebf3;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
}
.nfas-ws-filter-submit { width: 100%; min-height: 38px; margin-top: 3px !important; }
.nfas-ws-quick { margin-top: 12px; }
.nfas-ws-quick a {
    display: block;
    text-decoration: none;
    color: #334155;
    padding: 7px 4px;
    border-bottom: 1px solid #f0f3f7;
}
.nfas-ws-quick a:hover { color: #0f4aa3; }
.nfas-ws-drawer {
    position: fixed;
    z-index: 100002;
    right: -470px;
    top: 32px;
    bottom: 0;
    width: min(460px, 94vw);
    background: #fff;
    box-shadow: -12px 0 40px rgba(15,23,42,.2);
    transition: right .2s ease;
    display: flex;
    flex-direction: column;
}
.nfas-ws-drawer.is-open { right: 0; }
.nfas-ws-drawer-backdrop {
    position: fixed; inset: 32px 0 0 0;
    background: rgba(15,23,42,.32);
    z-index: 100001;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.nfas-ws-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.nfas-ws-drawer-head {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.nfas-ws-drawer-head small { color: #64748b; }
.nfas-ws-drawer-head h2 { margin: 3px 0 0; }
.nfas-ws-drawer-close {
    border: 0; background: transparent; color: #475569;
    font-size: 30px; line-height: 1; cursor: pointer;
}
.nfas-ws-drawer-body { padding: 16px 18px 28px; overflow-y: auto; }
.nfas-ws-drawer-alert {
    border: 1px solid #fecaca;
    background: #fff7f7;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}
.nfas-ws-drawer-alert h3 { margin: 0 0 7px; color: #991b1b; }
.nfas-ws-drawer-alert p { margin: 7px 0; line-height: 1.45; }
.nfas-ws-drawer-alert .nfas-ws-action-label {
    display: block; font-size: 10px; font-weight: 900;
    text-transform: uppercase; color: #64748b; margin-top: 10px;
}
.nfas-ws-drawer-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.nfas-ws-hidden { display: none !important; }

@media (max-width: 1280px) {
    .nfas-ws-shell { grid-template-columns: 200px minmax(0,1fr) 245px; }
    .nfas-ws-column-popover { right: 260px; }
}
@media (max-width: 980px) {
    .nfas-ws-shell { grid-template-columns: 1fr; }
    .nfas-ws-left, .nfas-ws-right { position: static; height: auto; border: 0; border-bottom: 1px solid #d7e1ee; }
    .nfas-ws-grid-wrap { height: auto; max-height: 70vh; }
    .nfas-ws-column-popover { position: fixed; right: 20px; top: 80px; }
}


/* =========================================================
   App Shell Notafiscal v0.8.1
   Paleta oficial notafiscal.cnt.br
   ========================================================= */
.nfas-workspace-page {
    --nf-azul-header: #002C4B;
    --nf-azul-secundario: #005B9F;
    --nf-azul-destaque: #00B9FA;
    --nf-verde-sucesso: #1E9E5A;
    --nf-amarelo-atencao: #F59E0B;
    --nf-vermelho-risco: #D92D20;
    --nf-fundo-geral: #F5F8FB;
    --nf-fundo-card: #FFFFFF;
    --nf-texto-principal: #0B1F33;
    --nf-texto-secundario: #526173;
    --nf-borda-suave: #D9E2EC;
    max-width: none !important;
    background: var(--nf-fundo-geral);
}
.nfas-appbar {
    min-height: 58px;
    background: var(--nf-azul-header);
    color: #fff;
    display: grid;
    grid-template-columns: 235px minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
    box-sizing: border-box;
    border-bottom: 3px solid var(--nf-azul-destaque);
    position: sticky;
    top: 32px;
    z-index: 80;
    box-shadow: 0 3px 12px rgba(11,31,51,.16);
}
.nfas-appbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.nfas-appbar-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--nf-azul-destaque);
    color: var(--nf-azul-header);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.nfas-appbar-logo {
    width: 122px;
    height: 40px;
    object-fit: contain;
    object-position: left center;
    display: block;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
}

.nfas-appbar-name {
    min-width: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}
.nfas-appbar-name small {
    display: block;
    color: #c8e6f5;
    font-size: 9.5px;
    font-weight: 500;
    white-space: nowrap;
}
.nfas-appbar-nav {
    display: flex;
    gap: 2px;
    align-items: stretch;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
.nfas-appbar-nav > a,
.nfas-appbar-audit-form > button {
    min-height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: transparent;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.nfas-appbar-nav > a:hover,
.nfas-appbar-nav > a:focus,
.nfas-appbar-audit-form > button:hover,
.nfas-appbar-audit-form > button:focus {
    background: rgba(255,255,255,.12);
    color: #fff;
    outline: none;
}
.nfas-appbar-nav .dashicons {
    color: var(--nf-azul-destaque);
    width: 17px;
    height: 17px;
    font-size: 17px;
}
.nfas-appbar-audit-form {
    margin: 0;
    display: inline-flex;
}
.nfas-appbar-user {
    display: flex;
    align-items: center;
    gap: 7px;
}
.nfas-focus-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nfas-focus-toggle:hover { background: rgba(255,255,255,.12); }
.nfas-user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 7px 4px 4px;
    border-radius: 999px;
    color: #fff !important;
    text-decoration: none;
    background: rgba(255,255,255,.08);
    white-space: nowrap;
}
.nfas-user-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.nfas-user-chip span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

.nfas-workspace-page .nfas-ws-shell {
    grid-template-columns: 230px minmax(0,1fr) 280px;
    background: var(--nf-fundo-geral);
    min-height: calc(100vh - 90px);
}
.nfas-workspace-page .nfas-ws-left,
.nfas-workspace-page .nfas-ws-right {
    top: 90px;
    height: calc(100vh - 90px);
    border-color: var(--nf-borda-suave);
}
.nfas-workspace-page .nfas-ws-brand strong,
.nfas-workspace-page .nfas-ws-top h1,
.nfas-workspace-page .nfas-ws-result-count strong {
    color: var(--nf-texto-principal);
}
.nfas-workspace-page .nfas-ws-brand span,
.nfas-workspace-page .nfas-ws-top p,
.nfas-workspace-page .nfas-ws-section-title {
    color: var(--nf-texto-secundario);
}
.nfas-workspace-page .nfas-ws-file:hover,
.nfas-workspace-page .nfas-ws-nav a:hover,
.nfas-workspace-page .nfas-ws-nav a.is-active {
    color: var(--nf-azul-secundario);
    background: #EAF5FB;
}
.nfas-workspace-page .nfas-ws-file.is-active {
    color: var(--nf-azul-header);
    background: #E7F5FC;
    box-shadow: inset 3px 0 var(--nf-azul-destaque);
}
.nfas-workspace-page .nfas-ws-doc-row td {
    background: #EFF8FC !important;
    border-color: #C9E8F6;
}
.nfas-workspace-page .nfas-ws-doc-number { color: var(--nf-azul-secundario); }
.nfas-workspace-page .nfas-ws-alert-total,
.nfas-workspace-page .nfas-ws-alert-btn {
    color: var(--nf-vermelho-risco);
}
.nfas-workspace-page .nfas-ws-alert-btn {
    border-color: #F3B9B5;
    background: #FEEDEC;
}
.nfas-workspace-page .nfas-ws-doc-alert {
    color: #9B1C13;
    background: #FEEDEC;
}
.nfas-workspace-page .nfas-ws-filter-submit {
    background: var(--nf-azul-secundario) !important;
    border-color: var(--nf-azul-secundario) !important;
}
.nfas-ws-context-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--nf-borda-suave);
    background: var(--nf-fundo-geral);
    color: var(--nf-azul-header);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
}

/* Modo foco: remove o "chrome" do wp-admin sem alterar outras telas. */
body.nfas-workspace-admin.nfas-focus-mode #adminmenumain,
body.nfas-workspace-admin.nfas-focus-mode #wpadminbar {
    display: none !important;
}
body.nfas-workspace-admin.nfas-focus-mode #wpcontent,
body.nfas-workspace-admin.nfas-focus-mode #wpfooter {
    margin-left: 0 !important;
}
body.nfas-workspace-admin.nfas-focus-mode #wpbody-content {
    padding-bottom: 0 !important;
}
body.nfas-workspace-admin.nfas-focus-mode .nfas-workspace-page {
    margin-left: 0 !important;
}
body.nfas-workspace-admin.nfas-focus-mode .nfas-appbar {
    top: 0;
}
body.nfas-workspace-admin.nfas-focus-mode .nfas-ws-left,
body.nfas-workspace-admin.nfas-focus-mode .nfas-ws-right {
    top: 58px;
    height: calc(100vh - 58px);
}
body.nfas-workspace-admin.nfas-focus-mode .nfas-ws-shell {
    min-height: calc(100vh - 58px);
}
body.nfas-workspace-admin.nfas-focus-mode .nfas-ws-grid-wrap {
    height: calc(100vh - 204px);
}
body.nfas-workspace-admin.nfas-focus-mode #wpfooter { display:none !important; }

@media (max-width: 1180px) {
    .nfas-appbar { grid-template-columns: 180px minmax(0,1fr) auto; }
    .nfas-appbar-nav > a,
    .nfas-appbar-audit-form > button { padding: 0 8px; font-size: 11px; }
    .nfas-user-chip span { display: none; }
}
@media (max-width: 900px) {
    .nfas-appbar { grid-template-columns: 1fr auto; padding: 7px 10px; }
    .nfas-appbar-nav { grid-column: 1 / -1; order: 3; }
    .nfas-workspace-page .nfas-ws-left,
    .nfas-workspace-page .nfas-ws-right { top: auto; height:auto; }
}


/* =========================================================
   Workspace único v0.8.2 — editor central e livros separados
   ========================================================= */
.nfas-workspace-page .nfas-ws-grid-wrap {
    overflow-x: scroll !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
}
.nfas-ws-xscroll-top {
    height: 17px;
    overflow-x: scroll;
    overflow-y: hidden;
    background: #fff;
    border-top: 1px solid var(--nf-borda-suave, #D9E2EC);
    border-bottom: 1px solid var(--nf-borda-suave, #D9E2EC);
}
.nfas-ws-xscroll-top > div { height: 1px; min-width: 100%; }
.nfas-ws-xscroll-top::-webkit-scrollbar,
.nfas-workspace-page .nfas-ws-grid-wrap::-webkit-scrollbar { height: 14px; width: 12px; }
.nfas-ws-xscroll-top::-webkit-scrollbar-thumb,
.nfas-workspace-page .nfas-ws-grid-wrap::-webkit-scrollbar-thumb {
    background: #9FB3C8;
    border-radius: 8px;
    border: 3px solid #F5F8FB;
}
.nfas-ws-xscroll-top::-webkit-scrollbar-track,
.nfas-workspace-page .nfas-ws-grid-wrap::-webkit-scrollbar-track { background: #F5F8FB; }

.nfas-ws-center-scroll {
    height: calc(100vh - 148px);
    overflow: auto;
    padding: 18px;
    box-sizing: border-box;
    background: var(--nf-fundo-geral, #F5F8FB);
}
.nfas-ws-panel {
    background: #fff;
    border: 1px solid var(--nf-borda-suave, #D9E2EC);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(11,31,51,.05);
    color: var(--nf-texto-principal, #0B1F33);
}
.nfas-ws-panel + .nfas-ws-panel { margin-top: 16px; }
.nfas-ws-panel h2 { margin: 0; color: var(--nf-azul-header, #002C4B); font-size: 18px; }
.nfas-ws-panel h3 { margin: 20px 0 9px; color: var(--nf-azul-header, #002C4B); font-size: 14px; }
.nfas-ws-panel-heading {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin-bottom:16px;
}
.nfas-ws-panel-heading p { margin:5px 0 0; color:var(--nf-texto-secundario,#526173); }
.nfas-ws-count-chip {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:38px; padding:5px 9px; border-radius:999px;
    background:#EAF5FB; color:var(--nf-azul-secundario,#005B9F);
    font-weight:800; font-size:11px;
}
.nfas-ws-table-scroll {
    width:100%;
    overflow:auto;
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:8px;
    background:#fff;
}
.nfas-ws-simple-table,
.nfas-ws-book-table {
    border-collapse:collapse;
    width:max-content;
    min-width:100%;
    font-size:12px;
}
.nfas-ws-simple-table th,
.nfas-ws-simple-table td,
.nfas-ws-book-table th,
.nfas-ws-book-table td {
    padding:8px 10px;
    border-bottom:1px solid #E7EDF3;
    text-align:left;
    vertical-align:top;
    white-space:nowrap;
}
.nfas-ws-simple-table thead th,
.nfas-ws-book-table thead th {
    position:sticky;
    top:0;
    z-index:2;
    background:#EAF5FB;
    color:var(--nf-azul-header,#002C4B);
    font-weight:800;
}
.nfas-ws-book-table td:nth-child(6) { min-width:260px; white-space:normal; }
.nfas-ws-book-table td small,
.nfas-ws-simple-table td small {
    display:block;
    color:var(--nf-texto-secundario,#526173);
    margin-top:3px;
}
.nfas-ws-book-table tfoot th {
    background:#F5F8FB;
    color:var(--nf-azul-header,#002C4B);
    border-top:2px solid var(--nf-azul-secundario,#005B9F);
}
.nfas-ws-kpis {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:10px;
    margin:12px 0 18px;
}
.nfas-ws-kpis > div {
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-left:4px solid var(--nf-azul-secundario,#005B9F);
    border-radius:8px;
    padding:12px;
    background:#fff;
}
.nfas-ws-kpis span {
    display:block;
    color:var(--nf-texto-secundario,#526173);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
    font-weight:800;
}
.nfas-ws-kpis strong { display:block; margin-top:5px; font-size:19px; color:var(--nf-texto-principal,#0B1F33); }
.nfas-ws-form { max-width:980px; }
.nfas-ws-form-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px 14px;
}
.nfas-ws-form-grid label,
.nfas-ws-form > label {
    display:flex;
    flex-direction:column;
    gap:5px;
    font-size:12px;
    font-weight:800;
    color:var(--nf-texto-principal,#0B1F33);
}
.nfas-ws-form-grid input[type="text"],
.nfas-ws-form-grid input[type="number"],
.nfas-ws-form-grid input[type="file"],
.nfas-ws-form-grid select,
.nfas-ws-form-grid textarea {
    width:100%;
    min-height:38px;
    border:1px solid #B8C8D8;
    border-radius:7px;
}
.nfas-ws-form-grid textarea { min-height:86px; }
.nfas-ws-form-grid .span-2 { grid-column:1/-1; }
.nfas-ws-checks { display:flex; gap:18px; flex-wrap:wrap; margin:15px 0; }
.nfas-ws-checkbox-card {
    justify-content:center;
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    padding:12px;
    border-radius:8px;
}
.nfas-ws-note {
    padding:11px 13px;
    border-radius:8px;
    background:#EAF5FB;
    border-left:4px solid var(--nf-azul-secundario,#005B9F);
    margin-top:16px;
    color:var(--nf-texto-principal,#0B1F33);
}
.nfas-ws-note-warn { background:#FFF7E6; border-left-color:var(--nf-amarelo-atencao,#F59E0B); }
.nfas-ws-actions-inline { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 14px; }
.nfas-ws-report-cards {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.nfas-ws-report-cards a {
    display:flex;
    flex-direction:column;
    gap:5px;
    text-decoration:none;
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:10px;
    padding:16px;
    background:#fff;
    color:var(--nf-texto-principal,#0B1F33);
}
.nfas-ws-report-cards a:hover { border-color:var(--nf-azul-destaque,#00B9FA); background:#F7FCFF; }
.nfas-ws-report-cards strong { color:var(--nf-azul-header,#002C4B); font-size:15px; }
.nfas-ws-report-cards span { color:var(--nf-texto-secundario,#526173); }
.nfas-ws-details {
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:8px;
    margin-bottom:14px;
    background:#FAFCFE;
}
.nfas-ws-details summary { cursor:pointer; padding:12px; font-weight:800; color:var(--nf-azul-secundario,#005B9F); }
.nfas-ws-details[open] summary { border-bottom:1px solid var(--nf-borda-suave,#D9E2EC); }
.nfas-ws-details .nfas-ws-form { padding:14px; }
.nfas-ws-side-context {
    color:var(--nf-texto-principal,#0B1F33);
}
.nfas-ws-side-context > strong { display:block; font-size:14px; color:var(--nf-azul-header,#002C4B); }
.nfas-ws-side-context p { color:var(--nf-texto-secundario,#526173); line-height:1.45; font-size:12px; }

body.nfas-workspace-admin.nfas-focus-mode .nfas-ws-center-scroll {
    height: calc(100vh - 116px);
}
@media (max-width: 980px) {
    .nfas-ws-center-scroll { height:auto; }
    .nfas-ws-form-grid, .nfas-ws-report-cards { grid-template-columns:1fr; }
    .nfas-ws-form-grid .span-2 { grid-column:auto; }
}


/* =========================================================
   Editor inline do item v0.8.4
   ========================================================= */
.nfas-workspace-page .nfas-ws-shell.is-editing {
    grid-template-columns: 230px minmax(0,1fr) 390px;
}
.nfas-ws-right-default[hidden],
.nfas-ws-inline-editor[hidden] { display:none !important; }

.nfas-ws-inline-editor {
    min-height: 100%;
    color: var(--nf-texto-principal, #0B1F33);
}
.nfas-ws-inline-editor-head {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    padding-bottom:12px;
    margin-bottom:12px;
    border-bottom:1px solid var(--nf-borda-suave, #D9E2EC);
}
.nfas-ws-inline-editor-head small {
    display:block;
    color:var(--nf-texto-secundario, #526173);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
    font-weight:800;
}
.nfas-ws-inline-editor-head strong {
    display:block;
    margin-top:3px;
    color:var(--nf-azul-header, #002C4B);
    font-size:14px;
    line-height:1.25;
}
.nfas-ws-inline-close {
    border:0;
    background:transparent;
    color:var(--nf-texto-secundario, #526173);
    cursor:pointer;
    font-size:25px;
    line-height:1;
    padding:0 2px;
}
.nfas-ws-inline-close:hover { color:var(--nf-vermelho-risco, #D92D20); }
.nfas-ws-inline-body { padding-bottom:28px; }

.nfas-inline-loading {
    display:flex;
    align-items:center;
    gap:8px;
    color:var(--nf-texto-secundario, #526173);
    padding:14px 0;
}
.nfas-inline-loading .spinner { float:none; margin:0; }

.nfas-inline-doc {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    margin-bottom:10px;
}
.nfas-inline-doc > div {
    border:1px solid var(--nf-borda-suave, #D9E2EC);
    background:#fff;
    border-radius:7px;
    padding:8px;
    min-width:0;
}
.nfas-inline-doc span,
.nfas-inline-tax-summary span {
    display:block;
    color:var(--nf-texto-secundario, #526173);
    font-size:9px;
    text-transform:uppercase;
    letter-spacing:.04em;
    font-weight:800;
}
.nfas-inline-doc strong,
.nfas-inline-tax-summary strong {
    display:block;
    margin-top:3px;
    color:var(--nf-texto-principal, #0B1F33);
    font-size:11px;
    overflow:hidden;
    text-overflow:ellipsis;
}

.nfas-inline-product {
    border-left:4px solid var(--nf-azul-secundario, #005B9F);
    background:#F7FBFE;
    border-radius:7px;
    padding:9px 10px;
    margin-bottom:10px;
}
.nfas-inline-product-code {
    display:block;
    color:var(--nf-texto-secundario, #526173);
    font:10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.nfas-inline-product strong {
    display:block;
    margin-top:2px;
    font-size:12px;
    line-height:1.35;
}
.nfas-inline-product small {
    display:block;
    margin-top:4px;
    color:var(--nf-texto-secundario, #526173);
}

.nfas-inline-tax-summary {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    margin-bottom:14px;
}
.nfas-inline-tax-summary > div {
    background:#fff;
    border:1px solid var(--nf-borda-suave, #D9E2EC);
    border-radius:7px;
    padding:7px;
}
.nfas-inline-section-title,
.nfas-inline-fields-title {
    color:var(--nf-azul-header, #002C4B);
    font-weight:900;
}
.nfas-inline-section-title {
    margin:14px 0 8px;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.035em;
}
.nfas-inline-fields-title {
    margin:10px 0 7px;
    font-size:11px;
}

.nfas-inline-alert {
    border:1px solid #F3B9B5;
    border-left:4px solid var(--nf-vermelho-risco, #D92D20);
    background:#FFF8F7;
    border-radius:8px;
    padding:10px;
    margin-bottom:9px;
}
.nfas-inline-alert.nfas-sev-baixa {
    border-color:#F4D48A;
    border-left-color:var(--nf-amarelo-atencao, #F59E0B);
    background:#FFFBF1;
}
.nfas-inline-alert.nfas-sev-media {
    border-left-color:var(--nf-amarelo-atencao, #F59E0B);
}
.nfas-inline-alert-head {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:8px;
}
.nfas-inline-alert-head > div { min-width:0; }
.nfas-inline-alert-code {
    display:block;
    color:var(--nf-vermelho-risco, #D92D20);
    font-size:11px;
    font-weight:900;
}
.nfas-inline-alert-head strong {
    display:block;
    margin-top:2px;
    font-size:11px;
    line-height:1.3;
}
.nfas-inline-alert p {
    margin:7px 0 0;
    font-size:11px;
    line-height:1.45;
}
.nfas-inline-alert .nfas-inline-status {
    width:auto;
    max-width:118px;
    min-height:28px;
    height:28px;
    font-size:10px;
    border-radius:6px;
}
.nfas-inline-how,
.nfas-inline-hint {
    margin-top:9px;
    padding-top:8px;
    border-top:1px dashed #E4C0BC;
}
.nfas-inline-how > span,
.nfas-inline-hint > span {
    display:block;
    color:var(--nf-texto-secundario, #526173);
    font-size:9px;
    text-transform:uppercase;
    letter-spacing:.04em;
    font-weight:900;
}
.nfas-inline-no-alert {
    display:flex;
    flex-direction:column;
    gap:3px;
    padding:9px 10px;
    border:1px solid #B7DFC8;
    border-left:4px solid var(--nf-verde-sucesso, #1E9E5A);
    background:#F4FBF7;
    border-radius:8px;
    margin-bottom:12px;
}
.nfas-inline-no-alert strong { color:#16683F; font-size:11px; }
.nfas-inline-no-alert span { color:var(--nf-texto-secundario, #526173); font-size:10px; }

.nfas-inline-edit-form {
    border-top:1px solid var(--nf-borda-suave, #D9E2EC);
    margin-top:13px;
    padding-top:2px;
}
.nfas-inline-safe-note {
    margin:0 0 8px;
    padding:7px 9px;
    background:#EAF5FB;
    border-radius:6px;
    color:var(--nf-texto-secundario, #526173);
    font-size:10px;
    line-height:1.35;
}
.nfas-inline-field-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}
.nfas-inline-field {
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}
.nfas-inline-field-label {
    display:block;
    min-height:27px;
    color:var(--nf-texto-principal, #0B1F33);
    font-size:10px;
    font-weight:800;
    line-height:1.25;
}
.nfas-inline-field-label em,
.nfas-inline-field-label b {
    display:inline-block;
    margin-top:2px;
    border-radius:999px;
    padding:1px 5px;
    font-size:8px;
    font-style:normal;
    font-weight:900;
}
.nfas-inline-field-label em {
    background:#FEEDEC;
    color:var(--nf-vermelho-risco, #D92D20);
}
.nfas-inline-field-label b {
    background:#EAF5FB;
    color:var(--nf-azul-secundario, #005B9F);
}
.nfas-inline-field input[type="text"] {
    width:100%;
    min-width:0;
    height:31px;
    min-height:31px;
    border:1px solid #B8C8D8;
    border-radius:6px;
    font-size:11px;
    padding:3px 7px;
}
.nfas-inline-field.is-alert-field input[type="text"] {
    border-color:#E89189;
    background:#FFF9F8;
    box-shadow:inset 3px 0 var(--nf-vermelho-risco, #D92D20);
}
.nfas-inline-field.is-edited input[type="text"] {
    outline:2px solid rgba(0,91,159,.10);
    background:#F5FBFF;
}
.nfas-inline-field small {
    color:var(--nf-texto-secundario, #526173);
    font-size:8px;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.nfas-inline-field code { font-size:8px; }

.nfas-inline-more-fields {
    margin-top:10px;
    border:1px solid var(--nf-borda-suave, #D9E2EC);
    border-radius:7px;
    background:#FAFCFE;
}
.nfas-inline-more-fields summary {
    cursor:pointer;
    padding:8px 9px;
    color:var(--nf-azul-secundario, #005B9F);
    font-size:10px;
    font-weight:800;
}
.nfas-inline-more-fields[open] { padding:0 9px 10px; }
.nfas-inline-more-fields[open] summary {
    margin:0 -9px 4px;
    border-bottom:1px solid var(--nf-borda-suave, #D9E2EC);
}

.nfas-inline-justification {
    display:flex;
    flex-direction:column;
    gap:5px;
    margin-top:10px;
    color:var(--nf-texto-principal, #0B1F33);
    font-size:10px;
    font-weight:800;
}
.nfas-inline-justification textarea {
    width:100%;
    min-height:65px;
    border:1px solid #B8C8D8;
    border-radius:6px;
    font-size:11px;
}
.nfas-inline-save-row {
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:9px;
}
.nfas-inline-save-status {
    font-size:10px;
    color:var(--nf-texto-secundario, #526173);
}
.nfas-inline-save-status.is-success { color:var(--nf-verde-sucesso, #1E9E5A); font-weight:800; }
.nfas-inline-save-status.is-error { color:var(--nf-vermelho-risco, #D92D20); font-weight:800; }
.nfas-inline-pending-info {
    margin-top:8px;
    padding:6px 8px;
    border-radius:6px;
    background:#FFF7E6;
    color:#8A5600;
    font-size:10px;
}

.nfas-ws-item-row.has-edits td {
    box-shadow: inset 0 -1px #CBE4F2;
}
.nfas-ws-edit-badge {
    display:inline-flex;
    align-items:center;
    gap:2px;
    margin-left:5px;
    color:var(--nf-azul-secundario, #005B9F);
    background:#EAF5FB;
    border-radius:999px;
    padding:2px 5px;
    font-size:9px;
    font-weight:800;
    vertical-align:middle;
}
.nfas-ws-edit-badge[hidden] { display:none !important; }
.nfas-ws-edit-badge .dashicons {
    width:11px;
    height:11px;
    font-size:11px;
}
.nfas-ws-open-editor-link {
    border:0;
    background:transparent;
    padding:0;
    color:#7C8A9E;
    font-size:11px;
    cursor:pointer;
    text-decoration:underline;
    text-decoration-style:dotted;
}
.nfas-ws-open-editor-link:hover { color:var(--nf-azul-secundario, #005B9F); }

@media (max-width: 1280px) {
    .nfas-workspace-page .nfas-ws-shell.is-editing {
        grid-template-columns: 200px minmax(0,1fr) 350px;
    }
}
@media (max-width: 980px) {
    .nfas-workspace-page .nfas-ws-shell.is-editing { grid-template-columns:1fr; }
    .nfas-inline-field-grid { grid-template-columns:1fr; }
}


/* Revalidação automática pós-correção — v0.8.4 */
.nfas-inline-revalidation,
.nfas-inline-export-ready {
    display:flex;
    flex-direction:column;
    gap:4px;
    margin:0 0 10px;
    padding:9px 10px;
    border-radius:8px;
    font-size:10px;
    line-height:1.4;
}
.nfas-inline-revalidation strong,
.nfas-inline-export-ready strong {
    font-size:11px;
}
.nfas-inline-revalidation.is-success {
    border:1px solid #B7DFC8;
    border-left:4px solid var(--nf-verde-sucesso, #1E9E5A);
    background:#F4FBF7;
    color:#16683F;
}
.nfas-inline-revalidation.is-warning {
    border:1px solid #F3D39A;
    border-left:4px solid var(--nf-amarelo-atencao, #F59E0B);
    background:#FFF9ED;
    color:#8A5600;
}
.nfas-inline-export-ready {
    border:1px solid #A9CFE8;
    border-left:4px solid var(--nf-azul-secundario, #005B9F);
    background:#F3F9FD;
    color:var(--nf-texto-principal, #0B1F33);
}
.nfas-inline-export-ready .button {
    align-self:flex-start;
    margin-top:4px;
}


/* Workspace v0.8.6 — fechamento do ciclo de correção */
.nfas-ws-finalization .nfas-ws-panel-heading {
    align-items: flex-start;
}
.nfas-ws-count-chip.is-success {
    background: #e8f7ef;
    color: #176b42;
    border-color: #b7e3ca;
}
.nfas-ws-final-kpis {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}
.nfas-ws-final-kpis > div.is-warning {
    border-color: #f4c46b;
    background: #fff8e8;
}
.nfas-ws-final-kpis > div.is-ok {
    border-color: #b7e3ca;
    background: #f3fbf6;
}
.nfas-ws-final-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 14px 0 18px;
}
.nfas-ws-final-actions form {
    margin: 0;
}
.nfas-ws-final-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1.2;
    vertical-align: text-bottom;
}
.nfas-ws-note-ok {
    border-left-color: #1E9E5A !important;
    background: #effaf4 !important;
}
.nfas-ws-finalization h3 {
    margin-top: 22px;
    color: #002C4B;
}
.nfas-final-export {
    background: #1E9E5A !important;
    border-color: #1E9E5A !important;
}
.nfas-final-export:hover,
.nfas-final-export:focus {
    background: #167c46 !important;
    border-color: #167c46 !important;
}
@media (max-width: 1100px) {
    .nfas-ws-final-kpis {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 720px) {
    .nfas-ws-final-kpis {
        grid-template-columns: 1fr;
    }
}


/* v0.8.6 — retorno rápido da lista de correções para o editor inline */
.nfas-pending-edits-table .nfas-pending-edit-link{
  color:#005B9F;
  text-decoration:none;
}
.nfas-pending-edits-table .nfas-pending-edit-link:hover{
  color:#002C4B;
  text-decoration:underline;
}
.nfas-pending-edit-action{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 10px;
  border:1px solid #D9E2EC;
  border-radius:7px;
  background:#fff;
  color:#005B9F;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
.nfas-pending-edit-action:hover{
  border-color:#005B9F;
  color:#002C4B;
  background:#F5F8FB;
}
.nfas-pending-edit-row:hover td{
  background:#F8FBFD;
}


/* =========================================================
   Workspace v0.8.7 — refinamento visual e painéis recolhíveis
   ========================================================= */

/* Controles mais compactos e alinhados à identidade do portal. */
.nfas-workspace-page .nfas-appbar-nav > a,
.nfas-workspace-page .nfas-appbar-audit-form > button {
    min-height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
}
.nfas-workspace-page .nfas-appbar-nav .dashicons {
    width: 15px;
    height: 15px;
    font-size: 15px;
}
.nfas-workspace-page .nfas-focus-toggle,
.nfas-workspace-page .nfas-pane-toggle {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nfas-workspace-page .nfas-pane-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nfas-workspace-page .nfas-pane-toggle:hover,
.nfas-workspace-page .nfas-focus-toggle:hover,
.nfas-workspace-page .nfas-pane-toggle[aria-pressed="true"] {
    background: rgba(255,255,255,.12);
}
.nfas-workspace-page .nfas-pane-toggle[aria-pressed="true"] {
    box-shadow: inset 0 -2px var(--nf-azul-destaque, #00B9FA);
}
.nfas-workspace-page .nfas-pane-toggle .dashicons,
.nfas-workspace-page .nfas-focus-toggle .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}
.nfas-workspace-page .nfas-user-chip {
    padding: 3px 6px 3px 3px;
    gap: 6px;
    font-size: 11px;
}
.nfas-workspace-page .nfas-user-chip img {
    width: 24px;
    height: 24px;
}

/* Botões do conteúdo: menos altura, menos peso e menos "massa" visual. */
.nfas-workspace-page .button,
.nfas-workspace-page button.button {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    line-height: 28px;
    font-size: 11px;
    font-weight: 600;
}
.nfas-workspace-page .nfas-ws-toolbar-buttons {
    gap: 5px;
}
.nfas-workspace-page .nfas-ws-toolbar {
    padding: 8px 12px;
}
.nfas-workspace-page .nfas-ws-filter-submit {
    min-height: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}
.nfas-workspace-page .nfas-ws-filter-form label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}
.nfas-workspace-page .nfas-ws-filter-form select,
.nfas-workspace-page .nfas-ws-filter-form input[type="search"] {
    min-height: 33px;
    height: 33px;
    margin-top: 4px;
    font-size: 11px;
}
.nfas-workspace-page .nfas-ws-filter-head {
    font-size: 13px;
}
.nfas-workspace-page .nfas-ws-filter-divider {
    margin: 12px 0 8px;
    padding-top: 9px;
    font-weight: 700;
}

/* Grade mais leve: NF e cabeçalhos não competem com o conteúdo fiscal. */
.nfas-workspace-page .nfas-ws-grid thead th {
    font-weight: 700;
}
.nfas-workspace-page .nfas-ws-doc-number {
    color: var(--nf-azul-secundario, #005B9F);
    font-weight: 600;
}
.nfas-workspace-page .nfas-ws-doc-value {
    font-weight: 600;
}
.nfas-workspace-page .nfas-ws-open-item {
    color: var(--nf-azul-secundario, #005B9F);
    font-weight: 500;
    text-decoration: none;
}
.nfas-workspace-page .nfas-ws-open-item:hover {
    color: var(--nf-azul-header, #002C4B);
    text-decoration: underline;
}
.nfas-workspace-page .nfas-ws-doc-alert {
    font-weight: 600;
}
.nfas-workspace-page .nfas-ws-alert-btn {
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
}
.nfas-workspace-page .nfas-ws-section-title,
.nfas-workspace-page .nfas-ws-tree summary {
    font-weight: 700;
}
.nfas-workspace-page .nfas-ws-nav a,
.nfas-workspace-page .nfas-ws-nav .is-disabled {
    padding: 7px 8px;
    font-weight: 500;
}

/* Alertas: hierarquia clara sem excesso de negrito. */
.nfas-workspace-page .nfas-inline-section-title,
.nfas-workspace-page .nfas-inline-fields-title {
    font-weight: 700;
}
.nfas-workspace-page .nfas-inline-alert-code {
    font-weight: 700;
}
.nfas-workspace-page .nfas-inline-alert-head strong {
    font-weight: 600;
}
.nfas-workspace-page .nfas-inline-alert p {
    font-weight: 400;
    color: var(--nf-texto-principal, #0B1F33);
    line-height: 1.5;
}
.nfas-workspace-page .nfas-inline-how > span,
.nfas-workspace-page .nfas-inline-hint > span {
    font-weight: 700;
}
.nfas-workspace-page .nfas-inline-field-label,
.nfas-workspace-page .nfas-inline-justification {
    font-weight: 600;
}
.nfas-workspace-page .nfas-inline-field-label em,
.nfas-workspace-page .nfas-inline-field-label b {
    font-weight: 700;
}
.nfas-workspace-page .nfas-inline-doc span,
.nfas-workspace-page .nfas-inline-tax-summary span {
    font-weight: 600;
}
.nfas-workspace-page .nfas-inline-doc strong,
.nfas-workspace-page .nfas-inline-tax-summary strong {
    font-weight: 600;
}
.nfas-workspace-page .nfas-inline-more-fields summary {
    font-weight: 600;
}
.nfas-workspace-page .nfas-inline-save-status.is-success,
.nfas-workspace-page .nfas-inline-save-status.is-error {
    font-weight: 600;
}

/* Laterais recolhíveis. A barra superior permanece disponível para restaurá-las. */
.nfas-workspace-page .nfas-ws-shell {
    transition: grid-template-columns .16s ease;
}
.nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed {
    grid-template-columns: 0 minmax(0,1fr) 280px;
}
.nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed {
    grid-template-columns: 230px minmax(0,1fr) 0;
}
.nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed.nfas-right-collapsed {
    grid-template-columns: 0 minmax(0,1fr) 0;
}
.nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed > .nfas-ws-left,
.nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed > .nfas-ws-right {
    display: none;
}
.nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed .nfas-ws-column-popover {
    left: auto;
}
.nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed .nfas-ws-column-popover {
    right: 16px;
}

/* Durante a edição, a direita ganha espaço; o controle de ocultar continua disponível. */
.nfas-workspace-page .nfas-ws-shell.is-editing:not(.nfas-left-collapsed):not(.nfas-right-collapsed) {
    grid-template-columns: 230px minmax(0,1fr) 390px;
}
.nfas-workspace-page .nfas-ws-shell.is-editing.nfas-left-collapsed:not(.nfas-right-collapsed) {
    grid-template-columns: 0 minmax(0,1fr) 390px;
}
.nfas-workspace-page .nfas-ws-shell.is-editing.nfas-right-collapsed:not(.nfas-left-collapsed) {
    grid-template-columns: 230px minmax(0,1fr) 0;
}
.nfas-workspace-page .nfas-ws-shell.is-editing.nfas-left-collapsed.nfas-right-collapsed {
    grid-template-columns: 0 minmax(0,1fr) 0;
}

@media (max-width:1280px) {
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed {
        grid-template-columns: 0 minmax(0,1fr) 245px;
    }
    .nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed {
        grid-template-columns: 200px minmax(0,1fr) 0;
    }
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed.nfas-right-collapsed {
        grid-template-columns: 0 minmax(0,1fr) 0;
    }
    .nfas-workspace-page .nfas-ws-shell.is-editing:not(.nfas-left-collapsed):not(.nfas-right-collapsed) {
        grid-template-columns: 200px minmax(0,1fr) 350px;
    }
    .nfas-workspace-page .nfas-ws-shell.is-editing.nfas-left-collapsed:not(.nfas-right-collapsed) {
        grid-template-columns: 0 minmax(0,1fr) 350px;
    }
}
@media (max-width:980px) {
    .nfas-workspace-page .nfas-ws-shell,
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed,
    .nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed,
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed.nfas-right-collapsed,
    .nfas-workspace-page .nfas-ws-shell.is-editing {
        grid-template-columns: 1fr;
    }
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed > .nfas-ws-left,
    .nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed > .nfas-ws-right {
        display:none;
    }
}


/* =========================================================
   Workspace v0.8.8 — correção do recolhimento das laterais
   Quando um painel é ocultado ele sai do fluxo (display:none).
   Portanto, o grid passa efetivamente de 3 para 2/1 colunas,
   evitando que o painel direito ocupe o lugar da área central.
   ========================================================= */
.nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed:not(.nfas-right-collapsed) {
    grid-template-columns: minmax(0,1fr) 280px;
}
.nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed:not(.nfas-left-collapsed) {
    grid-template-columns: 230px minmax(0,1fr);
}
.nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed.nfas-right-collapsed {
    grid-template-columns: minmax(0,1fr);
}

/* Editor aberto: preserva largura útil da área central e reserva só o
   espaço necessário para o painel de correção. */
.nfas-workspace-page .nfas-ws-shell.is-editing.nfas-left-collapsed:not(.nfas-right-collapsed) {
    grid-template-columns: minmax(0,1fr) 390px;
}
.nfas-workspace-page .nfas-ws-shell.is-editing.nfas-right-collapsed:not(.nfas-left-collapsed) {
    grid-template-columns: 230px minmax(0,1fr);
}
.nfas-workspace-page .nfas-ws-shell.is-editing.nfas-left-collapsed.nfas-right-collapsed {
    grid-template-columns: minmax(0,1fr);
}

@media (max-width:1280px) {
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed:not(.nfas-right-collapsed) {
        grid-template-columns: minmax(0,1fr) 245px;
    }
    .nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed:not(.nfas-left-collapsed) {
        grid-template-columns: 200px minmax(0,1fr);
    }
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed.nfas-right-collapsed {
        grid-template-columns: minmax(0,1fr);
    }
    .nfas-workspace-page .nfas-ws-shell.is-editing.nfas-left-collapsed:not(.nfas-right-collapsed) {
        grid-template-columns: minmax(0,1fr) 350px;
    }
    .nfas-workspace-page .nfas-ws-shell.is-editing.nfas-right-collapsed:not(.nfas-left-collapsed) {
        grid-template-columns: 200px minmax(0,1fr);
    }
}

@media (max-width:980px) {
    .nfas-workspace-page .nfas-ws-shell,
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed,
    .nfas-workspace-page .nfas-ws-shell.nfas-right-collapsed,
    .nfas-workspace-page .nfas-ws-shell.nfas-left-collapsed.nfas-right-collapsed,
    .nfas-workspace-page .nfas-ws-shell.is-editing {
        grid-template-columns: minmax(0,1fr);
    }
}


/* =========================================================
   Workspace v0.8.9 — chave NF-e e espelho visual do documento
   ========================================================= */
.nfas-workspace-page .nfas-inline-key-link {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    width: 100%;
    margin: 10px 0 12px;
    padding: 9px 10px;
    border: 1px solid var(--nf-borda-suave, #D9E2EC);
    border-left: 3px solid var(--nf-azul-destaque, #00B9FA);
    border-radius: 7px;
    background: #F8FBFE;
    color: var(--nf-texto-principal, #0B1F33);
    text-align: left;
    cursor: pointer;
}
.nfas-workspace-page .nfas-inline-key-link:hover,
.nfas-workspace-page .nfas-inline-key-link:focus {
    border-color: var(--nf-azul-secundario, #005B9F);
    background: #F1F8FD;
    outline: none;
}
.nfas-workspace-page .nfas-inline-key-link span {
    color: var(--nf-texto-secundario, #526173);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.nfas-workspace-page .nfas-inline-key-link strong {
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 600;
    word-break: break-word;
    color: var(--nf-azul-secundario, #005B9F);
}
.nfas-workspace-page .nfas-inline-key-link small {
    color: var(--nf-texto-secundario, #526173);
    font-size: 10.5px;
    font-weight: 400;
}

.nfas-danfe-modal[hidden] {
    display: none !important;
}
.nfas-danfe-modal {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 24px;
}
.nfas-danfe-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11,31,51,.62);
    backdrop-filter: blur(2px);
}
.nfas-danfe-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1360px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    margin: auto;
    background: #F5F8FB;
    border: 1px solid #D9E2EC;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0,44,75,.28);
    overflow: hidden;
}
.nfas-danfe-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 9px 14px;
    background: var(--nf-azul-header, #002C4B);
    color: #fff;
    border-bottom: 2px solid var(--nf-azul-destaque, #00B9FA);
}
.nfas-danfe-dialog-head > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.nfas-danfe-dialog-head strong {
    font-size: 15px;
    font-weight: 650;
}
.nfas-danfe-dialog-head span {
    font-size: 10.5px;
    opacity: .82;
}
.nfas-danfe-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.nfas-danfe-close:hover {
    background: rgba(255,255,255,.1);
}
.nfas-danfe-body {
    overflow: auto;
    padding: 14px;
}
.nfas-danfe-warning {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 auto 10px;
    max-width: 1220px;
    padding: 8px 10px;
    border: 1px solid #F6C968;
    border-radius: 7px;
    background: #FFF8E8;
    color: #6E4A00;
    font-size: 11px;
}
.nfas-danfe-warning strong {
    flex: 0 0 auto;
    font-weight: 650;
}
.nfas-danfe-warning span {
    color: #6A5837;
    font-weight: 400;
}
.nfas-danfe-sheet {
    max-width: 1220px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #A9B6C5;
    color: #111827;
    box-shadow: 0 3px 10px rgba(11,31,51,.06);
}
.nfas-danfe-top {
    display: grid;
    grid-template-columns: 1fr 180px;
    border-bottom: 1px solid #A9B6C5;
}
.nfas-danfe-party,
.nfas-danfe-titlebox {
    min-height: 80px;
    padding: 10px 12px;
}
.nfas-danfe-titlebox {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #A9B6C5;
    text-align: center;
}
.nfas-danfe-party > span,
.nfas-danfe-meta span,
.nfas-danfe-totals span,
.nfas-danfe-key span {
    display: block;
    margin-bottom: 3px;
    color: #526173;
    font-size: 9.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.nfas-danfe-party strong {
    display: block;
    margin: 2px 0 5px;
    font-size: 14px;
    font-weight: 650;
    color: #002C4B;
}
.nfas-danfe-party small {
    display: block;
    margin-top: 2px;
    color: #526173;
}
.nfas-danfe-titlebox > strong {
    font-size: 23px;
    font-weight: 700;
    color: #002C4B;
}
.nfas-danfe-titlebox > span {
    font-size: 12px;
    font-weight: 600;
}
.nfas-danfe-titlebox > small {
    margin-top: 4px;
    color: #526173;
}
.nfas-danfe-key {
    padding: 8px 12px;
    border-bottom: 1px solid #A9B6C5;
    text-align: center;
}
.nfas-danfe-key strong {
    display: block;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .02em;
}
.nfas-danfe-meta {
    display: grid;
    grid-template-columns: 2.1fr .8fr .6fr 1fr;
    border-bottom: 1px solid #A9B6C5;
}
.nfas-danfe-meta > div {
    min-height: 58px;
    padding: 7px 9px;
    border-right: 1px solid #D9E2EC;
}
.nfas-danfe-meta > div:last-child {
    border-right: 0;
}
.nfas-danfe-meta strong,
.nfas-danfe-meta small {
    display: block;
}
.nfas-danfe-meta strong {
    font-size: 11.5px;
    font-weight: 600;
}
.nfas-danfe-meta small {
    margin-top: 2px;
    color: #526173;
    font-size: 9.5px;
}
.nfas-danfe-items-wrap {
    width: 100%;
    overflow-x: auto;
}
.nfas-danfe-items {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    font-size: 10.5px;
}
.nfas-danfe-items th {
    padding: 6px 7px;
    background: #EDF5FA;
    color: #0B1F33;
    border-right: 1px solid #D9E2EC;
    border-bottom: 1px solid #A9B6C5;
    text-align: left;
    white-space: nowrap;
    font-weight: 650;
}
.nfas-danfe-items td {
    padding: 6px 7px;
    border-right: 1px solid #E4EAF0;
    border-bottom: 1px solid #E4EAF0;
    vertical-align: top;
    white-space: nowrap;
    font-weight: 400;
}
.nfas-danfe-items td:nth-child(2) {
    min-width: 260px;
    white-space: normal;
}
.nfas-danfe-items td strong {
    display: block;
    font-weight: 550;
}
.nfas-danfe-items td small {
    display: block;
    margin-top: 2px;
    color: #526173;
    font-size: 9px;
}
.nfas-danfe-items tr.is-edited td {
    background: #F0FAF5;
}
.nfas-danfe-items tr.is-edited td:first-child {
    border-left: 3px solid #1E9E5A;
}
.nfas-danfe-totals {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid #A9B6C5;
}
.nfas-danfe-totals > div {
    padding: 8px 10px;
    border-right: 1px solid #D9E2EC;
}
.nfas-danfe-totals > div:last-child {
    border-right: 0;
}
.nfas-danfe-totals strong {
    display: block;
    font-size: 12px;
    font-weight: 650;
    color: #002C4B;
}
.nfas-danfe-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1220px;
    margin: 10px auto 0;
}
.nfas-danfe-actions .button {
    min-height: 30px;
    padding: 2px 10px;
    font-size: 11px;
    line-height: 26px;
}
.nfas-danfe-actions > span {
    color: #526173;
    font-size: 10.5px;
}
@media (max-width: 860px) {
    .nfas-danfe-modal { padding: 8px; }
    .nfas-danfe-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }
    .nfas-danfe-top { grid-template-columns: 1fr 130px; }
    .nfas-danfe-meta { grid-template-columns: 1fr 1fr; }
    .nfas-danfe-meta > div { border-bottom: 1px solid #D9E2EC; }
    .nfas-danfe-totals { grid-template-columns: 1fr 1fr; }
    .nfas-danfe-actions { flex-wrap: wrap; }
}


/* =========================================================
   Workspace v0.9.0 — cadastro guiado de regras
   ========================================================= */
.nfas-rules-workspace {
    --nfas-rule-muted:#66778A;
}
.nfas-rules-workspace .nfas-ws-panel-heading h2 {
    font-weight:650;
}
.nfas-rules-workspace .nfas-ws-panel-heading p,
.nfas-rules-workspace .nfas-rule-list-head p {
    color:var(--nf-texto-secundario,#526173);
    font-weight:400;
}
.nfas-rule-tutorial,
.nfas-rule-create,
.nfas-rule-advanced {
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:9px;
    background:#fff;
}
.nfas-rule-tutorial {
    margin-bottom:14px;
    overflow:hidden;
}
.nfas-rule-tutorial > summary,
.nfas-rule-create > summary {
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    padding:11px 13px;
    color:var(--nf-azul-header,#002C4B);
    list-style:none;
    font-weight:500;
}
.nfas-rule-tutorial > summary::-webkit-details-marker,
.nfas-rule-create > summary::-webkit-details-marker,
.nfas-rule-advanced > summary::-webkit-details-marker { display:none; }
.nfas-rule-tutorial > summary::after,
.nfas-rule-create > summary::after,
.nfas-rule-advanced > summary::after {
    content:'›';
    margin-left:auto;
    color:var(--nf-texto-secundario,#526173);
    font-size:18px;
    line-height:1;
    transform:rotate(90deg);
    transition:transform .15s ease;
}
.nfas-rule-tutorial[open] > summary::after,
.nfas-rule-create[open] > summary::after,
.nfas-rule-advanced[open] > summary::after {
    transform:rotate(-90deg);
}
.nfas-rule-tutorial > summary strong,
.nfas-rule-create > summary span {
    display:block;
    font-size:13px;
    font-weight:650;
}
.nfas-rule-tutorial > summary small,
.nfas-rule-create > summary small {
    display:block;
    margin-top:2px;
    color:var(--nf-texto-secundario,#526173);
    font-size:10.5px;
    font-weight:400;
}
.nfas-rule-tutorial-icon {
    display:grid;
    place-items:center;
    width:25px;
    height:25px;
    flex:0 0 25px;
    border-radius:50%;
    background:#EAF6FC;
    color:var(--nf-azul-secundario,#005B9F);
    font-size:13px;
    font-weight:700;
}
.nfas-rule-tutorial-body {
    padding:14px;
    border-top:1px solid var(--nf-borda-suave,#D9E2EC);
    background:#FBFDFE;
}
.nfas-rule-guide-intro {
    padding:12px 13px;
    border-left:3px solid var(--nf-azul-destaque,#00B9FA);
    border-radius:7px;
    background:#F3FAFE;
}
.nfas-rule-guide-intro > strong {
    font-size:13px;
    font-weight:650;
    color:var(--nf-azul-header,#002C4B);
}
.nfas-rule-guide-intro p {
    margin:4px 0 0;
    color:var(--nf-texto-secundario,#526173);
    font-size:11.5px;
    line-height:1.5;
    font-weight:400;
}
.nfas-rule-formula {
    display:flex;
    align-items:center;
    gap:7px;
    flex-wrap:wrap;
    margin-top:9px;
}
.nfas-rule-formula span {
    padding:4px 7px;
    border:1px solid #C8D9E8;
    border-radius:5px;
    background:#fff;
    color:#16344E;
    font-family:Consolas,Monaco,monospace;
    font-size:10.5px;
    font-weight:500;
}
.nfas-rule-formula i {
    color:var(--nf-azul-secundario,#005B9F);
    font-style:normal;
    font-weight:600;
}
.nfas-rule-guide-steps {
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:9px;
    margin:13px 0;
}
.nfas-rule-guide-steps article {
    display:flex;
    gap:8px;
    padding:10px;
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:7px;
    background:#fff;
}
.nfas-rule-step-number {
    display:grid;
    place-items:center;
    width:22px;
    height:22px;
    flex:0 0 22px;
    border-radius:50%;
    background:var(--nf-azul-header,#002C4B);
    color:#fff;
    font-size:10px;
    font-weight:650;
}
.nfas-rule-guide-steps h3,
.nfas-rule-guide-grid h3,
.nfas-rule-fields-help h3,
.nfas-rule-examples h3,
.nfas-rule-form-section-head h3,
.nfas-rule-list-head h3 {
    margin:0;
    color:var(--nf-texto-principal,#0B1F33);
    font-size:12.5px;
    font-weight:650;
}
.nfas-rule-guide-steps p {
    margin:4px 0 0;
    color:var(--nf-texto-secundario,#526173);
    font-size:10.5px;
    line-height:1.45;
    font-weight:400;
}
.nfas-rule-guide-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin:12px 0;
}
.nfas-rule-guide-grid > section,
.nfas-rule-fields-help {
    padding:11px;
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:7px;
    background:#fff;
}
.nfas-rule-ref-table {
    width:100%;
    margin-top:8px;
    border-collapse:collapse;
    font-size:10.5px;
}
.nfas-rule-ref-table th {
    padding:6px 7px;
    text-align:left;
    color:#405368;
    background:#F4F8FB;
    border-bottom:1px solid var(--nf-borda-suave,#D9E2EC);
    font-weight:600;
}
.nfas-rule-ref-table td {
    padding:6px 7px;
    border-bottom:1px solid #E9EEF3;
    color:#45576A;
    font-weight:400;
    vertical-align:top;
}
.nfas-rule-ref-table tr:last-child td { border-bottom:0; }
.nfas-rule-ref-table code,
.nfas-rule-field-chips code,
.nfas-rule-list-table code {
    color:var(--nf-azul-secundario,#005B9F);
    background:#EEF6FB;
    border-radius:4px;
    padding:1px 4px;
    font-size:10px;
    font-weight:500;
}
.nfas-rule-fields-help p {
    margin:8px 0 0;
    color:var(--nf-texto-secundario,#526173);
    font-size:10.5px;
    line-height:1.5;
    font-weight:400;
}
.nfas-rule-field-chips {
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    margin-top:8px;
}
.nfas-rule-examples {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:12px;
}
.nfas-rule-examples article {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 11px;
    border:1px solid var(--nf-borda-suave,#D9E2EC);
    border-radius:7px;
    background:#fff;
}
.nfas-rule-examples h3 { margin-top:3px; }
.nfas-rule-examples p {
    margin:4px 0 0;
    color:var(--nf-texto-secundario,#526173);
    font-size:10.5px;
    line-height:1.4;
    font-weight:400;
}
.nfas-rule-example-tag {
    color:var(--nf-azul-secundario,#005B9F);
    font-size:9.5px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.nfas-load-rule-example {
    flex:0 0 auto;
    min-height:27px !important;
    padding:0 8px !important;
    line-height:25px !important;
    font-size:10.5px !important;
}
.nfas-rule-guide-warning {
    font-size:10.5px;
    font-weight:400;
}
.nfas-rule-guide-warning strong { font-weight:650; }

.nfas-rule-create {
    margin-bottom:15px;
    overflow:hidden;
    background:#FAFCFE;
}
.nfas-rule-create > summary {
    border-bottom:0;
}
.nfas-rule-create[open] > summary {
    border-bottom:1px solid var(--nf-borda-suave,#D9E2EC);
}
.nfas-rule-create .nfas-ws-rule-form {
    max-width:none;
    padding:0;
}
.nfas-rule-form-section {
    padding:14px 14px 2px;
    border-bottom:1px solid #E6EDF3;
}
.nfas-rule-form-section:last-of-type {
    border-bottom:0;
}
.nfas-rule-form-section-head {
    display:flex;
    align-items:flex-start;
    gap:9px;
    margin-bottom:11px;
}
.nfas-rule-form-section-head > span {
    display:grid;
    place-items:center;
    width:22px;
    height:22px;
    flex:0 0 22px;
    border-radius:5px;
    background:#E9F5FB;
    color:var(--nf-azul-secundario,#005B9F);
    font-size:10px;
    font-weight:650;
}
.nfas-rule-form-section-head p {
    margin:3px 0 0;
    color:var(--nf-texto-secundario,#526173);
    font-size:10.5px;
    line-height:1.4;
    font-weight:400;
}
.nfas-rule-form-section-head .nfas-rule-add-condition {
    margin-left:auto;
}
.nfas-rules-workspace .nfas-ws-rule-form .nfas-ws-form-grid {
    gap:10px 12px;
}
.nfas-rules-workspace .nfas-ws-rule-form .nfas-ws-form-grid label,
.nfas-rules-workspace .nfas-ws-rule-form > label,
.nfas-rules-workspace .nfas-rule-condition-row label {
    gap:4px;
    color:#233A50;
    font-size:11px;
    font-weight:550;
}
.nfas-rules-workspace .nfas-ws-rule-form label small {
    color:var(--nf-texto-secundario,#526173);
    font-size:9.5px;
    line-height:1.35;
    font-weight:400;
}
.nfas-rules-workspace .nfas-ws-rule-form input,
.nfas-rules-workspace .nfas-ws-rule-form select,
.nfas-rules-workspace .nfas-ws-rule-form textarea {
    color:var(--nf-texto-principal,#0B1F33);
    font-size:11.5px;
    font-weight:400;
}
.nfas-rules-workspace .nfas-ws-rule-form input[type="text"],
.nfas-rules-workspace .nfas-ws-rule-form input:not([type]),
.nfas-rules-workspace .nfas-ws-rule-form select,
.nfas-rules-workspace .nfas-ws-rule-form textarea,
.nfas-rules-workspace .nfas-ws-rule-form input[type="date"] {
    min-height:34px;
    border-color:#C5D2DF;
    border-radius:6px;
}
.nfas-rules-workspace .nfas-ws-rule-form textarea {
    min-height:72px;
}
.nfas-rule-conditions-builder {
    display:flex;
    flex-direction:column;
    gap:7px;
}
.nfas-rule-condition-row {
    display:grid;
    grid-template-columns:minmax(160px,1.15fr) minmax(180px,1fr) minmax(160px,1fr) 28px;
    gap:8px;
    align-items:end;
    padding:8px;
    border:1px solid #D7E1EA;
    border-radius:7px;
    background:#fff;
}
.nfas-rule-remove-condition {
    width:28px;
    height:28px;
    margin-bottom:1px;
    padding:0;
    border:1px solid #E3B7B3;
    border-radius:5px;
    background:#FFF8F7;
    color:#B42318;
    cursor:pointer;
    font-size:16px;
    line-height:1;
}
.nfas-rule-remove-condition:hover { background:#FEEDEC; }
.nfas-rule-condition-row:only-child .nfas-rule-remove-condition {
    opacity:.35;
    pointer-events:none;
}
.nfas-rule-condition-help {
    margin:7px 0 12px;
    color:var(--nf-texto-secundario,#526173);
    font-size:9.8px;
    line-height:1.45;
    font-weight:400;
}
.nfas-rule-add-condition,
.nfas-rule-form-actions .button {
    min-height:28px !important;
    padding:0 9px !important;
    line-height:26px !important;
    font-size:10.5px !important;
}
.nfas-rule-advanced {
    margin:12px 14px 0;
    background:#fff;
}
.nfas-rule-advanced > summary {
    display:flex;
    align-items:center;
    gap:8px;
    padding:9px 10px;
    cursor:pointer;
    color:var(--nf-azul-secundario,#005B9F);
    font-size:10.5px;
    font-weight:550;
    list-style:none;
}
.nfas-rule-advanced .nfas-ws-form-grid {
    padding:10px;
    border-top:1px solid #E6EDF3;
}
.nfas-rule-form-actions {
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px 14px;
}
.nfas-rule-form-actions > span {
    color:var(--nf-texto-secundario,#526173);
    font-size:9.8px;
    font-weight:400;
}
.nfas-rule-list-head {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    margin:2px 0 8px;
}
.nfas-rule-list-head p {
    margin:3px 0 0;
    font-size:10.5px;
}
.nfas-rule-list-table {
    font-size:10.5px;
}
.nfas-rule-list-table th {
    font-weight:600;
}
.nfas-rule-list-table td {
    font-weight:400;
}
.nfas-rule-status {
    display:inline-block;
    padding:2px 6px;
    border-radius:999px;
    background:#F1F4F7;
    color:#526173;
    font-size:9.5px;
    font-weight:500;
}
.nfas-rule-status-ativa { background:#EAF7F0; color:#147A45; }
.nfas-rule-status-em_teste { background:#FFF5D9; color:#8A5B00; }
.nfas-rule-status-inativa { background:#F1F4F7; color:#667085; }

@media (max-width:1200px) {
    .nfas-rule-guide-steps { grid-template-columns:1fr 1fr; }
}
@media (max-width:820px) {
    .nfas-rule-guide-grid,
    .nfas-rule-examples { grid-template-columns:1fr; }
    .nfas-rule-condition-row { grid-template-columns:1fr; }
    .nfas-rule-remove-condition { justify-self:end; }
    .nfas-rule-form-section-head { flex-wrap:wrap; }
    .nfas-rule-form-section-head .nfas-rule-add-condition { margin-left:31px; }
}

.nfas-rules-workspace .nfas-rule-value-input.is-no-value {
    background:#F3F6F8;
    color:#8A98A8;
}


/* v0.9.5 — Central administrativa de usuários e atendimento */
.nfas-admin-users-page {
    --nfas-admin-blue:#002C4B;
    --nfas-admin-link:#005B9F;
    --nfas-admin-border:#D9E2EC;
    --nfas-admin-bg:#F5F8FB;
    --nfas-admin-text:#0B1F33;
    --nfas-admin-muted:#526173;
}
.nfas-admin-users-header {
    display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0;
}
.nfas-admin-users-header h1 { margin:0 0 5px;font-size:24px;font-weight:650;color:var(--nfas-admin-text); }
.nfas-admin-users-header p { margin:0;color:var(--nfas-admin-muted); }
.nfas-admin-users-kpis {
    display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;margin:0 0 16px;
}
.nfas-admin-users-kpis > div,
.nfas-admin-user-stats > div,
.nfas-admin-user-facts > div {
    background:#fff;border:1px solid var(--nfas-admin-border);border-radius:10px;padding:13px 15px;
}
.nfas-admin-users-kpis span,
.nfas-admin-user-stats span,
.nfas-admin-user-facts span { display:block;color:var(--nfas-admin-muted);font-size:12px;margin-bottom:5px; }
.nfas-admin-users-kpis strong { font-size:24px;font-weight:650;color:var(--nfas-admin-text); }
.nfas-admin-users-layout {
    display:grid;grid-template-columns:minmax(360px,520px) minmax(500px,1fr);gap:16px;align-items:start;
}
.nfas-admin-user-list,
.nfas-admin-user-detail {
    background:#fff;border:1px solid var(--nfas-admin-border);border-radius:12px;overflow:hidden;
}
.nfas-admin-section-head { padding:15px 16px 10px; }
.nfas-admin-section-head h2,.nfas-admin-section-head h3 { margin:0 0 4px;color:var(--nfas-admin-text);font-size:17px;font-weight:650; }
.nfas-admin-section-head p { margin:0;color:var(--nfas-admin-muted);font-size:13px; }
.nfas-admin-user-search { padding:0 14px 12px; }
.nfas-admin-user-search input { width:100%; }
.nfas-admin-user-list-scroll { max-height:690px;overflow:auto;border-top:1px solid var(--nfas-admin-border); }
.nfas-admin-user-row {
    display:flex;gap:10px;align-items:center;padding:11px 13px;text-decoration:none;border-bottom:1px solid #edf2f7;color:var(--nfas-admin-text);
}
.nfas-admin-user-row:hover,.nfas-admin-user-row.is-selected { background:#F0F8FD; }
.nfas-admin-user-avatar img,.nfas-admin-user-identity img { border-radius:50%;display:block; }
.nfas-admin-user-main { min-width:0;flex:1; }
.nfas-admin-user-main strong { display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.nfas-admin-user-main small { display:block;color:var(--nfas-admin-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.nfas-admin-user-meta { text-align:right;display:grid;gap:4px;justify-items:end; }
.nfas-admin-user-meta small { color:var(--nfas-admin-muted);font-size:11px;white-space:nowrap; }
.nfas-user-status {
    display:inline-flex;padding:3px 7px;border-radius:999px;font-size:11px;font-style:normal;font-weight:600;white-space:nowrap;
}
.nfas-user-status-approved { background:#EAF7F0;color:#167647; }
.nfas-user-status-pending { background:#FFF7E6;color:#9A5B00; }
.nfas-user-status-suspended { background:#FEEDEC;color:#D92D20; }
.nfas-admin-user-detail { padding:16px; }
.nfas-admin-user-detail-top { display:flex;justify-content:space-between;gap:16px;align-items:flex-start;border-bottom:1px solid var(--nfas-admin-border);padding-bottom:14px; }
.nfas-admin-user-identity { display:flex;gap:12px;align-items:center; }
.nfas-admin-user-identity h2 { margin:0 0 3px;font-size:20px;font-weight:650; }
.nfas-admin-user-identity a { display:block;color:var(--nfas-admin-link);margin-bottom:6px;text-decoration:none; }
.nfas-admin-user-actions { display:flex;gap:8px;flex-wrap:wrap; }
.nfas-admin-user-actions form { margin:0; }
.nfas-admin-user-facts { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:14px 0; }
.nfas-admin-user-facts strong { font-size:13px;font-weight:600;overflow-wrap:anywhere; }
.nfas-admin-user-stats { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0 0 16px; }
.nfas-admin-user-stats strong { font-size:21px;font-weight:650; }
.nfas-admin-user-chat { border-top:1px solid var(--nfas-admin-border);margin:0 -16px -16px;padding:0 16px 16px; }
.nfas-admin-chat-thread { max-height:340px;overflow:auto;background:var(--nfas-admin-bg);border:1px solid var(--nfas-admin-border);border-radius:10px;padding:12px;display:grid;gap:8px; }
.nfas-admin-chat-message { max-width:82%;padding:9px 11px;border-radius:9px;background:#fff;border:1px solid var(--nfas-admin-border); }
.nfas-admin-chat-message.from-admin { margin-left:auto;background:#EAF4FB;border-color:#cfe5f5; }
.nfas-admin-chat-message > div { display:flex;gap:8px;justify-content:space-between;color:var(--nfas-admin-muted);font-size:11px; }
.nfas-admin-chat-message > div strong { color:var(--nfas-admin-text);font-weight:600; }
.nfas-admin-chat-message p { margin:5px 0 0;line-height:1.45;color:var(--nfas-admin-text); }
.nfas-admin-chat-form { margin-top:10px;display:grid;gap:8px;justify-items:start; }
.nfas-admin-chat-form textarea { width:100%;min-height:82px;box-sizing:border-box; }
.nfas-admin-user-placeholder { min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--nfas-admin-muted); }
.nfas-admin-user-placeholder .dashicons { width:48px;height:48px;font-size:48px;color:#9fb5c8; }
.nfas-admin-user-placeholder h2 { color:var(--nfas-admin-text);font-weight:600;margin:12px 0 4px; }
.nfas-empty { color:var(--nfas-admin-muted);padding:13px;margin:0; }

/* Atendimento dentro do Workspace */
.nfas-ws-support-panel { max-width:900px; }
.nfas-ws-support-thread {
    min-height:160px;max-height:520px;overflow:auto;background:#F5F8FB;border:1px solid #D9E2EC;border-radius:10px;padding:12px;display:grid;gap:9px;
}
.nfas-ws-support-message { max-width:78%;background:#fff;border:1px solid #D9E2EC;border-radius:9px;padding:9px 11px; }
.nfas-ws-support-message.from-user { margin-left:auto;background:#EAF4FB;border-color:#cfe5f5; }
.nfas-ws-support-message > div { display:flex;justify-content:space-between;gap:12px;color:#526173;font-size:11px; }
.nfas-ws-support-message > div strong { color:#0B1F33;font-weight:600; }
.nfas-ws-support-message p { margin:5px 0 0;line-height:1.45; }
.nfas-ws-support-form { margin-top:12px;display:grid;gap:8px;justify-items:start; }
.nfas-ws-support-form textarea { width:100%;box-sizing:border-box; }
.nfas-ws-muted { color:#526173; }

@media (max-width:1200px) {
    .nfas-admin-users-layout { grid-template-columns:1fr; }
    .nfas-admin-user-facts,.nfas-admin-user-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:800px) {
    .nfas-admin-users-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .nfas-admin-user-facts,.nfas-admin-user-stats { grid-template-columns:1fr; }
}


/* v0.9.6 — Central de usuários: usa toda a largura útil do wp-admin, sem folga lateral extra */
.nfas-admin-users-page {
    box-sizing: border-box;
    width: calc(100% - 20px);
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 20px !important;
}
.nfas-admin-users-page .nfas-admin-users-header,
.nfas-admin-users-page .nfas-admin-users-kpis,
.nfas-admin-users-page .nfas-admin-users-layout {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
@media (max-width: 782px) {
    .nfas-admin-users-page {
        width: calc(100% - 10px);
        margin-right: 10px !important;
    }
}


/* v0.10.0 — CT-e analítico */
.nfas-ws-cte-import-notice{
  margin:12px 14px;
  padding:12px 14px;
  border:1px solid #D9E2EC;
  border-left:3px solid #00B9FA;
  border-radius:8px;
  background:#F5F8FB;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.nfas-ws-cte-import-notice strong{color:#002C4B;font-weight:600}
.nfas-ws-cte-import-notice p{margin:4px 0 0;color:#526173;font-size:12px;line-height:1.45;max-width:820px}
.nfas-ws-cte-import-notice .button{white-space:nowrap}
.nfas-inline-key-static{
  display:block;
  margin:10px 0;
  padding:10px 12px;
  border:1px solid #D9E2EC;
  border-radius:8px;
  background:#F5F8FB;
}
.nfas-inline-key-static span{display:block;color:#526173;font-size:10px;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
.nfas-inline-key-static strong{display:block;color:#0B1F33;font-size:11px;line-height:1.45;overflow-wrap:anywhere;font-weight:500}
.nfas-inline-transport{border-left-color:#005B9F}
.nfas-ws-key{font-size:11px;white-space:nowrap}
@media (max-width:900px){
  .nfas-ws-cte-import-notice{align-items:flex-start;flex-direction:column}
}
