.categorias-page {
  box-sizing: border-box;
  padding: 40px;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.cat-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.cat-form-titulo {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.cat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cat-form #cat-nome {
  flex: 1;
  min-width: 180px;
}

.cat-lista {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cat-grupo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.cat-grupo-head {
  padding: 14px 20px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.cat-item-nome {
  font-size: 14px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.cat-item-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cat-item-swipe {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cat-arquivada .cat-item-nome {
  color: var(--text-muted);
}

.cat-vazio {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.cat-vazio p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.cat-vazio-acoes {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primario {
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-primario:hover { background: var(--accent-hover); }

.btn-secundario {
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-secundario:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 650px) {
  .categorias-page { padding: 24px; }
  .cat-form { flex-direction: column; align-items: stretch; }
  .cat-form #cat-nome { width: 100%; flex: none; }

  /* Editar/excluir escondidos; deslize a linha p/ ESQUERDA para revelar
     (o .cat-grupo já tem overflow:hidden, que clipa a faixa) */
  .cat-item {
    position: relative;
    transition: transform 0.18s ease;
    touch-action: pan-y;
    background: var(--surface);
  }
  .cat-item.aberta {
    transform: translateX(-104px);
  }
  .cat-item-swipe {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -104px;
    width: 104px;
    justify-content: center;
  }
  .cat-item-swipe .btn-acao {
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
  }
  .cat-item-swipe .cat-editar {
    background: #f59e0b;
  }
  .cat-item-swipe .cat-excluir {
    background: var(--negative);
  }
}
