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

:root {
  --emerald: #047857;
  --emerald-dark: #065f46;
  --sage: #6ee7b7;
  --sage-light: #d1fae5;
  --mint: #a7f3d0;
  --forest: #064e3b;
  --cream: #fffbeb;
  --warm-white: #fefce8;
  --coral: #fb923c;
  --gold: #f59e0b;
  --sand: #fef3c7;
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #6b7280;
}

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

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text-dark);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.fiopli-dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--cream);
}

/* ========================================
   SIDEBAR
   ======================================== */
.dashboard-sidebar {
  background: white;
  border-right: 3px solid var(--mint);
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

.pixel-bg {
  position: absolute;
  opacity: 0.08;
  pointer-events: none;
}

.pixel-bg-1 {
  top: 20%;
  right: 10%;
  width: 50px;
  height: 50px;
  background:
    linear-gradient(90deg, var(--emerald) 0%, var(--emerald) 20%, transparent 20%, transparent 40%, var(--emerald) 40%, var(--emerald) 60%, transparent 60%, transparent 80%, var(--emerald) 80%),
    linear-gradient(0deg, var(--sage) 0%, var(--sage) 20%, transparent 20%, transparent 40%, var(--sage) 40%, var(--sage) 60%, transparent 60%, transparent 80%, var(--sage) 80%);
  animation: pixelFloat 10s ease-in-out infinite;
}

.pixel-bg-2 {
  bottom: 30%;
  left: 5%;
  width: 40px;
  height: 40px;
  background:
    linear-gradient(90deg, var(--mint) 0%, var(--mint) 33%, transparent 33%, transparent 66%, var(--mint) 66%),
    linear-gradient(0deg, var(--emerald) 0%, var(--emerald) 33%, transparent 33%, transparent 66%, var(--emerald) 66%);
  animation: pixelFloat 12s ease-in-out infinite;
  animation-delay: 2s;
}

.pixel-bg-3 {
  top: 60%;
  right: 15%;
  width: 35px;
  height: 35px;
  background:
    linear-gradient(90deg, var(--sage-light) 0%, var(--sage-light) 25%, transparent 25%, transparent 50%, var(--sage-light) 50%, var(--sage-light) 75%, transparent 75%),
    linear-gradient(0deg, var(--mint) 0%, var(--mint) 25%, transparent 25%, transparent 50%, var(--mint) 50%, var(--mint) 75%, transparent 75%);
  animation: pixelFloat 14s ease-in-out infinite;
  animation-delay: 4s;
}

@keyframes pixelFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-10px, -15px); }
}

.sidebar-logo-link {
  text-decoration: none;
  display: block;
  padding: 0 1.5rem;
  margin-bottom: 2.5rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  animation: grow 3s ease-in-out infinite;
}

@keyframes grow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.logo-text {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  list-style: none;
  padding: 0 0.75rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-nav li {
  display: block;
  width: 100%;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.375rem;
  color: var(--text-medium);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s;
  border: 2px solid transparent;
  width: 100%;
}

.sidebar-nav-item:hover {
  background: var(--sage-light);
  color: var(--emerald-dark);
  border-color: var(--mint);
}

.sidebar-nav-item.active {
  background: var(--emerald);
  color: white;
  border-color: var(--emerald-dark);
}

.nav-icon {
  font-size: 1.25rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.dashboard-main {
  padding: 2.5rem 3rem;
  position: relative;
  z-index: 1;
  max-width: 1400px;
}

.dash-header {
  margin-bottom: 2.5rem;
}

.header-greeting {
  animation: fadeInUp 0.5s ease-out;
}

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

.greeting-date {
  font-size: 0.8125rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.greeting-title {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--forest);
  letter-spacing: -0.02em;
}

/* Alerts */
.dash-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  font-weight: 600;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dash-alert-success {
  background: var(--sage-light);
  border: 2px solid var(--emerald);
  color: var(--emerald-dark);
}

.dash-alert-error {
  background: rgba(251, 146, 60, 0.1);
  border: 2px solid var(--coral);
  color: #c2410c;
}

/* Stats Cards */
.stats-cards {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: white;
  border: 3px solid var(--mint);
  border-radius: 24px;
  padding: 1.75rem;
  display: flex;
  gap: 1rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.15);
  border-color: var(--emerald);
}

.stat-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.stat-card-content {
  flex: 1;
}

.stat-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-medium);
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.stat-card-value {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--forest);
  letter-spacing: -0.02em;
}

/* Empty State */
.empty-state-card {
  background: white;
  border: 3px dashed var(--mint);
  border-radius: 32px;
  padding: 4rem 3rem;
  text-align: center;
  margin-bottom: 3rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.empty-state-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 1rem;
}

.empty-state-text {
  color: var(--text-medium);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 2rem;
  background: var(--emerald);
  color: white;
  text-decoration: none;
  border-radius: 32px;
  font-weight: 700;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(4, 120, 87, 0.25);
}

.empty-state-btn:hover {
  background: var(--emerald-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(4, 120, 87, 0.35);
}

.btn-arrow {
  font-size: 1.125rem;
  transition: transform 0.3s;
}

.empty-state-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Sections */
.dash-section {
  margin-bottom: 3rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading-title {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.5rem;
}

.section-heading-meta {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Form Container */
.form-container {
  max-width: 700px;
}

.form-card {
  background: white;
  border: 3px solid var(--mint);
  border-radius: 24px;
  padding: 2.5rem;
}

.form-card-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 2px dashed var(--mint);
}

.form-card-icon {
  font-size: 3rem;
  line-height: 1;
}

.form-card-title {
  font-family: 'Fraunces', serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.5rem;
}

.form-card-subtitle {
  color: var(--text-medium);
  font-size: 1rem;
}

/* Form Fields */
.fiopli-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

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

.form-field {
  display: flex;
  flex-direction: column;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--forest);
  margin-bottom: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  background: white;
  border: 2px solid var(--mint);
  border-radius: 16px;
  transition: all 0.3s;
  color: var(--text-dark);
}

.field-input:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 4px 20px rgba(4, 120, 87, 0.15);
}

.field-input::placeholder {
  color: var(--text-light);
}

.field-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* Info Box */
.form-info-box {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--sage-light);
  border: 2px solid var(--mint);
  border-radius: 16px;
}

.info-box-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.info-box-title {
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.info-box-text {
  color: var(--text-medium);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--mint);
}

.btn-submit {
  padding: 1.1rem 2.5rem;
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(4, 120, 87, 0.25);
}

.btn-submit:hover {
  background: var(--emerald-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(4, 120, 87, 0.35);
}

.btn-cancel {
  padding: 1.1rem 2.5rem;
  background: transparent;
  color: var(--text-medium);
  border: 2px solid var(--mint);
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-cancel:hover {
  background: rgba(251, 146, 60, 0.1);
  border-color: var(--coral);
  color: var(--coral);
}

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

  .dashboard-sidebar {
    display: none;
  }

  .dashboard-main {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: 1.5rem;
  }

  .greeting-title {
    font-size: 2rem;
  }

  .form-card {
    padding: 1.75rem;
  }

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

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

  .btn-submit,
  .btn-cancel {
    width: 100%;
    text-align: center;
  }
}

/* ========================================
   BUDGET SPECIFIC STYLES
   ======================================== */

/* Budget Cards Grid */
.budgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.budget-card {
  background: white;
  border: 3px solid var(--mint);
  border-radius: 24px;
  padding: 2rem;
  transition: all 0.3s;
  display: block;
}

.budget-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.15);
  border-color: var(--emerald);
}

.budget-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px dashed var(--mint);
}

.budget-card-title h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.375rem;
}

.budget-card-date {
  font-size: 0.8125rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.budget-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.budget-card-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.budget-stat {
  flex: 1;
  text-align: center;
}

.budget-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-medium);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.budget-stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--forest);
}

.budget-stat-value.income-value {
  color: var(--emerald);
}

.budget-stat-value.expense-value {
  color: var(--coral);
}

.budget-stat-value.net-positive {
  color: var(--emerald);
}

.budget-stat-value.net-negative {
  color: var(--coral);
}

.budget-stat-divider {
  width: 2px;
  height: 40px;
  background: var(--mint);
}

.budget-card-footer {
  text-align: center;
}

.budget-card-link {
  font-weight: 600;
  color: var(--emerald);
  font-size: 0.9375rem;
}

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

.transaction-item {
  background: white;
  border: 2px solid var(--mint);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: all 0.3s;
}

.transaction-item:hover {
  border-color: var(--emerald);
  box-shadow: 0 4px 16px rgba(4, 120, 87, 0.1);
}

.transaction-icon {
  font-size: 2rem;
  line-height: 1;
}

.transaction-content {
  flex: 1;
}

.transaction-category {
  font-weight: 700;
  color: var(--forest);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.transaction-description {
  color: var(--text-medium);
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}

.transaction-date {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.transaction-amount {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
}

.transaction-amount.amount-income {
  color: var(--emerald);
}

.transaction-amount.amount-expense {
  color: var(--coral);
}

/* Action Buttons */
.btn-secondary {
  padding: 0.875rem 1.75rem;
  background: white;
  color: var(--emerald);
  border: 2px solid var(--emerald);
  border-radius: 32px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--emerald);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(4, 120, 87, 0.25);
}

.btn-danger {
  padding: 0.875rem 1.75rem;
  background: white;
  color: var(--coral);
  border: 2px solid var(--coral);
  border-radius: 32px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
}

.btn-danger:hover {
  background: var(--coral);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.25);
}

/* Goals List */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.goal-card {
  background: white;
  border: 3px solid var(--mint);
  border-radius: 24px;
  padding: 2rem;
  transition: all 0.3s;
}

.goal-card:hover {
  border-color: var(--emerald);
  box-shadow: 0 4px 16px rgba(4, 120, 87, 0.1);
}

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

.goal-card-name {
  font-family: 'Fraunces', serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--forest);
}

.goal-card-amount {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--emerald);
}

.goal-progress-wrap {
  margin-bottom: 1rem;
}

.goal-progress-bar {
  width: 100%;
  height: 12px;
  background: var(--sage-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.goal-progress-fill {
  height: 100%;
  background: var(--emerald);
  border-radius: 12px;
  transition: width 0.3s ease;
}

.goal-progress-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.goal-current,
.goal-target {
  font-weight: 700;
  color: var(--forest);
}

.goal-slash {
  color: var(--text-light);
}

.goal-percent {
  margin-left: auto;
  font-weight: 700;
  color: var(--emerald);
}

.goal-card-footer {
  font-size: 0.875rem;
  color: var(--text-medium);
  padding-top: 1rem;
  border-top: 2px dashed var(--mint);
}

/* Quick Actions */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.quick-action-card {
  background: white;
  border: 2px solid var(--mint);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
  transition: all 0.3s;
}

.quick-action-card:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(4, 120, 87, 0.15);
}

.quick-action-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.quick-action-text {
  flex: 1;
}

.quick-action-title {
  font-weight: 700;
  color: var(--forest);
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.quick-action-desc {
  color: var(--text-medium);
  font-size: 0.875rem;
}

.quick-action-arrow {
  font-size: 1.5rem;
  color: var(--emerald);
  transition: transform 0.3s;
}

.quick-action-card:hover .quick-action-arrow {
  transform: translateX(4px);
}

/* Stat Card Meta */
.stat-card-meta {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 0.375rem;
  font-weight: 500;
}

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

  .budget-card-stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .budget-stat-divider {
    width: 100%;
    height: 2px;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .transaction-amount {
    align-self: flex-end;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}
