:root{
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* ===== Tema claro (Gêmeas) ===== */
  --bg: #fff2f8;
  --bg2: #ffe8f3;

  --panel: rgba(255,255,255,0.82);
  --panel-2: rgba(255,255,255,0.92);

  --text: rgba(36, 17, 47, 0.92);
  --muted: rgba(36, 17, 47, 0.72);
  --muted-2: rgba(36, 17, 47, 0.55);

  --primary: #ff4da6;
  --primary-2: #a855f7;
  --danger: #ff3d6f;
  --ok: #29c38a;
  --warn: #ffb84d;

  --border: rgba(255,77,166,0.22);
  --border-strong: rgba(255,77,166,0.32);

  --shadow: 0 18px 55px rgba(255,77,166,0.14), 0 10px 24px rgba(0,0,0,0.06);
  --shadow-soft: 0 10px 28px rgba(255,77,166,0.10), 0 8px 18px rgba(0,0,0,0.05);

  --radius: 22px;
  --radius-sm: 16px;

  --ring: 0 0 0 3px rgba(255,77,166,0.16);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);

  background:
    radial-gradient(900px 520px at 16% 6%, rgba(255,77,166,0.18), transparent 62%),
    radial-gradient(980px 560px at 88% 10%, rgba(168,85,247,0.14), transparent 64%),
    radial-gradient(920px 560px at 60% 98%, rgba(255,184,220,0.28), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Links */
a{ color: inherit; }
a:hover{ opacity: 0.92; }

/* ===== Topbar ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);

  background: rgba(255, 234, 245, 0.82);
  backdrop-filter: blur(10px);
}
.topbar-inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}
.brand-icon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-soft);
}
.brand-logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-soft);
}
.brand-text{
  display:flex;
  flex-direction:column;
  line-height: 1.05;
  min-width: 0;
}
.brand-text strong{
  font-weight: 900;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text span{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Container / Grid ===== */
.container{
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}
.grid{
  display:grid;
  gap: 16px;
}
.grid-2{
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 980px){
  .grid-2{ grid-template-columns: 1fr; }
}
.row{ display:flex; gap: 12px; flex-wrap: wrap; }
.row-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.row-4{ display:grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 980px){
  .row-2{ grid-template-columns: 1fr; }
  .row-3{ grid-template-columns: 1fr; }
  .row-4{ grid-template-columns: 1fr; }
}

/* ===== Typography ===== */
.h1{
  font-size: 24px;
  margin: 0 0 6px 0;
  font-weight: 900;
}
.h2{
  font-size: 18px;
  margin: 0 0 8px 0;
  font-weight: 850;
}
.sub{
  margin: 0;
  color: var(--muted);
}
.small{
  font-size: 12px;
  color: var(--muted);
}
.label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ===== Cards ===== */
.card{
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0; /* importante pro grid não “apertar” o lado direito */
}
.card .card{
  box-shadow: none;
  background: rgba(255,255,255,0.70);
}

/* ===== Inputs ===== */
input:not([type=checkbox]):not([type=radio]):not([type=file]),
.input,
select,
textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,77,166,0.26);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  box-shadow: 0 6px 16px rgba(255,77,166,0.06);
}
textarea{ min-height: 92px; resize: vertical; }

input::placeholder,
textarea::placeholder{
  color: rgba(36,17,47,0.40);
}

input:focus,
select:focus,
textarea:focus{
  border-color: rgba(255,77,166,0.46);
  box-shadow: var(--ring);
}

input[disabled], select[disabled], textarea[disabled]{
  opacity: 0.7;
  cursor: not-allowed;
}

/* Checkbox */
input[type=checkbox]{
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,77,166,0.28);
  background: rgba(255,255,255,0.78);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease, opacity .12s ease;
}
.btn:hover{
  border-color: rgba(255,77,166,0.40);
  box-shadow: 0 14px 34px rgba(255,77,166,0.14), 0 10px 18px rgba(0,0,0,0.05);
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: linear-gradient(135deg, rgba(255,77,166,0.96), rgba(168,85,247,0.90));
  color: white;
  border-color: rgba(255,77,166,0.36);
}
.btn-danger{
  background: linear-gradient(135deg, rgba(255,61,111,0.96), rgba(255,77,166,0.86));
  color: white;
  border-color: rgba(255,61,111,0.36);
}
.btn-ghost{
  background: rgba(255,255,255,0.62);
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,77,166,0.22);
  background: rgba(255,255,255,0.70);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}
.pill:hover{
  border-color: rgba(255,77,166,0.36);
}
.pill.active{
  background: linear-gradient(135deg, rgba(255,77,166,0.20), rgba(168,85,247,0.16));
  border-color: rgba(255,77,166,0.38);
}

/* ===== Alerts ===== */
.alert{
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,77,166,0.25);
  background: rgba(255,77,166,0.08);
  color: rgba(36,17,47,0.92);
  box-shadow: var(--shadow-soft);
}
.alert.success{
  border-color: rgba(41,195,138,0.28);
  background: rgba(41,195,138,0.10);
}

/* ===== Tables ===== */
.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
}
.table th, .table td{
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,77,166,0.14);
  color: var(--text);
}
.table th{
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: none;
  color: rgba(36,17,47,0.78);
  background: rgba(255,77,166,0.08);
}
.table tr:last-child td{ border-bottom: none; }

/* ===== KPIs / Progress ===== */
.kpis{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 980px){
  .kpis{ grid-template-columns: 1fr; }
}
.kpi{
  border: 1px solid rgba(255,77,166,0.22);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.74);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.kpi .k{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi .v{
  font-size: 22px;
  font-weight: 950;
}

.progress{
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,77,166,0.08);
  border: 1px solid rgba(255,77,166,0.18);
}
.progress > div{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,77,166,0.95), rgba(168,85,247,0.82));
}

/* ===== Tabs ===== */
.tabs{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,77,166,0.22);
  background: rgba(255,255,255,0.70);
  font-weight: 850;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.tab:hover{ border-color: rgba(255,77,166,0.36); }
.tab.active{
  background: linear-gradient(135deg, rgba(255,77,166,0.18), rgba(168,85,247,0.14));
  border-color: rgba(255,77,166,0.36);
}

/* ===== Summary Card (Resumo do mês) ===== */
/* objetivo: metade/metade no topo e não “roubar” espaço do lançamento */
.summary-card .summary-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.summary-card .summary-title{ margin: 0 0 2px 0; }
.summary-card .summary-filters{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0; /* remove trava que empurrava o layout */
}
.summary-card .summary-filters > div{ min-width: 0; }
.summary-card .summary-filters select{ min-width: 0; }

.summary-hero{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 190px 1fr; /* compacto para liberar espaço ao card de lançamento */
  gap: 12px;
  align-items: stretch;
}
@media (max-width: 980px){
  .summary-hero{ grid-template-columns: 1fr; }
}

.summary-twins{
  border-radius: var(--radius);
  border: 1px solid rgba(255,77,166,0.22);
  background: rgba(255,255,255,0.72);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}
.summary-twins img{
  width: 100%;
  max-width: 190px;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,77,166,0.18);
  background: rgba(255,255,255,0.86);
}

.summary-right{
  display:grid;
  gap: 12px;
  min-width: 0;
}
.summary-humor{
  border-radius: var(--radius);
  border: 1px solid rgba(255,77,166,0.18);
  background: rgba(255,255,255,0.70);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}
.summary-humor-title{
  font-weight: 950;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}
.summary-kpis{
  gap: 10px;
}
.summary-kpis .kpi{
  padding: 10px;
}

/* ===== Metas ===== */
.goals-list{ display:grid; gap: 14px; }
.goal-card{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;

  border: 1px solid rgba(255,77,166,0.22);
  background: rgba(255,255,255,0.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
@media (max-width: 980px){
  .goal-card{ grid-template-columns: 1fr; }
}
.goal-title{
  font-weight: 950;
  font-size: 18px;
  margin: 0;
}
.goal-sub{
  margin-top: 4px;
  color: var(--muted);
}
.goal-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,77,166,0.22);
  background: rgba(255,77,166,0.08);
  font-weight: 850;
  font-size: 12px;
}
.goal-bar{
  height: 10px;
  border-radius: 999px;
  overflow:hidden;
  border: 1px solid rgba(255,77,166,0.18);
  background: rgba(255,77,166,0.08);
  margin-top: 10px;
}
.goal-bar-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,77,166,0.95), rgba(168,85,247,0.82));
}

/* ===== Footer note ===== */
.footer-note{
  text-align:center;
  color: var(--muted);
  font-size: 12px;
  padding: 14px 0 28px;
}

/* ===== Ajustes finos (tema claro + layout topo) ===== */

/* 1) Corrige “ovais vazios” (alerts) e qualquer placeholder escondido */
.hidden{ display: none !important; }
.alert:empty{ display: none !important; }

/* 2) Topbar menor (Metas/Configurações/Sair menos “grandes”) */
.topbar-inner{
  padding: 10px 14px !important;
  gap: 10px !important;
}
.nav{
  gap: 8px !important;
}
.pill{
  padding: 7px 12px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}
.brand{
  gap: 10px !important;
}
.brand-badge{
  width: 30px !important;
  height: 30px !important;
  border-radius: 12px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid var(--border) !important;
  background: rgba(255,255,255,0.86) !important;
  box-shadow: var(--shadow-soft) !important;
}
.brand > div{
  display: flex !important;
  flex-direction: column !important;
  line-height: 1.05 !important;
}
.brand > div small{
  margin-top: 4px !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}

/* 3) Garantia do 50/50 no topo (Resumo x Novo lançamento) */
.grid-2{
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}
.grid > *{ min-width: 0 !important; }

/* 4) Resumo do mês: HUMOR em cima, GÊMEAS gigante no meio, KPIs embaixo
      (sem mexer no HTML: usamos display:contents para “soltar” os filhos) */
.summary-hero{
  grid-template-columns: 1fr !important;
  grid-template-rows: auto 1fr auto !important;
  gap: 12px !important;
  min-height: 360px; /* dá espaço pra imagem crescer */
}
.summary-right{
  display: contents !important; /* permite reordenar sem alterar HTML */
}

/* HUMOR (fininho) */
.summary-humor{
  grid-row: 1 !important;
  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px 10px !important;
}
.summary-humor-title{
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 950 !important;
}

/* “Neutra • 0,0%” na MESMA LINHA do título */
#pandaText{
  margin: 0 !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}

/* Barra ocupa a linha de baixo (baixa e discreta) */
.summary-humor .progress{
  flex-basis: 100% !important;
  margin-top: 6px !important;
  height: 9px !important;
}

/* Remove a linha “Barra: 0% a 200% …” */
.summary-humor .progress + .small{
  display: none !important;
}

/* GÊMEAS (ocupa o espaço “sobrando”) */
.summary-twins{
  grid-row: 2 !important;
  align-self: stretch !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px !important;
}
.summary-twins img{
  max-width: 320px !important;
  width: 100% !important;
  height: auto !important;
}

/* KPIs embaixo (mais baixos) */
.summary-kpis{
  grid-row: 3 !important;
  margin-top: 0 !important;
  gap: 10px !important;
}
.summary-kpis .kpi{
  padding: 10px !important;
}
.summary-kpis .kpi .v{
  font-size: 20px !important;
}

/* 5) Selects: melhora visual do controle (dropdown nativo continua nativo) */
select{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(36,17,47,0.55) 50%),
    linear-gradient(135deg, rgba(36,17,47,0.55) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  padding-right: 36px !important;
}

/* opcional: melhora o contraste do menu em alguns browsers */
select option{
  color: rgba(36,17,47,0.92);
}
/* ===== Fix: impedir grid estourar e “apertar” o card do lançamento ===== */
.grid > *{ min-width: 0; }

/* ===== Ajuste topo: Resumo 50/50 + KPIs ao lado + esconder seletor mês/ano ===== */

/* 1) Topo (grid) - garantir mesmo tamanho dos 2 cards */
main.container > .grid.grid-2{
  align-items: stretch !important;
}
main.container > .grid.grid-2 > .card{
  height: 100% !important;
  min-height: 420px; /* ajuste fino se quiser mais/menos */
}

/* 2) Esconder seletor de Ano/Mês do card Resumo do mês */
.summary-card .summary-filters{
  display: none !important;
}

/* 3) Reorganizar o conteúdo do Resumo do mês sem mexer no HTML */
.summary-hero{
  /* 2 colunas: Gêmeas (esq) + KPIs (dir) */
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  grid-template-rows: auto 1fr !important;
  gap: 12px !important;
  align-items: stretch !important;
}

/* “solta” os filhos da summary-right pra gente posicionar com grid */
.summary-right{
  display: contents !important;
}

/* Humor fica em cima ocupando as 2 colunas */
.summary-humor{
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;

  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px 10px !important;
}

/* Título + status na mesma linha */
.summary-humor-title{
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 950 !important;
}
#pandaText{
  margin: 0 !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}

/* Barra logo abaixo (baixinha) */
.summary-humor .progress{
  flex-basis: 100% !important;
  margin-top: 6px !important;
  height: 9px !important;
}

/* Remove a linha “Barra: 0% a 200% ...” */
.summary-humor .progress + .small{
  display: none !important;
}

/* Gêmeas à esquerda (um pouco menor do que estava) */
.summary-twins{
  grid-column: 1 !important;
  grid-row: 2 !important;

  padding: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.summary-twins img{
  max-width: 240px !important; /* aqui controla o tamanho */
  width: 100% !important;
  height: auto !important;
}

/* KPIs à direita, um embaixo do outro */
.summary-kpis{
  grid-column: 2 !important;
  grid-row: 2 !important;

  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  align-content: start !important;
}

/* KPIs mais “baixos” (menos altura) */
.summary-kpis .kpi{
  padding: 10px 12px !important;
}
.summary-kpis .kpi .v{
  font-size: 20px !important;
}

/* 4) Em telas menores, volta a empilhar (não quebra) */
@media (max-width: 980px){
  main.container > .grid.grid-2 > .card{
    min-height: auto;
  }

  .summary-hero{
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
  }

  .summary-twins{
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .summary-kpis{
    grid-column: 1 !important;
    grid-row: 3 !important;
    grid-template-columns: 1fr 1fr 1fr !important;
  }
}
/* ===== Opção A: Ano/Mês no header do Resumo (canto direito) ===== */

/* Remove o texto "Mar / 2026" (mês/ano por texto) */
#monthLabel{
  display: none !important;
}

/* Reexibe e compacta os selects (Ano/Mês) no header */
.summary-card .summary-head{
  align-items: center !important;
}

.summary-card .summary-filters{
  display: flex !important;          /* sobrescreve o display:none antigo */
  gap: 10px !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  margin-left: auto !important;
}

.summary-card .summary-filters > div{
  width: 98px; /* tamanho compacto */
  min-width: 0;
}

.summary-card .summary-filters .label{
  margin: 0 0 6px 4px !important;
}

.summary-card .summary-filters select{
  padding: 9px 36px 9px 12px !important;
  border-radius: 999px !important;
  font-weight: 800;
}

/* ===== Altura igual SOMENTE no topo ===== */
main.container > .grid.grid-2.top-row{
  align-items: stretch !important;
}

main.container > .grid.grid-2.top-row > .card{
  height: 100% !important;
  min-height: 420px !important; /* ajuste fino se quiser */
}

/* Cards abaixo NÃO herdam altura do topo (para não ficarem quadradões) */
main.container > .grid.grid-2:not(.top-row){
  align-items: start !important;
}

main.container > .grid.grid-2:not(.top-row) > .card{
  height: auto !important;
  min-height: unset !important;
}
/* ===== Ajustes finos: alturas + espaçamentos + selects ===== */

/* 1) Resumo: KPIs com altura total igual ao card das Gêmeas */
.summary-hero{
  align-items: stretch !important;
}

.summary-twins{
  height: 100% !important;
}

.summary-kpis{
  height: 100% !important;
  grid-auto-rows: 1fr !important;     /* 3 itens dividem igualmente */
  align-content: stretch !important;
}

.summary-kpis .kpi{
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

/* 2) Novo lançamento: mais “respiro” e ocupar melhor a altura */
.card h1 + p,
.card h2 + p{
  margin-bottom: 14px !important;
}

#txForm{
  display: flex;
  flex-direction: column;
  gap: 14px; /* aumenta espaçamento geral dentro do card */
}

#txForm .row-3,
#txForm .row-4,
#txForm .row-2{
  gap: 14px !important;
}

#txForm .btn{
  margin-top: 4px;
}

/* Se tiver uma linha “alert/placeholder” vazia no card, some */
#txForm .alert:empty{ display:none !important; }

/* 3) Selects: deixar mais bonitos (controle) */
select{
  border-color: rgba(255,77,166,0.30) !important;
  box-shadow: 0 6px 16px rgba(255,77,166,0.07) !important;
  transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease;
}

select:hover{
  border-color: rgba(255,77,166,0.44) !important;
}

select:focus{
  border-color: rgba(255,77,166,0.55) !important;
  box-shadow: 0 0 0 3px rgba(255,77,166,0.16), 0 10px 20px rgba(255,77,166,0.10) !important;
}

/* Dropdown nativo: melhora mínima em alguns browsers */
select option{
  padding: 8px 10px;
}
/* KPIs (Entradas / Saídas / Comprometimento) um pouco maiores */
.kpi .v{
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.kpi .k{
  font-size: 13px;
}

/* ===== Mobile: empilhar cards na ordem desejada ===== */
@media (max-width: 980px){
  /* transformar os grids em “fluxo” e ordenar */
  .grid-2{
    grid-template-columns: 1fr !important;
  }

  /* Topo */
  .top-row > .card:nth-child(1){ order: 1; } /* Resumo do mês */
  .top-row > .card:nth-child(2){ order: 2; } /* Novo lançamento */

  /* Segundo grid (onde ficam gastos e últimas) */
  main.container > .grid.grid-2:not(.top-row){
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Aqui depende da ordem atual no HTML:
     Pelo teu print, “Gastos por categoria” está à esquerda e “Últimas entradas” à direita.
     Então invertemos no mobile: Últimas primeiro, depois Gastos. */
  main.container > .grid.grid-2:not(.top-row) > .card:nth-child(1){ order: 4; } /* Gastos por categoria */
  main.container > .grid.grid-2:not(.top-row) > .card:nth-child(2){ order: 3; } /* Últimas entradas */

  /* “Despesas do mês” normalmente vem depois como card grande -> fica por último */
  .card.expenses-card{ order: 5; } /* se existir essa classe, melhor */
}

/* ===== Ajuste cirúrgico: coluna direita do topo + card Total ===== */
main.container > .grid.grid-2.top-row{
  align-items: start !important;
}

main.container > .grid.grid-2.top-row > .card{
  height: auto !important;
  min-height: unset !important;
}

.top-right-col{
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.launch-card{
  height: auto !important;
  min-height: unset !important;
}

.total-card{
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 116px;
}

.total-card .k{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.total-card .v{
  font-size: 30px;
  font-weight: 950;
  line-height: 1.05;
}

.total-card .v.is-negative{
  color: var(--danger);
}

#txForm{
  gap: 12px !important;
}

#txForm .row-3,
#txForm .row-4,
#txForm .row-2{
  gap: 12px !important;
}

#txForm .btn{
  margin-top: 0 !important;
}

@media (max-width: 980px){
  .top-row > .summary-card{
    order: 1;
  }

  .top-row > .top-right-col{
    order: 2;
  }

  .top-right-col{
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
}

/* =========================================================
   PATCH RESPONSIVO CIRÚRGICO - DASHBOARD / CONFIG
   COLAR NO FINAL DO style.css
   ========================================================= */

@media (max-width: 768px) {
  /* largura padrão e alinhamento geral */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .top-row,
  .grid.grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .summary-card,
  .top-right-col,
  .launch-card,
  .total-card,
  #lastIncomeWrap,
  #txTableWrap,
  .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* resumo do mês */
  .summary-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .summary-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .summary-hero {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .summary-twins {
    width: 100% !important;
  }

  .summary-twins img,
  #pandaImg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
  }

  .summary-right {
    width: 100% !important;
    min-width: 0 !important;
  }

  .summary-kpis,
  .kpis.summary-kpis {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .summary-kpis .kpi,
  .kpis.summary-kpis .kpi {
    min-width: 0 !important;
    padding: 12px !important;
  }

  .summary-kpis .kpi .k,
  .kpis.summary-kpis .kpi .k {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  .summary-kpis .kpi .v,
  .kpis.summary-kpis .kpi .v,
  #kpiIncome,
  #kpiExpense,
  #kpiCommit,
  #kpiBalance {
    font-size: 0.95rem !important;
    line-height: 1.15 !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .summary-title,
  .h1.summary-title {
    font-size: 1.6rem !important;
    line-height: 1.1 !important;
  }

  .summary-humor-title {
    font-size: 1.05rem !important;
  }

  /* coluna da direita */
  .top-right-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .launch-card,
  .total-card {
    margin: 0 !important;
  }

  /* formulário novo lançamento */
  .launch-card .row.row-3,
  .launch-card .row.row-2,
  #expenseFields .row.row-3,
  #incomeFields .row.row-2 {
    grid-template-columns: 1fr !important;
  }

  .launch-card .btn.btn-primary,
  #txForm .btn.btn-primary {
    width: 100% !important;
  }

  /* tabelas com rolagem horizontal em vez de estourar layout */
  #lastIncomeWrap,
  #txTableWrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #lastIncomeWrap .table,
  #txTableWrap .table {
    min-width: 760px !important;
  }

  /* textos grandes demais no mobile */
  .h1 {
    font-size: 1.6rem !important;
    line-height: 1.1 !important;
  }

  .h2 {
    font-size: 1.2rem !important;
    line-height: 1.2 !important;
  }

  .sub,
  .small,
  .label,
  .table th,
  .table td {
    font-size: 12px !important;
  }

  /* mobile mais vibrante sem desmontar tema */
  body {
    background:
      linear-gradient(180deg, rgba(255, 214, 235, 0.55), rgba(255, 198, 230, 0.72)) !important;
  }

  .card {
    background: rgba(255, 247, 252, 0.94) !important;
    border-color: rgba(255, 150, 205, 0.24) !important;
  }
}

/* desktop e mobile: botões Editar / Excluir menores */
.actions .btn,
.table .actions .btn,
#lastIncomeWrap .actions .btn,
#txTableWrap .actions .btn,
button[data-edit].btn,
button[data-del].btn,
a.btn.btn-ghost,
button.btn.btn-danger {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  border-radius: 16px !important;
  min-width: 72px !important;
  width: auto !important;
}

/* ações das tabelas mais compactas */
.table td .actions,
#lastIncomeWrap td .actions,
#txTableWrap td .actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  align-items: flex-start !important;
}

/* desktop: impede total do mês muito estreito ou desalinhado */
.top-right-col .total-card {
  width: 100% !important;
}

/* desktop: reduz um pouco os botões também */
@media (min-width: 769px) {
  .actions .btn,
  .table .actions .btn,
  #lastIncomeWrap .actions .btn,
  #txTableWrap .actions .btn,
  button[data-edit].btn,
  button[data-del].btn,
  a.btn.btn-ghost,
  button.btn.btn-danger {
    min-height: 34px !important;
    height: 34px !important;
    padding: 0 13px !important;
    font-size: 12px !important;
    min-width: 76px !important;
  }
}