/* =========================================================================
   CargoTrack · Design System
   Logistics · Premium navy + cargo-orange · Magazine grid · Tech-forward editorial
   ========================================================================= */

:root {
  /* Color · brand */
  --navy: #0B2545;
  --navy-deep: #06182E;
  --navy-soft: #1E3A5F;
  --orange: #F25F1E;          /* CargoTrans cargo-orange · primary action */
  --orange-deep: #C84610;
  --orange-soft: #FF8552;
  --gold: #F5B82E;            /* highlight · "in transit" · accent */
  --gold-deep: #B8841C;
  --sky: #D8E4F0;             /* infographic blue */
  --teal: #1B7A7F;            /* delivered / success-secondary */

  /* Color · surface */
  --cream: #F7F4ED;           /* page surface */
  --cream-warm: #F0E9D8;      /* alt rows / banners */
  --cream-soft: #EBE3D0;
  --paper: #FFFFFF;
  --ink: #0A0E14;
  --body: #3D4654;
  --muted: #7B8696;
  --rule: #DDD5C2;
  --rule-soft: #E8E1D0;

  /* Color · semantic */
  --green: #2E7D5B;           /* entregado */
  --red: #B5443B;             /* incidencia */
  --info: #2563EB;            /* en sistema */
  --warn: #C77B12;             /* en aduana / retraso */

  /* Type · Geist · Silicon Valley tech-forward · same family used by Vercel, Linear */
  --serif: "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans:  "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "Geist Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --display-soft: normal;
  --display-wonk: normal;

  /* Spacing & radius */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-2xl: 999px;
  --shadow-sm: 0 1px 2px rgba(10, 14, 20, 0.04), 0 0 0 1px rgba(221, 213, 194, 0.5);
  --shadow-md: 0 4px 12px rgba(10, 14, 20, 0.08), 0 0 0 1px rgba(221, 213, 194, 0.4);
  --shadow-lg: 0 16px 48px rgba(10, 14, 20, 0.12), 0 0 0 1px rgba(221, 213, 194, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Editorial fractal-noise overlay (warmth) */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.04, 0 0 0 0 0.10, 0 0 0 0 0.18, 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
  mix-blend-mode: multiply;
}
body.app::before { opacity: 0.22; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- Type primitives ---------- */
.eyebrow {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--orange);
}
.eyebrow.muted { color: var(--muted); }
.eyebrow.gold { color: var(--gold-deep); }
.display      { font-family: var(--serif); font-weight: 600; line-height: 0.98; letter-spacing: -0.045em; }
.display-wonk { font-family: var(--serif); font-weight: 700; line-height: 0.98; letter-spacing: -0.045em; }
.serif        { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; }
em { font-style: italic; font-weight: inherit; }
.num-tab, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }
.wrap-narrow { max-width: 920px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }
.stack > * + * { margin-top: var(--space, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.wrap-md { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 920px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-2xl);
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-primary       { background: var(--navy); color: var(--cream); }
.btn-primary:hover { background: var(--orange); transform: translateY(-1px); }
.btn-orange        { background: var(--orange); color: var(--paper); }
.btn-orange:hover  { background: var(--orange-deep); transform: translateY(-1px); }
.btn-ghost         { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover   { background: var(--cream-warm); border-color: var(--navy); }
.btn-soft          { background: var(--cream-warm); color: var(--ink); }
.btn-soft:hover    { background: var(--sky); }
.btn-navy-out      { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn-navy-out:hover{ background: var(--navy); color: var(--cream); }
.btn-lg { padding: 14px 26px; font-size: 14px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn .arrow { font-family: var(--serif); font-style: italic; font-weight: 400; font-variation-settings: var(--display-wonk); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tags / chips / status pills ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-2xl);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--cream-warm); color: var(--ink);
  border: 1px solid var(--rule-soft);
}
.tag.orange  { background: rgba(242, 95, 30, 0.12); color: var(--orange-deep); border-color: rgba(242, 95, 30, 0.22); }
.tag.navy    { background: rgba(11, 37, 69, 0.08); color: var(--navy); border-color: rgba(11, 37, 69, 0.16); }
.tag.gold    { background: rgba(245, 184, 46, 0.16); color: #6a5210; border-color: rgba(245, 184, 46, 0.30); }
.tag.green   { background: rgba(46, 125, 91, 0.10); color: var(--green); border-color: rgba(46, 125, 91, 0.22); }
.tag.red     { background: rgba(181, 68, 59, 0.10); color: var(--red); border-color: rgba(181, 68, 59, 0.22); }
.tag.sky     { background: rgba(37, 99, 235, 0.08); color: var(--info); border-color: rgba(37, 99, 235, 0.18); }
.tag.warn    { background: rgba(199, 123, 18, 0.10); color: var(--warn); border-color: rgba(199, 123, 18, 0.22); }
.tag.ghost   { background: transparent; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
}
.card.warm  { background: var(--cream-warm); }
.card.cream { background: var(--cream); }
.card.dark  { background: var(--navy); color: var(--cream); border-color: var(--navy-deep); }
.card.dark .muted { color: rgba(247, 244, 237, 0.65); }
.card.dark .card-title { color: var(--cream); }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.card-title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1.1;
  font-variation-settings: var(--display-soft);
}
.card-sub { color: var(--muted); font-size: 13px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule);
  background: var(--cream-warm);
}
.table td {
  padding: 14px; border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.table tr:hover td { background: rgba(240, 233, 216, 0.5); }
.table tr.selected td { background: rgba(242, 95, 30, 0.06); }
.table .name { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--ink); }
.table .name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.table .track-num { font-family: var(--mono); font-size: 12px; color: var(--navy); font-weight: 600; }
.table-compact th, .table-compact td { padding: 8px 12px; }

/* ---------- Avatars / icon-tiles ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 14px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--cream);
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  flex-shrink: 0;
  font-variation-settings: var(--display-wonk);
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; }
.avatar.navy { background: linear-gradient(135deg, var(--navy), var(--navy-deep)); color: var(--cream); }
.avatar.gold { background: linear-gradient(135deg, var(--gold), var(--orange)); color: var(--ink); }
.avatar.cream { background: linear-gradient(135deg, var(--cream-warm), var(--sky)); color: var(--navy); }
.avatar.teal { background: linear-gradient(135deg, var(--teal), var(--navy)); color: var(--cream); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--cream); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Square icon tile (transport-themed) */
.tile-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--cream);
  font-size: 20px; flex-shrink: 0;
}
.tile-icon.orange { background: var(--orange); color: var(--paper); }
.tile-icon.gold   { background: var(--gold); color: var(--ink); }
.tile-icon.cream  { background: var(--cream-warm); color: var(--navy); }
.tile-icon.outline { background: transparent; border: 1px solid var(--rule); color: var(--navy); }

/* ---------- Form ---------- */
.field { display: block; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 95, 30, 0.15);
}
.textarea { font-family: var(--sans); resize: vertical; min-height: 96px; }
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r-2xl);
}
.search input { border: 0; background: none; flex: 1; font-size: 13px; outline: 0; }
.search svg { color: var(--muted); flex-shrink: 0; }

/* Hero track-input · marquee field (used on cliente landing) */
.track-field {
  display: flex; align-items: center; gap: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-2xl);
  padding: 6px 6px 6px 22px;
  box-shadow: var(--shadow-md);
}
.track-field input {
  border: 0; background: none; flex: 1; outline: 0;
  font-family: var(--mono); font-size: 16px; font-weight: 600;
  color: var(--navy); letter-spacing: 0.02em;
  padding: 14px 8px;
}
.track-field input::placeholder { color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }
.track-field button { padding: 14px 26px; font-size: 14px; }

/* ---------- Stats / KPIs ---------- */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
.kpi-num {
  font-family: var(--serif); font-size: 44px; line-height: 1;
  letter-spacing: -0.025em; font-variation-settings: var(--display-soft);
}
.kpi-num em { color: var(--orange); font-size: 32px; vertical-align: super; font-variation-settings: var(--display-wonk); }
.kpi-delta {
  font-size: 12px; color: var(--green); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.kpi-delta.down { color: var(--red); }

/* ---------- Sparklines / charts ---------- */
.spark { width: 100%; height: 48px; display: block; }
.spark path { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { fill: rgba(242, 95, 30, 0.14); stroke: none; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; }
.bar-chart .bar {
  flex: 1; background: linear-gradient(to top, var(--orange), var(--gold));
  border-radius: 3px 3px 0 0; min-height: 4px;
}
.bar-chart .bar.muted { background: var(--rule); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.7, 0, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
.reveal.d5 { transition-delay: 0.40s; }

/* =========================================================================
   ADMIN APP CHROME (sidebar + topbar layout)
   ========================================================================= */

body.app { background: var(--cream); }
.app-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; min-height: 100dvh; position: relative; z-index: 2; }

/* =========================================================================
   MOBILE · sidebar collapses to slide-in drawer triggered by hamburger
   ========================================================================= */
.mobile-menu-btn {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  color: var(--navy);
  transition: background 0.15s, border-color 0.15s;
}
.mobile-menu-btn:hover { background: var(--cream-warm); border-color: var(--navy); }
.mobile-menu-btn svg { width: 22px; height: 22px; }
.sidebar-scrim {
  position: fixed; inset: 0;
  background: rgba(10, 14, 20, 0.42);
  z-index: 99;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease-out;
  /* No backdrop-filter · the blur was rasterizing the page behind the
     scrim and visually softening the entire viewport when the drawer
     was open. Use a light solid scrim instead for separation. */
}
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

@media (max-width: 960px) {
  /* Drop the .app-shell stacking context (z-index:2) on mobile so the
     sidebar's z-index:100 actually beats the scrim's z-index:99. Without
     this, the scrim covers the sidebar and steals every tap, blocking
     menu navigation. */
  body.app .app-shell {
    grid-template-columns: 1fr;
    z-index: auto;
  }

  /* Sidebar becomes a slide-in drawer.
     Uses `left` for animation (NOT transform) so the element stays out of the
     GPU compositor at rest — preserving subpixel anti-aliasing on text.
     `body.app` prefix raises specificity above the desktop .sidebar
     { position: sticky } rule which comes later in source. */
  body.app .sidebar {
    display: flex;
    position: fixed;
    top: 0; bottom: 0;
    left: -100%;
    width: min(280px, 86vw);
    height: 100vh; height: 100dvh;
    z-index: 100;
    transform: none;
    transition: left 0.28s cubic-bezier(0.2, 0, 0, 1);
    overflow-y: auto;
    /* Safe-area for notch / Dynamic Island */
    padding-top: max(22px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    /* Isolate from body::before mix-blend-mode */
    isolation: isolate;
  }
  body.app .sidebar.open {
    left: 0;
    /* No blurred shadow · large blur radius promotes element to GPU compositor
       layer and forces grayscale AA on text. Use a hard 1px border instead. */
    border-right: 1px solid var(--navy-deep);
  }
  /* Disable body::before fractal-noise overlay on mobile · was bleeding into
     the sidebar via mix-blend-mode and softening text. */
  body::before, body.app::before { display: none !important; }
  /* Crisp text inside sidebar: explicit subpixel AA + opaque colors */
  body.app .sidebar,
  body.app .sidebar * {
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
  }
  body.app .sidebar .nav-item       { color: #DDE3EA; }
  body.app .sidebar .nav-item:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); }
  body.app .sidebar .nav-item.active { color: #FFFFFF; }
  body.app .sidebar .nav-group-label { color: #8FA0B5; }
  body.app .sidebar .sidebar-footer .role { color: #8FA0B5; }
  body.app .sidebar .nav-item .nav-icon { opacity: 1; }

  .mobile-menu-btn { display: inline-flex; }

  /* Topbar tightens up on mobile */
  .app-topbar {
    padding: 12px 16px;
    gap: 10px;
  }
  .app-topbar h1 { font-size: 17px; }
  .app-topbar .crumb { font-size: 11px; }
  .app-topbar .search { display: none; }
  .app-topbar .icon-btn { width: 40px; height: 40px; }

  /* Content gets phone-friendly padding + safe-area */
  .app-content {
    padding: 18px 16px;
    padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
  }

  /* Section heads stack on mobile */
  .section-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .section-head h2 { font-size: 26px; }
  .section-head .lede { font-size: 13px; }
  .section-head .tabs { width: 100%; justify-content: stretch; overflow-x: auto; }

  /* Tables · horizontal scroll fallback */
  .card > .table,
  .card > div > .table,
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }
  .module-table, .compare-table, .matrix-table { min-width: 580px; }

  /* Banner and grids stack */
  .banner { flex-wrap: wrap; }
  .banner > * { flex-basis: auto; }
  .banner button.btn { width: 100%; margin-left: 0 !important; margin-top: 8px; }

  /* Hero cards reduce padding */
  .hero-price, .scope-hero, .rm-hero { padding: 24px 20px; }
  .hero-price h2, .scope-hero h2, .rm-hero h2 { font-size: 38px; }
  .hero-price .meta-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-price .meta-grid > div { padding: 12px; }
  .hero-price .meta-grid .v { font-size: 17px; }

  /* Floating widgets · keep clear of mobile chrome */
  .fab-stack {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .fab-btn { width: 54px; height: 54px; font-size: 24px; }
  .ai-panel, .wa-panel {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
  }
  .ai-panel { height: min(70vh, 540px); height: min(70dvh, 540px); }

  /* Sidebar credit & avatars get a touch more breathing room */
  .sidebar-credit { margin-top: 16px; padding: 14px; }
  .sidebar-credit::after { font-size: 11px; }

  /* Proposal ribbon stacks */
  .proposal-ribbon { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .proposal-ribbon .left { flex-direction: column; align-items: flex-start; gap: 6px; }
  .proposal-ribbon::after { text-align: left; font-size: 10px; }

  /* KPI/grid layouts fall to single column on small phones */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi-row, .kpi-grid, .kpis { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .meta-row { flex-direction: column; align-items: flex-start; gap: 14px; }

  /* Notificaciones flow diagram · stack vertically with arrows rotated 90deg */
  .trig-flow { grid-template-columns: 1fr !important; padding: 16px !important; }
  .trig-flow .trig-arrow { transform: rotate(90deg); }

  /* Hide stat-pill chips in topbar on mobile (e.g. "Hoy 2,148 enviadas") */
  .app-topbar .stat-pill { display: none; }

  /* Forms · prevent iOS auto-zoom on focus by ensuring 16px+ font */
  .input, .select, .textarea { font-size: 16px; padding: 12px 14px; min-height: 44px; }
  .field label { font-size: 11px; }
}

@media (max-width: 540px) {
  .app-content { padding: 14px 12px; }
  .section-head h2 { font-size: 22px; }
  .hero-price h2, .scope-hero h2, .rm-hero h2 { font-size: 30px; line-height: 1.05; }
  .card { padding: 18px; }
  .kpi-row, .kpi-grid, .kpis { grid-template-columns: 1fr !important; }
  .hero-price .meta-grid { grid-template-columns: 1fr 1fr; }
  .btn { padding: 10px 16px; }
  .btn-lg { padding: 14px 22px; }
  /* Make all primary CTAs full width on smallest screens */
  .final-cta a.btn,
  .final-cta .btn-primary,
  .rm-cta a.btn,
  .rm-cta .btn-primary {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    margin: 6px 0 !important;
    text-align: center;
    justify-content: center;
  }

  /* Cost / tier / milestone / outcome / handoff grids fully collapse */
  .cost-grid, .tier-grid, .milestones, .outcome-grid,
  .ai-kpis, .handoff-grid, .deliv-grid, .pillars,
  .ai-funnel, .pay-grid, .svc-grid, .pkg-grid,
  .row-2, .row-3 { grid-template-columns: 1fr !important; }

  /* AWS stack chips · compact 2-col on tiny screens */
  .stack-row { grid-template-columns: repeat(2, 1fr) !important; }

  /* Schedule + matrix tables · keep horizontal scroll affordance */
  .schedule-grid, .matrix-table { font-size: 10px; }

  /* Tracking page · header row stacks, map shorter */
  .header-row { grid-template-columns: 1fr !important; gap: 12px !important; }
  .header-row > .row { width: 100%; }
  .grid-track { grid-template-columns: 1fr !important; }
  .grid-quote { grid-template-columns: 1fr !important; }

  /* Maps · don't overflow viewport on phones */
  .map-big { height: 320px !important; }
  .nation-map, .map-section, .coverage-map { height: 300px !important; }
  .mini-route, .active-mini-route { min-height: 140px !important; }

  /* Cotizar stepper · horizontal scroll on phones */
  .stepper { overflow-x: auto; padding-bottom: 6px; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .stepper .stp { flex-shrink: 0; }
  .stp .bar { width: 24px !important; margin: 0 6px !important; }
  .stp .lbl { font-size: 11px !important; }

  /* Customer dashboard · active envio card stacks */
  .active { grid-template-columns: 1fr !important; }
  .grid-cust { grid-template-columns: 1fr !important; gap: 18px !important; }
  .crm-grid, .flota-grid, .notif-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .det-grid, .ai-grid, .dash-grid { grid-template-columns: 1fr !important; }
  .filter-strip { grid-template-columns: 1fr !important; }

  /* Cliente landing · everything collapses cleanly */
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 18px !important; }
  .stats-grid .stat .num { font-size: 56px !important; }
  .stats-grid .stat .num em { font-size: 36px !important; }
  .steps, .feats-grid, .speakers-grid, .includes-grid,
  .sponsors-grid, .testimonials-grid, .ai-show-grid,
  .app-show-grid, .ai-stats-grid { grid-template-columns: 1fr !important; }
  .ai-stats-grid > div { padding: 14px 0; border-bottom: 1px solid rgba(247,244,237,0.08); }

  /* Hero headline keeps fitting */
  .hero-headline { font-size: clamp(40px, 12vw, 64px) !important; }
  .hero-headline .indent { padding-left: 0 !important; }

  /* Track input field stacks button below */
  .track-field { flex-direction: column; padding: 10px; gap: 8px; border-radius: 18px; }
  .track-field input { width: 100%; padding: 12px 14px; font-size: 16px; }
  .track-field button { width: 100%; }
  .hero-track-help { flex-direction: column; gap: 8px; }
  .hero-track-help .dot-sep { display: none; }

  /* Phone preview · don't shrink, just center */
  .phone { width: 240px; height: 480px; }

  /* Sponsors grid · 2-col on tiny screens */
  section.stripe.sponsors .sponsors-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Footer · stack everything */
  footer.site-footer .footer-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  footer.site-footer .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Mid-range mobile (740-960px) · tighten admin chrome a bit */
@media (max-width: 740px) {
  .app-topbar { gap: 8px; }
  .app-topbar h1 { font-size: 16px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-topbar .crumb { font-size: 10px; }
  .app-topbar .tag { display: none; }
  /* Hide all action buttons on phone topbar · CTAs exist in page body and floating widgets */
  .app-topbar .btn,
  .app-topbar a.btn { display: none !important; }
  /* Keep notification bell + avatar but tighten */
  .app-topbar .icon-btn { width: 36px; height: 36px; }
  .app-topbar .avatar { flex-shrink: 0; }
  .nav-cta { padding: 10px 14px; font-size: 12px; white-space: nowrap; }
}

.sidebar {
  background: var(--navy);
  color: var(--cream);
  padding: 22px 18px 28px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--navy-deep);
}
.sidebar .brand {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 8px 22px;
  border-bottom: 1px solid rgba(247, 244, 237, 0.10);
  margin-bottom: 18px;
}
.sidebar .brand-mark {
  font-family: var(--serif); font-size: 24px; font-weight: 500;
  color: var(--cream); letter-spacing: -0.02em;
}
.sidebar .brand-mark em { color: var(--orange); font-variation-settings: var(--display-wonk); }
.sidebar .brand-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); transform: translateY(-3px); }
.sidebar .brand small { font-size: 10px; letter-spacing: 0.18em; color: rgba(247, 244, 237, 0.55); text-transform: uppercase; margin-left: 4px; }

.nav-group { margin-bottom: 18px; }
.nav-group-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(247, 244, 237, 0.45);
  padding: 0 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: rgba(247, 244, 237, 0.80);
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(247, 244, 237, 0.06); color: var(--cream); }
.nav-item.active { background: var(--orange); color: var(--paper); }
.nav-item.active .nav-icon { color: var(--paper); }
.nav-item .nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10px; padding: 2px 7px;
  background: rgba(247, 244, 237, 0.12); border-radius: var(--r-2xl);
}
.nav-item.active .nav-badge { background: rgba(0, 0, 0, 0.22); color: var(--cream); }

.sidebar-footer {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid rgba(247, 244, 237, 0.10);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-footer .name { font-size: 13px; color: var(--cream); font-weight: 500; }
.sidebar-footer .role { font-size: 11px; color: rgba(247, 244, 237, 0.55); }

/* Main content */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 32px;
  background: rgba(247, 244, 237, 0.85);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.app-topbar h1 {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1;
  font-variation-settings: var(--display-soft);
}
.app-topbar .crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.app-topbar .crumb a:hover { color: var(--orange); }
.app-topbar .icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); background: var(--paper); color: var(--body);
  transition: background 0.15s, border-color 0.15s;
}
.app-topbar .icon-btn:hover { background: var(--cream-warm); border-color: var(--navy); }

.app-content { padding: 32px; flex: 1; }
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 24px; margin-bottom: 24px;
}
.section-head h2 {
  font-family: var(--serif); font-size: 32px; font-weight: 400;
  letter-spacing: -0.025em; line-height: 1.05;
  font-variation-settings: var(--display-soft);
}
.section-head .lede { color: var(--muted); font-size: 14px; max-width: 520px; }

/* ---------- Banner / inline alert ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px; border-radius: var(--r-md);
  background: var(--cream-warm); border: 1px solid var(--rule);
  font-size: 13px;
}
.banner.orange { background: rgba(242, 95, 30, 0.07); border-color: rgba(242, 95, 30, 0.22); }
.banner.gold   { background: rgba(245, 184, 46, 0.10); border-color: rgba(245, 184, 46, 0.28); }
.banner.navy   { background: rgba(11, 37, 69, 0.05); border-color: rgba(11, 37, 69, 0.18); }
.banner-icon {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--paper); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.banner strong { display: block; font-weight: 700; color: var(--ink); margin-bottom: 2px; font-size: 13px; }
.banner span { color: var(--body); }

/* ---------- Pill nav / tabs ---------- */
.tabs {
  display: inline-flex; padding: 4px;
  background: var(--cream-warm); border-radius: var(--r-2xl);
  border: 1px solid var(--rule);
}
.tabs a {
  padding: 7px 16px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--body); border-radius: var(--r-2xl);
  transition: background 0.15s, color 0.15s;
}
.tabs a.active { background: var(--navy); color: var(--cream); }
.tabs a:hover:not(.active) { color: var(--ink); }

/* ---------- Drawer / aside panel ---------- */
.drawer {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 24px;
}
.drawer-head {
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

/* ---------- Status timeline (tracking) ---------- */
.tline { position: relative; padding-left: 24px; }
.tline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--rule);
}
.tline .stop {
  position: relative; padding: 8px 0 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
}
.tline .stop::before {
  content: ""; position: absolute; left: -19px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--rule);
}
.tline .stop.done::before { background: var(--green); border-color: var(--green); }
.tline .stop.now::before  { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px rgba(242, 95, 30, 0.20); }
.tline .stop.warn::before { background: var(--gold); border-color: var(--gold); }
.tline .stop .when { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.tline .stop .what { font-size: 14px; color: var(--ink); font-weight: 600; }
.tline .stop .where { font-size: 13px; color: var(--body); margin-top: 2px; }
.tline .stop.now .what { color: var(--orange-deep); }

/* ---------- Map placeholder (route SVG) ---------- */
.map {
  position: relative;
  width: 100%; min-height: 320px;
  border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, rgba(216, 228, 240, 0.7), transparent 60%),
    radial-gradient(circle at 75% 70%, rgba(245, 184, 46, 0.18), transparent 55%),
    linear-gradient(135deg, #e3ecf5 0%, #cdd9e7 100%);
  border: 1px solid var(--rule);
}
.map .road {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg, transparent 48%, rgba(11, 37, 69, 0.15) 49%, rgba(11, 37, 69, 0.15) 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(11, 37, 69, 0.10) 49%, rgba(11, 37, 69, 0.10) 51%, transparent 52%);
  background-size: 80px 80px, 60px 60px;
  opacity: 0.7;
}
.map .pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  font-size: 11px; font-weight: 700; color: var(--navy);
}
.map .pin .dot {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0;
  background: var(--orange); border: 3px solid var(--paper);
  transform: rotate(-45deg);
  box-shadow: 0 6px 16px rgba(10, 14, 20, 0.25);
}
.map .pin.origin .dot { background: var(--navy); }
.map .pin.dest .dot { background: var(--green); }
.map .pin .lbl { background: var(--paper); padding: 3px 8px; border-radius: var(--r-2xl); margin-top: 6px; box-shadow: var(--shadow-sm); white-space: nowrap; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.map .route-line {
  position: absolute; top: 50%; left: 12%; right: 12%;
  height: 3px; transform: translateY(-50%);
  background: repeating-linear-gradient(to right, var(--orange) 0 8px, transparent 8px 14px);
}

/* Misc utilities */
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.center { text-align: center; }
.right { text-align: right; }
.hidden-sm { display: initial; }
@media (max-width: 640px) { .hidden-sm { display: none; } }
.hr { height: 1px; background: var(--rule); border: 0; margin: 18px 0; }
.dot-sep { display: inline-block; width: 3px; height: 3px; background: currentColor; border-radius: 50%; opacity: 0.5; margin: 0 8px; vertical-align: middle; }
.checklist { list-style: none; }
.checklist li { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--body); }
.checklist li::before {
  content: "→"; font-family: var(--serif); font-style: italic; color: var(--orange); flex-shrink: 0;
  font-variation-settings: var(--display-wonk);
}

/* WhatsApp / chat bubble (notifications panel) */
.chat-bubble {
  padding: 10px 14px; border-radius: 14px;
  background: var(--cream-warm); max-width: 78%;
  font-size: 13px; line-height: 1.45;
  position: relative;
}
.chat-bubble.out {
  background: rgba(46, 125, 91, 0.20); margin-left: auto;
  border-bottom-right-radius: 4px;
}
.chat-bubble.in { border-bottom-left-radius: 4px; background: var(--paper); border: 1px solid var(--rule); }
.chat-bubble small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }

/* =========================================================================
   LEAFLET · custom marker + tile filter for CargoTrack brand fit
   ========================================================================= */

.leaflet-host {
  width: 100%; height: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #e3ecf5;
  position: relative; z-index: 0;
}
.leaflet-container { background: #dde6f0 !important; font-family: var(--sans) !important; outline: 0; }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(255,255,255,0.85) !important; }
.leaflet-bar a { background: var(--paper) !important; color: var(--navy) !important; border-color: var(--rule) !important; font-weight: 700 !important; }
.leaflet-bar a:hover { background: var(--cream-warm) !important; }

/* Brand-tinted CARTO Positron tiles via CSS filter (light, neutral, modern) */
.tile-tinted .leaflet-tile { filter: saturate(0.85) brightness(1.02) contrast(0.96); }

/* Custom DivIcon · origin / dest / waypoint */
.pin-leaf {
  position: relative;
  pointer-events: auto;
}
.pin-leaf .pin-dot {
  width: 22px; height: 22px;
  border-radius: 50% 50% 50% 0;
  background: var(--orange);
  border: 3px solid var(--paper);
  transform: rotate(-45deg);
  box-shadow: 0 6px 14px rgba(10, 14, 20, 0.30);
  position: absolute; left: 0; top: 0;
}
.pin-leaf.origin .pin-dot { background: var(--navy); }
.pin-leaf.dest   .pin-dot { background: var(--green); }
.pin-leaf.alert  .pin-dot { background: var(--red); }
.pin-leaf .pin-lbl {
  position: absolute; left: 28px; top: -2px;
  background: var(--paper);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* =========================================================================
   "Beating-heart" GPS marker · radar pulse · stacked CSS rings
   IMPORTANT: parent .truck-leaf element MUST NOT animate transform — Leaflet
   uses translate3d() on this element to position it, so any transform here
   would clobber the geographic position. Beating animation lives on inner
   .heart child; radar rings live on ::before/::after (independent transforms).
   ========================================================================= */
.truck-leaf {
  width: 46px; height: 46px;
  position: relative;
  z-index: 2;
  /* deliberately no transform / no animation — Leaflet owns transform here */
}
/* Inner element does the heartbeat scale */
.truck-leaf .heart {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--orange);
  box-shadow: 0 6px 18px rgba(242, 95, 30, 0.40), inset 0 0 0 3px rgba(255, 255, 255, 0.95);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  animation: truckHeart 1.4s ease-out infinite;
  transform-origin: center center;
}
/* Expanding radar rings · pseudo-elements on parent · independent transforms */
.truck-leaf::before,
.truck-leaf::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  opacity: 0.7;
  z-index: -1;
  animation: radarRing 2.2s ease-out infinite;
  pointer-events: none;
  transform-origin: center center;
}
.truck-leaf::after { animation-delay: 1.1s; }

.truck-leaf.idle .heart {
  background: var(--paper);
  border-color: var(--navy);
  box-shadow: 0 4px 12px rgba(11, 37, 69, 0.25);
  animation: none;
}
.truck-leaf.idle::before, .truck-leaf.idle::after { display: none; }

.truck-leaf.alert .heart {
  border-color: var(--red);
  animation: truckHeartRed 0.9s ease-out infinite;
}
.truck-leaf.alert::before, .truck-leaf.alert::after {
  border-color: var(--red);
  animation: radarRingRed 1.4s ease-out infinite;
}
.truck-leaf.alert::after { animation-delay: 0.7s; }

@keyframes truckHeart {
  0%, 100% { transform: scale(1); }
  20%      { transform: scale(1.10); }
  40%      { transform: scale(0.97); }
  60%      { transform: scale(1.04); }
}
@keyframes truckHeartRed {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}
@keyframes radarRing {
  0%   { transform: scale(0.6);  opacity: 0.85; border-width: 3px; }
  70%  { transform: scale(2.2);  opacity: 0.20; border-width: 1px; }
  100% { transform: scale(2.8);  opacity: 0;    border-width: 0px; }
}
@keyframes radarRingRed {
  0%   { transform: scale(0.7);  opacity: 0.85; border-width: 3px; }
  100% { transform: scale(2.6);  opacity: 0;    border-width: 0px; }
}

/* GPS coordinate readout · floats next to truck for flavor */
.gps-readout {
  position: absolute;
  left: 56px; top: -2px;
  background: var(--ink);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.gps-readout::before {
  content: "";
  position: absolute; left: -4px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px; height: 8px; background: var(--ink);
}
.gps-readout .live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 6px;
  animation: liveDot 1s ease-out infinite;
  vertical-align: 1px;
}
@keyframes liveDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 184, 46, 0.6); }
  50%      { opacity: 0.4; box-shadow: 0 0 0 6px rgba(245, 184, 46, 0); }
}

/* Smaller truck for fleet / multi-truck views · same anti-clobber pattern */
.truck-leaf.sm {
  width: 28px; height: 28px;
  /* parent has no animation/transform — owned by Leaflet */
}
.truck-leaf.sm .heart {
  font-size: 13px;
  border-width: 2px;
  box-shadow: 0 2px 8px rgba(242, 95, 30, 0.30);
  animation: truckHeartSm 1.6s ease-out infinite;
}
.truck-leaf.sm::before { animation: radarRingSm 2.4s ease-out infinite; inset: -2px; }
.truck-leaf.sm::after  { display: none; }
.truck-leaf.sm.idle .heart { box-shadow: 0 2px 6px rgba(11, 37, 69, 0.20); animation: none; border-color: var(--navy); }
.truck-leaf.sm.idle::before, .truck-leaf.sm.idle::after { display: none; }
.truck-leaf.sm.alert .heart { animation: truckHeartRedSm 1.0s ease-out infinite; border-color: var(--red); }
.truck-leaf.sm.alert::before { border-color: var(--red); animation: radarRingSmRed 1.5s ease-out infinite; display: block; }
@keyframes truckHeartSm    { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes truckHeartRedSm { 0%,100% { transform: scale(1); } 50% { transform: scale(1.10); } }
@keyframes radarRingSm     { 0% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes radarRingSmRed  { 0% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(2.0); opacity: 0; } }

/* City marker · clean dot + offset tooltip label (no overlap) */
.city-dot-leaf {
  width: 12px; height: 12px;
  background: var(--navy);
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(10, 14, 20, 0.25);
}
.city-dot-leaf.hq {
  width: 18px; height: 18px;
  background: var(--orange);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 4px rgba(242, 95, 30, 0.20), 0 3px 8px rgba(10, 14, 20, 0.30);
  animation: hqPulse 2s ease-out infinite;
}
@keyframes hqPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(242, 95, 30, 0.20), 0 3px 8px rgba(10, 14, 20, 0.30); }
  50%     { box-shadow: 0 0 0 8px rgba(242, 95, 30, 0.10), 0 3px 8px rgba(10, 14, 20, 0.30); }
}
/* Override default Leaflet tooltip to match brand */
.leaflet-tooltip.city-label-tooltip {
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.leaflet-tooltip.city-label-tooltip.hq {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy-deep);
}
.leaflet-tooltip.city-label-tooltip::before { display: none !important; }
.leaflet-tooltip-pane .city-label-tooltip { box-shadow: var(--shadow-sm); }

/* Phone-frame (for mobile PWA preview) */
.phone {
  width: 280px; height: 560px;
  background: var(--ink); border-radius: 32px;
  padding: 14px 10px;
  box-shadow: var(--shadow-lg), 0 0 0 8px rgba(10, 14, 20, 0.04);
  position: relative;
}
.phone::before {
  content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 78px; height: 22px; background: var(--ink); border-radius: var(--r-2xl);
  box-shadow: 0 0 0 1px rgba(247, 244, 237, 0.05);
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 22px;
  background: var(--cream); overflow: hidden;
  position: relative;
}

/* =========================================================================
   GEOLINK CREDIT · attribution badge · "Desarrollado por Geolink"
   ========================================================================= */
.geolink-credit {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--ink); color: var(--cream);
  border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  border: 1px solid rgba(247, 244, 237, 0.10);
}
.geolink-credit:hover { background: var(--navy); transform: translateY(-1px); }
.geolink-credit .ping {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(242, 95, 30, 0.6);
  animation: liveDot 1.8s ease-out infinite;
}
.geolink-credit strong { color: var(--gold); font-weight: 600; }
.geolink-credit .arrow { font-family: var(--serif); font-style: italic; color: var(--orange); }

/* Sidebar footer · Geolink credit · pinned bottom of admin sidebar */
.sidebar-credit {
  margin-top: 14px;
  padding: 12px;
  background: rgba(247, 244, 237, 0.04);
  border: 1px solid rgba(247, 244, 237, 0.08);
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background 0.15s;
}
.sidebar-credit:hover { background: rgba(247, 244, 237, 0.08); }
.sidebar-credit .lbl {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(247, 244, 237, 0.45);
  margin-bottom: 4px;
}
.sidebar-credit .nm {
  font-family: var(--serif); font-size: 14px; font-weight: 600;
  color: var(--cream); letter-spacing: -0.02em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sidebar-credit .nm .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--orange);
}
.sidebar-credit .url {
  font-family: var(--mono); font-size: 10px;
  color: var(--gold);
  margin-top: 2px;
}
.sidebar-credit::after {
  content: "octavio@geolink.dev\A +505 8994-2459";
  display: block;
  white-space: pre;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(247, 244, 237, 0.10);
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(247, 244, 237, 0.65);
  letter-spacing: 0.02em;
  line-height: 1.6;
}

/* Page-top credit ribbon · used on proposal pages above the hero */
.proposal-ribbon {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 12px;
}
.proposal-ribbon .left { display: inline-flex; align-items: center; gap: 10px; letter-spacing: 0.04em; }
.proposal-ribbon .left .pin {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  background: rgba(245, 184, 46, 0.18);
  color: var(--gold);
  border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.proposal-ribbon a {
  color: var(--orange); text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.proposal-ribbon a:hover { color: var(--gold); }
.proposal-ribbon::after {
  content: "📧 octavio@geolink.dev   📞 +505 8994-2459";
  flex-basis: 100%;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(247, 244, 237, 0.10);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(247, 244, 237, 0.65);
  letter-spacing: 0.02em;
  text-align: right;
}

/* =========================================================================
   AI CHAT WIDGET · CargoBot · floating bottom-right · WhatsApp neighbor
   ========================================================================= */
.fab-stack {
  position: fixed; right: 22px; bottom: 22px;
  display: flex; flex-direction: column; gap: 12px;
  z-index: 1000; align-items: flex-end;
}
.fab-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(10, 14, 20, 0.25), 0 4px 8px rgba(10, 14, 20, 0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  border: 0; padding: 0;
  font-size: 28px;
  color: var(--paper);
}
.fab-btn:hover { transform: translateY(-2px) scale(1.05); }
.fab-btn.wa { background: linear-gradient(135deg, #25D366, #1DA851); }
.fab-btn.ai { background: linear-gradient(135deg, var(--navy), var(--orange-deep)); position: relative; overflow: hidden; }
.fab-btn.ai::before {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--orange), var(--gold), var(--orange));
  z-index: -1;
  animation: aiSpin 4s linear infinite;
  opacity: 0.85;
}
.fab-btn.ai::after {
  content: "";
  position: absolute; inset: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
}
.fab-btn.ai .ai-glyph {
  position: relative; z-index: 1;
  font-family: var(--serif);
  font-weight: 700;
  font-style: italic;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: -0.04em;
}
@keyframes aiSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.fab-btn .pip {
  position: absolute; top: -2px; right: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); color: white;
  border: 2px solid var(--cream);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
}
.fab-tooltip {
  position: absolute; right: 72px; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--cream);
  padding: 8px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.fab-tooltip::after {
  content: ""; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px; background: var(--ink);
}
.fab-btn:hover .fab-tooltip { opacity: 1; transform: translateY(-50%) translateX(-4px); }

/* AI chat panel (expanded) */
.ai-panel {
  position: fixed; right: 22px; bottom: 100px;
  width: 380px; max-width: calc(100vw - 44px);
  height: 540px; max-height: calc(100vh - 140px);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(10, 14, 20, 0.30), 0 8px 16px rgba(10, 14, 20, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  animation: aiPanelIn 0.25s ease-out;
}
.ai-panel.open { display: flex; }
@keyframes aiPanelIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-panel-head {
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: var(--cream);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
  position: relative; overflow: hidden;
}
.ai-panel-head::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 95, 30, 0.40), transparent 70%);
  pointer-events: none;
}
.ai-panel-head .avatar { background: linear-gradient(135deg, var(--orange), var(--gold)); color: var(--ink); font-weight: 700; font-style: italic; }
.ai-panel-head .ai-name { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.ai-panel-head .ai-name em { color: var(--gold); }
.ai-panel-head .ai-status { font-size: 11px; color: rgba(247, 244, 237, 0.7); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.ai-panel-head .ai-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: liveDot 1.6s infinite; }
.ai-panel-head .close-btn {
  margin-left: auto; background: rgba(247,244,237,0.12); color: var(--cream);
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: background 0.15s;
}
.ai-panel-head .close-btn:hover { background: rgba(247,244,237,0.22); }

.ai-panel-body {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 60%);
}
.ai-msg {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
}
.ai-msg.bot {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--ink);
}
.ai-msg.user {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: var(--cream);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.ai-msg .ai-time { font-size: 10px; color: var(--muted); display: block; margin-top: 4px; }
.ai-msg.user .ai-time { color: rgba(247,244,237,0.6); }
.ai-msg strong { font-weight: 600; }
.ai-msg .quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-msg .quick-replies button {
  padding: 6px 12px;
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
}
.ai-msg .quick-replies button:hover { background: var(--orange); color: white; border-color: var(--orange); }
.ai-msg .ai-card {
  margin-top: 10px;
  padding: 10px;
  background: var(--cream-warm);
  border-radius: 10px;
  border: 1px solid var(--rule);
}
.ai-msg .ai-card .nm { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--orange-deep); }
.ai-msg .ai-card .vl { font-size: 13px; color: var(--ink); margin-top: 4px; font-weight: 500; }
.ai-typing {
  display: inline-flex; gap: 4px; padding: 8px 14px;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 16px; border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: aiTyping 1.4s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.ai-panel-foot {
  border-top: 1px solid var(--rule);
  padding: 12px 14px;
  background: var(--paper);
}
.ai-panel-foot .ai-input {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 8px 8px 14px;
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-panel-foot .ai-input:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 95, 30, 0.12);
}
.ai-panel-foot input {
  flex: 1; border: 0; background: none; outline: 0;
  font-size: 13px; color: var(--ink);
  font-family: var(--sans);
}
.ai-panel-foot .send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: white; border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
  font-size: 14px; font-weight: 700;
}
.ai-panel-foot .send-btn:hover { background: var(--orange-deep); transform: rotate(-15deg); }
.ai-panel-foot .powered {
  font-size: 10px; color: var(--muted); text-align: center;
  margin-top: 8px; letter-spacing: 0.04em;
}
.ai-panel-foot .powered em { color: var(--orange); font-weight: 600; }

/* WhatsApp panel · subscribe to channel */
.wa-panel {
  position: fixed; right: 22px; bottom: 100px;
  width: 360px; max-width: calc(100vw - 44px);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(10, 14, 20, 0.30);
  display: none;
  z-index: 999;
  overflow: hidden;
  animation: aiPanelIn 0.25s ease-out;
}
.wa-panel.open { display: block; }
.wa-panel .wa-head {
  background: linear-gradient(135deg, #075E54, #128C7E);
  color: white;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
}
.wa-panel .wa-head .avatar { background: white; color: #075E54; font-weight: 700; }
.wa-panel .wa-head h4 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.wa-panel .wa-head .sub { font-size: 11px; color: rgba(255,255,255,0.8); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.wa-panel .wa-head .sub .live { width: 7px; height: 7px; border-radius: 50%; background: #25D366; }
.wa-panel .wa-head .x-btn { margin-left: auto; background: rgba(255,255,255,0.18); color: white; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; font-size: 16px; }
.wa-panel .wa-body { padding: 20px; }
.wa-panel .wa-body h5 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.wa-panel .wa-body p { font-size: 13px; color: var(--body); line-height: 1.5; margin-bottom: 16px; }
.wa-panel .wa-body .feat {
  display: flex; gap: 10px; padding: 10px 0; align-items: center;
  border-top: 1px dashed var(--rule);
}
.wa-panel .wa-body .feat:last-of-type { border-bottom: 1px dashed var(--rule); }
.wa-panel .wa-body .feat .ic {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(46,125,91,0.12); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.wa-panel .wa-body .feat .nm { font-size: 13px; color: var(--ink); font-weight: 500; }
.wa-panel .wa-body .feat .sub { font-size: 11px; color: var(--muted); }
.wa-panel .wa-body .wa-cta {
  display: block; width: 100%;
  background: #25D366; color: white;
  padding: 12px; border-radius: 10px;
  text-align: center; font-weight: 600; font-size: 14px;
  margin-top: 16px; border: 0; cursor: pointer;
  transition: background 0.15s;
}
.wa-panel .wa-body .wa-cta:hover { background: #1DA851; }

/* =========================================================================
   APP STORE / MOBILE APP SHOWCASE
   ========================================================================= */
.appstore-badges {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px;
}
.appstore-badge {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--ink); color: var(--cream);
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(247,244,237,0.10);
  transition: transform 0.2s, background 0.2s;
}
.appstore-badge:hover { transform: translateY(-2px); background: var(--navy); }
.appstore-badge .glyph { font-size: 28px; line-height: 1; }
.appstore-badge .text .small { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.65; }
.appstore-badge .text .big { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

.qr-card {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 14px 18px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  margin-top: 18px;
}
.qr-block {
  width: 80px; height: 80px;
  flex-shrink: 0;
  background:
    linear-gradient(45deg, var(--ink) 25%, transparent 25%) 0 0/12px 12px,
    linear-gradient(-45deg, var(--ink) 25%, transparent 25%) 0 6px/12px 12px,
    linear-gradient(45deg, transparent 75%, var(--ink) 75%) 6px 0/12px 12px,
    linear-gradient(-45deg, transparent 75%, var(--ink) 75%) -6px -6px/12px 12px,
    var(--paper);
  border: 6px solid var(--paper);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.qr-block::before, .qr-block::after {
  content: ""; position: absolute;
  width: 18px; height: 18px;
  border: 4px solid var(--ink);
  border-radius: 4px; background: var(--paper);
}
.qr-block::before { top: 0; left: 0; }
.qr-block::after  { top: 0; right: 0; }
.qr-card .qr-text small { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.qr-card .qr-text strong { display: block; font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.qr-card .qr-text span { font-size: 12px; color: var(--body); display: block; margin-top: 2px; }
