/* Sólo tokens de tema.css: sin colores fijos aquí. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
.suave { color: var(--texto-suave); }

input, select, button { font: inherit; color: inherit; }
input, select {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: .6rem .75rem;
  min-height: 44px;
}
:focus-visible { outline: 3px solid var(--enfoque); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
label.en-linea { flex-direction: row; align-items: center; gap: .5rem; }

.btn {
  background: var(--superficie-2);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: .5rem .9rem;
  min-height: 44px;
  cursor: pointer;
}
.btn:hover { border-color: var(--texto-suave); }
.btn-primario { background: var(--primario); color: var(--primario-texto); border-color: var(--primario); font-weight: 700; }
.btn-grande { min-height: 52px; font-size: 1.05rem; }
.btn:disabled { opacity: .6; cursor: default; }

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.5rem;
}

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-tarjeta { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 1rem; }
.login-tarjeta h1 { font-size: 1.5rem; margin: 0; }
.login-tarjeta p { margin: 0; }
.logo { max-width: 160px; max-height: 64px; object-fit: contain; }
.logo-chico { max-height: 32px; max-width: 96px; object-fit: contain; }

.mensaje { padding: .6rem .8rem; border-radius: var(--radio); margin: 0; }
.mensaje-error { background: var(--peligro-fondo); color: var(--peligro); }
.mensaje-ok { background: var(--exito-fondo); color: var(--exito); }

/* App */
.barra {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
  padding: .5rem 16px;
}
.marca { font-size: 1.1rem; }
.pestanas { display: flex; gap: .25rem; flex-wrap: wrap; }
.pestanas button {
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: .6rem .8rem; min-height: 44px; cursor: pointer; color: var(--texto-suave); font-weight: 600;
}
.pestanas button.activa { color: var(--texto); border-bottom-color: var(--primario); }
.barra-derecha { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.contenido { padding: 16px; max-width: 1200px; margin: 0 auto; }
.fila-herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1rem; }
.fila-herramientas h2 { margin: 0 auto 0 0; }

.tabla-envoltura { overflow-x: auto; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla th { background: var(--superficie-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-suave); }
.tabla tr:last-child td { border-bottom: 0; }

.estado { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.estado-asignada, .estado-cancelada { background: var(--neutro-fondo); color: var(--neutro); }
.estado-en_camino, .estado-en_sitio { background: var(--info-fondo); color: var(--info); }
.estado-reporte_listo, .estado-pendiente { background: var(--aviso-fondo); color: var(--aviso); }
.estado-concluida { background: var(--exito-fondo); color: var(--exito); }

.estado-cotizacion { background: var(--neutro-fondo); color: var(--neutro); border: 1px dashed var(--borde); }
.res-ok, .res-actualizada { background: var(--exito-fondo); color: var(--exito); }
.res-duplicada, .res-ignorada { background: var(--neutro-fondo); color: var(--neutro); }
.res-error { background: var(--peligro-fondo); color: var(--peligro); }
.badge {
  display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px;
  background: var(--peligro); color: var(--primario-texto); font-size: .75rem; line-height: 1.4em; text-align: center;
}
.lista-parametros { display: grid; gap: .75rem; }
.parametro { display: grid; grid-template-columns: 1fr minmax(140px, 260px) auto; gap: .5rem 1rem; align-items: center; }
.parametro .descripcion { font-weight: 400; color: var(--texto-suave); font-size: .9rem; }
.parametro .clave { font-family: ui-monospace, monospace; font-size: .85rem; }
.parametro .estado-guardado { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .parametro { grid-template-columns: 1fr; }
  .barra-derecha { margin-left: 0; width: 100%; justify-content: flex-end; }
}

.pie { text-align: center; padding: 1.5rem 16px; font-size: .85rem; }
