:root { --bg: #f6f7f9; --surface: #fff; --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb; --brand: #0f766e; --brand-deep: #115e59; --bad: #b91c1c; --warn: #92400e; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--brand-deep); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; color: var(--brand-deep); }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
main.wide { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
main.narrow { max-width: 28rem; margin: 4rem auto; padding: 0 1rem; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; padding: .7rem 1.5rem; background: #0f172a; color: #fff; border-bottom: 3px solid var(--brand); }
.brand { color: #fff; text-decoration: none; } .brand small { color: #5eead4; }
.top nav { display: flex; gap: .25rem; flex: 1; }
.top nav a { padding: .4rem .75rem; border-radius: 8px; color: #cbd5e1; text-decoration: none; font-weight: 550; }
.top nav a:hover, .top nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.me { display: flex; align-items: center; gap: .8rem; font-size: .88rem; } .me a { color: #cbd5e1; } .me form { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.panel.highlight { border-color: #5eead4; background: #f0fdfa; }
.hint { color: var(--muted); } .small { font-size: .85rem; word-break: break-all; }
.error { background: #fef2f2; border: 1px solid #fecaca; color: var(--bad); padding: .6rem .8rem; border-radius: 8px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: var(--warn); padding: .6rem .8rem; border-radius: 8px; }
.stack { display: flex; flex-direction: column; gap: .9rem; margin: 1rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem; align-items: end; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; color: #374151; }
input, select { padding: .55rem .65rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
button { padding: .55rem 1rem; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
button:hover { background: var(--brand-deep); }
button.ghost { background: transparent; color: inherit; border: 1px solid #cbd5e1; padding: .3rem .65rem; font-weight: 500; font-size: .85rem; }
.top button.ghost { color: #fff; border-color: rgba(255,255,255,.35); } .top button.ghost:hover { background: rgba(255,255,255,.12); }
button.ghost:hover { background: rgba(15,118,110,.08); }
code { background: #f1f5f9; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }
code.secret { font-size: 1.1rem; letter-spacing: .08em; padding: .3rem .6rem; display: inline-block; }
.scroll { overflow-x: auto; margin-bottom: 1.2rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; color: var(--muted); white-space: nowrap; }
tr.off td { color: var(--muted); } .nowrap { white-space: nowrap; }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; } .actions form { margin: 0; }
.qr { width: 12rem; height: 12rem; margin: .5rem auto 1rem; padding: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; } .qr svg { width: 100%; height: 100%; display: block; }
details { margin: .6rem 0; } summary { cursor: pointer; color: var(--brand-deep); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.btn { display: inline-block; padding: .55rem 1rem; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--brand-deep); }
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin: 1rem 0; }
.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; } .inline input { flex: 1; min-width: 12rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; font-size: .92rem; }
label.check input { width: auto; } label.check.off { color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .4rem 1rem; }
.history { list-style: none; padding: 0; margin: 0; } .history li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
h1 small { font-size: .9rem; font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .8rem; }
.kpis > div { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .9rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; }
.kpis small { color: var(--muted); font-weight: 550; } .kpis strong { font-size: 1.1rem; } .bad { color: var(--bad); font-weight: 600; }
input.short { width: 6rem; flex: none; min-width: 0; } input.mid { width: 15rem; flex: none; min-width: 0; }
.top-gap { margin-top: .8rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
textarea { padding: .55rem .65rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; resize: vertical; }
.subnav { display: flex; gap: .25rem; padding: .35rem 1.5rem; background: #1e293b; }
.subnav a { padding: .3rem .7rem; border-radius: 6px; color: #cbd5e1; text-decoration: none; font-size: .88rem; font-weight: 550; }
.subnav a:hover, .subnav a.active { background: rgba(255,255,255,.14); color: #fff; }
.stages { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.stages li { padding: .35rem .9rem; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-weight: 600; font-size: .88rem; }
.stages li.now { background: var(--brand); color: #fff; }
.tabs { display: flex; gap: .4rem; } .tabs a { padding: .3rem .8rem; border-radius: 8px; text-decoration: none; background: #f1f5f9; } .tabs a.active { background: var(--brand); color: #fff; }
form.inline-form { display: inline; margin-left: .6rem; } form.inline-form button { padding: .15rem .5rem; font-size: .8rem; }
.demo { padding: .4rem 0; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.document header p { margin: .15rem 0; } .document h2 small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.document tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
ul.cols { columns: 2 16rem; padding-left: 1.1rem; margin: .4rem 0; } p.pre { white-space: pre-wrap; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; } main.wide { max-width: none; padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
}
body.public { background: #f6f7f9; } .public-top { padding: .8rem 1.5rem; background: #0f172a; color: #fff; border-bottom: 3px solid var(--brand); }
.public-main { max-width: 52rem; margin: 1.5rem auto 3rem; padding: 0 1rem; }
.firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; } .firmas small { color: var(--muted); font-weight: 600; }
.firmas img { display: block; max-width: 100%; height: 90px; object-fit: contain; object-position: left; margin: .3rem 0; }
.firmas .pending { height: 90px; display: flex; align-items: center; color: var(--muted); font-style: italic; }
.firmas hr { border: 0; border-top: 1px solid #94a3b8; margin: .3rem 0 .4rem; }
@media (max-width: 36rem) { .firmas { grid-template-columns: 1fr; } }
.lienzo-caja { max-width: 38rem; } #lienzo { width: 100%; height: auto; aspect-ratio: 3 / 1; background: #fff; border: 2px dashed #94a3b8; border-radius: 10px; touch-action: none; cursor: crosshair; display: block; }
.lienzo-barra { display: flex; justify-content: space-between; align-items: center; margin-top: .3rem; }
img.firma-actual { height: 80px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: .2rem; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; width: 100%; }
.document h3 { margin: 1.1rem 0 .3rem; font-size: 1rem; } .document p { margin: .4rem 0; text-align: justify; } .document ul { margin: .3rem 0; }

/* Ficha para completar un contrato: el nombre del dato a la izquierda, dónde escribirlo a la derecha, en el orden del documento. */
.ficha-seccion { margin: 1.2rem 0 .2rem; padding-top: .6rem; border-top: 1px solid #e2e8f0; font-size: 1rem; color: #134e4a; }
.ficha-fila { display: grid; grid-template-columns: minmax(12rem, 1fr) 2fr; gap: .4rem 1rem; align-items: start; }
.ficha-fila label { padding-top: .45rem; font-weight: 500; }
.ficha-n { display: inline-block; min-width: 1.6rem; color: #64748b; font-variant-numeric: tabular-nums; }
.ficha-fila input, .ficha-fila textarea { width: 100%; }
.ficha-fila .vacio { border-color: #d97706; background: #fffbeb; }
@media (max-width: 40rem) { .ficha-fila { grid-template-columns: 1fr; } .ficha-fila label { padding-top: 0; } }

.ficha-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .25rem .75rem; }
.ficha-mods .check { display: flex; gap: .4rem; align-items: center; font-weight: normal; }
