/* ==========================================================================
   PHN — Panel de Proveedores
   Mismo sistema visual que el panel de la caseta: blanco, lineas de 1 px y el
   verde de marca solo donde hace falta.
   ========================================================================== */

:root {
  /* Verde de marca (línea de diseño 2026-10-28): rellena; la letra encima es SIEMPRE
     blanca, peso 700 y 16 px o más. Para TEXTO verde sobre claro se usa --verde-texto. */
  --verde:        #80BA26;
  --verde-fuerte: #6FA31F;   /* hover del relleno */
  --verde-texto:  #4F7D11;
  --verde-tinte:  #EEF5DF;
  --verde-suave:  #F6F9EC;
  --sobre-verde:  #FFFFFF;   /* texto sobre relleno verde */

  --blanco:  #FFFFFF;
  --fondo:   #F5F5F7;
  --lateral: #FBFBFD;
  --tinta:   #1D1D1F;
  --tinta-2: #424245;
  --tinta-3: #6E6E73;
  --linea:   #E8E8ED;
  --linea-2: #D2D2D7;
  --campo:   #F5F5F7;
  --oscuro:  #1D1D1F;
  --rojo:    #B3261E;
  --rojo-tinte: #FFE5E3;
  --ambar:   #7A5A00;
  --ambar-tinte: #FFF4D6;

  --radio:    20px;
  --radio-lg: 24px;
  --radio-sm: 12px;
  --sombra: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  --sombra-alta: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.07);

  --sp-1: 8px;
  --sp-2: 14px;
  --sp-3: 22px;
  --sp-4: 34px;

  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --txt-sm:   14px;
  --txt-base: 15px;
  --txt-lg:   20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--fondo);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: var(--txt-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

.icono {
  width: 15px; height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view { display: none; }
.view.is-active { display: block; }

/* ---------- Login ---------- */

#view-login.is-active { display: flex; align-items: center; justify-content: center; }
#view-login { min-height: 100vh; padding: var(--sp-3); background: var(--fondo); }

.login {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  background: var(--blanco);
  border-radius: 28px;
  box-shadow: var(--sombra-alta);
  text-align: center;
}
.login__logo { width: 100%; max-width: 220px; height: auto; }
.login__sub {
  margin: 6px 0 var(--sp-3);
  color: var(--tinta-3);
  font-size: 15px;
}

.campo { display: block; text-align: left; margin-bottom: var(--sp-2); }
.campo__label { display: block; margin-bottom: 6px; color: var(--tinta-3); font-size: 12px; font-weight: 600; }
.campo__input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  background: var(--campo);
  border: 2px solid transparent;
  border-radius: var(--radio-sm);
  color: var(--tinta);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.campo__input::placeholder { color: var(--tinta-3); }
.campo__input:focus { outline: none; border-color: var(--verde); background: var(--blanco); box-shadow: 0 0 0 4px var(--verde-tinte); }
.campo__input--fecha { min-width: 160px; }
.campo__input--num { max-width: 120px; text-align: right; }
.campo__error {
  margin: 0 0 var(--sp-2);
  padding: 10px 14px;
  background: var(--rojo-tinte);
  border-radius: var(--radio-sm);
  color: var(--rojo);
  font-size: var(--txt-sm);
  font-weight: 500;
  text-align: center;
}
.campo__error[hidden] { display: none; }

#login-form .campo__input { min-height: 48px; font-size: 16px; }
#btn-login { min-height: 54px; font-size: 17px; border-radius: 16px; }

/* Llave de acceso (huella / rostro) */
.btn--llave { min-height: 54px; gap: 10px; font-size: 17px; border-radius: 16px; }
.btn--llave .icono { width: 22px; height: 22px; stroke-width: 1.9; }
.login__o {
  display: flex; align-items: center; gap: 12px;
  margin: var(--sp-2) 0; color: var(--tinta-3); font-size: 13px;
}
.login__o::before, .login__o::after { content: ""; flex: 1; height: 1px; background: var(--linea); }
.login__o[hidden], .btn--llave[hidden], .btn--icono[hidden] { display: none; }
.login--llave #btn-login { background: var(--campo); color: var(--tinta); font-size: 15px; min-height: 48px; }
.login--llave #btn-login:hover:not(:disabled) { background: #EBEBEF; }
.btn--icono { padding: 0; width: 44px; }
.btn--icono .icono { width: 20px; height: 20px; stroke-width: 1.9; }
.visor__caja--llave { max-width: 440px; }
.llave__icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: var(--sp-2);
  background: var(--verde-tinte); color: var(--verde-texto); border-radius: 16px;
}
.llave__icono .icono { width: 28px; height: 28px; stroke-width: 1.8; }
.llave__texto { margin: 0 0 var(--sp-3); color: var(--tinta-3); font-size: var(--txt-sm); }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 0 var(--sp-3);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease, border-color .15s ease, color .15s ease;
}
.btn:focus-visible, .pestana:focus-visible, .chip:focus-visible { outline: 2px solid var(--verde-texto); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primario { min-height: 44px; background: var(--verde); color: var(--sobre-verde); font-size: 16px; font-weight: 700; }
.btn--primario:hover:not(:disabled) { background: var(--verde-fuerte); }
.btn--ancho { width: 100%; }
.btn--corto { min-height: 44px; font-size: var(--txt-sm); background: var(--campo); color: var(--tinta); }
.btn--corto.btn--primario { background: var(--verde); color: var(--sobre-verde); font-size: 16px; font-weight: 700; }
.btn--corto.btn--primario:hover:not(:disabled) { background: var(--verde-fuerte); }
.btn--corto:hover:not(.btn--primario):not(:disabled) { background: #EBEBEF; }

.btn--texto {
  min-height: 44px;
  padding: 0 6px;
  background: none;
  color: var(--tinta-3);
  font-size: 13px;
  font-weight: 500;
}
.btn--texto:hover { color: var(--tinta); }

.btn--chip {
  min-height: 38px;
  padding: 0 var(--sp-2);
  background: var(--blanco);
  border: 1px solid var(--linea-2);
  color: var(--tinta-2);
  font-size: var(--txt-sm);
  font-weight: 500;
}
.btn--chip:hover { border-color: var(--verde); color: var(--verde-texto); }

.btn--mini {
  min-height: 36px;
  padding: 0 14px;
  background: var(--campo);
  color: var(--tinta-2);
  font-size: 13px;
  font-weight: 600;
}
.btn--mini:hover { background: var(--verde-tinte); color: var(--verde-texto); }
.btn--peligro:hover { background: var(--rojo-tinte); color: var(--rojo); }

/* ---------- Estructura: lateral + contenido ---------- */

#view-panel.is-active { display: flex; min-height: 100vh; }

.lateral {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex: 0 0 248px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 16px;
  background: var(--lateral);
  border-right: 1px solid var(--linea);
}
/* Logo horizontal a todo el ancho del menú (sin recuadro); el nombre del panel debajo. */
.lateral__marca { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 0 6px; }
.lateral__logo { display: block; width: 100%; max-width: 140px; height: auto; }
.lateral__titulos, .lateral__quien { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.lateral__nombre { font-size: 15px; font-weight: 600; }
.lateral__area { font-size: 12px; color: var(--tinta-3); }
.lateral__admin { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.pestanas { display: flex; flex-direction: column; gap: 4px; }
.pestana {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: var(--radio-sm);
  color: var(--tinta-2);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.pestana .icono { width: 20px; height: 20px; stroke-width: 1.9; }
.pestana:hover { background: #F0F0F3; }
.pestana.is-activa { background: var(--verde-tinte); color: var(--verde-texto); font-weight: 600; }

.lateral__sesion {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--linea);
}

/* ---------- Contenido ---------- */

.main { flex: 1 1 0; min-width: 0; max-width: 1280px; padding: 32px 40px 56px; }
/* Línea de diseño 2026-10-28: tope 1040 px (1024–1499) y 1280 px (>= 1500), centrado. */
@media (min-width: 1024px) { .main { max-width: 1040px; margin-inline: auto; } }
@media (min-width: 1500px) { .main { max-width: 1280px; } }

.vista { display: none; }
.vista.is-activa { display: block; }

.vista__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.vista__eyebrow { display: block; color: var(--tinta-3); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.vista__titulo { margin: 4px 0 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; }
.vista__meta { color: var(--tinta-3); font-size: var(--txt-sm); }

/* ---------- Tablas ---------- */

.tabla-caja {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  padding: 10px 26px 18px;
  overflow-x: auto;
}
.tabla { width: 100%; border-collapse: collapse; font-size: var(--txt-sm); }
.tabla:empty { display: none; }

.tabla th {
  padding: 14px 8px 10px;
  background: var(--blanco);
  border-bottom: 1px solid var(--linea);
  color: var(--tinta-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.tabla td {
  padding: 14px 8px;
  border-bottom: 1px solid #F0F0F3;
  vertical-align: middle;
}
.tabla th:first-child, .tabla td:first-child { padding-left: 0; }
.tabla th:last-child, .tabla td:last-child { padding-right: 0; }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover { background: #FAFAFC; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla__vacia td { padding: var(--sp-4); text-align: center; color: var(--tinta-3); }

.tabla tfoot td {
  padding: var(--sp-2);
  border-top: 2px solid var(--linea);
  font-weight: 700;
  background: var(--fondo);
}

.celda-nombre { font-weight: 600; }
.celda-hora { font-variant-numeric: tabular-nums; color: var(--tinta-2); }
.celda-dia { color: var(--tinta-3); white-space: nowrap; }

.marca {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.marca--entrada { background: var(--verde-tinte); color: var(--verde-texto); }
.marca--salida  { background: #EDEDF0; color: var(--tinta-2); }
.marca--activo  { background: var(--verde-tinte); color: var(--verde-texto); }
.marca--baja    { background: #EDEDF0; color: var(--tinta-3); }
.marca--aviso   { background: var(--ambar-tinte); color: var(--ambar); }

.acciones-fila { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
/* Editar y Dar de baja en una sola linea: partidos en dos renglones la fila
   crece al doble y la tabla se vuelve ilegible con 63 proveedores. */
.acciones-fila .btn { white-space: nowrap; }
.tabla td:last-child, .tabla th:last-child { width: 1%; white-space: nowrap; }
/* Un correo largo es UN solo token sin espacios: sin esto se lleva 291px de
   ancho, empuja la tabla fuera del contenedor y corta la columna de acciones.
   Va SOLO en esta celda: aplicado a todo .tabla td partia tambien los chips
   de categoria en pedazos ("SERVI CIOS"). */
.celda-correo { overflow-wrap: anywhere; }

.foto-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  margin-right: 5px;
  background: var(--blanco);
  border: 1px solid var(--linea-2);
  border-radius: 999px;
  color: var(--tinta-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.foto-chip:hover { border-color: var(--verde); color: var(--verde-texto); }

.sin-dato { color: var(--tinta-3); }

/* ---------- Alta de personal ---------- */

.alta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}
.alta .campo__input { width: auto; flex: 1; min-width: 200px; }
.alta .campo__input--num { flex: none; }

/* ---------- Informe (resultado de la IA) ---------- */

.informe {
  margin: 0;
  padding: var(--sp-3) 26px;
  background: var(--blanco);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  font-family: var(--fuente);
  font-size: var(--txt-base);
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.informe[hidden] { display: none; }

.nota { margin: var(--sp-2) 0 0; color: var(--tinta-3); font-size: 13px; }
.nota--suelta { margin: 0 0 var(--sp-2); }

/* ---------- Visor / modales ---------- */

.visor {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
  background: rgba(29, 29, 31, .45);
}
.visor[hidden] { display: none; }
.visor__caja {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  background: var(--blanco);
  border-radius: 28px;
  box-shadow: var(--sombra-alta);
  text-align: left;
}
.visor__titulo { margin: 0 0 var(--sp-3); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--tinta); }
.visor__marco { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.visor__img { max-width: 100%; max-height: 60vh; border-radius: var(--radio-sm); }
.visor__img[hidden] { display: none; }
.visor .btn { margin-top: var(--sp-3); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-4);
  transform: translate(-50%, 160%);
  min-width: 220px;
  max-width: 90vw;
  padding: 14px var(--sp-3);
  border-radius: 999px;
  background: var(--tinta);
  color: var(--blanco);
  font-size: var(--txt-sm);
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
  pointer-events: none;
  z-index: 70;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--rojo); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Bloque por empresa ---------- */

.empresa { margin-bottom: var(--sp-4); }
.empresa:last-child { margin-bottom: 0; }

.empresa__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
  flex-wrap: wrap;
}
.empresa__titulo { margin: 0; font-size: var(--txt-base); font-weight: 600; }
.empresa__meta { color: var(--tinta-3); font-size: var(--txt-sm); }

/* ==========================================================================
   PROVEEDORES — lo propio de este panel
   ========================================================================== */

/* Los filtros viven en su propia tarjeta, como en el lienzo. */
.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px 20px;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.filtros .campo__input { width: auto; flex: 1; min-width: 200px; }
.filtros .campo__input--select { flex: none; min-width: 200px; }
.filtros .campo__input--ancho { flex: 1; min-width: 280px; }
.filtros .btn { flex: none; }
.filtros .busca { flex: 1; min-width: 260px; }
.filtros .busca .campo__input { width: 100%; }

.busca { position: relative; display: block; }
.busca .icono {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--tinta-3);
  pointer-events: none;
}
.campo__input--busca { padding-left: 42px; }

/* Selects con su flecha propia, sin la del sistema. */
.campo__input--select {
  min-width: 170px;
  min-height: 44px;
  padding: 0 40px 0 14px;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--campo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
.campo__input--select:focus { background-color: var(--blanco); }
.campo__input--ancho { min-width: 280px; }
.campo--ancho { grid-column: 1 / -1; }

.campo__nota {
  margin-left: 5px;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--tinta-3);
}

/* Formularios en rejilla dentro de los modales */
.rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--sp-2);
}
.rejilla--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla .campo { margin-bottom: var(--sp-2); }

.visor__caja--ancha { max-width: 760px; }
.visor__acciones {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
}
.visor__acciones .btn { margin-top: 0; }
.visor__acciones .btn--mini { min-height: 44px; padding: 0 var(--sp-3); font-size: var(--txt-sm); }

/* Chips de seleccion multiple (a quien se le pide cotizacion) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: var(--sp-2);
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.chip {
  min-height: 40px;
  padding: 0 14px;
  background: var(--campo);
  border: 2px solid transparent;
  border-radius: 999px;
  color: var(--tinta-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.chip:hover { background: #EBEBEF; }
.chip.is-selected { border-color: var(--verde); background: var(--verde-tinte); color: var(--verde-texto); font-weight: 600; }
.chips__vacio { color: var(--tinta-3); font-size: var(--txt-sm); padding: 6px; }

.cotizacion__form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 var(--sp-2);
  margin-bottom: var(--sp-2);
  padding: 20px 22px 8px;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

/* El mejor precio de un material se ve sin leer la columna */
.precio-mejor { color: var(--verde-texto); font-weight: 700; }
.precio-diff { color: var(--tinta-3); }
.precio-caro { color: var(--ambar); font-weight: 600; }

.celda-larga { max-width: 280px; }

@media (max-width: 860px) {
  .rejilla, .rejilla--3, .cotizacion__form { grid-template-columns: 1fr; }
}

/* ==========================================================================
   LOGOS, TARJETAS Y FICHA
   ========================================================================== */

/* El monograma ocupa exactamente el mismo hueco que el logo: una lista a medio
   llenar de logos no se ve rota, solo distinta. */
.avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}
.avatar--letras { border-color: transparent; }
.avatar__img {
  width: 100%;
  height: 100%;
  /* contain, no cover: un logo recortado deja de ser el logo. */
  object-fit: contain;
}

/* Rectangulares a proposito: el logo de un proveedor industrial casi siempre
   es una firma horizontal. En un cuadro se queda en una franja diminuta. */
.avatar--sm { width: 44px; height: 34px; font-size: 12px; }
.avatar--md { width: 76px; height: 54px; border-radius: 14px; font-size: 18px; }
.avatar--lg { width: 96px; height: 70px; border-radius: 16px; font-size: 24px; }

.celda-nombre__toque {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.celda-nombre__toque:hover { color: var(--verde-texto); }
.celda-nombre__toque:focus-visible { outline: 2px solid var(--verde-texto); outline-offset: 2px; }

/* ---------- Tarjetas (telefono) ---------- */

.tarjetas { display: none; margin: 0; padding: 0; list-style: none; }
.tarjeta + .tarjeta { margin-top: 10px; }

.tarjeta__toque {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  min-height: 72px;
  padding: var(--sp-2);
  background: var(--blanco);
  border: 0;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.tarjeta__toque:active { background: #FAFAFC; }
.tarjeta__toque:focus-visible { outline: 2px solid var(--verde-texto); outline-offset: 2px; }

.tarjeta__texto {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.tarjeta__nombre { font-weight: 600; overflow-wrap: anywhere; }
.tarjeta__tel {
  color: var(--tinta-3);
  font-size: var(--txt-sm);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tarjeta__marca { margin-top: 2px; }
.tarjeta__flecha { flex: none; color: var(--tinta-3); }
.tarjeta--baja .tarjeta__toque { background: var(--lateral); box-shadow: none; border: 1px solid var(--linea); }
.tarjeta--baja .tarjeta__nombre { color: var(--tinta-3); }

.tarjetas__vacio {
  padding: var(--sp-4);
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  color: var(--tinta-3);
  text-align: center;
}

/* ---------- Ficha flotante del proveedor ---------- */

/* En telefono sube desde abajo, que es donde esta el pulgar. En pantalla ancha
   se comporta como los demas modales. */
.ficha { align-items: flex-end; padding: 0; }
.ficha__caja {
  max-width: 560px;
  max-height: 90vh;
  border-radius: 28px 28px 0 0;
  text-align: left;
}

.ficha__head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.ficha__logo { flex: none; }
.ficha__titulos { flex: 1; min-width: 0; }
.ficha__nombre { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ficha__razon { margin: 3px 0 0; color: var(--tinta-3); font-size: var(--txt-sm); overflow-wrap: anywhere; }
.ficha__razon[hidden] { display: none; }
.ficha__estado:not(:empty) { margin-top: 8px; }
.ficha__cerrar { flex: none; margin-top: 0; }

.ficha__dato { padding: 12px 0; border-top: 1px solid #F0F0F3; }
.ficha__etiqueta {
  display: block;
  color: var(--tinta-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ficha__valor { display: block; margin-top: 3px; overflow-wrap: anywhere; }
a.ficha__valor { color: var(--verde-texto); text-decoration: none; font-weight: 500; }
a.ficha__valor:hover { text-decoration: underline; }

/* Pegados abajo: la ficha hace scroll y los botones tienen que seguir ahi. */
.ficha__acciones {
  position: sticky;
  bottom: -28px;
  display: flex;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
  padding: var(--sp-2) 0 0;
  background: var(--blanco);
}
.ficha__acciones .btn { flex: 1; margin-top: 0; }
.ficha__acciones #ficha-editar { background: var(--verde); color: var(--sobre-verde); font-size: 16px; font-weight: 700; }
/* .btn--peligro solo se distingue al pasar el raton, y en telefono no hay
   raton: aqui la baja tiene que leerse como tal antes de tocarla. */
.ficha__acciones .btn--peligro { background: var(--rojo-tinte); color: var(--rojo); }

/* ---------- Control del logo en el formulario ---------- */

.logo-campo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid #F0F0F3;
}
.logo-campo__vista { flex: none; }
.logo-campo__lado { flex: 1; min-width: 0; }
.logo-campo__botones { display: flex; gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.logo-campo__botones .btn { margin-top: 0; }
.logo-campo__nota { margin: 0; color: var(--tinta-3); font-size: 12px; }

/* ---------- Telefono: lateral arriba, pestanas abajo ---------- */

@media (max-width: 720px) {
  #view-panel.is-active { display: block; }

  .lateral {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--linea);
  }
  .lateral__marca { flex: 1; min-width: 0; padding: 0; flex-direction: row; align-items: center; gap: 12px; }
  .lateral__logo { width: 96px; flex: none; }
  .lateral__sesion { margin: 0; padding: 0; border: 0; gap: 4px; }
  .lateral__quien { display: none; }
  .lateral__nombre { font-size: 14px; }

  .pestanas {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    flex-direction: row;
    gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(251, 251, 253, .96);
    border-top: 1px solid var(--linea);
  }
  .pestana {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 0 4px;
    font-size: 11px;
    text-align: center;
  }

  .main { padding: 20px 16px 96px; }
  .vista__titulo { font-size: 28px; }
  .vista__head { margin-bottom: 16px; }
  .vista__head .btn { width: 100%; }

  .filtros { padding: 14px; }
  .filtros .campo__input,
  .filtros .campo__input--select,
  .filtros .busca,
  .filtros .btn { flex: 1 1 100%; min-width: 0; }

  .tabla-caja { padding: 6px 16px 14px; }
  .cotizacion__form { padding: 16px 16px 4px; }

  /* Solo el directorio: la tabla de precios se queda como tabla, con su
     scroll horizontal, porque ahi lo que se compara son numeros en columna. */
  #vista-proveedores .tabla-caja { display: none; }
  #vista-proveedores .tarjetas { display: block; }

  .toast { bottom: 84px; }
}

@media (min-width: 721px) {
  .ficha { align-items: center; padding: var(--sp-3); }
  .ficha__caja { border-radius: 28px; }
  .ficha__acciones { bottom: -28px; }
}
