/* =============================================================TEMA GLOBAL============================================================= */

:root {
  --roxo: #7a4dff;
  --roxo-claro: #efe9ff;
  --text: #333;
  --muted: #7b7f86;
  --bg: #f7f7fb;
  --panel: #ffffff;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(0,0,0,0.06);
  font-family: "Inter", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

/* ============================================================= HEADER / MENU============================================================= */

.top-header {
  background: var(--roxo);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.top-menu {
  display: flex;
  gap: 10px;
}

.menu-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
}

.menu-btn.active {
  background: #fff;
  color: var(--roxo);
  font-weight: 600;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================================= CONTAINER GLOBAL ============================================================= */

main {
  max-width: 1250px;
  margin: auto;
  padding: 22px;
}

h1, h2, h3 {
  color: var(--roxo);
  margin-bottom: 12px;
}

/* ============================================================= PÁGINAS ============================================================= */
.page {
  display: none;
  margin-top: 25px;
}

.page:not(.hidden) {
  display: block;
}

.hidden { display: none !important; }

/* ========================= AVISO: LANÇAMENTO BAIXADO ========================= */
.alert-warning {
  background: #fff4e5;
  border: 1px solid #ffcc80;
  color: #8a5a00;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}

/* ============================================================= PAINÉIS / BOXES ============================================================= */

.card-panel, .box {
  background: var(--panel);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

/* =============================================================INPUTS / SELECT ============================================================= */

input, select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--roxo);
}

/* Campos da tela de lançamentos compactos */
#tela-lancamentos input,
#tela-lancamentos select {
  padding: 8px 10px;
  height: 38px;
  font-size: 14px;
}

/* ============================================================= BOTÕES ============================================================= */

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.btn-primary {
  background: var(--roxo);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.btn-secondary {
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px 16px;
  border-radius: 12px;
}

.btn-danger,
.danger {
  background: #e83f5b !important;
  color: #fff !important;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
}

button:hover { opacity: .9; }

/* ============================================================= TABS ============================================================= */

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fff;
}

.tab-btn.active {
  background: var(--roxo);
  color: #fff;
  border-color: var(--roxo);
}

/* ================================ LANÇAMENTOS — RECEITAS x DESPESAS ALINHAMENTO PROFISSIONAL ================================ */

.listas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.listas .box {
  padding: 18px;
  box-sizing: border-box;
  min-width: 0;
}

.listas ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.listas li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 6px;
   font-size: 13px;
}
/* Texto do lançamento (lado esquerdo) */
.listas li > div:first-child {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Área dos botões (lado direito) */
.listas li > div:last-child {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.listas li:nth-child(odd) { background: #fff; }
.listas li:nth-child(even) { background: var(--roxo-claro); }


/* =============================================================ÍCONES PROFISSIONAIS DOS BOTÕES ============================================================= */

.listas button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  height: 28px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.listas button::before { content: none !important; }

/* EDITAR */
.listas button.edit::before {
  content: "";
  width: 14px; height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' fill='%237a4dff' viewBox='0 0 24 24'><path d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM21.41 6.34c.38-.38.38-1.02 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/></svg>");
}

/* EXCLUIR */
.listas button.delete::before {
  content: "";
  width: 14px; height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' fill='%23d93025' viewBox='0 0 24 24'><path d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/></svg>");
}

/* BAIXAR */
.listas button.download::before {
  content: "";
  width: 14px; height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' fill='%231da83a' viewBox='0 0 24 24'><path d='M5 20h14v-2H5v2zm7-18L5.33 9h3.67v4h6V9h3.67L12 2z'/></svg>");
}

/* ============================================================= FILTRO ALINHADO (Período + botão filtrar) ============================================================= */

.filtros-lanc {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.filtros-lanc input,
.filtros-lanc select {
  max-width: 220px;
}

#btn-filtrar-lanc {
  margin-left: 0 !important;
  height: 40px;
}

/* ============================================================= EXTRATO ============================================================= */

.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
}

#table-extrato {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#table-extrato th {
  background: var(--roxo-claro);
  padding: 12px;
  font-weight: 600;
  text-align: left;
}

#table-extrato td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

/* ============================================================= LOGIN PAGE ============================================================= */

.login-wrapper {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
}

.login-box {
  max-width: 380px;
  width: 100%;
  background: var(--panel);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-title {
  margin: 0;
  font-size: 26px;
  color: var(--roxo);
  font-weight: 700;
}

.login-subtitle {
  margin-top: 4px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 16px;
}

.login-box input {
  margin-bottom: 12px;
}

.full {
  width: 100%;
  margin-bottom: 10px;
}

.msg {
  margin-top: 10px;
  font-size: 14px;
  color: red;
}

/* ============================================================= RESPONSIVIDADE ============================================================= */

@media (max-width: 900px) {
  .listas { flex-direction: column; }
  .filtros, .filtros-lanc {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* impedir que BAIXADO quebre linha */
.listas li > div:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;                     /* ocupa todo espaço possível */
  margin-right: 12px;          /* espaço antes dos botões */
}

/* força os botões sempre ficarem na mesma linha */
.listas li > div:last-child {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
}

/* impedir quebra de texto dentro dos botões */
.listas button {
  white-space: nowrap;
}

/* Logo no centro do conteúdo (substitui o título) */
.app-logo-center {
  width: 190px;        /* ajuste conforme preferir */
  display: block;
  margin: 0 auto 25px; /* centraliza e dá espaçamento inferior */
  opacity: 0.95;
}
/* ========================= EXTRATO — CORES ========================= */

/* Crédito (verde) */
.extrato-credito {
  color: #1da83a;
  font-weight: 600;
}

/* Débito (vermelho) */
.extrato-debito {
  color: #d93025;
  font-weight: 600;
}

/* Saldo positivo */
.extrato-saldo-positivo {
  color: #1da83a;
  font-weight: 600;
}

/* Saldo negativo */
.extrato-saldo-negativo {
  color: #d93025;
  font-weight: 600;
}

/* ===================================================== MODAL — IMPLEMENTAÇÃO FINAL E ESTÁVEL ===================================================== */

/* Overlay do modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  background: rgba(0, 0, 0, 0.45);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 99999;
}

/* Conteúdo do modal */
.modal-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 420px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ESCONDER MODAL (regra soberana) */
.modal.hidden {
  display: none !important;
}

/* ========================= (Opcional) Animação leve ========================= */
.modal:not(.hidden) .modal-content {
  animation: modalFadeIn 0.18s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================= LANÇAMENTOS — NOVO LAYOUT ========================= */

.lanc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  margin-top: 16px;
  height: calc(100vh - 180px);
}

/* coluna esquerda (menu + totais) */
.lanc-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* conteúdo principal com scroll */
.lanc-content {
  overflow-y: auto;
  padding-right: 6px;
}

/* totais agora ficam abaixo do menu */
.card-totais {
  position: relative;
}

.lanc-menu {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lanc-menu button {
  background: transparent;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
}

.lanc-menu button.active {
  background: var(--roxo-claro);
  color: var(--roxo);
  font-weight: 600;
}
/* ================================ LANÇAMENTOS — 1 COLUNA ================================ */
   
.listas.single-column {
  display: grid;
  grid-template-columns: 1fr;
}
   
/* ========================= LOADING / PROCESSANDO ======================== */

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #eee;
  border-top: 4px solid #7a4dff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================= CONTAS — CARDS ========================= */

.contas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.conta-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.conta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}

.conta-info strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
  color: #333;
}

.conta-info small {
  display: block;
  font-size: 13px;
  color: #666;
}

.conta-actions {
  margin-top: 12px;
}

.conta-actions button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
}
/* ========================= BOTÃO ADICIONAR CONTA (DESTAQUE) ========================= */

.btn-add-conta {
  background: #16c784;          /* verde moderno */
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 18px;             /* 🔥 espaçamento do menu */
  margin-bottom: 25px;
  box-shadow: 0 6px 18px rgba(22,199,132,0.25);
  transition: all 0.2s ease;
}

.btn-add-conta:hover {
  background: #13b374;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(22,199,132,0.35);
}
/* ========================= LOGIN PREMIUM ========================= */

.login-box {
  max-width: 400px;
  width: 100%;
  background: #ffffff;
  padding: 40px 32px;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  text-align: center;
  transition: transform 0.2s ease;
}

.login-box:hover {
  transform: translateY(-3px);
}

.login-title {
  font-size: 24px;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: #777;
  margin-bottom: 24px;
}
/* ========================= LOGIN LOGO CLEAN ========================= */

.login-logo-clean {
  width: 180px;
  margin: 0 auto 25px;
  display: block;
}

/* ================= MODAL SIGNUP ================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: #fff;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

