:root{
  --bg:#0b1020;--text:#e8eefc;--muted:#a8b3d6;--primary:#2f6bff;
  --green:#12d18e;--yellow:#ffb020;--red:#ff5c6c;--border:rgba(255,255,255,.08);
  --shadow:0 18px 40px rgba(0,0,0,.45);--radius:18px;--radius2:26px;
  --mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  --sans:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial
}
*{box-sizing:border-box}html,body{height:100%}
body{
  margin:0;font-family:var(--sans);color:var(--text);
  background:radial-gradient(1200px 600px at 15% 10%,rgba(47,107,255,.25),transparent 55%),
             radial-gradient(900px 500px at 90% 30%,rgba(18,209,142,.18),transparent 55%),
             linear-gradient(180deg,#070a14,var(--bg));
}
.app{display:flex;min-height:100vh}
.sidebar{
  width:270px;padding:18px;background:rgba(10,15,32,.65);
  backdrop-filter:blur(10px);border-right:1px solid var(--border);
}
.brand{display:flex;gap:12px;align-items:center;padding:10px 10px 18px}
.logo{
  width:44px;height:44px;border-radius:14px;display:grid;place-items:center;
  background:linear-gradient(135deg,rgba(47,107,255,.95),rgba(47,107,255,.55));
  font-weight:900;
}
.brand-title{font-weight:900}
.brand-sub{font-size:12px;color:var(--muted)}
.nav{display:flex;flex-direction:column;gap:8px;padding:8px}
.nav-item{
  display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;
  color:var(--muted);text-decoration:none;cursor:pointer;border:1px solid transparent
}
.nav-item:hover{background:rgba(255,255,255,.03);color:var(--text);border-color:rgba(255,255,255,.06)}
.nav-item.active{background:rgba(47,107,255,.12);color:var(--text);border-color:rgba(47,107,255,.25)}
.ico{width:22px;text-align:center}
.sidebar-footer{padding:12px 8px;display:flex;flex-direction:column;gap:10px}
.hint{font-size:12px;color:var(--muted);line-height:1.35}

.main{flex:1;display:flex;flex-direction:column}
.topbar{
  display:flex;justify-content:space-between;align-items:center;
  padding:18px 22px;border-bottom:1px solid var(--border);
  background:rgba(10,15,32,.35);backdrop-filter:blur(10px)
}
.topbar-left{display:flex;align-items:center;gap:12px}
.crumb{font-weight:850;font-size:20px}
.pill{
  font-family:var(--mono);font-size:12px;padding:8px 10px;border-radius:999px;
  border:1px solid var(--border);color:var(--muted)
}
.content{padding:22px}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.card{
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.02));
  border:1px solid var(--border);border-radius:var(--radius);padding:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.25)
}
.card-title{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.08em}
.card-value{font-size:28px;font-weight:900;margin-top:6px}
.kpi{display:flex;align-items:center;justify-content:space-between;gap:10px}
.kpi .dot{width:40px;height:40px;border-radius:16px;display:grid;place-items:center;font-weight:900}
.dot.blue{background:rgba(47,107,255,.18);color:#cfe0ff}
.dot.green{background:rgba(18,209,142,.18);color:#bff7e3}
.dot.orange{background:rgba(255,176,32,.18);color:#ffe4b5}
.dot.red{background:rgba(255,92,108,.18);color:#ffd0d5}
.badge{
  display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;
  border:1px solid var(--border);font-size:12px;color:var(--muted)
}
.badge.green{color:#bff7e3;border-color:rgba(18,209,142,.35);background:rgba(18,209,142,.12)}
.badge.yellow{color:#ffe4b5;border-color:rgba(255,176,32,.35);background:rgba(255,176,32,.12)}
.badge.red{color:#ffd0d5;border-color:rgba(255,92,108,.35);background:rgba(255,92,108,.12)}
.small{font-size:12px;color:var(--muted)}
.notice{padding:12px;border-radius:16px;border:1px solid var(--border);background:rgba(255,255,255,.03);color:var(--muted)}
hr.sep{border:none;border-top:1px solid var(--border);margin:14px 0}

.table{width:100%;border-collapse:separate;border-spacing:0 10px}
.table thead th{padding:0 10px 6px;text-align:left}
.th{color:var(--muted);font-weight:800;font-size:12px;text-transform:uppercase;letter-spacing:.08em}
.table tbody td{
  padding:14px 12px;border-top:1px solid var(--border);border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.03)
}
.table tbody tr td:first-child{border-left:1px solid var(--border);border-top-left-radius:16px;border-bottom-left-radius:16px}
.table tbody tr td:last-child{border-right:1px solid var(--border);border-top-right-radius:16px;border-bottom-right-radius:16px}

.btn{
  cursor:pointer;border:none;color:var(--text);
  background:linear-gradient(135deg,rgba(47,107,255,.95),rgba(47,107,255,.65));
  padding:10px 12px;border-radius:14px;font-weight:850
}
.btn:hover{filter:brightness(1.05)}
.btn.ghost{background:rgba(255,255,255,.03);border:1px solid var(--border)}
.btn.danger{background:rgba(255,92,108,.12);border:1px solid rgba(255,92,108,.35)}
.btn.icon{width:42px;height:42px;padding:0;border-radius:16px;display:grid;place-items:center}
.file{position:relative;overflow:hidden}
.file input{position:absolute;inset:0;opacity:0;cursor:pointer}

.form{display:flex;flex-direction:column;gap:12px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.field input,.field select,.field textarea{
  width:100%;padding:12px;border-radius:14px;border:1px solid var(--border);
  background:rgba(255,255,255,.03);color:var(--text);outline:none
}
.field textarea{min-height:90px;resize:vertical}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}

.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:center;justify-content:center;padding:18px}
.modal.show{display:flex}
.modal-card{
  width:min(860px,98vw);border-radius:var(--radius2);border:1px solid var(--border);
  background:linear-gradient(180deg,rgba(18,25,55,.92),rgba(10,15,32,.92));
  box-shadow:var(--shadow);padding:16px
}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:6px 6px 10px}
.modal-title{font-weight:900;font-size:16px}

@media (max-width:1080px){.grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){.sidebar{display:none}.grid2{grid-template-columns:1fr}}


/* WhatsApp editor improvements */
#waText{ min-height: 280px; font-size: 16px; line-height: 1.45; }
.modal .panel{ max-width: 980px; }

/* Movimientos (pagos por día) */
.days-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; }
.days-col{ background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); border-radius: 14px; padding:10px; }
.days-head{ display:flex; justify-content:space-between; font-weight:700; opacity:.9; padding:6px 2px; border-bottom:1px solid rgba(255,255,255,0.08); margin-bottom:6px; }
.days-row{ display:flex; justify-content:space-between; padding:6px 2px; border-bottom:1px dashed rgba(255,255,255,0.06); }
.days-row:last-child{ border-bottom:none; }
.list{ display:flex; flex-direction:column; gap:8px; }
.list-row{ display:grid; grid-template-columns: 1fr 140px 160px; gap:10px; align-items:center; padding:10px; border:1px solid rgba(255,255,255,0.06); border-radius:14px; background: rgba(255,255,255,0.02); }
.list-row .num{ text-align:right; font-variant-numeric: tabular-nums; }


/* Fix selects readability (dropdown blanco) */
select, option{ color:#0b0b0f; }
select{ background: rgba(255,255,255,0.95); }
