/* Variables CSS y Temas */
:root {
  --bg-app: #f4f5f7;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-main: #e2e8f0;
  --color-brand: #0ea5e9;
  --color-accent: #ff5722;
}

html.dark {
  --bg-app: #090d16;
  --bg-card: #131b2e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-main: #1e293b;
  --color-brand: #38bdf8;
  --color-accent: #ff7043;
}

/* Tipografía */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

/* Estilos de Tarjetas */
.cashflix-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cashflix-card:hover {
  border-color: rgba(255, 87, 34, 0.2);
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Enlaces del Sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  space-x: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  text-decoration: none;
  gap: 0.75rem;
}

.sidebar-link:hover {
  background-color: rgba(255, 87, 34, 0.06);
  color: var(--text-main);
}

.sidebar-link.active {
  background-color: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-main);
}

/* Mobile Nav Links */
.mobile-nav-btn {
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

/* Selector de Períodos (Este Mes / Mes Anterior / Este Año) */
.period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border-radius: 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.period-btn:hover {
  color: var(--text-main);
}

.period-btn.active {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html.dark .period-btn.active {
  background-color: #1e293b !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Botones de Unidades / Meses / Hípicos en Modales */
.unit-btn, .sp-unit-btn {
  background-color: var(--bg-app);
  color: var(--text-muted);
  transition: all 0.15s ease;
  cursor: pointer;
}

.unit-btn:hover, .sp-unit-btn:hover {
  color: var(--text-main);
}

.unit-btn.active {
  background-color: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.sp-unit-btn.active {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* Modales */
.modal-overlay {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Bottom Tab Bar (Mobile) */
.bottom-tab-bar {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-main);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-main);
  border-radius: 9999px;
}
