/* Centro de pedidos: hoja blanca sobre el azul rey del logo, con separadores de colores a la derecha. */
.shell { display: grid; grid-template-columns: minmax(0, 1fr) 188px; min-height: calc(100vh - 44px); padding: 20px 0 20px 20px; align-items: start; }
.binder { --cur: var(--electrico); min-height: calc(100vh - 84px); padding: 0 30px 40px 58px; border-right: 6px solid var(--cur); box-shadow: 0 2px 0 var(--rey-hondo), 0 18px 40px -24px rgb(0 0 0 / .32); min-width: 0; }
.binder.is-hinge { animation: hinge 180ms steps(2, end); }
@keyframes hinge { from { border-right-width: 0; } }
.binder__head { display: flex; align-items: center; gap: 16px; padding: 18px 0 14px; border-bottom: 2px solid var(--ink); }
.binder__logo { height: 54px; width: auto; border-radius: 6px; display: block; }
.binder__who { min-width: 0; }
.binder__who b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.binder__who span { font-size: 12.5px; color: var(--muted); }
.binder__head .btn { margin-left: auto; }

/* separadores */
.tabs { display: flex; flex-direction: column; gap: 3px; padding-top: 26px; position: sticky; top: 64px; }
.tabs a { --tx: #fff; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 16px 10px 18px; background: var(--t); color: var(--tx); text-decoration: none; font-weight: 800; font-size: 14px; line-height: 1.2; border-radius: 0 8px 8px 0; margin-right: 18px; transition: margin .12s steps(2, end); box-shadow: 0 2px 0 rgb(0 0 0 / .18); }
.tabs a:nth-child(2) { min-height: 76px; } .tabs a:nth-child(4) { min-height: 72px; } .tabs a:nth-child(6) { min-height: 80px; }
.tabs a:hover { margin-right: 8px; }
.tabs a[aria-current="page"] { background: #fff; color: var(--ink); margin-right: 0; margin-left: -6px; padding-left: 24px; box-shadow: 0 2px 0 var(--rey-hondo); }
.tabs a[aria-current="page"] span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--t); margin-right: 8px; vertical-align: 0; }
.tabs i { font: 600 11.5px var(--sans); font-style: normal; opacity: .85; }
.tabs i:empty { display: none; }
.tabs i::after { content: " por atender"; }

.main { padding: 20px 0 0; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.top h1 { font-size: 30px; }
.top p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.filt { display: flex; gap: 6px; flex-wrap: wrap; }
.filt button { border: 1.5px solid var(--ink); background: #fff; padding: 5px 13px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--ink); }
.filt button:hover { background: var(--fog); }
.filt button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* cifras del día, en una regla de tinta */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 20px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.kpi { padding: 12px 14px 12px 0; }
.kpi + .kpi { padding-left: 14px; border-left: 1px solid var(--line2); }
.kpi b { display: block; font: 700 24px/1.15 var(--mono); letter-spacing: -.05em; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi--warn b { color: #D42430; }

/* tablero */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; scroll-snap-type: x mandatory; }
.lane { scroll-snap-align: start; }
@media (min-width: 1100px) { .board { grid-auto-columns: calc((100% - 3 * 14px) / 4); } }
.board-nav { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.board-nav span { margin-right: auto; }
@media (max-width: 600px) { .board-nav span { display: none; } .board-nav { justify-content: flex-end; } }
.lane { min-height: 200px; }
.lane h2 { font: 800 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; display: flex; justify-content: space-between; align-items: center; padding: 0 0 8px; margin-bottom: 10px; border-bottom: 3px solid var(--lc, var(--ink)); }
.lane h2 span { font-family: var(--mono); color: var(--muted); }
[data-st="confirmado"] { --lc: var(--electrico); } [data-st="porfacturar"] { --lc: var(--amarillo); } [data-st="facturado"] { --lc: var(--morado); }
[data-st="alistamiento"] { --lc: var(--cian); } [data-st="listo"] { --lc: var(--rey-hondo); } [data-st="enruta"] { --lc: var(--rosa); } [data-st="entregado"] { --lc: var(--verde); } .lane--nov { --lc: var(--rojo); }
.cards { display: grid; gap: 10px; }
.card { background: #fff; border: 1.5px solid var(--line); border-radius: 5px; padding: 11px 12px; cursor: pointer; text-align: left; width: 100%; display: block; transition: border-color .12s; }
.card:hover { border-color: var(--ink); }
.card.is-new { border-color: var(--amarillo); box-shadow: 0 0 0 2px var(--amarillo); }
.lane--nov .card { background: #FFF1F3; border-color: #F6C2CB; }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card__id { font: 700 14px var(--mono); letter-spacing: -.03em; }
.card__cl { display: block; font-weight: 700; margin-top: 6px; line-height: 1.3; }
.card__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card__meta b { margin-left: auto; color: var(--ink); font-family: var(--mono); font-size: 12.5px; letter-spacing: -.03em; }
.card__note { font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 7px; }
.card__act { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.empty { font-size: 12.5px; color: var(--muted); padding: 8px 0; }

/* tablas */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font: 800 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr.row-link { cursor: pointer; }
.tbl tr.row-link:hover td, .tbl tbody tr:hover td { background: #F7F9FC; }
.tbl th.num { text-align: right; }
.tbl td.num { text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; letter-spacing: -.03em; }
.tbl td.mono { font-family: var(--mono); font-size: 12px; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .nw { white-space: nowrap; }
.xprev td { white-space: nowrap; }
.xprev td.w-desc { min-width: 220px; white-space: normal; } .xprev td.w-cli { min-width: 160px; white-space: normal; } .xprev td.w-dir { min-width: 200px; white-space: normal; }
.box h3 small.sans { font: 600 13px var(--sans); }
.big .u { font: 700 .6em var(--sans); letter-spacing: 0; margin-left: .15em; }
.tbl input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); }
.tblwrap { overflow-x: auto; border-top: 2px solid var(--ink); }
.tblwrap .tbl th { border-bottom-width: 1px; }
.sec { margin-top: 30px; }
.sec__h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sec__h h2 { font-size: 19px; }
.sec__h p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.note { background: var(--fog); border: 1px solid var(--line); padding: 11px 14px; border-radius: 5px; color: var(--muted); font-size: 13px; }
.note b { color: var(--ink); }
.thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; overflow: hidden; display: block; }

/* conversaciones */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: 1.5px solid var(--ink); border-radius: 6px; height: calc(100vh - 250px); min-height: 500px; overflow: hidden; }
.inbox__list { border-right: 1.5px solid var(--ink); overflow-y: auto; background: #fff; }
.inbox__tabs { display: flex; gap: 5px; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.inbox__tabs button { border: 1.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.inbox__tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.conv { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line2); background: #fff; padding: 12px; }
.conv:hover { background: var(--fog); }
.conv[aria-current="true"] { background: #FFF0F6; box-shadow: inset 0 0 0 1.5px var(--rosa); }
.conv__top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conv__top b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv__top small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.conv p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.conv__tags { display: flex; gap: 10px; margin-top: 6px; align-items: center; }
.tag--wait { color: #C4202A; } .tag--wait::before { display: block; background: var(--rojo); border-radius: 50%; }
.tag--human { color: var(--morado); } .tag--human::before { display: block; background: var(--morado); border-radius: 50%; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #fff; }
.thread__head b { font-size: 16px; font-weight: 800; }
.thread__head span { font-size: 12.5px; color: var(--muted); }
.thread__orders { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--fog); font-size: 12.5px; align-items: center; }
.thread .wa__body { flex: 1; }
.thread__in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.thread__in input { flex: 1; border: 1.5px solid var(--line); border-radius: 5px; padding: 9px 12px; min-width: 0; }
.thread__in input:focus { border-color: var(--ink); outline: none; }
.thread__lock { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; }
.msg__who--ia { color: var(--rey); }

/* facturación y despacho */
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.box { border-top: 3px solid var(--bc, var(--ink)); padding: 12px 0 0; }
.cols3 .box:nth-child(1) { --bc: var(--morado); } .cols3 .box:nth-child(2) { --bc: var(--amarillo); } .cols3 .box:nth-child(3) { --bc: var(--rojo); }
.grid2 .box { border: 1.5px solid var(--line); border-top: 3px solid var(--bc, var(--ink)); border-radius: 0; padding: 14px 16px 16px; }
.box h3 { font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.box h3 small { font: 700 13px var(--mono); color: var(--muted); }
.box > p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.mini { display: grid; gap: 8px; margin-top: 12px; }
.mini__it { border: 1.5px solid var(--line); border-radius: 5px; padding: 10px 11px; font-size: 13px; background: #fff; }
.mini__it b { font-weight: 800; }
.mini__it .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mini__it small { color: var(--muted); }
.mini__it select, .d-act select { border: 1.5px solid var(--line); border-radius: 5px; padding: 4px 6px; font-size: 12.5px; background: #fff; }
.route { display: grid; gap: 0; margin: 10px 0 0; padding: 0; }
.route li { list-style: none; display: grid; grid-template-columns: 76px 1fr auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line2); font-size: 12.5px; align-items: center; }

/* estados: píldora sólida en un color del logo */
.st { font: 800 11.5px var(--sans); padding: 3px 9px; border-radius: 4px; background: var(--fog); color: var(--ink); white-space: nowrap; display: inline-block; }
.st--recibido, .st--confirmado { background: var(--electrico); color: #fff; }
.st--porfacturar { background: var(--amarillo); color: var(--ink); }
.st--facturado { background: var(--morado); color: #fff; }
.st--alistamiento { background: var(--cian); color: #fff; }
.st--listo { background: var(--rey-hondo); color: #fff; }
.st--enruta { background: var(--rosa); color: #fff; }
.st--entregado { background: var(--verde); color: #fff; }
.st--novedad { background: var(--rojo); color: #fff; }

/* indicadores */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bars { display: grid; gap: 10px; margin-top: 12px; }
.bar { display: grid; grid-template-columns: 110px 1fr 160px; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; }
.bar__t { height: 14px; background: var(--fog); border-radius: 2px; overflow: hidden; }
.bar__t i { display: block; height: 100%; }
.bar b { text-align: right; font-family: var(--mono); font-size: 12px; letter-spacing: -.03em; }
.box .big { font: 700 34px/1.1 var(--mono); color: var(--ink); letter-spacing: -.05em; margin-top: 10px; }
.box .big + p { color: var(--muted); font-size: 13px; }

/* cajón de detalle: una hoja que entra desde los separadores */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__bg { position: absolute; inset: 0; background: rgb(14 30 70 / .45); }
.drawer__in { position: absolute; right: 0; top: 0; bottom: 0; width: min(540px, 100%); background: #fff; overflow-y: auto; padding: 24px 26px 30px 30px; box-shadow: -24px 0 40px -24px rgb(0 0 0 / .45); border-left: 6px solid var(--electrico); animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { translate: 24px 0; opacity: .4; } }
.drawer__x { position: absolute; right: 14px; top: 14px; }
.d-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.d-h h2 { font: 700 24px var(--mono); letter-spacing: -.05em; margin-right: 4px; }
.d-sec { margin-top: 20px; }
.d-sec h3 { font: 800 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.d-grid { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13.5px; }
.d-grid dt { color: var(--muted); } .d-grid dd { margin: 0; font-weight: 600; }
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 0 0 12px 22px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 2px; background: var(--rey); }
.tl li:not(:last-child)::after { content: ""; position: absolute; left: 4.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.tl li small { color: var(--muted); }
.proof { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.proof img { max-width: 220px; max-height: 130px; border: 1.5px solid var(--line); border-radius: 5px; background: #fff; }
.d-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--ink); align-items: center; }

@media (max-width: 1240px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi:nth-child(4) { padding-left: 0; border-left: 0; } .kpis .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line2); } .cols3 { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0; align-content: start; }
  .tabs { order: -1; flex-direction: row; overflow-x: auto; padding: 10px 10px 0; gap: 4px; position: static; scrollbar-width: none; }
  .tabs a, .tabs a:nth-child(n) { min-height: 0; margin: 0; padding: 9px 14px; border-radius: 7px 7px 0 0; white-space: nowrap; flex: none; box-shadow: none; }
  .tabs a:hover { margin: 0; }
  .tabs a[aria-current="page"] { margin: 0; padding-left: 14px; box-shadow: none; }
  .tabs i::after { content: ""; }
  .tabs i { display: none; }
  .binder { padding: 0 16px 32px 16px; border-right: 0; border-top: 6px solid var(--cur); min-height: 0; box-shadow: none; }
  .binder.is-hinge { animation: none; }
  .holes { display: none; }
  .binder__head { flex-wrap: wrap; gap: 10px; }
  .binder__logo { height: 42px; }
  .binder__who span { display: none; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox__list { max-height: 280px; border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .thread .wa__body { min-height: 380px; }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi, .kpi + .kpi { padding: 10px 10px 10px 0; border-left: 0; border-bottom: 1px solid var(--line2); }
  .bar { grid-template-columns: 80px 1fr 90px; }
  .top h1 { font-size: 24px; }
}

.m-cod { display: none; }
@media (max-width: 600px) { .tbl .c-opt { display: none; } .m-cod { display: block; font: 500 11px var(--mono); color: var(--muted); margin-top: 2px; } }

/* despacho: pasos, lista de qué lleva y asignación */
.pasos { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: p; }
.pasos li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-top: 4px solid var(--lc); background: #fff; }
.pasos li > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--lc); color: #fff; font-weight: 800; font-size: 13px; }
.pasos li[data-st="facturado"] > span { color: #fff; }
.pasos b { display: block; font-size: 13.5px; } .pasos small { display: block; font-size: 12px; color: var(--muted); }
.pasos em { font: 700 20px var(--mono); font-style: normal; color: var(--ink); }
.lleva { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; }
.lleva li { display: grid; grid-template-columns: 34px 1fr; gap: 6px; }
.lleva li b { font-family: var(--mono); text-align: right; }
.cuenta { font: 700 14px var(--mono); color: var(--muted); margin-left: 6px; }
.asigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.asig { border: 1.5px solid var(--line); border-top: 4px solid var(--rey-hondo); background: #fff; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.asig header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.asig header small { color: var(--muted); }
.asig h3 { font-size: 17px; }
.asig__dir { font-size: 13px; color: var(--muted); }
.asig__cobro { font-size: 13px; background: #FFF8D6; border-left: 3px solid var(--amarillo); padding: 6px 9px; }
.asig__lleva { border-top: 1px solid var(--line2); padding-top: 8px; font-size: 13px; }
.quien { border: 0; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.quien legend { font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.quien__op { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; border: 1.5px solid var(--line); border-radius: 5px; padding: 9px 10px; cursor: pointer; }
.quien__op:has(input:checked) { border-color: var(--rey); background: #EEF3FC; box-shadow: inset 0 0 0 1px var(--rey); }
.quien__op input { margin-top: 3px; accent-color: var(--rey); width: 16px; height: 16px; }
.quien__op b { display: block; font-size: 13.5px; } .quien__op small { display: block; font-size: 12px; color: var(--muted); }
.quien__op em { display: inline-block; margin-top: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--verde); }
.asig__go { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 6px; }
.asig__go span { font-size: 12px; color: var(--muted); }
.d-act .quien, .d-act .asig__go { width: 100%; }
@media (max-width: 900px) { .pasos { grid-template-columns: 1fr 1fr; } .asigs { grid-template-columns: 1fr; } }
