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

.rec-gerar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-gerar {
  min-height: 40px;
  padding: 8px 16px;
  line-height: 1.3;
  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-gerar:hover { background: var(--accent-hover); }
.btn-gerar:disabled { opacity: 0.6; cursor: wait; }

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

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

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

.rec-tipo {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}

.rec-tipo-btn {
  flex: 1; /* divide o grupo por igual (sem "terceiro espaço" vazio no celular) */
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rec-tipo-btn.ativo {
  background: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

.rec-input {
  height: 42px;
  /* min-height segura a altura mesmo quando o campo tem flex:1 num form em coluna
     (o flex-basis colapsava o campo — era a "descrição menor" no celular) */
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  /* remove a altura/estilo nativos do iOS — input, select e date ficam idênticos */
  -webkit-appearance: none;
  appearance: none;
}

/* seta customizada (a nativa some com appearance: none) */
select.rec-input {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4-4 4 4'/%3E%3Cpath d='M16 15l-4 4-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}
.rec-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#rec-descricao { flex: 1; min-width: 160px; }
#rec-valor { width: 150px; }
.rec-dia { width: 84px; }

.btn-salvar-rec {
  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-salvar-rec:hover { background: var(--accent-hover); }

.rec-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-vazio {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

.rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.rec-inativo { opacity: 0.55; }

.rec-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rec-item-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.rec-item-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

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

.rec-item-main {
  flex: 1;
}

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

@media (max-width: 650px) {
  .recorrentes-page { padding: 24px; }
  .rec-form { flex-direction: column; align-items: stretch; }
  #rec-descricao,
  #rec-valor,
  .rec-dia { width: 100%; flex: none; }

  /* Editar/excluir escondidos; deslize p/ ESQUERDA para revelar (switch fica visível) */
  .rec-lista {
    overflow-x: hidden;
  }
  .rec-item {
    position: relative;
    transition: transform 0.18s ease;
    touch-action: pan-y;
  }
  .rec-item.aberta {
    transform: translateX(-104px);
  }
  .rec-item-swipe {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -104px;
    width: 104px;
    justify-content: center;
  }
  .rec-item-swipe .btn-acao {
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
  }
  .rec-item-swipe .rec-editar {
    background: #f59e0b;
  }
  .rec-item-swipe .rec-excluir {
    background: var(--negative);
  }
}
