/* ============================================
   MUHASEBE APP — DESIGN SYSTEM
   Dark Theme, Inter Font, Professional
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #080A0F;
  --bg-secondary: #0F1117;
  --bg-card: #131720;
  --bg-card-hover: #171D2A;
  --bg-sidebar: #0C0E15;

  --border-color: #1E2330;
  --border-light: #252C3D;

  --accent-green: #00D4AA;
  --accent-green-dim: rgba(0, 212, 170, 0.12);
  --accent-green-glow: rgba(0, 212, 170, 0.3);

  --accent-red: #FF4D6D;
  --accent-red-dim: rgba(255, 77, 109, 0.12);
  --accent-red-glow: rgba(255, 77, 109, 0.3);

  --accent-purple: #7C3AED;
  --accent-purple-dim: rgba(124, 58, 237, 0.12);
  --accent-purple-glow: rgba(124, 58, 237, 0.3);

  --accent-blue: #3B82F6;
  --accent-yellow: #F59E0B;
  --accent-orange: #F97316;

  --text-primary: #F0F2F8;
  --text-secondary: #A0A8BF;
  --text-muted: #5A6275;

  --sidebar-width: 260px;
  --topbar-height: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.5);
  --shadow-glow-green: 0 0 32px rgba(0, 212, 170, 0.15);
  --shadow-glow-red: 0 0 32px rgba(255, 77, 109, 0.15);
  --shadow-glow-purple: 0 0 32px rgba(124, 58, 237, 0.15);

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-green));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.sidebar-logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 0.5rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-purple);
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: var(--radius-md);
}

.nav-item:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-item:hover::before { opacity: 0.05; }

.nav-item.active {
  color: var(--text-primary);
  background: var(--accent-purple-dim);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 3px;
  background: var(--accent-purple);
  border-radius: 0 2px 2px 0;
}

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

.sidebar-bottom {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: var(--bg-card); }

.sidebar-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-muted); }

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

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
  backdrop-filter: blur(10px);
}

.topbar-left { flex: 1; }

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.topbar-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.topbar-btn.primary {
  background: linear-gradient(135deg, var(--accent-purple), #9333ea);
  border-color: transparent;
  color: white;
  font-weight: 600;
}

.topbar-btn.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.hamburger {
  display: none;
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.hamburger:hover { background: var(--bg-card-hover); }

.page-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   PAGE SECTIONS
   ============================================ */

.page-section {
  display: none;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-section.active { display: block; }

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

/* ============================================
   STAT CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
}

.stat-card.income::before { background: linear-gradient(90deg, var(--accent-green), transparent); }
.stat-card.expense::before { background: linear-gradient(90deg, var(--accent-red), transparent); }
.stat-card.balance::before { background: linear-gradient(90deg, var(--accent-purple), transparent); }
.stat-card.total::before { background: linear-gradient(90deg, var(--accent-blue), transparent); }

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

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-card.income .stat-card-icon { background: var(--accent-green-dim); }
.stat-card.expense .stat-card-icon { background: var(--accent-red-dim); }
.stat-card.balance .stat-card-icon { background: var(--accent-purple-dim); }
.stat-card.total .stat-card-icon { background: rgba(59, 130, 246, 0.12); }

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-card.income .stat-card-value { color: var(--accent-green); }
.stat-card.expense .stat-card-value { color: var(--accent-red); }
.stat-card.balance .stat-card-value { color: var(--accent-purple); }
.stat-card.total .stat-card-value { color: var(--accent-blue); }

.stat-card-change {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-card-change .change-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 99px;
}

.change-badge.up { background: var(--accent-green-dim); color: var(--accent-green); }
.change-badge.down { background: var(--accent-red-dim); color: var(--accent-red); }
.change-badge.neutral { background: var(--bg-secondary); color: var(--text-muted); }

/* ============================================
   CHARTS
   ============================================ */

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: border-color var(--transition-fast);
}

.chart-card:hover { border-color: var(--border-light); }

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

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

.chart-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.chart-wrapper {
  position: relative;
  height: 220px;
}

/* ============================================
   TABLES / TRANSACTION LIST
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.card:hover { border-color: var(--border-light); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
  flex-wrap: wrap;
}

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

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

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

.tx-list { padding: 0; list-style: none; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.tx-item:last-child { border-bottom: none; }
.tx-item:hover { background: var(--bg-card-hover); }

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

.tx-icon.income { background: var(--accent-green-dim); }
.tx-icon.expense { background: var(--accent-red-dim); }

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

.tx-desc {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.tx-amount {
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-amount.income { color: var(--accent-green); }
.tx-amount.expense { color: var(--accent-red); }

.tx-actions {
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tx-item:hover .tx-actions { opacity: 1; }

.tx-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tx-action-btn:hover.edit { background: var(--accent-purple-dim); border-color: var(--accent-purple); color: var(--accent-purple); }
.tx-action-btn:hover.delete { background: var(--accent-red-dim); border-color: var(--accent-red); color: var(--accent-red); }

/* ============================================
   FILTERS & SEARCH
   ============================================ */

.filters-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

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

.filter-select {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235A6275' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-purple);
  background-color: var(--bg-card);
}

.filter-select option { background: var(--bg-card); }

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--accent-red-dim); color: var(--accent-red); border-color: var(--accent-red); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.125rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-fast);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: var(--bg-card);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-card); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Type selector */
.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.type-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.type-option input { display: none; }

.type-option.income-opt:hover,
.type-option.income-opt.selected {
  background: var(--accent-green-dim);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.type-option.expense-opt:hover,
.type-option.expense-opt.selected {
  background: var(--accent-red-dim);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #9333ea);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #00B4D8);
  color: #000;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.25);
}

.btn-success:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.35);
}

.btn-danger {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: rgba(255, 77, 109, 0.3);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

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

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 0.45rem 0.875rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-income { background: var(--accent-green-dim); color: var(--accent-green); }
.badge-expense { background: var(--accent-red-dim); color: var(--accent-red); }
.badge-neutral { background: var(--bg-secondary); color: var(--text-muted); }

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.pagination-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}

.pagination-btn:hover { border-color: var(--accent-purple); color: var(--accent-purple); background: var(--accent-purple-dim); }
.pagination-btn.active { background: var(--accent-purple); color: white; border-color: var(--accent-purple); }
.pagination-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon { font-size: 3rem; opacity: 0.4; }

.empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-desc { font-size: 0.875rem; color: var(--text-muted); max-width: 320px; }

/* ============================================
   CATEGORY BREAKDOWN (Reports)
   ============================================ */

.category-list { display: flex; flex-direction: column; gap: 0.75rem; }

.category-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.category-icon-small {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

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

.category-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.category-progress {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 99px;
  overflow: hidden;
}

.category-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-item-amount {
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.25rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 360px;
}

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

.toast.hide { animation: toastOut 0.25s ease forwards; }

@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%) scale(0.8); }
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-text { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-purple); }

/* ============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ============================================
   DATE PERIOD PICKER (Reports)
   ============================================ */

.period-picker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.period-btn {
  padding: 0.45rem 0.875rem;
  border-radius: 99px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.period-btn:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.period-btn.active { background: var(--accent-purple-dim); border-color: var(--accent-purple); color: var(--accent-purple); }

/* ============================================
   LOADING SKELETON
   ============================================ */

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */

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

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

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

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

  .hamburger { display: flex; }

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

  .topbar { padding: 0 1rem; }

  .page-content { padding: 1rem; }

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

  .stat-card-value { font-size: 1.4rem; }

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

  .form-row { grid-template-columns: 1fr; }

  .modal { max-height: 95vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

  .modal-overlay { align-items: flex-end; padding: 0; }

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

  .topbar-btn span { display: none; }

  .filters-bar { flex-direction: column; }

  .search-input-wrapper { min-width: unset; width: 100%; }
}

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

/* ============================================
   COUNTER ANIMATION
   ============================================ */

.counting { transition: all 0.1s; }

/* ============================================
   MONTH / YEAR BADGE
   ============================================ */

.month-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-purple-dim);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--accent-purple);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

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

/* ============================================
   SUMMARY TABLE (Reports)
   ============================================ */

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.summary-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-color);
}

.summary-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.summary-table tbody tr:last-child td { border-bottom: none; }

.summary-table tbody tr:hover td { background: var(--bg-card-hover); }

.summary-table .positive { color: var(--accent-green); font-weight: 700; }
.summary-table .negative { color: var(--accent-red); font-weight: 700; }
.summary-table .neutral { color: var(--text-muted); }
