:root {
  --bg-color: #12141d;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #a0a4b8;
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --red-expense: #ef4444;
  --panel-radius: 16px;
  --transition-speed: 0.3s;
}

:root.light-theme {
  --bg-color: #f1f5f9;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(0, 0, 0, 0.1);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --accent-green: #059669;
  --accent-green-hover: #047857;
  --red-expense: #dc2626;
}

[v-cloak] {
  display: none !important;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  width: 100%;
}

/* App Container */
#app {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.center-content.full-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.app-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
  background: var(--glass-bg);
  /* Se elimina backdrop-filter para mejorar FPS dramáticamente en Android */
  border: 1px solid var(--glass-border);
  border-radius: var(--panel-radius);
  padding: 20px;
  transform: translateZ(0); /* Aceleración por hardware */
  will-change: transform;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.glass-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.text-center { text-align: center; }
.text-left { text-align: left; }

/* Typography */
h1, h2, h3, h4 { font-weight: 600; }
p, span, label { font-size: 1rem; }
.text-sm { font-size: 0.875rem; color: var(--text-secondary); }
.text-xl { font-size: 1.5rem; font-weight: bold; }
.text-2xl { font-size: 2rem; font-weight: bold; }
.text-accent { color: var(--accent-green); }
.text-danger { color: var(--red-expense); }

/* Buttons */
.btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent-green); color: #fff; border: none; }
.btn-primary:hover:not(:disabled) { background: var(--accent-green-hover); }

/* Inputs */
.input-group { margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.875rem; }
.input {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent-green); }

/* Headers */
.header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.nav-bar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 1.1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); }
.active-nav {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; margin-bottom: 16px;}
.balance-split { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--glass-border); padding-top: 16px;}

/* Tabs Container */
.tabs-container {
  display: flex;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--glass-border);
}
.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}
.tab-btn.active { background: var(--glass-bg); color: var(--text-primary); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.tab-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; }
.envelope-card { cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; min-height: 120px; overflow: hidden; padding: 14px; }
.envelope-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 6px; width: 100%; }
.envelope-title { font-weight: 600; font-size: 0.95rem; flex: 1 1 auto; min-width: 0; word-break: normal; overflow-wrap: normal; line-height: 1.2; }
.envelope-amount { font-size: clamp(1.1rem, 6vw, 1.5rem); font-weight: bold; margin-top: auto; transition: 0.3s; word-wrap: break-word; }
.badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.shared-badge { background: #3b82f6; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; }
.fixed-badge { background: #8b5cf6; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal-content {
  width: 100%; max-width: 400px;
  animation: slideUp 0.3s ease-out;
}

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

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 26px; border: 1px solid var(--glass-border); }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-green); border-color: var(--accent-green);}
input:checked + .slider:before { transform: translateX(24px); }

/* Spacing under app for nav */
.content-area { padding-bottom: 40px; }

/* Nuevas Extensiones UI */
.transaction-item:last-child { border-bottom: none !important; }
.selected-card {
   border-color: var(--accent-green) !important;
   background: rgba(16, 185, 129, 0.1) !important;
}
.multi-select-overlay {
   position: absolute;
   top: 10px;
   right: 10px;
   background: var(--accent-green);
   color: white;
   border-radius: 50%;
   width: 24px;
   height: 24px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 0.8rem;
   box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.envelope-card { position: relative; }
