/* ============================================
   SISTEMA DE GASTOS PREMIUM 2025
   Diseño elegante, interactivo y sin fricción
   ============================================ */

.expenses-premium {
  --exp-primary: #0e2a47;
  --exp-primary-light: #1a3d5f;
  --exp-accent: #00c2ff;
  --exp-accent-hover: #00a9e0;
  --exp-success: #1fdb8b;
  --exp-warning: #ffb84d;
  --exp-error: #ff5c5c;
  --exp-bg: #f8fafc;
  --exp-card: #ffffff;
  --exp-border: rgba(14, 42, 71, 0.1);
  --exp-text: #1e293b;
  --exp-text-soft: #64748b;
  --exp-shadow: 0 4px 20px rgba(14, 42, 71, 0.08);
  --exp-shadow-hover: 0 8px 30px rgba(14, 42, 71, 0.12);
  --exp-radius: 16px;
  --exp-radius-sm: 12px;
  --exp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  padding: 32px 24px 48px;
  background: var(--exp-bg);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ============================================
   HEADER CON ESTADÍSTICAS
   ============================================ */
.expenses-header {
  margin-bottom: 32px;
}

.expenses-header__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.expenses-header__title-group {
  flex: 1;
  min-width: 280px;
}

.expenses-header__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--exp-primary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.expenses-header__title i {
  color: var(--exp-accent);
  font-size: 28px;
}

.expenses-header__subtitle {
  margin: 0;
  color: var(--exp-text-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* Estadísticas destacadas */
.expenses-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.expense-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--exp-card);
  border-radius: var(--exp-radius-sm);
  border: 1px solid var(--exp-border);
  box-shadow: var(--exp-shadow);
  transition: var(--exp-transition);
  min-width: 160px;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
}

.stat-icon--today {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon--total {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon--month {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--exp-text-soft);
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--exp-primary);
  line-height: 1;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.expenses-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

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

/* ============================================
   FORMULARIO
   ============================================ */
.expense-form-wrapper {
  position: sticky;
  top: 100px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible; /* Permitir dropdowns */
}

@media (max-width: 1024px) {
  .expense-form-wrapper {
    position: static; /* No sticky en tablets/móvil */
  }
}

.expense-form-card {
  background: var(--exp-card);
  border-radius: var(--exp-radius);
  border: 1px solid var(--exp-border);
  box-shadow: var(--exp-shadow);
  padding: 32px; /* Aumentado de 28px */
  transition: var(--exp-transition);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible; /* Permitir que dropdowns se muestren fuera */
  position: relative;
}

@media (max-width: 768px) {
  .expense-form-card {
    padding: 20px 16px; /* Padding reducido en móvil pero consistente */
  }
}

.expense-form-card:hover {
  box-shadow: var(--exp-shadow-hover);
}

/* Quick Actions Bar */
.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 28px; /* Aumentado de 24px */
  padding-bottom: 20px;
  border-bottom: 1px solid var(--exp-border);
  flex-wrap: wrap; /* Permitir wrap en móvil */
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  color: var(--exp-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--exp-transition);
}

.quick-action-btn:hover {
  background: var(--exp-primary);
  color: white;
  border-color: var(--exp-primary);
  transform: translateY(-2px);
}

.quick-action-btn i {
  font-size: 14px;
}

.quick-action-divider {
  width: 1px;
  background: var(--exp-border);
  margin: 0 4px;
}

/* Formulario */
.expense-form {
  display: flex;
  flex-direction: column;
  gap: 24px; /* Aumentado de 20px para mejor respiración */
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Aumentado de 8px para mejor separación */
  margin-bottom: 0; /* Removido margin-bottom inconsistente */
}

.form-field--amount {
  margin-bottom: 0; /* Removido margin-bottom extra */
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--exp-text);
  margin-bottom: 0; /* Removido margin-bottom, usando gap del contenedor */
  line-height: 1.4;
}

.form-label i {
  color: var(--exp-accent);
  font-size: 14px;
}

.required {
  color: var(--exp-error);
}

/* Inputs - Estandarizados */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px; /* Aumentado de 12px para mejor touch target */
  font-size: 16px; /* Aumentado de 15px para mejor legibilidad */
  border: 2px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  background: var(--exp-card);
  color: var(--exp-text);
  transition: var(--exp-transition);
  font-family: inherit;
  box-sizing: border-box;
  min-height: 48px; /* Altura mínima consistente para accesibilidad */
  line-height: 1.5;
}

/* Prevenir zoom en iOS al enfocar inputs */
@media (max-width: 768px) {
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* 16px previene zoom automático en iOS */
  }
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--exp-accent);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.15); /* Aumentado de 0.1 */
  transform: translateY(-1px); /* Sutil elevación al enfocar */
}

/* Focus visible para accesibilidad */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--exp-accent);
  outline-offset: 2px;
}

.form-input:hover,
.form-select:hover {
  border-color: var(--exp-primary-light);
}

/* Amount Input Especial */
.amount-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.currency-symbol {
  position: absolute;
  left: 16px;
  font-size: 22px; /* Aumentado de 20px */
  font-weight: 700;
  color: var(--exp-accent);
  z-index: 1;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}

.amount-input {
  padding-left: 48px !important;
  font-size: 28px; /* Aumentado de 24px para mejor visibilidad */
  font-weight: 700;
  text-align: left;
  min-height: 56px; /* Altura mínima mayor para el campo de monto */
}

@media (max-width: 768px) {
  .amount-input {
    font-size: 24px; /* Reducido en móvil pero aún grande */
    min-height: 52px;
  }
}

.amount-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.amount-suggestion {
  padding: 6px 12px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--exp-transition);
}

.amount-suggestion:hover {
  background: var(--exp-accent);
  color: white;
  border-color: var(--exp-accent);
}

/* Select Wrapper - Mejorado */
.select-wrapper {
  position: relative;
  display: flex;
  align-items: stretch; /* Cambiado de center para mejor alineación */
  width: 100%;
}

.form-select {
  padding-right: 88px; /* Aumentado para botón + icono */
  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 48px center; /* Ajustado para botón */
  cursor: pointer;
  min-height: 48px; /* Consistente con otros inputs */
}

/* Trigger de modal para selects en móvil */
.modal-trigger-select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  font-size: 16px;
  background: var(--exp-card);
  color: var(--exp-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--exp-transition);
  min-height: 48px;
  box-sizing: border-box;
  font-family: inherit;
}

.modal-trigger-select:hover {
  border-color: var(--exp-primary-light);
}

.modal-trigger-select:focus {
  outline: none;
  border-color: var(--exp-accent);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.15);
}

.modal-trigger-select[aria-expanded="true"] {
  border-color: var(--exp-accent);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.1);
}

/* En móvil, ocultar select nativo y usar modal */
@media (max-width: 768px) {
  .form-select {
    /* El select nativo se oculta y se reemplaza por trigger */
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  
  /* Asegurar que el trigger sea visible */
  .modal-trigger-select {
    position: relative;
    z-index: 1;
  }
}

.select-add-btn {
  position: absolute;
  right: 8px;
  width: 36px; /* Aumentado de 32px */
  height: 36px; /* Aumentado de 32px */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--exp-bg);
  border: 1px solid var(--exp-border);
  border-radius: 8px;
  color: var(--exp-text-soft);
  cursor: pointer;
  transition: var(--exp-transition);
  z-index: 2; /* Aumentado de 1 */
  flex-shrink: 0;
  top: 50%;
  transform: translateY(-50%);
}

.select-add-btn:hover {
  background: var(--exp-accent);
  color: white;
  border-color: var(--exp-accent);
  transform: scale(1.1);
}

/* Autocomplete - Mejorado */
.input-with-autocomplete {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--exp-card);
  border: 2px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  box-shadow: 0 8px 24px rgba(14, 42, 71, 0.15);
  max-height: 240px; /* Aumentado de 200px */
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000; /* Aumentado de 100 */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (max-width: 768px) {
  .autocomplete-dropdown {
    max-height: 200px; /* Más pequeño en móvil */
    border-radius: 12px;
  }
}

.autocomplete-item {
  padding: 14px 16px; /* Aumentado de 12px */
  cursor: pointer;
  transition: var(--exp-transition);
  border-bottom: 1px solid var(--exp-border);
  min-height: 48px; /* Altura mínima para touch */
  display: flex;
  align-items: center;
  font-size: 15px;
  line-height: 1.5;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--exp-bg);
  color: var(--exp-accent);
}

.autocomplete-item.hidden {
  display: none;
}

/* Form Row - Mejorado */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; /* Espaciado consistente */
  align-items: start; /* Alineación superior para labels de diferentes alturas */
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 24px; /* Más espacio en móvil */
  }
}

/* Campos Opcionales - Mejorado */
.form-optional {
  margin-top: 4px; /* Reducido de 8px */
  margin-bottom: 0;
}

.optional-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  color: var(--exp-text-soft);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--exp-transition);
}

.optional-toggle:hover {
  background: var(--exp-primary);
  color: white;
  border-color: var(--exp-primary);
}

.optional-toggle i {
  transition: transform 0.3s ease;
}

.optional-toggle.active i {
  transform: rotate(180deg);
}

.optional-fields {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 12px;
}

.optional-fields.active {
  max-height: 500px;
  margin-top: 16px; /* Aumentado de 12px */
  animation: slideDown 0.3s ease;
}

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

.optional-fields .form-field {
  margin-bottom: 16px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px; /* Aumentado de 80px */
  padding: 14px 16px; /* Consistente con otros inputs */
  line-height: 1.6;
  font-family: inherit;
}

@media (max-width: 768px) {
  .form-textarea {
    min-height: 90px;
  }
}

/* Acciones del Formulario - Mejorado */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 24px; /* Aumentado de 20px */
  border-top: 1px solid var(--exp-border);
  position: sticky; /* Fijar en la parte inferior al hacer scroll */
  bottom: 0;
  background: var(--exp-card);
  z-index: 10;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    margin-top: 16px;
  }
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px; /* Consistente */
  font-size: 15px;
  font-weight: 600;
  min-height: 48px; /* Altura mínima para accesibilidad */
  border-radius: var(--exp-radius-sm);
  transition: var(--exp-transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  border: none;
  border-radius: var(--exp-radius-sm);
  cursor: pointer;
  transition: var(--exp-transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--exp-primary) 0%, var(--exp-primary-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 42, 71, 0.2);
  flex: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 42, 71, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--exp-bg);
  color: var(--exp-text);
  border: 2px solid var(--exp-border);
}

.btn-secondary:hover {
  background: var(--exp-text-soft);
  color: white;
  border-color: var(--exp-text-soft);
}

.btn-submit {
  position: relative;
}

.submit-shortcut {
  margin-left: auto;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* ============================================
   HISTORIAL
   ============================================ */
.expense-history-wrapper {
  position: sticky;
  top: 100px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.expense-history-card {
  background: var(--exp-card);
  border-radius: var(--exp-radius);
  border: 1px solid var(--exp-border);
  box-shadow: var(--exp-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.history-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--exp-border);
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.history-header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.history-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--exp-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-title i {
  color: var(--exp-accent);
}

.history-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 6px 14px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-border);
  border-radius: 8px;
  color: var(--exp-text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--exp-transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--exp-primary);
  color: white;
  border-color: var(--exp-primary);
}

.history-search {
  position: relative;
  display: flex;
  align-items: center;
}

.history-search i {
  position: absolute;
  left: 14px;
  color: var(--exp-text-soft);
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font-size: 14px;
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  background: var(--exp-card);
  color: var(--exp-text);
  transition: var(--exp-transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--exp-accent);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.1);
}

.history-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.expense-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Item de gasto */
.expense-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  transition: var(--exp-transition);
  cursor: pointer;
}

.expense-item:hover {
  transform: translateX(4px);
  border-color: var(--exp-accent);
  box-shadow: var(--exp-shadow);
}

.expense-item__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--exp-primary) 0%, var(--exp-primary-light) 100%);
}

.expense-item__content {
  flex: 1;
  min-width: 0;
}

.expense-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--exp-text);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--exp-text-soft);
}

.expense-item__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(14, 42, 71, 0.08);
  border-radius: 12px;
  font-weight: 500;
}

.expense-item__category {
  display: inline-block;
}

.expense-item__date {
  display: inline-block;
}

.expense-item__amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--exp-primary);
  white-space: nowrap;
}

.expense-item__actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.expense-item:hover .expense-item__actions {
  opacity: 1;
}

.expense-item__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--exp-transition);
  font-size: 14px;
}

.expense-item__btn--edit {
  background: var(--exp-bg);
  color: var(--exp-accent);
  border: 1px solid var(--exp-border);
}

.expense-item__btn--edit:hover {
  background: var(--exp-accent);
  color: white;
}

.expense-item__btn--delete {
  background: var(--exp-bg);
  color: var(--exp-error);
  border: 1px solid var(--exp-border);
}

.expense-item__btn--delete:hover {
  background: var(--exp-error);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--exp-text-soft);
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--exp-bg);
  border-radius: 50%;
  color: var(--exp-text-soft);
  font-size: 36px;
}

.empty-state h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--exp-text);
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .expenses-layout {
    grid-template-columns: 1fr;
  }

  .expense-form-wrapper,
  .expense-history-wrapper {
    position: static;
  }

  .expense-history-card {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .expenses-premium {
    padding: 20px 12px 32px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .expenses-header {
    margin-bottom: 24px;
  }

  .expenses-header__content {
    flex-direction: column;
    gap: 20px;
    width: 100%;
  }

  .expenses-header__title-group {
    min-width: 0;
    width: 100%;
  }

  .expenses-header__title {
    font-size: 24px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .expenses-header__title i {
    font-size: 22px;
  }

  .expenses-header__subtitle {
    font-size: 14px;
  }

  .expenses-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .expense-stat-card {
    flex: 1;
    min-width: 0;
    padding: 12px 10px;
    gap: 8px;
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .stat-content {
    gap: 4px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-value {
    font-size: 14px;
  }

  .expenses-layout {
    gap: 16px;
    width: 100%;
    max-width: 100%;
  }

  .expense-form-wrapper,
  .expense-history-wrapper {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  .expense-form-card {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .quick-actions {
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 16px;
  }

  .quick-action-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
    justify-content: center;
  }

  .quick-action-btn span {
    display: none;
  }

  .form-field {
    width: 100%;
    max-width: 100%;
  }

  .form-label {
    font-size: 13px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 15px;
    padding: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .amount-input-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .form-row {
    gap: 12px;
  }

  .form-actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }

  .expense-history-card {
    padding: 16px;
    max-height: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .history-header {
    padding: 12px 0;
  }

  .history-header h3 {
    font-size: 18px;
  }

  .expense-item {
    padding: 12px;
    gap: 12px;
  }

  .expense-item__content {
    min-width: 0;
    flex: 1;
  }

  .expense-item__description {
    font-size: 14px;
  }

  .expense-item__meta {
    font-size: 12px;
  }

  .expense-item__amount {
    font-size: 16px;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .expenses-premium {
    padding: 16px 10px 24px;
  }

  .expenses-header__title {
    font-size: 20px;
  }

  .expenses-header__subtitle {
    font-size: 13px;
  }

  .expenses-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .expense-stat-card {
    flex-direction: row;
    text-align: left;
    padding: 10px 12px;
  }

  .expense-form-card {
    padding: 12px;
  }

  .quick-actions {
    gap: 4px;
  }

  .quick-action-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: 10px;
    font-size: 14px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .expense-item {
    padding: 10px;
    flex-wrap: wrap;
  }

  .expense-item__actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expense-item {
  animation: slideIn 0.3s ease;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  animation: pulse 2s infinite;
}

/* ============================================
   UTILIDADES
   ============================================ */
.hidden {
  display: none !important;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
