* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:#2c2c2a; background:#f5f4ef; }
header { background:#146c66; color:#fff; padding:14px 22px; display:flex; align-items:center; justify-content:space-between; }
header h1 { font-size:18px; font-weight:600; margin:0; }
main { max-width:980px; margin:22px auto; padding:0 16px; }
.card { background:#fff; border:1px solid #e5e3da; border-radius:12px; padding:18px 20px; margin-bottom:18px; }
.card h2 { font-size:16px; margin:0 0 10px; }
.card h3 { font-size:14px; margin:18px 0 6px; color:#3d3d3a; }
.muted { color:#8a8a85; font-size:13px; }
.warn { background:#fcf3e2; border-color:#ecd9af; }
.err { color:#a32d2d; font-size:13px; min-height:1em; margin:6px 0 0; }
button, .btn { background:#1f7a73; color:#fff; border:0; border-radius:8px; padding:9px 14px; font-size:14px; cursor:pointer; text-decoration:none; display:inline-block; }
button:hover, .btn:hover { background:#176159; }
button:disabled { opacity:.6; cursor:default; }
.link { background:none; color:#1f7a73; padding:0; border:0; cursor:pointer; font-size:13px; text-decoration:underline; }
.del { color:#a32d2d; }
input, select { font-size:14px; padding:8px 10px; border:1px solid #cfcdc4; border-radius:8px; background:#fff; }
.login input { display:block; width:100%; margin-bottom:10px; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.grid label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:#5f5e5a; }
.row { display:flex; gap:12px; align-items:center; }
.row.spread { justify-content:space-between; }
.spinner { color:#8a8a85; font-size:13px; margin-left:8px; }
.kpi { font-weight:400; font-size:12px; color:#8a8a85; }
.tablewrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { text-align:left; padding:7px 9px; border-bottom:1px solid #eeece4; white-space:nowrap; }
th { color:#5f5e5a; font-weight:600; }
td.num, th.num { text-align:right; }
.acts { display:flex; gap:8px; }
tr.pend td:nth-child(9) { color:#854f0b; }
tr.ok td:nth-child(9) { color:#1e5a2e; }
tr.ok { background:#f3faf4; }
@media (max-width:620px){ .grid { grid-template-columns:1fr; } }

/* seguridad / 2FA */
button.danger { background:#a32d2d; }
button.danger:hover { background:#852323; }
#qr { margin:12px 0; padding:10px; background:#fff; display:inline-block; border:1px solid #e5e3da; border-radius:8px; }
#twofaSetup input, #twofaOn input { display:inline-block; width:120px; margin-right:8px; letter-spacing:2px; }
#step2 input { display:block; width:100%; margin-bottom:10px; letter-spacing:3px; }

/* revisión por lotes */
.pitem { border:1px solid #e5e3da; border-radius:10px; padding:12px 14px; margin-bottom:12px; background:#fbfaf6; }
.pitem strong { font-size:13px; }
.badge { display:inline-block; font-size:12px; padding:2px 8px; border-radius:6px; margin-bottom:8px; }
.badge.err2 { background:#fcebeb; color:#a32d2d; }

/* aviso emergente */
.notice { border-radius:8px; padding:10px 14px; margin-bottom:16px; font-size:14px; }
.notice.ok { background:#e7f4ec; color:#1e5a2e; border:1px solid #bfe2cb; }
.notice.err { background:#fcebeb; color:#a32d2d; border:1px solid #f0c9c9; }

/* aviso de duplicado */
.pitem.dup { border-color:#ecd9af; background:#fcf6e9; }
.dupwarn { background:#fbe7c8; border:1px solid #ecd9af; border-radius:8px; padding:8px 10px; margin-bottom:10px; font-size:13px; color:#7a4f0b; }
.dupwarn label { display:flex; gap:8px; align-items:flex-start; cursor:pointer; }
.dupwarn input { margin-top:2px; }

/* resumen / diferencia */
.stats { display:flex; gap:14px; flex-wrap:wrap; }
.stat { flex:1; min-width:130px; background:#f7f6f1; border:1px solid #e5e3da; border-radius:10px; padding:12px 14px; }
.stat-label { display:block; font-size:12px; color:#8a8a85; }
.stat-val { display:block; font-size:20px; font-weight:500; margin-top:3px; color:#2c2c2a; }
.stat-val.pos { color:#1e5a2e; }
.stat-val.neg { color:#a32d2d; }
#sumIva { margin-top:10px; }
