.sg {color:inherit;font:inherit}.sg-panel{border:1px solid hsl(var(--border));background:hsl(var(--card));border-radius:.5rem;padding:1.25rem;margin:1.25rem 0}.sg h2{font-size:1.2rem;font-weight:700;margin:0 0 1rem}.sg h3{font-weight:600;margin:.75rem 0}.sg p{margin:.65rem 0}.sg-muted{font-size:.875rem;color:hsl(var(--muted-foreground))}.sg-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:1rem 0}.sg-field{display:flex;flex-direction:column;gap:.4rem;font-size:.875rem;min-width:0}.sg input:not([type=checkbox]),.sg select,.sg textarea{border:1px solid hsl(var(--input));background:hsl(var(--background));color:inherit;border-radius:.35rem;padding:.65rem;width:100%;min-height:2.65rem}.sg input:focus-visible,.sg select:focus-visible,.sg textarea:focus-visible,.sg button:focus-visible{outline:2px solid hsl(var(--primary));outline-offset:2px}.sg-check{display:flex;align-items:center;gap:.6rem;padding:.5rem 0}.sg-check input{width:1rem;height:1rem}.sg-button{background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-weight:600;padding:.65rem .9rem;border-radius:.35rem;border:1px solid transparent;cursor:pointer;margin:.3rem .4rem .3rem 0;font-size:.875rem}.sg-button:hover{filter:brightness(.94)}.sg-secondary{background:transparent;color:inherit;border-color:hsl(var(--border))}.sg-button:disabled{opacity:.5;cursor:default}.sg-summary{display:grid;grid-template-columns:minmax(100px,1fr) minmax(0,2fr);gap:.6rem;margin:1rem 0;font-size:.9rem}.sg-summary dt{color:hsl(var(--muted-foreground))}.sg-summary dd{font-weight:600;overflow-wrap:anywhere}.sg-badge{display:inline-block;background:hsl(var(--muted));border:1px solid hsl(var(--border));border-radius:2rem;padding:.15rem .65rem;text-transform:capitalize;font-size:.8rem}.sg-stack{display:grid;gap:1rem}.sg-error{padding:.85rem;border:1px solid hsl(var(--destructive));color:hsl(var(--destructive));border-radius:.35rem;margin:.75rem 0;overflow-wrap:anywhere}.sg-error button{margin-left:.75rem;text-decoration:underline}.sg-transport{padding:1rem 0;border-top:1px solid hsl(var(--border))}.sg-preview{max-width:100%;max-height:240px;object-fit:contain;border-radius:.35rem}.sg-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin:1.5rem 0}.sg-metrics>div{border:1px solid hsl(var(--border));padding:1rem;border-radius:.4rem}.sg-metrics dt{font-size:.8rem;color:hsl(var(--muted-foreground))}.sg-metrics dd{font-size:1.15rem;font-weight:700;margin-top:.4rem}.sg-table-wrap{overflow-x:auto}.sg table{width:100%;border-collapse:collapse;font-size:.875rem}.sg th,.sg td{padding:.75rem;text-align:left;border-bottom:1px solid hsl(var(--border));white-space:nowrap}.sg a{text-decoration:underline}.sg-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.sg-history{display:grid;gap:.65rem;margin:1rem 0;font-size:.85rem}.sg details{margin:1rem 0}.sg summary{cursor:pointer;font-weight:600}@media(max-width:640px){.sg-grid,.sg-metrics{grid-template-columns:1fr}.sg-panel{padding:1rem}.sg-summary{grid-template-columns:1fr;gap:.3rem}.sg-summary dd{margin-bottom:.5rem}}
@media print{.sg{display:none!important}}
.sg-modal{width:min(700px,94vw);max-height:90vh;overflow-y:auto;padding:1.25rem;background:hsl(var(--card));color:hsl(var(--foreground));border:1px solid hsl(var(--border));border-radius:.5rem;margin:auto}.sg-modal::backdrop{background:rgb(15 23 42 / .55)}
.sg [hidden]{display:none!important}

.sg-caja-general{border-top:3px solid hsl(var(--primary))}
.sg-caja-general .grid>div:first-child{background:hsl(var(--primary)/.06);border-color:hsl(var(--primary)/.25)}
.sg-caja-general .grid>div:first-child .text-data-m{font-size:clamp(1.5rem,3vw,2rem);line-height:1.2;font-weight:700;overflow-wrap:anywhere}
.sg-caja-general table th{white-space:nowrap}
.sg-caja-general table td{font-variant-numeric:tabular-nums}
@media(min-width:768px){.sg-caja-general>.grid{grid-template-columns:1.35fr 1fr 1fr}}

.sg-document-row { padding: 1rem 0; border-bottom: 1px solid hsl(var(--border)); min-width: 0; }
.sg-document-row p { overflow-wrap: anywhere; margin: .3rem 0; }
.sg-documents h3 { margin-top: 1.25rem; font-weight: 600; }
.sg-document-row input[type=file] { width: 100%; max-width: 100%; font-size: .85rem; }
.doc-bank-information { border: 1px solid hsl(var(--doc-accent-line)); background: hsl(var(--doc-accent-soft)); border-radius: .375rem; padding: .65rem .8rem; }
.doc-bank-information h3 { font-size: 10px; font-weight: 700; letter-spacing: .08em; margin-bottom: .5rem; }
.doc-bank-information dl { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: .2rem 1rem; font-size: 11px; }
.doc-bank-information dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-bank-information dt { opacity: .75; }
.doc-table td { white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
@media print { .document-row { break-inside: auto; } .doc-table-frame { overflow: visible !important; } .doc-table thead { display: table-header-group; } }

/* Keep the customer header, fields and documentation in a single dialog column. */
.sg-customer-dialog{display:flex!important;flex-direction:column!important;gap:1.25rem!important;width:min(94vw,48rem)!important;max-width:48rem!important}
.sg-customer-dialog>*{min-width:0;width:100%;flex-shrink:0}
.sg-customer-dialog>div.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.sg-customer-dialog input,.sg-customer-dialog textarea,.sg-customer-dialog button[role=combobox]{width:100%;min-width:0}
.sg-customer-dialog>div.grid>.md\:col-span-2{grid-column:1/-1}
.sg-customer-dialog>div.grid>div{min-width:0}
@media(max-width:640px){.sg-customer-dialog>div.grid{grid-template-columns:minmax(0,1fr)}}

/* Keep compact content while reserving the bottom of the sheet for signatures.
   These rules also apply to the offscreen copy used for shared PDFs. */
.document-sheet.doc-sheet,
.document-sheet.doc-sheet.doc-fill {
  min-height: var(--doc-sheet-height) !important;
  display: flex !important;
  flex-direction: column !important;
}
.document-sheet.doc-sheet .doc-flow {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 0 auto;
}
.document-sheet .doc-flow > * + * {
  margin-top: 1.2mm !important;
}
.document-sheet .doc-flow > .doc-signatures,
.document-sheet .doc-flow > .doc-bottom {
  margin-top: auto !important;
  flex-shrink: 0;
  break-inside: avoid;
}
.document-sheet header {
  padding-bottom: 1.5mm !important;
  gap: 2mm;
}
.document-sheet .doc-keep.py-1\.5,
.document-sheet .doc-keep > .py-1\.5 {
  padding-top: 1mm;
  padding-bottom: 1mm;
}
.document-sheet .doc-table th,
.document-sheet .doc-table td {
  padding-top: .8mm !important;
  padding-bottom: .8mm !important;
}
.document-sheet .doc-observation-lines {
  padding-top: 0;
}
.document-sheet .doc-observation-lines > span {
  height: 3mm;
}
.document-sheet .doc-observation-lines > span + span {
  margin-top: 1mm;
}
.document-sheet .doc-signatures {
  padding-top: 1.5mm !important;
  column-gap: 6mm;
  row-gap: 2mm;
}
.document-sheet .doc-signature-field {
  height: 9mm;
}
.document-sheet .doc-signature-image {
  max-height: 8mm;
}
.document-sheet .doc-footer {
  margin-top: 2mm !important;
  padding-top: 1mm;
}
/* Compact document identity and rental dates in screen, print and shared PDFs. */
.document-sheet .doc-customer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 3mm;
  row-gap: .6mm;
  padding: 1mm 2mm;
}
.document-sheet .doc-customer-grid > * { grid-column: auto; }
.document-sheet .doc-period > * + * { margin-top: 1mm; }
.document-sheet .doc-period > p { display: none; }
.document-sheet .doc-period > .grid > div { padding: 1mm 2mm; }
.document-sheet .doc-table td:first-child { overflow-wrap: normal; }
