/* Piastro - Main Stylesheet */

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #f1f5f9 100%);
  min-height: 100vh;
  color: #1e293b;
}

.outfit {
  font-family: 'Outfit', sans-serif;
}

/* Card Shadows */
.card-shadow {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
}

.card-shadow-lg {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
}

/* Premium Gradient */
.premium-gradient {
  background: linear-gradient(135deg, #0b1a2b 0%, #15324d 55%, #1e4b5c 100%);
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

.sidebar.collapsed ~ .mobile-header,
.sidebar.collapsed ~ .app-content {
  margin-left: 72px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid rgba(226,232,240,0.6);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(226,232,240,0.4);
  min-height: 64px;
  position: relative;
}

.sidebar-logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.2);
}

.sidebar-logo-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  color: white;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-logo-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e3a5f;
  letter-spacing: -0.02em;
}

.sidebar-logo-tagline {
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: -2px;
  letter-spacing: 0.03em;
}

.sidebar-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.15s;
}

.sidebar-toggle:hover {
  background: #f1f5f9;
  color: #475569;
}

.sidebar-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* Collapsed: hide text, center icon */
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-link-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-language {
  display: none;
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 1.25rem 0;
}

.sidebar.collapsed .sidebar-toggle {
  position: static;
  transform: none;
  margin: 0;
}

.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.625rem;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 0.625rem;
}

.sidebar.collapsed .sidebar-section {
  padding: 0.5rem;
}

.sidebar.collapsed .sidebar-footer {
  padding: 0.5rem;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 0.25rem 0.75rem;
}

.sidebar-section-label {
  display: block;
  padding: 0.75rem 0.625rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.15s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link svg {
  width: 1.125rem;
  height: 1.125rem;
  min-width: 1.125rem;
}

.sidebar-link:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.sidebar-link.active {
  color: #1e3a5f;
  background: #eff6ff;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.sidebar-link.disabled {
  opacity: 0.7;
  cursor: default;
}

.sidebar-link.disabled:hover {
  background: transparent;
  color: #64748b;
}

/* Sidebar Badge */
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  background: #fbbf24;
  color: #78350f;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  margin-left: auto;
  white-space: nowrap;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(226,232,240,0.4);
  padding: 0.5rem 0.75rem;
  margin-top: auto;
}

.sidebar-language {
  margin: 0.375rem 0.625rem 0.5rem;
}

.sidebar-language-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.sidebar-language-form {
  display: flex;
  gap: 0.375rem;
}

.sidebar-language-btn {
  flex: 1;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-language-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.sidebar-language-btn.active {
  background: #eff6ff;
  color: #1e3a5f;
  border-color: #bfdbfe;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  overflow: hidden;
}

.sidebar-user-avatar {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  background: #f1f5f9;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-weight: 600;
  font-size: 0.75rem;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link-logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 55;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  padding: 0.75rem 1rem;
  align-items: center;
  gap: 0.75rem;
}

.mobile-hamburger {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: background 0.15s;
}

.mobile-hamburger:hover {
  background: #f1f5f9;
}

.mobile-hamburger svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-header-logo .sidebar-logo-icon {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
}

.mobile-header-logo .sidebar-logo-icon svg {
  width: 1rem;
  height: 1rem;
}

.mobile-header-logo .sidebar-logo-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
}

/* Period Selector */
.period-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(241,245,249,0.8);
  border-radius: 9999px;
  padding: 0.375rem;
}

.period-btn {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: #475569;
}

.period-btn:hover {
  color: #0f172a;
}

.period-btn.active {
  background: #1e293b;
  color: white;
}

/* Period Dropdown */
.period-dropdown {
  position: relative;
}

.period-btn.period-more {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding-right: 0.75rem;
}

.period-btn.period-more svg {
  width: 0.875rem;
  height: 0.875rem;
}

.period-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.12);
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
  display: none;
  z-index: 100;
}

.period-dropdown-menu.show {
  display: block;
}

.period-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  text-align: left;
  background: none;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.period-dropdown-item:hover {
  background: #f8fafc;
  color: #1e293b;
}

.period-dropdown-item.active {
  background: #eff6ff;
  color: #1e3a5f;
  font-weight: 500;
}

/* Loading State */
body.loading {
  pointer-events: none;
}

body.loading .kpi-value,
body.loading .donut-value,
body.loading .legend-value,
body.loading .budget-spent,
body.loading .transaction-amount {
  opacity: 0.5;
}

/* Main Content */
main {
  max-width: 100%;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* Welcome Section */
.welcome {
  margin-bottom: 2rem;
}

.welcome h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.welcome p {
  color: #64748b;
  margin-top: 0.25rem;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s;
  cursor: pointer;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.08);
}

.kpi-card.dark {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.kpi-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon.emerald {
  background: #ecfdf5;
}

.kpi-icon.emerald svg {
  color: #059669;
}

.kpi-icon.blue {
  background: #eff6ff;
}

.kpi-icon.blue svg {
  color: #2563eb;
}

.kpi-icon.white {
  background: rgba(255,255,255,0.1);
}

.kpi-icon.white svg {
  color: white;
}

.kpi-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.kpi-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.kpi-badge.positive {
  background: #ecfdf5;
  color: #059669;
}

.kpi-badge.negative {
  background: #fef2f2;
  color: #dc2626;
}

.kpi-badge.positive-dark {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.kpi-badge svg {
  width: 0.875rem;
  height: 0.875rem;
}

.kpi-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.kpi-card.dark .kpi-label {
  color: #94a3b8;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.875rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.kpi-card.dark .kpi-value {
  color: white;
}

.kpi-value span {
  font-size: 1.125rem;
  color: #94a3b8;
  font-weight: 400;
}

.kpi-comparison {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.5rem;
}

/* KPI Cards Row - aligned with 2fr 1fr dashboard grid */
.kpi-cards-row {
  display: grid;
  /* Dashboard uses 2fr 1fr (ratio 2:1). Split left part (2fr) into 2 KPIs = 1fr 1fr 1fr with adjusted gaps */
  /* To align: 2 KPIs should span 2fr, 1 KPI should span 1fr → use same 2fr 1fr but nest first two */
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.kpi-cards-left {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.kpi-card {
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-card.kpi-income {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.kpi-card.kpi-expenses {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.kpi-card.kpi-balance {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.kpi-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-card-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.kpi-card-value.positive {
  color: #059669;
}

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

/* Dashboard Layout */
.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-charts-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Summary Card - Compact */
.summary-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
}

.summary-card .card-header {
  margin-bottom: 0.75rem;
}

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

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 0.5rem;
}

.summary-icon {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-icon svg {
  width: 1rem;
  height: 1rem;
  color: #fff;
}

.summary-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.375rem;
}

.summary-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
}

.summary-label {
  font-size: 0.8125rem;
  color: #64748b;
}

/* Card */
.card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.125rem;
}

.card-action {
  font-size: 0.875rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s;
}

.card-action:hover {
  color: #0f172a;
}

.card-action svg {
  width: 1rem;
  height: 1rem;
}

/* Chart Filter */
.chart-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chart-select:hover {
  border-color: #cbd5e1;
}

.chart-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Category Chart */
.category-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.donut-container {
  position: relative;
  flex-shrink: 0;
}

.donut-chart {
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  position: relative;
}

.donut-center {
  position: absolute;
  inset: 1rem;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.donut-label {
  font-size: 0.75rem;
  color: #64748b;
}

.category-legend {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 2rem;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s, opacity 0.2s;
}

.legend-item:hover {
  background-color: #f1f5f9;
}

.legend-item.active {
  background-color: #e0e7ff;
}

.legend-item.active .legend-name {
  color: #4338ca;
  font-weight: 500;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.legend-name {
  font-size: 0.875rem;
  color: #475569;
}

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

.legend-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
}

.legend-percent {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.375rem;
}

/* Budget vs Real */
.budget-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.budget-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.budget-category {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.budget-values {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.budget-numbers {
  font-size: 0.875rem;
  color: #64748b;
}

.budget-diff {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.budget-diff.positive {
  background: #ecfdf5;
  color: #047857;
}

.budget-diff.negative {
  background: #fef2f2;
  color: #b91c1c;
}

.progress-bar {
  height: 0.5rem;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease-out;
}

.progress-fill.normal {
  background: linear-gradient(90deg, #475569, #1e293b);
}

.progress-fill.over {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

/* Insights Card */
.insights-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
}

.insights-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.insights-icon {
  width: 2rem;
  height: 2rem;
  background: rgba(255,255,255,0.1);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.insights-icon svg {
  width: 1rem;
  height: 1rem;
  color: white;
}

.insights-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

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

.insight-item {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  border-radius: 0.75rem;
  padding: 1rem;
  border-left: 3px solid;
  transition: transform 0.2s;
}

.insight-item:hover {
  transform: translateX(4px);
}

.insight-item.warning {
  border-color: #fbbf24;
}

.insight-item.danger {
  border-color: #f87171;
}

.insight-item.success {
  border-color: #34d399;
}

.insight-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.insight-content svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.insight-item.warning svg {
  color: #fbbf24;
}

.insight-item.danger svg {
  color: #f87171;
}

.insight-item.success svg {
  color: #34d399;
}

.insight-text {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.4;
  line-height: 1.5;
}

.insight-text strong {
  font-weight: 500;
}

.insight-item.warning strong {
  color: #fbbf24;
}

.insight-item.danger strong {
  color: #f87171;
}

.insight-item.success strong {
  color: #34d399;
}

/* Transactions */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transactions-list .no-transactions {
  text-align: center;
  color: #64748b;
  padding: 2rem;
  font-size: 0.875rem;
}

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.transaction-item:hover {
  background: rgba(30, 58, 95, 0.02);
}

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

.transaction-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: #f1f5f9;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transaction-icon svg {
  width: 1rem;
  height: 1rem;
  color: #64748b;
}

.transaction-icon.income svg {
  color: #059669;
}

.transaction-details p {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
}

.transaction-details span {
  font-size: 0.75rem;
  color: #94a3b8;
}

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

.transaction-amount {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.transaction-amount.income {
  color: #059669;
}

.transaction-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  color: white;
  letter-spacing: 0.02em;
  margin-top: 0.25rem;
}

.view-all-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
}

.view-all-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.view-all-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Quebec Badge */
.quebec-badge {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
}

.quebec-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quebec-icon {
  width: 3rem;
  height: 3rem;
  background: #eff6ff;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quebec-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: #1e3a5f;
}

.quebec-text p {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
}

.quebec-text span {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.125rem;
  display: block;
}

/* Footer */
footer {
  border-top: 1px solid rgba(226,232,240,0.6);
  margin-top: auto;
}

.footer-container {
  max-width: 100%;
  padding: 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.footer-left svg {
  width: 1rem;
  height: 1rem;
  fill: #1e3a5f;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #475569;
}

/* Fleur de Lis SVG */
.fleur-de-lis {
  display: inline-block;
}

/* Responsive */

/* Tablet */
@media (max-width: 1024px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

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

  .category-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .category-legend {
    grid-template-columns: 1fr;
  }
}

/* Mobile: sidebar off-screen, hamburger visible */
@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 70;
  }

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

  /* Restore full sidebar appearance on mobile when open */
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .sidebar-link-text,
  .sidebar.mobile-open .sidebar-section-label,
  .sidebar.mobile-open .sidebar-badge,
  .sidebar.mobile-open .sidebar-user-info {
    display: flex;
  }

  .sidebar.mobile-open .sidebar-section-label {
    display: block;
  }

  .sidebar.mobile-open .sidebar-logo {
    justify-content: flex-start;
    padding: 1.25rem 1rem;
  }

  .sidebar.mobile-open .sidebar-link {
    justify-content: flex-start;
    padding: 0.5625rem 0.625rem;
  }

  .sidebar.mobile-open .sidebar-user {
    justify-content: flex-start;
    padding: 0.5rem 0.625rem;
  }

  .sidebar.mobile-open .sidebar-section {
    padding: 0.25rem 0.75rem;
  }

  .sidebar.mobile-open .sidebar-footer {
    padding: 0.5rem 0.75rem;
  }

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

  .sidebar.collapsed ~ .app-content {
    margin-left: 0;
  }

  .mobile-header {
    display: flex;
  }

  main {
    padding: 1.25rem 1rem;
  }

  .footer-container {
    padding: 1.25rem 1rem;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

/* ==================== */
/* TRANSACTIONS PAGE    */
/* ==================== */

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header-text {
  flex: 1;
}

.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: #64748b;
  font-size: 0.9375rem;
}

/* Filters Bar */
.filters-bar {
  background: white;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #1e293b;
  background: #f8fafc;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-input:focus {
  outline: none;
  border-color: #1e3a5f;
  background: white;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.filter-input::placeholder {
  color: #94a3b8;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.search-input-wrapper input {
  padding-left: 2.5rem;
}

select.filter-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.add-btn {
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-family: inherit;
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.add-btn svg {
  width: 1rem;
  height: 1rem;
}

/* KPI Cards Compact */
.kpi-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card-compact {
  background: white;
  border-radius: 0.875rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-icon-compact {
  width: 3rem;
  height: 3rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-compact.blue {
  background: #eff6ff;
}

.kpi-icon-compact.blue svg {
  color: #2563eb;
  width: 1.5rem;
  height: 1.5rem;
}

.kpi-icon-compact.red {
  background: #fef2f2;
}

.kpi-icon-compact.red svg {
  color: #dc2626;
  width: 1.5rem;
  height: 1.5rem;
}

.kpi-icon-compact.green {
  background: #ecfdf5;
}

.kpi-icon-compact.green svg {
  color: #059669;
  width: 1.5rem;
  height: 1.5rem;
}

.kpi-content-compact {
  flex: 1;
}

.kpi-label-compact {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kpi-value-compact {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

/* Table */
.table-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
}

.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.table-count {
  font-size: 0.875rem;
  color: #64748b;
}

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

.transactions-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.transactions-table th {
  padding: 0.875rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.transactions-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.transactions-table tbody tr:hover {
  background: #f8fafc;
}

.transactions-table td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
}

.transaction-date {
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.transaction-description {
  color: #0f172a;
  font-weight: 500;
}

.transaction-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #64748b;
}

.account-icon svg {
  width: 0.875rem;
  height: 0.875rem;
}

.account-icon.bank {
  background: #eff6ff;
  color: #2563eb;
}

.account-icon.credit {
  background: #fef3c7;
  color: #d97706;
}

.account-name {
  font-size: 0.8125rem;
  color: #475569;
}

.category-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
}

.transactions-table .transaction-amount {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.transactions-table .transaction-amount.expense {
  color: #dc2626;
}

.transactions-table .transaction-amount.income {
  color: #059669;
}

.transaction-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #64748b;
}

.action-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.action-btn.delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.action-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Pagination */
.pagination {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
}

.pagination-info {
  font-size: 0.875rem;
  color: #64748b;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-btn {
  padding: 0.5rem 0.875rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: #1e3a5f;
  color: #1e3a5f;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn.active {
  background: #1e3a5f;
  color: white;
  border-color: #1e3a5f;
}

/* Responsive */
@media (max-width: 1024px) {
  .kpi-grid-compact {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    min-width: 100%;
  }

  .transactions-table {
    display: block;
    overflow-x: auto;
  }
}

/* ==================== */
/* CATEGORIES PAGE      */
/* ==================== */

.page-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header-flex h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

.page-header-flex p {
  color: #64748b;
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

.add-category-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

.add-category-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.add-category-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Info Card */
.info-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.info-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: white;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #2563eb;
}

.info-content h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.375rem;
}

.info-content p {
  font-size: 0.875rem;
  color: #1e3a8a;
  line-height: 1.5;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.category-card {
  background: white;
  border-radius: 1rem;
  padding: 1.75rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-color-picker {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.category-color-picker svg {
  width: 1.75rem;
  height: 1.75rem;
}

.category-info {
  flex: 1;
}

.category-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.category-stats {
  font-size: 0.8125rem;
  color: #64748b;
}

.category-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #64748b;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.icon-btn.delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.keywords-section {
  margin-bottom: 1.25rem;
}

.keywords-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: block;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  min-height: 2rem;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: #475569;
  transition: all 0.2s;
}

.keyword-tag:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.keyword-remove {
  width: 1rem;
  height: 1rem;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
  padding: 0;
}

.keyword-remove:hover {
  color: #dc2626;
}

.keyword-remove svg {
  width: 0.75rem;
  height: 0.75rem;
}

.no-keywords {
  font-size: 0.8125rem;
  color: #94a3b8;
  font-style: italic;
}

.add-keyword-form {
  display: flex;
  gap: 0.5rem;
}

.keyword-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: #1e293b;
  background: #f8fafc;
  transition: all 0.2s;
  font-family: inherit;
}

.keyword-input:focus {
  outline: none;
  border-color: #1e3a5f;
  background: white;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.keyword-input::placeholder {
  color: #94a3b8;
}

.add-keyword-btn {
  padding: 0.5rem 1rem;
  background: #1e3a5f;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  font-family: inherit;
}

.add-keyword-btn:hover {
  background: #2d5a87;
}

.add-keyword-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.auto-categorization {
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}

.auto-categorization-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.auto-label-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toggle-switch {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  display: inline-block;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.4s;
  border-radius: 9999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 1.125rem;
  width: 1.125rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #059669;
}

input:checked + .toggle-slider:before {
  transform: translateX(1.25rem);
}

.auto-description {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
}

/* Create Category Card */
.create-category-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
}

.create-category-card:hover {
  border-color: #1e3a5f;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.create-icon {
  width: 4rem;
  height: 4rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.create-icon svg {
  width: 2rem;
  height: 2rem;
  color: #1e3a5f;
}

.create-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.create-subtitle {
  font-size: 0.875rem;
  color: #64748b;
}

/* Responsive Categories */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .page-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ===================================
   Import CSV Page Styles
   =================================== */

/* Upload Zone */
.upload-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  background: #f8fafc;
}

.upload-zone:hover {
  border-color: #1e3a5f;
  background: #eff6ff;
}

.upload-zone.dragover {
  border-color: #1e3a5f;
  background: #dbeafe;
}

.upload-icon {
  width: 5rem;
  height: 5rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.upload-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: #1e3a5f;
}

.upload-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.upload-subtitle {
  font-size: 0.9375rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.upload-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.upload-btn svg {
  width: 1rem;
  height: 1rem;
}

.upload-info {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* File Selected Display */
.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: #1e3a5f;
}

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

.file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.file-remove:hover {
  color: #dc2626;
  background: #fef2f2;
}

/* Config Section */
.config-section {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.config-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.5rem;
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #1e293b;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Advanced Options Toggle */
.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.advanced-toggle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.advanced-toggle svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
}

.advanced-toggle.open svg {
  transform: rotate(180deg);
}

.advanced-options {
  display: none;
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 0.75rem;
}

.advanced-options.open {
  display: block;
}

.option-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Column Config */
.column-config {
  display: flex;
  gap: 1rem;
}

.column-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-input label {
  font-size: 0.8125rem;
  color: #64748b;
  white-space: nowrap;
}

.column-input input {
  width: 3.5rem;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  text-align: center;
}

.column-input input:focus {
  outline: none;
  border-color: #1e3a5f;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: #1e3a5f;
}

.checkbox-group label {
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
}

/* Form Actions */
.form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* Preview Section */
.preview-section {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.preview-stats {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8125rem;
  color: #64748b;
}

.preview-table {
  overflow-x: auto;
  margin-bottom: 1rem;
}

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

.preview-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.preview-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

.preview-table tbody tr:hover {
  background: #f8fafc;
}

.preview-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #475569;
}

/* Status Labels */
.status-new {
  color: #059669;
}

.status-duplicate {
  color: #94a3b8;
}

.status-error {
  color: #dc2626;
}

.status-cancelled {
  color: #dc2626;
  font-size: 0.8125rem;
}

/* Import Actions */
.import-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

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

.btn-primary svg {
  width: 1rem;
  height: 1rem;
}

.btn-primary.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 9999px;
}

.btn-primary.btn-sm svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* History Section */
.history-section {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
}

.history-header {
  margin-bottom: 1.25rem;
}

.history-list {
  display: grid;
  gap: 1rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  transition: all 0.2s;
}

.history-item:hover {
  background: #f1f5f9;
}

.history-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-icon {
  width: 3rem;
  height: 3rem;
  background: white;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e3a5f;
}

.history-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.history-details h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.history-details p {
  font-size: 0.8125rem;
  color: #64748b;
}

.history-stats {
  display: flex;
  gap: 2rem;
  margin-right: 2rem;
}

.history-stat {
  text-align: center;
}

.history-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.history-stat-label {
  font-size: 0.75rem;
  color: #64748b;
}

.history-actions {
  display: flex;
  gap: 0.5rem;
}

.history-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.history-btn:hover {
  border-color: #1e3a5f;
  color: #1e3a5f;
}

.history-btn.danger {
  color: #dc2626;
}

.history-btn.danger:hover {
  border-color: #dc2626;
  background: #fef2f2;
}

.history-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Spin Animation */
.spin {
  animation: spin 1s linear infinite;
}

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

/* Responsive Import */
@media (max-width: 768px) {
  .option-row {
    grid-template-columns: 1fr;
  }

  .preview-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .history-stats {
    margin-right: 0;
  }

  .column-config {
    flex-direction: column;
  }
}

/* ===================================
   Budgets Page Styles
   =================================== */

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

.add-budget-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-budget-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.add-budget-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Overview Card */
.overview-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.overview-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.period-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border-radius: 9999px;
  padding: 0.25rem;
}

.period-btn {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: #475569;
  text-decoration: none;
}

.period-btn:hover {
  color: #1e293b;
}

.period-btn.active {
  background: #1e3a5f;
  color: white;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.overview-stats .stat-item {
  text-align: center;
}

.overview-stats .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.overview-stats .stat-label {
  font-size: 0.875rem;
  color: #64748b;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.5rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.stat-change.positive {
  background: #ecfdf5;
  color: #059669;
}

.stat-change.negative {
  background: #fef2f2;
  color: #dc2626;
}

.stat-change svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Budget Grid */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.budget-card {
  background: white;
  border-radius: 1rem;
  padding: 1.75rem;
}

.budget-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.budget-info {
  flex: 1;
}

.budget-category {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.budget-card .category-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.budget-card .category-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.budget-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.budget-amounts {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.budget-spent {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.budget-total {
  font-size: 0.9375rem;
  color: #64748b;
}

.budget-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.status-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.good {
  background: #ecfdf5;
  color: #059669;
}

.status-badge.warning {
  background: #fffbeb;
  color: #d97706;
}

.status-badge.over {
  background: #fef2f2;
  color: #dc2626;
}

.budget-remaining {
  font-size: 0.875rem;
  color: #64748b;
}

.budget-remaining.positive {
  color: #059669;
}

.budget-remaining.negative {
  color: #dc2626;
}

/* Progress Bar */
.progress-bar-container {
  margin-bottom: 1rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.progress-bar {
  height: 0.625rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

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

.progress-fill.good {
  background: linear-gradient(90deg, #10b981, #059669);
}

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

.progress-fill.over {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

/* Budget Actions */
.budget-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.budget-action-btn {
  flex: 1;
  padding: 0.625rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.budget-action-btn:hover {
  border-color: #1e3a5f;
  color: #1e3a5f;
  background: #f8fafc;
}

.budget-action-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Create Budget Card */
.create-budget-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.create-budget-card:hover {
  border-color: #1e3a5f;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.create-budget-card .create-icon {
  width: 4rem;
  height: 4rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.create-budget-card .create-icon svg {
  width: 2rem;
  height: 2rem;
  color: #1e3a5f;
}

.create-budget-card .create-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.create-budget-card .create-subtitle {
  font-size: 0.875rem;
  color: #64748b;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 28rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.modal-close:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #1e293b;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions .btn-secondary,
.modal-actions .btn-primary {
  flex: 1;
}

/* Responsive Budgets */
@media (max-width: 1024px) {
  .budget-grid {
    grid-template-columns: 1fr;
  }

  .overview-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .budget-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .overview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .budget-card-header {
    flex-direction: column;
    gap: 1rem;
  }

  .budget-status {
    align-items: flex-start;
  }

  .budget-actions {
    flex-direction: column;
  }

  .budget-action-btn {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
  }
}

/* ===================================
   Budgets Page Redesign
   =================================== */

/* KPI card for budget (blue gradient for remaining) */
.kpi-card.kpi-budget-total {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.kpi-card.kpi-remaining {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.kpi-percentage {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.7;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: #64748b;
}

.filter-pill:hover {
  border-color: #1e3a5f;
  color: #1e3a5f;
}

.filter-pill.active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: white;
}

/* Categories Toolbar */
.categories-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  margin-bottom: 1.5rem;
}

.categories-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.sort-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
}

.categories-toolbar .filter-pills {
  margin-bottom: 0;
}

.form-select.form-select-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  border-radius: 9999px;
  width: auto;
}

@media (max-width: 768px) {
  .categories-toolbar {
    flex-wrap: wrap;
  }

  .categories-sort {
    width: 100%;
    margin-left: 0;
  }

  .categories-toolbar .filter-pills {
    margin-bottom: 0.75rem;
  }
}

/* Budget Cards Grid - Responsive */
.budget-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 1279px) {
  .budget-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Budget Card Compact */
.budget-card-compact {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.budget-card-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.budget-icon-small {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.budget-icon-small svg {
  width: 1.125rem;
  height: 1.125rem;
  color: white;
}

.budget-card-text {
  flex: 1;
  min-width: 0;
}

.budget-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.budget-card-amounts {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.8125rem;
  margin-top: 0.125rem;
}

.budget-card-amounts .spent {
  font-weight: 600;
  color: #1e293b;
}

.budget-card-amounts .separator {
  color: #94a3b8;
}

.budget-card-amounts .total {
  color: #64748b;
}

/* Status Pill */
.status-pill {
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  flex-shrink: 0;
}

.status-pill.good {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.warning {
  background: #fef3c7;
  color: #b45309;
}

.status-pill.over {
  background: #fee2e2;
  color: #dc2626;
}

/* Progress Bar Compact */
.budget-progress-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar-mini {
  flex: 1;
  height: 0.375rem;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill-mini {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.progress-fill-mini.good {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

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

.progress-fill-mini.over {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  min-width: 2.5rem;
  text-align: right;
}

/* Budget Card Footer */
.budget-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}

.budget-remaining-text {
  font-size: 0.75rem;
  font-weight: 500;
}

.budget-remaining-text.positive {
  color: #16a34a;
}

.budget-remaining-text.negative {
  color: #dc2626;
}

.budget-card-actions {
  display: flex;
  gap: 0.25rem;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Create Budget Card Compact */
.budget-card-create {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 120px;
}

.budget-card-create:hover {
  border-color: #1e3a5f;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.create-icon-small {
  width: 2.5rem;
  height: 2.5rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.create-icon-small svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #1e3a5f;
}

.budget-card-create span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ===================================
   Categories Page Styles
   =================================== */

/* Categories Grid - identical to budget-cards-grid */
.categories-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 1279px) {
  .categories-grid-compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .categories-grid-compact {
    grid-template-columns: 1fr;
  }
}

/* Category Card - same size as budget cards */
.category-card-compact {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

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

.category-card-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

/* Same icon size as budget cards */
.category-icon-small {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-icon-small svg {
  width: 1.125rem;
  height: 1.125rem;
  color: white;
}

.category-card-text {
  flex: 1;
  min-width: 0;
}

.category-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Same font size as budget cards */
.category-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-stats-mini {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.125rem;
}

/* Type Badge */
.type-badge {
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  flex-shrink: 0;
}

.type-badge.expense {
  background: #fee2e2;
  color: #dc2626;
}

.type-badge.income {
  background: #dcfce7;
  color: #16a34a;
}

/* Category Card Actions - same as budget */
.category-card-actions {
  display: flex;
  gap: 0.25rem;
}

/* Keywords Row - adaptive flex wrap */
.category-keywords-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
  min-width: 0;
}

.keywords-preview {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: nowrap;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.keyword-mini {
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.keywords-more {
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #1e3a5f;
  border-radius: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.keywords-more:hover {
  background: #1e3a5f;
  color: white;
}

.no-keywords-mini {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}

/* Auto Toggle Mini */
.auto-toggle-mini {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.auto-label-mini {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.auto-info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
}

.auto-info-tooltip svg {
  width: 0.75rem;
  height: 0.75rem;
}

.auto-info-tooltip:hover {
  color: #64748b;
}

.auto-info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  right: 0;
  transform: translateY(-4px);
  background: #1e293b;
  color: white;
  font-size: 0.6875rem;
  font-weight: 400;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

.auto-info-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

.toggle-switch-mini {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.toggle-switch-mini input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider-mini {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 9999px;
}

.toggle-slider-mini:before {
  position: absolute;
  content: "";
  height: 1rem;
  width: 1rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch-mini input:checked + .toggle-slider-mini {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.toggle-switch-mini input:checked + .toggle-slider-mini:before {
  transform: translateX(1rem);
}

/* Create Category Card */
.category-card-create {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 120px;
}

.category-card-create:hover {
  border-color: #1e3a5f;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.category-card-create .create-icon-small {
  width: 2.5rem;
  height: 2.5rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.category-card-create .create-icon-small svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #1e3a5f;
}

.category-card-create .create-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.category-card-create .create-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
}

/* Info Tooltip */
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  color: #94a3b8;
  margin-left: 0.25rem;
}

.info-tooltip svg {
  width: 0.875rem;
  height: 0.875rem;
}

.info-tooltip:hover {
  color: #64748b;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Actions Dropdown */
.actions-dropdown {
  position: relative;
}

.actions-btn {
  gap: 0.375rem;
}

.actions-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.12);
  min-width: 220px;
  padding: 0.5rem;
  display: none;
  z-index: 120;
}

.actions-menu.show {
  display: block;
}

.actions-item {
  width: 100%;
  border: none;
  background: none;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.actions-item:hover {
  background: #f8fafc;
  color: #1e293b;
}

.actions-item.danger {
  color: #b91c1c;
}

.actions-item.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.actions-item svg {
  width: 1rem;
  height: 1rem;
}

/* btn-secondary btn-sm */
.btn-secondary.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: white;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary.btn-sm:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-secondary.btn-sm svg {
  width: 0.875rem;
  height: 0.875rem;
}

.btn-secondary.btn-sm.loading svg {
  animation: spin 1s linear infinite;
}

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

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Category Modal Styles */
.modal-form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-label .required {
  color: #dc2626;
}

.type-selector {
  display: flex;
  gap: 0.75rem;
}

.type-option {
  flex: 1;
  cursor: pointer;
}

.type-option input {
  display: none;
}

.type-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.type-label svg {
  width: 1rem;
  height: 1rem;
}

.type-option input:checked + .type-label.expense {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.type-option input:checked + .type-label.income {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #16a34a;
}

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

.color-option {
  cursor: pointer;
}

.color-option input {
  display: none;
}

.color-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.color-option input:checked + .color-swatch {
  border-color: #1e3a5f;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

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

.icon-option {
  cursor: pointer;
}

.icon-option input {
  display: none;
}

.icon-swatch {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s;
}

.icon-swatch svg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-option input:checked + .icon-swatch {
  border-color: #1e3a5f;
  background: #1e3a5f;
  color: white;
}

/* Preset Import Modal */
.preset-modal-content {
  max-width: 60rem;
  max-height: 85vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.preset-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.preset-modal-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preset-modal-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.preset-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.preset-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.preset-select-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-list {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: grid;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 40vh;
  background: #f8fafc;
}

.preset-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.preset-item.is-selected {
  border-color: #1e3a5f;
  background: #eff6ff;
}

.preset-checkbox {
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.preset-item-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.preset-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preset-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  color: white;
}

.preset-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.preset-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
}

.preset-meta {
  font-size: 0.75rem;
  color: #64748b;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: auto;
  justify-content: flex-end;
  max-width: 45%;
}

.preset-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.preset-merge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preset-merge-label {
  font-size: 0.8125rem;
  color: #475569;
}

.preset-footer-actions {
  display: flex;
  gap: 0.75rem;
}

.preset-footer-actions .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Reset Modal */
.reset-modal-content {
  max-width: 32rem;
}

.reset-modal-body {
  display: grid;
  gap: 1rem;
}

.reset-warning {
  margin: 0;
  font-size: 0.875rem;
  color: #475569;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.reset-options {
  display: grid;
  gap: 0.75rem;
}

.reset-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
}

.reset-option input {
  margin-top: 0.25rem;
}

.reset-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: #475569;
}

.reset-option-text strong {
  font-size: 0.875rem;
  color: #0f172a;
  font-weight: 600;
}

.reset-option-subtext {
  font-size: 0.75rem;
  color: #64748b;
}

.reset-confirm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #475569;
}

@media (max-width: 768px) {
  .preset-modal-content {
    max-height: 90vh;
  }

  .preset-item-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .preset-chips {
    max-width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .preset-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .preset-footer-actions {
    width: 100%;
  }

  .preset-footer-actions .btn-secondary,
  .preset-footer-actions .btn-primary {
    flex: 1;
  }
}

/* Modal Title with Icon */
.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.modal-title svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #1e3a5f;
}

.modal-title.danger svg {
  color: #dc2626;
}

.modal-title.success svg {
  color: #16a34a;
}

.modal-small {
  max-width: 24rem;
}

.modal-body {
  padding: 1rem 0;
  color: #475569;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.modal-body .text-muted {
  color: #94a3b8;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.modal-actions.center {
  justify-content: center;
}

/* Sync Period Selector */
.sync-period-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.period-option {
  cursor: pointer;
}

.period-option input {
  display: none;
}

.period-label {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.period-option input:checked + .period-label {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border-color: #1e3a5f;
  color: white;
}

/* Mode Selector */
.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mode-option {
  cursor: pointer;
}

.mode-option input {
  display: none;
}

.mode-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.mode-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.mode-title svg {
  width: 1rem;
  height: 1rem;
  color: #64748b;
}

.mode-description {
  font-size: 0.75rem;
  color: #94a3b8;
  padding-left: 1.5rem;
}

.mode-option input:checked + .mode-content {
  background: #f0f9ff;
  border-color: #1e3a5f;
}

.mode-option input:checked + .mode-content .mode-title svg {
  color: #1e3a5f;
}

/* Result Stats */
.result-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
}

.result-stat {
  text-align: center;
}

.result-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #1e293b;
}

.result-stat.highlight .result-value {
  color: #16a34a;
}

.result-label {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Danger Button */
.btn-danger {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-danger svg {
  width: 1rem;
  height: 1rem;
}

/* Spin Animation */
.spin {
  animation: spin 1s linear infinite;
}

/* Keywords Section in Modal */
.keywords-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.keywords-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.keywords-header .form-label {
  margin-bottom: 0;
}

.keywords-count {
  font-size: 0.75rem;
  color: #94a3b8;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 0.5rem;
}

.keyword-tag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #475569;
}

.keyword-tag .remove-keyword {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0;
  border-radius: 50%;
  transition: all 0.2s;
}

.keyword-tag .remove-keyword:hover {
  background: #fee2e2;
  color: #dc2626;
}

.keyword-tag .remove-keyword svg {
  width: 0.75rem;
  height: 0.75rem;
}

.add-keyword-form {
  display: flex;
  gap: 0.5rem;
}

.add-keyword-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
}

.add-keyword-form input:focus {
  outline: none;
  border-color: #1e3a5f;
}

.add-keyword-form button {
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #475569;
  transition: all 0.2s;
}

.add-keyword-form button:hover {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: white;
}

/* ===================================
   Assets Page Styles
   =================================== */

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

.add-asset-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-asset-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.add-asset-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Net Worth Card */
.networth-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-radius: 1.25rem !important;
  padding: 2.5rem !important;
  margin-bottom: 2rem !important;
  color: white !important;
}

.networth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.networth-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.networth-value {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 600;
  color: white;
}

.networth-change {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.networth-change.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.networth-change.negative {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.networth-change svg {
  width: 1rem;
  height: 1rem;
}

.networth-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item {
  text-align: center;
}

.breakdown-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}

.breakdown-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

/* Assets Grid */
.assets-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1.5rem !important;
  margin-bottom: 2rem !important;
}

.asset-card {
  background: white !important;
  border-radius: 1rem !important;
  padding: 1.75rem !important;
}

.asset-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.asset-info {
  flex: 1;
}

.asset-type {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.asset-icon {
  width: 2.75rem !important;
  height: 2.75rem !important;
  min-width: 2.75rem !important;
  max-width: 2.75rem !important;
  border-radius: 0.75rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.asset-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
}

.asset-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.asset-current-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.current-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

.value-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.value-change.positive {
  background: #ecfdf5;
  color: #059669;
}

.value-change.negative {
  background: #fef2f2;
  color: #dc2626;
}

.value-change svg {
  width: 0.75rem;
  height: 0.75rem;
}

.asset-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
}

.asset-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #64748b;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.icon-btn.delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.asset-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-item {
  padding: 0.875rem;
  background: #f8fafc;
  border-radius: 0.625rem;
}

.metric-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.asset-chart {
  height: 120px;
  background: #f8fafc;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  padding: 0.5rem;
}

.asset-chart canvas {
  display: none;
  width: 100% !important;
  height: 100% !important;
}

.chart-placeholder {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.asset-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.last-update {
  font-size: 0.8125rem;
  color: #64748b;
}

.update-btn {
  padding: 0.5rem 1rem;
  background: #1e3a5f;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.update-btn:hover {
  background: #2d5a87;
}

.update-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Create Asset Card */
.create-asset-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.create-asset-card:hover {
  border-color: #1e3a5f;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* Update modal specific styles */
.update-asset-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Responsive Assets */
@media (max-width: 1024px) {
  .assets-grid {
    grid-template-columns: 1fr;
  }

  .networth-breakdown {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .networth-value {
    font-size: 2.5rem;
  }

  .assets-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .networth-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .networth-breakdown {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .breakdown-item {
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .breakdown-item:last-child {
    border-bottom: none;
  }

  .asset-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .update-btn {
    justify-content: center;
  }
}


/* ========================================
   ANALYSIS PAGE
   ======================================== */

/* Header */
.analysis-header {
  margin-bottom: 1.5rem;
}

.analysis-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.analysis-title-row h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.analysis-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.125rem;
}

/* Timeline filter */
.timeline-filter {
  display: flex;
  gap: 0.25rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 0.625rem;
}

.timeline-btn {
  padding: 0.4375rem 1rem;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.timeline-btn:hover {
  color: #1e293b;
}

.timeline-btn.active {
  background: #fff;
  color: #1e3a5f;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Compact KPIs row */
.analysis-kpis {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
  flex-wrap: wrap;
}

.analysis-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.analysis-kpi-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.analysis-kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
}

.analysis-kpi-value.positive {
  color: #059669;
}

.analysis-kpi-value.negative {
  color: #dc2626;
}

.analysis-kpi-sep {
  width: 1px;
  height: 2rem;
  background: #e2e8f0;
  flex-shrink: 0;
}

/* Charts grid */
.analysis-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  margin-bottom: 0.75rem;
}

.chart-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.chart-container {
  width: 100%;
  height: 340px;
  min-height: 280px;
}

/* Table section */
.analysis-table-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.analysis-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.analysis-table-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.table-search-icon {
  position: absolute;
  left: 0.625rem;
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.table-search {
  padding: 0.4375rem 0.75rem 0.4375rem 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: #1e293b;
  background: #fff;
  width: 200px;
  transition: border-color 0.15s;
}

.table-search:focus {
  outline: none;
  border-color: #1e3a5f;
}

.table-select {
  padding: 0.4375rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: #1e293b;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}

.table-select:focus {
  outline: none;
  border-color: #1e3a5f;
}

.table-clear-btn {
  padding: 0.4375rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: #64748b;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.table-clear-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.table-active-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
}

.table-clear-chip {
  border: none;
  background: transparent;
  color: #1e3a5f;
  font-size: 1.125rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.125rem;
}

.table-clear-chip:hover {
  color: #dc2626;
}

/* Table */
.analysis-table-wrap {
  overflow-x: auto;
}

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

.analysis-table thead th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.analysis-table tbody tr {
  transition: background 0.1s;
}

.analysis-table tbody tr:hover {
  background: #f8fafc;
}

.analysis-table tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.td-date {
  white-space: nowrap;
  color: #64748b;
  font-size: 0.8125rem;
}

.td-desc {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-cat {
  white-space: nowrap;
}

.td-account {
  color: #64748b;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.td-amount {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.td-amount.expense {
  color: #dc2626;
}

.td-amount.income {
  color: #059669;
}

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

.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.cat-none {
  color: #94a3b8;
}

.table-empty {
  text-align: center;
  color: #94a3b8;
  padding: 2rem 0.75rem;
  font-style: italic;
}

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.8125rem;
  color: #64748b;
}

.pagination-btns {
  display: flex;
  gap: 0.25rem;
}

.pg-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: #64748b;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s;
}

.pg-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.pg-btn.active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}

/* Premium badge in sidebar */
.sidebar-badge.premium {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: #fff;
}

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

  .analysis-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .analysis-kpis {
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }

  .analysis-kpi-sep {
    display: none;
  }

  .analysis-kpi {
    flex: 1;
    min-width: 80px;
  }
}

@media (max-width: 768px) {
  .analysis-table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-filters {
    width: 100%;
  }

  .table-search {
    width: 100%;
    flex: 1;
  }

  .chart-container {
    height: 280px;
    min-height: 240px;
  }

  .td-desc {
    max-width: 180px;
  }

  .td-account {
    display: none;
  }
}

/* ===========================
   Pre-launch Banner
   =========================== */
.prelaunch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 2rem;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  color: #e0edff;
}

.prelaunch-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

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

.prelaunch-banner-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.prelaunch-banner-link {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prelaunch-banner-link:hover {
  color: #bfdbfe;
}

.prelaunch-banner-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #e0edff;
  padding: 0.25rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.prelaunch-banner-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.prelaunch-banner-close svg {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 768px) {
  .prelaunch-banner {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }
}

/* ===========================
   Subscription Upgrade Banner
   =========================== */
.subscription-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0.875rem;
  color: #e0edff;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.subscription-upgrade-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
}

.subscription-upgrade-banner .banner-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.subscription-upgrade-banner .banner-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.subscription-upgrade-banner .banner-title {
  font-weight: 800;
  color: white;
  font-size: 0.875rem;
  margin-bottom: 0.15rem;
}

.subscription-upgrade-banner .banner-text {
  font-size: 0.875rem;
  color: #cfe3ff;
  line-height: 1.35;
}

.subscription-upgrade-banner .banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-weight: 700;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.subscription-upgrade-banner .banner-cta svg {
  width: 1rem;
  height: 1rem;
}

.readonly-content {
  pointer-events: none;
  opacity: 0.72;
  filter: grayscale(0.08);
  user-select: none;
}

.analysis-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
  background: repeating-linear-gradient(
    135deg,
    rgba(148, 163, 184, 0.10),
    rgba(148, 163, 184, 0.10) 12px,
    rgba(148, 163, 184, 0.18) 12px,
    rgba(148, 163, 184, 0.18) 24px
  );
  border-radius: 0.75rem;
}

@media (max-width: 768px) {
  .subscription-upgrade-banner {
    padding: 0.75rem 1rem;
  }
  .subscription-upgrade-banner .banner-cta {
    display: none;
  }
}

/* ===========================
   Contact Page
   =========================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.contact-form-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
}

.contact-form-card .form-group {
  margin-bottom: 1.25rem;
}

.contact-form-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.5rem;
}

.contact-form-card input[type="text"],
.contact-form-card input[type="email"],
.contact-form-card select,
.contact-form-card textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  color: #1e293b;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form-card input:focus,
.contact-form-card select:focus,
.contact-form-card textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.contact-form-card textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form-card select {
  cursor: pointer;
  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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-error {
  display: block;
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.375rem;
  min-height: 0;
}

.contact-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.contact-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.contact-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.contact-submit-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Success state */
.contact-success {
  text-align: center;
  padding: 3rem 2rem;
}

.contact-success-icon {
  color: #16a34a;
  margin-bottom: 1rem;
}

.contact-success-icon svg {
  width: 3rem;
  height: 3rem;
}

.contact-success h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.contact-success p {
  color: #64748b;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.contact-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.contact-reset-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Info sidebar */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-info-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
}

.contact-info-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e3a5f;
  margin-bottom: 0.75rem;
}

.contact-info-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-info-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.375rem;
}

.contact-info-card p {
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.5;
}

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

  .contact-info {
    flex-direction: row;
  }

  .contact-info-card {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .contact-form-card {
    padding: 1.5rem;
  }

  .contact-info {
    flex-direction: column;
  }
}
