/* =========================================================
       1. VARIÁVEIS GERAIS (Design System)
    ========================================================= */
:root {
  --bg-body: #f4f7fe;
  --bg-card: #ffffff;
  --text-primary: #2b3674;
  --text-secondary: #a3aed0;

  --primary-color: #4318ff;
  --primary-hover: #3311db;
  --accent-green: #05cd99;
  --accent-orange: #ffb547;
  --accent-red: #ee5d50;

  --shadow-soft: 0px 3px 15px rgba(112, 144, 176, 0.08);
  --shadow-hover: 0px 8px 25px rgba(112, 144, 176, 0.15);
  --radius-card: 20px;
  --radius-btn: 12px;
}

/* =========================================================
       2. BASE E SCROLLBARS globais
    ========================================================= */
body {
  background-color: var(--bg-body);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.hidden {
  display: none !important;
}

.cursor-pointer {
  cursor: pointer;
}

.hover-shadow {
  transition: all 0.3s ease-in-out;
}

.hover-shadow:hover {
  box-shadow: var(--shadow-hover) !important;
  transform: translateY(-3px);
}

/* =========================================================
       3. TELA DE LOGIN RESPONSIVA
    ========================================================= */
.login-container {
  background: linear-gradient(135deg, var(--primary-color) 0%, #868CFF 100%);
  background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%),
    linear-gradient(135deg, var(--primary-color) 0%, #868CFF 100%);
}

.login-card {
  border-radius: var(--radius-card);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
       4. LAYOUT DO DASHBOARD & CARDS
    ========================================================= */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out forwards;
}

.card-modern {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: none;
  box-shadow: var(--shadow-soft);
  padding: 20px;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .card-modern {
    padding: 24px;
  }
}

/* =========================================================
       5. COMPONENTES: KPIs E STATUS
    ========================================================= */
.stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.1;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

@media (min-width: 768px) {
  .stat-icon {
    width: 54px;
    height: 54px;
    font-size: 1.6rem;
  }
}

/* =========================================================
       6. TABELAS RESPONSIVAS E BOTÕES
    ========================================================= */
.table-modern {
  margin-bottom: 0;
}

.table-modern thead th {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e9edf7;
  padding: 12px;
  white-space: nowrap;
}

.table-modern tbody td {
  padding: 12px;
  vertical-align: middle;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f3f8;
  white-space: nowrap;
  /* Evita quebrar o texto no celular */
}

.btn-modern-primary {
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--radius-btn);
  font-weight: 600;
  border: none;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-modern-primary:hover,
.btn-modern-primary:focus {
  background-color: var(--primary-hover);
  color: white;
}

.btn-modern-primary:active {
  transform: scale(0.97);
}

.modal-content {
  border-radius: var(--radius-card);
  border: none;
}

/* =========================================================
       7. AJUSTES MOBILE E BOTÕES FLUTUANTES (FAB)
    ========================================================= */

/* Garante que o menu suspenso (dropdown) fique sempre acima de tudo */
.dropdown-menu {
  z-index: 1060 !important;
}

/* Container dos botões flutuantes no canto inferior direito */
.fab-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1050;
}

/* Estilo dos botões flutuantes */
.fab-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab-btn:active {
  transform: scale(0.9);
}

.fab-income {
  background-color: var(--accent-green);
}

.fab-expense {
  background-color: var(--accent-red);
}

/* Dá um respiro no final da página para os botões não cobrirem a tabela */
#view-dashboard {
  padding-bottom: 90px !important;
}


/* Ajuste para o Tom Select não ficar atrás do Modal */
.ts-dropdown {
  z-index: 1090 !important;
}