/* ====== MAIN88 ESTILOS ====== */

/* Reset básico */
body, h1, h2, p, table {
  margin: 0;
  padding: 0;
}

body.main88-body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #1c1c1c;
  color: #f2f2f2;
  line-height: 1.5;
}

/* Contenedor principal */
.main88-container {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

/* Encabezado */
.main88-header {
  text-align: center;
  margin-bottom: 20px;
}
.main88-header h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}
.main88-sub {
  font-size: 0.9rem;
  color: #aaa;
}
.main88-badge {
  background: #2e7d32;
  color: #fff;
  font-size: 0.8rem;
  padding: 3px 6px;
  border-radius: 6px;
}

/* Tarjetas */
.main88-card {
  background: #2b2b2b;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.main88-card h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
}

/* Grids */
.main88-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.main88-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.main88-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.main88-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .main88-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 700px) {
  .main88-grid-2, .main88-grid-3, .main88-grid-5 {
    grid-template-columns: 1fr;
  }
  .main88-actions { text-align: stretch; }
  .main88-actions .main88-btn { width: 100%; }
  .main88-container { padding: 14px; }
}

/* Inputs y labels */
label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: #ddd;
}
input, textarea, select {
  background: #1f1f1f;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px;
  color: #fff;
  font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus {
  border-color: #66bb6a;
  box-shadow: 0 0 0 2px rgba(102,187,106,.25);
  outline: none;
}

/* Inputs numéricos */
.main88-table td input[type="number"] {
  text-align: right;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Tabla productos */
.main88-table-wrap {
  overflow-x: auto;
}
.main88-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.main88-table th, .main88-table td {
  border: 1px solid #444;
  padding: 6px;
  text-align: left;
}
.main88-table th {
  background: #333;
}
.main88-subtotal-cell {
  text-align: right;
  font-weight: bold;
}

/* Botones */
.main88-btn {
  background: #444;
  color: #fff;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.main88-btn:hover {
  background: #666;
}
.main88-primary {
  background: #2e7d32;
}
.main88-primary:hover {
  background: #388e3c;
}
.main88-icon-btn {
  background: #a00;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  line-height: 24px;
}
.main88-icon-btn:hover {
  background: #d32f2f;
}

/* Totales */
.main88-totals {
  margin-top: 15px;
}
.main88-totals-box {
  background: #1f1f1f;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  grid-column: span 2;
}
.main88-totals-box div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.main88-total {
  border-top: 1px solid #555;
  margin-top: 6px;
  padding-top: 6px;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Footer */
.main88-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.8rem;
  color: #aaa;
}

/* Acciones */
.main88-actions {
  text-align: right;
  margin-top: 20px;
}

/* Utilidades */
.main88-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo PDF (para que se vea completo) */
.pdf88-logo {
  width: 120px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background: transparent;
}
.pdf88-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* LOGO en encabezado PDF */
.pdf88-logo {
  min-width: 120px;   /* ancho mínimo para reservar espacio */
  min-height: 60px;   /* alto mínimo para evitar colapso */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.pdf88-logo img {
  max-width: 100%;    /* se adapta al ancho disponible */
  max-height: 100%;   /* nunca excede el alto del contenedor */
  object-fit: contain; /* mantiene proporción sin recortar */
}

/* Brand bar mejorada */
.pdf88-brandbar {
  background: #0B5ED7;
  color: #ffffff;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.pdf88-logo {
  min-width: 150px;   /* espacio fijo para logo */
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;   /* fondo blanco para contraste */
  border-radius: 6px;
  padding: 6px 10px;  /* margen interno */
}

.pdf88-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* nunca recorta */
  display: block;
}

/* Título */
.pdf88-title {
  font-size: 24px;
  font-weight: 700;
  margin-left: 12px;
  letter-spacing: 0.5px;
}

