/* =========================================================
   Paleta de marca: cambia estas variables para ajustar los
   colores a los logos de la empresa.
   ========================================================= */
:root {
  --brand: #ff6a13;        /* acento principal (botones, resaltados) */
  --brand-dark: #e2550a;
  --ink: #0f1b3d;          /* azul profundo: textos y fondos oscuros */
  --ink-2: #1c2b57;
  --muted: #5d6a85;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e3e8f2;
  --ok: #138a52;
  --warn: #b7791f;
  --err: #c0392b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 27, 61, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--brand-dark); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
.container { width: min(1180px, 92%); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .75em 1.4em;
  border-radius: 999px; border: 2px solid transparent; font-weight: 700; font-size: 1rem; cursor: pointer;
  text-decoration: none; transition: transform .15s, background .15s, color .15s; font-family: inherit; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-light { background: #fff; color: var(--ink); }
.btn-sm { padding: .4em .9em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--err); color: #fff; }
.link-btn { background: none; border: 0; color: var(--brand-dark); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* ---------- Navegación pública ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .55rem; font-weight: 900; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo img { height: 40px; width: auto; }
.logo .mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-links a:hover { color: var(--brand-dark); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 1rem 4%; border-bottom: 1px solid var(--line); gap: .8rem; }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 500px at 90% -10%, #2b3f7d 0%, transparent 60%), var(--ink); color: #fff; padding: 4.5rem 0 5rem; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 900; letter-spacing: -.03em; }
.hero h1 span { color: var(--brand); }
.hero p.lead { font-size: 1.2rem; color: #c9d3ee; max-width: 34em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-ctas .btn-outline { color: #fff; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem; color: #c9d3ee; font-weight: 600; font-size: .95rem; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } }

/* ---------- Tarjetas y formularios ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; color: var(--ink); border: 1px solid var(--line); }
.card h3 { font-size: 1.25rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .3rem; }
input, select, textarea { width: 100%; padding: .7em .85em; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,106,19,.15); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 640px) { .row, .row-3 { grid-template-columns: 1fr; } }
.form-actions { margin-top: 1.2rem; display: flex; gap: .7rem; flex-wrap: wrap; }

/* Cotizador */
.cotizador h3 { display: flex; align-items: center; gap: .5rem; }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 1.2rem; cursor: pointer; }
.stepper input { text-align: center; width: 70px; }
.resultado { margin-top: 1rem; background: var(--bg); border-radius: 12px; padding: 1rem; }
.resultado .total { font-size: 2rem; font-weight: 900; color: var(--ink); }
.desglose { list-style: none; padding: 0; margin: .5rem 0 1rem; font-size: .9rem; color: var(--muted); }
.desglose li { display: flex; justify-content: space-between; padding: .15rem 0; }
.error-msg { color: var(--err); font-weight: 600; margin-top: .6rem; }

/* ---------- Secciones ---------- */
.section { padding: 5rem 0; }
.section.alt { background: #fff; }
.section.dark { background: var(--ink); color: #fff; }
.section.dark .muted { color: #b8c3e2; }
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 900; letter-spacing: -.02em; }
.eyebrow { display: inline-block; color: var(--brand-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin-bottom: .6rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 900px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }
.feature .icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,106,19,.12); display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 1rem; }
.audience { display: flex; flex-direction: column; }
.audience p { flex: 1; }
.steps { counter-reset: paso; }
.step { position: relative; padding-left: 4rem; margin-bottom: 1.6rem; }
.step::before { counter-increment: paso; content: counter(paso); position: absolute; left: 0; top: 0; width: 2.8rem; height: 2.8rem;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 1.2rem; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 1.8rem; position: relative; margin: .6rem 0; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 900; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; font-weight: 600; }
.section.dark .chip { background: var(--ink-2); border-color: #2c3d70; color: #fff; }
.vehiculos-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.vehiculo-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; text-align: center; }
.vehiculo-card .cap { color: var(--brand-dark); font-weight: 800; }

/* ---------- Footer ---------- */
.footer { background: #0a1330; color: #b8c3e2; padding: 3.5rem 0 2rem; }
.footer a { color: #fff; text-decoration: none; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: #fff; margin: 0 0 .8rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: .4rem 0; }
.footer .legal { border-top: 1px solid #1f2b52; margin-top: 2.5rem; padding-top: 1.4rem; font-size: .85rem; }
.footer .logo { color: #fff; }
@media (max-width: 900px) { .footer .cols { grid-template-columns: 1fr 1fr; } }
.wa-float { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 60; text-decoration: none; }

/* ---------- Mensajes flash ---------- */
.flash-wrap { margin: 1rem 0; }
.flash { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: .5rem; font-weight: 600; }
.flash.ok { background: #e3f6ec; color: var(--ok); }
.flash.error { background: #fdecea; color: var(--err); }
.flash.info { background: #e8eefc; color: var(--ink-2); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 3rem 0; }
.auth-card { width: min(480px, 92%); }
.auth-card.wide { width: min(640px, 92%); }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.role-tabs label { margin: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem; text-align: center; cursor: pointer; font-size: .85rem; }
.role-tabs input { display: none; }
.role-tabs label:has(input:checked) { border-color: var(--brand); background: rgba(255,106,19,.08); }

/* ---------- Panel ---------- */
.panel { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #fff; padding: 1.4rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { color: #fff; margin-bottom: 2rem; padding: 0 .5rem; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 10px; color: #c9d3ee; text-decoration: none; font-weight: 600; margin-bottom: .2rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--ink-2); color: #fff; }
.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .who { margin-top: 2rem; padding: 1rem .9rem; border-top: 1px solid #2c3d70; font-size: .85rem; color: #b8c3e2; }
.sidebar .who button { color: #fff; }
.panel-main { padding: 2rem clamp(1rem, 3vw, 2.5rem); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.panel-head h1 { font-size: 1.8rem; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; }
.stat .n { font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 900; white-space: nowrap; }
.stat .l { color: var(--muted); font-size: .85rem; font-weight: 600; }
.panel-mobile-bar { display: none; }
@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 80; }
  .sidebar.open { transform: none; }
  .panel-mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: #fff; padding: .8rem 1rem; }
  .panel-mobile-bar button { background: none; border: 0; color: #fff; font-size: 1.5rem; }
}

/* Tablas */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .75rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f9fafd; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td form { display: inline; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }

/* Badges de estado */
.badge { display: inline-block; padding: .25em .7em; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge.pendiente { background: #fff4e0; color: var(--warn); }
.badge.asignado { background: #e8eefc; color: #2f56c8; }
.badge.en_ruta { background: #ffe9dc; color: var(--brand-dark); }
.badge.entregado, .badge.pagado, .badge.si { background: #e3f6ec; color: var(--ok); }
.badge.cancelado, .badge.no { background: #fdecea; color: var(--err); }

/* Línea de tiempo */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.2rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.timeline .when { font-size: .8rem; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: .5rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); font-weight: 600; font-size: .9rem; }
dl.kv dd { margin: 0; }
@media (max-width: 640px) { dl.kv { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 1.5rem; }
