@page {
  size: Letter;
  margin: 12mm;
}

@media print {
  a { color: #000; text-decoration: underline; }
}

:root {
  --accent: #3B82F6;
  --text: #0f172a;
  --muted: #475569;
  --rule: #e5e7eb;
}

html, body { padding: 0; margin: 0; }
body { 
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif; 
  color: var(--text);
  background: #94a3b8; /* Gris más claro */
}

/* Container principal */
.container {
  max-width: 11.5in;
  margin: 30px auto;
  padding: 30px;
  background: #94a3b8;
  min-height: 100vh;
}

/* Estructura de impresión: cabecera que se repite en cada página */
.print-table { 
  display: block;
  width: 8.5in; /* Ancho Letter */
  max-width: 100%;
  min-height: 11in; /* Alto Letter */
  margin-bottom: 60px; /* Espacio entre hojas */
  background: white;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  position: relative;
}
.print-header { background: #fff; border-bottom: 1px solid var(--rule); padding: 12px 16px; position: sticky; top: 0; z-index: 10; }
.print-body { display: block; padding: 24px 16px 120px; }
.print-footer { 
  background: #fff; 
  border-top: 1px solid var(--rule); 
  padding: 8px 16px; 
  margin-top: auto;
  text-align: center; 
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.print-footer .contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.print-header .title-row { display: inline-block; white-space: nowrap; }
.print-header .name { font-size: 18px; font-weight: 700; }
.print-header .sep { color: var(--muted); margin: 0 4px; }
.print-header .role { color: var(--muted); font-size: 13px; font-weight: 600; }
.print-header .headline { color: var(--muted); font-size: 12px; margin-top: 2px; }
.print-header .contacts { margin-top: 4px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 10px; }

.actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.btn { background: var(--accent); color: #fff; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; margin-bottom: 16px; padding-top: 12px; }
.name { font-size: 28px; font-weight: 700; letter-spacing: 0.2px; }
.role { color: var(--muted); font-weight: 600; }
.meta { margin-top: 6px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 10px; }
.rule { height: 1px; background: var(--rule); margin: 12px 0 16px; }
.grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
.section { margin-bottom: 14px; }
main > section.section { break-inside: avoid; }
.section h2 { 
  font-size: 14px; 
  color: var(--accent); 
  letter-spacing: 0.4px; 
  text-transform: uppercase; 
  margin: 0 0 8px;
  break-after: avoid;
}
.item-title { font-weight: 700; }
.item-sub { color: var(--muted); font-size: 13px; }
.list { margin: 6px 0 0 16px; padding: 0; }
.list li { margin: 4px 0; }
.two-col { columns: 2; column-gap: 24px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  .print-table {
    width: 100%;
    margin-bottom: 20px;
  }
}

/* Reglas específicas para impresión */
@media print {
  body { background: white !important; }
  .container { 
    background: white !important; 
    padding: 0; 
    margin: 0; 
    max-width: none; 
  }
  .print-table { 
    display: block;
    width: 100%;
    margin: 0;
    box-shadow: none !important;
    min-height: auto !important;
  }
  .print-header { 
    position: static !important;
    padding: 8px 16px; 
    background: #fff; 
    border-bottom: 1px solid var(--rule);
  }
  .print-footer { 
    position: static !important;
    padding: 8px 16px; 
    background: #fff; 
    border-top: 1px solid var(--rule);
    text-align: center;
  }
  .print-body { padding: 12px 16px; }
  .no-print { display: none !important; }
  /* IMPORTANTE: Forzar grid de 2 columnas en impresión */
  .grid { display: grid !important; grid-template-columns: 1fr 2fr !important; gap: 24px !important; }
  .header { display: grid !important; grid-template-columns: 1fr auto !important; }
  main > section.section { break-inside: avoid !important; }
  .section h2 { break-after: avoid !important; }
}

/* Asegurar botón visible en pantalla */
.actions.no-print { position: fixed; top: 16px; right: 16px; z-index: 1100; margin: 0; }


