:root {
  --azul: #0050F0;
  --azul-oscuro: #0040c0;
  --texto: #16202c;
  --gris: #5b6776;
  --borde: #d8e0ea;
  --fondo: #eef3f9;
  --ok: #12805c;
  --alerta: #b3261e;
  --radio: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------ barra */
.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--azul);
  color: #fff;
}

.marca { display: flex; align-items: center; gap: 8px; font-size: 17px; letter-spacing: .2px; }
.marca .punto { width: 10px; height: 10px; border-radius: 50%; background: #9dc0ff; }
.logo-marca { height: 24px; width: auto; display: block; }
.logo-login { height: 48px; width: auto; display: block; margin: 0 auto 12px; }
.marca strong { font-weight: 700; }

.red {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.red.online { background: #0d7a4f; }

.link {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  padding: 6px 0;
  cursor: pointer;
  opacity: .9;
}

/* ------------------------------------------------ layout */
.contenido {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
}

.tarjeta {
  background: #fff;
  border-radius: var(--radio);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(16,32,48,.06), 0 8px 24px rgba(16,32,48,.06);
  margin-bottom: 14px;
}

.titulo { margin: 0 0 6px; font-size: 21px; }

.ayuda { color: var(--gris); font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
.ayuda.chica { font-size: 13px; }

/* ------------------------------------------------ formularios */
label, legend {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 6px;
}
label:first-of-type { margin-top: 4px; }
.req { color: var(--azul); }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--texto);
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 13px 12px;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; min-height: 56px; line-height: 1.4; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(0,80,240,.13);
}

input:invalid:not(:placeholder-shown), textarea:invalid:not(:placeholder-shown) {
  border-color: var(--alerta);
}

fieldset { border: 0; padding: 0; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip.sel { background: rgba(0,80,240,.09); border-color: var(--azul); color: var(--azul); font-weight: 600; }

.boton {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: var(--azul);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.boton:active { background: var(--azul-oscuro); }
.boton[disabled] { opacity: .55; }

/* ------------------------------------------------ usuario */
.fila-usuario {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--borde);
  margin-bottom: 4px;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(0,80,240,.1);
  color: var(--azul);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 17px;
}
.nombre { font-weight: 700; }
.rol { font-size: 12px; color: var(--gris); }

/* ------------------------------------------------ ok */
.ok { background: #e9f7f0; border: 1px solid #bfe6d5; }
.ok h2 { margin: 0 0 6px; color: var(--ok); font-size: 19px; }
.ok .ayuda { margin-bottom: 4px; color: #2c5c49; }

/* ------------------------------------------------ cola */
.cola-cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cola-cabecera h2 { font-size: 16px; margin: 0; }
.badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--alerta);
  color: #fff;
  font-size: 12px;
  text-align: center;
  vertical-align: 2px;
}
.cola { list-style: none; margin: 10px 0 0; padding: 0; }
.cola li {
  border-top: 1px solid var(--borde);
  padding: 12px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.cola .datos { min-width: 0; }
.cola .cliente { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cola .meta { font-size: 12px; color: var(--gris); }
.cola .acciones { display: flex; gap: 4px; flex: none; }
.cola button {
  border: 1px solid var(--borde);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ------------------------------------------------ aviso */
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 28px);
  background: #16202c;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 50;
  text-align: center;
}
.aviso.error { background: var(--alerta); }
.aviso.ok { background: var(--ok); }
