/* ==========================================================================
   FinApp - Design System & Modern Styles
   ========================================================================== */

:root {
  /* Color Tokens - Modern Dark Palette */
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 50, 0.85);
  --bg-input: rgba(13, 18, 30, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --border-accent: rgba(59, 130, 246, 0.3);

  /* Primary Brand & Accents */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-glow: rgba(59, 130, 246, 0.25);

  /* Income & Positive Colors (Emerald) */
  --color-income: #10b981;
  --color-income-glow: rgba(16, 185, 129, 0.2);
  --color-income-dark: #064e3b;
  --color-income-light: #34d399;

  /* Expense & Negative Colors (Rose / Coral) */
  --color-expense: #f43f5e;
  --color-expense-glow: rgba(244, 63, 94, 0.2);
  --color-expense-dark: #881337;
  --color-expense-light: #fb7185;

  /* Warning / Caution */
  --color-warning: #f59e0b;
  --color-warning-glow: rgba(245, 158, 11, 0.2);

  /* Text & Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0b0f19;

  /* Layout & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Glassmorphism & Shadows */
  --glass-blur: blur(14px);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow-income: 0 0 25px -5px rgba(16, 185, 129, 0.3);
  --shadow-glow-expense: 0 0 25px -5px rgba(244, 63, 94, 0.3);
  --shadow-glow-balance: 0 0 25px -5px rgba(59, 130, 246, 0.3);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Light Theme Tokens & Customizations
   ========================================================================== */
[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(248, 250, 252, 0.98);
  --bg-input: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: #2563eb;
  --border-accent: rgba(37, 99, 235, 0.25);

  --color-income: #059669;
  --color-income-light: #059669;
  --color-expense: #e11d48;
  --color-expense-light: #e11d48;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.09) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(244, 63, 94, 0.05) 0px, transparent 50%);
  color: var(--text-primary);
}

[data-theme="light"] .brand h1 {
  background: linear-gradient(to right, #0f172a, #334155);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .panel-title-wrap h2,
[data-theme="light"] .modal-header h2,
[data-theme="light"] .expense-item-title,
[data-theme="light"] .insight-value,
[data-theme="light"] .kpi-value {
  color: #0f172a;
}

[data-theme="light"] .card-income .kpi-value {
  color: #059669;
}

[data-theme="light"] .card-expense .kpi-value {
  color: #e11d48;
}

[data-theme="light"] .card-balance.positive .kpi-value {
  color: #059669;
}

[data-theme="light"] .card-balance.negative .kpi-value {
  color: #e11d48;
}

[data-theme="light"] .modal-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal-header {
  background: #f8fafc;
  border-bottom-color: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .btn-outline {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}

[data-theme="light"] .btn-outline:hover {
  background: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .month-indicator,
[data-theme="light"] .month-navigator {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #334155;
}

[data-theme="light"] .tabbed-header {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .list-toolbar {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .list-footer {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .list-footer-stats strong {
  color: #0f172a;
}

[data-theme="light"] .tab-btn {
  color: #64748b;
}

[data-theme="light"] .tab-btn.active {
  color: #0f172a;
}

[data-theme="light"] .expense-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .expense-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .legend-item,
[data-theme="light"] .insight-row {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .chip-content {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #334155;
}

[data-theme="light"] .category-chip input[type="radio"]:checked + .chip-content {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #1d4ed8;
}

[data-theme="light"] .emoji-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .toast {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Theme Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-theme-toggle i {
  color: #f59e0b;
  transition: transform var(--transition-normal);
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-theme-toggle:hover i {
  transform: rotate(30deg) scale(1.15);
}

[data-theme="light"] .btn-theme-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-theme-toggle i {
  color: #6366f1;
}

[data-theme="light"] .btn-theme-toggle:hover i {
  transform: rotate(-30deg) scale(1.15);
}

/* Light theme overrides for form inputs */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] input[type="text"]:focus,
[data-theme="light"] input[type="number"]:focus,
[data-theme="light"] input[type="date"]:focus,
[data-theme="light"] select:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .search-box input {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .filter-select,
[data-theme="light"] .sort-select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .card-percentage .kpi-value {
  color: #7c3aed;
}

[data-theme="light"] .percent-label.status-great {
  background: rgba(5, 150, 105, 0.15);
  color: #047857;
}

[data-theme="light"] .percent-label.status-warning {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}

[data-theme="light"] .percent-label.status-danger {
  background: rgba(225, 29, 72, 0.15);
  color: #be123c;
}

[data-theme="light"] .modal-footer {
  background: #f8fafc;
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(244, 63, 94, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Month Navigator Component */
.month-navigator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-normal);
}

.month-navigator:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-month-nav {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-month-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: scale(1.08);
}

[data-theme="light"] .btn-month-nav:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.btn-month-nav i {
  width: 17px;
  height: 17px;
}

.month-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
}

.month-label-wrap:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-primary);
}

[data-theme="light"] .month-label-wrap:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-primary);
}

.month-label-wrap i {
  width: 15px;
  height: 15px;
  color: var(--color-primary);
}

.month-picker-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.btn-jump-current {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--color-primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: 0.2rem;
}

.btn-jump-current:hover {
  background: rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.btn-jump-current i {
  width: 13px;
  height: 13px;
}

[data-theme="light"] .btn-jump-current {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: #2563eb;
}

[data-theme="light"] .btn-jump-current:hover {
  background: rgba(37, 99, 235, 0.18);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn i {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.btn-expense {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.btn-expense:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.5);
}

.btn-income {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.btn-income:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--color-expense-light);
  background: rgba(244, 63, 94, 0.1);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: auto;
}

.btn-link:hover {
  color: var(--color-income-light);
}

/* ==========================================================================
   KPI Cards Grid
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.kpi-card.card-income::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.kpi-card.card-expense::before {
  background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.kpi-card.card-balance::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.kpi-card.card-percentage::before {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-wrap i {
  width: 19px;
  height: 19px;
}

.income-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-income-light);
}

.expense-icon {
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-expense-light);
}

.balance-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.percent-icon {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.card-income .kpi-value {
  color: var(--color-income-light);
}

.card-expense .kpi-value {
  color: var(--color-expense-light);
}

.card-balance.positive .kpi-value {
  color: #34d399;
}

.card-balance.negative .kpi-value {
  color: #fb7185;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.percent-label {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.percent-label.status-great {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.percent-label.status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.percent-label.status-danger {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

/* Progress bar inside % card */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.15rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background var(--transition-normal);
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, #f43f5e, #e11d48);
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  margin-top: auto;
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.kpi-badge i {
  width: 13px;
  height: 13px;
}

.income-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-income-light);
}

.badge-positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-income-light);
}

.badge-negative {
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-expense-light);
}

.kpi-subtext {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   Main Layout: Two Columns
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.layout-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Panel Cards */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-header {
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.panel-title-wrap h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.panel-title-wrap i {
  width: 20px;
  height: 20px;
}

.panel-icon-income { color: var(--color-income); }
.panel-icon-expense { color: var(--color-expense); }
.panel-icon-chart { color: #8b5cf6; }
.panel-icon-list { color: var(--color-primary); }

.badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-expense-light);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.badge-pill-income {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-income-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-count {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.panel-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.flex-1 {
  flex: 1;
}

label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-with-prefix input {
  padding-left: 2.8rem;
}

input:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

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

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-text-action i {
  width: 14px;
  height: 14px;
}

.btn-text-action:hover {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
}

/* Category Chip Selector */
.category-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-chip input[type="radio"] {
  display: none;
}

.chip-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.category-chip input[type="radio"]:checked + .chip-content {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.chip-content:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Emoji Picker Grid */
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.emoji-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.emoji-btn.selected {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Color Picker Row */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.color-option input[type="radio"] {
  display: none;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-option input[type="radio"]:checked + .color-dot {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Chart Panel
   ========================================================================== */
.chart-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.chart-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  gap: 0.75rem;
}

.chart-empty-state i {
  width: 44px;
  height: 44px;
  opacity: 0.4;
}

.chart-empty-state p {
  font-size: 0.85rem;
}

.category-legend {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  max-height: 180px;
  overflow-y: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-val {
  font-weight: 700;
  color: var(--text-primary);
}

/* Insights Summary Card */
.insights-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.4rem;
}

.insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.insight-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
}

.insight-label i {
  width: 15px;
  height: 15px;
  color: var(--color-primary);
}

.insight-value {
  color: #fff;
  font-weight: 700;
}

.insight-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

/* Tabs for Gastos & Entradas */
.tabbed-header {
  padding: 0.5rem 1.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);
}

.panel-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn i {
  width: 16px;
  height: 16px;
}

.tab-icon-expense { color: var(--color-expense); }
.tab-icon-income { color: var(--color-income); }

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--color-primary);
}

.tab-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-expense-light);
}

.income-tab-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-income-light);
}

.income-amount {
  color: var(--color-income-light) !important;
}

.income-empty-icon {
  background: rgba(16, 185, 129, 0.1) !important;
}

.income-empty-icon i {
  color: var(--color-income-light) !important;
}

.income-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-income-light);
}
.expense-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.list-toolbar {
  padding: 1rem 1.4rem;
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  flex-wrap: wrap;
}

.search-box {
  flex: 2;
  min-width: 180px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 0.85rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  padding-left: 2.3rem;
  font-size: 0.85rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.filter-select-wrap {
  flex: 1;
  min-width: 140px;
}

.filter-select-wrap select {
  font-size: 0.85rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  cursor: pointer;
}

.expense-list-scroll {
  flex: 1;
  max-height: 580px;
  overflow-y: auto;
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Custom Scrollbar */
.expense-list-scroll::-webkit-scrollbar,
.category-legend::-webkit-scrollbar {
  width: 6px;
}

.expense-list-scroll::-webkit-scrollbar-thumb,
.category-legend::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

.expense-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Expense Item Card */
.expense-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  animation: fadeInSlide 0.3s ease forwards;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expense-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.expense-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.expense-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.expense-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-item-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.expense-badge-cat {
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-weight: 600;
}

.expense-item-amount {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-expense-light);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: 0.5rem;
}

.expense-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-action i {
  width: 17px;
  height: 17px;
}

.btn-edit-expense:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.btn-delete-expense:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-expense-light);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.is-open,
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(59, 130, 246, 0.15);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-open .modal-card,
.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-modal-close i {
  width: 18px;
  height: 18px;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  gap: 0.75rem;
  margin: auto 0;
}

.empty-state-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.empty-state-icon i {
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 320px;
  line-height: 1.45;
}

/* List Footer */
.list-footer {
  padding: 1rem 1.4rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.list-footer-stats {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-footer-stats strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 360px;
}

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

.toast.toast-success {
  border-left: 4px solid var(--color-income);
}

.toast.toast-danger {
  border-left: 4px solid var(--color-expense);
}

.toast.toast-info {
  border-left: 4px solid var(--color-primary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .layout-column.left-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .income-panel {
    grid-column: span 1;
  }

  .expense-form-panel {
    grid-column: span 1;
  }

  .chart-panel {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
    gap: 1.25rem;
  }

  .layout-column.left-column {
    grid-template-columns: 1fr;
  }

  .income-panel,
  .expense-form-panel,
  .chart-panel {
    grid-column: span 1;
  }

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

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .list-toolbar {
    flex-direction: column;
  }

  .search-box, .filter-select-wrap {
    width: 100%;
  }
}

@media (max-width: 580px) {
  .btn-theme-toggle span {
    display: none;
  }
}

/* ==========================================================================
   Autenticação & Menu de Perfil de Usuário
   ========================================================================== */
.btn-admin-nav {
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.btn-admin-nav:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fbbf24;
}

[data-theme="light"] .btn-admin-nav {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b45309;
}

[data-theme="light"] .btn-admin-nav:hover {
  background: rgba(217, 119, 6, 0.2);
}

.user-profile-wrap {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.user-profile-btn:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.user-name {
  font-size: 0.84rem;
  font-weight: 700;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.badge-role-admin {
  color: #fbbf24;
}

.user-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.user-profile-wrap.is-open .user-chevron,
.user-profile-wrap.active .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 0.6rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 1050;
  animation: fadeInDown 0.2s ease;
}

.user-profile-wrap.is-open .user-dropdown-menu,
.user-profile-wrap.active .user-dropdown-menu,
.user-dropdown-menu.is-open,
.user-dropdown-menu.active {
  display: flex !important;
}

[data-theme="light"] .user-dropdown-menu {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem 0.65rem;
}

.dropdown-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
}

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

.dropdown-user-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dropdown-user-details strong {
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-details span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-provider {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  margin-top: 0.15rem;
}

.badge-provider-google {
  background: rgba(66, 133, 244, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(66, 133, 244, 0.3);
}

.badge-provider-local {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.3rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.dropdown-item i {
  width: 16px;
  height: 16px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

[data-theme="light"] .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

.dropdown-item.item-danger {
  color: var(--color-expense-light);
}

.dropdown-item.item-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--color-expense);
}

/* ==========================================================================
   Modal de Autenticação / Login / Cadastro
   ========================================================================== */
.auth-modal-card {
  max-width: 440px;
  width: 92%;
  padding: 2.2rem 2rem;
  text-align: center;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-brand-icon {
  margin: 0 auto 0.9rem;
  width: 52px;
  height: 52px;
}

.auth-google-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.google-signin-btn-container {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  margin-bottom: 1.25rem;
}

[data-theme="light"] .auth-tabs {
  background: rgba(0, 0, 0, 0.03);
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}

.admin-quick-login-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
}

.btn-admin-quick {
  font-size: 0.82rem;
  padding: 0.55rem;
  border-style: dashed;
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.btn-admin-quick:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #fbbf24;
}

[data-theme="light"] .btn-admin-quick {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.4);
}

/* ==========================================================================
   Painel de Gestão de Usuários (Administrador)
   ========================================================================== */
.admin-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.admin-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.admin-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-icon-shield {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.admin-icon-shield i {
  width: 24px;
  height: 24px;
}

.admin-title-wrap h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card-admin-total::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.card-admin-google::before {
  background: linear-gradient(90deg, #ea4335, #f87171);
}

.card-admin-local::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.card-admin-records::before {
  background: linear-gradient(90deg, #8b5cf6, #c084fc);
}

.admin-table-panel {
  padding: 0;
}

.admin-table-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-table-container {
  overflow-x: auto;
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

[data-theme="light"] .admin-table th {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-secondary);
}

.admin-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .admin-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-cell-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
}

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

.user-cell-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-cell-name {
  font-weight: 700;
  color: var(--text-primary);
}

.user-cell-id {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-role-admin-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-role-user-pill {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-blocked {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.admin-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-table-action {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

[data-theme="light"] .btn-table-action {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569;
}

[data-theme="light"] .btn-table-action:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.btn-table-action.action-delete:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--color-expense-light);
}

.btn-table-action i {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Aba e Gerenciador de Categorias
   ========================================================================== */
.tab-icon-category {
  color: #8b5cf6;
}

.category-tab-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.categories-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
  gap: 1rem;
}

.categories-view-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.categories-view-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.category-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
}

.category-admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.category-admin-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-card-hover);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.category-card-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.category-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.category-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.category-card-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.category-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-action:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-card-hover);
  transform: translateY(-1px);
}

.btn-icon-action.item-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .category-admin-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .category-admin-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .categories-view-header {
  background: #f8fafc;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}


