/* =========================
   Reset y base
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: auto;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* =========================
   Formularios
   ========================= */
form label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
}

form input,
form select {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

form button,
a.btn {
  margin-top: 15px;
  padding: 10px 20px;
  background: #0078D7;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

a.btn:hover,
form button:hover {
  background: #005fa3;
}

/* =========================
   Tablas (desktop)
   ========================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
  background: #fff;
}

th, td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

th {
  background-color: #0078D7;
  color: white;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* =========================
   Scroll horizontal
   ========================= */
.tabla-scroll-x {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
}

/* =========================
   Botoneras
   ========================= */
.botonera-fila {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 576px) {
  .botonera-fila {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: .4rem !important;
    width: 100%;
  }
  .botonera-fila .btn {
    width: 100% !important;
    padding: .45rem .6rem !important;
    font-size: .9rem !important;
    line-height: 1.2 !important;
  }
}
@media (max-width: 380px) {
  .botonera-fila {
    grid-template-columns: 1fr; /* 1 botón por fila en móviles muy pequeños */
  }
}

/* =========================
   Mensajes
   ========================= */
.mensaje {
  margin: 10px 0;
  padding: 10px;
  background: #e2f0d9;
  border-left: 5px solid #4CAF50;
}

.error {
  background: #fdd;
  border-left: 5px solid #d00;
}

/* =========================
   Remolques chips (ej. ver_datos.php)
   ========================= */
.remolques-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .4rem;
  align-items: center;
}
.remolques-wrap .badge {
  font-size: .92rem;
  font-weight: 600;
  padding: .45em .6em;
}

/* =========================
   Layout y componentes
   ========================= */
.page-title {
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.75rem);
  font-weight: 700;
  letter-spacing: .2px;
}

.card-primary {
  border: 1px solid rgba(0,0,0,.075);
  border-radius: 0.75rem;
  overflow: hidden;
}
.card-primary .card-header { border-bottom: 0; }
.card-primary .card-footer { background: #f8f9fa; }

.table-compact th,
.table-compact td {
  padding: .55rem .75rem;
  vertical-align: middle;
}

/* =========================
   ver_partes_historial
   ========================= */
.vph-historial .tabla-historial {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.vph-historial .tabla-historial th,
.vph-historial .tabla-historial td {
  padding: .55rem .65rem;
  vertical-align: middle;
}

.vph-historial .tabla-historial .acciones-col { min-width: 220px; }
.vph-historial .year-sep { background: #f1f3f5; font-weight: 600; }

/* ===== Modo tarjeta SOLO en móvil ===== */
@media (max-width: 576px) {
  .vph-historial .tabla-historial thead { display: none; }
  .vph-historial .tabla-historial tr {
    display: block;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
  }
  .vph-historial .tabla-historial td {
    display: grid;
    grid-template-columns: 40% 60%;
    align-items: center;
    gap: .25rem;
    border: none;
    border-bottom: 1px solid #eee;
    padding: .45rem .6rem;
    font-size: 13.5px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right; /* valores a la derecha */
  }
  .vph-historial .tabla-historial td:last-child { border-bottom: 0; }
  .vph-historial .tabla-historial td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #333;
    text-align: left;
  }
  .vph-historial .year-sep {
    display: block;
    border: 0;
    border-radius: 8px;
    margin: 14px 0 8px;
    padding: .5rem .65rem;
  }
}

/* =========================
   FIX pie de página en pantallas pequeñas
   ========================= */
footer,
.footer,
.pie-pagina,
.vph-historial .d-flex.justify-content-between {
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box;
  padding-left: 10px;
  padding-right: 10px;
}

/* Asegurar que las paginaciones no rompen el layout */
footer .pagination,
.footer .pagination,
.pie-pagina .pagination,
.vph-historial .pagination {
  flex-wrap: wrap;          /* que salte de línea si no cabe */
  justify-content: center;  /* centrado en pantallas pequeñas */
  gap: .25rem;
}

/* Que el texto del contador también ajuste */
.vph-historial .text-muted.small {
  white-space: normal !important;
}

/* =========================
    Index
   ========================= */
   
   #contenedor {
      max-width: 900px;
      margin: auto;
      background: #fff;
      padding: 20px;
      border-radius: 12px;
      box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
    
   a {
        text-decoration: none;
        
        
    }