*{box-sizing:border-box}
body{margin:0;background:#f1f5f9;color:#111827;font-family:Arial,Helvetica,sans-serif}
a{text-decoration:none;color:inherit}
.container{max-width:1180px;margin:0 auto;padding:24px}
.topbar{background:#111827;color:#fff}
.topbar .container{display:flex;justify-content:space-between;align-items:center;padding-top:14px;padding-bottom:14px}
.nav a{color:#fff;margin-left:14px;font-weight:700}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:24px;box-shadow:0 10px 30px rgba(0,0,0,.07)}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{width:100%;max-width:420px}
h1,h2{margin:0 0 16px}
label{display:block;font-size:13px;font-weight:700;margin:12px 0 6px}
input,select{width:100%;padding:11px 12px;border:1px solid #cbd5e1;border-radius:8px;font-size:14px}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.btn,button{display:inline-block;border:0;border-radius:8px;background:#111827;color:#fff;padding:10px 15px;font-weight:700;cursor:pointer}
.btn-light{background:#e5e7eb;color:#111827}
.btn-secondary{background:#475569;color:#fff}
.alert{padding:12px;border-radius:10px;margin-bottom:14px;background:#fee2e2;color:#991b1b}
.small{font-size:12px;color:#64748b}
table{width:100%;border-collapse:collapse;background:#fff;margin-top:18px}
th,td{padding:11px;border-bottom:1px solid #e5e7eb;text-align:left;font-size:14px}
th{background:#f8fafc}

/* IMPRESSÃO HTML PURO */
.print-actions{max-width:210mm;margin:18px auto;display:flex;gap:10px}
.print-sheet{
    width:210mm;
    min-height:297mm;
    background:#fff;
    margin:0 auto;
    padding:9mm 8mm;
    box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.doc{
    width:100%;
    min-height:277mm;
    border:2px solid #111;
    padding:0;
    color:#111;
    font-family:Arial, Helvetica, sans-serif;
}
.doc-header{
    height:31mm;
    border-bottom:2px solid #111;
    display:grid;
    grid-template-columns:27mm 1fr 30mm;
    align-items:center;
    padding:4mm 5mm;
}
.brasao{
    width:20mm;height:24mm;border:2px solid #111;border-radius:2mm;
    display:flex;align-items:center;justify-content:center;
    font-size:8px;font-weight:700;text-align:center;line-height:1.1;
}
.sus{
    display:flex;align-items:center;justify-content:center;font-weight:900;font-size:22px;
}
.sus-cross{
    width:17mm;height:17mm;position:relative;margin-right:2mm;
}
.sus-cross:before,.sus-cross:after{content:"";position:absolute;background:#111}
.sus-cross:before{left:6mm;top:0;width:5mm;height:17mm}
.sus-cross:after{left:0;top:6mm;width:17mm;height:5mm}
.sus small{display:block;font-size:6px;font-weight:700;line-height:1;margin-left:1mm}
.header-text{text-align:center;font-weight:900;line-height:1.45}
.header-text .p1{font-size:18px}
.header-text .p2{font-size:14px}
.header-text .p3{font-size:16px}
.doc-body{padding:16mm 5mm 0 5mm}
.line-row{display:flex;align-items:flex-end;margin-bottom:7mm;font-size:16px}
.line-row .label{white-space:nowrap;margin-right:2mm}
.line{border-bottom:1.8px solid #111;min-height:6mm;flex:1;padding:0 2mm}
.title{
    text-align:center;
    font-size:22px;
    font-weight:900;
    text-decoration:underline;
    margin:30mm 0 25mm;
}
.title.comp{margin:27mm 0 25mm}
.title.saude{margin:30mm 0 25mm}
.text-line{font-size:16px;line-height:1.65;margin-bottom:5mm}
.inline-line{display:inline-block;border-bottom:1.8px solid #111;min-width:80mm;padding:0 2mm;line-height:1.1}
.inline-small{display:inline-block;border-bottom:1.8px solid #111;min-width:26mm;text-align:center;padding:0 2mm}
.inline-medium{display:inline-block;border-bottom:1.8px solid #111;min-width:48mm;padding:0 2mm}
.inline-large{display:inline-block;border-bottom:1.8px solid #111;min-width:140mm;padding:0 2mm}
.signatures{
    display:grid;
    grid-template-columns:1fr 1.8fr;
    gap:28mm;
    margin-top:45mm;
    align-items:end;
}
.signatures.comp{margin-top:55mm}
.sig-line{border-top:1.8px solid #111;text-align:center;padding-top:1mm;font-size:12px;line-height:1.5}
.crm{text-align:center;margin-top:1mm;font-size:11px}
.footer-print{font-size:7px;margin-top:5mm}
@media(max-width:800px){.grid{grid-template-columns:1fr}.print-sheet{transform:scale(.55);transform-origin:top center;margin-bottom:-130mm}.container{padding:16px}}
@media print{
 body{background:#fff}
 .topbar,.print-actions{display:none!important}
 .print-sheet{box-shadow:none;margin:0;width:210mm;min-height:297mm;padding:9mm 8mm}
 @page{size:A4 portrait;margin:0}
}