/* Huevos de la Naza · Panel — paleta tomada del logo */
:root {
  --amber: #F7B016;
  --amber-2: #FFCB4C;
  --amber-soft: #FFF1CC;
  --yolk: #FFE08A;
  --ink: #241F35;
  --ink-2: #3B3452;
  --ink-3: #6B6580;
  --muted: #8C8698;
  --cream: #FFF9EE;
  --paper: #FFFFFF;
  --line: #F0E7D6;
  --red: #E2463C;
  --red-soft: #FDE7E5;
  --blue: #3E6FB6;
  --blue-soft: #E5EEFA;
  --violet: #7B5CC4;
  --violet-soft: #EEE8FA;
  --green: #2E9E6A;
  --green-soft: #E2F5EC;
  --gray-soft: #F2EFEA;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(36, 31, 53, .04), 0 8px 24px -12px rgba(36, 31, 53, .14);
  --shadow-lg: 0 24px 60px -20px rgba(36, 31, 53, .35);
  --sidebar: 252px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
code { background: var(--gray-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.ico { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 12px 20px 18px; }
.round { border-radius: 50%; }

/* ---------- Carga inicial ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-3); font-weight: 600; }
.boot img { border-radius: 50%; animation: bob 1.4s var(--ease) infinite; box-shadow: 0 14px 30px -12px rgba(247, 176, 22, .7); }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: var(--amber); color: var(--ink); padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.login-blob { position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #FFD35C, transparent 62%); right: -180px; bottom: -220px; }
.login-art h1 { font-size: clamp(34px, 4vw, 52px); font-weight: 800; position: relative; }
.login-art p { font-size: 18px; max-width: 420px; position: relative; color: var(--ink-2); }
.login-logo { width: 140px; height: 140px; border-radius: 50%; position: relative; box-shadow: 0 20px 40px -18px rgba(36, 31, 53, .55); border: 5px solid rgba(255, 255, 255, .5); }
.login-card { align-self: center; justify-self: center; width: min(420px, 92vw); background: var(--paper); border-radius: 24px; padding: 34px; box-shadow: var(--shadow); display: grid; gap: 16px; margin: 32px 0; }
.login-card.center { text-align: center; justify-items: center; }
.login-card h2 { font-size: 24px; font-weight: 800; }
.login-foot { display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.sent-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--amber-soft); color: #B07800; display: grid; place-items: center; }
.input.code { letter-spacing: .4em; font-size: 22px; text-align: center; font-weight: 700; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #EDEAF5; display: flex; flex-direction: column; padding: 20px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(247, 176, 22, .25); }
.brand b { display: block; font-size: 15px; }
.brand small { color: #A9A3BB; font-size: 12px; }
.side-nav { display: grid; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #C9C4D9; font-weight: 600; font-size: 14.5px; border: 0; background: none; width: 100%; text-align: left; transition: background .2s, color .2s; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.on { background: var(--amber); color: var(--ink); box-shadow: 0 10px 22px -12px rgba(247, 176, 22, .9); }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 6px; }
.me-txt { flex: 1; min-width: 0; }
.me-txt b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { color: #A9A3BB; }
.me .icon-btn { color: #C9C4D9; }
.me .icon-btn:hover { background: rgba(255, 255, 255, .08); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--amber); color: var(--ink); flex-shrink: 0; }
.avatar.soft { background: var(--amber-soft); color: #9A6A00; width: 42px; height: 42px; }

.main { min-width: 0; padding: 0 32px 48px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 20px 0 16px; background: linear-gradient(var(--cream) 75%, rgba(255, 249, 238, 0)); }
.topbar-brand { display: none; }
.page-title { font-size: 28px; font-weight: 800; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }
.page { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 30px 32px; background: linear-gradient(120deg, var(--amber) 0%, var(--amber-2) 100%); display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: 0 20px 40px -24px rgba(247, 176, 22, .9); }
.hero::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(255, 255, 255, .18); right: -90px; top: -170px; }
.hero-txt { position: relative; z-index: 1; display: grid; gap: 6px; max-width: 620px; }
.hero-kicker { font-size: 13px; font-weight: 700; text-transform: capitalize; color: var(--ink-2); opacity: .8; }
.hero h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.hero p { color: var(--ink-2); font-size: 16px; }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-logo { position: absolute; right: 22px; top: 18px; width: 92px; height: 92px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .55); z-index: 1; animation: bob 4s var(--ease) infinite; }
.skeleton-hero { height: 170px; background: linear-gradient(90deg, #FBE7B5, #FFF1CC, #FBE7B5); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

/* ---------- Tarjetas ---------- */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(240, 231, 214, .7); min-width: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 4px; }
.card-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ico { color: #C98D00; }
.card-body { padding: 14px 20px 20px; }
.card > .error-box { margin: 12px 20px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--paper); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); border: 1px solid rgba(240, 231, 214, .7); transition: transform .2s var(--ease), box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--amber-soft); color: #B07800; flex-shrink: 0; }
.kpi.blue .kpi-icon { background: var(--blue-soft); color: var(--blue); }
.kpi.violet .kpi-icon { background: var(--violet-soft); color: var(--violet); }
.kpi.red .kpi-icon { background: var(--red-soft); color: var(--red); }
.kpi.green .kpi-icon { background: var(--green-soft); color: var(--green); }
.kpi-body { display: grid; gap: 2px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi-sub em { font-style: normal; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 99px; }
.kpi-sub em.up { color: var(--green); background: var(--green-soft); }
.kpi-sub em.down { color: var(--red); background: var(--red-soft); }

.mini-stats, .stat-row, .summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat-row { grid-template-columns: repeat(4, 1fr); margin: 0; }
.mini-stats div, .stat-row div, .summary-strip div { background: var(--cream); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.mini-stats span, .stat-row span, .summary-strip span { font-size: 12px; color: var(--muted); font-weight: 600; }
.mini-stats b, .stat-row b, .summary-strip b { font-size: 16px; }
.summary-strip { margin: 0; }
.summary-strip div { background: var(--paper); box-shadow: var(--shadow); }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(36, 31, 53, .35); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero .btn.primary { background: var(--ink); }
.btn.glass { background: rgba(255, 255, 255, .45); border-color: rgba(255, 255, 255, .6); backdrop-filter: blur(6px); }
.btn.ghost { background: transparent; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.violet { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-ghost { color: var(--red); border-color: #F6C9C5; background: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg) } }
.icon-btn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; color: var(--ink-3); transition: background .2s; }
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }
.topbar .icon-btn { background: var(--paper); box-shadow: var(--shadow); }
.link { color: var(--blue); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 5px; }
.link:hover { text-decoration: underline; }

.input { width: 100%; border: 1.5px solid var(--line); background: #FFFDF9; border-radius: 12px; padding: 11px 13px; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(247, 176, 22, .18); }
.input.auto { width: auto; min-width: 170px; }
textarea.input { resize: vertical; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hint { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 44px; height: 26px; border-radius: 99px; background: #DDD6CA; position: relative; transition: background .2s; flex-shrink: 0; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px rgba(247, 176, 22, .3); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar.end { justify-content: flex-end; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(247, 176, 22, .18); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; padding: 11px 0; width: 100%; color: var(--ink); }

.tabs { display: flex; gap: 4px; background: var(--paper); padding: 5px; border-radius: 14px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-3); display: flex; gap: 7px; align-items: center; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; }
.tab-n { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--gray-soft); color: var(--ink-3); }
.tab.on .tab-n { background: var(--amber); color: var(--ink); }

/* ---------- Insignias ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge.amber { background: var(--amber-soft); color: #9A6A00; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--gray-soft); color: var(--ink-3); }

/* ---------- Listas ---------- */
.list { display: grid; }
.row-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; width: 100%; transition: background .15s; }
.list > .row-item:first-child { border-top: 0; }
button.row-item:hover { background: #FFFBF3; }
.row-item.static { cursor: default; }
.ri-id { font-weight: 800; color: var(--ink-3); background: var(--gray-soft); border-radius: 10px; padding: 8px 10px; font-size: 13px; min-width: 52px; text-align: center; }
.ri-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ri-main > b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ri-main > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.ri-side { display: grid; justify-items: end; gap: 6px; text-align: right; }
.ri-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.table-wrap { overflow-x: auto; }
.table-wrap.tall { max-height: 560px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FFFCF6; position: sticky; top: 0; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FFFBF3; }
.r { text-align: right !important; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }
.warn-t { color: #B07800; }

/* ---------- Gráficas ---------- */
.bars { display: flex; align-items: stretch; gap: 8px; padding-top: 26px; }
.bar-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bar-wrap { flex: 1; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 9px 9px 4px 4px; position: relative; opacity: .55; transform-origin: bottom; animation: grow .6s var(--ease) both; transition: opacity .2s, filter .2s; outline: none; }
.bar.hl, .bar:hover, .bar:focus { opacity: 1; }
.bar:hover, .bar:focus { filter: saturate(1.2); }
@keyframes grow { from { transform: scaleY(0) } to { transform: scaleY(1) } }
.bar .tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; display: grid; gap: 1px; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; z-index: 5; text-align: center; }
.bar .tip b { font-size: 13.5px; }
.bar:hover .tip, .bar:focus .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.bar-label { font-size: 11.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.hbars { display: grid; gap: 14px; }
.hbar { display: grid; gap: 6px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.hbar-top span { font-weight: 600; }
.hbar-track { height: 10px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; transform-origin: left; animation: growx .7s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0) } to { transform: scaleX(1) } }
.hbar small { color: var(--muted); font-size: 12px; }

.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut svg circle { transition: stroke-width .2s; }
.donut svg circle:hover { stroke-width: 22; }
.donut-num { font-size: 26px; font-weight: 800; fill: var(--ink); }
.donut-lbl { font-size: 11px; fill: var(--muted); font-weight: 600; }
.legend { display: grid; gap: 7px; font-size: 13.5px; min-width: 150px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend span { flex: 1; }

.meter { height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; transition: width .6s var(--ease); }
.meter-fill.amber { background: linear-gradient(90deg, var(--amber), var(--amber-2)); }
.meter-fill.red { background: var(--red); }

/* ---------- Inicio ---------- */
.alerts { display: grid; gap: 8px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: var(--cream); font-weight: 600; font-size: 14px; transition: transform .15s, background .15s; }
.alert-item:hover { transform: translateX(3px); }
.alert-item > span:nth-child(2) { flex: 1; }
.alert-item > .ico:last-child { color: var(--muted); }
.alert-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.alert-item.red .alert-ico { background: var(--red-soft); color: var(--red); }
.alert-item.amber .alert-ico { background: var(--amber-soft); color: #B07800; }
.alert-item.blue .alert-ico { background: var(--blue-soft); color: var(--blue); }
.alert-item.violet .alert-ico { background: var(--violet-soft); color: var(--violet); }
.alert-item.gray .alert-ico { background: var(--gray-soft); color: var(--ink-3); }
.prep { border: 1px dashed #EBD9B0; border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: #FFFCF4; }
.prep + .prep { margin-top: 12px; }
.prep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.prep-grid .prep + .prep { margin-top: 0; }
.prep-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-transform: capitalize; }
.prep-items { display: grid; gap: 6px; }
.prep-item { display: flex; align-items: center; gap: 10px; }
.prep-item span:nth-child(2) { flex: 1; }
.prep-item b { font-size: 18px; }
.egg-dot { width: 12px; height: 15px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--yolk); box-shadow: inset 0 -2px 0 rgba(176, 120, 0, .25); }

/* ---------- Productos ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.product { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 14px; border: 1px solid rgba(240, 231, 214, .7); transition: transform .2s var(--ease), box-shadow .2s; }
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product.off { opacity: .6; }
.product-head { display: flex; gap: 12px; align-items: center; }
.product-head > div:nth-child(2) { flex: 1; }
.product-head h4 { font-size: 17px; }
.product-egg { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--amber-soft), #FFE7A8); color: #B07800; }
.product-price { font-size: 18px; }
.product-stock { display: grid; gap: 8px; }
.ps-top { display: flex; justify-content: space-between; align-items: baseline; }
.ps-top span { color: var(--muted); font-weight: 600; font-size: 13px; }
.ps-top b { font-size: 26px; }
.ps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ps-grid div { background: var(--cream); border-radius: 10px; padding: 7px 8px; display: grid; }
.ps-grid span { font-size: 11px; color: var(--muted); font-weight: 600; }
.ps-grid b { font-size: 15px; }
.product-actions { display: flex; gap: 8px; }
.product-actions .btn { flex: 1; }

/* ---------- Detalle (cajón lateral) ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(36, 31, 53, .42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0 } }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { width: min(520px, 100vw); height: 100vh; background: var(--cream); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .3s var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 22px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 22px; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: grid; gap: 14px; align-content: start; }
.drawer-foot { padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.detail-status { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-block { background: var(--paper); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.detail-block.flush { padding: 14px 0 0; }
.detail-block.flush .detail-title { padding: 0 16px 6px; }
.detail-title { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; margin-bottom: 4px; }
.lines { display: grid; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); }
.line:first-child { border-top: 0; }
.line.sep { border-top: 1px solid var(--line); margin-top: 4px; }
.line.total { font-weight: 800; font-size: 17px; }
.note, .quote { background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; margin-top: 8px; font-size: 14px; }
.quote { margin: 0; }
.chat { display: grid; gap: 8px; max-height: 380px; overflow-y: auto; padding: 4px; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; display: grid; gap: 3px; }
.msg p { white-space: pre-wrap; }
.msg small { font-size: 11px; opacity: .6; }
.msg.in { background: var(--gray-soft); justify-self: start; border-bottom-left-radius: 4px; }
.msg.out { background: var(--amber-soft); justify-self: end; border-bottom-right-radius: 4px; }

/* ---------- Ventana modal ---------- */
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); background: var(--paper); border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .25s var(--ease); }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0 } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 8px; }
.modal-head h3 { font-size: 19px; font-weight: 800; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); }
.diff { display: grid; gap: 8px; }
.diff-row { display: flex; align-items: center; gap: 10px; background: var(--cream); padding: 10px 12px; border-radius: 10px; }
.diff-row span { flex: 1; font-weight: 600; color: var(--ink-3); }
.diff-row s { color: var(--muted); }
.warn, .info { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.warn { background: var(--red-soft); color: #A8302A; }
.info { background: var(--blue-soft); color: #2B5291; }

/* ---------- Estados vacíos, errores, avisos ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 34px 20px; text-align: center; color: var(--ink-3); }
.empty-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--amber-soft); color: #B07800; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 340px; font-size: 14px; }
.error-box { display: flex; align-items: center; gap: 10px; background: var(--red-soft); color: #A8302A; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.error-box span { flex: 1; }
.skeleton-wrap { display: grid; gap: 10px; width: 100%; }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, #F3ECE0, #FBF6EE, #F3ECE0); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0 } }
.toaster { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; max-width: 380px; animation: pop .25s var(--ease); }
.toast.ok .ico { color: var(--amber); }
.toast.error { background: #8E2822; }

/* ---------- Navegación móvil ---------- */
.bottom-nav { display: none; }
.sheet-menu { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; animation: up .3s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.sheet-grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); justify-self: center; margin-bottom: 6px; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--cream); font-weight: 700; }
.sheet-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--amber); color: var(--ink); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 40px 28px 34px; min-height: 0; }
  .login-art p { font-size: 16px; }
  .login-logo { width: 96px; height: 96px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { padding: calc(12px + env(safe-area-inset-top)) 0 10px; }
  .topbar-brand { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 18px; font-weight: 800; }
  .topbar-brand img { width: 36px; height: 36px; border-radius: 50%; }
  .page-title { display: none; }
  .hero { padding: 22px 20px; border-radius: 20px; }
  .hero-logo { width: 64px; height: 64px; right: 14px; top: 14px; }
  .hero-txt { padding-right: 64px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi-icon { width: 36px; height: 36px; border-radius: 11px; }
  .kpi-value { font-size: 20px; }
  .kpis.three { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .row-item { padding: 13px 14px; gap: 10px; }
  .ri-id { min-width: 44px; padding: 7px; }
  .card-head { padding: 16px 16px 2px; }
  .card-body { padding: 12px 16px 16px; }
  .input.auto { flex: 1; min-width: 0; }
  .search { min-width: 100%; }
  .toolbar.end .btn { flex: 1; }
  .drawer { width: 100vw; }
  .overlay:not(.drawer-overlay) { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; animation: up .3s var(--ease); }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  .toaster { left: 14px; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50; background: rgba(36, 31, 53, .96); backdrop-filter: blur(10px); border-radius: 22px; padding: 6px; box-shadow: var(--shadow-lg); }
  .bn { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 16px; color: #B9B3CA; font-size: 11px; font-weight: 700; transition: background .2s, color .2s; }
  .bn.on { background: var(--amber); color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================== v2: cuenta, roles y entregas ===================== */
.pass { position: relative; display: flex; }
.pass .input { padding-right: 46px; }
.pass .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.center-link { justify-content: center; background: none; border: 0; padding: 4px; }
.me { border: 0; background: none; color: inherit; width: 100%; text-align: left; border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0; }
.me:hover { background: rgba(255, 255, 255, .04); }
.me .ico { color: #A9A3BB; }
.only-mobile { display: none !important; }
.me-card { display: flex; gap: 12px; align-items: center; background: var(--cream); border-radius: 14px; padding: 12px; }
.me-card > div:last-child { display: grid; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); margin-top: 6px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.btn.big { padding: 15px 20px; font-size: 16px; border-radius: 14px; }
.btn.back { justify-self: start; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.neg.small, .small.neg { font-size: 13px; }
.info.m, .warn.m { margin: 10px 16px 0; }

.origen { display: flex; gap: 8px; margin-bottom: 12px; }
.origen .input { flex: 1; }
.small-sw { font-size: 14px; }
.small-sw span { transform: scale(.85); }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.planner { align-items: start; }
.planner > .stack:last-child { position: sticky; top: 84px; }

.paradas { list-style: none; margin: 0; padding: 4px 0; }
.parada { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); transition: background .15s; }
.parada:first-child { border-top: 0; }
.parada .num { width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--ink); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; font-size: 14px; }
.parada.entregado .num { background: var(--green); color: #fff; }
.parada.no_entregado .num { background: var(--red); color: #fff; }
.parada.entregado, .parada.no_entregado { opacity: .62; }
.parada.actual { background: #FFF8E6; }
.parada.actual .num { box-shadow: 0 0 0 4px rgba(247, 176, 22, .3); }
.mini-actions { display: flex; gap: 2px; }
.mini-actions .icon-btn { width: 32px; height: 32px; font-size: 12px; }
.mini-actions .icon-btn:disabled { opacity: .3; }
.add-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex-shrink: 0; }

.mapa { width: 100%; border-radius: 0 0 var(--radius) var(--radius); z-index: 0; background: #EAE6DF; }
.pin-wrap { background: none; border: 0; }
.pin { --c: var(--amber); width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 13px/1 'Plus Jakarta Sans', sans-serif; box-shadow: 0 4px 10px -2px rgba(36, 31, 53, .55); border: 2.5px solid #fff; margin: 2px; }
.pin.origen { --c: var(--ink); border-radius: 9px; }
.pin.ok { --c: var(--green); }
.pin.no { --c: var(--red); }
.pin.actual { width: 34px; height: 34px; margin: 0; box-shadow: 0 0 0 6px rgba(123, 92, 196, .3), 0 4px 10px -2px rgba(36, 31, 53, .55); }
.pin.truck { width: 34px; height: 34px; margin: 0; font-size: 17px; background: #fff; border-color: var(--c); border-width: 3px; }
.pin.yo { --c: #1A73E8; width: 20px; height: 20px; margin: 7px; box-shadow: 0 0 0 7px rgba(26, 115, 232, .22); }
.leaflet-div-icon { background: none; border: 0; }

.carga { display: grid; gap: 8px; }
.carga-item { display: flex; align-items: center; gap: 10px; background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.carga-item span:nth-child(2) { flex: 1; font-weight: 600; }
.carga-item b { font-size: 20px; }
.progreso { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.progreso .meter { flex: 1; }
.line-r { display: flex; gap: 6px; align-items: center; }

/* Vista del repartidor */
.ruta-view { max-width: 760px; }
.ruta-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: 22px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); }
.ruta-head h2 { font-size: 24px; font-weight: 800; margin: 2px 0 4px; }
.ruta-head .hero-kicker { color: var(--amber); opacity: 1; }
.ruta-head > div > span:last-child { color: #C9C4D9; font-size: 14px; }
.ruta-ring { --p: 0; width: 78px; height: 78px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), rgba(255, 255, 255, .12) 0); position: relative; }
.ruta-ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--ink); }
.ruta-ring b { position: relative; font-size: 18px; }
.start-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--violet-soft); border-radius: 18px; padding: 16px 18px; }
.start-box > div { display: grid; gap: 2px; }
.parada-actual { background: var(--paper); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-lg); border: 2px solid var(--amber); display: grid; gap: 14px; animation: rise .35s var(--ease); }
.pa-top { display: flex; align-items: center; gap: 14px; }
.pa-top > div { flex: 1; }
.pa-top h3 { font-size: 22px; font-weight: 800; }
.pa-num { width: 46px; height: 46px; border-radius: 14px; background: var(--amber); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.pa-dir { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.pa-dir > div { display: grid; }
.pa-dir .ico { color: var(--red); margin-top: 2px; }
.pa-nota { display: flex; gap: 8px; background: var(--amber-soft); padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.pa-items { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--cream); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 14px; }
.chip b { font-size: 16px; margin-right: 2px; }
.pa-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.pa-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fin-ruta { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 34px 20px; background: var(--paper); border-radius: 22px; box-shadow: var(--shadow); }
.fin-ruta h3 { font-size: 22px; }
.empty-ico.big { width: 72px; height: 72px; border-radius: 22px; background: var(--green-soft); color: var(--green); }
.radio-list { display: grid; gap: 8px; }
.radio { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.radio.on { border-color: var(--red); background: var(--red-soft); }
.radio input { accent-color: var(--red); width: 18px; height: 18px; }
.foto-input { display: grid; place-items: center; min-height: 130px; border: 2px dashed var(--line); border-radius: 16px; background: var(--cream); cursor: pointer; overflow: hidden; color: var(--ink-3); font-weight: 600; }
.foto-input span { display: grid; justify-items: center; gap: 6px; }
.foto-input img { width: 100%; max-height: 260px; object-fit: cover; }
.foto-input input { display: none; }

@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .planner > .stack:last-child { position: static; }
  .rol-repartidor .main { padding-bottom: 24px; }
  .ruta-head { padding: 18px; }
  .parada-actual { padding: 16px; }
  .pa-top h3 { font-size: 19px; }
  .origen { flex-wrap: wrap; }
  .origen .btn { flex: 1; }
}

/* v3: contraseñas */
.pass-ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--gray-soft); color: var(--ink-3); font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.pass-ver:hover { background: var(--line); color: var(--ink); }
.pass .input { padding-right: 76px; }
.reglas { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.reglas li { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.reglas li .ico { color: var(--red); }
.reglas li.ok { color: var(--green); }
.reglas li.ok .ico { color: var(--green); }
.me-card .small { font-size: 12.5px; }
@media (max-width: 480px) { .reglas { grid-template-columns: 1fr; } }

/* ===================== v4: entregas en vivo, huella y móvil ===================== */
.dir { display: flex; gap: 8px; align-items: flex-start; }
.dir .ico { color: var(--red); margin-top: 2px; flex-shrink: 0; }
.dir > div { display: grid; gap: 2px; min-width: 0; }
.dir b { font-size: 15px; line-height: 1.3; }
.dir span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.dir.grande b { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.dir.grande span { font-size: 15px; }
.pa-dirbox { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; background: var(--cream); border-radius: 16px; padding: 14px; }
.dir-main { font-size: 15px; line-height: 1.3; display: block; }
.dir-sub { display: block; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.ri-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.warn-t { color: #B26B00; font-weight: 700; }
.links-row { display: flex; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.note-line { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.plan-top { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; }
.sticky-col { position: sticky; top: 84px; align-self: start; }
.action-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 10px; background: rgba(36, 31, 53, .97); color: #fff; border-radius: 18px; padding: 10px 10px 10px 18px; box-shadow: var(--shadow-lg); margin-top: 6px; }
.ab-info { flex: 1; display: grid; min-width: 0; }
.ab-info span { color: #C9C4D9; font-size: 13px; }
.action-bar .btn:not(.violet) { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--green); font-weight: 700; }
.live-dot .ico { animation: pulso 1.6s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: .35; } }
.vivo { align-items: start; }
.rep-card { --c: var(--blue); background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; border-left: 5px solid var(--c); }
.rep-card header { display: flex; align-items: center; gap: 12px; }
.rep-avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.rep-info { flex: 1; display: grid; min-width: 0; }
.rep-info b { font-size: 16px; }
.rep-info span { font-size: 13px; color: var(--muted); }
.rep-prog { height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.rep-prog > div { height: 100%; background: var(--c); border-radius: 99px; transition: width .5s var(--ease); }
.rep-actual { display: grid; gap: 2px; background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.rep-actual .hero-kicker { color: var(--c); opacity: 1; }
.rep-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.rep-meta span { display: inline-flex; align-items: center; gap: 4px; }
.rep-det summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink-3); padding: 4px 0; }
.paradas.compacta .parada { padding: 9px 4px; gap: 10px; }
.paradas.compacta .num { width: 26px; height: 26px; font-size: 12px; }
.rep-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.leyenda i.ok { background: var(--green); }
.leyenda i.no { background: var(--red); }
.center { text-align: center; }
.start-box { display: grid; gap: 12px; background: var(--violet-soft); border: 1.5px solid rgba(123, 92, 196, .25); }
.sb-txt { display: grid; gap: 2px; }
.sb-txt b { font-size: 17px; }
.sb-txt span { font-size: 14px; color: var(--ink-3); }
.entrega-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(36, 31, 53, .3); }
.entrega-bar .btn { min-height: 54px; font-size: 16px; border-radius: 14px; }
.ruta-view.con-barra { padding-bottom: 90px; }
.conf-head { display: grid; gap: 2px; }
@media (min-width: 861px) { .entrega-bar { left: auto; right: 24px; bottom: 20px; width: 460px; border-radius: 18px; border: 1px solid var(--line); } }

/* Huella */
.login.lock .login-card { gap: 14px; }
.finger-btn { border: 0; background: none; display: grid; justify-items: center; gap: 10px; padding: 10px; margin: 6px auto; font-weight: 800; font-size: 16px; color: var(--ink); cursor: pointer; }
.finger-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: #9A6A00; box-shadow: 0 0 0 10px rgba(247, 176, 22, .12); transition: transform .2s var(--ease); }
.finger-btn:active .finger-ico { transform: scale(.94); }
.oferta-bio { display: flex; align-items: center; gap: 12px; background: var(--amber-soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; }
.oferta-bio > div { flex: 1; display: grid; }
.oferta-bio span { font-size: 13px; color: var(--ink-3); }
.avatar-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.avatar.sm { width: 38px; height: 38px; font-size: 16px; box-shadow: var(--shadow); }

@media (max-width: 860px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
  .icon-btn { width: 42px; height: 42px; }
  .mini-actions .icon-btn { width: 40px; height: 40px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn, .modal-foot > * { width: 100%; }
  .plan-top { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .action-bar { bottom: calc(84px + env(safe-area-inset-bottom)); flex-wrap: wrap; padding: 12px; }
  .action-bar .ab-info { flex-basis: 100%; }
  .action-bar .btn { flex: 1; }
  .rep-btns .btn { flex: 1; }
  .pa-nav { grid-template-columns: 1fr 1fr; }
  .pa-nav .btn.primary { grid-column: 1 / -1; min-height: 52px; font-size: 16px; }
  .dir.grande b { font-size: 18px; }
  .rol-repartidor .toaster { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .row-item.wrap { flex-wrap: wrap; }
  .row-item.wrap .row-btns { width: 100%; }
  .row-item.wrap .row-btns .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===================== v5: rutas automáticas y planeación del repartidor ===================== */
.btn-ordenar { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 0; cursor: pointer; padding: 16px 18px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #7B5CC4 0%, #3E6FB6 100%); box-shadow: 0 12px 26px -12px rgba(62, 111, 182, .9); transition: transform .15s var(--ease), box-shadow .2s, opacity .2s; }
.btn-ordenar:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(62, 111, 182, 1); }
.btn-ordenar:active { transform: scale(.985); }
.btn-ordenar:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ordenar .bo-ico { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex-shrink: 0; }
.btn-ordenar .bo-txt { display: grid; gap: 2px; }
.btn-ordenar b { font-size: 17px; font-weight: 800; }
.btn-ordenar small { font-size: 12.5px; opacity: .85; font-weight: 600; }
.btn-ordenar .spin { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.bo-wrap { padding-bottom: 4px; }
.puntos { display: grid; gap: 14px; }
.punto { display: flex; gap: 12px; align-items: flex-start; }
.punto-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; }
.punto-ico.ini { background: var(--ink); color: #fff; }
.punto-ico.fin { background: var(--red-soft); color: var(--red); }
.punto-body { flex: 1; display: grid; gap: 8px; min-width: 0; }
.punto-body > label:first-child { font-size: 13px; font-weight: 800; color: var(--ink-3); }
.punto-body .origen { margin-bottom: 0; }
.rep-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 12px 0; }
.rep-chip { display: flex; align-items: center; gap: 10px; text-align: left; border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.rep-chip > span:last-child { display: grid; }
.rep-chip small { font-size: 12px; color: var(--muted); }
.rep-chip .rc-check { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--gray-soft); color: var(--ink-3); flex-shrink: 0; }
.rep-chip.on { border-color: var(--violet); background: var(--violet-soft); }
.rep-chip.on .rc-check { background: var(--violet); color: #fff; }
.rep-chip:disabled { opacity: .5; cursor: not-allowed; }
.auto-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.auto-res { display: grid; gap: 8px; margin-top: 12px; }
.auto-res > div { display: flex; flex-wrap: wrap; gap: 4px 12px; background: var(--cream); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.preparar { display: grid; gap: 12px; }
.paso { background: var(--paper); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; border: 1.5px solid transparent; }
.paso.activo { border-color: rgba(123, 92, 196, .25); }
.paso.hecho { background: var(--green-soft); }
.paso.bloqueado { opacity: .75; }
.paso-head { display: flex; gap: 12px; align-items: center; }
.paso-head > div { display: grid; }
.paso-head b { font-size: 17px; }
.paso-head span:not(.paso-num) { font-size: 13.5px; color: var(--ink-3); }
.paso-num { width: 32px; height: 32px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.paso.hecho .paso-num { background: var(--green); }
.paso-ok { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; color: var(--green); }
.checklist { display: grid; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.check-item input { display: none; }
.check-item .ci-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.check-item.on { border-color: var(--green); background: var(--green-soft); }
.check-item.on .ci-box { background: var(--green); border-color: var(--green); color: #fff; }
.check-item .ci-txt { flex: 1; font-weight: 600; }
.check-item b { font-size: 20px; }
@media (max-width: 860px) {
  .btn-ordenar { padding: 14px; }
  .btn-ordenar b { font-size: 16px; }
  .rep-chips { grid-template-columns: 1fr; }
  .auto-pie .btn { width: 100%; }
}
.checklist.pad { padding: 12px; }
.check-item .ci-txt .dir-main { font-weight: 800; }
.paso-head .paso-act { margin-left: auto; }
.ab-info.dark span { color: var(--ink-3); }
.paquetes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.paquete { --c: var(--blue); border: 1.5px solid var(--line); border-top: 5px solid var(--c); border-radius: 18px; padding: 14px; display: grid; gap: 10px; background: var(--paper); align-content: start; }
.paquete header { display: flex; align-items: center; gap: 10px; }
.paquete header > div { flex: 1; display: grid; }
.paquete header span:not(.rep-avatar) { font-size: 13px; color: var(--muted); }
.paquete .rep-avatar { width: 36px; height: 36px; font-size: 15px; border-radius: 11px; }
.paquete .link { justify-self: start; }
.paquete .parada { padding: 8px 0; }
.input.mini { width: auto; padding: 6px 8px; font-size: 13px; border-radius: 9px; }
@media (max-width: 860px) { .paquetes { grid-template-columns: 1fr; } .input.mini { font-size: 16px; } }
.ruta-item.destacada { background: var(--amber-soft); }
.pa-items.mini { margin-top: 6px; }
.pa-items.mini .chip { padding: 3px 9px; font-size: 12.5px; }
.pa-items.mini .chip b { font-size: 13px; }
