* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
body {
  padding: 10px;
  max-width: 1200px;
  margin: 0 auto;
  background: #f9f9f9;
}
h2 {
  text-align: center;
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 19px;
}
.controles {
  text-align: center;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
select, input[type="date"], input[type="password"] {
  padding: 4px 7px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 3px;
}
button {
  padding: 5px 11px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
}
.btn-guardar { background: #27ae60; color: white; }
.btn-resumen { background: #3498db; color: white; }
.btn-cargar { background: #f39c12; color: white; }
.bloqueado {
  background: #eee;
  color: #777;
  cursor: not-allowed;
}
#mensaje {
  margin: 8px 0;
  font-weight: bold;
  text-align: center;
  font-size: 13px;
}

/* TABLA CORREGIDA 
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #fff;
}
th, td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: center; 
  font-size: 12.5px;
  vertical-align: middle; 
}
th {
  background: #2c3e50;
  color: white;
}
td[rowspan] {
  font-weight: bold;
  background: inherit;
}*/

table {
  border-collapse: collapse !important;
  width: 100%;
  table-layout: auto;
}
th, td {
  border: 1px solid #ddd;
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle !important;
}
td[rowspan] {
  vertical-align: middle !important;
  background: inherit !important;
}

tr.tipo-troncal td {
  background: #eaf2f8;
}
tr.tipo-alimentadora td {
  background: #fef9e7;
}

input[type="number"] {
  width: 42px;
  padding: 2px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 12.5px;
}
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  padding: 8px;
}
.modal-contenido {
  background: #fff;
  margin: 0 auto;
  width: 100%;
  max-width: 900px; 
  max-height: 98vh;
  border-radius: 4px;
  position: relative;
  overflow-y: auto;
  padding: 12px;
}
.cerrar {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #888;
  z-index: 10;
}
.cerrar:hover { color: #000; }

.resumen-header {
  background: #b9d3f4;
  padding: 6px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 8px;
  border-radius: 3px;
}
.totales-superior {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 12.5px;
}
.totales-superior div {
  padding: 4px;
  border: 1px solid #ccc;
  background: #f0f4f8;
  border-radius: 2px;
}
.fila-total {
  background: #e9ecef;
  font-weight: bold;
}