/* =========================================================================
   components.css — botões, cards, formulários, tabelas, badges, modais…
   ========================================================================= */

/* ------------------------------------------------------------- botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--gray-700);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; flex: 0 0 16px; }

.btn--primary {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  box-shadow: var(--sh-xs);
}
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.btn--secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--gray-700);
}
.btn--secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-900); }

.btn--ghost { background: transparent; color: var(--gray-600); }
.btn--ghost:hover { background: var(--gray-100); color: var(--gray-900); }

.btn--danger { background: var(--danger-500); border-color: var(--danger-500); color: #fff; }
.btn--danger:hover { background: var(--danger-700); border-color: var(--danger-700); color: #fff; }

.btn--danger-ghost { background: transparent; color: var(--danger-500); }
.btn--danger-ghost:hover { background: var(--danger-50); color: var(--danger-700); }

.btn--lime { background: var(--lime-500); border-color: var(--lime-500); color: #14320f; }
.btn--lime:hover { background: var(--lime-600); border-color: var(--lime-600); }

.btn--sm { height: 28px; padding: 0 10px; font-size: var(--fs-base); }
.btn--sm .icon { width: 14px; height: 14px; flex-basis: 14px; }
.btn--lg { height: 40px; padding: 0 20px; font-size: var(--fs-lg); }
.btn--block { width: 100%; }

.btn--icon { width: 34px; padding: 0; flex: 0 0 34px; }
.btn--icon.btn--sm { width: 28px; flex-basis: 28px; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-md) 0 0 var(--r-md); margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* ------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
/* espaço entre cards empilhados um sobre o outro */
.card + .card { margin-top: var(--sp-4); }

/* …mas dentro de um grid os cards são irmãos lado a lado: a regra acima
   empurrava a coluna da direita para baixo e desalinhava as duas colunas.
   Lá o espaçamento já vem do `gap` do próprio grid. */
.grid > .card + .card { margin-top: 0; }

.card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.card__title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-900); }
.card__subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 1px; }
.card__actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.card__body { padding: var(--sp-5); }
.card__body--flush { padding: 0; }
.card__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* seções do formulário de orçamento */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--sp-4);
}
.section__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.section__num {
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.section__title { font-size: var(--fs-md); font-weight: 600; }

/*
 * Cabeçalho que acompanha a rolagem.
 *
 * Num orçamento com muitos itens, adicionar um mandava a pessoa de volta ao
 * topo só para alcançar os botões de novo. Gruda logo abaixo da barra do topo
 * — daí o `top` ser a altura dela — e fica atrás dela no empilhamento
 * (a topbar usa z-index 30). O fundo é obrigatório: sem ele as linhas da
 * tabela passariam por baixo aparecendo através do cabeçalho.
 */
.section__head--sticky {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.section__actions { margin-left: auto; display: flex; gap: var(--sp-2); }
.section__body { padding: var(--sp-5); }
.section__body--flush { padding: 0; }

/* ------------------------------------------------------------- formulários */

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4); }
.col-1{grid-column:span 1}.col-2{grid-column:span 2}.col-3{grid-column:span 3}
.col-4{grid-column:span 4}.col-5{grid-column:span 5}.col-6{grid-column:span 6}
.col-7{grid-column:span 7}.col-8{grid-column:span 8}.col-9{grid-column:span 9}
.col-10{grid-column:span 10}.col-11{grid-column:span 11}.col-12{grid-column:span 12}

@media (max-width: 1024px) {
  .col-1,.col-2,.col-3,.col-4 { grid-column: span 6; }
  .col-5,.col-7,.col-8,.col-9,.col-10,.col-11 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .form-grid > [class^="col-"], .form-grid > [class*=" col-"] { grid-column: span 12; }
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 4px;
}
.label .req { color: var(--danger-500); }
.label__hint { margin-left: auto; font-weight: 400; font-size: var(--fs-xs); color: var(--text-soft); }

.input, .select, .textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--fs-md);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}
.input:disabled, .select:disabled, .textarea:disabled,
.input[readonly] { background: var(--gray-50); color: var(--text-muted); cursor: not-allowed; }
.input::placeholder, .textarea::placeholder { color: var(--text-soft); }

.textarea { min-height: 80px; resize: vertical; line-height: 1.55; }
.textarea--lg { min-height: 120px; }

.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23717d7e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.input--sm, .select--sm { min-height: 28px; padding: 3px 8px; font-size: var(--fs-base); }
.select--sm { padding-right: 26px; background-size: 14px; }

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--danger-500);
  box-shadow: 0 0 0 3px rgba(214, 69, 69, .15);
}

.field__error { font-size: var(--fs-xs); color: var(--danger-500); min-height: 0; }
.field__help  { font-size: var(--fs-xs); color: var(--text-muted); }

/* input com prefixo/sufixo */
.input-group { display: flex; align-items: stretch; }
.input-group .input, .input-group .select { border-radius: 0; margin-left: -1px; }
.input-group > :first-child { border-radius: var(--r-md) 0 0 var(--r-md); margin-left: 0; }
.input-group > :last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }
.input-group .input:focus, .input-group .select:focus { position: relative; z-index: 1; }
.input-addon {
  display: inline-flex; align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  background: var(--gray-50);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.input-group .btn { border-radius: 0; margin-left: -1px; height: auto; border-color: var(--border-strong); }
.input-group > .btn:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* checkbox / radio */
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: var(--fs-md); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand-500); cursor: pointer; flex: 0 0 16px; }
.check span { line-height: 1.4; }

/* várias caixas lado a lado (as operações do usuário), quebrando se faltar espaço */
.check-row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding: 6px 0; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 36px; height: 20px; flex: 0 0 36px;
  border-radius: var(--r-full);
  background: var(--gray-300);
  position: relative;
  transition: background var(--transition);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: var(--r-full);
  background: #fff; box-shadow: var(--sh-xs);
  transition: transform var(--transition);
}
.switch input:checked + .switch__track { background: var(--brand-500); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }

/* segmented control (moeda, idioma…) */
.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--gray-100);
  border-radius: var(--r-md);
  gap: 2px;
}
.segmented button {
  border: 0; background: transparent;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition), color var(--transition);
}
.segmented button:hover { color: var(--gray-800); }
.segmented button.is-active {
  background: var(--surface);
  color: var(--brand-700);
  box-shadow: var(--sh-xs);
}
.segmented--block { display: flex; }
.segmented--block button { flex: 1 1 0; justify-content: center; }

/* ------------------------------------------------------------- tabelas */

.table-wrap { width: 100%; overflow-x: auto; }

.table { font-size: var(--fs-md); }
.table th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--surface-muted);
  padding: 9px var(--sp-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.table td {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr.is-clickable { cursor: pointer; }
.table--compact th { padding: 7px var(--sp-3); }
.table--compact td { padding: 7px var(--sp-3); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table__actions { width: 1%; white-space: nowrap; text-align: right; }
.table__actions .btn { opacity: .55; }
.table tbody tr:hover .table__actions .btn { opacity: 1; }
.table tfoot td { padding: 10px var(--sp-4); font-weight: 600; border-top: 1px solid var(--border); }

.table__cell-main { font-weight: 600; color: var(--gray-900); }
.table__cell-sub  { font-size: var(--fs-sm); color: var(--text-muted); }

.thumb {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--gray-100);
  border: 1px solid var(--border);
}
.thumb--lg { width: 56px; height: 56px; flex-basis: 56px; }
.thumb--empty {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
}

/* ------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.badge--no-dot::before { display: none; }

.badge--neutral { background: var(--neutral-50); color: var(--neutral-700); border-color: var(--gray-200); }
.badge--success { background: var(--success-50); color: var(--success-700); border-color: #bfe6ce; }
.badge--warning { background: var(--warning-50); color: var(--warning-700); border-color: #f3ddab; }
.badge--danger  { background: var(--danger-50);  color: var(--danger-700);  border-color: #f2c2c2; }
.badge--info    { background: var(--info-50);    color: var(--info-700);    border-color: #c3d8f7; }
.badge--lime    { background: #f2f8e6; color: #4d7118; border-color: #d9ecb8; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: var(--gray-100);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.chip button {
  border: 0; background: transparent; cursor: pointer; padding: 0;
  color: var(--text-muted); display: inline-flex;
}
.chip button:hover { color: var(--danger-500); }

.currency-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .02em;
}
.currency-tag--usd { background: #e7f3ec; color: #14663a; }
.currency-tag--pyg { background: #fdf2e0; color: #8a5a06; }
.currency-tag--brl { background: #e8eefb; color: #1f4189; }

/* ------------------------------------------------------------- stats */

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.stat__head { display: flex; align-items: center; gap: var(--sp-2); }
.stat__icon {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600);
}
.stat__icon .icon { width: 17px; height: 17px; }
.stat__icon--lime    { background: #f2f8e6; color: var(--lime-600); }
.stat__icon--info    { background: var(--info-50); color: var(--info-500); }
.stat__icon--warning { background: var(--warning-50); color: var(--warning-500); }
.stat__icon--danger  { background: var(--danger-50); color: var(--danger-500); }
.stat__label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.stat__value { font-size: var(--fs-2xl); font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat__value--sm { font-size: var(--fs-xl); }
.stat__foot { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.stat__delta { font-weight: 600; }
.stat__delta--up { color: var(--success-700); }
.stat__delta--down { color: var(--danger-500); }

/* barra de progresso simples (relatórios/dashboard) */
.bar { height: 6px; background: var(--gray-100); border-radius: var(--r-full); overflow: hidden; }
.bar__fill { height: 100%; background: var(--brand-500); border-radius: var(--r-full); }
.bar__fill--lime { background: var(--lime-500); }
.bar__fill--info { background: var(--info-500); }
.bar__fill--warning { background: var(--warning-500); }
.bar__fill--danger { background: var(--danger-500); }

/* ------------------------------------------------------------- filtros */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
}
.filters .field { flex: 1 1 170px; }
.filters .field--search { flex: 2 1 260px; }
.filters__actions { display: flex; gap: var(--sp-2); }

.search-input { position: relative; }
.search-input .icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-soft); pointer-events: none;
}
.search-input .input { padding-left: 32px; }

/* ------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tabs button {
  border: 0; background: transparent;
  padding: 9px 14px;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--gray-900); }
.tabs button.is-active { color: var(--brand-600); border-bottom-color: var(--brand-500); font-weight: 600; }
.tabs__count {
  background: var(--gray-100); color: var(--text-muted);
  border-radius: var(--r-full); padding: 0 6px; font-size: var(--fs-xs); font-weight: 600;
}
.tabs button.is-active .tabs__count { background: var(--brand-50); color: var(--brand-700); }

/* ------------------------------------------------------------- dropdown */

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: var(--sp-1);
  /* acima da topbar (40) e da sidebar (30); o modal (200) continua por cima */
  z-index: 120;
  display: none;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__menu--left { right: auto; left: 0; }
.dropdown__item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%;
  padding: 7px 10px;
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--gray-700);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.dropdown__item:hover { background: var(--gray-50); color: var(--gray-900); text-decoration: none; }
.dropdown__item--danger { color: var(--danger-500); }
.dropdown__item--danger:hover { background: var(--danger-50); color: var(--danger-700); }
.dropdown__item .icon { width: 16px; height: 16px; flex: 0 0 16px; opacity: .8; }
.dropdown__sep { height: 1px; background: var(--border); margin: var(--sp-1) 0; }
.dropdown__label {
  padding: 6px 10px 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-soft);
}

/* ------------------------------------------------------------- autocomplete */

.autocomplete { position: relative; }
.autocomplete__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  z-index: 60;
  display: none;
  padding: var(--sp-1);
}
.autocomplete.is-open .autocomplete__list { display: block; }
.autocomplete__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
}
.autocomplete__item:hover, .autocomplete__item.is-highlighted { background: var(--brand-50); }
.autocomplete__item-main { font-weight: 600; font-size: var(--fs-md); }
.autocomplete__item-sub { font-size: var(--fs-sm); color: var(--text-muted); }
.autocomplete__empty { padding: var(--sp-4); text-align: center; color: var(--text-muted); font-size: var(--fs-md); }
.autocomplete__foot {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-1);
  padding-top: var(--sp-1);
}

/* ------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(21, 28, 29, .5);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  overflow-y: auto;
  animation: fade-in 140ms ease-out;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 100%;
  max-width: 560px;
  margin: auto;
  animation: modal-in 180ms cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--sp-12));
}
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 760px; }
.modal--xl { max-width: 1040px; }

.modal__head {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: var(--fs-lg); font-weight: 600; }
.modal__subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.modal__close {
  margin-left: auto;
  width: 30px; height: 30px; flex: 0 0 30px;
  border: 0; background: transparent; border-radius: var(--r-md);
  color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal__close:hover { background: var(--gray-100); color: var(--gray-900); }
.modal__body { padding: var(--sp-5); overflow-y: auto; flex: 1 1 auto; }
.modal__foot {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.modal__foot .u-grow { flex: 1 1 auto; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(-12px) scale(.985); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- toast */

.toasts {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  background: var(--gray-900);
  color: #fff;
  padding: 11px var(--sp-4);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: var(--fs-md);
  animation: toast-in 200ms cubic-bezier(.4, 0, .2, 1);
}
.toast .icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.toast--success .icon { color: var(--lime-400); }
.toast--danger  .icon { color: #ff8f8f; }
.toast--warning .icon { color: #f5c563; }
.toast--info    .icon { color: #8fc0ff; }
.toast__close { margin-left: auto; border: 0; background: transparent; color: rgba(255,255,255,.6); cursor: pointer; padding: 0; }
.toast__close:hover { color: #fff; }
.toast.is-leaving { animation: toast-out 160ms ease-in forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

@media (max-width: 640px) {
  .toasts { left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); max-width: none; }
}

/* ------------------------------------------------------------- alertas */

.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid;
  font-size: var(--fs-md);
}
.alert .icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert__title { font-weight: 600; margin-bottom: 2px; }
.alert--info    { background: var(--info-50);    border-color: #c3d8f7; color: var(--info-700); }
.alert--success { background: var(--success-50); border-color: #bfe6ce; color: var(--success-700); }
.alert--warning { background: var(--warning-50); border-color: #f3ddab; color: var(--warning-700); }
.alert--danger  { background: var(--danger-50);  border-color: #f2c2c2; color: var(--danger-700); }

/* ------------------------------------------------------------- vazio */

.empty {
  padding: var(--sp-10) var(--sp-5);
  text-align: center;
  color: var(--text-muted);
}
.empty__icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--gray-50);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
}
.empty__icon .icon { width: 24px; height: 24px; }
.empty__title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.empty__text { font-size: var(--fs-md); max-width: 380px; margin: 0 auto var(--sp-4); }

/* ------------------------------------------------------------- paginação */

.pagination {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap;
}
.pagination__info { font-size: var(--fs-sm); color: var(--text-muted); }
.pagination__pages { display: flex; gap: 2px; margin-left: auto; }
.pagination__page {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--gray-600);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pagination__page:hover { background: var(--gray-50); }
.pagination__page.is-active { background: var(--brand-500); border-color: var(--brand-500); color: #fff; font-weight: 600; }
.pagination__page:disabled { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------- timeline */

.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: var(--sp-4); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: calc(-1 * var(--sp-6) + 2px); top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand-500);
}
.timeline__dot--muted { border-color: var(--gray-300); }
.timeline__title { font-size: var(--fs-md); font-weight: 600; }
.timeline__meta { font-size: var(--fs-sm); color: var(--text-muted); }

/* ------------------------------------------------------------- diversos */

.divider-text {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--text-soft); font-size: var(--fs-sm);
  margin: var(--sp-4) 0;
}
.divider-text::before, .divider-text::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--border);
}

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-4); font-size: var(--fs-md); }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 500; color: var(--gray-800); }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface-muted);
  transition: border-color var(--transition), background var(--transition);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
.dropzone .icon { width: 22px; height: 22px; margin-bottom: 6px; }
.dropzone__hint { font-size: var(--fs-xs); color: var(--text-soft); margin-top: 4px; }
