/* ===== VARIÁVEIS E RESET ===== */
:root {
  --primary: #00695C;
  --primary-light: #26A69A;
  --primary-dark: #004D40;
  --secondary: #80CBC4;
  --accent: #FF6B35;
  --bg: #F0F4F8;
  --bg-card: #FFFFFF;
  --sidebar-bg: #00695C;
  --sidebar-text: rgba(255,255,255,0.85);
  --sidebar-active: rgba(255,255,255,0.15);
  --text-primary: #1A202C;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --border: #E2E8F0;
  --success: #38A169;
  --danger: #E53E3E;
  --warning: #D69E2E;
  --info: #3182CE;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease;
  --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 40px;
  color: white;
  text-align: center;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 36px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.login-left h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.login-left p {
  font-size: 16px;
  opacity: 0.8;
  max-width: 320px;
  line-height: 1.8;
}

.login-features {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.1);
  padding: 14px 18px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
}

.login-feature-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.login-feature-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.login-right {
  width: 480px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  box-shadow: -20px 0 60px rgba(0,0,0,0.15);
}

.login-right h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-right p {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 14px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(38,166,154,0.15);
}

.form-group input::placeholder { color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0,105,92,0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,105,92,0.45);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 2px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #C53030; }

.btn-success { background: var(--success); color: white; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ===== LAYOUT PRINCIPAL ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  background: linear-gradient(180deg, #00695C 0%, #004D40 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}

.sidebar-title {
  font-size: 18px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
}

.sidebar-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  margin-top: 1px;
}

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

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  padding: 12px 24px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  border-radius: 0;
  position: relative;
}

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

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

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--secondary);
  border-radius: 0 3px 3px 0;
}

.nav-item-icon { font-size: 18px; flex-shrink: 0; width: 20px; text-align: center; }

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

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--bg-card);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-badge {
  position: relative;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
}

.topbar-badge:hover { background: var(--border); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 28px 32px;
}

/* ===== CARDS DE ESTATÍSTICAS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.income { background: rgba(56,161,105,0.12); color: var(--success); }
.stat-icon.expense { background: rgba(229,62,62,0.12); color: var(--danger); }
.stat-icon.balance { background: rgba(0,105,92,0.12); color: var(--primary); }
.stat-icon.transactions { background: rgba(49,130,206,0.12); color: var(--info); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-value.income-text { color: var(--success); }
.stat-value.expense-text { color: var(--danger); }

.stat-change {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ===== CONTENT GRID ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

/* ===== CARD BASE ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body { padding: 24px; }

/* ===== TABELA ===== */
.table-responsive { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg);
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,105,92,0.03); }

tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: rgba(56,161,105,0.12); color: var(--success); }
.badge-danger { background: rgba(229,62,62,0.12); color: var(--danger); }
.badge-warning { background: rgba(214,158,46,0.12); color: var(--warning); }
.badge-info { background: rgba(49,130,206,0.12); color: var(--info); }
.badge-primary { background: rgba(0,105,92,0.12); color: var(--primary); }

/* ===== GRÁFICO ===== */
.chart-container {
  position: relative;
  height: 220px;
}

/* ===== MINI LISTA ===== */
.mini-list { display: flex; flex-direction: column; gap: 12px; }

.mini-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: var(--transition);
}

.mini-list-item:hover { background: var(--border); }

.mini-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.mini-text { flex: 1; min-width: 0; }
.mini-title { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mini-value { font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* ===== FILTROS ===== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-group select, .filter-group input {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.filter-group select:focus, .filter-group input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(38,166,154,0.15);
}

/* ===== AMOUNT ===== */
.amount-income { color: var(--success); font-weight: 700; }
.amount-expense { color: var(--danger); font-weight: 700; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: 360px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: scaleIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text-primary); }

.modal-body { padding: 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== PROFILES PAGE ===== */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.profile-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.profile-card.active-profile { border-color: var(--primary); }

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.profile-avatar.personal { background: rgba(0,105,92,0.12); }
.profile-avatar.family { background: rgba(49,130,206,0.12); }
.profile-avatar.business { background: rgba(214,158,46,0.12); }

.profile-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.profile-type { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===== TRANSACTION PAGE (app-style) ===== */
.tx-month-nav { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.tx-month-arrow { background:none; border:none; font-size:18px; color:var(--primary); cursor:pointer; padding:6px 10px; border-radius:8px; transition:var(--transition); }
.tx-month-arrow:hover { background:var(--primary-light); }
.tx-month-label { font-size:16px; font-weight:700; color:var(--text); text-transform:capitalize; min-width:160px; text-align:center; }

.tx-summary-cards { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-bottom:16px; }
.tx-sum-card { display:flex; align-items:center; gap:12px; padding:16px; border-radius:14px; background:#fff; box-shadow:var(--shadow-sm); }
.tx-sum-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; }
.tx-sum-income .tx-sum-icon { background:#E8F5E9; color:#2E7D32; }
.tx-sum-expense .tx-sum-icon { background:#FFEBEE; color:#C62828; }
.tx-sum-balance .tx-sum-icon { background:#E0F2F1; color:#00695C; }
.tx-sum-balance.negative .tx-sum-icon { background:#FFF3E0; color:#E65100; }
.tx-sum-label { font-size:12px; color:var(--text-muted); font-weight:500; }
.tx-sum-value { font-size:16px; font-weight:700; }
.tx-sum-income .tx-sum-value { color:#2E7D32; }
.tx-sum-expense .tx-sum-value { color:#C62828; }
.tx-sum-balance .tx-sum-value { color:#00695C; }
.tx-sum-balance.negative .tx-sum-value { color:#E65100; }

.tx-page-tabs { display:flex; gap:4px; background:var(--bg); padding:4px; border-radius:10px; margin-bottom:16px; width:fit-content; align-items:center; }
.tx-page-tab { padding:8px 20px; border:none; background:transparent; border-radius:8px; font-size:13px; font-weight:600; color:var(--text-muted); cursor:pointer; transition:var(--transition); }
.tx-page-tab.active { background:#fff; color:var(--primary); box-shadow:var(--shadow-sm); }
.tx-count-badge { font-size:11px; background:var(--primary-light); color:var(--primary); padding:2px 8px; border-radius:10px; font-weight:600; margin-left:8px; }

.tx-list-container { display:flex; flex-direction:column; gap:8px; }

.tx-card { display:flex; align-items:center; gap:12px; padding:14px 16px; background:#fff; border-radius:14px; box-shadow:0 1px 4px rgba(0,0,0,0.06); transition:var(--transition); cursor:default; }
.tx-card:hover { box-shadow:0 2px 8px rgba(0,0,0,0.1); }
.tx-card.paid { opacity:0.65; }
.tx-card.overdue { border-left:3px solid #E53E3E; }
.tx-card-icon { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.tx-card-icon.income { background:rgba(56,161,105,0.12); }
.tx-card-icon.expense { background:rgba(229,62,62,0.12); }
.tx-card-body { flex:1; min-width:0; }
.tx-card-desc { font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx-card.paid .tx-card-desc { text-decoration:line-through; color:var(--text-muted); }
.tx-card-sub { font-size:11px; color:var(--text-muted); margin-top:2px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tx-card-right { text-align:right; flex-shrink:0; }
.tx-card-amount { font-size:15px; font-weight:700; }
.tx-card-amount.income { color:#2E7D32; }
.tx-card-amount.expense { color:#C62828; }
.tx-card-status { font-size:10px; font-weight:600; margin-top:2px; }
.tx-card-status.paid { color:#38A169; }
.tx-card-status.pending { color:#D69E2E; }
.tx-card-status.overdue { color:#E53E3E; }
.tx-card-actions { display:flex; gap:4px; flex-shrink:0; }
.tx-card-actions .btn { padding:4px 8px; font-size:12px; }
.tx-installment-badge { background:#E3F2FD; color:#1565C0; font-size:10px; font-weight:700; padding:1px 6px; border-radius:6px; }

@media (max-width: 768px) {
  .tx-summary-cards { grid-template-columns:1fr; }
  .tx-card { flex-wrap:wrap; }
  .tx-card-actions { width:100%; justify-content:flex-end; margin-top:4px; }
}

/* Transaction type tabs (modal) */
.tx-tabs .tx-tab-expense.active {
  background: #FFEBEE;
  color: #C62828;
  box-shadow: 0 1px 3px rgba(198,40,40,0.2);
}
.tx-tabs .tx-tab-income.active {
  background: #E8F5E9;
  color: #2E7D32;
  box-shadow: 0 1px 3px rgba(46,125,50,0.2);
}
.tx-amount-input.type-expense { border-color: #E53E3E; color: #C62828; }
.tx-amount-input.type-income { border-color: #38A169; color: #2E7D32; }
.tx-amount-input.type-expense:focus { box-shadow: 0 0 0 3px rgba(229,62,62,0.15); border-color: #E53E3E; }
.tx-amount-input.type-income:focus { box-shadow: 0 0 0 3px rgba(56,161,105,0.15); border-color: #38A169; }
.tx-category-select { font-size: 14px; }
#btn-save-tx.type-expense { background: #C62828; }
#btn-save-tx.type-expense:hover { background: #B71C1C; }
#btn-save-tx.type-income { background: #2E7D32; }
#btn-save-tx.type-income:hover { background: #1B5E20; }
/* Transaction row type stripe */
tr.tx-row-income { border-left: 3px solid #38A169; }
tr.tx-row-expense { border-left: 3px solid #E53E3E; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== CATEGORY COLORS ===== */
.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider { background-color: var(--primary); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.divider-text {
  text-align: center;
  position: relative;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.divider-text::before, .divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
    --sidebar-width: 260px;
  }

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

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

  .topbar { padding: 0 16px; }

  .login-page { flex-direction: column; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 24px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== MOBILE TOGGLE ===== */
.mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
}

.overlay-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

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

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
