/* Costos VIGA — estilos base, responsive, uso desde celular en taller */
/* Paleta corporativa VIGA ENGINE S.A.S. (tomada del logo oficial):
   azul engranaje #2B4EA2 · naranja franja #EF8523 · verde biogás #2E9A47 · gris carbón #3A3A3C */
:root {
  --azul: #263f77;        /* azul VIGA profundo (barra superior, botones) */
  --azul-claro: #2b4ea2;  /* azul del engranaje del logo (enlaces, focos) */
  --acento: #ef8523;      /* naranja de la franja del logo */
  --fondo: #f2f4f7;
  --blanco: #ffffff;
  --texto: #3a3a3c;       /* gris carbón del logotipo */
  --gris: #64748b;
  --borde: #d8dee7;
  --rojo: #c0392b;
  --verde: #2e9a47;       /* verde biogás */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 16px;
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  background: var(--azul); color: #fff;
  padding: 0 16px; height: 56px;
  position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 800; letter-spacing: 1px; font-size: 18px; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.brand span { color: var(--acento); }
.logo-topbar { height: 34px; width: auto; display: block; }
.logo-login { width: 250px; max-width: 80%; height: auto; display: block; margin: 0 auto 6px; }
.menu-btn {
  display: none; background: none; border: none; color: #fff;
  font-size: 24px; cursor: pointer; padding: 4px 8px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: #dbe6f2; text-decoration: none; padding: 8px 14px;
  border-radius: 6px; font-weight: 600; font-size: 15px;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.activo { background: var(--acento); color: var(--azul); }
.usuario-box { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.usuario-nombre { opacity: .9; }
.link-btn {
  background: none; border: none; color: #bcd0e5; cursor: pointer;
  font-size: 13px; text-decoration: underline; padding: 0;
}
.salir { color: #fff; text-decoration: none; font-weight: 700; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: var(--azul); flex-direction: column; padding: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,.25);
  }
  .nav.abierta { display: flex; }
  .nav a { padding: 14px; font-size: 17px; }
  .usuario-nombre { display: none; }
  .link-btn { display: none; }
}

/* ---------- Contenido ---------- */
.contenido { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.titulo-pagina { font-size: 24px; margin: 8px 0 20px; color: var(--azul); }

.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tarjeta {
  background: var(--blanco); border: 1px solid var(--borde);
  border-radius: 10px; padding: 20px;
}
.tarjeta h3 { margin: 0 0 6px; color: var(--azul); }
.tarjeta p { margin: 0; color: var(--gris); font-size: 14px; }
.tarjeta .cifra { font-size: 32px; font-weight: 800; color: var(--texto); }
a.tarjeta { text-decoration: none; display: block; }
a.tarjeta:hover { border-color: var(--acento); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--borde); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; padding: 10px 18px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--gris);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs button.activa { color: var(--azul); border-bottom-color: var(--acento); }

/* ---------- Tablas ---------- */
.tabla-envoltura { overflow-x: auto; background: var(--blanco); border: 1px solid var(--borde); border-radius: 10px; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th {
  text-align: left; padding: 10px 12px; background: #eef2f7;
  color: var(--azul); font-size: 13px; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.tabla td { padding: 10px 12px; border-top: 1px solid var(--borde); }
.tabla tr:hover td { background: #f7fafc; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Formularios ---------- */
label { display: block; margin: 10px 0; font-weight: 600; font-size: 14px; color: var(--texto); }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 4px;
  border: 1px solid var(--borde); border-radius: 8px;
  font-size: 16px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul-claro); border-color: var(--azul-claro); }

.btn {
  background: var(--azul); color: #fff; border: none; border-radius: 8px;
  padding: 12px 20px; font-size: 15px; font-weight: 700; cursor: pointer;
  min-height: 44px; /* usable con guantes */
}
.btn:hover { background: var(--azul-claro); }
.btn.secundario { background: #e3e8f0; color: var(--texto); }
.btn.secundario:hover { background: #d3dae5; }
.btn.peligro { background: var(--rojo); }
.btn.chico { padding: 6px 12px; min-height: 34px; font-size: 13px; }

.barra-acciones { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.barra-acciones .buscador { flex: 1; min-width: 200px; }
.barra-acciones input { margin-top: 0; }

/* ---------- Etiquetas de estado ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill.ok { background: #e2f4e9; color: var(--verde); }
.pill.off { background: #fdeaea; color: var(--rojo); }
.pill.info { background: #e5eefc; color: var(--azul-claro); }

/* ---------- Modales ---------- */
.modal-fondo {
  display: none; position: fixed; inset: 0; background: rgba(15,25,40,.55);
  z-index: 100; padding: 16px; overflow-y: auto;
}
.modal-fondo.abierto { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: #fff; border-radius: 12px; padding: 22px;
  width: 100%; max-width: 520px; margin-top: 40px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.modal h2 { margin: 0 0 12px; font-size: 19px; color: var(--azul); }
.modal-acciones { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.aviso-similares {
  background: #fff8e8; border: 1px solid #f0d494; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; margin-top: 8px;
}
.aviso-similares ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Toast ---------- */
/* Aviso de confirmación. Oculto debe estar FUERA de la pantalla y sin capturar
   clics: si asoma, tapa la franja inferior y bloquea la interacción. */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  opacity: 0; visibility: hidden; pointer-events: none;
  background: var(--verde); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-weight: 700; z-index: 200; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1; visibility: visible; transition-delay: 0s;
}
.toast.error { background: var(--rojo); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- Login ---------- */
.login-fondo {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--azul) 0%, #0a2137 100%); padding: 16px;
}
.login-caja {
  background: #fff; border-radius: 14px; padding: 34px 30px;
  width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-caja .brand { color: var(--azul); font-size: 26px; text-align: center; margin-bottom: 4px; }
.login-caja .sub { text-align: center; color: var(--gris); font-size: 14px; margin-bottom: 20px; }
.login-caja .btn { width: 100%; margin-top: 16px; }
.login-error { color: var(--rojo); font-size: 14px; margin-top: 10px; text-align: center; min-height: 18px; }

/* ---------- Cajas informativas ---------- */
.caja-info {
  background: #e8f0fb; border: 1px solid #b9d0ee; border-radius: 10px;
  padding: 14px 16px; font-size: 14px; margin-bottom: 16px;
}
.caja-peligro {
  background: #fdeeee; border: 1px solid #eeb0ab; border-radius: 10px;
  padding: 14px 16px; font-size: 14px; margin-bottom: 16px;
}
