/* =========================================================
   CONTMAXXI - CSS GLOBAL (COMPLETO)
   ========================================================= */

:root{
  --logo-top-width: clamp(96px, 9vw, 155px);
  --logo-side-space: clamp(118px, 12vw, 190px);
  --watermark-size: 420px;
  --page-padding: 20px;
}


html, body{
  height: 100%;
  margin: 0;
  padding: 0;
}

/* =========================================================
   FUNDO + MARCA D’ÁGUA (CONTROLADA)
   ========================================================= */

body{
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f5f6fa;

  /* Marca d’água (LOGOTIPO.jpg na pasta raiz) */
  background-image: url("../LOGOTIPO.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: var(--watermark-size);
  background-attachment: fixed;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.94);
  pointer-events: none;
  z-index: 0;
}

/* =========================================================
   ESTRUTURA PRINCIPAL
   ========================================================= */

.logo-topo{
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1;
  pointer-events: none;
}

.logo-topo img{
  width: var(--logo-top-width);
  max-width: calc(100vw - 44px);
  height: auto;
  opacity: 0.96;
}


.app{
  position: relative;
  z-index: 2;
  padding: var(--page-padding) calc(var(--page-padding) + var(--logo-side-space)) var(--page-padding) var(--page-padding);
}

.card{
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* =========================================================
   CABEÇALHO DA PÁGINA
   ========================================================= */

.page-header{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.page-title{
  margin: 0;
  font-size: 22px;
  color: #1e293b;
}

.page-subtitle{
  margin: 6px 0 0;
  font-size: 13px;
  color: #475569;
}

.page-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   STEPS (WIZARD)
   ========================================================= */

.steps{
  display: flex;
  gap: 6px;
  margin: 18px 0 20px;
  flex-wrap: wrap;
}

.step{
  padding: 6px 12px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 12px;
  color: #374151;
}

.step.active{
  background: #111827;
  color: #ffffff;
}

/* =========================================================
   PAINÉIS / SEÇÕES
   ========================================================= */

.panel{
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 14px 16px;
  margin-bottom: 18px;
}

.panel-title{
  font-weight: bold;
  font-size: 14px;
  color: #111827;
  margin-bottom: 10px;
}

.divider{
  height: 1px;
  background: #e5e7eb;
  margin: 14px 0;
}

.hint{
  font-size: 12px;
  color: #6b7280;
}

.err{
  color: #b00020;
  font-size: 12px;
}

.ok{
  color: #0a7a2f;
  font-size: 12px;
}

/* =========================================================
   FORMULÁRIOS
   ========================================================= */

.form-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 10px;
  row-gap: 8px;
}

.dest-search-grid{
  grid-template-columns: 1.15fr 1.45fr 1.4fr;
  align-items: start;
}

.dest-country-field,
.dest-doc-field,
.dest-search-actions{
  grid-column: auto;
}

.dest-search-actions .inline-actions{
  min-height: 36px;
  align-items: center;
}

.field{
  display: flex;
  flex-direction: column;
}

.field-wide{
  grid-column: span 4;
}

textarea{
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

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

.review-card{
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.review-card strong{
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: #111827;
}

.review-card p{
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.field-3{
  grid-column: span 3;
}

label{
  font-size: 12px;
  color: #374151;
  margin-bottom: 4px;
}

input, select{
  height: 36px;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
}

input:focus, select:focus{
  border-color: #2563eb;
}

.info-box{
  background: #f1f5f9;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  color: #334155;
}

.technical-details{
  margin-top: 12px;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
}

.technical-details summary{
  cursor: pointer;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.technical-details .hint{
  margin-top: 8px;
}

/* =========================================================
   FILTROS DA LISTAGEM NF-e
   ========================================================= */

.filters{
  display: grid;
  grid-template-columns: 142px 142px 96px 112px minmax(260px, 1fr) 150px auto;
  gap: 8px;
  align-items: end;
  margin: 16px 0 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.filters .field{
  min-width: 0;
}

.filters input,
.filters select{
  width: 100%;
}

.filters .filter-date input{
  min-width: 138px;
}

.filters-actions{
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

/* =========================================================
   ✅ GRID HOMOGÊNEO DO CABEÇALHO
   - Evita “buracos” e aproxima o Tipo de operação
   - Mantém tudo alinhado e compacto
   ========================================================= */

.header-grid{
  /* ✅ ALTERAÇÃO: agora são 5 colunas para colocar "Natureza" ao lado da UF */
  grid-template-columns: 200px 200px 200px 200px 260px;
  justify-content: start;
  align-items: start;
  max-width: 1120px; /* ✅ ajustado para caber 5 colunas sem “buracos” */
}

/* ✅ ALTERAÇÃO: reposiciona os campos do cabeçalho sem mexer no HTML */
.header-grid > .field:nth-child(5){
  /* Natureza da operação vai para a 1ª linha, ao lado direito da UF */
  grid-column: 5;
  grid-row: 1;
}

.header-grid > .field:nth-child(6){ grid-column: 1; grid-row: 2; } /* Tipo de operação */
.header-grid > .field:nth-child(7){ grid-column: 2; grid-row: 2; } /* Finalidade */

.header-grid > .field:nth-child(8){
  /* Data/Hora emissão ocupa 2 colunas centrais na 2ª linha */
  grid-column: 3 / span 2;
  grid-row: 2;
}

.header-grid > .field:nth-child(9){
  /* Data/Hora saída sobe para a 2ª linha à direita */
  grid-column: 5;
  grid-row: 2;
}

/* Dentro do cabeçalho, deixa o grid mandar na largura (100%) */
.header-grid input,
.header-grid select{
  width: 100%;
  max-width: 100%;
}

/* Ajustes finos de compactação visual */
.header-grid .info-box{
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* Datas no cabeçalho mais enxutas */
.header-grid #dt_emissao,
.header-grid #dt_saida{
  max-width: 100%;
}

/* =========================================================
   AJUSTES: CAMPOS DO DESTINATÁRIO (SE VOCÊ JÁ ESTAVA USANDO)
   ========================================================= */

#dest_doc{ width: 260px; max-width: 260px; }
#dest_ie{  width: 260px; max-width: 260px; }
#dest_cep{ width: 160px; max-width: 160px; }
#dest_uf{  width: 90px;  max-width: 90px;  }
#dest_mun{ width: 360px; max-width: 360px; }
#dest_num{ width: 140px; max-width: 140px; }

/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 980px){
  :root{
    --logo-top-width: 92px;
    --logo-side-space: 0px;
  }

  .app{
    padding-right: var(--page-padding);
  }

  .logo-topo{
    top: 10px;
    right: 10px;
    opacity: 0.82;
  }

  .page-header{
    padding-right: 100px;
  }

  .form-grid{
    grid-template-columns: 1fr;
  }

  .dest-search-grid{
    grid-template-columns: 1fr;
  }

  .filters{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters .filter-search,
  .filters .filter-status,
  .filters-actions{
    grid-column: span 2;
  }

  .field-wide,
  .field-3{
    grid-column: span 1;
  }

  .header-grid{
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  #dest_doc,
  #dest_ie,
  #dest_cep,
  #dest_uf,
  #dest_mun,
  #dest_num{
    width: 100%;
    max-width: 100%;
  }
}

/* =========================================================
   BOTÕES
   ========================================================= */

.btn{
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary{
  background: #111827;
  color: #ffffff;
}

.btn-outline{
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #111827;
}

.btn-ghost{
  background: #eef2f7;
  color: #111827;
}

.btn-danger{
  background: #ffffff;
  border: 1px solid #ef4444;
  color: #ef4444;
}

/* =========================================================
   BADGES / STATUS
   ========================================================= */

.badge{
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 999px;
}

.badge.ok{
  background: #dcfce7;
  color: #166534;
}

.badge.warn{
  background: #fef3c7;
  color: #92400e;
}

.badge.err{
  background: #fee2e2;
  color: #991b1b;
}

/* =========================================================
   TABELA DE ITENS
   ========================================================= */

.table-wrap{
  overflow-x: auto;
}

.table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th{
  background: #f1f5f9;
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.table td{
  padding: 6px;
  border-bottom: 1px solid #e5e7eb;
}

.right{
  text-align: right;
}

.in-table{
  width: 100%;
  height: 32px;
  font-size: 13px;
}

#itens_table{
  min-width: 1120px;
}

#itens_table th:first-child,
#itens_table td:first-child{
  width: 34%;
  min-width: 360px;
}

#itens_table .item-prod{
  min-width: 340px;
}

#itens_table th:nth-child(2),
#itens_table td:nth-child(2){
  width: 120px;
}

#itens_table th:nth-child(3),
#itens_table td:nth-child(3){
  width: 105px;
}

#itens_table th:nth-child(4),
#itens_table td:nth-child(4),
#itens_table th:nth-child(6),
#itens_table td:nth-child(6),
#itens_table th:nth-child(7),
#itens_table td:nth-child(7),
#itens_table th:nth-child(8),
#itens_table td:nth-child(8){
  width: 115px;
}

#itens_table th:nth-child(5),
#itens_table td:nth-child(5){
  width: 75px;
}

#itens_table th:nth-child(9),
#itens_table td:nth-child(9){
  width: 120px;
}

.item-tax-panel{
  margin-top: 16px;
  background: #fbfdff;
  max-width: 100%;
  overflow: hidden;
}

.item-tax-top-grid{
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(190px, .9fr) minmax(190px, .9fr) minmax(190px, .9fr);
  gap: 10px;
  align-items: start;
  max-width: 100%;
}

.item-tax-fields-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 10px;
  align-items: start;
  max-width: 100%;
}

.item-tax-panel .field{
  min-width: 0;
}

.item-tax-panel input,
.item-tax-panel select{
  width: 100%;
  max-width: 100%;
}

.item-tax-panel .hint{
  max-width: 360px;
  line-height: 1.35;
}

.product-suggestions{
  margin-top: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.product-suggestion{
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: #ffffff;
  color: #111827;
  text-align: left;
  cursor: pointer;
}

.product-suggestion:hover{
  background: #f8fafc;
}

.product-suggestion:last-child{
  border-bottom: 0;
}

.product-suggestion span{
  color: #64748b;
  font-size: 12px;
}

.cell-total{
  font-weight: bold;
  color: #111827;
}

/* =========================================================
   AÇÕES + TOTAIS
   ========================================================= */

.row-actions{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.totals{
  display: flex;
  gap: 18px;
  font-size: 13px;
}

/* =========================================================
   FOOTER DO WIZARD
   ========================================================= */

.wizard-footer{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   UTILITÁRIOS
   ========================================================= */

.hidden{
  display: none !important;
}

.inline-actions{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.document-actions{
  margin-top: 12px;
}

.document-actions .btn{
  min-width: 120px;
}

.link{
  color: #1d4ed8;
  text-decoration: underline;
}

.sep{
  display: inline-block;
  margin: 0 5px;
  color: #94a3b8;
}

.no-print{
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

/* =========================================================
   DANFE NFC-e EM BOBINA TERMICA
   ========================================================= */

.thermal-print-page{
  background: #f3f4f6;
  background-image: none;
}

.thermal-print-page::before{
  display: none;
}

.thermal-page{
  min-height: 100vh;
  padding: 18px;
  box-sizing: border-box;
}

.thermal-toolbar{
  max-width: 720px;
  margin: 0 auto 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.thermal-receipt{
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  font-family: "Courier New", Consolas, monospace;
  line-height: 1.25;
  border: 1px solid #d1d5db;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
  box-sizing: border-box;
}

.thermal-80{
  width: 72mm;
  padding: 4mm;
  font-size: 10px;
}

.thermal-58{
  width: 50mm;
  padding: 3mm;
  font-size: 9px;
}

.thermal-center{
  text-align: center;
}

.thermal-strong{
  font-weight: 700;
}

.thermal-line{
  white-space: nowrap;
  overflow: hidden;
  margin: 3px 0;
}

.thermal-row{
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.thermal-row span:first-child{
  min-width: 0;
}

.thermal-row span:last-child{
  flex: 0 0 auto;
  text-align: right;
}

.thermal-head,
.thermal-total{
  font-weight: 700;
}

.thermal-item{
  margin: 4px 0;
  break-inside: avoid;
}

.thermal-key{
  margin: 4px 0;
  text-align: center;
  word-break: break-all;
}

.thermal-qr{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 132px;
  margin: 6px 0;
  word-break: break-all;
  text-align: center;
}

.thermal-warn{
  margin: 5px 0;
  padding: 4px;
  border: 1px dashed #000000;
  text-align: center;
  font-weight: 700;
}

/* =========================================================
   DANFE NF-e A4
   ========================================================= */

.a4-print-page{
  background: #e5e7eb;
  background-image: none;
}

.a4-print-page::before{
  display: none;
}

.danfe-toolbar{
  max-width: 210mm;
  margin: 16px auto 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.danfe-a4{
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  padding: 6mm;
  box-sizing: border-box;
  background: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  line-height: 1.25;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.danfe-box{
  border: 1px solid #000000;
  margin-bottom: 2mm;
}

.danfe-header{
  display: grid;
  grid-template-columns: 1.28fr .7fr 1.02fr;
  border: 1px solid #000000;
  margin-bottom: 2mm;
}

.danfe-cell{
  padding: 2mm;
  border-right: 1px solid #000000;
}

.danfe-cell:last-child{
  border-right: 0;
}

.danfe-title{
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.danfe-subtitle{
  text-align: center;
  font-size: 9px;
  text-transform: uppercase;
}

.danfe-access-key{
  font-family: "Courier New", Consolas, monospace;
  font-size: 10px;
  text-align: center;
  word-break: break-all;
  margin-top: 2mm;
}

.danfe-logo-line{
  display: flex;
  gap: 2mm;
  align-items: flex-start;
}

.danfe-logo-line img{
  width: 22mm;
  height: auto;
  object-fit: contain;
}

.danfe-company-name{
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.danfe-operation-box{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #000000;
  margin: 2mm 0;
  text-align: center;
}

.danfe-operation-box div{
  padding: 1mm;
  border-right: 1px solid #000000;
}

.danfe-operation-box div:last-child{
  border-right: 0;
}

.danfe-number{
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-top: 2mm;
}

.danfe-barcode{
  display: block;
  width: 100%;
  height: 16mm;
  margin: 1.5mm 0;
  background: #ffffff;
  fill: #000000;
}

.danfe-section-title{
  background: #e5e7eb;
  border-bottom: 1px solid #000000;
  padding: 1mm 2mm;
  font-weight: 700;
  text-transform: uppercase;
}

.danfe-fields{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.danfe-fields-6{
  grid-template-columns: repeat(6, 1fr);
}

.danfe-field{
  min-height: 9mm;
  padding: 1mm 1.4mm;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  box-sizing: border-box;
}

.danfe-field:nth-child(4n){
  border-right: 0;
}

.danfe-fields-6 .danfe-field:nth-child(4n){
  border-right: 1px solid #000000;
}

.danfe-fields-6 .danfe-field:nth-child(6n){
  border-right: 0;
}

.danfe-field strong{
  display: block;
  font-size: 7px;
  text-transform: uppercase;
  margin-bottom: 1mm;
}

.danfe-field-wide{
  grid-column: span 2;
}

.danfe-field-3{
  grid-column: span 3;
}

.danfe-field-4{
  grid-column: span 4;
}

.danfe-field-full{
  grid-column: 1 / -1;
}

.danfe-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 8px;
}

.danfe-table th,
.danfe-table td{
  border: 1px solid #000000;
  padding: .9mm;
  vertical-align: top;
}

.danfe-table th{
  background: #e5e7eb;
  text-transform: uppercase;
  font-size: 6.2px;
}

.danfe-totals{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

.danfe-totals .danfe-field:nth-child(4n){
  border-right: 1px solid #000000;
}

.danfe-totals .danfe-field:nth-child(6n){
  border-right: 0;
}

.danfe-note{
  min-height: 18mm;
  padding: 2mm;
  white-space: pre-wrap;
}

.danfe-two-columns{
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.danfe-two-columns > div:first-child{
  border-right: 1px solid #000000;
}

@media print{
  .a4-print-page{
    background: #ffffff !important;
  }

  .danfe-toolbar{
    display: none !important;
  }

  .danfe-a4{
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .danfe-box,
  .danfe-header,
  .danfe-table th,
  .danfe-table td{
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
#ambiente,
#serie,
#numero{
  width: 180px;
  max-width: 180px;
}

/* ✅ ÚNICA ALTERAÇÃO: Natureza da operação passa a ocupar 100% da coluna (igual ao dt_saida) */
#natureza_sug{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* ADICIONADO: Destaque de erro para validação */
.input-error {
  border-color: #e63946 !important;
  background-color: #fff5f5 !important;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2) !important;
}

/* =========================================================
   PAGINA INICIAL PUBLICA
   ========================================================= */

.home-page,
.login-page,
.signup-page{
  background-image: none;
  background-color: #f5f7fb;
}

.home-page::before,
.login-page::before,
.signup-page::before{
  display: none;
}

.home-shell{
  min-height: 100vh;
  padding: 28px;
  box-sizing: border-box;
}

.home-hero{
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(320px, 1fr) minmax(310px, 420px);
  align-items: center;
  gap: 34px;
  max-width: 1180px;
  margin: 0 auto;
}

.home-brand img{
  width: 100%;
  max-width: 330px;
  display: block;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f7f6;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.home-copy h1{
  margin: 14px 0 12px;
  font-size: 42px;
  line-height: 1.08;
  color: #172554;
  letter-spacing: 0;
}

.home-copy p{
  max-width: 620px;
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.55;
}

.home-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn-large{
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.invoice-preview{
  display: grid;
  gap: 12px;
}

.invoice-paper{
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.13);
}

.invoice-top{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.invoice-top strong,
.invoice-top span{
  display: block;
}

.invoice-top strong{
  color: #172554;
  font-size: 15px;
}

.invoice-top span{
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.invoice-top b{
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1d4ed8;
  border-radius: 8px;
  color: #1d4ed8;
}

.invoice-lines{
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.invoice-lines span,
.invoice-grid-mini i{
  height: 9px;
  border-radius: 999px;
  background: #dbeafe;
}

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

.invoice-lines span:nth-child(3){
  width: 86%;
}

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

.invoice-grid-mini{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.invoice-grid-mini i{
  height: 34px;
  border-radius: 6px;
  background: #f1f5f9;
}

.invoice-total{
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  color: #172554;
}

.invoice-total span{
  color: #64748b;
  font-size: 12px;
}

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

.mini-cards div,
.home-summary article{
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 12px;
}

.mini-cards strong,
.mini-cards span,
.home-summary strong,
.home-summary p{
  display: block;
}

.mini-cards strong,
.home-summary strong{
  color: #172554;
  font-size: 13px;
}

.mini-cards span,
.home-summary p{
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.home-summary{
  max-width: 1180px;
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* =========================================================
   LOGIN E CADASTRO
   ========================================================= */

.login-shell,
.signup-shell{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  box-sizing: border-box;
}

.login-card,
.signup-card{
  width: 100%;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.login-card{
  max-width: 430px;
  padding: 28px;
}

.login-logo{
  text-align: center;
  margin-bottom: 18px;
}

.login-logo img{
  width: 230px;
  max-width: 100%;
}

.login-card h1,
.signup-brand h1{
  margin: 0;
  color: #172554;
  letter-spacing: 0;
}

.login-card h1{
  font-size: 24px;
}

.login-card p,
.signup-brand p{
  margin: 8px 0 20px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.login-card label{
  display: block;
  margin-top: 12px;
}

.login-card input{
  width: 100%;
  height: 40px;
  margin-top: 5px;
}

.password-wrap{
  position: relative;
}

.password-wrap input{
  padding-right: 72px;
}

.password-toggle{
  position: absolute;
  right: 6px;
  top: 7px;
  height: 28px;
  min-width: 52px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.btn-block{
  width: 100%;
  margin-top: 18px;
}

.login-links{
  display: grid;
  gap: 8px;
  margin-top: 16px;
  text-align: center;
}

.login-links a{
  color: #1d4ed8;
  font-size: 13px;
  text-decoration: none;
}

.signup-card{
  max-width: 980px;
  padding: 24px;
}

.signup-brand{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
}

.signup-brand img{
  width: 220px;
  max-width: 100%;
}

.signup-brand h1{
  font-size: 28px;
  margin-top: 10px;
}

.signup-grid{
  grid-template-columns: repeat(3, 1fr);
}

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

.section-heading{
  margin: 0 0 12px;
  color: #172554;
  font-size: 18px;
}

.password-rule{
  margin-top: 16px;
  padding: 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

.password-rule-inline{
  margin-top: 0;
  align-self: end;
  line-height: 1.45;
}

.signup-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

@media (max-width: 980px){
  .home-hero,
  .home-summary,
  .signup-brand,
  .signup-grid{
    grid-template-columns: 1fr;
  }

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

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

  .field-2{
    grid-column: span 1;
  }
}

@media (max-width: 1180px){
  .item-tax-top-grid{
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 620px){
  .item-tax-top-grid,
  .item-tax-fields-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px){
  :root{
    --logo-top-width: 70px;
  }

  .logo-topo{
    opacity: 0.55;
  }

  .page-header{
    padding-right: 0;
  }

  .home-shell,
  .login-shell,
  .signup-shell{
    padding: 16px;
  }

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

  .filters .filter-search,
  .filters .filter-status,
  .filters-actions{
    grid-column: span 1;
  }

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

  .home-actions,
  .signup-actions{
    display: grid;
  }

  .btn-large,
  .signup-actions .btn{
    width: 100%;
  }
}

@media print{
  @page{
    size: A4 portrait;
    margin: 10mm;
  }

  body{
    background: #ffffff !important;
    background-image: none !important;
  }

  body::before,
  .logo-topo,
  .no-print,
  .page-actions{
    display: none !important;
  }

  .app{
    padding: 0 !important;
  }

  .card{
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .panel{
    break-inside: avoid;
  }

  .table-wrap{
    overflow: visible;
  }

  .thermal-page{
    min-height: 0;
    padding: 0 !important;
  }

  .thermal-receipt{
    width: 72mm;
    margin: 0;
    padding: 3mm;
    border: 0;
    box-shadow: none;
  }

  .thermal-receipt.thermal-58{
    width: 50mm;
    padding: 2mm;
  }
}
