* { box-sizing: border-box; }
body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background: #f2f4f7;
    color: #1f2937;
}
a { color: #1d4ed8; }

/* ---------- Barra de navegación ---------- */
header.topbar {
    background: #1f2937;
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
header.topbar .marca {
    font-weight: bold;
    font-size: 1.2em;
    padding: 14px 0;
}
header.topbar nav a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 14px 10px;
    display: inline-block;
    font-size: 0.95em;
}
header.topbar nav a:hover { color: #fff; background: #374151; }
header.topbar .usuario-info {
    color: #9ca3af;
    font-size: 0.85em;
    padding: 14px 0;
}
header.topbar .usuario-info strong { color: #fff; }

/* ---------- Contenedor principal ---------- */
main.contenedor {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px 40px;
}

.tarjeta {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

h1 { font-size: 1.5em; margin-top: 0; }
h2 { font-size: 1.2em; }

/* ---------- Formularios ---------- */
label { display: block; margin: 12px 0 4px; font-weight: bold; font-size: 0.9em; }
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=time], input[type=url], select, textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
}
textarea { resize: vertical; }
.form-fila { display: flex; gap: 16px; flex-wrap: wrap; }
.form-fila > div { flex: 1; min-width: 180px; }

button, .boton {
    display: inline-block;
    background: #1d4ed8;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    margin-top: 16px;
}
button:hover, .boton:hover { background: #1e40af; }
.boton.secundario { background: #6b7280; }
.boton.secundario:hover { background: #4b5563; }
.boton.peligro { background: #dc2626; }
.boton.peligro:hover { background: #991b1b; }
.boton.pequeno { padding: 5px 10px; font-size: 0.85em; margin-top: 0; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; font-size: 0.92em; }
th { background: #f8fafc; }
tr:hover td { background: #f8fafc; }

/* ---------- Avisos ---------- */
.aviso { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.95em; }
.aviso.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.aviso.ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

.etiqueta {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8em;
}
.etiqueta.admin { background: #fde68a; color: #92400e; }
.etiqueta.visualizador { background: #bfdbfe; color: #1e40af; }
.etiqueta.usuario { background: #bbf7d0; color: #166534; }

.grid-viajes { overflow-x: auto; }

/* ---------- Clientes / recogidas / descargas de cada viaje ---------- */
.grupo-lugares { margin-top: 14px; }
.grupo-titulo { font-weight: bold; font-size: 0.95em; color: #374151; }
.lugares-rejilla { display: flex; gap: 16px; flex-wrap: wrap; }
.lugar-item { flex: 1 1 180px; min-width: 180px; max-width: 320px; }
.creado-por { color: #6b7280; font-size: 0.85em; margin-top: 20px; }

/* ---------- Modales "añadir nuevo" ---------- */
.modal-fondo {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal-caja {
    background: #fff;
    border-radius: 8px;
    padding: 22px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-caja h3 { margin-top: 0; }
.modal-acciones { display: flex; gap: 10px; justify-content: flex-end; }
.modal-error { color: #991b1b; font-size: 0.88em; min-height: 1.2em; }

.login-caja {
    max-width: 380px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.login-caja h1 { text-align: center; }

/* ---------- Estadísticas ---------- */
.tabla-scroll { overflow-x: auto; }
.tabla-scroll table { min-width: 560px; }
.nota-pequena { color: #6b7280; font-size: 0.85em; margin: 8px 0 0; }
h3 { font-size: 1.05em; margin: 22px 0 6px; }
