/* =========================================================
   ZynoCash - CSS Principal
   Paleta: Verde #28a745 | Verde claro #20c997 | Branco #FFFFFF
   ========================================================= */

:root {
  --dc-green: #28a745;
  --dc-green-dark: #1e7e34;
  --dc-green-light: #20c997;
  --dc-green-bg: #eafaf1;
  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
  --topbar-height: 56px;
  --border-radius: 12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --transition: all 0.25s ease;
}

/* ─── Reset & Base ─────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4faf6;
  color: #2d3748;
  font-size: 0.9rem;
  margin: 0;
  overflow-x: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--dc-green) 0%, var(--dc-green-dark) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.9);
}

.brand-text {
  font-size: 1.1rem;
  font-weight: 400;
  color: white;
  letter-spacing: -0.5px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

.user-name {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
}

.user-email {
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-title {
  color: rgba(255,255,255,0.4);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: var(--transition);
  border-radius: 8px;
  margin: 2px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 16px);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.2);
  color: white;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
  color: rgba(255,255,255,0.6) !important;
}

.logout-btn:hover {
  background: rgba(220,53,69,0.3) !important;
  color: #ff6b6b !important;
}

/* ─── Overlay mobile ────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.active { display: block; }

/* ─── Main content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

/* ─── Topbar ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  color: #6c757d;
  padding: 4px 8px;
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
}

.topbar-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  color: #2d3748;
}

/* ─── Page content ──────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px 20px;
  max-width: 1200px;
  width: 100%;
}

/* ─── Page header ───────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-info { line-height: 1.3; }

/* ─── Stat Cards ────────────────────────────────────────── */
.stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e8f5e9;
  transition: var(--transition);
  height: 100%;
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--dc-green);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Card ZynoCash ──────────────────────────────────────── */
.card-nu {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid #e8f5e9;
  overflow: hidden;
}

.card-nu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.card-nu-header h6 { margin: 0; font-weight: 600; font-size: 0.875rem; }

.card-nu-body { padding: 16px; }

/* ─── Transações ────────────────────────────────────────── */
.transacoes-list { }

.transacao-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}

.transacao-item:last-child { border-bottom: none; }
.transacao-item:hover { background: #fafafa; }

.transacao-icone {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.transacao-icone.receita { background: #d1fae5; color: #059669; }
.transacao-icone.despesa { background: #fee2e2; color: #dc2626; }

.transacao-info { flex: 1; min-width: 0; }

.transacao-desc {
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transacao-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.transacao-valor {
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge-categoria {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #eafaf1;
  color: var(--dc-green);
}

.badge-receita { background: #d1fae5; color: #059669; }
.badge-despesa { background: #fee2e2; color: #dc2626; }

.badge-pagamento {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  background: #e9ecef;
  color: #495057;
}

/* ─── Meta item ─────────────────────────────────────────── */
.meta-item {
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}
.meta-item:last-child { border-bottom: none; }
.meta-item:hover { background: #fafafa; }

/* ─── Gráficos ──────────────────────────────────────────── */
.chart-container {
  position: relative;
  padding: 12px;
}

.empty-chart {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 0.85rem;
}

.empty-chart i {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* ─── Empty state ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: #adb5bd;
  padding: 40px 20px;
}

.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.6;
}

/* ─── Cartão ────────────────────────────────────────────── */
.cartao-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--dc-green), var(--dc-green-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ─── Auth pages ─────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dc-green) 0%, var(--dc-green-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo i {
  font-size: 2.5rem;
  color: var(--dc-green);
  display: block;
  margin-bottom: 10px;
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 400;
  color: #2d3748;
  margin: 0 0 6px;
}

.auth-logo p {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: #6c757d;
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--dc-green);
  font-weight: 600;
  text-decoration: none;
}

/* ─── Botão primário ─────────────────────────────────────── */
.btn-primary {
  background-color: var(--dc-green) !important;
  border-color: var(--dc-green) !important;
  font-weight: 500;
}

.btn-primary:hover {
  background-color: var(--dc-green-dark) !important;
  border-color: var(--dc-green-dark) !important;
}

.btn-outline-primary {
  color: var(--dc-green) !important;
  border-color: var(--dc-green) !important;
}

.btn-outline-primary:hover {
  background-color: var(--dc-green) !important;
  color: white !important;
}

/* ─── Tables ────────────────────────────────────────────── */
.table > thead > tr > th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  border-top: none;
  padding: 10px 12px;
}

.table > tbody > tr > td {
  padding: 10px 12px;
  vertical-align: middle;
  font-size: 0.875rem;
}

/* ─── Progress bars ─────────────────────────────────────── */
.progress { border-radius: 99px; }
.progress-bar { border-radius: 99px; }

/* ─── Error page ────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-icon {
  font-size: 5rem;
  font-weight: 700;
  color: var(--dc-green);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 16px;
}

/* ─── Responsive Mobile ─────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 16px 12px;
  }

  .stat-value { font-size: 1rem; }
  .auth-card { padding: 28px 20px; }
}

/* ─── Utilities ─────────────────────────────────────────── */
.fw-medium { font-weight: 500; }
.text-dc { color: var(--dc-green) !important; }
.bg-dc { background-color: var(--dc-green) !important; }

/* ─── Override Bootstrap primary para verde ─────────────── */
.text-primary { color: var(--dc-green) !important; }
.bg-primary { background-color: var(--dc-green) !important; }
.border-primary { border-color: var(--dc-green) !important; }
.badge.bg-primary { background-color: var(--dc-green) !important; }
.alert-primary { border-color: #b7dfbe; background-color: #eafaf1; color: #155724; }

/* Scrollbar customizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Input focus color */
.form-control:focus,
.form-select:focus {
  border-color: var(--dc-green);
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.2);
}

/* ─── Acesso Rápido (Dashboard) ─────────────────────────── */
.btn-acesso-rapido {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform .15s, opacity .15s;
}
.btn-acesso-rapido:hover { transform: translateY(-2px); opacity: .85; }

.ar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  transition: box-shadow .15s;
}
.btn-acesso-rapido:hover .ar-icon { box-shadow: 0 5px 14px rgba(0,0,0,.25); }

.btn-ar-danger  .ar-icon { background: #dc3545; }
.btn-ar-success .ar-icon { background: var(--dc-green); }
.btn-ar-info    .ar-icon { background: #0dcaf0; }

.ar-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: #6c757d;
}
