:root{--bg:#f4f6fa;--surface:#fff;--border:#e3e8f0;--text:#0f172a;--muted:#64748b;--blue:#2563eb;--blue-dark:#1d4ed8;--green:#16a34a;--amber:#d97706;--red:#dc2626;--radius:12px;--shadow:0 1px 3px #0000000d,0 5px 18px #0f172a0a}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:'DM Sans',Arial,sans-serif;font-size:14px}.hidden{display:none!important}button,input,select,textarea{font:inherit}.topbar{height:68px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:10}.brand,.top-actions,.hero,.stats article,.filters,.select-bar,.variables,.template-actions{display:flex;align-items:center}.brand{gap:11px}.brand-icon{width:39px;height:39px;border-radius:11px;background:var(--blue);color:#fff;display:grid;place-items:center;font-size:20px;box-shadow:0 5px 14px #2563eb3a}.brand h1{font:700 17px 'Sora';margin:0}.brand p{font-size:11px;color:var(--muted);margin:3px 0 0}.top-actions{gap:10px}.file-name{max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:12px}.container{max-width:1500px;margin:auto;padding:28px}.hero{justify-content:space-between;gap:20px;margin-bottom:20px}.eyebrow{color:var(--blue);font-size:10px;font-weight:700;letter-spacing:.12em}.hero h2{font:700 27px 'Sora';margin:6px 0}.hero p,.card-head p{color:var(--muted);margin:0}.btn{border:0;border-radius:8px;padding:10px 15px;font-weight:600;cursor:pointer;display:inline-flex;gap:7px;align-items:center;justify-content:center}.btn-primary{background:var(--blue);color:#fff}.btn-primary:hover{background:var(--blue-dark)}.btn-secondary{background:#fff;color:#334155;border:1px solid #d9dee8}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-full{width:100%;margin-top:9px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.stats article{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;gap:12px}.stat-icon{width:37px;height:37px;border-radius:10px;display:grid;place-items:center;font-weight:800}.stat-icon.blue{background:#eff6ff;color:var(--blue)}.stat-icon.amber{background:#fff7ed;color:var(--amber)}.stat-icon.green{background:#f0fdf4;color:var(--green)}.stat-icon.red{background:#fef2f2;color:var(--red)}.stats small{display:block;color:var(--muted);font-size:11px}.stats strong{display:block;font-size:21px;margin-top:2px}.card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}.empty-state{text-align:center;padding:65px 20px}.upload-art{font-size:48px;margin-bottom:12px}.empty-state h3{font:600 19px 'Sora';margin:0 0 8px}.empty-state p{color:var(--muted);max-width:610px;margin:0 auto 20px;line-height:1.6}.workspace{display:grid;grid-template-columns:minmax(650px,1.5fr) minmax(380px,.65fr);gap:15px;align-items:start}.card-head{display:flex;align-items:flex-start;justify-content:space-between;padding:17px 19px;border-bottom:1px solid #eef1f5}.card-head h3{font:600 14px 'Sora';margin:0 0 5px}.card-head p{font-size:11px}.badge{background:#f1f5f9;color:#64748b;padding:5px 8px;border-radius:6px;font-size:10px}.badge.draft{background:#fff7ed;color:#a16207}.filters{padding:12px;gap:8px;border-bottom:1px solid #eef1f5}.search-box{flex:1;border:1px solid #dbe1e9;border-radius:8px;padding:0 10px;height:38px;display:flex;align-items:center;color:#94a3b8}.search-box input{border:0;outline:0;width:100%;padding:0 8px;color:var(--text);min-width:140px}.filters select{height:38px;border:1px solid #dbe1e9;border-radius:8px;background:#fff;color:#475569;padding:0 9px;max-width:155px}.select-bar{justify-content:space-between;padding:9px 14px;background:#fafbfc;border-bottom:1px solid #eef1f5;font-size:11px;color:#475569}.link-btn{border:0;background:none;color:var(--blue);cursor:pointer;font-size:11px}.table-wrap{overflow:auto;max-height:560px}table{width:100%;border-collapse:collapse;min-width:830px}th{position:sticky;top:0;background:#f8fafc;text-align:left;color:#64748b;font-size:9px;text-transform:uppercase;letter-spacing:.04em;padding:10px;z-index:1}td{padding:11px 10px;border-top:1px solid #eff2f6;vertical-align:middle;font-size:11px}tbody tr:hover{background:#fafcff}tbody tr.selected{background:#f5f8ff}td strong,td small{display:block}td strong{font-size:11px}td small{color:#94a3b8;margin-top:3px}.tests-cell{max-width:250px}.test-item{display:block;margin-bottom:3px;color:#475569}.test-item::before{content:'•';color:var(--blue);margin-right:5px}.email-ok{color:var(--green)}.email-missing{color:var(--red)}.sent-mark{display:inline-flex;align-items:center;gap:3px;color:var(--blue);font-size:9px;margin-top:3px}.mail-btn{border:1px solid #dbe2eb;background:#fff;color:#3b4b63;border-radius:7px;padding:7px;cursor:pointer}.mail-btn:hover{color:var(--blue);border-color:#93b4f5}.template-content{padding:16px}.field{display:block;margin-bottom:12px}.field span{display:block;font-size:10px;font-weight:700;text-transform:uppercase;color:#475569;margin-bottom:5px}.field input,.field textarea{width:100%;border:1px solid #dbe1e9;border-radius:8px;padding:9px 10px;outline:0}.field textarea{height:220px;resize:vertical;line-height:1.5}.field input:focus,.field textarea:focus{border-color:#7da5f4;box-shadow:0 0 0 3px #2563eb12}.variables{gap:5px;flex-wrap:wrap;margin:-3px 0 11px}.variables>span{font-size:10px;color:var(--muted)}.variables button{font-size:9px;border:1px solid #dbe1e9;background:#fff;border-radius:5px;padding:4px 6px;color:#475569;cursor:pointer}.template-actions{justify-content:space-between;margin-bottom:13px}.template-actions .btn{padding:7px 10px;font-size:10px}.preview{border:1px solid #e1e6ee;background:#fafbfc;border-radius:9px;padding:12px}.preview-head{display:flex;justify-content:space-between;margin-bottom:9px}.preview-head span{font-size:9px;font-weight:700;letter-spacing:.08em;color:#64748b}.preview-head small{font-size:9px;color:#94a3b8}.preview>strong{font-size:11px}.preview pre{font:10px/1.55 'DM Sans';white-space:pre-wrap;color:#475569;max-height:175px;overflow:auto;margin:9px 0 0}.help{font-size:10px;color:#94a3b8;line-height:1.5;margin:11px 2px 0}.modal-backdrop{position:fixed;inset:0;background:#0f172a99;display:grid;place-items:center;padding:20px;z-index:50}.modal{position:relative;background:#fff;border-radius:15px;padding:25px;width:min(420px,100%);box-shadow:0 20px 70px #0005}.modal-close{position:absolute;right:12px;top:10px;border:0;background:none;font-size:25px;color:#64748b;cursor:pointer}.modal-icon{width:44px;height:44px;border-radius:12px;background:#eff6ff;color:var(--blue);display:grid;place-items:center;font-size:21px}.modal h3{font:600 18px 'Sora';margin:15px 0 6px}.modal>p{color:var(--muted);line-height:1.5}.progress{height:7px;background:#edf1f6;border-radius:99px;overflow:hidden;margin:15px 0}.progress div{height:100%;width:0;background:var(--blue);transition:.2s}.queue-current{background:#f8fafc;border:1px solid #e7ebf1;border-radius:8px;padding:10px;font-size:11px;min-height:38px}.modal-note{font-size:9px;text-align:center;margin-bottom:0!important}.toast{position:fixed;right:20px;bottom:20px;background:#0f172a;color:#fff;border-radius:9px;padding:11px 15px;font-size:11px;opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s;z-index:80}.toast.show{opacity:1;transform:none}
@media(max-width:1050px){.workspace{grid-template-columns:1fr}.template-card{order:-1}.stats{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.topbar{padding:0 14px}.file-name{display:none}.container{padding:18px 12px}.hero{align-items:flex-start;flex-direction:column}.hero .btn{width:100%}.stats{grid-template-columns:1fr 1fr}.filters{align-items:stretch;flex-direction:column}.filters select{max-width:none}.top-actions .btn{font-size:0}.top-actions .btn::after{content:'Excel';font-size:12px}}

/* Correo institucional remitente */
.sender-box{display:flex;align-items:center;gap:8px;margin-left:18px;padding-left:18px;border-left:1px solid var(--border)}
.sender-box span{font-size:10px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.03em}
.sender-box input{width:220px;height:35px;border:1px solid #dbe1e9;border-radius:8px;padding:0 10px;outline:0;color:#334155;background:#fff}
.sender-box input:focus{border-color:#7da5f4;box-shadow:0 0 0 3px #2563eb12}
.sender-box input.invalid{border-color:var(--red);background:#fef2f2}
.sender-check{height:30px;border:1px solid #bfd0f4;background:#eff6ff;color:#1d4ed8;border-radius:6px;padding:0 8px;font-size:9px;font-weight:700;cursor:pointer;white-space:nowrap}
.sender-check:hover{background:#dbeafe}
.hero-actions{display:flex;gap:9px;align-items:center}
.row-actions{display:flex;gap:5px;align-items:center}.confirm-btn{border:1px solid #bbf7d0;background:#f0fdf4;color:#15803d;border-radius:7px;padding:7px 8px;font-size:9px;font-weight:700;white-space:nowrap;cursor:pointer}.confirm-btn:disabled{opacity:.38;cursor:not-allowed}.sent-mark.sent-ok{color:#15803d;font-weight:700}
.field textarea{height:330px}
.preview pre{max-height:230px}
.preview-body{font:10px/1.55 'DM Sans';color:#475569;max-height:260px;overflow:auto;margin:9px 0 0;white-space:normal}.preview-body strong{font-weight:700;color:#253247}
@media(max-width:850px){.sender-box span{display:none}.sender-box{margin-left:8px;padding-left:8px}.sender-box input{width:190px}.hero-actions{width:100%;flex-wrap:wrap}.hero-actions .btn{flex:1}}
@media(max-width:680px){.topbar{height:auto;min-height:68px;padding:9px 14px;align-items:flex-start}.brand{flex-wrap:wrap}.sender-box{order:3;width:100%;border:0;padding:0;margin:4px 0 0}.sender-box input{width:190px}.sender-check{flex:1}.hero-actions{width:100%;flex-direction:column}.hero-actions .btn{width:100%}}
