:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --hover: #f0f2f5;
  --border: #e6e8ec;
  --border-strong: #d5d9df;
  --text: #0f1419;
  --text-2: #414a56;
  --muted: #6b7482;
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-soft: #e8f1fc;
  --accent-ink: #1c5cab;
  --on-accent: #ffffff;
  --grid: #eceef1;
  /* series (categorical slots 1–4, validated) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  /* status */
  --good: #1a7f4b; --good-soft: #e5f4ec;
  --warn: #9a6400; --warn-soft: #fff4dc; --warn-fill: #eda100;
  --crit: #c4312f; --crit-soft: #fdeceb; --crit-fill: #e34948;
  --night: #4a3aa7; --night-soft: #efedfb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d0f13; --surface: #161a20; --surface-2: #1b2027; --hover: #20262e;
    --border: #262c35; --border-strong: #333a45;
    --text: #eef0f3; --text-2: #c3c8d0; --muted: #8b93a1;
    --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: #172a40; --accent-ink: #86b6ef;
    --grid: #232830;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
    --good: #5cc98e; --good-soft: #13291e;
    --warn: #f0c060; --warn-soft: #2e2410; --warn-fill: #c98500;
    --crit: #f08a88; --crit-soft: #33191a; --crit-fill: #e66767;
    --night: #b1a7f5; --night-soft: #221f3d;
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 Inter, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--crit); }
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 500; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 7px 13px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 1px 2px rgba(42,120,214,.3); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.block { width: 100%; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--crit); background: var(--crit-soft); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.icon-btn .ic { width: 18px; height: 18px; }

textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; width: 100%; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.lbl { margin-bottom: 4px; }
.switch { flex-direction: row; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; flex: none; width: 34px; height: 20px; background: var(--border-strong); border-radius: 20px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 40px 36px; text-align: center; max-width: 400px; box-shadow: var(--shadow); animation: rise .5s var(--ease); }
.login-card h1 { font-size: 26px; margin: 14px 0 8px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; }
.logo .ic { width: 18px; height: 18px; }
.logo.big { width: 56px; height: 56px; border-radius: 16px; }
.logo.big .ic { width: 30px; height: 30px; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 0; height: 100vh; transition: grid-template-columns .35s var(--ease); }
.shell.drawer-open { grid-template-columns: 272px minmax(0, 1fr) 440px; }

.sidebar { display: flex; flex-direction: column; gap: 12px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border); overflow: hidden; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 2px 6px 6px; }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 32px; background: var(--surface-2); border-color: var(--border); }

.campaign { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.campaign-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
.campaign-val { font-size: 18px; font-weight: 600; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.campaign-val small { font-size: 12px; font-weight: 500; color: var(--muted); }
.campaign-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 7px; color: var(--muted); }
.campaign-foot .ic { width: 14px; height: 14px; }
.campaign-foot.warn { color: var(--warn); }
.campaign-foot.crit { color: var(--crit); }
.campaign-foot.good { color: var(--good); }
.campaign-edit { display: flex; gap: 6px; margin-top: 8px; }
.campaign-edit input { padding: 5px 8px; font-size: 13px; }

.meter { height: 8px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 8px; background: var(--accent); width: 0; transition: width .6s var(--ease), background .3s; }
.meter.warn { background: var(--warn-soft); } .meter.warn > i { background: var(--warn-fill); }
.meter.crit { background: var(--crit-soft); } .meter.crit > i { background: var(--crit-fill); }

.trip-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.trip-item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .15s; position: relative; }
.trip-item:hover { background: var(--hover); }
.trip-item.active { background: var(--accent-soft); }
.trip-item.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.trip-item .t-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-item .t-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.trip-item .t-cost { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 500; }
.trip-item.excluded .t-cost { text-decoration: line-through; color: var(--muted); }
.list-empty { color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }

.user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.user img { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); }
.user span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

.main { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.trip-header { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.title-block { flex: 1; min-width: 0; }
.title-input { font-size: 22px; font-weight: 700; letter-spacing: -.02em; border: 1px solid transparent; background: transparent; padding: 2px 8px; margin-left: -9px; border-radius: 8px; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { background: var(--surface); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .route-str { color: var(--text-2); }
.actions { display: flex; align-items: center; gap: 4px; }
.save-status { font-size: 12px; color: var(--muted); margin-right: 6px; transition: opacity .3s; }
.only-mobile { display: none; }

.tabs { position: relative; display: flex; gap: 4px; padding: 0 28px; border-bottom: 1px solid var(--border); }
.tab { font: inherit; font-weight: 500; color: var(--muted); background: none; border: 0; padding: 12px 10px; cursor: pointer; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab-ink { position: absolute; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; transition: left .3s var(--ease), width .3s var(--ease); }

.notices { padding: 0 28px; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 14px; margin-top: 12px; font-size: 13px; animation: rise .3s var(--ease); }
.notice .ic { margin-top: 2px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.crit { background: var(--crit-soft); color: var(--crit); }
.notice.info { background: var(--accent-soft); color: var(--accent-ink); }
.notice ul { margin: 0; padding-left: 16px; }

.content { padding: 20px 28px 40px; position: relative; }
.content.busy .tab-panel { opacity: .55; transition: opacity .2s; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .35s var(--ease); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title small { font-weight: 500; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; animation: rise .45s var(--ease) both; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); }
.kpi-icon .ic { width: 15px; height: 15px; }
.kpi-val { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; line-height: 1.15; }
.kpi-val small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi-sub .tag { color: var(--accent-ink); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.map-card { padding: 0; overflow: hidden; min-height: 400px; display: flex; }
.map-slot { flex: 1; min-height: 100%; }
.map { width: 100%; height: 100%; min-height: 400px; }
.map-empty { display: grid; place-items: center; height: 100%; min-height: 300px; color: var(--muted); padding: 20px; text-align: center; }

/* Presupuesto */
.hero { margin-bottom: 16px; }
.hero-val { font-size: 48px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: proportional-nums; }
.hero-val small { font-size: 20px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.hero-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.hero .meter { margin-top: 12px; }
.hero .campaign-foot { margin-top: 6px; }
.stack { display: flex; gap: 2px; height: 20px; margin: 4px 0 14px; }
.stack > div { height: 100%; transition: flex-grow .6s var(--ease), filter .15s; cursor: default; min-width: 2px; }
.stack > div:first-child { border-radius: 4px 0 0 4px; }
.stack > div:last-child { border-radius: 0 4px 4px 0; }
.stack > div:only-child { border-radius: 4px; }
.stack > div:hover, .stack > div.hl { filter: brightness(1.12) saturate(1.1); }
.legend { display: flex; flex-direction: column; gap: 2px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto 44px; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; font-size: 13px; transition: background .15s; }
.legend-row:hover, .legend-row.hl { background: var(--hover); }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .lg-name { color: var(--text-2); }
.legend-row .lg-sub { color: var(--muted); font-size: 12px; }
.legend-row .lg-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-row .lg-pct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }

/* Gráfico de manejo */
.drive-chart { position: relative; }
.drive-chart svg { display: block; width: 100%; overflow: visible; }
.drive-chart text { font: 11px Inter, system-ui, sans-serif; fill: var(--muted); }
.drive-chart .val { fill: var(--text-2); font-weight: 600; }
.drive-chart .limit-label { fill: var(--muted); }
.drive-chart .bar { fill: var(--s1); transition: opacity .15s; }
.drive-chart .col:hover .bar { opacity: .82; }
.drive-chart .grid { stroke: var(--grid); stroke-width: 1; }
.drive-chart .limit { stroke: var(--muted); stroke-width: 1; }

/* Recorrido */
.route-list { list-style: none; margin: 0; padding: 0; position: relative; }
.route-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 8px 8px; margin: 0 -8px; border-radius: 10px; position: relative; transition: background .15s; cursor: default; }
.route-list li:hover, .route-list li.hl { background: var(--hover); }
.route-list li:not(:last-child)::after { content: ""; position: absolute; left: 21px; top: 38px; bottom: -8px; width: 2px; background: var(--border); }
.node { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--surface); }
.node.origin { background: var(--text); color: var(--surface); }
.node .ic { width: 14px; height: 14px; }
.rl-name { font-weight: 600; font-size: 13px; }
.rl-sub { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.rl-sub span { display: inline-flex; align-items: center; gap: 4px; }
.rl-sub .ic { width: 13px; height: 13px; }
.rl-time { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rl-time b { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--hover); color: var(--text-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.night { background: var(--night-soft); color: var(--night); }
.pill .ic { width: 12px; height: 12px; }

/* ---------- Itinerario ---------- */
.itin-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 42%); gap: 20px; align-items: start; }
.itin-map { position: sticky; top: 12px; padding: 0; overflow: hidden; height: calc(100vh - 190px); min-height: 400px; display: flex; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { font: inherit; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 5px 12px; border-radius: 20px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.day { margin-bottom: 18px; animation: fadeUp .35s var(--ease) both; }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 2px 10px; flex-wrap: wrap; }
.day-head h3 { font-size: 15px; }
.day-head h3 span { color: var(--muted); font-weight: 500; margin-left: 6px; }
.day-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.day-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 0; box-shadow: var(--shadow-sm); }
.ev { display: grid; grid-template-columns: 92px 32px 1fr; gap: 0 8px; align-items: start; padding: 8px 16px 8px 12px; position: relative; transition: background .15s; }
.ev:hover, .ev.hl { background: var(--surface-2); }
.ev .time { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); padding-top: 6px; line-height: 1.3; }
.ev .time b { display: block; color: var(--text); font-weight: 600; font-size: 13px; }
.ev .rail { position: relative; display: flex; justify-content: center; align-self: stretch; }
.ev .rail::before { content: ""; position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--border); }
.ev:first-child .rail::before { top: 14px; }
.ev:last-child .rail::before { bottom: calc(100% - 14px); }
.ev .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); margin-top: 2px; }
.ev .dot .ic { width: 14px; height: 14px; }
.ev.stop .dot { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.ev.meal .dot { width: 20px; height: 20px; margin-top: 4px; border-width: 1.5px; }
.ev.meal .dot .ic { width: 11px; height: 11px; }
.ev.overnight { background: var(--night-soft); }
.ev.overnight .dot { background: var(--night); border-color: var(--night); color: #fff; }
.ev .body { padding-top: 4px; min-width: 0; }
.ev .what { font-weight: 500; }
.ev.stop .what { font-weight: 600; font-size: 14px; }
.ev.meal .what { font-size: 13px; color: var(--text-2); font-weight: 400; }
.ev.overnight .what { color: var(--night); font-weight: 600; }
.ev .detail { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ev .detail span { display: inline-flex; align-items: center; gap: 4px; }
.ev .detail .ic { width: 13px; height: 13px; }
.ev .note { font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; margin-top: 6px; display: inline-block; }

/* ---------- Vista de día (24 h) ---------- */
.itin-layout.calendar-mode { grid-template-columns: minmax(0, 1fr); }
.itin-layout.calendar-mode .itin-map { display: none; }
.view-toggle { margin-left: auto; display: inline-flex; border: 1px solid var(--border); border-radius: 20px; padding: 2px; background: var(--surface); }
.view-toggle button { font: 500 12px Inter, sans-serif; border: 0; background: transparent; color: var(--muted); padding: 4px 12px; border-radius: 16px; cursor: pointer; }
.view-toggle button.active { background: var(--text); color: var(--surface); }
.day-chips { align-items: center; }
.dv-help { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
.dv-scroll { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 250px); min-height: 420px; overflow: auto; box-shadow: var(--shadow-sm); position: relative; }
.dv-heads { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(170px, 1fr)); position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); min-width: calc(56px + var(--days) * 170px); }
.dv-head { padding: 8px 10px; font-size: 12px; color: var(--muted); border-left: 1px solid var(--border); white-space: nowrap; text-transform: capitalize; }
.dv-head b { color: var(--text); margin-right: 4px; }
.dv-gutter { position: sticky; left: 0; background: var(--surface); }
.dv-body { position: relative; display: grid; grid-template-columns: 56px 1fr; min-width: calc(56px + var(--days) * 170px); }
.dv-hours { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.dv-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.dv-hour span { position: absolute; left: 8px; top: -8px; font-size: 11px; color: var(--muted); background: var(--surface); padding: 0 3px; font-variant-numeric: tabular-nums; }
.dv-cols { grid-column: 2; display: grid; grid-template-columns: repeat(var(--days), minmax(170px, 1fr)); }
.dv-col { position: relative; border-left: 1px solid var(--border); }
.dv-block { position: absolute; z-index: 2; border-radius: 8px; padding: 4px 8px; overflow: hidden; font-size: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .05s; user-select: none; touch-action: none; }
.dv-block.lane-main { left: 4px; width: calc(70% - 6px); }
.dv-block.lane-side { left: 72%; right: 4px; }
.dv-block.draggable { cursor: grab; }
.dv-block.draggable:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.dv-block.dragging { cursor: grabbing; z-index: 10; box-shadow: var(--shadow-lg); opacity: .92; }
.dv-block.short .dv-time { display: none; }
.dv-title { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-title span { overflow: hidden; text-overflow: ellipsis; }
.dv-title .ic { width: 13px; height: 13px; flex: none; }
.dv-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.dv-block.stop { background: var(--accent-soft); border-color: var(--accent); }
.dv-block.stop .dv-title { color: var(--accent-ink); }
.dv-block.transfer, .dv-block.overnight { background: var(--night-soft); border-color: var(--night); }
.dv-block.overnight .dv-title, .dv-block.transfer .dv-title { color: var(--night); }
.dv-block.wait { background: transparent; border-style: dashed; box-shadow: none; }
.dv-block.wait .dv-title { font-weight: 500; color: var(--muted); }
.dv-block.meal { background: var(--warn-soft); border-color: var(--warn-fill); }
.dv-block.meal .dv-title { color: var(--warn); }
.dv-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.dv-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 24px; height: 3px; margin-left: -12px; border-radius: 3px; background: currentColor; opacity: .25; }

/* ---------- Cobertura de viáticos ---------- */
.coverage { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.viatico-row { align-items: flex-end; }
.viatico-row .btn { margin-bottom: 10px; }
.cov-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.cov-head small { font-weight: 500; color: var(--muted); }
.cov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cov-grid span { display: block; font-size: 11px; color: var(--muted); }
.cov-grid b { font-size: 17px; font-variant-numeric: tabular-nums; }
.cov-grid small { display: block; font-size: 11px; color: var(--muted); }
tr.ok-row td { color: var(--good); }
tr.bad-row td { color: var(--crit); }

/* ---------- Tablas ---------- */
.table-card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.grid-2 .table-card { margin-bottom: 0; }
.table-card .card-title { padding: 16px 18px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 600; border-bottom: 0; }
tfoot tr.grand td { font-size: 16px; }
td .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.muted-row td { color: var(--muted); }

/* ---------- Panel de planificación ---------- */
.drawer { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; min-width: 0; z-index: 25; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.drawer-head h2 { font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 24px; width: 440px; }
.panel { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.panel h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.panel h3 .ic { color: var(--muted); }
.panel .count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
details.panel summary { cursor: pointer; list-style: none; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary h3 { margin: 0; }
details.panel summary h3::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
details[open].panel summary h3::after { transform: rotate(-135deg); }
details[open].panel summary { margin-bottom: 12px; }
.row { display: flex; gap: 10px; }
.row > label { flex: 1; }
.row > label.narrow { flex: 0 0 96px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

.place-picker { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pp-current { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; }
.pp-current .ic { color: var(--accent); }
.pp-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.pp-or { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pp-or::before, .pp-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.place-picker gmp-place-autocomplete { width: 100%; color-scheme: light dark; }

.stops { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stop { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: box-shadow .2s, border-color .2s, transform .2s var(--ease), opacity .2s; animation: rise .3s var(--ease); }
.stop:hover { border-color: var(--border-strong); }
.stop.dragging { opacity: .4; }
.stop.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.stop.drop-after { box-shadow: 0 3px 0 var(--accent); }
.stop-head { display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 4px; }
.grip { cursor: grab; color: var(--muted); display: grid; place-items: center; width: 22px; height: 28px; border-radius: 6px; }
.grip:hover { background: var(--hover); }
.grip:active { cursor: grabbing; }
.stop-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.stop-name { flex: 1; font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.stop-name small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.sessions { padding: 0 10px 8px 32px; display: flex; flex-direction: column; gap: 6px; }
.sess { border-left: 2px solid var(--accent-soft); padding-left: 8px; display: flex; flex-direction: column; gap: 5px; }
.sess-row { display: flex; align-items: center; gap: 6px; }
.sess-name { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.sess-time { width: 118px; flex: none; padding: 4px 6px; font-size: 13px; }
.sess-row .dur { padding: 1px 2px; }
.sess-row .dur-val { min-width: 52px; font-size: 12px; }
.sess-del { width: 26px; height: 26px; }
.sess-more { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-top: 6px; }
.sess-more label { margin-bottom: 4px; }
.sess-more .sess-notes, .sess-more .sess-inside { grid-column: 1 / -1; }
.sess-inside { font-size: 12px; margin-bottom: 8px; }
.sess-svc { grid-column: 1 / -1; }
.lbl-sm { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.svc-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.svc { display: flex; align-items: center; gap: 8px; }
.svc .switch { margin: 0; flex: 1; font-size: 12px; }
.svc-qty { width: 96px; flex: none; padding: 3px 6px; font-size: 12px; }
.adj-form .svc-list { flex-direction: row; gap: 14px; flex-wrap: wrap; }
.sess-note-preview { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-line; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sess-actions { display: flex; justify-content: space-between; }
.sess-actions .more { margin-left: 0; }
.sess-label { font-weight: 500; color: var(--text-2); }
.ev .note { white-space: pre-line; }
.stop-controls { display: flex; align-items: center; gap: 6px; padding: 0 10px 10px 32px; margin-top: -4px; flex-wrap: wrap; }
.dur { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px 4px 2px 8px; color: var(--muted); }
.dur .ic { width: 14px; height: 14px; }
.dur-btn { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 600 15px/1 Inter, sans-serif; cursor: pointer; }
.dur-btn:hover { background: var(--hover); }
.dur-btn:disabled { opacity: .3; cursor: default; }
.dur-val { min-width: 56px; text-align: center; font-weight: 600; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.dur-val.is-default { color: var(--muted); font-weight: 500; }
.dur-hint { font-size: 11px; color: var(--muted); padding-right: 4px; }
.dur-reset { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 14px; padding: 0 4px; }
.appt { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 12px; }
.appt input { width: auto; padding: 3px 6px; font-size: 13px; }
.more { margin-left: auto; border: 0; background: none; color: var(--accent); font: 500 12px Inter, sans-serif; cursor: pointer; padding: 4px; }
.ev.wait .dot { border-style: dashed; }
.ev.extra .dot { border-color: var(--accent); color: var(--accent); }
.ev.skipped .what { color: var(--muted); }
.ev.skipped .dot { border-style: dashed; }
.adj-btn { margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 500 11px Inter, sans-serif; padding: 2px 8px; border-radius: 20px; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; vertical-align: 1px; }
.adj-btn .ic { width: 11px; height: 11px; }
.ev:hover .adj-btn, .adj-btn.on, .adj-btn:focus-visible { opacity: 1; }
.adj-btn.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
@media (hover: none) { .adj-btn { opacity: 1; } }
.adj-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.adj-form .full { grid-column: 1 / -1; }
.adj-actions { display: flex; justify-content: flex-end; gap: 6px; }
.ev.transfer .dot { background: var(--night-soft); border-color: var(--night); color: var(--night); }
.ev.wait .what { color: var(--text-2); }
.stop-summary:empty { display: none; }
.stop-summary { font-size: 12px; color: var(--muted); padding: 0 12px 8px 36px; margin-top: -4px; display: flex; gap: 10px; flex-wrap: wrap; }
.stop-fields { display: none; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 4px 12px 4px; border-top: 1px solid var(--border); }
.stop.open .stop-fields { display: grid; }
.stop.open .stop-summary { display: none; }
.stop-fields .full { grid-column: 1 / -1; }
.stop-fields .switch { margin: 2px 0 12px; }

/* ---------- Tooltip, toast, estados ---------- */
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 12px; font-size: 12px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 260px; }
.tooltip.show { opacity: 1; transform: none; }
.tooltip b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .tt-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.tooltip .tt-sub { color: var(--muted); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; z-index: 110; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty-state { text-align: center; padding: 70px 20px; max-width: 460px; margin: 0 auto; animation: fadeUp .4s var(--ease); }
.empty-illus { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.empty-illus .ic { width: 34px; height: 34px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 0 22px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; margin-top: 2px; }

/* Marcadores del mapa */
.mk { width: 30px; height: 30px; border-radius: 50%; background: var(--accent, #2a78d6); color: #fff; font: 700 12px Inter, sans-serif; display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .2s var(--ease); }
.mk.origin { background: #0f1419; }
.mk.origin svg { width: 14px; height: 14px; }
.mk.hl { transform: scale(1.3); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsivo ---------- */
.scrim { display: none; }
@media (max-width: 1280px) {
  .shell.drawer-open { grid-template-columns: 272px minmax(0, 1fr) 0; }
  .drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 440px; max-width: 100vw; transform: translateX(100%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.drawer-open .drawer { transform: none; }
  .drawer-body { width: auto; }
}
@media (max-width: 1100px) {
  .grid-main, .grid-2, .itin-layout { grid-template-columns: minmax(0, 1fr); }
  .itin-map { position: relative; top: 0; height: 360px; order: -1; }
}
@media (max-width: 860px) {
  .shell, .shell.drawer-open { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.sidebar-open .sidebar { transform: none; }
  .shell.sidebar-open .scrim, .shell.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
  .only-mobile { display: inline-grid; }
  .trip-header { padding: 14px 16px 4px; flex-wrap: wrap; }
  .actions { width: 100%; justify-content: flex-end; }
  .tabs, .notices { padding-left: 16px; padding-right: 16px; overflow-x: auto; }
  .content { padding: 16px 16px 32px; }
  .hero-val { font-size: 40px; }
  .ev { grid-template-columns: 70px 28px 1fr; padding-right: 10px; }
}

/* ---------- Compartir ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fadeUp .2s var(--ease); }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-body { padding: 16px 18px 18px; max-height: 70vh; overflow-y: auto; }
.share-form { display: flex; gap: 8px; margin-bottom: 14px; }
.members { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; }
.members li:hover { background: var(--hover); }
.members .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.members .m-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }

/* ---------- Calendario ---------- */
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; font-weight: 500; color: var(--text-2); background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; transition: background .15s; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.calendar-view { display: none; padding: 18px 28px 40px; }
.view-calendar .calendar-view { display: block; animation: fadeUp .3s var(--ease); }
.view-calendar .trip-header, .view-calendar .tabs, .view-calendar .notices, .view-calendar #content { display: none; }
.view-calendar .trip-item.active { background: transparent; }
.view-calendar .trip-item.active::before { display: none; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { font-size: 20px; min-width: 190px; text-align: center; }
.cal-nav .icon-btn { font-size: 22px; line-height: 1; }
.cal-export { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: auto; }
.cal-export span { margin-right: 2px; }
.cal-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.cal-stats b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-grid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-weekdays div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 30px repeat(3, 26px) 10px; row-gap: 3px; position: relative; border-bottom: 1px solid var(--border); min-height: 124px; }
.cal-week:last-child { border-bottom: 0; }
.cal-day { grid-row: 1 / -1; border-right: 1px solid var(--border); padding: 6px 8px; position: relative; transition: background .15s; }
.cal-day:nth-child(7) { border-right: 0; }
.cal-day.weekend { background: var(--surface-2); }
.cal-day.out .cal-num { color: var(--muted); opacity: .6; }
.cal-day.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-size: 12px; font-weight: 600; color: var(--text-2); display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; padding: 0 6px; }
.cal-more { position: absolute; left: 8px; bottom: 4px; font-size: 11px; color: var(--muted); }
.cal-add { position: absolute; top: 5px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--hover); color: var(--accent); }
.cal-bar { z-index: 2; align-self: stretch; margin: 0 4px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 500; cursor: grab; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .12s, box-shadow .12s, opacity .15s; }
.cal-bar:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.cal-bar:active { cursor: grabbing; }
.cal-bar.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.cal-bar.pending { background: var(--surface); color: var(--text-2); border: 1.5px dashed var(--border-strong); box-shadow: none; }
.cal-bar.excluded { background: var(--hover); color: var(--muted); box-shadow: none; }
.cal-bar.dragging { opacity: .4; }
.cal-name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cal-cost { font-size: 11px; opacity: .85; font-variant-numeric: tabular-nums; }
.cal-warn { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-fill); color: #111; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cal-agenda { margin-top: 16px; padding: 14px 8px 8px; }
.cal-agenda .card-title { padding: 0 10px; }
.agenda-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; grid-template-areas: "date name cost" "date stops cost"; gap: 0 14px; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-radius: 10px; padding: 9px 10px; cursor: pointer; transition: background .15s; }
.agenda-row:hover, .agenda-row.active { background: var(--hover); }
.agenda-date { grid-area: date; font-size: 13px; color: var(--text-2); text-transform: capitalize; }
.agenda-name { grid-area: name; font-weight: 600; font-size: 13px; }
.agenda-stops { grid-area: stops; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-cost { grid-area: cost; font-weight: 600; font-variant-numeric: tabular-nums; align-self: center; }
.pill.warn-pill { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.toast .toast-action { margin-left: 12px; background: none; border: 0; color: var(--accent-hover); font: 600 13px Inter, sans-serif; cursor: pointer; pointer-events: auto; }
.toast.show { pointer-events: auto; }
@media (max-width: 860px) {
  .calendar-view { padding: 14px 12px 32px; }
  .cal-week { min-height: 100px; grid-template-rows: 26px repeat(3, 20px) 6px; }
  .cal-bar { font-size: 10px; padding: 0 4px; margin: 0 1px; }
  .cal-cost, .cal-add { display: none; }
  .agenda-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date cost" "name cost" "stops stops"; }
}

/* ---------- Impresión: documento "Plan de gira" ---------- */
.print-doc { display: none; }
@page { size: letter; margin: 14mm 13mm 16mm; @bottom-right { content: "Página " counter(page) " de " counter(pages); font: 8pt Inter, sans-serif; color: #6b7482; } @bottom-left { content: "Rutas HN · Plan de gira"; font: 8pt Inter, sans-serif; color: #6b7482; } }
@media print {
  :root { color-scheme: light; }
  html, body { background: #fff !important; height: auto; }
  body > *:not(.print-doc) { display: none !important; }
  .print-doc { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pd { font: 9pt/1.45 Inter, system-ui, sans-serif; color: #111820; }
.pd b { font-weight: 600; }
.pd-muted { color: #6b7482; font-size: 8pt; }
.pd-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #2a78d6; padding-bottom: 6px; margin-bottom: 14px; font-size: 8pt; color: #6b7482; }
.pd-brand { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #1c5cab; text-transform: uppercase; letter-spacing: .06em; }
.pd-logo { width: 10px; height: 10px; border-radius: 3px; background: #2a78d6; }
.pd-title { font-size: 22pt; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.pd-sub { font-size: 11pt; color: #414a56; margin-top: 2px; }
.pd-sub::first-letter { text-transform: uppercase; }
.pd-route { font-size: 9pt; color: #414a56; margin: 6px 0 14px; }
.pd-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.pd-facts > div { border: 1px solid #e3e6eb; border-radius: 6px; padding: 7px 9px; }
.pd-facts span { display: block; font-size: 7pt; text-transform: uppercase; letter-spacing: .05em; color: #6b7482; }
.pd-facts b { display: block; font-size: 10.5pt; margin-top: 1px; }
.pd-facts em { display: block; font-style: normal; font-size: 8pt; color: #6b7482; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-facts .pd-total { grid-column: span 2; background: #e8f1fc; border-color: #b7d3f6; }
.pd-facts .pd-total b { font-size: 16pt; color: #1c5cab; }
.pd-facts .pd-over { background: #fdeceb; border-color: #f5c2c0; }
.pd-facts .pd-over b { color: #c4312f; }
.pd-map { margin: 0 0 12px; }
.pd-map img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid #e3e6eb; }
.pd-map figcaption { font-size: 7.5pt; color: #6b7482; margin-top: 3px; }
.pd-warn { border-left: 3px solid #eda100; background: #fff6e0; padding: 7px 10px; border-radius: 4px; margin-bottom: 12px; font-size: 8.5pt; }
.pd-warn ul { margin: 3px 0 0; padding-left: 16px; }
.pd-sec { margin-top: 16px; }
.pd-break { break-before: page; }
.pd-trip-break { break-before: page; }
.pd-keep { break-inside: avoid; }
.pd-sec h2 { font-size: 13pt; font-weight: 700; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid #d5d9df; break-after: avoid; }
.pd-h3 { font-size: 10pt; margin: 12px 0 5px; break-after: avoid; }
.pd-h3 span { font-weight: 400; color: #6b7482; font-size: 8.5pt; margin-left: 6px; }
.pd-table { width: 100%; border-collapse: collapse; }
.pd-table th { text-align: left; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .04em; color: #6b7482; font-weight: 600; background: #f4f5f7; padding: 5px 6px; border-bottom: 1px solid #d5d9df; }
.pd-table td { padding: 5px 6px; border-bottom: 1px solid #eceef1; vertical-align: top; font-size: 8.5pt; }
.pd-table tr { break-inside: avoid; }
.pd-table thead { display: table-header-group; }
.pd-table tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid #d5d9df; }
.pd-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-table .c { text-align: center; }
.pd-grand td { font-size: 11pt; }
.pd-sub-row td { border-top: 0; padding-top: 2px; }
.pd-sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.pd-day { margin-bottom: 12px; }
.pd-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: #f4f5f7; border-left: 3px solid #2a78d6; padding: 5px 8px; border-radius: 0 4px 4px 0; break-after: avoid; }
.pd-day-head h3 { font-size: 10.5pt; margin: 0; }
.pd-day-head h3 span { font-weight: 400; color: #414a56; margin-left: 4px; }
.pd-day-head div { font-size: 8pt; color: #414a56; }
.pd-itin { table-layout: fixed; }
.pd-itin thead th { background: transparent; }
.pd-tag { display: inline-block; font-size: 7pt; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #414a56; background: #eceef1; border-radius: 3px; padding: 1px 5px; }
.pd-tag.strong { background: #2a78d6; color: #fff; }
.pd-tag.night { background: #4a3aa7; color: #fff; }
.k-stop td { background: #f8fbff; }
.k-night td { background: #f3f1fc; }
.k-meal td, .k-wait td { color: #414a56; }
.pd-meals td { width: 25%; }
.pd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pd-grid2 > div { break-inside: avoid; }
.pd-campaign { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; border: 1px solid #e3e6eb; border-radius: 6px; padding: 8px 10px; break-inside: avoid; }
.pd-campaign span { display: block; font-size: 7pt; text-transform: uppercase; letter-spacing: .05em; color: #6b7482; }
.pd-campaign b { font-size: 10.5pt; }
.pd-meter { grid-column: 1 / -1; height: 6px; background: #e8f1fc; border-radius: 6px; overflow: hidden; }
.pd-meter i { display: block; height: 100%; background: #2a78d6; }
.pd-campaign.warn .pd-meter { background: #fff4dc; } .pd-campaign.warn .pd-meter i { background: #eda100; }
.pd-campaign.crit .pd-meter { background: #fdeceb; } .pd-campaign.crit .pd-meter i { background: #e34948; }
.pd-campaign.crit div:nth-child(4) b { color: #c4312f; }
.pd-params { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.pd-params > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted #d5d9df; font-size: 8.5pt; }
.pd-params span { color: #6b7482; }
.pd-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; font-size: 8.5pt; color: #414a56; text-align: center; }
.pd-signs i { display: block; border-top: 1px solid #111820; margin-bottom: 4px; }
