/**
 * FinansPanel - Ana stil dosyası
 *
 * Modern koyu tema, yeşil/turkuaz vurgu rengi.
 * Mobil öncelikli responsive tasarım.
 */

/* ============================================
   CSS Değişkenleri (Tema Renkleri)
   ============================================ */
:root {
  /* Arka plan tonları */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2b3d;
  --bg-input: #0f1623;
  --bg-sidebar: #0d1320;
  --bg-tertiary: #0f172a;

  /* Vurgu renkleri — yeşil / turkuaz */
  --accent-primary: #10b981;
  --accent-secondary: #14b8a6;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --accent-glow: rgba(16, 185, 129, 0.25);

  /* Metin renkleri */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Durum renkleri */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Kenarlık ve gölge */
  --border-color: rgba(148, 163, 184, 0.12);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Boyutlar */
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --bottom-nav-height: 64px;
  --fab-size: 56px;

  /* Geçiş süreleri */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ============================================
   Sıfırlama ve Temel Stiller
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.app-body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Üst Çubuk (Topbar)
   ============================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1000;
  gap: 1rem;
}

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

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.topbar-brand svg {
  color: var(--accent-primary);
  width: 24px;
  height: 24px;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  display: none;
}

.search-form {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

/* ============================================
   Butonlar
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
  vertical-align: middle;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

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

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

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

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

.btn-icon:hover {
  background: var(--bg-card);
  color: var(--accent-primary);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Yan Menü (Sidebar)
   ============================================ */
.app-wrapper {
  display: flex;
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 900;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

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

.sidebar-overlay {
  position: fixed;
  inset: 0;
  top: var(--topbar-height);
  background: rgba(0, 0, 0, 0.6);
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.sidebar-brand svg {
  color: var(--accent-primary);
  width: 22px;
  height: 22px;
}

.sidebar-close {
  display: flex;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.nav-list {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-divider {
  padding: 0.75rem 1.25rem 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

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

/* ============================================
   Ana İçerik Alanı
   ============================================ */
.main-content {
  flex: 1;
  width: 100%;
  padding: 1.25rem;
  padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
  margin-left: 0;
  min-height: calc(100vh - var(--topbar-height));
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(16, 185, 129, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(20, 184, 166, 0.04) 0%, transparent 50%),
    var(--bg-primary);
}

.page-header {
  margin-bottom: 1.35rem;
}

.page-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-bar .page-title {
  margin-bottom: 0.15rem;
}

.page-header-bar .btn {
  flex-shrink: 0;
}

.page-title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 52ch;
}

/* ============================================
   Kartlar
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card.card-interactive:hover,
.dashboard-widget:hover,
.dashboard-chart-card:hover {
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: var(--shadow-md);
}

.card-filter {
  padding: 1rem 1.15rem 1.1rem;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.65) 0%, var(--bg-card) 100%);
  border-color: rgba(148, 163, 184, 0.14);
}

.card-filter .filter-grid {
  margin-bottom: 0.65rem;
}

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

.card-filter .d-flex.gap-1,
.card-filter .filter-actions {
  padding-top: 0.15rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.35rem;
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.positive {
  color: var(--color-success);
}

.stat-value.negative {
  color: var(--color-danger);
}

/* ============================================
   Uyarılar
   ============================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid transparent;
  line-height: 1.45;
}

.alert svg {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
}

.alert > span,
.alert > div {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.modal-body .alert {
  margin-bottom: 1rem;
}

.alert {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.security-alert {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* ============================================
   Rozetler (Badge)
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9px;
  line-height: 1;
}

.badge-danger {
  background: var(--color-danger);
  color: #fff;
}

.badge-warning {
  background: var(--color-warning);
  color: #000;
}

.badge-success {
  background: var(--color-success);
  color: #fff;
}

.category-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.color-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-picker-item {
  cursor: pointer;
}

.color-picker-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

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

.color-picker-input:checked + .color-picker-swatch {
  border-color: var(--text-primary);
  transform: scale(1.08);
}

.color-picker-input:focus-visible + .color-picker-swatch {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ============================================
   Form Elemanları
   ============================================ */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* ============================================
   Tablolar
   ============================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-secondary);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(16, 185, 129, 0.04);
}

.table tbody td.text-center.text-muted {
  padding: 2.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.table-responsive {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table-responsive .table {
  margin-bottom: 0;
}

.table-responsive .table thead th:first-child {
  padding-left: 1rem;
}

.table-responsive .table tbody td:first-child {
  padding-left: 1rem;
}

.table-responsive .table thead th:last-child,
.table-responsive .table tbody td:last-child {
  padding-right: 1rem;
}

/* Mobilde kart görünümü */
.mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.mobile-card-item:hover {
  border-color: rgba(148, 163, 184, 0.22);
}

/* ============================================
   Mobil Alt Navigasyon
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 1;
  padding: 0.4rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  position: relative;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--accent-primary);
}

.bottom-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

/* ============================================
   FAB — Hızlı İşlem Butonu
   ============================================ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 1rem);
  right: 1rem;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  cursor: pointer;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.fab:hover {
  transform: scale(1.08);
}

.fab svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   Panel / Modal (Daha Fazla, Hızlı İşlem)
   ============================================ */
.more-menu-panel,
.quick-action-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  z-index: 1100;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.more-menu-panel.open,
.quick-action-panel.open {
  transform: translateY(0);
}

.more-menu-overlay,
.quick-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.more-menu-overlay.visible,
.quick-action-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.more-menu-header,
.quick-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.more-menu-header h3,
.quick-action-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.more-menu-grid,
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 1rem;
}

.more-menu-item,
.quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.more-menu-item:hover,
.quick-action-item:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.08);
}

.more-menu-item svg,
.quick-action-item svg {
  width: 22px;
  height: 22px;
}

.more-menu-item.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ============================================
   Kullanıcı Menüsü
   ============================================ */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.user-menu-trigger:hover {
  border-color: var(--accent-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.user-avatar svg {
  width: 18px;
  height: 18px;
}

.user-name {
  display: none;
  font-size: 0.85rem;
}

.user-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 1100;
  overflow: hidden;
}

.user-dropdown.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
}

.text-danger {
  color: var(--color-danger) !important;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: calc(100% - 2rem);
  max-width: 480px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 1250;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-lg {
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.modal-fullscreen-mobile.open {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

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

/* Modal hata mesaji — Kaydet dugmesinin hemen ustunde, mobilde sabit */
.modal-form-error {
  margin: 0.75rem 0 0 !important;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .modal.open form.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
  }

  .modal-form-error {
    position: sticky;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 6;
    margin: 0 -1.25rem !important;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.18);
  }

  form.modal-body .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -1.25rem;
    padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.22);
  }
}

/* ============================================
   Durum rozetleri ve işlem butonları
   ============================================ */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  white-space: nowrap;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status-inactive {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.status-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  margin-left: 4px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1;
}

.type-badge i,
.type-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.type-badge-default {
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.28);
}

.type-badge-custom {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.22);
}

.expense-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.2;
}

.expense-status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.28);
}

.expense-status-partial {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.28);
}

.expense-status-paid {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.28);
}

.expense-status-overdue {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.28);
}

.expense-status-cancelled {
  background: rgba(100, 116, 139, 0.14);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.24);
}

.role-admin {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
}

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

.role-moderator {
  background: rgba(245, 158, 11, 0.18);
  color: #d97706;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.action-buttons .btn-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.action-buttons .btn-icon:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-primary);
}

.inline-form {
  display: inline;
}

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

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================
   Log sayfası
   ============================================ */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.log-ip {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.log-row-warning td {
  background: rgba(239, 68, 68, 0.05);
}

.log-card-warning {
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.pagination-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.pagination-item:hover,
.pagination-item.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.1);
}

/* ============================================
   Giriş Sayfası
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(20, 184, 166, 0.06) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo svg {
  width: 48px;
  height: 48px;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.auth-form .btn-primary {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

/* ============================================
   Kurulum Sayfası
   ============================================ */
.install-page {
  min-height: 100vh;
  padding: 2rem 1rem;
  background: var(--bg-primary);
}

.install-container {
  max-width: 600px;
  margin: 0 auto;
}

.install-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.install-step {
  flex: 1;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
}

.install-step.active {
  background: var(--accent-gradient);
}

/* ============================================
   Placeholder / Boş Durum
   ============================================ */
.placeholder-box {
  text-align: center;
  padding: 2.75rem 1.5rem;
  color: var(--text-secondary);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: var(--border-radius);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, transparent 100%);
}

.placeholder-box > svg {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.85rem;
  opacity: 0.55;
  color: var(--accent-primary);
}

.placeholder-box p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 36ch;
  margin-inline: auto;
}

.placeholder-box .btn svg {
  width: 18px;
  height: 18px;
  margin-bottom: 0;
  opacity: 1;
}

/* ============================================
   Masaüstü Düzen (768px+)
   ============================================ */
@media (min-width: 768px) {
  .topbar-search {
    display: block;
  }

  .sidebar-toggle,
  .sidebar-close {
    display: none;
  }

  .sidebar {
    transform: translateX(0);
  }

  .main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    padding-bottom: 2rem;
  }

  .bottom-nav,
  .fab {
    display: none;
  }

  .user-name {
    display: inline;
  }

  .brand-text {
    display: inline;
  }

  .sidebar-header .sidebar-close {
    display: none;
  }
}

@media (max-width: 767px) {
  .brand-text {
    display: none;
  }

  .table-desktop {
    display: none;
  }

  .mobile-card-list {
    display: flex;
  }
}

@media (min-width: 768px) {
  .mobile-card-list {
    display: none;
  }
}

/* ============================================
   SweetAlert2 Koyu Tema Uyumu
   ============================================ */
.swal2-popup {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.swal2-title {
  color: var(--text-primary) !important;
}

.swal2-html-container {
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: var(--accent-primary) !important;
}

.swal2-cancel {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
}

/* ============================================
   Yardımcı Sınıflar
   ============================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ============================================
   Tarih secici (Flatpickr)
   ============================================ */
.date-picker-field {
  position: relative;
  display: flex;
  align-items: stretch;
}

.date-picker-field .form-control {
  padding-right: 2.5rem;
}

.date-picker-trigger {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--border-radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.date-picker-trigger:hover {
  color: var(--accent-primary);
  background: rgba(34, 197, 94, 0.08);
}

.date-picker-trigger svg {
  width: 1rem;
  height: 1rem;
}

.flatpickr-calendar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: var(--border-radius);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  background: transparent;
  color: var(--text-primary);
}

.flatpickr-weekdays {
  background: transparent;
}

span.flatpickr-weekday {
  color: var(--text-muted);
}

.flatpickr-day {
  color: var(--text-primary);
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: rgba(34, 197, 94, 0.15);
  border-color: transparent;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.flatpickr-day.today {
  border-color: var(--accent-primary);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: var(--text-secondary);
}

/* ============================================
   Form collapse (istege bagli bolumler)
   ============================================ */
.form-collapse {
  margin-top: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
}

.form-collapse + .form-collapse {
  margin-top: 0.5rem;
}

.form-collapse-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.92rem;
  cursor: pointer;
}

.form-collapse-toggle:hover {
  background: rgba(148, 163, 184, 0.06);
}

.form-collapse-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-collapse-label svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent-primary);
}

.form-collapse-icon {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.form-collapse-toggle.is-open .form-collapse-icon {
  transform: rotate(180deg);
}

.form-collapse-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border-color);
}

.form-row-responsive {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-row-responsive > .form-group {
  flex: 1 1 160px;
  min-width: 0;
  margin-bottom: 0;
}

.form-row-responsive > .form-group-narrow {
  flex: 0 1 120px;
}

.income-modal-form .form-group {
  margin-bottom: 0.85rem;
}

.income-modal-form .form-row-responsive:last-of-type {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .form-row-responsive {
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
  }

  .form-row-responsive > .form-group,
  .form-row-responsive > .form-group-narrow {
    flex: 1 1 100%;
    margin-bottom: 0.85rem;
  }

  .income-modal-form .form-collapse-body .form-row-responsive > .form-group:last-child {
    margin-bottom: 0;
  }
}

.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.file-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-upload-zone:hover {
  border-color: var(--accent-primary);
  background: rgba(34, 197, 94, 0.05);
  color: var(--text-secondary);
}

.file-upload-zone svg {
  width: 1.25rem;
  height: 1.25rem;
}

.file-upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.file-upload-preview-item {
  width: 72px;
  height: 72px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.file-upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-upload-preview-doc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.35rem;
  font-size: 0.65rem;
  text-align: center;
  color: var(--text-muted);
  word-break: break-all;
}

.budget-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.budget-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.budget-progress-fill.success { background: #10b981; }
.budget-progress-fill.warning { background: #f59e0b; }
.budget-progress-fill.danger { background: #ef4444; }

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

.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
}

.search-result-section {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.search-result-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.search-result-item {
  display: block;
  padding: 0.35rem 0.25rem;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
}

.search-result-item:hover {
  background: var(--bg-secondary);
}

.search-result-all {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-decoration: none;
}

/* Arama sayfası */
.search-page-form {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-page-input-wrap {
  position: relative;
  flex: 1 1 240px;
}

.search-page-input-wrap > svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-page-input-wrap .form-control {
  padding-left: 2.35rem;
}

.search-results-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.search-results-count {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.search-result-card .card-header {
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
}

.search-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.search-result-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.search-result-list .search-result-item {
  padding: 0;
}

.search-result-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.search-result-link:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: inherit;
}

.search-result-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-result-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ============================================
   Takvim (FullCalendar koyu tema)
   ============================================ */
.calendar-page-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.calendar-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, transparent 100%);
}

.calendar-card-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-card-header h2 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.calendar-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.calendar-legend-dot.expense-pending { background: #f59e0b; }
.calendar-legend-dot.expense-paid { background: #22c55e; }
.calendar-legend-dot.installment { background: #60a5fa; }
.calendar-legend-dot.income { background: #34d399; }

.calendar-wrapper {
  padding: 1rem 1.25rem 1.35rem;
}

.calendar-wrapper .fc {
  --fc-border-color: var(--border-color);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--bg-secondary);
  --fc-neutral-text-color: var(--text-secondary);
  --fc-today-bg-color: rgba(16, 185, 129, 0.1);
  --fc-list-event-hover-bg-color: var(--bg-card-hover);
  --fc-highlight-color: rgba(16, 185, 129, 0.12);
  --fc-button-text-color: var(--text-primary);
  --fc-button-bg-color: var(--bg-secondary);
  --fc-button-border-color: var(--border-color);
  --fc-button-hover-bg-color: var(--bg-card-hover);
  --fc-button-hover-border-color: rgba(16, 185, 129, 0.35);
  --fc-button-active-bg-color: rgba(16, 185, 129, 0.2);
  --fc-button-active-border-color: var(--accent-primary);
  --fc-event-border-color: transparent;
  font-family: inherit;
}

.calendar-wrapper .fc .fc-toolbar {
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem !important;
}

.calendar-wrapper .fc .fc-toolbar-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.calendar-wrapper .fc .fc-button {
  border-radius: var(--border-radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  text-transform: none;
  box-shadow: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.calendar-wrapper .fc .fc-button:focus {
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.calendar-wrapper .fc .fc-button-primary:not(:disabled).fc-button-active,
.calendar-wrapper .fc .fc-button-primary:not(:disabled):active {
  color: var(--accent-primary);
}

.calendar-wrapper .fc .fc-button-group > .fc-button {
  border-radius: 0;
}

.calendar-wrapper .fc .fc-button-group > .fc-button:first-child {
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.calendar-wrapper .fc .fc-button-group > .fc-button:last-child {
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.calendar-wrapper .fc .fc-scrollgrid {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border-color: var(--border-color);
}

.calendar-wrapper .fc .fc-col-header-cell {
  background: var(--bg-secondary);
  padding: 0.55rem 0;
}

.calendar-wrapper .fc .fc-col-header-cell-cushion {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.calendar-wrapper .fc .fc-daygrid-day {
  background: var(--bg-card);
  transition: background var(--transition-fast);
}

.calendar-wrapper .fc .fc-daygrid-day:hover {
  background: var(--bg-card-hover);
}

.calendar-wrapper .fc .fc-daygrid-day-number {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.55rem;
  text-decoration: none;
}

.calendar-wrapper .fc .fc-day-today .fc-daygrid-day-number {
  color: var(--accent-primary);
  font-weight: 700;
}

.calendar-wrapper .fc .fc-day-today .fc-daygrid-day-number::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--accent-primary);
}

.calendar-wrapper .fc .fc-day-other .fc-daygrid-day-number {
  color: var(--text-muted);
  opacity: 0.45;
}

.calendar-wrapper .fc .fc-daygrid-day-frame {
  min-height: 5.5rem;
}

.calendar-wrapper .fc .fc-daygrid-event {
  border-radius: 6px;
  margin: 1px 3px 2px;
  padding: 1px 2px;
  font-size: 0.72rem;
  font-weight: 500;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.calendar-wrapper .fc .fc-daygrid-event .fc-event-title {
  font-weight: 500;
  padding: 2px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-wrapper .fc .fc-daygrid-more-link {
  color: var(--accent-primary);
  font-size: 0.72rem;
  font-weight: 600;
  margin: 2px 4px;
}

.calendar-wrapper .fc .fc-list {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.calendar-wrapper .fc .fc-list-day-cushion {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.calendar-wrapper .fc .fc-list-event:hover td {
  background: var(--bg-card-hover);
}

.calendar-wrapper .fc .fc-list-event-title,
.calendar-wrapper .fc .fc-list-event-time {
  color: var(--text-primary);
}

.calendar-wrapper .fc .fc-popover {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-md);
}

.calendar-wrapper .fc .fc-popover-header {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.calendar-wrapper .fc .fc-more-popover .fc-popover-body {
  padding: 0.35rem;
}

@media (max-width: 768px) {
  .calendar-card-header {
    padding: 0.85rem 1rem;
  }

  .calendar-wrapper {
    padding: 0.75rem 0.65rem 1rem;
  }

  .calendar-wrapper .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-wrapper .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .calendar-wrapper .fc .fc-toolbar-title {
    font-size: 1rem;
    text-align: center;
  }

  .calendar-wrapper .fc .fc-daygrid-day-frame {
    min-height: 4.25rem;
  }

  .calendar-wrapper .fc .fc-button {
    font-size: 0.75rem;
    padding: 0.35rem 0.55rem;
  }
}

/* ============================================
   Kartlar — Cüzdan / Kart Görünümü
   ============================================ */
.wallet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.wallet-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wallet-summary-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wallet-summary-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.wallet-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.wallet-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.wallet-card {
  position: relative;
  min-height: 196px;
  border-radius: 18px;
  padding: 1.1rem 1.2rem 1rem;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wallet-card--credit {
  min-height: 228px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a7c 40%, #10b981 120%);
}

.wallet-card-wrap:hover .wallet-card {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
}

.wallet-card--inactive {
  filter: grayscale(0.55) brightness(0.75);
  opacity: 0.82;
}

.wallet-card--debit {
  background: linear-gradient(135deg, #1a365d 0%, #2563eb 55%, #38bdf8 130%);
}

.wallet-card--cash {
  background: linear-gradient(135deg, #14532d 0%, #15803d 50%, #34d399 130%);
}

.wallet-card--virtual {
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #22d3ee 130%);
}

.wallet-card--prepaid {
  background: linear-gradient(135deg, #7c2d12 0%, #ea580c 55%, #fbbf24 130%);
}

.wallet-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.04) 28%,
    transparent 55%
  );
  pointer-events: none;
}

.wallet-card__pattern {
  position: absolute;
  right: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.65rem;
  opacity: 0.12;
  pointer-events: none;
}

.wallet-card__pattern span {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 2px solid #fff;
}

.wallet-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.wallet-card__chip {
  width: 42px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(145deg, #f5d76e 0%, #d4a017 45%, #c9a227 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
}

.wallet-card__chip::before {
  content: '';
  position: absolute;
  inset: 6px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.wallet-card__type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.wallet-card__body {
  position: relative;
  z-index: 1;
  margin-top: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.wallet-card__bank {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-card__name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.25rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-card__number {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  opacity: 0.72;
  margin: 0;
}

.wallet-card__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
  min-width: 0;
}

.wallet-card__footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  margin-top: 0;
  padding-top: 0;
}

.wallet-card__footer:has(.wallet-card__metric--wide) {
  grid-template-columns: 1fr;
}

.wallet-card__metric {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.wallet-card__metric--wide {
  grid-column: 1 / -1;
}

.wallet-card__metric-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.wallet-card__metric-value {
  font-size: clamp(0.78rem, 2.2vw, 0.9rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.wallet-card__usage {
  position: relative;
  z-index: 1;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.wallet-card__usage-bar {
  flex: 1;
  min-width: 0;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  margin-bottom: 0;
}

.wallet-card__usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.92);
  transition: width 0.4s ease;
}

.wallet-card__usage-text {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.95;
  white-space: nowrap;
  line-height: 1;
}

.wallet-card__meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin-top: 0;
  font-size: 0.68rem;
  opacity: 0.92;
  min-width: 0;
}

.wallet-card__meta-line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.wallet-card__meta-line svg,
.wallet-card__meta span svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.wallet-card__top-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.wallet-card__status-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.9);
  color: #1a1a1a;
}

.wallet-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.15rem 0 0;
  margin-top: 0.15rem;
}

.wallet-card-actions .btn-sm {
  flex: 1;
  min-width: fit-content;
  justify-content: center;
}

.wallet-card-actions .btn-sm i {
  width: 14px;
  height: 14px;
}

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

  .wallet-card {
    min-height: 188px;
    padding: 1rem;
  }

  .wallet-card--credit {
    min-height: 220px;
  }

  .wallet-card__name {
    font-size: 0.95rem;
  }

  .wallet-card-actions .btn-sm {
    flex: 1 1 calc(50% - 0.25rem);
  }
}

/* ============================================
   Bankalar — Kart ızgarası
   ============================================ */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.bank-tile {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.1rem;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bank-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.85;
}

.bank-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.bank-tile__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.bank-tile--expandable .bank-tile__head {
  cursor: pointer;
}

.bank-tile__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
}

.bank-tile__icon svg {
  width: 24px;
  height: 24px;
}

.bank-tile__info {
  flex: 1;
  min-width: 0;
}

.bank-tile__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.4rem;
  word-break: break-word;
}

.bank-tile__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bank-tile__meta svg {
  width: 14px;
  height: 14px;
}

.bank-tile__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.bank-tile.is-open .bank-tile__chevron {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.bank-tile__cards {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border-color);
}

.bank-tile.is-open .bank-tile__cards {
  display: flex;
}

.bank-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.bank-card-row--inactive {
  opacity: 0.55;
}

.bank-card-row__left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bank-card-row__name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bank-card-row__name svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.bank-card-row__type {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bank-card-row__right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  text-align: right;
}

.bank-card-row__label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.bank-card-row__value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bank-card-row__sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.bank-tile__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-color);
}

.bank-tile__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.bank-tile__badge svg {
  width: 14px;
  height: 14px;
}

.bank-tile__actions {
  display: flex;
  gap: 0.35rem;
}

/* ============================================
   Harcama — Ödeme kaynağı (Kart / Nakit)
   ============================================ */
.payment-source-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.payment-source-option {
  flex: 1;
  min-width: 120px;
  cursor: pointer;
}

.payment-source-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-source-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.payment-source-option span svg {
  width: 16px;
  height: 16px;
}

.payment-source-option input:checked + span {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.12);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.payment-source-option:hover span {
  border-color: rgba(16, 185, 129, 0.45);
}

.expense-cash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.telegram-settings-box {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
}

.telegram-settings-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.telegram-settings-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
}

.telegram-help summary {
  cursor: pointer;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.backup-status-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

/* Dashboard hızlı dönem seçimi */
.dashboard-intro {
  min-width: 0;
}

.dashboard-greeting {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent-primary);
  letter-spacing: 0.01em;
}

.dashboard-period-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.dashboard-period-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.dashboard-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dashboard-quick-filter {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.dashboard-quick-filter:hover {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--text-primary);
}

.dashboard-quick-filter.is-active {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.14);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}

@media (max-width: 767px) {
  .dashboard-quick-filters {
    width: 100%;
  }

  .dashboard-quick-filter {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
    min-width: 0;
  }
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.dashboard-stat-grid .stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.1rem 1.15rem 1rem;
  border-radius: var(--border-radius-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.dashboard-stat-grid .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(148, 163, 184, 0.22);
}

.dashboard-stat-grid .stat-card::before {
  height: 4px;
  opacity: 0.95;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  min-height: 1.75rem;
}

.stat-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.stat-card-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.stat-card-expense::before { background: linear-gradient(135deg, #ef4444, #f97316); }
.stat-card-income::before { background: linear-gradient(135deg, #10b981, #14b8a6); }
.stat-card-debt::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-card-net::before { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.stat-card-savings::before { background: linear-gradient(135deg, #14b8a6, #06b6d4); }

.stat-card-expense .stat-card-icon { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.stat-card-income .stat-card-icon { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; }
.stat-card-debt .stat-card-icon { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.stat-card-net .stat-card-icon { background: rgba(59, 130, 246, 0.14); color: #93c5fd; }
.stat-card-savings .stat-card-icon { background: rgba(20, 184, 166, 0.14); color: #5eead4; }

.dashboard-stat-grid .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dashboard-stat-grid .stat-value {
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.stat-hint {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.dashboard-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dashboard-section-title svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent-primary);
}

.dashboard-section-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-chart-card {
  overflow: hidden;
}

.dashboard-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-chart-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dashboard-chart-kpi,
.dashboard-chart-kpi-group > .dashboard-chart-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.dashboard-chart-kpi span,
.dashboard-chart-kpi-group > .dashboard-chart-kpi span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.dashboard-chart-kpi strong,
.dashboard-chart-kpi-group > .dashboard-chart-kpi strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dashboard-chart-kpi-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-chart-kpi.is-income strong { color: var(--color-success); }
.dashboard-chart-kpi.is-expense strong { color: var(--color-danger); }

.dashboard-chart-wrap {
  position: relative;
  height: 300px;
  margin-top: 0.35rem;
  padding: 0.25rem 0.15rem 0;
}

.dashboard-chart-wrap.is-tall {
  height: 320px;
}

.dashboard-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 260px;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.dashboard-chart-empty svg {
  width: 2.2rem;
  height: 2.2rem;
  opacity: 0.55;
}

.dashboard-chart-empty p {
  margin: 0;
  font-size: 0.88rem;
}

.dashboard-chart-legend {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--border-color);
  display: grid;
  gap: 0.45rem;
}

.dashboard-chart-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.82rem;
}

.dashboard-chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

.dashboard-chart-legend-value {
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-expense-date {
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.dashboard-expense-title {
  font-weight: 600;
}

.dashboard-expense-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-expense-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.text-right {
  text-align: right;
}

/* Dashboard widget kartları */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.dashboard-widget-wide {
  grid-column: 1 / -1;
}

.dashboard-widget .card-header {
  margin-bottom: 0.35rem;
}

.dashboard-widget-header .dashboard-widget-sub {
  margin: 0.2rem 0 0;
}

.dashboard-widget-sub {
  font-size: 0.82rem;
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
}

.dashboard-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .dashboard-compare-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-compare-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  min-width: 0;
}

.dashboard-compare-item.is-expense { border-color: rgba(239, 68, 68, 0.18); }
.dashboard-compare-item.is-income { border-color: rgba(16, 185, 129, 0.18); }
.dashboard-compare-item.is-net { border-color: rgba(59, 130, 246, 0.18); }

.dashboard-compare-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.dashboard-compare-label svg {
  width: 0.85rem;
  height: 0.85rem;
}

.dashboard-compare-value {
  font-size: clamp(0.92rem, 1.6vw, 1.08rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dashboard-compare-item .dashboard-change-badge {
  margin-top: 0.1rem;
}

.dashboard-change-badge {
  display: inline-flex;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.dashboard-change-badge.is-positive {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

.dashboard-change-badge.is-negative {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
}

.dashboard-change-badge.is-neutral {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

.dashboard-widget-alert {
  border-color: rgba(239, 68, 68, 0.35);
}

.dashboard-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.dashboard-widget-foot {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.dashboard-top-categories,
.dashboard-budget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.dashboard-top-categories li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.88rem;
}

.dashboard-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dashboard-cat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-cat-bar-wrap {
  grid-column: 2 / -1;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.dashboard-cat-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.dashboard-cat-amount,
.dashboard-cat-percent {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dashboard-budget-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.dashboard-budget-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.dashboard-budget-pill.is-safe {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

.dashboard-budget-pill.is-warning {
  color: #d97706;
  background: rgba(245, 158, 11, 0.15);
}

.dashboard-budget-pill.is-danger {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
}

.dashboard-budget-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.dashboard-budget-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.dashboard-budget-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dashboard-budget-fill.is-safe { background: #10b981; }
.dashboard-budget-fill.is-warning { background: #f59e0b; }
.dashboard-budget-fill.is-danger { background: #ef4444; }

.dashboard-subscription-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.dashboard-subscription-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.dashboard-widget-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--accent-primary);
  text-decoration: none;
}

.dashboard-widget-link:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .dashboard-compare-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-chart-header {
    flex-direction: column;
  }

  .dashboard-chart-kpi,
  .dashboard-chart-kpi-group {
    width: 100%;
  }

  .dashboard-chart-kpi-group > .dashboard-chart-kpi {
    flex: 1;
    align-items: flex-start;
  }

  .dashboard-top-categories li {
    grid-template-columns: auto 1fr auto;
  }

  .dashboard-cat-percent {
    display: none;
  }
}

/* ============================================
   Yaklaşan Ödemeler Zaman Çizelgesi
   ============================================ */
.payment-timeline {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.25rem 0.5rem;
}

.payment-timeline-group {
  position: relative;
  padding: 0 0 1.25rem 1.75rem;
  border-left: 2px solid var(--border-color);
}

.payment-timeline-group:last-child {
  padding-bottom: 0.25rem;
  border-left-color: transparent;
}

.payment-timeline-marker {
  position: absolute;
  left: -7px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.payment-timeline-group.is-today > .payment-timeline-marker {
  background: var(--color-warning);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.payment-timeline-group.is-overdue > .payment-timeline-marker {
  background: var(--color-danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.payment-timeline-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.payment-timeline-when {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.payment-timeline-group.is-today .payment-timeline-when {
  color: var(--color-warning);
}

.payment-timeline-group.is-overdue .payment-timeline-when {
  color: var(--color-danger);
}

.payment-timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.payment-timeline-total {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.payment-timeline-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payment-timeline-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: background var(--transition-fast);
}

.payment-timeline-item:hover {
  background: var(--bg-card-hover);
}

.payment-timeline-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--border-radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-primary);
}

.payment-timeline-item-icon i {
  width: 18px;
  height: 18px;
}

.payment-timeline-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.payment-timeline-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-timeline-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.payment-timeline-item-amount {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
}
