:root{
  --bg:#F5F5F7; --card:#FFFFFF; --text:#1D1D1F; --muted:#6E6E73;
  --line:#D2D2D7; --soft:#E8E8ED; --accent:#0071E3; --accent-dark:#0060C0;
  --ok:#1E7B34; --err:#C4221B;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Helvetica,sans-serif;
  -webkit-font-smoothing:antialiased}
button,input,select,textarea{font-family:inherit;font-size:17px;color:var(--text)}
:focus-visible{outline:3px solid rgba(0,113,227,.45);outline-offset:2px}
.hidden{display:none!important}

/* Barra superior */
.nav{position:sticky;top:0;z-index:10;height:56px;padding:0 24px;background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}
.nav .brand{font-size:17px;font-weight:600;min-width:120px}
.nav .user{font-size:13px;color:var(--muted);min-width:120px;text-align:right;display:flex;gap:10px;justify-content:flex-end;align-items:center}
.seg{display:flex;gap:2px;padding:2px;background:var(--soft);border-radius:9px}
.seg a,.seg button{border:none;background:transparent;padding:7px 18px;border-radius:7px;font-size:13px;font-weight:500;color:var(--text);text-decoration:none;cursor:pointer}
.seg .on{background:#fff;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.link{background:none;border:none;color:#0066CC;font-size:13px;cursor:pointer;padding:0}

.wrap{max-width:1344px;margin:0 auto;padding:40px 24px 64px}
h1{margin:0;font-size:40px;font-weight:600;letter-spacing:-.025em}
.sub{margin:6px 0 0;font-size:17px;color:var(--muted)}
.card{background:var(--card);border-radius:20px;padding:32px}

/* Formularios */
.field{display:flex;flex-direction:column;gap:8px}
.field>label,.label{font-size:13px;font-weight:600}
.input{height:48px;border-radius:12px;border:1px solid var(--line);padding:0 14px;background:#fff;width:100%}
textarea.input{height:96px;padding:12px 14px;resize:none}
.money{display:flex;align-items:center;gap:8px}
.money input{border:none;outline:none;flex:1;height:100%;background:transparent}
.money:focus-within{outline:3px solid rgba(0,113,227,.45)}
.chips{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.chip{height:48px;border:none;border-radius:12px;background:var(--bg);font-size:15px;font-weight:500;cursor:pointer}
.chip.on{background:var(--accent);color:#fff}
.pills{display:flex;gap:8px;flex-wrap:wrap}
.pill{flex:1;min-width:120px;height:44px;border-radius:22px;border:1px solid var(--line);background:#fff;font-size:15px;font-weight:500;cursor:pointer}
.pill.on{background:var(--text);color:#fff;border-color:var(--text)}
.btn{height:50px;border:none;border-radius:12px;background:var(--accent);color:#fff;font-size:17px;font-weight:600;cursor:pointer;width:100%}
.btn:hover{background:var(--accent-dark)}
.btn:disabled{opacity:.5;cursor:default}
.btn-sm{height:36px;padding:0 18px;border-radius:18px;border:none;background:var(--accent);color:#fff;font-size:13px;font-weight:600;cursor:pointer}
.msg{font-size:15px;font-weight:500}
.msg.ok{color:var(--ok)} .msg.err{color:var(--err)}

/* Login */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.login .card{width:100%;max-width:400px;display:flex;flex-direction:column;gap:20px}
.login h1{font-size:32px}

/* Registro */
.reg{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:24px;align-items:start;margin-top:32px}
.form{display:flex;flex-direction:column;gap:28px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.summary{display:flex;flex-direction:column;gap:20px;position:sticky;top:80px}
.summary h2{margin:0;font-size:22px;font-weight:600}
.row{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--soft);font-size:15px}
.row span:first-child{color:var(--muted)} .row span:last-child{text-align:right}
.big{font-size:48px;font-weight:600;letter-spacing:-.03em}

/* Monitor */
.head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.live{display:flex;align-items:center;gap:8px;padding:6px 14px;background:#fff;border-radius:16px;font-size:13px;font-weight:500}
.dot{width:8px;height:8px;border-radius:4px;background:#28A745}
.dot.off{background:#C7C7CC}
.month{height:36px;border-radius:9px;border:1px solid var(--line);padding:0 10px;font-size:13px;background:#fff}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-top:28px}
.kpi{background:#fff;border-radius:18px;padding:24px;display:flex;flex-direction:column;gap:6px}
.kpi small{font-size:13px;color:var(--muted)}
.kpi b{font-size:36px;font-weight:600;letter-spacing:-.03em}
.blocks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin-top:20px;align-items:start}
.block{background:#fff;border-radius:18px;padding:24px}
.block h3{margin:0 0 18px;font-size:17px;font-weight:600}
.bar{margin-bottom:16px}
.bar .t{display:flex;justify-content:space-between;gap:12px;font-size:14px;margin-bottom:6px}
.bar .t em{font-style:normal;color:var(--muted);font-weight:400}
.track{height:6px;background:var(--soft);border-radius:3px;overflow:hidden}
.fill{height:6px;background:var(--accent);border-radius:3px;transition:width .4s}
.empty{font-size:14px;color:var(--muted)}
.table-card{background:#fff;border-radius:18px;padding:24px;margin-top:20px}
.table-card .top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px;min-width:760px}
th{text-align:left;color:var(--muted);font-size:12px;font-weight:500;padding:10px 8px;border-bottom:1px solid var(--soft)}
td{padding:14px 8px;border-bottom:1px solid #F0F0F2}
td.num,th.num{text-align:right}
td.num{font-weight:600}
.tag{display:inline-block;padding:3px 10px;border-radius:10px;background:var(--bg);font-size:13px}
tr.new{animation:flash 1.6s ease-out}
@keyframes flash{from{background:#E6F0FC}to{background:transparent}}

@media (max-width:980px){
  .reg{grid-template-columns:1fr}
  .summary{position:static}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .blocks{grid-template-columns:1fr}
}
@media (max-width:600px){
  h1{font-size:30px}
  .chips{grid-template-columns:repeat(2,minmax(0,1fr))}
  .two{grid-template-columns:1fr}
  .card{padding:22px}
  .nav .brand{display:none}
  .kpi b{font-size:28px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
