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

/* ==========================================================================
   NowLoads — Sistema de diseño
   Marketplace logístico · estética SaaS B2B, editorial, sin "vibe coding".
   Paleta del logotipo: teal-navy #183c48 · azul #306cc0 · turquesa #6ccccc · grises.
   ========================================================================== */

:root {
  /* Paleta derivada del logotipo NowLoads */
  --navy: #16323d;        /* fondo oscuro (teal-navy del wordmark) */
  --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: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 27, 58, .06), 0 8px 24px rgba(11, 27, 58, .06);
  --shadow-sm: 0 1px 2px rgba(11, 27, 58, .08);

  --sans: "Inter", "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --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); }

/* 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); 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: #fff; 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-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: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px); 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: #fff; border: 1px solid var(--line); border-radius: 8px;
  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: #fff; 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); color: #eef6f8; }
.hero::before {
  /* Signature: líneas de ruta tenues */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255,255,255,.05) 100%);
  background-size: 100% 56px;
  pointer-events: 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: #fff; border-radius: 14px; padding: 1.4rem 1.5rem; color: var(--ink);
  box-shadow: 0 24px 60px rgba(5,18,28,.4); border: 1px solid rgba(255,255,255,.6); }
.freight-card.stack { position: relative; z-index: 2; }
.freight-card.behind { position: absolute; top: -34px; right: -10px; width: 74%; z-index: 1; opacity: .55;
  transform: rotate(-3deg); padding: 1rem 1.2rem; box-shadow: 0 16px 36px rgba(5,18,28,.3); }
.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: 6px; }
.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); 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: #fff; }
.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: #fff; 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: 9px; 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); color: #fff; border-radius: 16px; 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: #fff; 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); 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; 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: #fff; 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: 8px;
  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: 8px; 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: 5px; display: grid;
  place-items: center; padding: 0 4px; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 320px; background: #fff; 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: 8px; border-left: 3px solid transparent; }
.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; }
.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: #fff; 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); }
.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: #fff; 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; }

/* ---- 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 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: .8rem 1rem; 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: #fff;
  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; box-shadow: var(--shadow);
  border: 1px solid; display: flex; gap: .6rem; align-items: flex-start; background: #fff; }
.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: #fff; 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: #fff; 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: 6px; }
.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); color: #d4ddf0; border-radius: var(--radius); padding: 1.1rem 1.3rem;
  box-shadow: 0 12px 40px rgba(8,21,46,.4); 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: #fff; 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; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .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-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; }
}

/* 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: 10px; 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: #fff; border: 1px solid var(--line); border-radius: 12px; 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: 8px; 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: #fff; 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: 10px; padding: .8rem .9rem; background: #fff; }
.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: center; justify-content: space-between; gap: .8rem;
  margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.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; }
