:root {
  --bg: #0a0a0a;
  --bg-card: #111;
  --bg-input: #1a1a1a;
  --border: #2a2a2a;
  --text: #fff;
  --text-muted: #888;
  --primary: #10b981;
}

body.light {
  --bg: #f5f5f5;
  --bg-card: #fff;
  --bg-input: #f0f0f0;
  --border: #e5e5e5;
  --text: #0a0a0a;
  --text-muted: #666;
  --primary: #059669;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.screen { min-height: 100vh; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#login-screen h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

input {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
}

input:focus {
  outline: none;
  border-color: var(--primary);
}

button {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

button:active { transform: scale(0.97); }
button.secondary { background: var(--border); color: var(--text); margin-top: 8px; }

header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

header h2 { font-size: 1.25rem; }
#user-email { font-size: 0.75rem; color: var(--text-muted); }

.header-actions {
  display: flex;
  gap: 8px;
}

.header-actions button,
#btn-tema,
#btn-tema-perfil,
#btn-sair,
#btn-sair-perfil {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text);
  width: auto;
  cursor: pointer;
}

.header-actions button:hover,
#btn-tema:hover,
#btn-tema-perfil:hover,
#btn-sair:hover,
#btn-sair-perfil:hover {
  background: var(--bg-input);
}

.card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.saldo p { 
  color: var(--text-muted); 
  font-size: 0.875rem; 
}
.saldo h3 { 
  font-size: 2rem; 
  margin: 8px 0; 
}

.grupo-info { 
  font-size: 0.75rem; 
  color: var(--text-muted);
  word-break: break-all;
  overflow-wrap: break-word;
}

.grupo-info span {
  font-family: monospace;
  color: var(--primary);
  display: inline-block;
  max-width: 100%;
}

.tipo-botoes {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tipo-btn {
  flex: 1;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tipo-btn.ativo {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#btn-despesa.ativo {
  background: #ef4444;
  border-color: #ef4444;
}

#btn-receita.ativo {
  background: #22c55e;
  border-color: #22c55e;
}

.lista { 
  margin-bottom: 80px; 
}

.item {
  background: var(--bg-card);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-info p:first-child { 
  font-weight: 500; 
}

.item-info p:last-child { 
  font-size: 0.75rem; 
  color: var(--text-muted); 
}

.item-valor { 
  font-weight: 700; 
}

.positivo { 
  color: #22c55e; 
}

.negativo { 
  color: #ef4444;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
}

.bottom-nav button {
  background: none;
  width: auto;
  padding: 8px 20px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.bottom-nav button.active { 
  color: var(--primary); 
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.modal-content {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
}

.modal-content h3 { 
  margin-bottom: 16px; 
}

.codigo-box {
  background: var(--bg-input);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 12px 0;
  color: var(--primary);
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
  cursor: pointer;
  transition: opacity 0.2s;
}

.codigo-box:hover {
  opacity: 0.8;
}

.saldo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.filtro-mes {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.resumo-mes {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.resumo-item {
  flex: 1;
}

.resumo-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.resumo-item span {
  font-weight: 700;
  font-size: 1.1rem;
}

.item-acoes {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-excluir {
  background: none;
  border: none;
  width: auto;
  padding: 4px 8px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.btn-excluir:hover {
  opacity: 1;
}

.btn-excluir:active {
  transform: scale(0.9);
}

/* Landing Page */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

.landing-header {
  padding: 20px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-header .logo {
  width: 40px;
  height: 40px;
}

.landing-header h1 {
  font-size: 1.5rem;
}

.btn-login-topo {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.landing-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero h2 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 16px 40px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.btn-cta:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  padding: 60px 20px;
}

.feature {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.feature h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.feature p {
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .hero h2 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

.erro {
  color: #ef4444;
  font-size: 0.9rem;
  margin: 8px 0;
  padding: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  text-align: center;
}

#solicitacoes-pendentes {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

#solicitacoes-pendentes h4 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text);
}

.solicitacao {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}

.solicitacao span {
  font-size: 14px;
  color: var(--text);
}

.solicitacao div {
  display: flex;
  gap: 8px;
}

.btn-aprovar, .btn-rejeitar {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: auto;
}

.btn-aprovar {
  background: #22c55e;
  color: white;
}

.btn-rejeitar {
  background: #ef4444;
  color: white;
}

.modo-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 16px 0 16px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.modo-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.modo-btn.ativo {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-of-type {
  margin-top: 0;
}

input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.sucesso {
  color: #22c55e;
  font-size: 14px;
  margin-bottom: 12px;
}

.perfil-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}

.avatar-inicial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-offline {
  font-size: 11px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 4px;
  text-align: center;
}

.bottom-nav button {
  background: none;
  width: auto;
  padding: 8px 20px;
  color: var(--text-muted);
  font-size: 0.875rem;
  border: none;
  transition: color 0.2s;
  cursor: pointer;
}

.bottom-nav button.active { 
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--primary);

}
.termos-box {
  margin: 16px 0;
  font-size: 0.875rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: auto;
  cursor: pointer;
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

.termos-texto {
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 16px 0;
}

.termos-texto p {
  margin-bottom: 16px;
}

.termos-texto strong {
  color: var(--text);
}

