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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --accent-hover: #7d6ff0;
  
  --error: #ff6b6b;
  --success: #51cf66;
  --warning: #fcc419;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --bottom-nav-height: 64px;
  --top-nav-height: 60px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Backgrounds Animados */
.bg-gradient {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(108, 92, 231, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 100%, rgba(99, 110, 255, 0.05) 0%, transparent 50%),
              var(--bg-primary);
}
.bg-noise {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 600px;
  margin: 0 auto; /* Simulando app mobile no desktop */
  position: relative;
  background: var(--bg-primary);
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

@media (min-width: 601px) {
  .app {
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
}

/* Top Nav */
.top-nav {
  height: var(--top-nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.icon-btn {
  background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-primary);
  transition: transform 0.2s;
}
.icon-btn:hover { transform: scale(1.1); }

/* Content Area */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
}
.loader {
  text-align: center; color: var(--text-muted); margin-top: 40px;
}

/* Bottom Nav */
.bottom-nav {
  height: var(--bottom-nav-height);
  position: fixed;
  bottom: 0; width: 100%; max-width: 600px;
  background: rgba(18, 18, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  text-decoration: none;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; height: 100%;
  transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
  color: var(--accent);
}
.nav-icon { font-size: 1.4rem; margin-bottom: 2px; }
.nav-label { font-size: 0.65rem; font-weight: 500; }

/* Dashboard Cards */
.dash-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 24px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column;
}
.dash-card.full { grid-column: 1 / -1; }
.dash-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }
.dash-value { font-size: 1.8rem; font-weight: 700; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* Lists & Items */
.list-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.list-title { font-size: 1.1rem; font-weight: 600; }
.btn-sm {
  background: var(--accent); color: white; border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
}
.item-icon { font-size: 1.8rem; }
.item-details { flex: 1; }
.item-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.item-subtitle { color: var(--text-secondary); font-size: 0.8rem; }
.item-amount { font-weight: 700; font-size: 1.05rem; }

/* Modal & Forms */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 100; display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 601px) { .modal-overlay { align-items: center; } }
.modal-content {
  background: var(--bg-secondary); border-top-left-radius: var(--radius-xl); border-top-right-radius: var(--radius-xl);
  width: 100%; max-width: 600px; padding: 24px; animation: slideUp 0.3s ease-out;
  border-top: 1px solid var(--border-subtle);
}
@media (min-width: 601px) {
  .modal-content { border-radius: var(--radius-xl); border: 1px solid var(--border-subtle); }
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 0.95rem;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent); outline: none;
}
.btn-block {
  width: 100%; padding: 14px; background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); font-weight: 600; font-size: 1rem; cursor: pointer; margin-top: 10px;
}
.btn-danger { background: var(--error); margin-top: 10px; }

/* Utils */
.flex-row { display: flex; gap: 12px; }
.flex-row > * { flex: 1; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; background: rgba(255,255,255,0.1); }

@keyframes slideUp {
  from { transform: translateY(100%); } to { transform: translateY(0); }
}

/* Toast */
.toast-container {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 400px;
}
.toast {
  background: var(--success); color: var(--bg-primary); padding: 12px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; }
}
