/* ================================================================
   Finanzas Seba · look & feel
   Dark neon + glass. Fuente: Outfit
   ================================================================ */
:root {
  --bg: #0B0B1A;
  --bg2: #12122A;
  --card: rgba(255, 255, 255, .055);
  --card-b: rgba(255, 255, 255, .10);
  --text: #EEF0FF;
  --muted: #9A9CC4;
  --violet: #7C5CFF;
  --cyan: #00D1FF;
  --pink: #FF5C8A;
  --green: #2EE59D;
  --amber: #FFB547;
  --red: #FF4D6A;
  --grad: linear-gradient(135deg, #7C5CFF 0%, #00D1FF 100%);
  --grad-pink: linear-gradient(135deg, #FF5C8A 0%, #FFB547 100%);
  --grad-green: linear-gradient(135deg, #2EE59D 0%, #00D1FF 100%);
  --r: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --side: 240px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: 'Outfit', system-ui, -apple-system, Segoe UI, sans-serif;
  background: radial-gradient(1200px 800px at 80% -10%, #231a52 0%, transparent 60%),
              radial-gradient(900px 700px at -10% 110%, #0c2f45 0%, transparent 60%), var(--bg);
  color: var(--text); font-size: 15px; line-height: 1.45;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; }
h3 { font-size: .95rem; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
small, .small { font-size: .8rem; }
.muted { color: var(--muted); }
.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.grow { flex: 1; min-width: 0; }
code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 6px; }

/* Orbes animados de fondo */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; animation: float 18s ease-in-out infinite; }
.bg-orbs span:nth-child(1) { width: 420px; height: 420px; background: #7C5CFF; top: -120px; right: 10%; }
.bg-orbs span:nth-child(2) { width: 360px; height: 360px; background: #00D1FF; bottom: -140px; left: 15%; animation-delay: -6s; opacity: .22; }
.bg-orbs span:nth-child(3) { width: 280px; height: 280px; background: #FF5C8A; top: 40%; right: -80px; animation-delay: -12s; opacity: .18; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,30px) scale(1.08); } }

.glass {
  background: var(--card); border: 1px solid var(--card-b); border-radius: var(--r);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow);
}

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
  background: rgba(10, 10, 26, .65); border-right: 1px solid var(--card-b); backdrop-filter: blur(20px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--grad); font-size: 1.3rem; box-shadow: 0 6px 20px rgba(124,92,255,.5); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: .2s; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(0,209,255,.18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(124,92,255,.5); }
.sidebar .ico { width: 24px; text-align: center; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 6px; }
.user-chip { font-size: .85rem; color: var(--muted); }
.logout { font-size: .85rem; color: var(--pink); }

.main { margin-left: var(--side); padding: 22px 28px 110px; max-width: 1500px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.7rem; font-weight: 800; background: linear-gradient(90deg, #fff, #b9b2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.rate-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(0,209,255,.1); border: 1px solid rgba(0,209,255,.35); color: var(--text); font-weight: 600; font-size: .9rem; }
.rate-pill:hover { text-decoration: none; background: rgba(0,209,255,.18); }
.rate-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.cur-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--card-b); }
.cur-toggle a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.cur-toggle a:hover { text-decoration: none; color: var(--text); }
.cur-toggle a.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(124,92,255,.45); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.align-start { align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.card { padding: 20px; margin-bottom: 16px; }
.grid-2 > .card, .grid-main > .card, .stack > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; font-weight: 500; border: 1px solid; animation: slideIn .35s ease; }
.flash-ok { background: rgba(46,229,157,.12); border-color: rgba(46,229,157,.4); color: #b8ffe1; }
.flash-err { background: rgba(255,77,106,.12); border-color: rgba(255,77,106,.45); color: #ffc2cc; }
.flash-warn { background: rgba(255,181,71,.12); border-color: rgba(255,181,71,.45); color: #ffe2b3; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 12px; border: 0;
  font: inherit; font-weight: 600; cursor: pointer; color: #fff; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--grad); box-shadow: 0 6px 22px rgba(124,92,255,.45); }
.btn-success { background: var(--grad-green); color: #04241a; box-shadow: 0 6px 22px rgba(46,229,157,.35); }
.btn-cyan { background: linear-gradient(135deg, #00D1FF, #2EE59D); color: #032330; box-shadow: 0 6px 22px rgba(0,209,255,.35); }
.btn-ghost { background: rgba(255,255,255,.07); border: 1px solid var(--card-b); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-danger { background: linear-gradient(135deg, #FF4D6A, #FF7A45); }
.btn-danger-ghost { background: transparent; border: 1px solid rgba(255,77,106,.5); color: #ff9aab; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1rem; opacity: .6; }
.icon-btn:hover { opacity: 1; }

/* ---------- Formularios ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
label.inline { flex-direction: row; align-items: center; gap: 10px; }
input, select, textarea {
  font: inherit; color: var(--text); background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 11px 13px; outline: none; transition: border .2s, box-shadow .2s; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
select option, select optgroup { background: #1a1a35; color: var(--text); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--violet); }
input[type=color] { padding: 3px; height: 42px; width: 52px; cursor: pointer; }
input[type=month], input[type=date] { color-scheme: dark; }
.stack-form { display: flex; flex-direction: column; }
.hint { font-size: .85rem; color: var(--muted); background: rgba(124,92,255,.08); border: 1px dashed rgba(124,92,255,.35); padding: 10px 12px; border-radius: 12px; margin: 6px 0 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-card { border-color: rgba(124,92,255,.45); box-shadow: 0 0 0 1px rgba(124,92,255,.2), 0 20px 60px rgba(124,92,255,.25); animation: slideIn .3s ease; }

.amount-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 6px; }
.amount-row.compact { margin-bottom: 12px; }
.amount-row.compact select { width: auto; }
.amount-input { font-size: 2rem !important; font-weight: 800; padding: 10px 16px !important; letter-spacing: -.02em;
  background: rgba(124,92,255,.08) !important; border-color: rgba(124,92,255,.35) !important; }
.amount-input.income { background: rgba(46,229,157,.08) !important; border-color: rgba(46,229,157,.35) !important; }
.conv-preview { min-height: 22px; color: var(--muted); font-size: .9rem; margin-bottom: 12px; padding-left: 4px; }
.conv-preview b { color: var(--cyan); }

/* Segmentado */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--card-b); gap: 2px; flex-shrink: 0; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--muted); font-size: .88rem; transition: .2s; white-space: nowrap; }
.seg input:checked + span { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(124,92,255,.4); }
.seg-wrap { flex-wrap: wrap; display: flex; }

.credit-box { border: 1px solid rgba(255,181,71,.4); background: rgba(255,181,71,.07); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.credit-box[hidden] { display: none; }
.credit-title { font-weight: 700; margin-bottom: 10px; color: #ffd89a; }
.credit-box input[type=month] { margin: 10px 0; max-width: 220px; }
.credit-box .seg input:checked + span { background: var(--grad-pink); }

.source-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: block; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); color: var(--text); background: rgba(255,255,255,.04); font-weight: 500; transition: .2s; }
.chip:hover span { border-color: var(--c); }
.chip input:checked + span { background: var(--c); border-color: var(--c); color: #0b0b1a; font-weight: 700; box-shadow: 0 4px 16px color-mix(in srgb, var(--c) 50%, transparent); }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .arrow { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--card-b); color: var(--text); font-size: 1.4rem; }
.month-nav .arrow:hover { text-decoration: none; background: rgba(124,92,255,.25); }
.month-nav form { position: relative; }
.month-nav input[type=month] { width: 40px; height: 40px; padding: 0; opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.month-nav form::before { content: '📅'; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid var(--card-b); }
.month-label { font-size: 1.25rem; font-weight: 700; min-width: 150px; text-align: center; }
.month-nav .today { font-size: .8rem; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--card-b); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; margin-bottom: 14px; align-items: center; }
.filters select, .filters input[type=search] { width: auto; flex: 1 1 170px; padding: 9px 12px; }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-strip > div { padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--card-b); display: flex; flex-direction: column; }
.summary-strip small { color: var(--muted); }
.summary-strip b { font-size: 1.2rem; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { padding: 18px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; transition: transform .2s; }
.kpi:hover { transform: translateY(-3px); }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--k, var(--grad)); }
.kpi::after { content: ''; position: absolute; width: 140px; height: 140px; right: -50px; top: -50px; border-radius: 50%; background: var(--k, var(--violet)); opacity: .14; filter: blur(10px); }
.kpi small { color: var(--muted); font-weight: 500; }
.kpi b { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.kpi-foot { font-size: .8rem; color: var(--muted); }
.kpi-green { --k: var(--green); } .kpi-violet { --k: var(--violet); } .kpi-pink { --k: var(--pink); }
.kpi-cyan { --k: var(--cyan); } .kpi-amber { --k: var(--amber); } .kpi-red { --k: var(--red); }
.kpi-red b { color: #ff9aab; }
.delta { font-weight: 700; padding: 1px 7px; border-radius: 999px; font-size: .78rem; }
.delta.good { background: rgba(46,229,157,.15); color: var(--green); }
.delta.bad { background: rgba(255,77,106,.15); color: #ff8a9e; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 200px; margin: 10px 0; }
.legend-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.legend-list div { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.legend-list b { margin-left: auto; }
.legend-list small { color: var(--muted); width: 36px; text-align: right; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ---------- Listas de movimientos ---------- */
.tx-list { display: flex; flex-direction: column; gap: 14px; }
.tx-day { display: flex; flex-direction: column; gap: 8px; }
.tx-day-head { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; padding: 0 6px; font-weight: 600; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); border-radius: 14px; transition: .2s; box-shadow: none; }
.tx:hover { text-decoration: none; transform: translateX(3px); border-color: rgba(124,92,255,.5); background: rgba(124,92,255,.08); }
.tx-ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: color-mix(in srgb, var(--c, #7C5CFF) 22%, transparent); border: 1px solid color-mix(in srgb, var(--c, #7C5CFF) 45%, transparent); }
.tx-ico.sm { width: 32px; height: 32px; font-size: 1rem; border-radius: 10px; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { text-align: right; display: flex; flex-direction: column; }
.tx-amt b { font-size: 1.05rem; }
.tx-amt small { color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; margin-left: 4px; }
.tag-card { background: rgba(255,181,71,.18); color: #ffd18a; }
.tag-ok { background: rgba(46,229,157,.18); color: var(--green); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.mini-list { display: flex; flex-direction: column; }
.mini-list a { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.06); color: var(--text); }
.mini-list a:last-child { border-bottom: 0; }
.mini-list a:hover { text-decoration: none; background: rgba(255,255,255,.04); border-radius: 10px; }
.mini-list .grow { display: flex; flex-direction: column; }
.mini-list small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-weight: 800; font-size: .85rem; flex-shrink: 0; }

/* ---------- Barras ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; color: var(--text); font-size: .9rem; }
.bar-row:hover { text-decoration: none; }
.bar-track { display: block; height: 10px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-track.thin { height: 5px; margin-top: 5px; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--grad)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.bar-val { font-weight: 700; }

.budgets { display: flex; flex-direction: column; gap: 14px; }
.budget-top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; gap: 8px; }
.budget .bar-fill { background: var(--grad-green); }
.budget.warn .bar-fill { background: linear-gradient(90deg, #FFB547, #FF7A45); }
.budget.over .bar-fill { background: linear-gradient(90deg, #FF4D6A, #FF5C8A); box-shadow: 0 0 12px var(--red); }
.budget small { color: var(--muted); }
.budget.over small { color: #ff8a9e; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.budget-input { margin: 0; padding: 10px; background: rgba(255,255,255,.03); border-radius: 12px; border: 1px solid var(--card-b); }
.budget-input > span { display: flex; justify-content: space-between; gap: 6px; color: var(--text); }

/* ---------- Reportes ---------- */
.report-head { margin: -20px -20px 16px; padding: 22px 20px; border-radius: var(--r) var(--r) 0 0; position: relative; }
.report-head.violet { background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(0,209,255,.12)); }
.report-head.pink { background: linear-gradient(135deg, rgba(255,92,138,.32), rgba(255,181,71,.12)); }
.report-head h2 { font-size: 1.2rem; margin-top: 6px; }
.report-head p { color: #c9cbf0; font-size: .88rem; margin: 6px 0 10px; }
.report-tag { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.15); }
.big { font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; }
.report-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: #d6d8ff; }
.cat-breakdown details { border-bottom: 1px solid rgba(255,255,255,.06); }
.cat-breakdown summary, .card-origin summary { display: flex; align-items: center; gap: 10px; padding: 10px 4px; cursor: pointer; list-style: none; }
.cat-breakdown summary::-webkit-details-marker, .card-origin summary::-webkit-details-marker { display: none; }
.cat-breakdown summary:hover, .card-origin summary:hover { background: rgba(255,255,255,.03); border-radius: 10px; }
.pct { color: var(--muted); width: 48px; text-align: right; }
.sub-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px 7px 46px; font-size: .88rem; color: var(--text); }
.sub-row:hover { background: rgba(255,255,255,.04); text-decoration: none; border-radius: 8px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list div { display: flex; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--card-b); font-size: .9rem; }
.note { margin-top: 16px; padding: 12px; border-radius: 12px; background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.3); font-size: .9rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split-item { padding: 14px; border-radius: 14px; display: flex; flex-direction: column; }
.split-item b { font-size: 1.3rem; }
.split-item.green { background: rgba(46,229,157,.1); border: 1px solid rgba(46,229,157,.3); }
.split-item.amber { background: rgba(255,181,71,.1); border: 1px solid rgba(255,181,71,.3); }
.card-origin { border: 1px solid var(--card-b); border-radius: 12px; margin-bottom: 8px; padding: 0 8px; background: rgba(255,255,255,.02); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px; border-bottom: 1px solid var(--card-b); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; }
tbody tr:hover td { background: rgba(255,255,255,.03); }
table.heat td { text-align: right; border-radius: 6px; }
table.heat td:first-child { text-align: left; }
table.heat td.hot { box-shadow: inset 0 0 0 2px var(--red); }
table.heat a { color: var(--text); }
.edit-table input:not([type=checkbox]):not([type=color]), .edit-table select { padding: 7px 10px; }
.edit-table .icon-input { width: 56px; text-align: center; }
.new-row td { background: rgba(124,92,255,.06); }

/* ---------- Categorías ---------- */
.cat-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.cat-form input[name=name] { flex: 1 1 160px; }
.cat-form select { flex: 1 1 180px; width: auto; }
.cat-form .icon-input { width: 60px; text-align: center; font-size: 1.2rem; }
.danger-zone { padding-top: 8px; border-top: 1px dashed rgba(255,77,106,.3); }
.danger-zone select { flex: 0 1 200px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cat-card { margin: 0; padding: 14px; border-top: 3px solid var(--c); }
.cat-head { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.cat-head::-webkit-details-marker, .child summary::-webkit-details-marker { display: none; }
.cat-head b { flex: 1; }
.edit-hint { opacity: .4; }
.cat-head:hover .edit-hint { opacity: 1; }
.cat-children { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cat-children details.child { flex-basis: auto; }
.cat-children details.child[open] { flex-basis: 100%; background: rgba(0,0,0,.2); border-radius: 12px; padding: 8px; }
.child summary { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--card-b); font-size: .85rem; cursor: pointer; list-style: none; display: inline-block; }
.child summary:hover { border-color: var(--c); }

/* ---------- Tipo de cambio ---------- */
.rate-hero { text-align: center; padding: 30px 20px; }
.rate-big { font-size: 3.6rem; font-weight: 800; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 6px 0; }
.blue-result { margin: 12px 0; padding: 14px; border-radius: 14px; background: rgba(0,209,255,.08); border: 1px solid rgba(0,209,255,.35); text-align: center; }
.blue-result .vals { display: flex; justify-content: center; gap: 22px; margin: 6px 0; }
.blue-result .vals div { display: flex; flex-direction: column; }
.blue-result .vals b { font-size: 1.4rem; }
.blue-result .prom b { color: var(--cyan); }
[data-fetch-blue] { margin-bottom: 14px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- FAB / nav mobile ---------- */
.fab-wrap { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 30; }
.fab { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; font-size: 1.9rem; font-weight: 300; color: #fff;
  background: var(--grad); box-shadow: 0 10px 30px rgba(124,92,255,.6); transition: transform .2s; }
.fab:hover { text-decoration: none; transform: scale(1.08) rotate(90deg); }
.fab-in { width: 46px; height: 46px; border-radius: 15px; font-size: .9rem; font-weight: 700; background: var(--grad-green); box-shadow: 0 8px 22px rgba(46,229,157,.45); }
.fab-in:hover { transform: scale(1.08); }
.bottom-nav { display: none; }
.more-sheet[hidden] { display: none; }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; padding: 34px 30px; text-align: center; display: flex; flex-direction: column; }
.login-card.wide { max-width: 560px; text-align: left; }
.login-card.wide h1, .login-card.wide .login-logo { align-self: center; }
.login-card label { text-align: left; }
.login-logo { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; background: var(--grad); display: grid; place-items: center; font-size: 2.2rem; box-shadow: 0 12px 40px rgba(124,92,255,.6); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.login-card h1 { font-size: 1.8rem; font-weight: 800; }
.login-card > p { margin: 6px 0 22px; }
.code { background: rgba(0,0,0,.4); padding: 12px; border-radius: 12px; font-size: .8rem; overflow: auto; white-space: pre; }

/* ================== Responsive ================== */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 14px 14px 110px; }
  .topbar h1 { font-size: 1.35rem; }
  .grid-2, .kpis-3, .summary-strip { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 1.25rem; }
  .big { font-size: 2rem; }
  .bar-row { grid-template-columns: 120px 1fr auto; }
  .month-label { min-width: 0; font-size: 1.05rem; }
  .bottom-nav { display: flex; position: fixed; inset: auto 0 0 0; z-index: 40; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: rgba(12,12,30,.85); backdrop-filter: blur(20px); border-top: 1px solid var(--card-b); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 1.25rem; gap: 2px; min-width: 52px; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav small { font-size: .66rem; }
  .fab-wrap { bottom: 86px; right: 16px; }
  .more-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; display: flex; align-items: flex-end; }
  .more-sheet .sheet { width: 100%; background: #15152e; border-radius: 22px 22px 0 0; padding: 18px; display: flex; flex-direction: column; gap: 6px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .more-sheet a { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.05); color: var(--text); font-weight: 600; }
  .amount-row { flex-direction: column; }
  .amount-row .seg { align-self: flex-start; }
  .tx-amt small { display: none; }
  .filters .seg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, .bg-orbs span { animation: none !important; transition: none !important; } }

/* ajustes finos */
.grid-2 > *, .grid-main > * { min-width: 0; }
.amount-row.compact { display: grid; grid-template-columns: 120px 1fr 90px; }
.amount-row.compact select { width: 100%; }
@media (max-width: 860px) { .amount-row.compact { grid-template-columns: 1fr 1fr; } .amount-row.compact input { grid-column: 1 / -1; order: -1; } }
.edit-table .day-input { width: 72px; text-align: center; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.mini-row:last-child { border-bottom: 0; }
.tag-warn { background: rgba(255,77,106,.16); color: #ff9aab; }
.credit-box .hint { margin: 0 0 10px; }
.card-name { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 8px; font-weight: 700; color: #ffd89a; }
