/* =============================================
   GESTIÓN DE GASTOS v2.0 — Mobile First CSS
   ============================================= */

/* ── Variables ─────────────────────────────── */
:root {
  --primary:       #1a56db;
  --primary-dark:  #003366;
  --primary-light: #e8f0fe;
  --success:       #16a34a;
  --success-light: #dcfce7;
  --warning:       #d97706;
  --warning-light: #fef3c7;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --info:          #0284c7;
  --info-light:    #e0f2fe;
  --purple:        #7c3aed;
  --purple-light:  #ede9fe;

  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --bg:            #f1f5f9;
  --bg-alt:        #e2e8f0;
  --card:          #ffffff;
  --border:        #e2e8f0;
  --border-focus:  #1a56db;

  --nav-h:         60px;
  --bnav-h:        64px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.05);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.dark {
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --bg:         #0f172a;
  --bg-alt:     #1e293b;
  --card:       #1e293b;
  --border:     #334155;
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

/* ── Layout ────────────────────────────────── */
.page-wrap { min-height: 100vh; padding-top: var(--nav-h); }
.page-wrap.has-bnav { padding-bottom: calc(var(--bnav-h) + 16px); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px; }

@media (min-width: 768px)  { .container { padding: 24px; } }
@media (min-width: 1024px) { .container { padding: 24px 32px; } }

/* ── Top Navbar (Admin) ────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--primary-dark);
  color: white; z-index: 100;
  display: flex; align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  gap: 8px;
}
.nav-brand {
  font-size: 1.05rem; font-weight: 700; color: white;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; opacity: .9; }
.nav-spacer { flex: 1; }
.nav-links { display: none; align-items: center; gap: 2px; }
.nav-links a {
  color: rgba(255,255,255,.8); padding: 6px 10px;
  border-radius: var(--radius-sm); font-size: .83rem; font-weight: 500;
  transition: background .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,.15); color: white; text-decoration: none;
}
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-user { font-size: .78rem; color: rgba(255,255,255,.7); display: none; }

/* Hamburger */
.nav-hamburger {
  background: none; border: none; color: white; cursor: pointer;
  padding: 8px; display: flex; flex-direction: column; gap: 5px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: white;
  border-radius: 2px; transition: transform .25s, opacity .25s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Drawer mobile */
.nav-drawer {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--primary-dark); z-index: 99;
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  transform: translateY(-110%); transition: transform .25s ease;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateY(0); }
.nav-drawer a {
  color: rgba(255,255,255,.85); padding: 13px 16px;
  border-radius: var(--radius-sm); font-size: .95rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px; transition: background .15s;
}
.nav-drawer a:hover, .nav-drawer a.active {
  background: rgba(255,255,255,.15); color: white; text-decoration: none;
}
.drawer-sep { height: 1px; background: rgba(255,255,255,.1); margin: 6px 0; }
.drawer-label {
  font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: .08em; padding: 8px 16px 2px;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-user { display: block; }
  .nav-hamburger { display: none; }
  .nav-drawer { display: none !important; }
}

/* ── Bottom Nav (Portal) ───────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bnav-h);
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; align-items: stretch; z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; color: var(--text-muted);
  font-size: .62rem; font-weight: 500; text-decoration: none;
  padding: 8px 4px; transition: color .15s; position: relative;
}
.bnav-item:hover { text-decoration: none; }
.bnav-icon { font-size: 1.35rem; line-height: 1; }
.bnav-item.active { color: var(--primary); }
.bnav-item.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 3px; background: var(--primary); border-radius: 0 0 3px 3px;
}
.bnav-badge {
  position: absolute; top: 6px; right: 50%; margin-right: -18px;
  background: var(--danger); color: white;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .page-wrap.has-bnav { padding-bottom: 16px; }
}

/* ── Portal header ─────────────────────────── */
.portal-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); background: var(--primary-dark);
  color: white; z-index: 100;
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.ph-title { flex: 1; font-weight: 700; font-size: 1.05rem; }
.ph-user  { font-size: .78rem; color: rgba(255,255,255,.7); }

/* ── Cards ─────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  gap: 8px; flex-wrap: wrap;
}
.card-header h2 { font-size: .95rem; font-weight: 600; }
.card-body { padding: 16px; }
.card-footer {
  padding: 11px 16px; border-top: 1px solid var(--border); background: var(--bg);
}

/* ── Stats ─────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 12px; margin-bottom: 16px;
}
@media (min-width: 480px) { .stats-grid { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4,1fr); gap: 16px; } }

.stat-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px; box-shadow: var(--shadow);
}
.stat-label {
  font-size: .7rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.stat-value { font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-sub   { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.stat-card.primary { border-left: 3px solid var(--primary); }
.stat-card.success { border-left: 3px solid var(--success); }
.stat-card.warning { border-left: 3px solid var(--warning); }
.stat-card.danger  { border-left: 3px solid var(--danger); }
.stat-card.purple  { border-left: 3px solid var(--purple); }

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: .875rem; font-weight: 500; font-family: var(--font);
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  line-height: 1.4; white-space: nowrap; text-decoration: none; user-select: none;
  min-height: 40px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary   { background: var(--primary);  color: white; }
.btn-primary:hover { background: #1447c0; }
.btn-success   { background: var(--success);  color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: var(--danger);   color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning   { background: var(--warning);  color: white; }
.btn-warning:hover { background: #b45309; }
.btn-secondary { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

.btn-sm    { padding: 5px 10px; font-size: .78rem; min-height: 32px; }
.btn-lg    { padding: 13px 20px; font-size: 1rem; min-height: 48px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Badges ────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px;
  font-size: .7rem; font-weight: 600;
}
.badge-primary   { background: var(--primary-light);  color: var(--primary); }
.badge-success   { background: var(--success-light);  color: var(--success); }
.badge-warning   { background: var(--warning-light);  color: var(--warning); }
.badge-danger    { background: var(--danger-light);   color: var(--danger); }
.badge-info      { background: var(--info-light);     color: var(--info); }
.badge-secondary { background: var(--bg-alt);         color: var(--text-muted); }
.badge-purple    { background: var(--purple-light);   color: var(--purple); }

/* ── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.flabel {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 5px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="tel"],
input[type="url"], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9375rem; font-family: var(--font);
  color: var(--text); background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
textarea { resize: vertical; min-height: 80px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.form-label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 12px; transition: background .2s;
}
.toggle input:checked + .toggle-track { background: var(--success); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s; pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Alerts ────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 14px;
}
.alert-success { background: var(--success-light); color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: var(--danger-light);  color: #b91c1c; border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-light);    color: #0369a1; border: 1px solid #7dd3fc; }

/* ── Tables ────────────────────────────────── */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  padding: 9px 12px; text-align: left;
  font-size: .7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Modal ─────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  align-items: center; justify-content: center; padding: 16px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.4rem; line-height: 1;
  padding: 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--bg-alt); }
.modal-body   { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Login ─────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 16px;
  background: linear-gradient(135deg, #003366 0%, #1a56db 100%);
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 28px 22px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-icon { font-size: 48px; margin-bottom: 8px; }
.login-logo h1 { font-size: 1.25rem; color: var(--primary-dark); }
.login-logo p  { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }
body.dark .login-logo h1 { color: #93c5fd; }

/* ── Filtros ───────────────────────────────── */
.filter-bar {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 130px; flex: 1; }
.filter-group label {
  font-size: .7rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
}

/* ── Permisos ──────────────────────────────── */
.permisos-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 600px) { .permisos-grid { grid-template-columns: 1fr 1fr; } }
.permiso-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--bg);
  border-radius: var(--radius-sm); border: 1px solid var(--border); gap: 12px;
}
.permiso-label { font-size: .875rem; color: var(--text); flex: 1; }

/* ── Bandeja ───────────────────────────────── */
.inbox-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  transition: background .1s; cursor: pointer;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: var(--bg); }
.inbox-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.inbox-content { flex: 1; min-width: 0; }
.inbox-title { font-weight: 600; font-size: .88rem; margin-bottom: 2px; }
.inbox-sub   { font-size: .78rem; color: var(--text-muted); }
.inbox-time  { font-size: .7rem; color: var(--text-light); white-space: nowrap; }

/* ── Empty state ───────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }

/* ── Misc ──────────────────────────────────── */
hr, .divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg-alt); color: var(--text-muted);
  border-radius: 20px; padding: 4px 10px; font-size: .78rem; font-weight: 500;
}
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.nowrap  { white-space: nowrap; }
.fw-bold { font-weight: 700; }
.small   { font-size: .8rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.sticky-sidebar { position: sticky; top: calc(var(--nav-h) + 16px); }

/* Dark mode toggle btn */
.btn-dark {
  background: rgba(255,255,255,.15); border: none; color: white;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background .15s;
}
.btn-dark:hover { background: rgba(255,255,255,.25); }

/* PWA install */
#pwa-install {
  display: none; position: fixed;
  bottom: calc(var(--bnav-h) + 12px); left: 50%;
  transform: translateX(-50%); z-index: 99;
  background: var(--primary); color: white; border: none;
  border-radius: 24px; padding: 10px 20px;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-md); white-space: nowrap;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px 16px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; color: var(--text-muted);
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-light); }
.dz-icon { font-size: 2.5rem; margin-bottom: 8px; }

/* ── FAB (Floating Action Button) ──────────── */
.fab {
  position: fixed;
  bottom: calc(var(--bnav-h) + 16px);
  right: 16px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--primary);
  color: white; font-size: 2rem; line-height: 1;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,86,219,.45);
  z-index: 98;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.fab:hover  { transform: scale(1.06); box-shadow: 0 6px 20px rgba(26,86,219,.55); }
.fab:active { transform: scale(.94); }
@media (min-width: 768px) {
  .fab { bottom: 24px; }
}

/* ── Slide-up panel ────────────────────────── */
.slide-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 149;
  display: none; opacity: 0; transition: opacity .25s;
}
.slide-overlay.open { display: block; opacity: 1; }

.slide-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  z-index: 150;
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.32,0,.67,0);
  max-height: 96vh; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.slide-panel.open {
  transform: translateY(0);
  transition-timing-function: cubic-bezier(.33,1,.68,1);
}
.slide-handle {
  width: 40px; height: 4px;
  background: var(--border); border-radius: 2px;
  margin: 10px auto 0;
}
.slide-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.slide-body { padding: 16px; }

/* ── Category / method quick buttons ──────── */
.quick-btns {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px;
}
.qbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 12px; min-width: 68px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer;
  font-size: .72rem; font-weight: 500; color: var(--text-muted);
  transition: all .15s; user-select: none;
}
.qbtn-icon { font-size: 1.4rem; line-height: 1; }
.qbtn.sel  { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qbtn.sel-success { border-color: var(--success); background: var(--success-light); color: var(--success); }
.qbtn.sel-warning { border-color: var(--warning); background: var(--warning-light); color: var(--warning); }
.qbtn.sel-purple  { border-color: var(--purple); background: var(--purple-light); color: var(--purple); }

/* ── Balance pareja ────────────────────────── */
.balance-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white; border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.bh-label  { font-size: .75rem; opacity: .75; margin-bottom: 4px; }
.bh-amount { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.bh-sub    { font-size: .8rem; opacity: .75; margin-top: 6px; }
.bh-row    { display: flex; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2); }
.bh-col    { flex: 1; }
.bh-col-label { font-size: .7rem; opacity: .7; }
.bh-col-val   { font-size: 1.1rem; font-weight: 700; margin-top: 2px; }

/* ── Gasto item lista ──────────────────────── */
.gasto-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.gasto-item:last-child { border-bottom: none; }
.gasto-ico {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  background: var(--bg-alt);
}
.gasto-info { flex: 1; min-width: 0; }
.gasto-desc { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gasto-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.gasto-monto { text-align: right; flex-shrink: 0; }
.gasto-total { font-weight: 700; font-size: .95rem; }
.gasto-parte { font-size: .72rem; color: var(--text-muted); }

/* ── Monto input grande ────────────────────── */
.monto-input {
  font-size: 2rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  border: none !important;
  border-bottom: 2px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 8px 4px !important;
}
.monto-input:focus { border-bottom-color: var(--primary) !important; box-shadow: none !important; }

/* ── Autocomplete list ──────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; z-index: 200;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); list-style: none;
  max-height: 200px; overflow-y: auto;
  box-shadow: var(--shadow-md);
  display: none; width: 100%;
  top: 100%; left: 0; margin-top: 2px;
}
.autocomplete-list li {
  padding: 10px 14px; cursor: pointer; font-size: .9rem;
  border-bottom: 1px solid var(--border);
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover { background: var(--bg); }

/* ── Gasto item borrador ────────────────────── */
.gasto-item.item-borrador {
  background: var(--warning-light);
  border-left: 3px solid var(--warning);
  padding-left: 13px;
}

/* Notif badge navbar */
.nav-notif { position: relative; display: inline-flex; }
.nav-notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: white;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
