/* Portal de transportistas: la misma cara que Citas de carga y Cargas (Segoe UI, cabecera con
   degradado naranja, ciruela #5b1f5f). Pensado también para el móvil: en pantalla estrecha
   cada carga es una tarjeta. */
:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  --brand-orange: #f26b2a;
  --brand-orange-dark: #d55a1f;
  --brand-plum: #5b1f5f;
  --brand-plum-dark: #36103a;
  --grid-border: #e4d6ec;
  --bg: #f9f6fb;
  --ink: #2c1b2f;
  --muted: rgba(44, 27, 47, 0.62);
  --header-gradient: linear-gradient(120deg, #f26b2a 0%, #f98f4f 55%, #fbd1a4 100%);
  --rojo: #c62828;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
[hidden] { display: none !important; }

.app__header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.7rem 1.5rem; background: var(--header-gradient); color: #fff; box-shadow: 0 6px 18px rgba(54, 16, 58, 0.32); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.8rem; border-radius: 16px; background: rgba(255, 255, 255, 0.18); }
.brand__logo { height: 30px; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-size: 0.96rem; font-weight: 700; letter-spacing: 0.08em; }
.brand__subtitle { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.85); }
.perfil { display: inline-flex; gap: 0.6rem; align-items: center; font-size: 0.85rem; overflow-wrap: anywhere; }

.barra { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.6rem 1.5rem; background: var(--header-gradient); color: #fff; }
.barra h1 { margin: 0; font-size: 1.1rem; }
.acciones { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }

.btn { border: none; border-radius: 999px; padding: 0.5rem 1.15rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--brand-orange); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-orange-dark); }
.btn--ghost { background: #fff; color: var(--brand-plum-dark); border: 1px solid rgba(44, 27, 47, 0.22); }
.btn--toolbar { background: rgba(255, 255, 255, 0.15); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; padding: 0.4rem 0.8rem; font-size: 0.86rem; white-space: nowrap; }
.btn--toolbar:hover:not(:disabled) { background: rgba(255, 255, 255, 0.28); }
.btn--export { background: rgba(76, 175, 80, 0.55); border-color: rgba(76, 175, 80, 0.8); }

.vista { display: flex; flex-direction: column; gap: 0.8rem; padding-bottom: 2rem; }
.vista > :not(.barra) { margin-left: 1.5rem; margin-right: 1.5rem; }
.tarjeta { background: #fff; border: 1px solid var(--grid-border); border-radius: 14px; padding: 1rem 1.2rem; box-shadow: 0 10px 24px rgba(91, 31, 95, 0.06); }
.entrar { max-width: 460px; margin: 2rem auto 0 !important; display: flex; flex-direction: column; gap: 0.6rem; }
.entrar h1 { margin: 0; color: var(--brand-plum); font-size: 1.3rem; }
.entrar p { margin: 0; }
.entrar form { display: flex; flex-direction: column; gap: 0.5rem; }
.entrar label { font-weight: 600; }
.entrar input { border: 1px solid rgba(91, 31, 95, 0.3); border-radius: 8px; padding: 0.6rem 0.7rem; font-size: 1rem; }
#codigo { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; }
.fila-botones { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.info { margin: 0.4rem 0 0; font-weight: 600; color: var(--brand-plum-dark); }
.leyenda, .sub { margin: 0; color: var(--muted); font-size: 0.84rem; }
.vacio { text-align: center; color: var(--muted); }

.grupo h2 { margin: 0.4rem 0; font-size: 1rem; color: var(--brand-plum); }
.tabla-caja { overflow: auto; background: #fff; border: 1px solid var(--grid-border); border-radius: 14px; box-shadow: 0 10px 24px rgba(91, 31, 95, 0.08); }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 0.78rem; color: var(--brand-plum); background: #f4edf7; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--grid-border); white-space: nowrap; }
td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--grid-border); vertical-align: middle; }
td.envio { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: rgb(39, 113, 194); }
td.hora { font-weight: 700; }
tr.pendiente td { background: #fff6ec; }
td select { border: 1px solid rgba(91, 31, 95, 0.3); border-radius: 6px; padding: 0.3rem 0.4rem; background: #fff; }
select.error { border-color: var(--rojo); color: var(--rojo); }
.pill { font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 0.15rem 0.6rem; display: inline-block; }
.p-ok { background: rgba(152, 208, 70, 0.3); color: #3d6b0e; }
.p-naranja { background: rgba(255, 106, 57, 0.3); color: #a33d14; }

.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.2rem; color: #fff; border-radius: 10px; padding: 0.7rem 1rem; font-weight: 600; max-width: min(640px, calc(100% - 2rem)); z-index: 20; box-shadow: 0 12px 28px rgba(54, 16, 58, 0.35); background: var(--brand-plum-dark); }
.aviso.ok { background: #2e7d32; }
.aviso.error { background: #c2410c; }

/* Móvil: cada carga, una tarjeta con su etiqueta delante de cada dato. */
@media (max-width: 720px) {
  .app__header, .barra { padding: 0.6rem 1rem; }
  .vista > :not(.barra) { margin-left: 1rem; margin-right: 1rem; }
  .tabla-caja { background: none; border: none; box-shadow: none; }
  table.citas thead { display: none; }
  table.citas tr { display: block; background: #fff; border: 1px solid var(--grid-border); border-radius: 12px; margin-bottom: 0.6rem; padding: 0.3rem 0.4rem; }
  table.citas td { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; border: none; padding: 0.3rem 0.4rem; }
  table.citas td::before { content: attr(data-t); color: var(--muted); font-size: 0.8rem; }
}
