:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --border: #d8e0ea;
  --border-strong: #c7d1df;
  --text: #111827;
  --muted: #617089;
  --brand: #0b1b52;
  --brand-2: #00766f;
  --accent: #0f62c9;
  --danger: #dc2626;
  --success: #15803d;
  --warn: #a16207;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(11, 27, 82, .055), rgba(0, 118, 111, .075)),
    var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.page-title {
  color: var(--brand);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
  margin-bottom: 8px;
}

h2,
.section-heading,
.panel-title {
  color: var(--text);
}

.app,
.signup-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.signup-page .signup-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.signup-card,
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.signup-card,
.card {
  padding: 28px;
}

.panel {
  padding: 18px;
  margin-top: 18px;
  box-shadow: none;
}

.signup-brand,
.page-header,
.wizard-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 28px;
}

.signup-brand img {
  width: 190px;
  max-width: 24vw;
  flex: 0 0 auto;
  object-fit: contain;
}

.logo-topo {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 150px;
  max-width: 13vw;
  z-index: 0;
  pointer-events: none;
}

.logo-topo img {
  width: 100%;
  display: block;
  object-fit: contain;
}

.logo-topo + .app,
body > .app {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dff8f5;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.page-subtitle,
.hint,
.muted {
  color: var(--muted);
}

.hint,
.muted {
  font-size: 13px;
}

.divider,
.sep {
  height: 1px;
  margin: 22px 0;
  background: var(--border);
}

.form-grid,
.signup-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.field,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-8,
.col-9,
.col-12 {
  min-width: 0;
}

.field,
.col-3,
.col-4 {
  grid-column: span 3;
}

.field-2,
.field-wide,
.col-6 {
  grid-column: span 6;
}

.col-2 {
  grid-column: span 2;
}

.col-5 {
  grid-column: span 5;
}

.col-8 {
  grid-column: span 8;
}

.col-9 {
  grid-column: span 9;
}

.col-12,
.field.field-wide {
  grid-column: span 12;
}

label {
  display: block;
  margin: 0 0 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  background: #fff;
  color: #0f172a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 98, 201, .14);
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f5f9;
  color: #475569;
}

.uppercase-field,
.upper {
  text-transform: uppercase;
}

.row,
.inline-actions,
.page-actions,
.signup-actions,
.wizard-footer,
.wizard-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.signup-actions,
.wizard-footer {
  justify-content: flex-end;
  margin-top: 24px;
}

.btn,
button,
input[type="button"],
input[type="submit"],
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 16px;
  background: #fff;
  color: #0f172a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover,
button:hover,
a.btn:hover {
  border-color: #98a8bb;
}

.btn-primary,
button.btn-primary,
input[type="submit"] {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.btn-primary:hover,
button.btn-primary:hover {
  background: var(--brand);
}

.btn-outline,
.btn-secondary {
  background: #fff;
  color: #0f172a;
}

.btn-danger {
  border-color: #fecaca;
  color: var(--danger);
}

.btn-ok {
  border-color: #bbf7d0;
  color: var(--success);
}

.btn:disabled,
button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
  line-height: 1.15;
}

.badge.ok,
.status.on,
.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.warn,
.status.off,
.warn {
  background: #fef3c7;
  color: #92400e;
}

.badge.err,
.err {
  background: #fee2e2;
  color: #991b1b;
}

.info-box,
.msg {
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: #334155;
}

.emitente-address-grid .field-cep {
  grid-column: 1 / span 2;
}

.emitente-address-grid .field-logradouro {
  grid-column: 3 / span 8;
}

.emitente-address-grid .field-numero {
  grid-column: 11 / span 1;
}

.emitente-address-grid .field-uf {
  grid-column: 12 / span 1;
  grid-row: 1;
}

.emitente-address-grid .field-complemento {
  grid-column: 1 / span 3;
}

.emitente-address-grid .field-bairro {
  grid-column: 4 / span 3;
}

.emitente-address-grid .field-cidade {
  grid-column: 7 / span 3;
}

.emitente-address-grid .field-ibge {
  grid-column: 10 / span 3;
}

.emitente-address-grid .field-email {
  grid-column: 1 / span 4;
}

.emitente-address-grid .field-fone {
  grid-column: 5 / span 2;
}

.emitente-address-grid .field-logo-upload {
  grid-column: 7 / span 6;
}

.emitente-address-grid .field-cep input {
  max-width: 12ch;
}

.emitente-address-grid .field-numero input {
  max-width: 9ch;
}

.emitente-address-grid .field-uf input {
  max-width: 6ch;
  text-align: center;
}

.emitente-address-grid .field-ibge input {
  max-width: 20ch;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-upload-row input[type="file"] {
  min-width: 0;
  flex: 1 1 auto;
}

.logo-upload-row .btn {
  flex: 0 0 auto;
}

.emit-logo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.emit-logo-preview img {
  width: 72px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.emitente-header-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-soft);
}

.emitente-logo-box {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.emitente-logo-box img {
  width: 112px;
  height: 70px;
  object-fit: contain;
}

.emitente-meta strong {
  display: block;
  color: var(--brand);
  font-size: 15px;
  margin-bottom: 4px;
}

.emitente-info-text {
  color: #334155;
  line-height: 1.35;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.nfe-list-page .page-header {
  align-items: flex-start;
  justify-content: space-between;
}

.nfe-list-page .nfe-list-header {
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.nfe-list-page .nfe-issuer-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  flex: 1 1 auto;
}

.nfe-list-page .issuer-logo-stack {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.nfe-list-page .issuer-logo-box {
  width: 114px;
  height: 114px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nfe-list-page .issuer-logo-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nfe-list-page .issuer-model {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.nfe-list-page .issuer-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.nfe-list-page .issuer-title-block .page-title {
  margin-bottom: 6px;
  font-size: clamp(24px, 2.05vw, 32px);
  line-height: 1.08;
  white-space: nowrap;
  overflow-wrap: normal;
}

.nfe-list-page .page-actions {
  justify-content: flex-end;
  max-width: 640px;
  margin-left: auto;
}

.nfe-list-page .page-actions .btn {
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
}

.nfe-nova-page > .logo-topo {
  display: none;
}

.nfe-nova-page .nfe-issue-header {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nfe-nova-page .nfe-issuer-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  flex: 1 1 auto;
}

.nfe-nova-page .issuer-logo-stack {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.nfe-nova-page .issuer-logo-box {
  width: 114px;
  height: 114px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nfe-nova-page .issuer-logo-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nfe-nova-page .issuer-model {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.nfe-nova-page .issuer-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.nfe-nova-page .issuer-title-block .page-title {
  margin-bottom: 6px;
  font-size: clamp(24px, 2.05vw, 32px);
  line-height: 1.08;
}

.nfe-nova-page .page-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.nfe-nova-page .page-actions .btn {
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
}

.nfe-nova-page .header-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}

.nfe-nova-page .header-grid .field {
  flex: 0 0 220px;
}

.nfe-nova-page .header-field-ambiente {
  flex-basis: 210px;
}

.nfe-nova-page .header-field-serie {
  flex-basis: 86px;
}

.nfe-nova-page .header-field-tp-emis {
  flex-basis: 330px;
}

.nfe-nova-page .header-field-numero {
  flex-basis: 130px;
}

.nfe-nova-page .header-field-uf {
  flex-basis: 86px;
}

.nfe-nova-page .header-field-natureza {
  flex-basis: 320px;
}

.nfe-nova-page .header-field-tipo,
.nfe-nova-page .header-field-finalidade {
  flex-basis: 180px;
}

.nfe-nova-page .header-field-datetime {
  flex-basis: 210px;
}

.nfe-nova-page .header-field-justificativa {
  flex-basis: min(520px, 100%);
}

.nfe-nova-page #serie,
.nfe-nova-page #numero,
.nfe-nova-page #emit_uf {
  text-align: center;
}

.nfe-nova-page #itens_table {
  min-width: 1380px;
  table-layout: fixed;
}

.nfe-nova-page #itens_table th,
.nfe-nova-page #itens_table td {
  padding-left: 6px;
  padding-right: 6px;
}

.nfe-nova-page #itens_table input.in-table {
  min-height: 40px;
  padding: 8px 9px;
  width: 100%;
}

.nfe-nova-page #itens_table th:nth-child(1),
.nfe-nova-page #itens_table td:nth-child(1) {
  width: 33ch;
}

.nfe-nova-page #itens_table th:nth-child(2),
.nfe-nova-page #itens_table td:nth-child(2) {
  width: 13ch;
}

.nfe-nova-page #itens_table th:nth-child(3),
.nfe-nova-page #itens_table td:nth-child(3) {
  width: 9ch;
}

.nfe-nova-page #itens_table th:nth-child(4),
.nfe-nova-page #itens_table td:nth-child(4) {
  width: 8ch;
}

.nfe-nova-page #itens_table th:nth-child(5),
.nfe-nova-page #itens_table td:nth-child(5) {
  width: 7ch;
}

.nfe-nova-page #itens_table th:nth-child(7),
.nfe-nova-page #itens_table td:nth-child(7) {
  width: 10ch;
}

.nfe-nova-page #itens_table th:nth-child(6),
.nfe-nova-page #itens_table td:nth-child(6),
.nfe-nova-page #itens_table th:nth-child(8),
.nfe-nova-page #itens_table td:nth-child(8),
.nfe-nova-page #itens_table th:nth-child(9),
.nfe-nova-page #itens_table td:nth-child(9) {
  width: 17ch;
}

.nfe-nova-page #itens_table th:nth-child(10),
.nfe-nova-page #itens_table td:nth-child(10) {
  width: 10ch;
}

.nfe-nova-page #itens_table .item-prod {
  min-width: 30ch;
}

.nfe-nova-page #itens_table .item-ncm {
  min-width: 11ch;
}

.nfe-nova-page #itens_table .item-cfop {
  min-width: 8ch;
}

.nfe-nova-page #itens_table .item-vunit,
.nfe-nova-page #itens_table .item-desc,
.nfe-nova-page #itens_table .item-total {
  min-width: 15ch;
}

.nfe-nova-page #itens_table .item-desc-pct,
.nfe-nova-page #itens_table .item-qtd,
.nfe-nova-page #itens_table .item-un {
  min-width: 7ch;
}

.nfe-nova-page #itens_table .item-desc[readonly] {
  background: #f8fafc;
  color: #334155;
  cursor: default;
}

.nfe-nova-page #itens_table .item-total {
  background: #f8fafc;
  font-weight: 800;
}

.nfe-nova-page .product-suggestions {
  margin: 12px 0 6px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.nfe-nova-page .product-suggestions.hidden {
  display: none;
}

.nfe-nova-page .product-suggestion {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.nfe-nova-page .product-suggestion:hover,
.nfe-nova-page .product-suggestion:focus {
  border-color: #0f766e;
  background: #ecfeff;
  outline: none;
}

.nfe-nova-page .product-suggestion strong,
.nfe-nova-page .product-suggestion span {
  display: block;
}

.nfe-nova-page .product-suggestion strong {
  font-size: 13px;
  line-height: 1.25;
}

.nfe-nova-page .product-suggestion span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
}

.nfe-nova-page input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.nfe-nova-page .check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.nfe-nova-page .item-tax-panel input:not([type="checkbox"]),
.nfe-nova-page .item-tax-panel select,
.nfe-nova-page .tax-summary-grid input,
.nfe-nova-page .payment-main-grid input,
.nfe-nova-page .payment-main-grid select {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
}

.nfe-nova-page .item-tax-identity-grid {
  grid-template-columns:
    minmax(130px, 1fr)
    minmax(150px, 1fr)
    minmax(150px, 1fr)
    120px
    145px
    160px;
  gap: 10px 12px;
  align-items: start;
}

.nfe-nova-page .item-tax-identity-grid .field {
  display: grid;
  grid-template-rows: 36px 40px;
  align-content: start;
}

.nfe-nova-page .item-tax-identity-grid label {
  align-self: end;
}

.nfe-nova-page .item-tax-top-grid {
  display: grid;
  grid-template-columns:
    minmax(280px, 1.35fr)
    minmax(230px, 1.1fr)
    minmax(200px, 1fr)
    minmax(140px, .72fr)
    minmax(150px, .78fr)
    minmax(220px, 1.05fr);
  gap: 10px 12px;
  align-items: start;
}

.nfe-nova-page .item-tax-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 220px));
  justify-content: start;
  align-items: start;
  gap: 10px 12px;
  margin-top: 8px;
}

.nfe-nova-page .item-tax-identity-grid .field,
.nfe-nova-page .item-tax-top-grid .field,
.nfe-nova-page .item-tax-fields-grid .field,
.nfe-nova-page .tax-summary-grid .field,
.nfe-nova-page .payment-main-grid .field {
  grid-column: auto;
  min-width: 0;
}

.nfe-nova-page .item-tax-fields-grid .hint {
  grid-column: 1 / -1;
}

.nfe-nova-page .tax-summary-grid {
  grid-template-columns:
    minmax(190px, 220px)
    minmax(120px, 150px)
    minmax(130px, 150px)
    minmax(130px, 150px)
    minmax(130px, 150px)
    minmax(140px, 160px);
  justify-content: start;
  align-items: end;
  gap: 10px 14px;
}

.nfe-nova-page .payment-main-grid {
  grid-template-columns:
    minmax(160px, 190px)
    minmax(230px, 300px)
    minmax(120px, 145px)
    minmax(110px, 135px)
    minmax(140px, 160px)
    minmax(260px, 1fr);
  align-items: end;
  gap: 10px 14px;
}

.nfe-nova-page .local-toggle-grid,
.nfe-nova-page .billing-toggle-grid {
  display: flex;
  align-items: center;
  gap: 18px 30px;
  flex-wrap: wrap;
}

.nfe-nova-page .local-toggle-grid .field,
.nfe-nova-page .billing-toggle-grid .field {
  width: auto;
  min-width: 0;
}

.nfe-nova-page .local-toggle-grid .badge,
.nfe-nova-page .billing-toggle-grid .badge {
  margin-top: 0;
  white-space: nowrap;
}

.nfe-list-page .filters {
  display: grid;
  grid-template-columns: 150px 150px 86px 118px minmax(220px, 300px) 170px auto;
  align-items: end;
  gap: 12px;
  margin: 6px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.nfe-list-page .filters .field {
  grid-column: auto;
}

.nfe-list-page .filters input,
.nfe-list-page .filters select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
}

.nfe-list-page .filter-date input {
  max-width: 150px;
}

.nfe-list-page .filter-serie input {
  max-width: 86px;
}

.nfe-list-page .filter-numero input {
  max-width: 118px;
}

.nfe-list-page .filter-search input {
  max-width: 300px;
}

.nfe-list-page .filter-status select {
  max-width: 170px;
}

.nfe-list-page .filters-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
}

.nfe-list-page .filters-actions .btn {
  width: auto;
  min-height: 40px;
  padding: 8px 14px;
}

.nfe-list-page .xml-export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.nfe-list-page .xml-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.nfe-list-page .xml-select-all input,
.nfe-list-page .nota-select {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
}

.nfe-list-page .xml-export-actions .btn {
  min-height: 40px;
  padding: 8px 14px;
}

.nfe-list-page .table th:nth-child(1),
.nfe-list-page .table td:nth-child(1) {
  width: 70px;
}

.nfe-list-page .table th:nth-child(2),
.nfe-list-page .table td:nth-child(2) {
  width: 82px;
}

.nfe-list-page .table th:nth-child(3),
.nfe-list-page .table td:nth-child(3) {
  width: 110px;
}

.nfe-list-page .table th:nth-child(4),
.nfe-list-page .table td:nth-child(4) {
  width: 130px;
}

.nfe-list-page .table th:nth-child(6),
.nfe-list-page .table td:nth-child(6) {
  width: 140px;
}

.nfe-list-page .table th:nth-child(7),
.nfe-list-page .table td:nth-child(7) {
  width: 120px;
}

.nfe-list-page .table th:nth-child(8),
.nfe-list-page .table td:nth-child(8) {
  width: 190px;
  white-space: nowrap;
}

table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf2f7;
  color: #111827;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.right {
  text-align: right;
}

.review-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.review-grid > *,
.cards-grid > * {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.hidden {
  display: none !important;
}

.home-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 12%, rgba(0, 118, 111, .10), transparent 30%),
    linear-gradient(135deg, #f7fafc, #e8f0f8);
}

.home-shell {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(360px, 1fr) minmax(300px, 430px);
  gap: 38px;
  align-items: center;
  min-height: calc(100vh - 180px);
}

.home-brand {
  display: grid;
  place-items: center;
  min-width: 0;
}

.home-brand img {
  width: min(360px, 100%);
  max-height: 360px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 18px 34px rgba(15, 23, 42, .08));
}

.home-copy {
  min-width: 0;
}

.home-copy h1 {
  color: var(--brand);
  font-size: clamp(36px, 4.7vw, 64px);
  line-height: 1.08;
  margin: 10px 0 18px;
}

.home-copy p {
  max-width: 760px;
  color: #31415a;
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.55;
  margin-bottom: 26px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-large {
  padding: 15px 20px;
  min-height: 56px;
}

.invoice-preview {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.invoice-paper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .10);
}

.invoice-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.invoice-top strong {
  display: block;
  color: var(--brand);
  font-size: 20px;
}

.invoice-top span,
.invoice-total span,
.mini-cards span {
  color: var(--muted);
}

.invoice-top b {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid #2453e8;
  border-radius: 12px;
  color: #2453e8;
  font-size: 20px;
}

.invoice-lines {
  display: grid;
  gap: 11px;
  padding: 22px 0;
}

.invoice-lines span {
  display: block;
  height: 11px;
  border-radius: 99px;
  background: #d9e8fb;
}

.invoice-lines span:nth-child(2) { width: 78%; }
.invoice-lines span:nth-child(3) { width: 88%; }
.invoice-lines span:nth-child(4) { width: 64%; }

.invoice-grid-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.invoice-grid-mini i {
  height: 42px;
  border-radius: 8px;
  background: #eef3f9;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
}

.invoice-total strong {
  color: var(--brand);
  font-size: 22px;
}

.mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-cards div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.78);
}

.mini-cards strong {
  display: block;
  color: var(--brand);
  margin-bottom: 6px;
}

.home-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.home-summary article {
  min-height: 100px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.88);
}

.home-summary strong {
  display: block;
  color: var(--brand);
  margin-bottom: 6px;
}

.home-summary p {
  color: #43536a;
  margin: 0;
}

.wizard-tabs,
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.tab,
.wizard-tab {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  padding: 10px 14px;
}

.tab.active,
.wizard-tab.active {
  border-color: #0f172a;
  box-shadow: inset 0 0 0 1px #0f172a;
}

@media (max-width: 1100px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .home-brand img {
    width: min(260px, 70vw);
  }

  .invoice-preview {
    max-width: 620px;
    width: 100%;
  }

  .home-summary {
    grid-template-columns: 1fr;
  }

  .field,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-8,
  .col-9 {
    grid-column: span 6;
  }

  .logo-topo {
    position: static;
    width: 120px;
    max-width: none;
    margin: 18px auto 0;
  }

  .emitente-address-grid .field-cep,
  .emitente-address-grid .field-numero,
  .emitente-address-grid .field-complemento,
  .emitente-address-grid .field-bairro,
  .emitente-address-grid .field-cidade,
  .emitente-address-grid .field-ibge,
  .emitente-address-grid .field-uf,
  .emitente-address-grid .field-email,
  .emitente-address-grid .field-fone,
  .emitente-address-grid .field-logo-upload {
    grid-column: span 6;
  }

  .emitente-address-grid .field-uf {
    grid-row: auto;
  }

  .emitente-address-grid .field-logradouro {
    grid-column: span 12;
  }

  .nfe-nova-page .item-tax-identity-grid,
  .nfe-nova-page .item-tax-top-grid,
  .nfe-nova-page .tax-summary-grid,
  .nfe-nova-page .payment-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nfe-nova-page .item-tax-identity-grid .field,
  .nfe-nova-page .item-tax-top-grid .field,
  .nfe-nova-page .item-tax-fields-grid .field,
  .nfe-nova-page .tax-summary-grid .field,
  .nfe-nova-page .payment-main-grid .field {
    grid-column: auto;
  }

  .nfe-list-page .filters {
    grid-template-columns: 150px 150px 86px 118px minmax(220px, 1fr) 170px;
  }

  .nfe-list-page .filters-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .home-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0 32px;
  }

  .home-hero {
    gap: 22px;
  }

  .home-copy h1 {
    font-size: 34px;
  }

  .home-actions .btn {
    width: 100%;
  }

  .mini-cards {
    grid-template-columns: 1fr;
  }

  .app,
  .signup-shell {
    width: min(100% - 20px, 100%);
    padding: 14px 0 28px;
  }

  .signup-card,
  .card,
  .panel {
    padding: 18px;
    border-radius: 10px;
  }

  .signup-brand,
  .page-header,
  .wizard-header {
    display: block;
  }

  .nfe-list-page .nfe-list-header,
  .nfe-list-page .nfe-issuer-header,
  .nfe-nova-page .nfe-issue-header,
  .nfe-nova-page .nfe-issuer-header {
    display: flex;
  }

  .nfe-list-page .nfe-list-header,
  .nfe-nova-page .nfe-issue-header {
    flex-direction: column;
    align-items: stretch;
  }

  .nfe-list-page .issuer-logo-box,
  .nfe-nova-page .issuer-logo-box {
    width: 86px;
    height: 86px;
  }

  .nfe-list-page .issuer-title-block .page-title,
  .nfe-nova-page .issuer-title-block .page-title {
    white-space: normal;
  }

  .nfe-nova-page .header-grid .field {
    flex-basis: 100%;
  }

  .nfe-nova-page .item-tax-identity-grid,
  .nfe-nova-page .item-tax-top-grid,
  .nfe-nova-page .tax-summary-grid,
  .nfe-nova-page .payment-main-grid {
    grid-template-columns: 1fr;
  }

  .nfe-nova-page .local-toggle-grid,
  .nfe-nova-page .billing-toggle-grid {
    align-items: flex-start;
    gap: 12px;
  }

  .signup-brand img {
    width: 130px;
    max-width: 55%;
    margin: 0 auto 18px;
    display: block;
  }

  .field,
  .field-2,
  .field-wide,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-8,
  .col-9,
  .col-12 {
    grid-column: span 12;
  }

  .signup-actions,
  .wizard-footer,
  .wizard-footer-actions,
  .page-actions {
    align-items: stretch;
  }

  .btn,
  button,
  a.btn {
    width: 100%;
  }

  .emitente-address-grid .field-cep,
  .emitente-address-grid .field-logradouro,
  .emitente-address-grid .field-numero,
  .emitente-address-grid .field-complemento,
  .emitente-address-grid .field-bairro,
  .emitente-address-grid .field-cidade,
  .emitente-address-grid .field-ibge,
  .emitente-address-grid .field-uf,
  .emitente-address-grid .field-email,
  .emitente-address-grid .field-fone,
  .emitente-address-grid .field-logo-upload {
    grid-column: span 12;
  }

  .emitente-address-grid .field-uf {
    grid-row: auto;
  }

  .logo-upload-row {
    align-items: stretch;
    flex-direction: column;
  }

  .emitente-header-card {
    grid-template-columns: 1fr;
  }

  .emitente-logo-box {
    min-height: 78px;
  }

  .nfe-list-page .filters {
    grid-template-columns: 1fr 1fr;
  }

  .nfe-list-page .filter-search,
  .nfe-list-page .filter-status,
  .nfe-list-page .filters-actions {
    grid-column: 1 / -1;
  }

  .nfe-list-page .filter-date input,
  .nfe-list-page .filter-serie input,
  .nfe-list-page .filter-numero input,
  .nfe-list-page .filter-search input,
  .nfe-list-page .filter-status select {
    max-width: none;
  }

  .nfe-list-page .filters-actions .btn,
  .nfe-list-page .xml-export-actions .btn {
    width: 100%;
  }
}
