/* ============================================================
   Casamento — sistema visual
   Paleta de alto contraste: tinta escura sobre superficie clara
   neutra. O rosa vira acento pontual (marca, acoes primarias),
   nao fundo de tudo — pastel em area grande apagava a leitura.
   O tom de marca em si e um rosa claro e vivido (Tailwind
   pink-600), nao um pastel dessaturado nem o vinho escuro antigo.
   ============================================================ */
:root {
  /* Marca — rosa claro, porem contido: saturacao media (nem neon/choque,
     nem pastel dessaturado), luminosidade media-alta. */
  --brand: #BD427D;
  --brand-dark: #A13662;
  --brand-soft: #F7E4ED;
  --brand-ink: #6F2041;
  --gold: #8A6100;

  /* Superficies e tinta */
  --bg: #F1EFF3;
  --panel: #FFFFFF;
  --panel-2: #F8F7F9;
  --border: #DCD7E0;
  --border-strong: #B5ACBD;
  --text: #17121B;
  --text-muted: #57505C;

  /* Semanticas (par texto/fundo com contraste medido) */
  --green: #14663C;      --green-bg: #DEF3E6;
  --blue: #1B4F9C;       --blue-bg: #E4ECFA;
  --red: #B3261E;        --red-bg: #FBE7E5;
  --amber: #8A5A00;      --amber-bg: #FAEFD6;

  /* Escala densa (dashboard) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(23,18,27,.06), 0 4px 12px rgba(23,18,27,.05);
  --shadow-lg: 0 12px 40px rgba(23,18,27,.22);
  --ring: 0 0 0 3px rgba(189,66,125,.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Numeros em coluna nao devem dancar a cada digito */
.num, .stat-value, .money { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

.icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 246px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-5) var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.brand-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.brand-title { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px 11px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.nav-item .icon { color: var(--text-muted); }
.nav-label-short { display: none; }
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-item.active .icon { color: #fff; }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: var(--sp-3); }

.link-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  transition: background .16s ease, color .16s ease;
}
.link-btn:hover { color: var(--brand); background: var(--panel-2); }

/* ---------------- Content ---------------- */
/* min-width: 0 impede que uma tabela larga estufe o flex e empurre a sidebar.
   A sobra de largura fica dividida nos dois lados em vez de toda na direita. */
.content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1520px;
  margin-inline: auto;
  padding: var(--sp-6) var(--sp-6) 64px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.subtitle { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 0; }
.placeholder { color: var(--text-muted); font-size: 14px; }

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: var(--sp-5) 0 var(--sp-3);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--panel-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8F1E17; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-sm .icon { width: 15px; height: 15px; }

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.btn-icon:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-danger-text:hover { background: var(--red-bg); color: var(--red); border-color: transparent; }

/* ---------------- Stat cards ---------------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow);
}
.stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.stat-card .stat-value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.stat-card .stat-hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-card.is-brand { border-left: 3px solid var(--brand); }
.stat-card.is-brand .stat-value { color: var(--brand-ink); }
.stat-card.is-green { border-left: 3px solid var(--green); }
.stat-card.is-green .stat-value { color: var(--green); }
.stat-card.is-red { border-left: 3px solid var(--red); }
.stat-card.is-red .stat-value { color: var(--red); }

/* ---------------- Categorias ---------------- */
.categoria-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.categoria-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}

.categoria-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.categoria-caret { color: var(--text-muted); transition: transform .18s ease; flex-shrink: 0; }
.categoria-caret.is-open { transform: rotate(90deg); }
.categoria-nome { font-weight: 700; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.categoria-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  flex-shrink: 0;
}
.categoria-total { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }

.categoria-header-actions { display: flex; gap: 2px; align-items: center; }

.categoria-body { padding: var(--sp-2) var(--sp-4) var(--sp-3); }
.categoria-body.collapsed { display: none; }

/* ---------------- Tabelas ---------------- */
.orc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.orc-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: var(--sp-2) 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.orc-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.orc-table tbody tr:last-child td { border-bottom: none; }
.orc-table tbody tr { transition: background .14s ease; }
.orc-table tbody tr:hover { background: var(--panel-2); }
.orc-table td[data-num] { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.orc-table th.th-num { text-align: right; }
.cell-strong { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* A tabela de Orçamentos renderiza uma <table> por categoria; table-layout: fixed
   + larguras por coluna garantem que todas fiquem alinhadas entre si.
   Escopado só a ela — as tabelas de Fornecedores e Convidados têm outras colunas
   e não devem herdar essas larguras (senão a coluna de Ações fica espremida). */
#categorias-container .orc-table {
  table-layout: fixed;
}
#categorias-container .orc-table th,
#categorias-container .orc-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
#categorias-container .orc-table .col-sel { width: 34px; }
#categorias-container .orc-table th:nth-child(2), #categorias-container .orc-table td:nth-child(2) { width: 26%; }
#categorias-container .orc-table th.th-num:nth-child(3), #categorias-container .orc-table td:nth-child(3) { width: 15%; }
#categorias-container .orc-table th.th-num:nth-child(4), #categorias-container .orc-table td:nth-child(4) { width: 15%; }
#categorias-container .orc-table th:nth-child(5), #categorias-container .orc-table td:nth-child(5) { width: 15%; }
#categorias-container .orc-table th:nth-child(6), #categorias-container .orc-table td:nth-child(6) { width: 15%; }
#categorias-container .orc-table th:nth-child(7), #categorias-container .orc-table td:nth-child(7) { width: 80px; }

/* Convidados e Fornecedores: a coluna de ações (editar/excluir) precisa de
   espaço garantido pra não ser espremida quando a tabela aperta. */
#convidados-tbody .row-actions,
.pgto-tbody .row-actions { width: 76px; white-space: nowrap; }

.empty-row td {
  color: var(--text-muted);
  text-align: center;
  padding: var(--sp-5) var(--sp-3);
}

/* Rede de segurança: se uma tabela não couber na largura disponível, ela rola
   por dentro do card em vez de estourar a página ou esconder colunas inteiras. */
.table-card, .categoria-body, .fc-body {
  overflow-x: auto;
}
.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-4);
  box-shadow: var(--shadow);
}

/* ---------------- Status ---------------- */
.status-select {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 26px 5px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
}
.status-em_contato { background-color: var(--blue-bg); color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231B4F9C' stroke-width='1.6'/%3E%3C/svg%3E"); }
.status-negociando { background-color: var(--amber-bg); color: var(--amber);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238A5A00' stroke-width='1.6'/%3E%3C/svg%3E"); }
.status-recusado { background-color: var(--red-bg); color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23B3261E' stroke-width='1.6'/%3E%3C/svg%3E"); }
.status-fechado { background-color: var(--green-bg); color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2314663C' stroke-width='1.6'/%3E%3C/svg%3E"); }

/* Cor sozinha nao carrega significado: o badge sempre leva icone + texto */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ---------------- Fornecedores ---------------- */
.fornecedores-lista { display: flex; flex-direction: column; gap: var(--sp-3); }

.fornecedor-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fornecedor-card.is-quitado { border-left: 3px solid var(--green); }

.fc-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  flex-wrap: wrap;
}
.fc-id { flex: 1; min-width: 200px; }
.fc-cat {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-ink);
  margin-bottom: 2px;
}
.fc-nome { font-size: 17px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.fc-obs { font-size: 13px; color: var(--text-muted); margin-top: 4px; overflow-wrap: anywhere; }

.fc-numeros { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.fc-numeros > div { min-width: 92px; text-align: right; }
.fc-num-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
}
.fc-num-valor { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-num-valor.pago { color: var(--green); }
.fc-num-valor.saldo { color: var(--red); }
.fc-num-valor.zerado { color: var(--green); }

.fc-actions { display: flex; gap: 2px; }

.progress {
  height: 7px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  transition: width .35s cubic-bezier(.22,.61,.36,1);
}
.progress-fill.full { background: var(--green); }

.fc-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.fc-body.collapsed { display: none; }
.fc-body-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-2);
}

.pgto-vazio {
  color: var(--text-muted);
  font-size: 13.5px;
  padding: var(--sp-4);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.fc-toggle {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  background: var(--panel-2);
  border: none;
  border-top: 1px solid var(--border);
  padding: 9px var(--sp-4);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.fc-toggle:hover { color: var(--brand); }
.fc-toggle .icon { transition: transform .18s ease; }
.fc-toggle.is-open .icon { transform: rotate(180deg); }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 18, 27, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  z-index: 100;
  animation: overlayIn .16s ease both;
}
@keyframes overlayIn { from { opacity: 0; } }
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--panel);
  border-radius: 14px;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-lg { width: 580px; }

.modal h2 {
  margin: 0 0 var(--sp-4);
  color: var(--text);
  font-size: 18px;
  letter-spacing: -.01em;
}

.modal label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  font-weight: 700;
}
.modal input[type=text],
.modal input[type=number],
.modal input[type=date],
.modal select,
.modal textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text);
  background: var(--panel);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.modal textarea { resize: vertical; }
.field-hint { font-weight: 400; font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-3); }
.col-span-2 { grid-column: 1 / -1; }

.pagamento-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  margin-bottom: var(--sp-3);
}
.pagamento-secao.hidden { display: none; }
.pagamento-info { margin: 2px 0 10px; font-size: 13.5px; color: var(--text-muted); }
.pagamento-hint { margin: -2px 0 10px; font-size: 12.5px; color: var(--text-muted); }
.pagamento-hint.alerta { color: var(--red); font-weight: 600; }

.resumo-pagamento {
  background: var(--brand-soft);
  border: 1px solid #E7B8CE;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--brand-ink);
  margin-bottom: var(--sp-3);
  line-height: 1.65;
}
.resumo-pagamento:empty { display: none; }
.resumo-pagamento .linha { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.resumo-pagamento .destaque { font-weight: 700; }
.resumo-pagamento .aviso { color: var(--red); font-weight: 700; }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.checkbox-line input { width: auto; margin: 0; accent-color: var(--brand); }

.valor-linha { display: flex; align-items: flex-end; gap: var(--sp-4); margin-bottom: var(--sp-3); }
.valor-linha > label:first-child { flex: 1; margin-bottom: 0; }
.checkbox-inline {
  margin-bottom: 9px; white-space: nowrap;
  font-size: 13.5px; color: var(--text); cursor: pointer;
}

.convidado-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4) 2px;
  margin-bottom: var(--sp-3);
}
.convidado-box.hidden { display: none; }

.modo-linha {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.modo-label {
  font-size: 11.5px; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; width: 100%;
}
.radio-inline {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--text);
  margin: 0; cursor: pointer;
}
.radio-inline input { width: auto; margin: 0; accent-color: var(--brand); cursor: pointer; }

.faixas-header, .faixa-row {
  display: grid;
  grid-template-columns: 34px 1fr 1.3fr 1fr 34px;
  gap: var(--sp-2);
  align-items: center;
}
.faixas-header {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700; margin-bottom: 6px;
}
.faixas-header .faixas-col-calc { text-align: right; }
.faixas-lista { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.faixa-row { padding: 4px 6px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.faixa-row.faixa-ativa { background: var(--brand-soft); border-color: var(--brand); }
.faixa-row input[type="number"] { margin: 0; }
.faixa-row input[type="radio"] {
  width: auto; margin: 0 auto; display: block;
  accent-color: var(--brand); cursor: pointer;
}
.faixa-calc {
  font-size: 12.5px; color: var(--text-muted); text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.faixa-ativa .faixa-calc { color: var(--brand-ink); font-weight: 700; }

.modal input.campo-calculado {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.modal-actions .btn-danger-ghost { margin-right: auto; background: transparent; color: var(--red); border-color: var(--border); }
.modal-actions .btn-danger-ghost:hover { background: var(--red-bg); border-color: var(--red-bg); }

.modal label.hidden, .hidden { display: none; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px;
  background: var(--text);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toastIn .2s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast.hidden { display: none; }
.toast.error { background: var(--red); }

/* ---------------- Resumo ---------------- */
.resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-3);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
}
.panel h3 {
  margin: 0 0 var(--sp-3);
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
}
.bar-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.bar-item .bar-top {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  font-size: 13.5px; margin-bottom: 5px;
}
.bar-item .bar-nome { font-weight: 600; overflow-wrap: anywhere; }
.bar-item .bar-valor { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }

.countdown {
  display: flex; align-items: baseline; gap: 10px;
  padding: var(--sp-4);
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.countdown-num { font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.countdown-label { font-size: 14px; opacity: .92; }
.countdown-data { margin-left: auto; font-size: 13.5px; opacity: .92; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--sp-3) var(--sp-3);
    position: sticky; top: 0; z-index: 50;
  }
  .brand { padding: 0 4px 0; margin-bottom: 0; border-bottom: none; }

  /* Nav vira barra de abas fixa no rodape (padrao mobile): com 5 destinos e
     rotulos curtos tudo fica visivel de uma vez, sem depender de descobrir
     que a barra rola na horizontal (2 dos 5 destinos ficavam fora da tela). */
  .nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 6px var(--sp-1) calc(6px + env(safe-area-inset-bottom));
    z-index: 60;
    box-shadow: 0 -2px 14px rgba(23,18,27,.08);
  }
  .nav-item {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 10.5px;
    text-align: center;
    line-height: 1.2;
  }
  .nav-item .icon { width: 21px; height: 21px; }
  .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .nav-label-full { display: none; }
  .nav-label-short { display: inline; }

  .sidebar-footer {
    border-top: none; padding: 0;
    position: absolute; top: var(--sp-3); right: var(--sp-3);
  }
  .link-btn { font-size: 12px; padding: 8px; }
  .link-btn span { display: none; }

  /* Espaco reservado no fim do conteudo para a barra de abas fixa nao cobrir nada */
  .content { padding: var(--sp-4) var(--sp-3) calc(84px + env(safe-area-inset-bottom)); max-width: 100%; }

  /* Botoes de acao do cabecalho (Novo convidado, Fornecedor avulso, Simulacao
     + Nova categoria...) ganham a linha inteira no mobile em vez de ficar do
     tamanho do texto, jogado num canto — alvo de toque maior e mais facil de
     achar. */
  .tab-header { flex-direction: column; align-items: stretch; gap: var(--sp-3); margin-bottom: var(--sp-4); }
  .tab-header > .btn { width: 100%; justify-content: center; }
  .tab-header-actions { width: 100%; gap: var(--sp-2); }
  .tab-header-actions .btn { flex: 1; justify-content: center; }
  h1 { font-size: 20px; }

  /* Cartoes de estatistica mais discretos: sombra mais leve, menos respiro.
     Quando a contagem de cartoes e impar (ex: 5 num grid de 2 colunas), o
     ultimo sobrava sozinho numa linha — aqui ele estica pra linha toda. */
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-4); }
  .stat-card {
    padding: 10px 12px;
    box-shadow: none;
    border-radius: var(--radius-sm);
  }
  .stat-card .stat-value { font-size: 17px; }
  .stat-card .stat-label { font-size: 10.5px; }
  .stats-bar > .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .table-card { padding: var(--sp-2) 10px; }
  .categoria-body { padding: 10px 12px; }

  /* Tabelas viram listas compactas: rolagem lateral em tabela financeira
     esconde numero, e mostrar tudo (fornecedor + valor + entrada + pagamento
     + status) de uma vez deixa cada item enorme. Colapsada, a linha mostra so
     o nome; um toque abre os detalhes (.is-open), como o card de fornecedor. */
  .orc-table thead { display: none; }
  .orc-table, .orc-table tbody, .orc-table tr, .orc-table td { display: block; width: 100%; }
  /* As regras de largura por coluna (15%/26%/etc, pensadas para table-layout:fixed
     no desktop, algumas com prefixo #categorias-container) continuavam valendo
     mesmo com a celula virando linha de cartao — a celula ficava espremida em
     ~15% da largura e o valor era cortado pelo overflow:hidden, sumindo
     visualmente. !important garante que nenhuma largura de coluna do desktop
     (atual ou futura) volte a espremer a celula no modo cartao do mobile. */
  .orc-table th:nth-child(n), .orc-table td:nth-child(n) { width: auto !important; }

  .orc-table tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    margin-bottom: 8px;
    cursor: pointer;
  }
  .orc-table tbody tr.empty-row { cursor: default; }
  .orc-table tbody tr:last-child { margin-bottom: 0; }

  .orc-table td {
    border: none;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    text-align: right;
  }
  .orc-table td::before {
    content: attr(data-label);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    flex-shrink: 0;
  }
  .orc-table td:not([data-label])::before { content: ''; }
  .orc-table td[data-label="Fornecedor"],
  .orc-table td[data-label="Nome"],
  .orc-table td[data-label="Descrição"] {
    display: block;
    overflow: hidden;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 0;
  }
  /* Seta indicando que a linha abre, flutuando a direita: se o nome quebra em
     mais de uma linha, o texto contorna a seta em vez de passar por cima dela
     (o que acontecia com a seta posicionada de forma absoluta). Gira quando
     a linha esta expandida. */
  .orc-table td[data-label="Fornecedor"]::before,
  .orc-table td[data-label="Nome"]::before,
  .orc-table td[data-label="Descrição"]::before {
    content: '';
    float: right;
    width: 8px; height: 8px;
    margin: 6px 2px 0 10px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform .18s ease;
  }
  .orc-table tr.is-open td[data-label="Fornecedor"]::before,
  .orc-table tr.is-open td[data-label="Nome"]::before,
  .orc-table tr.is-open td[data-label="Descrição"]::before {
    transform: rotate(225deg);
    margin-top: 9px;
  }
  .orc-table tr.empty-row td::before { content: none; float: none; }

  /* Recolhida, a linha mostra so o nome (+ subtitulo) e as acoes — o resto
     (valor, entrada, pagamento, status / categoria, lado, motivo) fica
     escondido ate o toque abrir. A coluna de selecao (.col-sel) fica de fora
     dessa regra: no modo simulacao ela precisa continuar visivel mesmo com a
     linha recolhida, senao a checkbox some e da pra marcar o fornecedor. */
  .orc-table tbody tr:not(.is-open):not(.empty-row) td:not([data-label="Fornecedor"]):not([data-label="Nome"]):not([data-label="Descrição"]):not(.row-actions):not(.col-sel) {
    display: none;
  }
  .orc-table tbody tr.is-open td[data-label="Fornecedor"],
  .orc-table tbody tr.is-open td[data-label="Nome"],
  .orc-table tbody tr.is-open td[data-label="Descrição"] {
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    padding-bottom: 8px;
  }

  .orc-table .row-actions { justify-content: flex-end; padding-top: 2px; padding-bottom: 6px; }
  .btn-icon { width: 44px; height: 44px; }

  .empty-row td, .orc-table tr.empty-row {
    display: block; text-align: center;
    border: 1px dashed var(--border-strong);
  }
  .empty-row td::before { content: ''; display: none; }

  .fc-numeros { gap: var(--sp-4); width: 100%; }
  .fc-numeros > div { flex: 1; min-width: 0; }
  .fc-actions { width: 100%; justify-content: flex-end; }

  /* Simulacoes: cartao mais enxuto — a lista de fornecedores (que pode ser
     longa) some do preview, ja que um toque abre o detalhe completo. */
  .simulacoes-lista { gap: var(--sp-2); }
  .simulacao-card { padding: 10px 12px; gap: var(--sp-3); box-shadow: none; }
  .simulacao-card-icon { width: 34px; height: 34px; }
  .simulacao-card-icon .icon { width: 16px; height: 16px; }
  .simulacao-card-nome { font-size: 14.5px; }
  .simulacao-card-fornecedores { display: none; }
  .simulacao-card-total { font-size: 16px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal, .modal-lg {
    width: 100%; max-width: 100%; max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: var(--sp-5) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom));
  }
  /* Formularios longos (orcamento com faixas, por ex.) obrigavam a rolar ate
     o fim pra achar Salvar/Cancelar. Fixando a barra de acoes no rodape do
     modal enquanto o conteudo rola por baixo, ela fica sempre alcancavel. */
  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--panel);
    padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 12px -8px rgba(23,18,27,.12);
  }

  .form-grid { grid-template-columns: 1fr; }

  .valor-linha { flex-direction: column; align-items: stretch; gap: 4px; }
  .valor-linha > label:first-child { margin-bottom: var(--sp-2); }
  .checkbox-inline { margin-bottom: var(--sp-3); }

  .faixas-header { display: none; }
  .faixas-lista { gap: 10px; }
  .faixa-row {
    grid-template-columns: 30px 1fr 1fr;
    grid-template-areas: "usar qtd valor" "usar calc acao";
    gap: 6px 8px;
    border: 1px solid var(--border);
    padding: var(--sp-2);
  }
  .faixa-row .faixas-col-usar { grid-area: usar; align-self: center; }
  .faixa-row .faixa-qtd { grid-area: qtd; }
  .faixa-row .faixa-valor { grid-area: valor; }
  .faixa-row .faixa-calc { grid-area: calc; text-align: left; }
  .faixa-row .faixas-col-acao { grid-area: acao; text-align: right; }

  .modal-actions .btn { flex: 1; padding: 12px 16px; justify-content: center; }
  .modal-actions .btn-danger-ghost { flex: 0 0 auto; }

  /* 16px evita o zoom automatico do iOS ao focar o campo */
  .modal input[type="text"], .modal input[type="number"], .modal input[type="date"],
  .modal select, .modal textarea { padding: 12px; font-size: 16px; }
  .modal input[type="radio"], .modal input[type="checkbox"] { width: 20px; height: 20px; }
  .status-select { padding: 8px 26px 8px 12px; font-size: 13px; }

  .toast { left: var(--sp-3); right: var(--sp-3); transform: none; justify-content: center; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
}

@media (max-width: 360px) {
  .stats-bar { grid-template-columns: 1fr; }
}

/* ---------------- Simulações ---------------- */
.tab-header-actions { display: flex; gap: var(--sp-2); }

.col-sel { width: 34px; text-align: center !important; }
.col-sel input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
#categorias-container:not(.selecao-ativa) .col-sel { display: none; }

/* Modo seleção: deixa claro que a tabela virou uma lista marcável,
   sem depender só da coluna de checkbox pra comunicar isso. */
#categorias-container.selecao-ativa .categoria-body { background: var(--panel-2); }
#categorias-container.selecao-ativa .orc-table tbody tr { cursor: pointer; }
#categorias-container.selecao-ativa .orc-table tbody tr:has(.col-sel input:checked) {
  background: var(--brand-soft);
}

#btn-modo-simulacao.is-ativo {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* Barra flutuante de seleção */
.simulacao-bar {
  position: fixed;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--text);
  color: #fff;
  padding: 10px 10px 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  animation: toastIn .2s cubic-bezier(.22,.61,.36,1) both;
}
.simulacao-bar.hidden { display: none; }
.simulacao-bar-actions { display: flex; align-items: center; gap: 8px; }
#simulacao-bar-texto { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.simulacao-bar .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.simulacao-bar .btn-secondary:hover { background: rgba(255,255,255,.12); }
.simulacao-bar .btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* Modo de selecao para simulacao no mobile: a pilula flutuante centralizada
   brigava com a barra de abas fixa (cortava texto, ficava por cima/atras
   dela). Vira uma barra full-width ancorada no rodape — com texto e botoes
   em linhas separadas, ja que os dois botoes + o texto nao cabem lado a lado
   num telão de 375px — e a navegacao some enquanto a selecao esta ativa, so
   uma coisa fixa no rodape por vez. */
@media (max-width: 860px) {
  body.selecao-ativa .nav { display: none; }
  body.selecao-ativa .content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .simulacao-bar {
    left: 0; right: 0; bottom: 0;
    transform: none;
    width: 100%;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    border-radius: 16px 16px 0 0;
    padding: 12px var(--sp-4) calc(12px + env(safe-area-inset-bottom));
  }
  #simulacao-bar-texto { white-space: normal; flex: 1 1 100%; }
  .simulacao-bar-actions { width: 100%; }
  .simulacao-bar-actions .btn { flex: 1; justify-content: center; }
}

/* Lista de simulações */
.simulacoes-lista { display: flex; flex-direction: column; gap: var(--sp-3); }
.simulacao-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .1s ease;
}
.simulacao-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.simulacao-card:active { transform: scale(.997); }
.simulacao-card-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid; place-items: center;
}
.simulacao-card-info { flex: 1; min-width: 200px; }
.simulacao-card-nome { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.simulacao-card-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.simulacao-card-fornecedores { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; overflow-wrap: anywhere; }
.simulacao-card-totais { text-align: right; }
.simulacao-card-total-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.simulacao-card-total { font-size: 19px; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.simulacao-card-actions { display: flex; align-items: center; gap: 2px; }
.simulacao-card-actions .icon { color: var(--text-muted); }

/* Modal de detalhe / documento imprimível — uma lista simples, sem tabela nem campos. */
.modal-simulacao { width: 620px; max-width: 94vw; padding: var(--sp-6); position: relative; }
.sim-print-close {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: none; background: var(--panel-2); color: var(--text-muted);
  border-radius: 999px; cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.sim-print-close:hover { background: var(--border); color: var(--text); }

.sim-doc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-3);
  border-bottom: 2px solid var(--brand-soft);
}
.sim-doc-head h2 { margin: 0; padding-right: 40px; }
.sim-doc-gerado { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.sim-lista { list-style: none; margin: 0; padding: 0; }
.sim-lista li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
}
.sim-lista li:first-child { padding-top: 4px; }
.sim-lista li:last-child { border-bottom: none; }
.sim-item-nome { font-weight: 700; font-size: 14.5px; color: var(--text); }
.sim-item-detalhe { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.sim-item-valor { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }

.sim-totais {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 2px solid var(--border-strong);
}
.sim-totais-linha {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--sp-3);
  padding: 6px 2px;
  font-weight: 600;
}
.sim-totais-linha span:first-child { font-size: 12.5px; color: var(--text-muted); }
.sim-totais-linha span:last-child { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.sim-totais-linha.is-destaque {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-weight: 700;
}
.sim-totais-linha.is-destaque span:first-child { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.sim-totais-linha.is-destaque span:last-child { font-size: 20px; color: var(--brand-ink); }

@media print {
  body * { visibility: hidden; }
  #modal-simulacao-detalhe, #modal-simulacao-detalhe * { visibility: visible; }
  #modal-simulacao-detalhe {
    position: absolute; inset: 0;
    background: #fff; box-shadow: none;
    display: block; padding: 0;
  }
  #modal-simulacao-detalhe .modal { width: 100%; max-width: 100%; max-height: none; box-shadow: none; padding: 24px; }
  #modal-simulacao-detalhe .modal-actions,
  #modal-simulacao-detalhe .sim-print-close { display: none; }
}

@media (max-width: 640px) {
  .modal-simulacao { padding: var(--sp-4); }
  .sim-doc-head { flex-direction: column; align-items: flex-start; }
  .sim-lista li { flex-direction: column; align-items: flex-start; gap: 2px; }
  .simulacao-card { align-items: flex-start; }
  .simulacao-card-totais { text-align: left; }
}

/* ---------------- Filtros ---------------- */
.filtros-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow);
}
.filtro-campo { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filtro-campo.filtro-busca { flex: 1 1 220px; }
.filtro-campo label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.filtro-campo input,
.filtro-campo select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.filtro-campo input:focus,
.filtro-campo select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.filtros-info {
  margin: 0 0 var(--sp-3);
  font-size: 13px;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .filtros-bar { flex-direction: column; align-items: stretch; }
  .filtro-campo { min-width: 0; }
  /* Em coluna o eixo principal do flex passa a ser vertical: o flex-basis de
     220px pensado para largura (linha, desktop) virava altura minima do campo
     de busca, esticando o card com uma folga vazia enorme. */
  .filtro-campo.filtro-busca { flex-basis: auto; }
}
