.nota-entre-page {
  width: 100%;
  min-height: calc(var(--app-dvh, 100dvh) - 132px);
  padding: 20px 18px 28px;
  color: #0f172a;
}

.nee-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.nee-header h1 {
  margin: 0;
  color: #0f172a;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(26px, 2.3vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.nee-header p {
  margin: 12px 0 0;
  color: #53627a;
  font-size: 15px;
}

.nee-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.nee-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.nee-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 150px;
}

.nee-top-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(460px, 1.25fr);
  gap: 16px;
}

.nee-card {
  background: #fff;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  padding: 22px 20px;
}

.nee-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.nee-card-heading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nee-card-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf3ff;
  color: #2563eb;
  font-weight: 900;
}

.nee-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-family: "Manrope", sans-serif;
  font-weight: 850;
}

.nee-card.summary,
.nee-card.last {
  padding: 24px;
}

.nee-card.last.ok {
  border-color: #b9e6c6;
  background: linear-gradient(145deg, #ffffff, #f1fff6);
}

.nee-company-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nee-company-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.nee-company-info {
  min-height: 118px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.nee-company-info div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nee-company-info span,
.nee-field > span {
  color: #37445c;
  font-size: 12px;
  font-weight: 850;
}

.nee-company-info strong {
  color: #21304a;
  font-size: 14px;
  font-weight: 700;
}

.nee-company-info .nee-address-status {
  padding-top: 2px;
}

.nee-company-info .nee-address-status strong {
  font-size: 12px;
  line-height: 1.35;
}

.nee-company-info .nee-address-status.missing strong {
  color: #b91c1c;
}

.nee-company-info .nee-address-status.ok strong {
  color: #047857;
}

.nee-last-error {
  margin: 10px 0 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.nee-form-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 0.7fr;
  gap: 16px 18px;
}

.nee-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nee-field.wide {
  grid-column: span 1;
}

.nee-field input,
.nee-field select,
.nee-card textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.nee-field input:focus,
.nee-field select:focus,
.nee-card textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nee-card textarea {
  min-height: 96px;
  resize: vertical;
}

.nee-btn,
.nee-doc-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 850;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.nee-btn:disabled,
.nee-doc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nee-btn:not(:disabled):hover,
.nee-doc-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.nee-btn.refresh {
  background: #08776e;
  color: #fff;
  box-shadow: 0 12px 22px rgba(8, 119, 110, 0.2);
}

.nee-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nee-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -8px 0 18px;
  padding: 8px;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.nee-subtabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #53627a;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
}

.nee-subtabs button.active {
  color: #5b21b6;
  background: #e9ddff;
}

.nee-subtabs span {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #6d28d9;
  font-size: 12px;
}

.nee-btn.add,
.nee-btn.outline {
  background: #fff;
  color: #1d4ed8;
  border-color: #2563eb;
}

.nee-btn.primary,
.nee-btn.emit {
  background: linear-gradient(135deg, #2563eb, #0b56d9);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.nee-btn.neutral,
.nee-btn.ghost {
  background: #fff;
  color: #334155;
  border-color: #cbd6e5;
}

.nee-table-wrap {
  overflow-x: auto;
  border: 1px solid #dce4ef;
  border-radius: 10px;
}

.nee-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.nee-table th {
  height: 46px;
  padding: 0 16px;
  background: #f8fafc;
  color: #344157;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
}

.nee-table td {
  padding: 12px 16px;
  border-top: 1px solid #e8eef6;
  vertical-align: middle;
}

.nee-product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 290px;
}

.nee-product-thumb {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 52px;
  border-radius: 10px;
  border: 1px solid #dce4ef;
  background: linear-gradient(145deg, #f8fafc, #edf2f7);
  color: #64748b;
}

.nee-product-cell strong {
  display: block;
  color: #111827;
  font-weight: 800;
  line-height: 1.25;
}

.nee-product-cell small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.nee-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nee-row-actions button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #eff6ff;
  color: #2563eb;
  cursor: pointer;
  font-weight: 900;
}

.nee-row-actions button:last-child {
  background: #fff1f2;
  color: #e11d48;
}

.nee-empty {
  height: 78px;
  text-align: center;
  color: #64748b;
}

.nee-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 0;
  color: #64748b;
  font-size: 14px;
}

.nee-pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nee-pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
}

.nee-pagination button.active {
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 900;
}

.nee-item-editor {
  margin: -4px 0 18px;
  padding: 16px;
  border: 1px dashed #9bb7ff;
  border-radius: 12px;
  background: #f8fbff;
}

.nee-item-editor-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, minmax(110px, 0.7fr));
  gap: 12px;
}

.nee-item-editor-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.nee-item-editor-actions span {
  margin-right: auto;
  color: #0f172a;
  font-weight: 850;
}

.nee-counter {
  margin-top: 6px;
  text-align: right;
  color: #64748b;
  font-size: 12px;
}

.nee-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  color: #172033;
  font-size: 16px;
}

.nee-summary-row + .nee-summary-row {
  border-top: 1px solid #e4eaf2;
}

.nee-summary-row strong {
  font-size: 16px;
}

.nee-summary-row.strong strong {
  color: #1556e8;
  font-size: 22px;
}

.nee-summary-row.strong span,
.nee-summary-row.strong strong {
  font-weight: 950;
}

.nee-card.last h3 {
  margin: 20px 0 12px;
  font-size: 24px;
  color: #0f172a;
}

.nee-status {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 850;
}

.nee-status.ok {
  color: #15803d;
  background: #dcfce7;
}

.nee-status.warning {
  color: #9a3412;
  background: #ffedd5;
}

.nee-status.danger {
  color: #991b1b;
  background: #fee2e2;
}

.nee-status.neutral {
  color: #475569;
  background: #f1f5f9;
}

.nee-status.muted {
  color: #64748b;
  background: #e2e8f0;
}

.nee-consult-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nee-consult-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 2px;
}

.nee-consult-heading h2 {
  margin: 0;
  color: #0f172a;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.nee-consult-heading p {
  margin: 4px 0 0;
  color: #607089;
}

.nee-consult-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(260px, 1.2fr) minmax(160px, 0.8fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.nee-consult-filters .nee-field:first-child {
  grid-column: span 1;
}

.nee-consult-filters .nee-field:nth-child(6) {
  grid-column: span 2;
}

.nee-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.nee-date-range span {
  color: #64748b;
  font-weight: 800;
}

.nee-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nee-consult-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 14px;
  align-items: start;
}

.nee-list-card,
.nee-detail-panel {
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.nee-list-card {
  min-width: 0;
  overflow: hidden;
}

.nee-list-title {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8eef6;
}

.nee-list-title h2 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}

.nee-list-title select {
  min-height: 36px;
  border: 1px solid #cbd6e5;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  padding: 0 10px;
  font-weight: 750;
}

.nee-consult-table-wrap {
  border: 0;
  border-radius: 0;
}

.nee-consult-table {
  min-width: 1040px;
}

.nee-consult-table tr.selected td,
.nee-consult-table tbody tr:hover td {
  background: #f6f2ff;
}

.nee-consult-table td small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.nee-note-link {
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 950;
  cursor: pointer;
}

.nee-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 160px;
}

.nee-list-actions button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.nee-list-actions button.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.nee-detail-panel {
  position: sticky;
  top: 150px;
  padding: 18px;
}

.nee-detail-panel.empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #607089;
}

.nee-detail-panel.empty h2 {
  margin: 0 0 8px;
  color: #0f172a;
}

.nee-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8eef6;
}

.nee-detail-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #0f172a;
}

.nee-detail-head > button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
}

.nee-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 0;
}

.nee-detail-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #fbfdff;
}

.nee-detail-item span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.nee-detail-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: #172033;
  font-size: 13px;
}

.nee-detail-money {
  padding: 2px 0 12px;
  border-top: 1px solid #e8eef6;
  border-bottom: 1px solid #e8eef6;
}

.nee-detail-money .nee-summary-row {
  padding: 9px 0;
  font-size: 14px;
}

.nee-detail-money .nee-summary-row.strong strong {
  font-size: 19px;
}

.nee-detail-error {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
}

.nee-detail-error.muted {
  background: #f8fafc;
  color: #475569;
}

.nee-detail-error strong,
.nee-detail-error p {
  margin: 0;
}

.nee-detail-error p {
  margin-top: 6px;
  line-height: 1.45;
}

.nee-detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.nee-timeline {
  margin-top: 16px;
}

.nee-timeline h3,
.nee-items-detail summary {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.nee-timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  padding: 8px 0;
}

.nee-timeline-item > span {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
  font-weight: 900;
}

.nee-timeline-item strong,
.nee-timeline-item small {
  display: block;
}

.nee-timeline-item small {
  margin-top: 2px;
  color: #64748b;
}

.nee-items-detail {
  margin-top: 14px;
}

.nee-items-table {
  min-width: 760px;
  font-size: 12px;
}

.nee-last-date {
  margin: 22px 0;
  color: #53627a;
  font-size: 14px;
}

.nee-doc-btn {
  width: 100%;
  margin-top: 12px;
  background: #fff;
  color: #334155;
  border-color: #cbd6e5;
}

.nee-doc-btn.primary {
  color: #1556e8;
  border-color: #2563eb;
}

.nee-footer-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(190px, 1.2fr);
  gap: 16px;
  padding: 12px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.nee-footer-actions .nee-btn {
  width: 100%;
}

.nee-alert {
  margin-bottom: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 750;
}

.nee-alert.success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.nee-alert.warning {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.nee-alert.error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

@media (max-width: 1280px) {
  .nee-grid {
    grid-template-columns: 1fr;
  }

  .nee-consult-grid {
    grid-template-columns: 1fr;
  }

  .nee-detail-panel {
    position: static;
  }

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

  .nee-side {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nee-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .nota-entre-page {
    padding: 14px 12px 22px;
  }

  .nee-header {
    flex-direction: column;
  }

  .nee-side,
  .nee-company-selects,
  .nee-company-panels,
  .nee-form-grid,
  .nee-footer-actions,
  .nee-item-editor-grid,
  .nee-consult-filters,
  .nee-detail-grid {
    grid-template-columns: 1fr;
  }

  .nee-consult-filters .nee-field:nth-child(6) {
    grid-column: auto;
  }

  .nee-date-range {
    grid-template-columns: 1fr;
  }

  .nee-filter-actions {
    flex-direction: column;
  }

  .nee-filter-actions .nee-btn {
    width: 100%;
  }

  .nee-subtabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .nee-subtabs button {
    flex: 0 0 auto;
  }

  .nee-card {
    padding: 18px 14px;
  }

  .nee-table-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
