/* FinansTakip Modern Design Tokens */
:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 26, 43, 0.75);
  --bg-card-hover: rgba(26, 37, 60, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-emerald: #10b981;
  --color-emerald-hover: #059669;
  --color-rose: #f43f5e;
  --color-rose-hover: #e11d48;
  --color-amber: #f59e0b;
  --color-indigo: #818cf8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography Helpers */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-muted { color: var(--text-muted); }
.text-emerald { color: var(--color-emerald); }
.text-rose { color: var(--color-rose); }
.text-amber { color: var(--color-amber); }
.text-indigo { color: var(--color-indigo); }
.text-center { text-align: center; }

.hidden { display: none !important; }

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Flex & Grid Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

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

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--color-rose);
}
.btn-outline-danger:hover {
  background: rgba(244, 63, 94, 0.15);
}

.btn-block { width: 100%; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }
.badge-danger { background: rgba(244, 63, 94, 0.15); color: var(--color-rose); }
.badge-indigo { background: rgba(129, 140, 248, 0.15); color: var(--color-indigo); }
.badge-sm { padding: 2px 6px; font-size: 0.68rem; }

/* AUTH MODAL & CARD */
.auth-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 50%),
              radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 50%),
              var(--bg-main);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 30px;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.auth-header h2 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-header p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 28px; }

.input-group {
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.input-group input, .input-group select, .input-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.input-with-icon input {
  padding-left: 42px;
}

.input-group input:focus, .input-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.alert-box {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.alert-danger { background: rgba(244, 63, 94, 0.15); color: #fca5a5; border: 1px solid rgba(244, 63, 94, 0.3); }

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

/* SIDEBAR (DESKTOP) */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  border-radius: 0;
  border-right: 1px solid var(--border-color);
  border-top: none;
  border-bottom: none;
  border-left: none;
  padding: 24px 16px;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.brand-text h1 { font-size: 1.15rem; line-height: 1.2; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

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

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

.nav-item.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* MOBILE HEADER & BOTTOM NAV */
.mobile-header, .mobile-bottom-nav {
  display: none;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 30px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.header-title h2 { font-size: 1.4rem; }

/* TAB VIEWS */
.tab-view { display: none; }
.tab-view.active { display: block; animation: fadeIn 0.25s ease-out; }

/* STATS KPI GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.border-left-emerald { border-left: 4px solid var(--color-emerald); }
.border-left-rose { border-left: 4px solid var(--color-rose); }
.border-left-amber { border-left: 4px solid var(--color-amber); }
.border-left-indigo { border-left: 4px solid var(--color-indigo); }

.stat-icon-bg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-bg svg { width: 24px; height: 24px; }

.emerald-bg { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.rose-bg { background: rgba(244, 63, 94, 0.15); color: var(--color-rose); }
.amber-bg { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }
.indigo-bg { background: rgba(129, 140, 248, 0.15); color: var(--color-indigo); }

.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.stat-value { font-size: 1.45rem; font-weight: 800; margin: 2px 0; }
.stat-hint { font-size: 0.75rem; color: var(--text-muted); }

/* URGENT PAYMENTS BANNER */
.dashboard-section {
  padding: 20px 24px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.urgent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.urgent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10, 15, 26, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.urgent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* CHARTS GRID */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
}

.chart-card {
  padding: 20px;
}

.chart-header h3 { font-size: 1.05rem; margin-bottom: 16px; }

.chart-wrapper {
  position: relative;
  height: 260px;
  width: 100%;
}

/* TABLES */
.view-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.bar-btns {
  display: flex;
  gap: 10px;
}

.content-block {
  padding: 24px;
}
.margin-top { margin-top: 24px; }

.block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

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

/* DIGITAL CREDIT CARDS DESIGN */
.cards-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.digital-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.gradient-blue { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%); }
.gradient-purple { background: linear-gradient(135deg, #2e1065 0%, #581c87 50%, #7e22ce 100%); }
.gradient-emerald { background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #059669 100%); }
.gradient-gold { background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #d97706 100%); }
.gradient-rose { background: linear-gradient(135deg, #881337 0%, #be123c 50%, #e11d48 100%); }

.card-chip {
  width: 36px;
  height: 26px;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  border-radius: 4px;
  margin-bottom: 12px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-bank-name { font-size: 0.8rem; font-weight: 700; opacity: 0.8; text-transform: uppercase; }
.card-title-name { font-size: 1.25rem; font-weight: 800; }

.card-mid {
  margin: 16px 0;
}

.card-statement-info {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* RECURRING EXPENSES & PERIOD JOURNEY STYLES */
.recurring-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.recurring-card {
  padding: 22px 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(14, 20, 33, 0.7);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.25s ease;
}

.recurring-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.recurring-card.paid {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(10, 25, 20, 0.4);
}

.period-journey-box {
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 6px;
}

.journey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.journey-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.journey-stat-unit {
  display: flex;
  flex-direction: column;
}

.journey-stat-unit .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.journey-stat-unit .val {
  font-size: 1rem;
  font-weight: 800;
}

/* PERIOD ROADMAP GRID IN MODAL */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.roadmap-step {
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-color);
  background: rgba(10, 15, 26, 0.5);
}

.roadmap-step.completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--color-emerald);
}

.roadmap-step.current {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--color-amber);
  color: var(--color-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.roadmap-step.future {
  opacity: 0.4;
}

/* SAVINGS GOALS CARDS */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.goal-card {
  padding: 24px;
}

.goal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.goal-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 12px 0 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* MODALS OVERLAY */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

.max-w-md { max-width: 460px; }

/* RESPONSIVE DESIGN FOR MOBILE */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .top-header { display: none; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
  }

  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 8px 4px;
    border-radius: 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    background: rgba(11, 15, 25, 0.95);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px;
  }

  .mobile-nav-item svg { width: 20px; height: 20px; }
  .mobile-nav-item.active { color: var(--color-primary); }

  .main-content {
    padding: 16px;
    padding-bottom: 80px;
  }

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

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

  .cards-display-grid {
    grid-template-columns: 1fr;
  }
}

/* Modern Receipt Upload UI/UX Box */
.receipt-upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.04);
  cursor: pointer;
  transition: all 0.25s ease;
}

.receipt-upload-box:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.receipt-upload-box .upload-icon {
  width: 32px;
  height: 32px;
  color: var(--color-indigo);
  margin-bottom: 8px;
}

.receipt-upload-box .upload-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.receipt-upload-box .upload-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.receipt-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.receipt-preview-card img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

