/* NowLoads Platform — estilos del panel
   © Agencia Tortuga · https://agenciatortuga.cl */

/* Respetar el atributo hidden por sobre display de .btn/.card */
.nlp-app [hidden] { display: none !important; }

/* Tipografía auto-alojada (Ley 21.719, sin Google Fonts) */
@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lato";
  src: url("../fonts/lato-700.woff2") format("woff2");
  font-weight: 500 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face { font-family: "NL Sans"; src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2"); font-weight: 100 450; font-style: normal; font-display: swap; }
@font-face { font-family: "NL Sans"; src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2"); font-weight: 451 900; font-style: normal; font-display: swap; }
@font-face { font-family: "NL Sans"; src: url("../fonts/lato-400.woff2") format("woff2"); font-weight: 100 450; font-style: normal; font-display: swap; unicode-range: U+0030-0039; }
@font-face { font-family: "NL Sans"; src: url("../fonts/lato-700.woff2") format("woff2"); font-weight: 451 900; font-style: normal; font-display: swap; unicode-range: U+0030-0039; }

/* Sistema de diseño — paleta: navy #183c48 · azul #306cc0 · turquesa #6ccccc · grises. */

:root {
  /* Paleta derivada del logotipo NowLoads */
  --navy: #16323d;        /* texto de títulos (teal-navy del wordmark) */
  --navy-bg: #16323d;     /* fondo de marca (sidebar, hero) */
  --navy-700: #1f4655;
  --blue: #306cc0;        /* azul del anillo (acción primaria) */
  --blue-600: #275aa6;
  --sky: #48a8e4;         /* celeste de realce */
  --teal: #3fb6b6;        /* turquesa del swoosh */
  --teal-600: #2f9a9a;

  --ink: #183c48;         /* texto principal (color del wordmark) */
  --slate: #45616c;
  --muted: #6a808a;
  --line: #e2e9ec;
  --line-2: #eef3f5;
  --bg: #f5f8f9;
  --card: #ffffff;
  --white: #ffffff;

  --amber: #b7791f;
  --amber-bg: #fdf3e1;
  --green: #15803d;
  --green-bg: #e7f6ec;
  --red: #b91c1c;
  --red-bg: #fbeaea;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: none;
  --shadow-sm: none;

  /* Tipografía del sistema: San Francisco en iPhone/iPad/Mac, Roboto en Android, Segoe UI en Windows. */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --maxw: 1180px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .4em; color: var(--navy); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); margin-bottom: .6rem;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: .01em; }

/* Iconos del set inline: tamaño consistente por contexto */
.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em; flex: none; }
.btn .ico { width: 1.05em; height: 1.05em; vertical-align: -0.12em; }
.s-foot .ico { width: 18px; height: 18px; vertical-align: -0.22em; }
.notif-btn .ico, .hamburger .ico { width: 20px; height: 20px; }
.feature .ic .ico { width: 22px; height: 22px; }
.empty .ic .ico { width: 44px; height: 44px; }
.page-head .ico, .card-head .ico { width: 1.05em; height: 1.05em; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: .72rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-dark { background: var(--navy-bg); color: #fff; }
.btn-dark:hover { background: var(--navy-700); color: #fff; }
.btn-teal { background: var(--teal); color: #042b27; }
.btn-teal:hover { background: var(--teal-600); }
.btn-ghost { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9d2e3; background: #fbfcfe; }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #f3cccc; }
.btn-danger:hover { background: #f7dcdc; }
.btn-sm { padding: .5rem .8rem; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Badges de estado ---- */
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  padding: .22rem .5rem; border-radius: 4px; line-height: 1.3; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-gray   { background: #eef1f7; color: #4a5568; }
.badge-blue   { background: #e8efff; color: #1f4fd0; }
.badge-cyan   { background: #e2f6f4; color: #0b7a72; }
.badge-indigo { background: #ebe9ff; color: #4f46c7; }
.badge-purple { background: #f0e7fb; color: #6a3fb0; }
.badge-amber  { background: var(--amber-bg); color: var(--amber); }
.badge-teal   { background: #def5f0; color: #166a6a; }
.badge-green  { background: var(--green-bg); color: #12692c; }
.badge-red    { background: var(--red-bg); color: var(--red); }

/* ---- Utilidades de layout ---- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.row { display: flex; gap: 1rem; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-sm { gap: .5rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2.grid-wide-l { grid-template-columns: 1.4fr 1fr; align-items: start; }
.grid-2.grid-wide-r { grid-template-columns: 1fr 1.4fr; align-items: start; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .75rem; } .mt-2 { margin-top: 1.5rem; } .mt-3 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .75rem; } .mb-2 { margin-bottom: 1.5rem; }

/* ==========================================================================
   SITIO PÚBLICO
   ========================================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 40; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-nav .container { display: flex; align-items: center; height: 66px; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 19px;
  color: var(--navy); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-mark { height: 28px; width: auto; flex: none; }
.brand-light span { color: #fff; }
.s-brand .brand-mark { height: 30px; }
.site-nav .links { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.site-nav .links a {
  font-size: 13px; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: .06em;
}
.site-nav .links a:hover { color: var(--navy); text-decoration: none; }
.site-nav .actions { display: flex; gap: .6rem; align-items: center; }
.nav-toggle { display: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer; color: var(--navy); }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--card); padding: .6rem 24px 1rem; }
.mobile-menu > a { display: block; padding: .7rem .2rem; font-size: 15px; font-weight: 600; color: var(--navy);
  border-bottom: 1px solid var(--line-2); }
.mobile-menu > a:hover { text-decoration: none; color: var(--blue); }
.mobile-menu .mm-actions { display: grid; gap: .5rem; margin-top: .9rem; }
.site-nav.open .mobile-menu { display: block; }

/* Búsqueda y paginación de listados */
.search-box { display: flex; align-items: center; gap: .5rem; }
.search-box .input { max-width: 280px; }
.search-box .sb-ic { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.pager-info { font-size: 13px; color: var(--muted); }

/* Spinner de carga en botones al enviar */
.btn.is-loading { pointer-events: none; opacity: .9; }
.btn.is-loading::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor;
  border-top-color: transparent; border-radius: 50%; display: inline-block; animation: nlspin .6s linear infinite; }
@keyframes nlspin { to { transform: rotate(360deg); } }

.hero { position: relative; overflow: hidden; background: var(--navy-bg); color: #eef6f8; }
.hero::before {
  /* (Textura de scanlines eliminada: fondo plano) */
  content: none;
}
.hero .container { position: relative; padding: 84px 24px 92px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 16ch; }
.hero .lead { font-size: 1.12rem; color: #cfe2e7; max-width: 52ch; margin-bottom: 1.8rem; }
.hero .cta-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero .eyebrow { color: var(--teal); }

/* Signature: tarjeta de carga del hero */
.hero-visual { position: relative; min-height: 320px; }
.freight-card { background: var(--card); border-radius: var(--radius); padding: 1.4rem 1.5rem; color: var(--ink);
  border: 1px solid var(--line); }
.freight-card.stack { position: relative; z-index: 2; }
.freight-card.behind { position: absolute; top: -28px; right: -10px; width: 74%; z-index: 1; opacity: .5;
  padding: 1rem 1.2rem; }
.freight-card .fc-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.freight-card .fc-ref { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.freight-card .fc-tag { font-size: 11px; font-weight: 700; color: var(--red); background: var(--red-bg);
  padding: .15rem .5rem; border-radius: var(--radius-sm); }
.freight-card .fc-title { font-weight: 700; font-size: 1.1rem; color: var(--navy); margin-bottom: .55rem; }
.freight-card .fc-route { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); margin-bottom: .5rem; }
.freight-card .fc-route.mini { font-size: 13px; font-weight: 600; margin: 0; }
.freight-card .fc-arrow { color: var(--blue); }
.freight-card .fc-meta { font-size: 13px; color: var(--slate); }
.freight-card .fc-sep { height: 1px; background: var(--line); margin: .9rem 0; }
.freight-card .fc-offers { display: flex; align-items: baseline; gap: .5rem; }
.freight-card .fc-offers span { font-size: 13px; color: var(--muted); }
.freight-card .fc-offers b { font-family: var(--mono); font-size: 1.25rem; color: var(--navy); }
.freight-card .fc-carriers { display: flex; align-items: center; gap: .35rem; margin-top: .9rem; }
.freight-card .fc-av { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-bg); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; margin-left: -6px; border: 2px solid #fff; }
.freight-card .fc-av:first-child { margin-left: 0; }
.freight-card .fc-stars { font-size: 12px; color: #166a6a; font-weight: 600; margin-left: .4rem; }

/* Route line motif */
.routeline { display: flex; align-items: center; gap: .5rem; margin: 1.6rem 0; max-width: 460px; color: #9fbcc4; font-size: 13px; }
.routeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); flex: none; }
.routeline .dot.end { background: var(--blue); }
.routeline .track { flex: 1; height: 2px; background: #c9d6db; border-radius: 2px; position: relative; }
.routeline .track::after { content: "▸"; position: absolute; right: -2px; top: -9px; color: var(--blue); font-size: 13px; }

.hero-stats { display: flex; gap: 2.4rem; margin-top: 2.6rem; flex-wrap: wrap; }
.hero-stats .stat .n { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; color: #fff; }
.hero-stats .stat .l { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #8caab4; }

.section { padding: 72px 0; }
.section.alt { background: var(--card); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section .lead { color: var(--slate); max-width: 60ch; font-size: 1.05rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.4rem; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
  position: relative;
}
.section.alt .feature { background: var(--bg); }
.feature .ic { width: 38px; height: 38px; border-radius: var(--radius); background: #e8efff; color: var(--blue);
  display: grid; place-items: center; margin-bottom: 1rem; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--slate); font-size: 14px; margin: 0; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2.4rem; }
.step { position: relative; padding-top: 2.6rem; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--blue);
  position: absolute; top: 0; left: 0; letter-spacing: .05em;
  border-top: 2px solid var(--blue); padding-top: .5rem; width: 40px;
}
.step h3 { font-size: 1rem; }
.step p { color: var(--slate); font-size: 14px; margin: 0; }

.cta-band { background: var(--navy-bg); color: #fff; border-radius: var(--radius); padding: 3rem; text-align: center; margin: 0 auto; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #bcd4da; max-width: 50ch; margin: 0 auto 1.6rem; }

.faq-item { border-bottom: 1px solid var(--line); padding: 1.2rem 0; }
.faq-item h3 { font-size: 1.02rem; margin-bottom: .4rem; }
.faq-item p { color: var(--slate); margin: 0; }

.site-footer { background: #10262f; color: #9fbcc4; padding: 56px 0 28px; font-size: 14px; }
.site-footer a { color: #cfe2e7; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; }
.site-footer .fcol a { display: block; margin-bottom: .5rem; }
.site-footer .legal { border-top: 1px solid #1c4150; margin-top: 2.4rem; padding-top: 1.4rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.made-cl { display: inline-flex; align-items: center; gap: .4rem; font-size: 12.5px; color: #9fbcc4; }
.made-cl .flag { width: 18px; height: 12px; border-radius: 2px; overflow: hidden; display: inline-block; flex: none; }

/* ---- Auth ---- */
.auth-wrap { position: relative; z-index: 1; min-height: 0; padding: 0; width: 100%; display: flex; justify-content: center; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 420px; padding: 2rem; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.5rem; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 1.4rem; font-size: 14px; color: var(--muted); }

/* ==========================================================================
   PANEL (app)
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--navy-bg); color: #c8dbe0;
  position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 50;
}
.sidebar .s-brand { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: 20px 22px; color: #fff;
  font-weight: 800; font-size: 18px; letter-spacing: -.02em; border-bottom: 1px solid #1c4150; }
.sidebar .s-role { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #7fa3ad;
  padding: 18px 22px 8px; }
.sidebar nav { flex: 1; overflow-y: auto; padding-bottom: 1rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .7rem; padding: .62rem 22px; color: #b3c8ce;
  font-size: 14px; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #1d4151; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #1d4151; color: #fff; border-left-color: var(--teal); }
.sidebar nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.sidebar .s-foot { padding: 14px 22px; border-top: 1px solid #1c4150; font-size: 12px; }

.app-main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.app-header {
  height: 62px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem; padding: 0 24px;
}
.app-header .page-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.app-header .spacer { flex: 1; }
.hamburger { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius);
  width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; }

.notif { position: relative; }
.notif-btn { background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 38px; height: 38px;
  display: grid; place-items: center; cursor: pointer; color: var(--slate); }
.notif-dot { position: absolute; top: -4px; right: -4px; background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: var(--radius-sm); display: grid;
  place-items: center; padding: 0 4px; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 320px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; display: none; }
.notif-panel.open { display: block; }
.notif-panel .ni { display: block; padding: .7rem .8rem; border-radius: var(--radius); border: 1px solid var(--line); border-left: 3px solid transparent; }
.notif-panel .ni + .ni { margin-top: 8px; }
.notif-panel .ni:hover { background: var(--bg); }
.notif-panel .ni.unread { background: #eef6f8; border-left-color: var(--blue); }
.notif-panel .ni.unread:hover { background: #e6f1f4; }
/* Viaje entregado o finalizado: fondo verde */
.notif-panel .ni.ni-done { background: #e7f5ec; border-color: #bfe3cb; border-left-color: #1f8a4c; }
.notif-panel .ni.ni-done:hover { background: #dcefe3; }
.notif-panel .ni.ni-done .t { color: #145c33; }
.notif-panel .ni .t { font-weight: 600; font-size: 13.5px; color: var(--navy); }
.notif-panel .ni .b { font-size: 12.5px; color: var(--muted); }
.notif-empty { padding: 1.4rem; text-align: center; color: var(--muted); font-size: 13px; }

.user-chip { display: flex; align-items: center; gap: .55rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.user-chip .nm { font-size: 13.5px; font-weight: 600; color: var(--navy); line-height: 1.1; }
.user-chip .rl { font-size: 11.5px; color: var(--muted); }

.app-body { padding: 26px 24px 48px; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: .2rem; }

/* ---- KPI cards ---- */
.kpis { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.6rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; flex: 1 1 180px;
  position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.kpi.teal::before { background: var(--teal); }
.kpi.amber::before { background: var(--amber); }
.kpi.navy::before { background: var(--navy-bg); }
.kpi.green::before { background: var(--green); }
.kpi .l { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.kpi .n { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--navy); margin-top: .25rem; line-height: 1; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: .3rem; }

/* ---- Cards / panels ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between;
  align-items: center; gap: 1rem; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 1.2rem; }
.card-body.tight { padding: 0; }
.tight-head { padding: 1.1rem 1.2rem .7rem; }

/* ---- Tablas ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: .85rem 1.2rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data .ref { font-family: var(--mono); font-size: 12.5px; color: var(--slate); }
.t-actions { display: flex; gap: .4rem; justify-content: flex-end; }

/* ---- Forms ---- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: .25rem; }
.input, select.input, textarea.input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .8rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--blue);
  outline: 2px solid rgba(48,108,192,.45); outline-offset: 1px; box-shadow: none; }
textarea.input { resize: vertical; min-height: 84px; }
.check { display: flex; align-items: center; gap: .55rem; font-size: 13.5px; color: var(--ink); cursor: pointer; padding: .35rem 0; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin: 0 0 1.4rem; }
fieldset legend { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  color: var(--blue); padding: 0 .5rem; }

/* ---- Flash ---- */
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: .6rem;
  max-width: 360px; }
.flash { padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.4; box-shadow: var(--shadow);
  border: 1px solid; display: flex; gap: .6rem; align-items: center; background: var(--card); }
.app-body > .flash, .pwa-main > .flash { margin-bottom: 1rem; }
.flash.success { border-color: #bfe6cb; color: var(--green); }
.flash.error { border-color: #f0c9c9; color: var(--red); }
.flash .x { margin-left: auto; cursor: pointer; opacity: .5; background: none; border: none; font-size: 16px; }

/* ---- Timeline de viaje ---- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1.3rem 2.2rem; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--line); }
.timeline li.done::before { background: var(--teal); border-color: var(--teal); }
.timeline li.current::before { background: var(--blue); border-color: var(--blue); }
.timeline li .ts { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.timeline li .st { font-weight: 600; color: var(--navy); font-size: 14px; }
.timeline li .nt { font-size: 13px; color: var(--slate); }

/* ---- Mapa ---- */
.map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.map-sm { height: 300px; }

/* ---- Load card (marketplace) ---- */
.load-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.load-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem;
  display: flex; flex-direction: column; gap: .7rem; transition: border-color .15s, box-shadow .15s; }
.load-card:hover { border-color: #cdd8ee; box-shadow: var(--shadow); }
.load-card .lc-top { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.load-card h3 { font-size: 1.02rem; margin: 0; }
.load-card .lc-ref { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.lc-route { display: flex; align-items: center; gap: .5rem; font-size: 13.5px; color: var(--ink); }
.lc-route .city { font-weight: 600; }
.lc-route .arrow { color: var(--blue); }
.lc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; font-size: 12.5px; color: var(--slate); }
.lc-meta b { color: var(--navy); font-weight: 600; }
.lc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .2rem; }
.lc-price { font-family: var(--mono); font-weight: 700; color: var(--navy); font-size: 1.05rem; }

.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: 11px; font-weight: 600;
  background: #eef1f7; color: #54607a; padding: .15rem .5rem; border-radius: var(--radius-sm); }
.tag.urgent { background: var(--red-bg); color: var(--red); }
.tag.cold { background: #e2f0ff; color: #1f6fd0; }

/* ---- Rating stars ---- */
.stars { color: #e0a000; font-size: 13px; letter-spacing: 1px; }
.rel-bar { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; width: 90px; }
.rel-bar i { display: block; height: 100%; background: var(--teal); }

/* ---- Filtros ---- */
.filters { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: .7rem; align-items: end; }
.filters .field { margin: 0; }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .ic { width: 48px; height: 48px; margin: 0 auto 1rem; color: #aab9c0; }
.empty-art { width: 140px; height: 96px; margin: 0 auto 1.2rem; display: block; }
.empty h3 { color: var(--slate); font-size: 1.05rem; }

/* ---- Definición / detalle ---- */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: .55rem 1rem; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; color: var(--ink); }

/* ---- Cookie banner (Ley 21.719) ---- */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 95; max-width: 560px; margin: 0 auto;
  background: var(--navy-bg); color: #d4ddf0; border-radius: var(--radius); padding: 1.1rem 1.3rem;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
}
.cookie p { margin: 0; font-size: 13px; flex: 1 1 260px; }
.cookie a { color: var(--teal); }
.cookie .btn { white-space: nowrap; }

/* ---- Signature pad ---- */
.sigpad { border: 2px dashed var(--line); border-radius: var(--radius-sm); background: var(--card); touch-action: none; width: 100%; height: 180px; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .grid-4, .kpis { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; border-right: 1px solid rgba(255,255,255,.08); }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .nav-toggle { display: inline-flex; }
  .site-nav .links { display: none; }
  .site-nav .actions { display: none; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(8,21,46,.5); z-index: 45; }
  .sidebar-backdrop.show { display: block; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-visual { min-height: 0; max-width: 420px; }
  .freight-card.behind { display: none; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .kpis, .form-grid,
  .grid-2.grid-wide-l, .grid-2.grid-wide-r { grid-template-columns: 1fr; }
  .feature-grid, .steps, .site-footer .cols { grid-template-columns: 1fr; }
  .hero .container { padding: 56px 20px 64px; }
  .cta-band { padding: 2rem 1.4rem; }
  .dl { grid-template-columns: 1fr; gap: .15rem; }
  .dl dt { margin-top: .6rem; }
  .kpi { flex: 1 1 140px; padding: .9rem 1rem; }
  .kpi .n { font-size: 1.5rem; }
}

/* Accesibilidad */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── NowLoads Platform: extras del plugin ───────────────────────── */
.flash.info { border-color: #bcd9e6; color: var(--navy); background: #eef6f8; }
/* Acceso: logo grande centrado sobre el formulario + isotipo como marca de agua */
.nlp-public { position: relative; overflow: hidden; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.nlp-public::before, .nlp-public::after { content: ""; position: absolute; z-index: 0;
  background: url(../img/logo_mark.png) no-repeat center / contain; pointer-events: none; }
.nlp-public::before { width: 380px; height: 348px; top: -72px; right: -96px; opacity: .06; }
.nlp-public::after  { width: 320px; height: 293px; bottom: 24px; left: -118px; opacity: .045; }
.auth-top { position: relative; z-index: 1; padding: 0; margin: 0 0 26px;
  display: flex; justify-content: center; width: 100%; }
.auth-top .brand { gap: 0; }
.auth-top .brand-logo { height: 76px; }
@media (max-width: 380px) {
  .auth-top .brand-logo { height: 64px; }
  .nlp-public::before { width: 300px; height: 275px; top: -56px; right: -80px; }
  .nlp-public::after { width: 260px; height: 238px; left: -96px; }
}
.auth-card-wide { max-width: 560px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1.2rem; }
.role-switch.role-switch-3 { grid-template-columns: repeat(3, 1fr); }
.role-opt { border: 1.5px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; cursor: pointer;
  display: flex; flex-direction: column; gap: .15rem; transition: border-color .15s, background .15s; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt strong { color: var(--navy); font-size: .95rem; }
.role-opt span { font-size: 12px; color: var(--muted); }
.role-opt.on { border-color: var(--blue); background: #eef4fc; }
.s-brand .s-mark { width: 26px; height: 26px; }
@media (max-width: 520px) { .role-switch, .role-switch.role-switch-3 { grid-template-columns: 1fr; } }

/* ── Planes de membresía ─────────────────────────────────────────── */
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.plan-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column; }
.plan-card.is-current { border-color: var(--teal); }
.plan-name { margin: 0 0 6px; font-size: 16px; color: var(--navy); }
.plan-price { font-size: 28px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.plan-features { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.plan-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--slate); }
.plan-features li .ico { width: 16px; height: 16px; color: var(--teal); flex: 0 0 auto; margin-top: 2px; }
.plan-card form { margin-top: auto; }
.plan-card .btn-block { margin-top: auto; }

/* Página Instalar app */
.nlp-benefits, .nlp-steps { margin: .2rem 0 0; padding-left: 1.2rem; color: var(--ink); line-height: 1.7; }
.nlp-benefits li, .nlp-steps li { margin-bottom: .35rem; }
.nlp-share-ic { display: inline-flex; vertical-align: middle; }
.nlp-share-ic svg { width: 18px; height: 18px; color: var(--blue); }

/* Indicador "En vivo" (punto verde) junto a la referencia del viaje */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1a9e54; margin-left: 4px; vertical-align: middle; }

/* ── Sidebar: logo original + logout como botón ─────────────────── */
.sidebar .s-brand { padding: 18px 20px; }
.sidebar .s-brand .s-logo { height: 34px; width: auto; display: block; }
.sidebar .s-foot .s-logout {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .62rem .8rem; border: 1px solid rgba(255,255,255,.24);
  border-radius: var(--radius); color: #fff; font-size: 13.5px; font-weight: 600;
}
.sidebar .s-foot .s-logout:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.45); color: #fff; text-decoration: none; }
.sidebar .s-foot .s-logout .ico { width: 18px; height: 18px; opacity: .95; vertical-align: 0; }

/* ── Página de Ajustes ──────────────────────────────────────────── */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.set-card .set-head { padding: .9rem 1.2rem; border-bottom: 1px solid var(--line-2); font-weight: 700; color: var(--navy); font-size: .98rem; }
.set-card .set-body { padding: 1.1rem 1.2rem; }
.set-list { display: grid; gap: .85rem; }
.set-row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.set-row .k { color: var(--muted); font-size: 13px; }
.set-row .v { color: var(--ink); font-weight: 600; font-size: 14px; text-align: right; word-break: break-word; }
@media (max-width: 860px) { .set-grid { grid-template-columns: 1fr; } }

/* ── Flota: pestañas ───────────────────────────────────────────── */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.tabs .tab { padding: .6rem 1rem; font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--navy); text-decoration: none; }
.tabs .tab.on { color: var(--navy); border-bottom-color: var(--blue); }

/* ── Botón/acción destructiva ──────────────────────────────────── */
.btn.danger { color: #b42318; border-color: #f0c6c1; }
.btn.danger:hover { background: #fdecea; border-color: #e0392b; color: #8a1f1f; }

/* ── Casilleros de documentos ──────────────────────────────────── */
.doc-slots { display: grid; gap: .8rem; }
.doc-slot { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; background: var(--card); }
.doc-slot-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.doc-slot-head strong { color: var(--navy); font-size: .92rem; }
.doc-slot-head .req { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-left: .4rem; }
.doc-slot-body { display: flex; align-items: flex-start; gap: 12px;
  margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.doc-slot-meta { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.doc-slot-actions { display: flex; align-items: center; gap: .4rem; }
.doc-slot-actions form { margin: 0; }
.doc-slot-up { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
.doc-slot-up .input { height: 34px; padding: .25rem .5rem; font-size: 13px; flex: 1 1 auto; min-width: 120px; width: auto; }
.doc-slot-up .input[type="date"] { flex: 0 0 auto; min-width: 130px; }
.doc-slot-up .btn { flex: none; }

/* ── Landing pública (editorial, plano) ─────────────────────────── */
.landing { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 7vh 20px 5vh; text-align: center; }
.landing-hero h1 { font-size: 2.1rem; line-height: 1.15; color: var(--navy); letter-spacing: -0.01em; margin: 0; }
.landing-hero .lead { color: var(--muted); font-size: 1.05rem; max-width: 580px; margin: 1rem auto 1.8rem; line-height: 1.5; }
.landing-cta { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.landing-cta .btn { min-width: 150px; }
.landing-feats { list-style: none; padding: 0; margin: 3rem auto 0; display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; text-align: left; }
.landing-feats li { padding: 1.15rem 1.2rem; border-right: 1px solid var(--line); }
.landing-feats li:last-child { border-right: 0; }
.landing-feats strong { display: block; color: var(--navy); font-size: .95rem; margin-bottom: .3rem; }
.landing-feats span { color: var(--muted); font-size: 13px; line-height: 1.4; }
@media (max-width: 640px) {
  .landing-hero h1 { font-size: 1.7rem; }
  .landing-feats { grid-template-columns: 1fr; }
  .landing-feats li { border-right: 0; border-bottom: 1px solid var(--line); }
  .landing-feats li:last-child { border-bottom: 0; }
}

/* ── Panel admin: datos clave-valor, filtros, vacíos ─────────────── */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem 1.4rem; }
.kv > div { display: flex; flex-direction: column; gap: .15rem; }
.kv span { color: var(--muted); font-size: 12px; }
.kv strong { color: var(--navy); font-size: .95rem; font-weight: 600; }
.admin-filters { display: flex; align-items: center; gap: .6rem; }
.admin-filters label { color: var(--navy); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: .4rem; }
.admin-filters .input { height: 34px; padding: .25rem .5rem; font-size: 13px; width: auto; min-width: 150px; }
.tight-empty { color: var(--muted); padding: 1rem 1.2rem; margin: 0; }

/* ── Panel admin: incidencias ───────────────────────────────────── */
.incident-reply { font-size: 13px; background: #f6f8f9; border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .7rem; margin: .5rem 0 0; color: var(--navy); }

/* ── Panel admin: seguimiento en vivo ───────────────────────────── */
.track-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.track-list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.track-item { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.track-item:hover { border-color: #c9d2e3; }
.track-item.on { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.track-route { font-weight: 600; color: var(--navy); margin-top: 2px; }
.track-live { color: var(--green); font-weight: 700; font-size: 11px; }
.track-map-wrap { min-width: 0; }
.track-map { height: 560px; border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 780px) { .track-grid { grid-template-columns: 1fr; } .track-map { height: 420px; } }

/* ── Panel admin: indicador de estado (MercadoPago) ─────────────── */
.sdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); flex: 0 0 auto; }
.sdot.ok { background: var(--green); }
.sdot.err { background: #c0392b; }
.sdot.off { background: #c9a227; }

/* ── Constructor de formularios: arrastrar y soltar ─────────────── */
.drag-handle { cursor: grab; color: var(--muted); font-size: 15px; user-select: none; padding: 0 6px 0 2px; line-height: 1; }
#nlp-fields-body tr { cursor: default; }
#nlp-fields-body tr.dragging { opacity: .5; background: #eef3f8; }

/* ── Números con cifras tabulares (reemplazo del mono tipo IBM) ──── */
.kpi .n, .freight-card .fc-ref, .freight-card .fc-offers b, .hero-stats .stat .n {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}

/* ── Botones solo-icono (editar / eliminar / aprobar / rechazar) ── */
.btn-icon { padding: .42rem .5rem; line-height: 0; }
.btn-icon .ico { width: 16px; height: 16px; vertical-align: middle; }
.btn-icon.danger { color: var(--red); }
.btn-ghost.btn-icon:hover { background: var(--line-2); }

/* ── Reloj de tiempo de transporte ──────────────────────────────── */
.clock { display: inline-flex; flex-direction: column; gap: 2px; }
.clock-l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.clock-v { font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; line-height: 1.1; }
.clock.live .clock-v::before { content: "●"; color: var(--green); font-size: .5em; vertical-align: middle; margin-right: .4em; }
.card-clock { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; background: var(--card); }
.track-item .clock-v { font-size: 16px; }
.track-item .clock-l { font-size: 10px; }

/* ── Modal de mensaje de difusión (broadcast) ───────────────────── */
.nlp-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(16,32,45,.55); }
.nlp-modal.open { display: flex; }
.nlp-modal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); max-width: 440px; width: 100%; padding: 1.5rem; }
.nlp-modal-ey { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); font-weight: 700; margin-bottom: .4rem; }
.nlp-modal-card h3 { margin: 0 0 .6rem; color: var(--navy); font-size: 1.2rem; }
.nlp-modal-card p { margin: 0 0 1.2rem; color: var(--ink); line-height: 1.5; }

/* ── Banner de mantenimiento ────────────────────────────────────── */
.nlp-maint { background: #fff7ed; border: 1px solid #f5c98a; color: #92400e; border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; font-size: 14px; font-weight: 500; }

/* ── Panel: endurecimiento mobile (evitar cortes horizontales) ──── */
.app-main { min-width: 0; }
.app-body { overflow-x: hidden; }
.card, .card-body { min-width: 0; }
.kv strong, .kv span { overflow-wrap: anywhere; }
.card-body, .page-head h1, .page-head .sub { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .app-body { padding: 18px 14px 40px; }
  .page-head h1 { font-size: 1.28rem; }
  .app-header { padding: 0 14px; }
  .card-head { padding: .9rem 1rem; }
  .card-body { padding: 1rem; }
  table.data th, table.data td { padding-left: 1rem; padding-right: 1rem; }
  .tight-head { padding: .9rem 1rem .6rem !important; }
  .status-legend { padding: .8rem 1rem .6rem; }
}

/* ── Cuentas demo (lista apilada, mobile-friendly) ──────────────── */
.demo-accounts { display: flex; flex-direction: column; }
.demo-acct { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.demo-acct:last-child { border-bottom: 0; }
.demo-acct-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.demo-acct-info strong { color: var(--navy); font-size: .95rem; }
.demo-acct-info span { overflow-wrap: anywhere; }
.demo-acct form { flex: 0 0 auto; }

/* ── Detalle de viaje (admin): partes ───────────────────────────── */
.party-block { padding: 12px 0; border-bottom: 1px solid var(--line); }
.party-role { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.party-name { display: inline-block; font-weight: 700; color: var(--navy); font-size: 1rem; }
a.party-name:hover { color: var(--blue); }
.party-meta { font-size: 13px; color: var(--slate, #55707a); margin-top: 3px; overflow-wrap: anywhere; }

/* ── Tablas responsivas: se apilan como tarjetas en mobile ──────── */
@media (max-width: 640px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; box-sizing: border-box; }
  table.data tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px; margin-bottom: 10px; background: var(--card); }
  table.data tr:last-child { margin-bottom: 0; }
  table.data td { white-space: normal; border: 0; padding: 8px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; overflow-wrap: anywhere; min-height: 0; }
  table.data td + td { border-top: 1px solid var(--line-2); }
  table.data td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; flex: 0 0 auto; white-space: nowrap; font-size: 12px; text-transform: none; letter-spacing: 0; }
  table.data td[data-label=""]::before, table.data td.t-actions::before, table.data td:empty::before { display: none; }
  table.data td[data-label=""], table.data td.t-actions { justify-content: flex-end; }
  table.data td:empty { display: none; }
  table.data td .btn { margin: 0; }
}

/* ── Semáforo de estado (reemplaza la columna Estado) ───────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; flex: 0 0 auto; }
.sdot-gray { background: #4a5568; } .sdot-blue { background: #1f4fd0; } .sdot-purple { background: #6a3fb0; }
.sdot-amber { background: var(--amber, #d97706); } .sdot-teal { background: #166a6a; }
.sdot-green { background: #12692c; } .sdot-red { background: var(--red, #c0392b); }
.status-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0; padding: .85rem 1.2rem .7rem; font-size: 12px; color: var(--muted); }
.status-legend span { display: inline-flex; align-items: center; }
.status-legend .sdot { margin-right: 5px; }
.hide-desktop { display: none; }
@media (max-width: 640px) {
  table.data td.hide-desktop { display: flex; }
  table.data .sdot { display: none; }
  .status-legend { display: none; }
}

/* ── Zona de peligro / botón rojo sólido ────────────────────────── */
.btn-danger-solid { background: var(--red, #c0392b); color: #fff; border: 1px solid var(--red, #c0392b); }
.btn-danger-solid:hover { background: #a5301f; border-color: #a5301f; color: #fff; }
.danger-card { border-color: #f0c6c1; }
.danger-card .card-head h3 { color: #b42318; }
.danger-confirm { background: #fdf3f2; border: 1px solid #f0c6c1; border-radius: var(--radius); padding: 12px 14px; }

/* ── Navegación lateral con paneles deslizantes (árbol) ─────────── */
.s-nav-stack { flex: 1; position: relative; overflow: hidden; }
.s-nav-main { height: 100%; overflow-y: auto; padding-bottom: 1rem; }
.s-nav-sub { position: absolute; inset: 0; background: var(--navy-bg); overflow-y: auto; padding-bottom: 1rem;
  transform: translateX(100%); transition: transform .28s ease; z-index: 3; }
.s-nav-sub.open { transform: translateX(0); }
.sidebar .s-item { display: flex; align-items: center; gap: .7rem; width: 100%; box-sizing: border-box;
  padding: .62rem 22px; color: #b3c8ce; font-size: 14px; font-weight: 500; font-family: inherit;
  background: transparent; border: 0; border-left: 3px solid transparent; text-align: left; cursor: pointer; }
.sidebar .s-item:hover { background: #1d4151; color: #fff; text-decoration: none; }
.sidebar .s-item.active { background: #1d4151; color: #fff; border-left-color: var(--teal); }
.sidebar .s-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.s-group .s-chev { margin-left: auto; display: inline-flex; }
.s-group .s-chev svg { width: 15px; height: 15px; opacity: .55; }
.s-back { color: #8fb0ba; font-weight: 600; border-bottom: 1px solid #1c4150; margin-bottom: 4px; }
.s-sub-title { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #7fa3ad; padding: 10px 22px 8px; }

/* ── Planificar ruta ────────────────────────────────────────────── */
.planner-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.planner-field { position: relative; margin: 0; }
.planner-actions .btn { white-space: nowrap; }
.planner-sug { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-top: 4px; max-height: 260px; overflow-y: auto; display: none; }
.planner-sug.open { display: block; }
.planner-sug-item { padding: .5rem .7rem; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line-2); line-height: 1.3; }
.planner-sug-item:last-child { border-bottom: 0; }
.planner-sug-item:hover { background: #f2f6f8; }
.planner-result { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pr-stat { display: flex; flex-direction: column; }
.pr-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pr-stat strong { font-size: 1.3rem; color: var(--navy); }
@media (max-width: 700px) { .planner-fields { grid-template-columns: 1fr; } }

/* Icono de marca (NowLoads) dentro del menú */
.sidebar .s-item img.ico-mark { width: 19px; height: 19px; object-fit: contain; flex: none; opacity: 1; }

/* Encabezados de sección del menú lateral */
.s-section { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #7fa3ad; font-weight: 600; padding: 16px 22px 6px; }
.s-nav-main .s-section:first-child { padding-top: 14px; }

/* Asignación de conductor inline (Mi operación) */
.assign-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.input-sm { padding: .32rem .5rem; font-size: 13px; max-width: 190px; }

/* ── Documentos: miniatura de vista previa + modal ──────────────── */
.doc-thumb { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0; overflow: hidden; cursor: pointer; }
.doc-thumb:hover { border-color: var(--blue); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-thumb-pdf { flex-direction: column; gap: 1px; color: var(--red); }
.doc-thumb-pdf svg { width: 20px; height: 20px; }
.doc-thumb-pdf span { font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.doc-modal { position: fixed; inset: 0; background: rgba(16,50,61,.72); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.doc-modal-box { background: var(--card); border-radius: 12px; padding: 14px; max-width: min(920px, 96vw); max-height: 94vh;
  display: flex; flex-direction: column; gap: 10px; position: relative; }
.doc-modal-box img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 6px; }
.doc-modal-box iframe { width: min(860px, 92vw); height: 80vh; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.doc-modal-x { position: absolute; top: 6px; right: 10px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.doc-modal-x:hover { color: var(--navy); }
.doc-modal-open { margin: 0 auto; }

/* ── Documentos: cámara y vista previa antes de subir ───────────── */
.doc-cam { flex: none; }
.doc-pick { flex-basis: 100%; display: flex; align-items: center; gap: 10px; margin-top: .5rem;
  padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #f7fafb; }
.doc-pick img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.doc-pick-pdf { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: 6px; background: var(--card); border: 1px solid var(--line); color: var(--red); font-size: 10px; font-weight: 800; }
.doc-pick-name { font-size: 13px; color: var(--navy); overflow-wrap: anywhere; min-width: 0; }
.doc-pick-ok { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--green); white-space: nowrap; }

/* Aviso de preparación para producción */
.prod-warn { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #f0c98a; border-left: 3px solid var(--amber);
  border-radius: 8px; background: #fdf6ec; color: #7a4b12; font-size: 13px; line-height: 1.5; }
.prod-warn strong { color: #7a4b12; }

/* ── Fix: el mapa Leaflet no debe pintar sobre el header ────────── */
/* Todo mapa Leaflet queda en su propia capa: sus paneles (z 400) y controles (z 1000)
   ya no se montan sobre el menú lateral, el fondo oscuro ni la cabecera. */
.leaflet-container, #nlp-map, #live-map, #nlp-plan-map { position: relative; z-index: 0; isolation: isolate; }
.leaflet-top, .leaflet-bottom { z-index: 400; }

/* ── Fix: panel de notificaciones no se corta en móvil ──────────── */
@media (max-width: 640px) {
  .notif-panel { position: fixed; left: 10px; right: 10px; top: 58px; width: auto; max-height: 72vh; overflow-y: auto; }
}

/* Fix: el panel de notificaciones no debe recortarse en móvil */
@media (max-width: 560px) {
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 58px; width: auto; max-height: 72vh; overflow-y: auto; }
}

/* Páginas legales */
.legal-body { color: var(--slate); line-height: 1.7; font-size: 14px; }
.legal-body p { margin: 0 0 .8rem; }
.legal-body h2, .legal-body h3 { color: var(--navy); margin: 1.2rem 0 .4rem; }

/* Opciones de propuesta (empresa aprueba) */
.opts { display: flex; flex-direction: column; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.opt:first-child { border-top: 0; }
.opt-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }

/* Panel de aprobaciones pendientes (dashboard admin) */
.approvals-panel { display: flex; flex-direction: column; gap: 10px; }
.approvals-panel .ap-title { margin: 0 0 4px; font-size: 14px; color: var(--navy); }
.ap-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none;
  color: var(--navy); background: var(--card); transition: transform .12s ease; }
.ap-item:hover { transform: translateY(-1px); }
.ap-label { font-weight: 600; font-size: 14px; }
.ap-count { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; background: #eef3f8; color: var(--muted); }
.ap-item.ap-ok .ap-count { background: #eef3f8; color: var(--muted); }
.ap-item.ap-warn { border-color: #f2d69b; background: #fff9ec; }
.ap-item.ap-warn .ap-count { background: #f0b429; color: #fff; }
.ap-item.ap-alert { border-color: #e5484d; background: #fdecea; color: #b42318; animation: apBlink 1.1s ease-in-out infinite; }
.ap-item.ap-alert .ap-label { color: #b42318; }
.ap-item.ap-alert .ap-count { background: #e5484d; color: #fff; }
@keyframes apBlink { 0%,100% { box-shadow: 0 0 0 0 rgba(229,72,77,.0); background: #fdecea; }
  50% { box-shadow: 0 0 0 4px rgba(229,72,77,.28); background: #fbd7d5; } }
@media (prefers-reduced-motion: reduce) { .ap-item.ap-alert { animation: none; } }

/* Fila de filtros (usuarios) */
.filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-row .input[type="search"] { flex: 1 1 240px; }
.filters-row select.input { flex: 0 0 auto; min-width: 170px; }
@media (max-width: 560px) { .filters-row .input[type="search"], .filters-row select.input { flex: 1 1 100%; } }
.btn { white-space: nowrap; }

/* Paginación */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 1.2rem; }
.pagination .pg { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--navy); font-size: 18px; background: var(--card); }
.pagination .pg:hover { border-color: var(--blue); color: var(--blue); }
.pagination .pg-off { opacity: .4; }
.pagination .pg-info { font-size: 13px; color: var(--muted); }

/* Ajustes: encabezados de sección y filas */
.set-sec { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  font-weight: 700; margin: 1.6rem 0 .6rem; }
.set-sec:first-of-type { margin-top: 1rem; }
.set-sec-danger { color: #b42318; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid.grid-2[style*="stretch"] > .card { height: 100%; }

/* Planificador: guardar ruta */
.planner-save { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.planner-save .input { flex: 1 1 240px; max-width: 340px; }

/* Chat / conversaciones */
.chat-thread { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px; }
.chat-msg { display: flex; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble { max-width: 78%; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--card); }
.chat-msg.mine .chat-bubble { background: #eef3fb; border-color: #d6e2f3; }
.chat-who { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.chat-body { font-size: 14px; color: var(--navy); line-height: 1.45; }
.chat-time { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.chat-send { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.chat-send textarea { flex: 1; resize: vertical; min-height: 44px; }
.chat-closed { text-align: center; padding: 10px; color: var(--muted); font-size: 13px; background: #f4f7f8; border-radius: 10px; margin-top: 12px; }

/* Bandeja de conversaciones */
.conv-list { display: flex; flex-direction: column; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 12px 1.2rem; border-top: 1px solid var(--line); text-decoration: none; color: var(--navy); }
.conv-item:first-child { border-top: 0; }
.conv-item:hover { background: #f7fafb; }
.conv-item.has-unread { background: #eef3fb; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 10px; }
.conv-sub { margin-top: 2px; }
.conv-badge { background: var(--blue); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
/* Ícono de email en el header con parpadeo */
.msg-btn { position: relative; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 38px; height: 38px; display: grid; place-items: center; color: var(--slate); text-decoration: none; }
.msg-btn .ico { width: 20px; height: 20px; }
.msg-btn:hover { border-color: var(--blue); color: var(--blue); }
.msg-btn.blink { animation: msgBlink 1s ease-in-out infinite; }
@keyframes msgBlink { 0%,100% { background: transparent; } 50% { background: #dbe8fb; } }
.msg-dot { position: absolute; top: -4px; right: -4px; background: #e5484d; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .msg-btn.blink { animation: none; } }

/* Campo imagen (formularios personalizados) */
.cf-img-prev { margin-bottom: 8px; }
.cf-img-prev img { max-height: 120px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }

/* Recordatorio de onboarding (panel transportista) */
.nlp-onboard-card { border-left: 3px solid #d9a400; }

/* Proponer en línea (detalle de carga admin) */
.nlp-propose-row > td { background: #f4f8fc; }
.propose-row-inner { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }

/* Modo oscuro (panel) */
:root[data-theme="dark"] {
  --navy: #e6eef1;
  --navy-bg: #0d1b22;
  --navy-700: #14262e;
  --ink: #e6eef1;
  --slate: #b6c5cb;
  --muted: #8ea2aa;
  --line: #24363e;
  --line-2: #1d2f36;
  --bg: #0f1c23;
  --card: #162730;
  --amber-bg: rgba(183, 121, 31, .18);
  --green-bg: rgba(21, 128, 61, .20);
  --red-bg: rgba(229, 72, 77, .18);
}
:root[data-theme="dark"] .badge-gray   { background: #22343c; color: #c4d1d6; }
:root[data-theme="dark"] .badge-blue   { background: rgba(48, 108, 192, .22); color: #8fb8f0; }
:root[data-theme="dark"] .badge-teal   { background: rgba(63, 182, 182, .18); color: #7fd6d6; }
:root[data-theme="dark"] .badge-purple { background: rgba(106, 63, 176, .22); color: #c9b3f0; }
:root[data-theme="dark"] .badge-amber  { color: #f0c26a; }
:root[data-theme="dark"] .badge-green  { color: #7fd29a; }
:root[data-theme="dark"] .badge-red    { color: #ff8a8e; }
:root[data-theme="dark"] .flash.info   { background: rgba(48, 108, 192, .14); border-color: #2c4a63; color: var(--ink); }
:root[data-theme="dark"] .flash.success { border-color: #2f6b45; }
:root[data-theme="dark"] .flash.error  { border-color: #7a3a3d; }
:root[data-theme="dark"] .nlp-maint    { background: rgba(183, 121, 31, .16); border-color: #6b4d1b; color: #f0c26a; }
:root[data-theme="dark"] .ap-item.ap-warn  { background: rgba(183, 121, 31, .14); border-color: #6b4d1b; }
:root[data-theme="dark"] .ap-item.ap-alert { background: rgba(229, 72, 77, .14); border-color: #7a3a3d; }
:root[data-theme="dark"] .ap-item.ap-ok    { background: #1a2a31; border-color: var(--line); }
:root[data-theme="dark"] .conv-item.has-unread, :root[data-theme="dark"] .chat-msg.mine .chat-bubble,
:root[data-theme="dark"] .nlp-propose-row > td, :root[data-theme="dark"] .msg-btn.blink { background: rgba(48, 108, 192, .16); border-color: #2c4a63; }
:root[data-theme="dark"] .chat-bubble, :root[data-theme="dark"] .chat-closed, :root[data-theme="dark"] .note { background: var(--card); }
:root[data-theme="dark"] .note, :root[data-theme="dark"] .card-body .note { background: #1a2a31; }
:root[data-theme="dark"] img.shot, :root[data-theme="dark"] .cf-img-prev img { border-color: var(--line); }
:root[data-theme="dark"] .sidebar .s-item.active { background: rgba(255,255,255,.08); }

/* Botón de tema (sol/luna) */
.theme-btn { position: relative; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 38px; height: 38px; display: grid; place-items: center; color: var(--slate); cursor: pointer; margin-right: 8px; }
.theme-btn .ico { width: 20px; height: 20px; }
.theme-btn:hover { border-color: var(--blue); color: var(--blue); }
.theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: none; }

/* Estados en mayúsculas (toda la app) */
.badge-status { text-transform: uppercase; letter-spacing: .05em; }
.status-legend > span { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.timeline li .st { text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }

/* Accesos directos (Resumen admin) */
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shortcut { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.shortcut:hover { border-color: var(--blue); background: var(--line-2); }
.shortcut .sc-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--line-2); color: var(--blue); }
.shortcut .sc-ico .ico { width: 18px; height: 18px; }
.shortcut .sc-lbl { font-size: 14px; font-weight: 600; }
.shortcut .sc-count { position: absolute; top: 10px; right: 10px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 560px) { .shortcuts { grid-template-columns: repeat(2, 1fr); } }
.nlp-search-card + .admin-filters { margin-top: 0; }
table.data tbody tr[hidden] { display: none; }

/* Usuario al pie del menú lateral */
.sidebar .s-user { display: flex; align-items: center; gap: .65rem; padding: .2rem .15rem .8rem; margin-bottom: .75rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .s-user .avatar { flex: none; }
.sidebar .s-user-txt { min-width: 0; }
.sidebar .s-user .nm { font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .s-user .rl { font-size: 11.5px; color: #9fb6bf; }

/* Foto de perfil */
.avatar-img { object-fit: cover; display: block; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; flex: none; }
.avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-edit .av-side { min-width: 0; flex: 1; }
.avatar-edit .av-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-edit .av-actions form { margin: 0; }
.avatar-edit .av-btn { position: relative; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.avatar-edit .av-btn .ico { width: 16px; height: 16px; }
.avatar-edit .av-hint { margin: .5rem 0 0; }
.avatar-edit .av-loading { display: none; margin: .5rem 0 0; color: var(--blue); font-weight: 600; }
.avatar-edit.is-uploading .av-loading { display: block; }
.avatar-edit.is-uploading .av-actions { opacity: .5; pointer-events: none; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.nlp-pwa .avatar-edit .av-actions { flex-direction: column; width: 100%; }
.nlp-pwa .avatar-edit .av-actions form, .nlp-pwa .avatar-edit .av-btn { width: 100%; justify-content: center; }
.nlp-pwa .avatar-edit .av-side { flex-basis: 100%; }

/* Preferencias de correo */
.email-prefs .ep-row { display: flex; align-items: center; gap: 10px; padding: .45rem 0; cursor: pointer; }
.email-prefs .ep-row input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.email-prefs .ep-master { border-bottom: 1px solid var(--line); padding-bottom: .7rem; margin-bottom: .3rem; }
.email-prefs .ep-cats { padding-left: 4px; }
.email-prefs.ep-off .ep-cats { opacity: .45; }
.verify-banner { border-left: 3px solid #d9a400; }

/* Probar envío de correos */
.mail-diag { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.mail-diag .md-row { display: flex; justify-content: space-between; gap: 12px; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mail-diag .md-row span { color: var(--muted); }
.mail-diag .md-row strong { text-align: right; overflow-wrap: anywhere; }
.mail-diag .md-note { font-size: 12px; margin: .35rem 0 .2rem; padding: .45rem .6rem; border-radius: 8px; }
.mail-diag .md-note.warn { background: var(--amber-bg); color: #8a5a00; }
.mail-diag .md-errors { padding-top: .6rem; font-size: 13px; }
.mail-diag .md-errors > span { color: var(--muted); display: block; margin-bottom: .3rem; }
.mail-diag .md-err { padding: .3rem 0; color: var(--red); overflow-wrap: anywhere; }
.mail-diag .md-ok { color: var(--green); }
:root[data-theme="dark"] .mail-diag .md-note.warn { color: #f0c26a; }

/* Piezas NL (generador del plugin nowloads-social dentro del panel) */
.nlp-pieces .nls-wrap { margin: 0; }
.nlp-pieces .nls-title, .nlp-pieces .nls-sub { display: none; }
.pieces-qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pieces-qr { background: #fff; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.pieces-qr img, .pieces-qr canvas { display: block; }
.pieces-steps { margin: 0; padding-left: 1.2rem; line-height: 1.8; }
.pieces-logo-prev { height: 120px; border-radius: var(--radius); display: grid; place-items: center; padding: 16px; border: 1px solid var(--line); }
.pieces-logo-prev img { max-height: 80px; max-width: 100%; object-fit: contain; }

/* Sin zoom en la app: sin doble toque y campos de 16 px en pantallas táctiles (evita el zoom automático de iPhone) */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { font-size: 16px !important; }
}

/* Crear cuenta (admin) */
.type-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.type-opt { display: inline-flex; align-items: flex-start; gap: 8px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 14px; background: var(--card); }
.type-opt input { margin-top: 3px; accent-color: var(--blue); }
.type-opt:has(input:checked) { border-color: var(--blue); background: var(--line-2); }
.type-opt.block { display: flex; margin-top: .45rem; }
.new-account .only-org, .new-account .only-driver, .new-account .only-manual { display: none; }
.new-account[data-type="company"] .only-org, .new-account[data-type="carrier"] .only-org { display: block; }
.new-account[data-type="driver"] .only-driver { display: block; }
.new-account[data-pass="manual"] .only-manual { display: block; }
.mail-diag .md-from { margin: .5rem 0 .3rem; align-items: center; }
.mail-diag .md-from .input { flex: 1; min-width: 0; }
.direct-assign .only-carrier, .direct-assign .only-driver { display: none; }
.direct-assign[data-target="carrier"] .only-carrier, .direct-assign[data-target="driver"] .only-driver { display: block; }

/* Comisión: porcentaje o monto fijo */
.comm-setting .comm-pct, .comm-setting .comm-fixed, .comm-field .comm-pct, .comm-field .comm-fixed { display: none; align-items: center; gap: 6px; }
.comm-setting[data-type="pct"] .comm-pct, .comm-setting[data-type="fixed"] .comm-fixed { display: inline-flex; }
.comm-field[data-type="pct"] .comm-pct, .comm-field[data-type="fixed"] .comm-fixed { display: inline-flex; }
.comm-field .comm-preview { margin: .4rem 0 0; }

/* Campo de archivo en español (reemplaza «Choose File / No file chosen» del navegador) */
.file-es { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 6px; border: 1px solid var(--line, #d9e2e6); border-radius: 6px; background: var(--card, #fff); position: relative; }
.file-es .file-es-name { font-size: 13px; color: var(--muted, #6b7f88); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-es.has-file .file-es-name { color: var(--ink, #16323d); }
.file-es .file-es-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13.5px; font-weight: 600; color: var(--blue); text-decoration: none; }

/* Botón «Trazado» sobre los mapas de viaje (todos los perfiles) */
.nlp-trail-ctl button { font: inherit; font-size: 12px; font-weight: 600; color: #16323d; background: #fff; border: 1px solid #cdd8dc; border-radius: 4px; padding: 5px 10px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.nlp-trail-ctl button.on { background: #16323d; color: #fff; border-color: #16323d; }

/* ============================================================
   Resumen de inicio (admin, empresa, transportista) · 2.5.8
   Operación antes que tablero: divisores, jerarquía, estados en texto.
   ============================================================ */
.home { display: flex; flex-direction: column; gap: 28px; }
.home-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; }
.home-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.home-title { margin: 6px 0 4px; font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.home-sub { margin: 0; font-size: 16px; color: var(--slate); }
.home-sub strong { font-weight: 600; }
.home-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 600; text-decoration: none; }
.home-cta:hover { background: var(--blue-600); color: #fff; }
.home-cta svg { width: 18px; height: 18px; flex: none; }
.home-search { display: flex; flex-direction: column; gap: 6px; flex: 0 1 380px; min-width: 240px; }
.home-search label { font-size: 12px; font-weight: 600; color: var(--slate); }
.home-search .input { height: 44px; }
.home-cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.home-cols > .home-panel { margin: 0; }
.home-col-3 { flex: 3 1 440px; min-width: 0; }
.home-col-2 { flex: 2 1 340px; min-width: 0; }
.home-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.home-panel-h { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; align-items: baseline; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.home-h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.home-link { font-size: 14px; font-weight: 600; color: var(--blue); text-decoration: none; }
.home-note { font-size: 13px; color: var(--muted); }
.home-empty { padding: 18px 20px; font-size: 14px; color: var(--muted); margin: 0; }
.home-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.home-row:last-child { border-bottom: 0; }
a.home-row:hover { background: var(--bg); }
.home-row-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home-kind { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.home-tt { font-size: 15px; font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.home-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.home-age { font-size: 13px; color: var(--muted); white-space: nowrap; }
.home-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--card); color: var(--navy); white-space: nowrap; }
.home-btn:hover { border-color: var(--blue); color: var(--blue); }
.home-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.home-btn.primary:hover { background: var(--blue-600); color: #fff; }
.home-btn.outline { color: var(--blue); border-color: var(--blue); }
/* Tonos de estado (texto en mayúscula, sin pastillas) */
.t-red { color: #a12a2a; } .t-amber { color: #8a5a0c; } .t-teal { color: #1f6b68; } .t-blue { color: #306cc0; } .t-gray { color: #5a6f79; } .t-navy { color: var(--navy); }
.b-teal { background: #3fb6b6; } .b-amber { background: #e09a2d; } .b-red { background: #a7b4b9; } .b-blue { background: #306cc0; } .b-gray, .b-navy { background: #a7b4b9; }
:root[data-theme="dark"] .t-red { color: #f0a3a3; } :root[data-theme="dark"] .t-amber { color: #f0c27a; } :root[data-theme="dark"] .t-teal { color: #7fd6d6; } :root[data-theme="dark"] .t-blue { color: #8fb8f0; } :root[data-theme="dark"] .t-gray { color: #a9bac0; }
/* Ahora mismo */
.home-now { display: flex; flex-wrap: wrap; }
.home-now a { flex: 1 1 160px; padding: 18px 20px 20px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.home-now a:last-child { border-right: 0; }
.home-now a:hover { background: var(--bg); }
.home-now .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 900; font-size: 44px; line-height: 1; color: var(--navy); }
.home-now .l { font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.home-now .h { font-size: 13px; color: var(--muted); }
/* Avance */
.home-bar { position: relative; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.home-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.home-mv { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.home-mv:last-child { border-bottom: 0; }
.home-mv:hover { background: var(--bg); }
.home-mv-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.home-plate { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .04em; color: var(--navy); }
/* Envío grande (empresa) */
.home-ship { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.home-ship:last-child { border-bottom: 0; }
.home-ship:hover { background: var(--bg); }
.home-ship-main { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.home-ship-route { font-size: 18px; font-weight: 700; color: var(--navy); }
.home-ship-eta { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; }
.home-ship-eta .k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.home-ship-eta .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 900; font-size: 30px; line-height: 1.05; color: var(--navy); }
.home-ship-eta .v.long { font-size: 20px; line-height: 1.2; }
/* Accesos directos en franja */
.home-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
@media (max-width: 760px) { .home-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-shortcuts a { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 15px; font-weight: 600; color: var(--navy); text-decoration: none; }
.home-shortcuts a:hover { background: var(--bg); color: var(--blue); }
.home-shortcuts svg { width: 20px; height: 20px; flex: none; color: var(--slate); }
.home-shortcuts .c { margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: #a12a2a; }
/* Flota */
.home-fleet { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.home-fleet:last-child { border-bottom: 0; }
.home-fleet:hover { background: var(--bg); }
.home-fleet .p { flex: 0 0 96px; }
.home-fleet .d { flex: 1 1 150px; min-width: 0; font-size: 14px; }
.home-fleet .d strong { font-weight: 600; color: var(--navy); }
.home-fleet .r { flex: 1 1 170px; min-width: 0; font-size: 14px; color: var(--slate); }
.home-fleet .s { flex: 0 0 32px; display: flex; justify-content: flex-end; }
/* Registro incompleto */
.home-ob { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding: 16px 20px; color: var(--ink); text-decoration: none; }
.home-ob-steps { flex: 1 1 200px; display: flex; align-items: center; gap: 12px; }
.home-ob-steps .seg { flex: 1; display: flex; gap: 4px; }
.home-ob-steps .seg span { flex: 1; height: 8px; border-radius: 2px; background: var(--line); }
.home-ob-steps .seg .ok { background: #3fb6b6; } .home-ob-steps .seg .rev { background: #e09a2d; }
/* Tabla compacta */
.home-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.home-table th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.home-table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.home-table th:first-child, .home-table td:first-child { padding-left: 20px; }
.home-table tr:last-child td { border-bottom: 0; }
.home-table .st { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.home-strip { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; padding: 14px 20px; }
@media (max-width: 640px) {
  .home-title { font-size: 25px; }
  .home-now .n { font-size: 36px; }
  .home-now a { border-bottom: 1px solid var(--line-2); }
}

/* Enlaces: nunca cortados a la mitad. Dentro de un texto, bajan completos a una línea nueva. */
.home-link, .back-link, a.btn, .btn { white-space: nowrap; }
.home-empty .home-link, .home-note .home-link { display: block; margin-top: 6px; }
.home-panel-h .home-note { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.home-panel-h .home-note .home-link { margin-top: 0; }
@media (max-width: 640px) { .home-panel-h .home-note { align-items: flex-start; text-align: left; } }

/* ============================================================
   Estados como íconos (2.6.0): el color dice el tipo, el texto aparece al tocar.
   ============================================================ */
.st-ic { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; vertical-align: middle; border-radius: 6px; cursor: help; outline-offset: 2px; }
.st-ic svg { width: 22px; height: 22px; }
.st-ic.st-sm { width: 18px; height: 18px; } .st-ic.st-sm svg { width: 16px; height: 16px; }
.st-ic.st-lg { width: 30px; height: 30px; } .st-ic.st-lg svg { width: 28px; height: 28px; }
.st-ic:focus-visible { outline: 2px solid var(--blue); }
.st-gray { color: #5a6f79; } .st-amber { color: #b7791f; } .st-blue { color: #306cc0; } .st-teal { color: #1f8a8a; }
.st-navy { color: #16323d; } .st-green { color: #15803d; } .st-red { color: #b42318; }
:root[data-theme="dark"] .st-gray { color: #a9bac0; } :root[data-theme="dark"] .st-amber { color: #f0c27a; } :root[data-theme="dark"] .st-blue { color: #8fb8f0; }
:root[data-theme="dark"] .st-teal { color: #7fd6d6; } :root[data-theme="dark"] .st-navy { color: #e6eef1; } :root[data-theme="dark"] .st-green { color: #7ed69a; } :root[data-theme="dark"] .st-red { color: #f0a3a3; }
.st-dot { margin-right: 6px; }
.status-legend .st-ic { margin-right: 5px; }
@media (max-width: 640px) { table.data .st-dot { display: none; } }
/* Globo con el nombre del estado */
.st-tip { position: fixed; z-index: 3000; max-width: 240px; padding: 7px 11px; border-radius: 8px; background: #16323d; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.st-tip.show { opacity: 1; transform: translateY(0); }
:root[data-theme="dark"] .st-tip { background: #e6eef1; color: #16323d; }

/* Íconos de fondo en los cuadros de estadística (2.6.1): a la derecha, con transparencia. */
.kpi, .home-now a, .drv-week > div { position: relative; overflow: hidden; }
.kpi > .l, .kpi > .n, .kpi > .sub, .home-now a > span:not(.kpi-bg), .drv-week > div > b, .drv-week > div > span:not(.kpi-bg) { position: relative; z-index: 1; }
.kpi-bg { position: absolute; right: -8px; top: 50%; transform: translateY(-50%); width: 76px; height: 76px; opacity: .13; pointer-events: none; z-index: 0; }
.kpi-bg svg { width: 100%; height: 100%; display: block; }
.kpi-bg.st-navy { color: var(--navy); }
:root[data-theme="dark"] .kpi-bg { opacity: .18; }
.home-now .kpi-bg { width: 92px; height: 92px; right: -6px; }
.drv-week .kpi-bg { width: 52px; height: 52px; right: -8px; }
@media (max-width: 640px) { .kpi-bg { width: 60px; height: 60px; } }

/* Interruptor de notificaciones */
.push-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.push-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--blue); }
.push-row input:disabled { opacity: .6; }

/* ---- Alerta de incidencias (admin) ---- */
#nlp-inc-alert { position: sticky; top: 0; z-index: 900; margin: 0 0 14px; display: grid; gap: 6px; }
.inc-alert-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px;
  background: #b91c1c; color: #fff; animation: incBlink 1s steps(1, end) infinite; }
.inc-alert-k { font: 800 12px/1 var(--mono, ui-monospace, monospace); letter-spacing: .08em; text-transform: uppercase;
  border: 1.5px solid #fff; border-radius: 6px; padding: 5px 7px; }
.inc-alert-t { flex: 1 1 260px; display: grid; gap: 2px; font-size: 14px; line-height: 1.35; }
.inc-alert-t strong { font-size: 15px; }
.inc-alert-b { border: 0; border-radius: 8px; padding: 8px 14px; font: 700 14px/1 inherit; background: #fff; color: #b91c1c; cursor: pointer; text-decoration: none; }
.inc-alert-b.ghost { background: transparent; color: #fff; border: 1.5px solid #fff; }
@keyframes incBlink { 50% { background: #7f1010; } }
.notif-btn.notif-alarm, .app-header .notif-btn.notif-alarm { background: #b91c1c; border-color: #b91c1c; color: #fff; animation: incBell 1s steps(1, end) infinite; }
.notif-btn.notif-alarm .notif-dot { background: #fff; color: #b91c1c; }
@keyframes incBell { 50% { background: #fbeaea; color: #b91c1c; } }
.card.inc-new { border: 2px solid #b91c1c; animation: incCard 1s steps(1, end) infinite; }
@keyframes incCard { 50% { border-color: #f3cccc; } }
.inc-ack-btn { margin-left: 8px; background: #b91c1c; color: #fff; border-color: #b91c1c; }
@media (prefers-reduced-motion: reduce) { .inc-alert-row, .notif-btn.notif-alarm, .card.inc-new { animation-duration: 2s; } }
