:root{--brand:#B4441F;--ink:#14161D;--muted:#5B6070;--line:#E6E7EB;--bg:#F5F6F8;--card:#fff;--ok:#12805C;--warn:#B45309;--danger:#D92D20;--side:#14161D}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;font-family:"Inter",system-ui,sans-serif;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
h1,h2{margin:0;font-family:"Space Grotesk","Inter",sans-serif;letter-spacing:-.02em}
h1{font-size:28px}h2{font-size:17px}
p{margin:0}
a{color:var(--brand)}
.muted{color:var(--muted)}.block{display:block}.warn{color:var(--warn);font-weight:600}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
button{font:inherit;cursor:pointer}
.demo-top{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:#12141A;color:#E9EAEE;font-size:13.5px;padding:8px 18px}
.demo-top b{color:#C6F432}
.demo-top-r{display:flex;gap:10px;align-items:center}
.demo-top .lnk{color:#E9EAEE}
.demo-top .cta{background:#C6F432;color:#12141A;text-decoration:none;font-weight:700;padding:7px 14px;border-radius:999px}
.lnk{background:none;border:0;padding:0;color:var(--brand);font-weight:600;text-decoration:underline}

.shell{display:grid;grid-template-columns:248px 1fr;min-height:calc(100vh - 40px)}
.side{background:var(--side);color:#C9CBD3;padding:20px 14px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:calc(100vh - 40px)}
.brand{display:flex;gap:10px;align-items:center;padding:0 6px}
.brand .logo{width:40px;height:40px;border-radius:10px;background:var(--brand);color:#fff;display:grid;place-items:center;font:700 15px "Space Grotesk",sans-serif;flex:none}
.brand b{display:block;color:#fff;font-size:14.5px;line-height:1.2}
.brand small{font-size:12px;opacity:.7}
.side nav{display:flex;flex-direction:column;gap:4px}
.side nav a{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:10px;color:#C9CBD3;text-decoration:none;font-weight:500;font-size:15px}
.side nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.side nav a.on{background:rgba(255,255,255,.1);color:#fff;box-shadow:inset 3px 0 0 var(--brand)}
.side nav a em{margin-left:auto;font-style:normal;background:var(--danger);color:#fff;font-size:12px;font-weight:700;border-radius:999px;padding:1px 8px}
.verweb{margin-top:auto;display:flex;align-items:center;gap:10px;padding:11px 12px;border:1px solid rgba(255,255,255,.15);border-radius:10px;color:#fff;text-decoration:none;font-size:14px}

.main{padding:24px clamp(16px,3vw,36px) 60px;min-width:0}
.top{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.top .muted{text-transform:capitalize;margin-top:2px}
.top-r{display:flex;align-items:center;gap:10px}
.switch-neg select{font:500 14px "Inter",sans-serif;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;min-height:40px}
.bell{position:relative;width:42px;height:42px;border-radius:10px;border:1px solid var(--line);background:#fff;display:grid;place-items:center;color:var(--ink)}
.bell em{position:absolute;top:-6px;right:-6px;font-style:normal;background:var(--danger);color:#fff;font-size:11px;font-weight:700;border-radius:999px;min-width:20px;height:20px;display:grid;place-items:center;padding:0 5px}
.avatar{width:42px;height:42px;border-radius:50%;background:var(--brand);color:#fff;display:grid;place-items:center;font:700 13px "Inter",sans-serif}

.stack{display:flex;flex-direction:column;gap:18px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px}
.card-h{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.card-h a{font-size:14px;font-weight:600;text-decoration:none}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;position:relative;display:flex;flex-direction:column;gap:4px}
.kpi .muted{font-size:13px;font-weight:500}
.kpi strong{font:700 26px "Space Grotesk",sans-serif;letter-spacing:-.02em}
.kpi-ic{position:absolute;right:16px;top:16px;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:color-mix(in srgb,var(--brand) 12%,#fff);color:var(--brand)}
.up{display:inline-flex;align-items:center;gap:4px;color:var(--ok);font-weight:600;font-size:12.5px}
.grid2{display:grid;grid-template-columns:1.6fr 1fr;gap:18px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}

.chart{width:100%;height:auto;display:block}
.chart .gl{stroke:#EEF0F3}
.chart .bar{fill:color-mix(in srgb,var(--brand) 35%,#fff)}
.chart .bar.hoy{fill:var(--brand)}
.chart .bar:hover{fill:var(--brand)}
.chart .lb{font:500 12px "Inter",sans-serif;fill:var(--muted)}
.chart .vl{font:600 11px "Inter",sans-serif;fill:var(--ink)}

.alerts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.alerts li{display:flex;align-items:center;gap:10px;padding:12px;border-radius:12px;background:#F7F8FA;font-size:14px}
.alerts li span{flex:1}
.alerts li a{font-weight:600;font-size:13px;text-decoration:none}
.alerts .a-new{background:#FFF4ED;color:#9A3412}.alerts .a-low{background:#FFFAEB;color:#92400E}

.tbl-box{overflow-x:auto}
.tbl{width:100%;border-collapse:collapse;font-size:14.5px;min-width:640px}
.tbl th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);padding:10px 12px;border-bottom:1px solid var(--line);font-weight:600}
.tbl td{padding:12px;border-bottom:1px solid #F0F1F4;vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl .num{font-weight:600;white-space:nowrap}
.tbl tr.from-web{background:#F6FDE9}
.tag-web{display:inline-block;margin-left:6px;font-size:11px;font-weight:700;background:#C6F432;color:#12141A;padding:2px 7px;border-radius:999px}
.badge{display:inline-block;font-size:12px;font-weight:700;padding:4px 10px;border-radius:999px;white-space:nowrap}
.b-nuevo{background:#FEE4E2;color:#B42318}.b-preparando{background:#FEF0C7;color:#93370D}.b-en-camino{background:#D1E9FF;color:#175CD3}.b-entregado{background:#D1FADF;color:#05603A}
.btn-s{border:1px solid var(--ink);background:var(--ink);color:#fff;border-radius:8px;padding:7px 12px;font-size:13px;font-weight:600;white-space:nowrap}
.btn-p{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;background:var(--brand);color:#fff;border-radius:10px;padding:11px 16px;font-weight:600;min-height:44px}
.btn-o{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:10px;padding:11px 16px;font-weight:600;min-height:44px}
.btn-o.sm{min-height:36px;padding:7px 12px;font-size:13px}
.icon-btn{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:#fff;display:grid;place-items:center}
.empty{padding:28px;text-align:center;color:var(--muted)}
.hint{font-size:13.5px;color:var(--muted);padding-left:4px}
.tabs{display:flex;gap:8px;flex-wrap:wrap}
.tabs button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 14px;font-weight:600;font-size:14px;display:inline-flex;gap:8px;align-items:center}
.tabs button em{font-style:normal;background:#F0F1F4;border-radius:999px;padding:0 7px;font-size:12px}
.tabs button.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.tabs button.on em{background:rgba(255,255,255,.2)}

.drawer-wrap{position:fixed;inset:0;background:rgba(10,12,18,.45);z-index:50;display:flex;justify-content:flex-end}
.drawer{width:min(420px,100vw);height:100%;background:#fff;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:14px;animation:entra .25s ease}
@keyframes entra{from{transform:translateX(30px);opacity:0}}
.timeline{list-style:none;margin:0;padding:0;display:flex;gap:6px}
.timeline li{flex:1;font-size:11.5px;font-weight:600;color:var(--muted);display:flex;flex-direction:column;gap:6px}
.timeline li span{height:6px;border-radius:999px;background:#EEF0F3}
.timeline li.done{color:var(--ink)}.timeline li.done span{background:var(--brand)}
.dl{display:grid;grid-template-columns:110px 1fr;gap:8px 12px;margin:0;font-size:14.5px}
.dl dt{color:var(--muted)}.dl dd{margin:0;font-weight:500}
.items{list-style:none;margin:0;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:8px;font-size:14.5px}
.items li{display:flex;justify-content:space-between;gap:12px}
.tot{display:flex;justify-content:space-between;font-size:18px}.tot b{font-family:"Space Grotesk",sans-serif}
.row-btns{display:flex;flex-direction:column;gap:8px;margin-top:auto}

.add-form .f-row,.card .f-row{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:12px;align-items:end;margin-top:12px}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:var(--muted)}
input{font:400 15px "Inter",sans-serif;padding:10px 12px;border:1px solid #D0D3DA;border-radius:10px;min-height:42px;color:var(--ink);background:#fff;width:100%}
input:focus,select:focus,button:focus-visible,a:focus-visible{outline:3px solid color-mix(in srgb,var(--brand) 40%,transparent);outline-offset:2px}
.tbl.prod input{max-width:120px}
.tbl.prod input.low{border-color:var(--warn);background:#FFFAEB}
.tbl tr.off{opacity:.5}
.pcell{display:flex;gap:12px;align-items:center}
.pcell img,.noimg{width:44px;height:44px;border-radius:10px;object-fit:cover;background:#EEF0F3;flex:none;display:block}
.sw{width:46px;height:26px;border-radius:999px;border:0;background:#D0D3DA;position:relative;padding:0;transition:background .2s}
.sw i{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.sw.on{background:var(--ok)}.sw.on i{transform:translateX(20px)}
.sw.big{width:64px;height:34px}.sw.big i{width:28px;height:28px}.sw.big.on i{transform:translateX(30px)}
.setting{display:flex;justify-content:space-between;align-items:center;gap:20px}
.users{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.users li{display:flex;justify-content:space-between;align-items:center;padding:12px;border:1px solid var(--line);border-radius:12px}

.hbars{list-style:none;margin:14px 0 0;padding:0;display:flex;flex-direction:column;gap:12px}
.hbars li{display:grid;grid-template-columns:1fr auto;gap:4px 10px;font-size:13.5px}
.hb-n{grid-column:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hbars b{grid-column:2;grid-row:1}
.hb-t{grid-column:1 / -1;height:8px;border-radius:999px;background:#EEF0F3;overflow:hidden}
.hb-t i{display:block;height:100%;background:var(--brand);border-radius:999px}

.toasts{position:fixed;right:18px;bottom:18px;z-index:80;display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.toast{display:flex;gap:10px;align-items:center;background:#14161D;color:#fff;padding:12px 16px;border-radius:12px;font-size:14px;box-shadow:0 16px 36px -14px rgba(0,0,0,.6);transform:translateY(20px);opacity:0;transition:.3s;max-width:min(420px,calc(100vw - 36px))}
.toast.on{transform:none;opacity:1}
.toast svg{color:#C6F432;flex:none}.toast.nuevo{background:var(--brand)}.toast.nuevo svg{color:#fff}

@media (max-width:1100px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.grid2,.grid3{grid-template-columns:1fr}}
@media (max-width:820px){
  .shell{grid-template-columns:1fr}
  .side{position:fixed;bottom:0;left:0;right:0;top:auto;height:auto;z-index:40;padding:6px;flex-direction:row;gap:0}
  .side .brand,.side .verweb{display:none}
  .side nav{flex-direction:row;width:100%;justify-content:space-around}
  .side nav a{flex-direction:column;gap:3px;font-size:11px;padding:8px 6px;position:relative}
  .side nav a.on{box-shadow:none}
  .side nav a em{position:absolute;top:2px;right:6px;margin:0;padding:0 6px}
  .main{padding-bottom:90px}
  .add-form .f-row,.card .f-row{grid-template-columns:1fr 1fr}
  .add-form .f-row label:first-child,.card .f-row label:first-child{grid-column:1 / -1}
  h1{font-size:24px}
  .toasts{bottom:84px}
}
@media (prefers-reduced-motion:reduce){.toast,.sw i,.drawer{transition:none;animation:none}}
.dt-corta{display:none}
@media (max-width:640px){
  .dt-larga{display:none}.dt-corta{display:inline}
  .demo-top{flex-wrap:nowrap;padding:8px 12px}
  .kpi strong{font-size:20px}
  .kpis{gap:10px}.kpi{padding:14px}
  .top-r{width:100%}.switch-neg{flex:1}.switch-neg select{width:100%}
  /* Pedidos como tarjetas */
  .tbl:not(.prod){min-width:0}
  .tbl:not(.prod) thead{display:none}
  .tbl:not(.prod) tr{display:grid;grid-template-columns:1fr auto;grid-template-areas:"id total" "cli cli" "est act";gap:6px 10px;padding:14px 0;border-bottom:1px solid #F0F1F4}
  .tbl:not(.prod) td{padding:0;border:0}
  .tbl:not(.prod) td:nth-child(1){grid-area:id}
  .tbl:not(.prod) td:nth-child(2){grid-area:cli}
  .tbl:not(.prod) td:nth-child(3),.tbl:not(.prod) td:nth-child(5){display:none}
  .tbl:not(.prod) td:nth-child(4){grid-area:total;font-size:16px}
  .tbl:not(.prod) td:nth-child(6){grid-area:est;align-self:center}
  .tbl:not(.prod) td:nth-child(7){grid-area:act;justify-self:end}
  .tbl:not(.prod) tr.from-web{padding:14px 10px;margin:0 -10px;border-radius:12px}
  .tbl.prod{min-width:520px}
}
