@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-2: #fafbfc;
  --text: #20242a;
  --muted: #7b8491;
  --primary: #b4232f;
  --primary-dark: #8f1822;
  --primary-soft: #fbeaec;
  --dark: #23272d;
  --border: #e8eaee;
  --green: #168456;
  --green-soft: #e9f7f1;
  --orange: #c9731f;
  --shadow: 0 8px 30px rgba(20, 26, 33, 0.06);
  --radius: 18px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 252px;
  background: linear-gradient(180deg, #252a31 0%, #1f2328 100%);
  color: #fff;
  padding: 24px 18px 18px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 20px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.brand-logo-wrap {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  flex: 0 0 auto;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  font-size: 11px;
  color: #9ea6b0;
  margin-top: 2px;
}
.sidebar-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.sidebar-nav-scroll::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
.nav-section {
  padding-bottom: 17px;
  margin-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.nav-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 8px;
}
.nav-label {
  font-size: 10px;
  font-weight: 800;
  color: #777f89;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 12px 10px;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c4cad1;
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}
.menu a svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}
.menu a:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}
.menu a.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #7f8790;
  font-size: 11px;
}
.content {
  margin-left: 252px;
  width: calc(100% - 252px);
  padding: 34px 38px 42px;
  max-width: 1600px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 7px;
}
.topbar h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}
.top-actions {
  display: flex;
  gap: 10px;
}
.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel {
  padding: 22px;
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}
.panel-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--primary);
}
.panel-icon svg {
  width: 18px;
}
.panel h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.015em;
}
.panel-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 13px;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field label {
  font-size: 11px;
  font-weight: 800;
  color: #5f6772;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}
input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 11px;
  font:
    500 13px "Inter",
    sans-serif;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: 0.18s;
}
input:hover,
select:hover {
  border-color: #cfd4db;
}
input:focus,
select:focus {
  border-color: #bd5a63;
  box-shadow: 0 0 0 3px rgba(180, 35, 47, 0.09);
}
.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 15px;
  font:
    700 12px "Inter",
    sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.18s;
  white-space: nowrap;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 16px rgba(180, 35, 47, 0.18);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.btn-dark {
  background: #2d3238;
  color: #fff;
}
.btn-dark:hover {
  background: #202429;
}
.btn-light {
  background: #f2f4f6;
  color: #3b4148;
  border: 1px solid #e6e8eb;
}
.btn-light:hover {
  background: #e9ecef;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.card {
  padding: 19px 20px;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  right: -14px;
  top: -18px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(180, 35, 47, 0.035);
}
.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.metric-icon.green {
  background: var(--green-soft);
  color: var(--green);
}
.metric-icon.gray {
  background: #f0f2f4;
  color: #626b75;
}
.metric-icon.orange {
  background: #fff2e6;
  color: var(--orange);
}
.metric-icon svg {
  width: 18px;
  height: 18px;
}
.card .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card .value {
  font-size: 25px;
  font-weight: 800;
  margin-top: 12px;
  letter-spacing: -0.035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .hint {
  font-size: 11px;
  color: #9aa1a9;
  margin-top: 6px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
}
.chart-box {
  height: 320px;
  position: relative;
}
.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.price-box {
  margin-top: 16px;
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px dashed #d9dde2;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.price-preview {
  font-weight: 800;
  font-size: 17px;
  color: var(--primary);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}
th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #eef0f2;
  text-align: left;
  font-size: 12.5px;
  white-space: nowrap;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #818994;
  background: #fafbfc;
  font-weight: 800;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: 0.15s;
}
tbody tr:hover {
  background: #fcfcfd;
}
.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-dot {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f3f5;
  color: #5b636c;
  font-size: 10px;
  font-weight: 800;
}
.money {
  font-weight: 800;
  color: #343a40;
}
.money.loss {
  color: var(--primary);
}
.actions {
  display: flex;
  gap: 7px;
}
.success,
.error {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 15px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.success {
  background: #eaf7f1;
  color: #176a49;
  border: 1px solid #d4eee1;
}
.error {
  background: #fff0f1;
  color: #94232c;
  border: 1px solid #f8dadd;
}
.empty-state {
  text-align: center;
  padding: 38px;
  color: var(--muted);
}
.empty-state svg {
  width: 28px;
  margin-bottom: 8px;
}
.section-count {
  font-size: 10px;
  font-weight: 800;
  color: #7d858e;
  background: #f2f4f6;
  border-radius: 999px;
  padding: 5px 8px;
}
@media (max-width: 1100px) {
  .sidebar {
    width: 82px;
    padding: 24px 13px;
  }
  .brand {
    padding: 4px 7px 22px;
  }
  .brand-text,
  .nav-label,
  .menu a span,
  .sidebar-footer {
    display: none;
  }
  .brand-logo-wrap {
    width: 42px;
    height: 42px;
  }
  .menu a {
    justify-content: center;
    padding: 12px;
  }
  .content {
    margin-left: 82px;
    width: calc(100% - 82px);
    padding: 28px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .filters {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 680px) {
  .content {
    padding: 20px 15px;
  }
  .topbar h1 {
    font-size: 24px;
  }
  .cards,
  .form-grid,
  .filters {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 16px;
  }
  .card {
    padding: 17px;
  }
  .top-actions {
    display: none;
  }
  .chart-box {
    height: 275px;
  }
  .actions {
    flex-wrap: wrap;
  }
}
.sidebar-bottom {
  flex: 0 0 auto;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.user-meta strong {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span {
  font-size: 9px;
  color: #969ea8;
  margin-top: 2px;
}
.icon-link {
  color: #aeb5bd;
  display: grid;
  place-items: center;
}
.icon-link svg {
  width: 15px;
}
.logout-form {
  margin-top: 7px;
}
.logout-form button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #aeb5bd;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: 600 12px Inter;
}
.logout-form button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.logout-form svg {
  width: 16px;
}
.inline-form {
  display: inline-flex;
  margin: 0;
}
.warning {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 15px;
  background: #fff8e6;
  color: #8b5a00;
  border: 1px solid #f1dfad;
  font-size: 12px;
  font-weight: 600;
}
.status-active,
.status-off {
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
}
.status-active {
  background: #e9f7f1;
  color: #168456;
}
.status-off {
  background: #f0f2f4;
  color: #7d858e;
}
.user-form {
  grid-template-columns: 1.4fr 1.4fr 0.8fr 1.2fr auto;
}
.narrow-panel {
  max-width: 640px;
}
.stack-form {
  display: grid;
  gap: 15px;
}
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 80% 10%,
      rgba(180, 35, 47, 0.12),
      transparent 28%
    ),
    linear-gradient(135deg, #171b20, #292e35);
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-shell {
  width: 100%;
  max-width: 440px;
}
.auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.auth-brand h1 {
  font-size: 17px;
  margin: 0;
}
.auth-brand p {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0 0;
}
.auth-copy {
  padding: 25px 0 18px;
}
.auth-copy h2 {
  margin: 5px 0 7px;
  font-size: 26px;
}
.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.btn-block {
  width: 100%;
  margin-top: 3px;
}
.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  color: #9299a2;
  font-size: 10px;
}
.auth-foot svg {
  width: 14px;
}
@media (max-width: 1100px) {
  .sidebar-bottom {
    padding-top: 12px;
  }
  .sidebar-user {
    padding: 8px;
    justify-content: center;
  }
  .user-meta,
  .icon-link,
  .logout-form span {
    display: none;
  }
  .logout-form button {
    justify-content: center;
  }
  .user-form {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 680px) {
  .user-form {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 24px;
  }
}
.value-sm {
  font-size: 20px !important;
}
/* Módulo financeiro */
.span-2 {
  grid-column: span 2;
}
.small {
  font-size: 12px;
  margin-top: 4px;
}
.field textarea {
  width: 100%;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  background: #fff;
}
.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pago {
  background: #dcfce7;
  color: #166534;
}
.status-em-aberto {
  background: #eff6ff;
  color: #1d4ed8;
}
.status-parcial {
  background: #fff7ed;
  color: #c2410c;
}
.status-atrasado {
  background: #fee2e2;
  color: #b91c1c;
}
@media (max-width: 850px) {
  .span-2 {
    grid-column: span 1;
  }
}
.btn-danger {
  background: #fff0f1;
  color: #a51f2b;
  border: 1px solid #f4cfd3;
}
.btn-danger:hover {
  background: #a51f2b;
  color: #fff;
  border-color: #a51f2b;
}
.actions .btn {
  padding: 9px 11px;
}
.icon-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.icon-setting {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.icon-setting .field {
  flex: 1;
}
.icon-preview {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--primary);
}
.icon-preview svg {
  width: 20px;
  height: 20px;
}
.purchase-calc {
  padding: 13px 15px;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.purchase-calc strong {
  color: var(--text);
  font-size: 15px;
}
.form-grid-purchase {
  grid-template-columns: 1.25fr 1.25fr 0.8fr 0.8fr 0.9fr 0.9fr;
}
@media (max-width: 1200px) {
  .form-grid-purchase {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .icon-settings-grid,
  .form-grid-purchase {
    grid-template-columns: 1fr;
  }
}

/* Compras: uma linha por compra e destaque das parcelas vinculadas */
.purchase-installments-link {
  display: inline-flex;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.purchase-highlight {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

/* Modais - Compras e Pagamentos */
body.modal-open {
  overflow: hidden;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 22, 28, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}
.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(15, 20, 26, 0.28);
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.18s ease;
}
.modal-backdrop.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}
.modal-dialog.modal-lg {
  width: min(1120px, 100%);
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #fbfcfd);
}
.modal-header h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}
.modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.modal-header .eyebrow {
  margin-bottom: 5px;
}
.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f7f8f9;
  color: #59616b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.16s;
  flex: 0 0 auto;
}
.modal-close:hover {
  background: #eef0f2;
  color: var(--text);
}
.modal-close svg {
  width: 18px;
  height: 18px;
}
.modal-body {
  padding: 22px 24px 25px;
  overflow: auto;
  max-height: calc(100vh - 145px);
}
.modal-body > .panel-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.modal-body .form-grid-purchase {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modal-body .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.modal-body .form-grid .btn {
  justify-self: start;
}
.modal-body .span-2 {
  grid-column: span 2;
}
@media (max-width: 820px) {
  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }
  .modal-dialog,
  .modal-dialog.modal-lg {
    width: 100%;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }
  .modal-header {
    padding: 18px;
  }
  .modal-body {
    padding: 18px;
    max-height: calc(94vh - 110px);
  }
  .modal-body .form-grid-purchase,
  .modal-body .form-grid {
    grid-template-columns: 1fr;
  }
  .modal-body .span-2 {
    grid-column: span 1;
  }
  .top-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

/* Pop-ups globais */
.toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 30px));
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 11px;
  padding: 14px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(25, 30, 36, 0.16);
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
  transition: 0.22s ease;
  color: #30353b;
}
.app-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.app-toast.leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
}
.app-toast.success {
  border-left: 4px solid var(--green);
}
.app-toast.error {
  border-left: 4px solid var(--primary);
}
.app-toast.warning {
  border-left: 4px solid var(--orange);
}
.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.app-toast.success .toast-icon {
  background: var(--green-soft);
  color: var(--green);
}
.app-toast.error .toast-icon {
  background: var(--primary-soft);
  color: var(--primary);
}
.app-toast.warning .toast-icon {
  background: #fff2e6;
  color: var(--orange);
}
.toast-icon svg,
.toast-close svg {
  width: 17px;
  height: 17px;
}
.toast-text {
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 650;
  padding-top: 4px;
  white-space: normal;
}
.toast-close {
  border: 0;
  background: transparent;
  color: #8b939c;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.toast-close:hover {
  background: #f0f2f4;
  color: #3d434a;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(18, 22, 27, 0.48);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.app-modal-backdrop[hidden] {
  display: none;
}
.app-modal {
  position: relative;
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 19px;
  box-shadow: 0 28px 80px rgba(15, 20, 25, 0.25);
  padding: 25px;
}
.app-modal-confirm {
  text-align: center;
}
.app-modal-x {
  position: absolute;
  top: 13px;
  right: 13px;
  border: 0;
  background: #f2f4f6;
  color: #69717a;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.app-modal-x svg {
  width: 16px;
}
.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 3px auto 14px;
}
.confirm-icon svg {
  width: 23px;
  height: 23px;
}
.app-modal h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.app-modal p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 auto;
  max-width: 360px;
}
.app-modal-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
}
.btn-danger {
  background: var(--primary);
  color: #fff;
}
.btn-danger:hover {
  background: var(--primary-dark);
}
body.modal-open {
  overflow: hidden;
}
@media (max-width: 680px) {
  .toast-stack {
    top: 14px;
    right: 15px;
  }
  .app-modal {
    padding: 22px 17px;
  }
  .app-modal-actions {
    flex-direction: column-reverse;
  }
  .app-modal-actions .btn {
    width: 100%;
  }
}

/* Dashboard de perdas - ajustes estáveis */
.dashboard-summary-cards {
  grid-template-columns: 1.15fr 1fr 1fr;
}
.dashboard-volume-cards {
  grid-template-columns: repeat(3, 1fr);
  margin-top: -4px;
}
.dashboard-card-accent {
  border-left: 3px solid var(--primary);
}
.dashboard-volume-card .value small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.dashboard-litro-icon {
  background: #eaf4fb;
  color: #317aa7;
}
.dashboard-volume-card {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.dashboard-volume-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(25, 30, 36, 0.06);
}
.dashboard-summary-cards .card,
.dashboard-volume-cards .card {
  min-width: 0;
}
.dashboard-summary-cards .value-sm {
  font-size: 18px;
  white-space: normal;
  line-height: 1.25;
}
.filters {
  grid-template-columns: 1.35fr 0.65fr 1fr 1fr auto;
}
@media (max-width: 1100px) {
  .dashboard-summary-cards,
  .dashboard-volume-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  .dashboard-summary-cards,
  .dashboard-volume-cards {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: 1fr;
  }
}

/* Dashboard - gráfico mensal por produto */
.dashboard-product-chart-wrap {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.dashboard-chart-empty {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.dashboard-chart-empty[hidden] {
  display: none;
}
.dashboard-chart-empty > svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: #a1a8b0;
}
.dashboard-chart-empty strong {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 5px;
}
.dashboard-chart-empty span {
  font-size: 11.5px;
  max-width: 310px;
  line-height: 1.5;
}
.dashboard-product-chart-wrap canvas[hidden] {
  display: none !important;
}

/* Dashboard - gráficos em largura total, um abaixo do outro */
.grid-2 {
  grid-template-columns: 1fr;
  gap: 18px;
}
.grid-2 .panel {
  width: 100%;
}
.grid-2 .chart-box {
  height: 360px;
}
@media (max-width: 760px) {
  .grid-2 .chart-box {
    height: 300px;
  }
}

/* Paginação */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef0f2;
}
.pagination-info {
  font-size: 11.5px;
  color: var(--muted);
}
.pagination-info strong {
  color: var(--text);
}
.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #606975;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 750;
  transition: 0.15s;
}
a.page-btn:hover {
  border-color: #cfd4da;
  background: #f7f8f9;
  color: var(--text);
}
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 5px 13px rgba(180, 35, 47, 0.16);
}
.page-arrow {
  font-size: 20px;
  line-height: 1;
}
.page-ellipsis {
  padding: 0 3px;
  color: #a0a7af;
}
@media (max-width: 680px) {
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
  .pagination-buttons {
    width: 100%;
  }
}

/* Reforma Financeira 2026 */
.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.finance-purchase-form {
  display: grid;
  gap: 18px;
}
.finance-form-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 17px;
  background: #fbfcfc;
}
.finance-form-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 0 0 14px;
}
.finance-form-section h3 svg {
  width: 17px;
  color: var(--primary);
}
.modal-xl {
  max-width: 1000px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.finance-installment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.finance-installment-preview > strong {
  width: 100%;
  font-size: 11px;
}
.finance-installment-preview span {
  font-size: 10.5px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 7px 9px;
  border-radius: 9px;
}
.finance-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.finance-kpi-strip > div,
.finance-kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 15px;
}
.finance-kpi-strip span,
.finance-kpi span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}
.finance-kpi-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}
.finance-filter-panel {
  padding: 15px;
}
.finance-filters {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr auto auto;
  gap: 10px;
  align-items: end;
}
.due-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5f0;
  color: #34704c;
  font-size: 10px;
  font-weight: 800;
}
.due-pill.late {
  background: #fdebec;
  color: #b4232f;
}
.due-pill.soon {
  background: #fff4df;
  color: #9a6810;
}
.due-pill.paid {
  background: #f1f2f4;
  color: #7a828b;
}
.btn-sm {
  padding: 7px 9px;
  font-size: 10.5px;
}
.finance-dashboard-filters {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 16px;
  margin-bottom: 15px;
}
.filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}
.filter-title > svg {
  width: 18px;
  color: var(--primary);
}
.filter-title strong,
.filter-title span {
  display: block;
}
.filter-title strong {
  font-size: 12px;
}
.filter-title span {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.finance-filter-fields {
  display: grid;
  grid-template-columns: 0.65fr 1.2fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.finance-dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}
.finance-kpi strong {
  display: block;
  font-size: 22px;
  margin: 7px 0 3px;
  letter-spacing: -0.03em;
}
.finance-kpi small {
  font-size: 10px;
  color: var(--muted);
}
.finance-kpi.danger {
  border-left: 3px solid var(--primary);
}
.finance-chart-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}
.finance-chart-box {
  height: 340px;
  padding-top: 10px;
}
@media (max-width: 1000px) {
  .finance-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .finance-dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .finance-filters,
  .finance-filter-fields {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .finance-form-grid,
  .finance-dashboard-kpis,
  .finance-kpi-strip,
  .finance-filters,
  .finance-filter-fields {
    grid-template-columns: 1fr;
  }
}

.finance-chart-empty {
  height: 100%;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 30px;
}
.finance-chart-empty[hidden] {
  display: none;
}

/* Perdas - cadastro/edição em modal */
.loss-modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.loss-modal-form .price-box {
  grid-column: 1/-1;
  margin: 0;
}
.loss-modal-footer {
  grid-column: 1/-1;
  margin-top: 4px;
}
.loss-price-box {
  width: 100%;
  justify-content: flex-start;
}
.actions .btn-danger {
  padding: 8px 10px;
}
@media (max-width: 680px) {
  .loss-modal-form {
    grid-template-columns: 1fr;
  }
  .loss-modal-form .price-box,
  .loss-modal-footer {
    grid-column: 1;
  }
}

/* Dashboards analíticos */
.analytics-dashboard {
  padding-bottom: 40px;
}
.compact-filter {
  padding: 16px 18px;
}
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.analytics-kpis.mini {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0;
}
.analytics-kpis.mini .wide {
  grid-column: span 2;
}
.analytics-kpi {
  background: #fff;
  border: 1px solid #e8ebee;
  border-radius: 14px;
  padding: 16px;
  min-width: 0;
  box-shadow: 0 3px 14px rgba(24, 31, 38, 0.035);
}
.analytics-kpi span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #69727d;
  margin-bottom: 8px;
}
.analytics-kpi strong {
  display: block;
  font-size: 21px;
  line-height: 1.15;
  color: #20262d;
  overflow-wrap: anywhere;
}
.analytics-kpi strong.small-value {
  font-size: 14px;
  line-height: 1.35;
}
.analytics-kpi small {
  display: block;
  margin-top: 7px;
  color: #8a939e;
  font-size: 11px;
}
.analytics-kpi.danger strong {
  color: #b4232f;
}
.analytics-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.analytics-chart {
  height: 330px;
  position: relative;
}
.analytics-chart.tall {
  height: 370px;
}
.analytics-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a939e;
  font-size: 13px;
}
.analytics-empty[hidden] {
  display: none;
}
@media (max-width: 1250px) {
  .analytics-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
  .analytics-kpis.mini {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 850px) {
  .analytics-grid-2 {
    grid-template-columns: 1fr;
  }
  .analytics-kpis,
  .analytics-kpis.mini {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-kpis.mini .wide {
    grid-column: span 2;
  }
}
@media (max-width: 560px) {
  .analytics-kpis,
  .analytics-kpis.mini {
    grid-template-columns: 1fr;
  }
  .analytics-kpis.mini .wide {
    grid-column: auto;
  }
  .analytics-chart {
    height: 300px;
  }
}

/* ===== Dashboard moderno 2026 ===== */
.analytics-dashboard {
  --dash-bg: #f5f7fa;
  --dash-card: #ffffff;
  --dash-border: #e8ecf1;
  --dash-text: #1f2933;
  --dash-muted: #75808d;
  background:
    radial-gradient(
      circle at 92% 2%,
      rgba(180, 35, 47, 0.07),
      transparent 24rem
    ),
    linear-gradient(180deg, #f8fafc 0%, #f4f6f9 100%);
  min-height: 100vh;
}
.analytics-dashboard .topbar {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #20252b 0%, #343b43 60%, #b4232f 165%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: 0 18px 45px rgba(25, 31, 38, 0.13);
}
.analytics-dashboard .topbar:after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -70px;
  top: -115px;
  border: 34px solid rgba(255, 255, 255, 0.045);
}
.analytics-dashboard .topbar h1 {
  color: #fff;
  font-size: 28px;
  margin: 2px 0 5px;
  letter-spacing: -0.6px;
}
.analytics-dashboard .topbar .muted {
  color: rgba(255, 255, 255, 0.68);
}
.analytics-dashboard .topbar .eyebrow {
  color: #ffb1b7;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.analytics-dashboard .topbar .btn-primary {
  position: relative;
  z-index: 2;
  box-shadow: 0 9px 25px rgba(180, 35, 47, 0.28);
}
.analytics-dashboard .compact-filter {
  border: 1px solid rgba(216, 222, 229, 0.9);
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(35, 43, 52, 0.055);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}
.analytics-dashboard .filters {
  align-items: end;
}
.analytics-dashboard .filters .field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #737d89;
}
.analytics-dashboard .filters input,
.analytics-dashboard .filters select {
  border-radius: 11px;
  border-color: #dfe4ea;
  background: #fbfcfd;
  transition: 0.18s ease;
}
.analytics-dashboard .filters input:focus,
.analytics-dashboard .filters select:focus {
  border-color: #b4232f;
  box-shadow: 0 0 0 3px rgba(180, 35, 47, 0.09);
  background: #fff;
}
.analytics-kpis {
  gap: 14px;
}
.analytics-kpi {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--dash-border);
  border-radius: 18px;
  padding: 17px 17px 16px;
  box-shadow: 0 8px 24px rgba(29, 38, 47, 0.055);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.analytics-kpi:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: var(--kpi-accent, #7a8490);
}
.analytics-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(29, 38, 47, 0.09);
  border-color: #dce2e8;
}
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.analytics-kpi .kpi-head span {
  margin: 0;
}
.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--kpi-accent, #697481);
  background: var(--kpi-soft, #f1f3f5);
  flex: 0 0 auto;
}
.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}
.kpi-red {
  --kpi-accent: #b4232f;
  --kpi-soft: #fff0f1;
}
.kpi-amber {
  --kpi-accent: #c47a14;
  --kpi-soft: #fff7e8;
}
.kpi-orange {
  --kpi-accent: #d05d1f;
  --kpi-soft: #fff2eb;
}
.kpi-blue {
  --kpi-accent: #3776b7;
  --kpi-soft: #eef6ff;
}
.kpi-cyan {
  --kpi-accent: #2b8d9c;
  --kpi-soft: #edfafa;
}
.kpi-purple {
  --kpi-accent: #7653a6;
  --kpi-soft: #f5f0fb;
}
.kpi-slate {
  --kpi-accent: #586574;
  --kpi-soft: #f0f3f6;
}
.analytics-kpi strong {
  font-size: 22px;
  letter-spacing: -0.35px;
}
.analytics-kpi small {
  color: #87919c;
}
.analytics-dashboard .panel {
  border: 1px solid var(--dash-border);
  border-radius: 19px;
  box-shadow: 0 9px 27px rgba(29, 38, 47, 0.055);
  background: #fff;
}
.analytics-dashboard .panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 14px;
}
.analytics-title {
  display: flex;
  align-items: center;
  gap: 11px;
}
.analytics-title h3 {
  margin: 0;
}
.chart-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #b4232f;
  background: linear-gradient(145deg, #fff1f2, #fce7e9);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 47, 0.08);
}
.chart-icon svg {
  width: 19px;
  height: 19px;
}
.analytics-chart {
  padding: 3px 4px 1px;
}
.analytics-dashboard .table-wrap {
  border: 1px solid #eef1f4;
  border-radius: 13px;
  overflow: hidden;
}
.analytics-dashboard table thead th {
  background: #f7f9fb;
  color: #687381;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}
.analytics-dashboard table tbody tr {
  transition: background 0.15s ease;
}
.analytics-dashboard table tbody tr:hover {
  background: #fafbfc;
}
.analytics-dashboard .btn-light {
  border-radius: 10px;
}
@media (max-width: 700px) {
  .analytics-dashboard .topbar {
    padding: 22px 18px;
    border-radius: 18px;
  }
  .analytics-dashboard .topbar h1 {
    font-size: 24px;
  }
}

/* Correção estável dos dashboards: cards e linhas de gráficos */
.analytics-grid-single {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.analytics-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.analytics-kpis.mini {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.analytics-kpis.mini .wide {
  grid-column: auto !important;
}
.analytics-kpi {
  min-width: 0;
  min-height: 118px;
}
.analytics-kpi strong {
  display: block;
  max-width: 100%;
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.18;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
}
.analytics-kpi strong.small-value {
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.analytics-kpi .kpi-head {
  min-width: 0;
}
.analytics-kpi .kpi-head span {
  min-width: 0;
  line-height: 1.25;
}
@media (max-width: 1180px) {
  .analytics-kpis,
  .analytics-kpis.mini {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 650px) {
  .analytics-kpis,
  .analytics-kpis.mini {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Dashboard de perdas - resumo executivo em 6 cards */
.dashboard-main-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  margin: 18px 0 !important;
}
.dashboard-main-kpis .analytics-kpi {
  min-height: 128px;
  padding: 18px 19px;
}
.dashboard-main-kpis .analytics-kpi strong {
  font-size: clamp(20px, 1.65vw, 25px);
}
.dashboard-main-kpis .analytics-kpi strong.small-value {
  font-size: clamp(14px, 1.08vw, 17px);
  line-height: 1.35;
}
@media (max-width: 1100px) {
  .dashboard-main-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 620px) {
  .dashboard-main-kpis {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Variação mensal: para perdas, queda é positiva e alta é negativa */
#kVar.variation-down {
  color: #15803d !important;
  font-weight: 700;
}
#kVar.variation-up {
  color: #dc2626 !important;
  font-weight: 700;
}
#kVar.variation-neutral {
  color: #64748b !important;
  font-weight: 600;
}

/* Histórico de perdas: tabela ajustada à largura da tela */
.perdas-history-panel {
  min-width: 0;
  overflow: hidden;
}
.perdas-history-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.perdas-history-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}
.perdas-history-table th,
.perdas-history-table td {
  padding: 11px 8px;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}
.perdas-history-table th:nth-child(1),
.perdas-history-table td:nth-child(1) {
  width: 10%;
}
.perdas-history-table th:nth-child(2),
.perdas-history-table td:nth-child(2) {
  width: 20%;
}
.perdas-history-table th:nth-child(3),
.perdas-history-table td:nth-child(3) {
  width: 14%;
}
.perdas-history-table th:nth-child(4),
.perdas-history-table td:nth-child(4) {
  width: 14%;
}
.perdas-history-table th:nth-child(5),
.perdas-history-table td:nth-child(5) {
  width: 14%;
}
.perdas-history-table th:nth-child(6),
.perdas-history-table td:nth-child(6) {
  width: 14%;
}
.perdas-history-table th:nth-child(7),
.perdas-history-table td:nth-child(7) {
  width: 14%;
}
.perdas-history-table .money {
  white-space: nowrap;
}
.perdas-history-table td.actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.perdas-history-table td.actions .inline-form {
  margin: 0;
}
.perdas-history-table .history-action-btn {
  padding: 8px 9px;
  min-width: 0;
  gap: 5px;
  font-size: 12px;
}
.perdas-history-table .history-action-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}
@media (max-width: 1150px) {
  .perdas-history-table th,
  .perdas-history-table td {
    padding: 9px 6px;
    font-size: 12px;
  }
  .perdas-history-table .history-action-btn {
    padding: 7px;
  }
  .perdas-history-table .history-action-btn span {
    display: none;
  }
  .perdas-history-table th:nth-child(7),
  .perdas-history-table td:nth-child(7) {
    width: 9%;
  }
  .perdas-history-table th:nth-child(2),
  .perdas-history-table td:nth-child(2) {
    width: 23%;
  }
}

/* Histórico de perdas: alinhamento seguro por coluna */
.perdas-history-table thead th:nth-child(1),
.perdas-history-table tbody td:nth-child(1),
.perdas-history-table thead th:nth-child(3),
.perdas-history-table tbody td:nth-child(3),
.perdas-history-table thead th:nth-child(4),
.perdas-history-table tbody td:nth-child(4),
.perdas-history-table thead th:nth-child(5),
.perdas-history-table tbody td:nth-child(5),
.perdas-history-table thead th:nth-child(6),
.perdas-history-table tbody td:nth-child(6),
.perdas-history-table thead th:nth-child(7) {
  text-align: center !important;
}
.perdas-history-table thead th:nth-child(2),
.perdas-history-table tbody td:nth-child(2) {
  text-align: left !important;
}
.perdas-history-table tbody td:nth-child(7) {
  text-align: center !important;
}

/* Correção visual definitiva da coluna Ações no histórico de perdas */
.perdas-history-table th:nth-child(7),
.perdas-history-table td:nth-child(7) {
  width: 16% !important;
}
.perdas-history-table th:nth-child(2),
.perdas-history-table td:nth-child(2) {
  width: 19% !important;
}
.perdas-history-table th:nth-child(3),
.perdas-history-table td:nth-child(3) {
  width: 13% !important;
}
.perdas-history-table th:nth-child(4),
.perdas-history-table td:nth-child(4),
.perdas-history-table th:nth-child(5),
.perdas-history-table td:nth-child(5),
.perdas-history-table th:nth-child(6),
.perdas-history-table td:nth-child(6) {
  width: 14% !important;
}
.perdas-history-table td.actions {
  display: table-cell !important;
  text-align: center !important;
  white-space: nowrap !important;
}
.perdas-history-table td.actions > .history-action-btn,
.perdas-history-table td.actions > .inline-form {
  display: inline-block !important;
  vertical-align: middle;
}
.perdas-history-table td.actions > .inline-form {
  margin-left: 5px !important;
}
.perdas-history-table .history-action-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0 !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
}
.perdas-history-table .history-action-btn span {
  display: inline !important;
}
@media (max-width: 1150px) {
  .perdas-history-table .history-action-btn span {
    display: none !important;
  }
  .perdas-history-table .history-action-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
  }
  .perdas-history-table th:nth-child(7),
  .perdas-history-table td:nth-child(7) {
    width: 10% !important;
  }
  .perdas-history-table th:nth-child(2),
  .perdas-history-table td:nth-child(2) {
    width: 24% !important;
  }
}

/* Histórico de perdas: redistribuição final para impedir corte em Ações */
.perdas-history-table {
  width: 100% !important;
  table-layout: fixed !important;
}
.perdas-history-table th,
.perdas-history-table td {
  box-sizing: border-box !important;
}

.perdas-history-table th:nth-child(1),
.perdas-history-table td:nth-child(1) {
  width: 9% !important;
}

.perdas-history-table th:nth-child(2),
.perdas-history-table td:nth-child(2) {
  width: 19% !important;
}

.perdas-history-table th:nth-child(3),
.perdas-history-table td:nth-child(3) {
  width: 13% !important;
}

.perdas-history-table th:nth-child(4),
.perdas-history-table td:nth-child(4) {
  width: 13% !important;
}

.perdas-history-table th:nth-child(5),
.perdas-history-table td:nth-child(5) {
  width: 13% !important;
}

.perdas-history-table th:nth-child(6),
.perdas-history-table td:nth-child(6) {
  width: 13% !important;
}

.perdas-history-table th:nth-child(7),
.perdas-history-table td:nth-child(7) {
  width: 20% !important;
}

.perdas-history-table td.actions {
  display: table-cell !important;
  text-align: center !important;
  white-space: nowrap !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.perdas-history-table td.actions > .history-action-btn,
.perdas-history-table td.actions > .inline-form {
  display: inline-block !important;
  vertical-align: middle !important;
}

.perdas-history-table td.actions > .inline-form {
  margin: 0 0 0 4px !important;
}

.perdas-history-table .history-action-btn {
  width: auto !important;
  min-width: 0 !important;
  padding: 7px 9px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

.perdas-history-table .history-action-btn svg {
  width: 15px !important;
  height: 15px !important;
  flex: 0 0 15px !important;
}

@media (max-width: 1200px) {
  .perdas-history-table .history-action-btn span {
    display: none !important;
  }
  .perdas-history-table .history-action-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
  }
  .perdas-history-table th:nth-child(2),
  .perdas-history-table td:nth-child(2) {
    width: 23% !important;
  }
  .perdas-history-table th:nth-child(7),
  .perdas-history-table td:nth-child(7) {
    width: 12% !important;
  }
  .perdas-history-table th:nth-child(1),
  .perdas-history-table td:nth-child(1) {
    width: 10% !important;
  }
  .perdas-history-table th:nth-child(3),
  .perdas-history-table td:nth-child(3) {
    width: 13% !important;
  }
  .perdas-history-table th:nth-child(4),
  .perdas-history-table td:nth-child(4) {
    width: 14% !important;
  }
  .perdas-history-table th:nth-child(5),
  .perdas-history-table td:nth-child(5) {
    width: 14% !important;
  }
  .perdas-history-table th:nth-child(6),
  .perdas-history-table td:nth-child(6) {
    width: 14% !important;
  }
}

/* Histórico de perdas: ações somente com ícones */
.perdas-history-table th:nth-child(7),
.perdas-history-table td:nth-child(7) {
  width: 10% !important;
}
.perdas-history-table th:nth-child(2),
.perdas-history-table td:nth-child(2) {
  width: 24% !important;
}
.perdas-history-table .history-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 11px !important;
}
.perdas-history-table .history-action-btn svg {
  width: 17px !important;
  height: 17px !important;
}

/* Histórico de perdas: mantém a data em uma única linha */
.perdas-history-table th:nth-child(1),
.perdas-history-table td:nth-child(1) {
  width: 11% !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
.perdas-history-table th:nth-child(2),
.perdas-history-table td:nth-child(2) {
  width: 23% !important;
}

/* Filtros do histórico de perdas */
.history-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(145px, 0.8fr) minmax(
      145px,
      0.8fr
    ) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 4px 0 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
}
.history-filters .field {
  margin: 0;
  min-width: 0;
}
.history-filters .field label {
  margin-bottom: 6px;
}
.history-filters select,
.history-filters input {
  width: 100%;
}
.history-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 1px;
}
.history-filter-actions .btn {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-filter-actions {
    grid-column: 1/-1;
  }
}
@media (max-width: 650px) {
  .history-filters {
    grid-template-columns: 1fr;
  }
  .history-filter-actions {
    grid-column: auto;
  }
}

/* Histórico: botões Filtrar/Limpar somente com ícones */
.history-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}
.history-filter-icon-btn {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 13px !important;
}
.history-filter-icon-btn svg {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
}

/* Produtos: alinhamento da tabela e cadastro em modal */
.produtos-table {
  width: 100%;
}
.produtos-table th,
.produtos-table td {
  vertical-align: middle;
}
.produtos-table th:not(:first-child),
.produtos-table td:not(:first-child) {
  text-align: center !important;
}
.produtos-table th:first-child,
.produtos-table td:first-child {
  text-align: left !important;
}
.produtos-table td.produtos-actions {
  text-align: center !important;
}
.produtos-actions .inline-form {
  display: inline-block;
  margin: 0 0 0 6px;
  vertical-align: middle;
}
.produtos-actions > .btn {
  vertical-align: middle;
}
.product-modal-dialog {
  max-width: 680px;
}
.product-modal-form {
  grid-template-columns: 1.5fr 0.75fr 0.9fr;
  align-items: end;
}
.product-modal-form .product-name-field {
  min-width: 0;
}
.product-modal-form .modal-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 760px) {
  .product-modal-form {
    grid-template-columns: 1fr;
  }
  .product-modal-form .modal-actions {
    grid-column: auto;
  }
}

/* Produtos: filtros e ações compactas em ícones */
.produtos-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(150px, 0.7fr) auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 18px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}
.produtos-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}
.produtos-filter-icon-btn,
.product-action-icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.produtos-filter-icon-btn svg,
.product-action-icon-btn svg {
  width: 18px;
  height: 18px;
  margin: 0 !important;
}
.produtos-actions {
  white-space: nowrap;
}
.produtos-actions .inline-form {
  margin-left: 6px;
}
@media (max-width: 850px) {
  .produtos-filters {
    grid-template-columns: 1fr 1fr;
  }
  .produtos-filter-actions {
    grid-column: 1/-1;
  }
}
@media (max-width: 620px) {
  .produtos-filters {
    grid-template-columns: 1fr;
  }
  .produtos-filter-actions {
    grid-column: auto;
  }
}

/* Produtos: filtros sempre organizados em uma única linha no desktop */
.produtos-filters {
  grid-template-columns: minmax(260px, 1.7fr) minmax(150px, 0.65fr) auto !important;
  align-items: end !important;
}
.produtos-filter-actions {
  grid-column: auto !important;
  display: flex !important;
  flex-wrap: nowrap;
  align-items: end;
  white-space: nowrap;
}

/* Mantém uma linha enquanto houver espaço; empilha apenas em telas pequenas */
@media (min-width: 701px) {
  .produtos-filters {
    grid-template-columns: minmax(260px, 1.7fr) minmax(150px, 0.65fr) auto !important;
  }
  .produtos-filter-actions {
    grid-column: auto !important;
  }
}
@media (max-width: 700px) {
  .produtos-filters {
    grid-template-columns: 1fr !important;
  }
  .produtos-filter-actions {
    grid-column: auto !important;
  }
}

/* Dashboard de Perdas: filtros em uma única linha */
.analytics-dashboard .compact-filter .filters {
  display: grid !important;
  grid-template-columns: minmax(210px, 1.35fr) minmax(105px, 0.65fr) minmax(
      160px,
      1fr
    ) minmax(170px, 1fr) minmax(170px, 1fr) 48px !important;
  gap: 14px !important;
  align-items: end !important;
}
.analytics-dashboard .compact-filter .filters > .field {
  min-width: 0;
  margin: 0 !important;
}
.analytics-dashboard .dashboard-clear-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  align-self: end;
}
.analytics-dashboard .dashboard-clear-icon svg {
  width: 20px;
  height: 20px;
  margin: 0 !important;
}
@media (max-width: 1100px) {
  .analytics-dashboard .compact-filter .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  .analytics-dashboard .compact-filter .filters {
    grid-template-columns: 1fr !important;
  }
}

/* Correção: filtros do Dashboard sem ultrapassar o painel */
.analytics-dashboard .compact-filter {
  overflow: hidden;
}
.analytics-dashboard .compact-filter .filters {
  width: 100%;
  box-sizing: border-box;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(0, 0.68fr)
    minmax(0, 1fr)
    minmax(0, 1.05fr)
    minmax(0, 1.05fr)
    44px !important;
  gap: 12px !important;
}
.analytics-dashboard .compact-filter .filters > * {
  min-width: 0;
  box-sizing: border-box;
}
.analytics-dashboard .compact-filter .field input,
.analytics-dashboard .compact-filter .field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.analytics-dashboard .dashboard-clear-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  align-self: end;
}

@media (max-width: 1180px) {
  .analytics-dashboard .compact-filter .filters {
    grid-template-columns:
      minmax(0, 1.3fr)
      minmax(0, 0.65fr)
      minmax(0, 0.9fr)
      minmax(0, 1fr)
      minmax(0, 1fr)
      42px !important;
    gap: 10px !important;
  }
  .analytics-dashboard .dashboard-clear-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
  }
}

/* Dashboard Financeiro simplificado */
.finance-dashboard-clean .finance-main-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.finance-dashboard-clean .finance-filters-clean {
  display: grid !important;
  grid-template-columns: minmax(110px, 0.55fr) minmax(180px, 1.15fr) minmax(
      170px,
      1fr
    ) minmax(180px, 1.15fr) 44px !important;
  gap: 12px !important;
  align-items: end !important;
}
.finance-dashboard-clean .finance-filters-clean > * {
  min-width: 0;
}
.finance-dashboard-clean .finance-filters-clean select {
  width: 100%;
  min-width: 0;
}
.finance-dashboard-clean .finance-clear-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.finance-dashboard-clean .finance-clear-icon svg {
  width: 19px;
  height: 19px;
  margin: 0 !important;
}
.finance-dashboard-clean
  .finance-next-table
  th:not(:nth-child(2)):not(:nth-child(3)),
.finance-dashboard-clean
  .finance-next-table
  td:not(:nth-child(2)):not(:nth-child(3)) {
  text-align: center;
}
@media (max-width: 1100px) {
  .finance-dashboard-clean .finance-main-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finance-dashboard-clean .finance-filters-clean {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 650px) {
  .finance-dashboard-clean .finance-main-kpis,
  .finance-dashboard-clean .finance-filters-clean {
    grid-template-columns: 1fr !important;
  }
}

/* Produtos da área financeira: cadastro e edição em modal */
.financial-product-modal {
  max-width: 760px;
}
.financial-product-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.financial-product-form .modal-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 700px) {
  .financial-product-form {
    grid-template-columns: 1fr;
  }
  .financial-product-form .span-2,
  .financial-product-form .modal-actions {
    grid-column: auto;
  }
}

/* Fornecedores: cadastro e edição em modal */
.supplier-modal-dialog {
  max-width: 720px;
}
.supplier-modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.supplier-modal-form .modal-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 680px) {
  .supplier-modal-form {
    grid-template-columns: 1fr;
  }
  .supplier-modal-form .span-2,
  .supplier-modal-form .modal-actions {
    grid-column: auto;
  }
}

/* Importação: resumo em balões e detalhes de erros expansíveis */
.import-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.import-summary-card {
  min-width: 0;
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
button.import-summary-card {
  width: 100%;
  font: inherit;
  color: inherit;
}
.import-summary-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #64748b;
}
.import-summary-icon svg {
  width: 24px;
  height: 24px;
}
.import-summary-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.import-summary-content span {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}
.import-summary-content strong {
  font-size: 30px;
  line-height: 1;
  color: #0f172a;
}
.import-summary-success .import-summary-icon {
  background: #ecfdf5;
  color: #15803d;
}
.import-summary-error {
  position: relative;
  cursor: default;
}
.import-summary-error.has-errors {
  cursor: pointer;
  border-color: #fecaca;
}
.import-summary-error.has-errors .import-summary-icon {
  background: #fef2f2;
  color: #dc2626;
}
.import-summary-error.has-errors .import-summary-content strong {
  color: #dc2626;
}
.import-summary-error.has-errors:hover {
  border-color: #fca5a5;
  background: #fffafa;
}
.import-summary-error:disabled {
  opacity: 1;
}
.import-summary-action {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: transform 0.2s ease;
}
.import-summary-error.is-open .import-summary-action {
  transform: rotate(180deg);
}
.import-errors-section {
  scroll-margin-top: 18px;
  margin-bottom: 18px;
}
.import-errors-section[hidden] {
  display: none !important;
}
.import-errors-panel {
  border-color: #fecaca;
}
.import-error-group + .import-error-group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}
.import-error-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px 12px;
  color: #334155;
}
.import-error-group-title svg {
  width: 19px;
  height: 19px;
  color: #dc2626;
}
.import-error-group-title span {
  margin-left: auto;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
@media (max-width: 850px) {
  .import-summary-cards {
    grid-template-columns: 1fr;
  }
  .import-summary-card {
    min-height: 92px;
  }
}
/* Raio-X financeiro 2026 */
.raio-kpis .analytics-kpi{min-width:0}.raio-kpis .analytics-kpi strong{font-size:clamp(20px,2vw,30px)}.negative{color:#dc2626!important}.finance-form-grid .span-2{grid-column:span 2}@media(max-width:850px){.finance-form-grid .span-2{grid-column:span 1}}
/* Financeiro: blocos realmente dinâmicos por tipo de lançamento */
.type-fields{display:none!important;grid-column:1/-1}.type-fields.is-active{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.payment-term[hidden]{display:none!important}@media(max-width:900px){.type-fields.is-active{grid-template-columns:1fr}}

/* Lançamentos financeiros: compatível com a CSP do sistema */
.tipo-lancamento[hidden], .campos-comuns-lanc[hidden], #msgTipoLanc[hidden], #boxParcelas[hidden], #boxVencimento[hidden] { display:none !important; }
.tipo-lancamento, .campos-comuns-lanc, .lanc-msg { margin-top:16px; }
.fav-dynamic[hidden]{display:none!important}

/* Favorecidos - formulário dinâmico reorganizado */
.supplier-modal-dialog{max-width:780px}
.supplier-modal-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.fav-form-intro{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid var(--border);background:var(--surface-2);border-radius:14px}
.fav-form-intro .fav-step-badge{width:32px;height:32px;flex:0 0 32px;border-radius:10px;display:grid;place-items:center;background:var(--primary);color:#fff;font-weight:800}
.fav-form-intro strong{display:block;font-size:14px;color:var(--text)}
.fav-form-intro span{display:block;margin-top:2px;font-size:12px;color:var(--muted)}
.fav-type-field{margin-top:2px}
.fav-type-field select{min-height:46px;font-weight:700}
.fav-type-hint{display:none;min-height:92px;border:1px dashed var(--border);border-radius:14px;background:var(--surface-2);align-items:center;justify-content:center;gap:10px;color:var(--muted);font-size:13px;text-align:center;padding:18px}
.fav-type-hint.is-visible{display:flex}
.fav-type-hint svg{width:19px;height:19px}
.fav-dynamic-area{display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-top:2px}
.fav-dynamic-area.has-type{display:grid}
.fav-dynamic{display:none!important}
.fav-dynamic.is-visible{display:flex!important;flex-direction:column}
.fav-dynamic-area .fav-email-field{grid-column:1/-1}
.supplier-modal-form .modal-actions{padding-top:4px;border-top:1px solid var(--border);margin-top:2px}
@media(max-width:680px){.supplier-modal-form,.fav-dynamic-area{grid-template-columns:1fr}.fav-dynamic-area .fav-email-field{grid-column:auto}.fav-form-intro{align-items:flex-start}}

/* Novo Lançamento - organização visual */
#modalLanc .modal-dialog{width:min(1040px,calc(100vw - 32px));}
#modalLanc .modal-body{padding:20px 24px 0;overflow-y:auto;max-height:calc(100vh - 170px);background:#f7f8fa;}
#modalLanc .finance-purchase-form{gap:14px;}
#modalLanc .lanc-section{margin-top:0;border:1px solid #e2e6ea;border-radius:16px;background:#fff;padding:18px;box-shadow:0 1px 2px rgba(15,23,42,.025);}
#modalLanc .lanc-section-main{border-top:3px solid var(--primary);}
#modalLanc .lanc-section-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;padding-bottom:13px;border-bottom:1px solid #edf0f2;}
#modalLanc .lanc-section-title>div{display:flex;align-items:center;gap:9px;min-width:0;}
#modalLanc .lanc-section-title strong{font-size:14px;color:var(--text);}
#modalLanc .lanc-section-title small{font-size:11.5px;color:var(--muted);text-align:right;}
#modalLanc .lanc-step{width:25px;height:25px;border-radius:8px;display:grid;place-items:center;background:var(--primary);color:#fff;font-size:11px;font-weight:800;flex:0 0 25px;}
#modalLanc .finance-form-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 16px;align-items:end;}
#modalLanc .lanc-grid-2{grid-template-columns:2fr 1fr;}
#modalLanc .field label{margin-bottom:1px;}
#modalLanc input,#modalLanc select,#modalLanc textarea{background:#fff;}
#modalLanc input[readonly]{background:#f3f5f7;color:#68717d;cursor:not-allowed;}
#modalLanc #totalLanc{font-size:16px;font-weight:800;background:#f8faf9;}
#modalLanc .modal-footer{position:sticky;bottom:0;margin:4px -24px 0;padding:15px 24px;background:#fff;border-top:1px solid var(--border);z-index:4;}
#modalLanc .modal-footer .btn{min-width:130px;justify-content:center;}
@media(max-width:850px){
 #modalLanc .finance-form-grid,#modalLanc .lanc-grid-2{grid-template-columns:1fr 1fr;}
 #modalLanc .finance-form-grid .span-2{grid-column:1/-1;}
 #modalLanc .lanc-section-title{align-items:flex-start;flex-direction:column;gap:5px;}
 #modalLanc .lanc-section-title small{text-align:left;padding-left:34px;}
}
@media(max-width:580px){
 #modalLanc .modal-dialog{width:100%;max-height:100vh;border-radius:0;}
 #modalLanc .modal-body{padding:15px 14px 0;max-height:calc(100vh - 145px);}
 #modalLanc .finance-form-grid,#modalLanc .lanc-grid-2{grid-template-columns:1fr;}
 #modalLanc .finance-form-grid .span-2{grid-column:auto;}
 #modalLanc .lanc-section{padding:15px;}
 #modalLanc .modal-footer{margin-left:-14px;margin-right:-14px;padding:12px 14px;}
}
