* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #f2f3f5; color: #1a1a1a; font-size: 15px; }
body.centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 22px; margin: 16px auto; max-width: 980px; }
.login-card { max-width: 380px; text-align: center; }
.login-card .logo { width: 150px; margin-bottom: 6px; }
.login-card form { text-align: left; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 0 0 10px; }
label { display: block; margin: 10px 0; font-weight: 600; font-size: 13.5px; }
input, select { width: 100%; padding: 11px 12px; margin-top: 5px; border: 1px solid #c9ccd1; border-radius: 8px; font-size: 16px; background: #fff; }
input:focus, select:focus { outline: 2px solid #d92b2b33; border-color: #d92b2b; }
.btn { display: inline-block; border: 1px solid #c9ccd1; background: #fff; color: #1a1a1a; padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: #d92b2b; border-color: #d92b2b; color: #fff; padding: 13px 26px; font-size: 16px; }
.btn.primary:hover { background: #b92222; }
.btn.danger { color: #b92222; border-color: #e2a9a9; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; margin-top: 14px; }
.topbar { display: flex; align-items: center; gap: 12px; background: #111; color: #fff; padding: 10px 20px; font-weight: 700; }
.topbar .logo-sm { width: 54px; }
.topbar a { margin-left: auto; color: #fff; border-color: #555; }
main { max-width: 1020px; margin: 0 auto; padding: 8px 14px 40px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.grid .span2 { grid-column: span 2; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } .grid .span2 { grid-column: span 1; } }
.hint { color: #777; font-size: 12.5px; font-weight: 400; }
.totals { margin: 12px 0; min-height: 20px; }
table.calcbox { border-collapse: collapse; background: #fbf7ee; border: 1px solid #e7dcc2; border-radius: 8px; min-width: 320px; }
table.calcbox td { padding: 7px 14px; font-size: 14px; }
table.calcbox td:last-child { text-align: right; font-weight: 600; }
table.calcbox tr.tot td { border-top: 2px solid #d9b96a; font-weight: 800; color: #b92222; font-size: 15px; }
.alert { background: #fdecec; border: 1px solid #f5b5b5; color: #8f1f1f; border-radius: 8px; padding: 12px 16px; margin: 14px auto; max-width: 980px; }
.alert.ok { background: #e9f7ec; border-color: #b3dfbd; color: #1d6b31; }
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e8e9eb; vertical-align: top; }
table.list th { color: #666; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge.sent { background: #fff3cd; color: #8a6d00; }
.badge.signed { background: #d9f2df; color: #1d6b31; }
.badge.cancelled { background: #eee; color: #777; text-decoration: line-through; }
.actions form.inline { display: inline; }
.actions .btn { margin: 2px 2px 2px 0; }
/* signing page */
.signbody { background: #ececee; }
.signwrap { max-width: 660px; margin: 0 auto; padding: 0 12px 50px; }
table.summary { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14.5px; }
table.summary td { padding: 8px 6px; border-bottom: 1px solid #eee; }
table.summary td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
details.terms { margin: 14px 0; border: 1px solid #e2e3e6; border-radius: 8px; padding: 10px 14px; }
details.terms summary { font-weight: 700; cursor: pointer; }
details.terms .fin td, details.terms .fin th { font-size: 12px; }
details.terms table.fields td.lbl { width: 40%; }
.sigbox { border: 2px dashed #b9bcc2; border-radius: 10px; background: #fafafa; margin: 6px 0 8px; touch-action: none; }
.sigbox canvas { display: block; width: 100%; height: 180px; border-radius: 8px; }
label.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13.5px; margin: 16px 0 4px; }
label.consent input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
