/* --- GERAL E VARIÁVEIS --- */
:root {
  --header-blue: #005b96;
  --yellow: #ffc107;
  --green: #388e3c;
  --grey-light: #f4f4f4;
  --grey-text: #555;
  --card-shadow: 0 2px 10px rgba(0, 91, 150, 0.08);
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: var(--grey-light);
  color: #333;
}

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

.hidden {
  display: none !important;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.btn {
  background: var(--header-blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
  box-sizing: border-box;
}

.btn:hover:not(:disabled) {
  background: #004472;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
}

.btn-secondary {
  background: #aaa;
}
.btn-secondary:hover {
  background: #888;
}

.emoji {
  margin-right: 8px;
}

/* --- CABEÇALHO --- */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header-blue);
  color: #fff;
  padding: 12px 24px;
  box-shadow: var(--card-shadow);
}
.logo { font-size: 22px; font-weight: bold; }
nav a { color: #fff; text-decoration: none; margin-left: 20px; font-weight: bold; }
nav a:hover { color: var(--yellow); }

/* --- LOGIN --- */
.login-btn {
  display: block;
  max-width: 300px;
  margin: 60px auto;
}

/* --- PAINEL PRINCIPAL --- */
#loadingIndicator { text-align: center; font-size: 18px; color: var(--grey-text); padding: 40px; }
#dashboardContent { display: flex; flex-direction: column; }

/* --- 1. DASHBOARD RESUMO --- */
#dashboard-resumo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.user-info { display: flex; align-items: center; gap: 16px; }
.user-avatar { font-size: 48px; background: #e2f1fa; border-radius: 50%; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; }
.user-details { display: flex; flex-direction: column; }
.user-nome { font-size: 22px; font-weight: bold; color: var(--header-blue); }
.user-email { font-size: 14px; color: var(--grey-text); }

.patrimonio-info { display: flex; gap: 24px; text-align: right; }
.patrimonio-item { display: flex; flex-direction: column; }
.patrimonio-item .label { font-size: 14px; color: var(--grey-text); margin-bottom: 4px; }
.patrimonio-item .valor { font-size: 24px; font-weight: bold; }
.patrimonio-item .saldo { color: var(--green); }
.patrimonio-item .investido { color: var(--header-blue); }
.patrimonio-item .patrimonio { color: #333; }

/* --- 2. AÇÕES RÁPIDAS --- */
#acoes-rapidas {
  display: flex;
  gap: 32px;
}
.acao-coluna {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.acao-coluna h3 {
  margin-top: 0;
  color: var(--header-blue);
  font-size: 20px;
  display: flex;
  align-items: center;
}
.input-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.input-group label {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 6px;
}
.input-group input {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.investir-desc {
  color: var(--grey-text);
  flex-grow: 1;
}
.btn-investir {
  margin-top: 12px;
}

/* --- AUTOCOMPLETE SUGESTÕES --- */
.autocomplete { position: relative; }
.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}
.autocomplete-items div:last-child { border-bottom: none; }
.autocomplete-items div:hover { background-color: #e9e9e9; }

/* --- 3. CENTRO DE NOTIFICAÇÕES --- */
#centro-notificacoes h3 { margin-top: 0; color: var(--header-blue); font-size: 20px; display: flex; align-items: center; }
#listaNotificacoes {
  max-height: 300px;
  overflow-y: auto;
}
.notificacao-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
  gap: 12px;
}
.notificacao-item:last-child { border-bottom: none; }
.notificacao-item.nao-lida {
  background-color: #e7f4fa;
  border-left: 4px solid var(--header-blue);
  font-weight: bold;
}
.notificacao-icone { font-size: 24px; }
.notificacao-texto { flex-grow: 1; }
.notificacao-acao button {
  padding: 6px 12px;
  font-size: 14px;
  min-width: 80px;
}
.sem-notificacoes {
  text-align: center;
  color: var(--grey-text);
  padding: 20px;
}

/* --- MODAIS --- */
.modal-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  text-align: center;
}
.modal-content h3 { margin-top: 0; }
.modal-botoes {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 900px) {
  .container { margin: 24px auto; }
  #acoes-rapidas { flex-direction: column; }
  .patrimonio-info { justify-content: flex-start; margin-top: 20px; }
}

@media (max-width: 600px) {
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  nav { width: 100%; display: flex; justify-content: space-around; }
  nav a { margin: 0; }

  #dashboard-resumo { flex-direction: column; align-items: flex-start; gap: 16px; }
  .patrimonio-info { width: 100%; justify-content: space-between; text-align: left; }
  .patrimonio-item .valor { font-size: 20px; }
  
  .card { padding: 16px; }
}