/* DELIRIOUS PIZZA · panel */
:root { --bg: #f7f3ea; --side: #121110; --card: #fff; --line: #e8e0cf; --txt: #1b1814; --mut: #7d7466; --yel: #ffd43b; --red: #e5372b; --grn: #1faa59; --blu: #3b6cf6; --r: 14px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Outfit', system-ui, sans-serif; background: var(--bg); color: var(--txt); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
.disp { font-family: 'Bebas Neue', Impact, sans-serif; letter-spacing: .02em; font-weight: 400; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: #121110 url('../assets/img/bg-oscuro.webp') center/cover; padding: 16px; }
.login form { background: #fff; border-radius: 24px; padding: 28px; width: min(360px, 100%); text-align: center; display: grid; gap: 12px; }
.login img { width: 140px; margin: 0 auto; }
.login input { height: 52px; border-radius: 12px; border: 2px solid var(--line); text-align: center; font-size: 24px; letter-spacing: .4em; }
.login small { color: var(--mut); }

/* layout */
.app { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; }
.side { background: var(--side); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; position: sticky; top: 0; height: 100vh; }
.side .lg { width: 52px; margin-bottom: 14px; }
.side button { width: 54px; height: 50px; border-radius: 14px; color: #9b927f; display: grid; place-items: center; position: relative; font-size: 21px; transition: .15s; }
.side button span.l { position: absolute; left: 64px; background: #000; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .15s; z-index: 5; }
.side button:hover span.l { opacity: 1; }
.side button.on { background: var(--yel); color: #111; }
.side button:hover:not(.on) { background: #24211e; color: #fff; }
.side .sp { flex: 1; }
.side .dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.side .dot:empty { display: none; }
main { padding: 22px 26px 60px; min-width: 0; }
.hd { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.hd h1 { font-size: 42px; line-height: 1; }
.hd .sp { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { padding: 10px 16px; color: var(--mut); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.on { color: var(--txt); border-color: var(--txt); }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; background: #fff; border: 1.5px solid var(--line); white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: #cfc4ad; }
.btn.dark { background: #121110; color: #fff; border-color: #121110; }
.btn.yel { background: var(--yel); border-color: var(--yel); color: #111; }
.btn.grn { background: var(--grn); border-color: var(--grn); color: #fff; }
.btn.red { color: var(--red); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: #d8cfbd; position: relative; cursor: pointer; transition: .2s; flex: none; }
.switch input::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--grn); }
.switch input:checked::after { left: 21px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi small { color: var(--mut); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font-size: 28px; margin-top: 2px; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: #efe9dc; border-radius: 16px; padding: 10px; min-height: 300px; }
.col h3 { font-size: 14px; display: flex; justify-content: space-between; padding: 4px 6px 10px; }
.col h3 span { background: #fff; border-radius: 99px; padding: 0 8px; font-size: 12px; }
.ped { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); cursor: pointer; transition: .15s; border-left: 4px solid var(--yel); }
.ped:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.ped.nuevo { border-left-color: var(--red); animation: nuevo 1.2s ease 3; }
@keyframes nuevo { 50% { background: #fff1d6; } }
.ped .r1 { display: flex; justify-content: space-between; font-weight: 800; }
.ped .r2 { font-size: 13px; color: var(--mut); margin-top: 2px; }
.ped .it { font-size: 13px; margin-top: 6px; }
.ped .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tg { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #f1ece2; color: #6a604f; }
.tg.ok { background: #dff5e8; color: #157a40; }
.tg.warn { background: #fff0cc; color: #8a6200; }
.tg.bad { background: #fde3e0; color: #b02a20; }
.tg.blu { background: #e3ebff; color: #2849b5; }
.ped .act { margin-top: 10px; display: flex; gap: 6px; }
.ped .act .btn { flex: 1; justify-content: center; }
.timer { font-variant-numeric: tabular-nums; }
.timer.late { color: var(--red); }

/* tablas */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); padding: 10px 12px; background: #fbf8f2; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1ebdf; vertical-align: middle; }
.tbl tr:last-child td { border: 0; }
.tbl input.inl { width: 80px; height: 34px; border: 1.5px solid var(--line); border-radius: 8px; padding: 0 8px; }
.tbl .th { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f1ece2; display: grid; place-items: center; font-size: 22px; }
.wrapt { overflow-x: auto; }
.search { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); padding: 0 12px; min-width: 240px; background: #fff; }

/* chat */
.chatlay { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 170px); min-height: 460px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.convs { border-right: 1px solid var(--line); overflow-y: auto; }
.conv { padding: 12px 14px; border-bottom: 1px solid #f1ebdf; cursor: pointer; }
.conv.on { background: #fff8dc; }
.conv b { display: flex; justify-content: space-between; font-size: 14px; }
.conv p { font-size: 13px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread b::after { content: '●'; color: var(--red); }
.hilo { display: flex; flex-direction: column; min-width: 0; }
.hilo .mm { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #faf7f0; }
.m { max-width: 70%; padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: pre-line; }
.m.cliente { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.m.bot { background: #fff4c2; align-self: flex-end; }
.m.staff { background: #dff5e8; align-self: flex-end; }
.m.sistema { align-self: center; font-size: 12px; color: var(--mut); background: none; }
.m small { display: block; font-size: 10px; color: var(--mut); margin-top: 2px; }
.hilo form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.hilo form input { flex: 1; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); padding: 0 12px; }

/* forms */
.form { display: grid; gap: 12px; }
.f2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fl label { display: block; font-size: 12px; font-weight: 600; color: var(--mut); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.fl input, .fl select, .fl textarea { width: 100%; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); padding: 0 12px; background: #fff; }
.fl textarea { height: auto; padding: 10px 12px; min-height: 90px; resize: vertical; }
.sec-t { font-size: 18px; font-weight: 800; margin: 6px 0 2px; }
.help { font-size: 13px; color: var(--mut); }
.pend { background: #fff0cc; color: #8a6200; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-left: 6px; }

/* drawer */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: none; }
.velo.on { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: #fff; z-index: 51; transform: translateX(105%); transition: transform .3s; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer .dh { padding: 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer .db { padding: 18px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer .df { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.wa-prev { background: #e7f8ee; border-radius: 12px; padding: 12px; font-size: 14px; white-space: pre-line; border: 1px solid #bfe8cf; }
.lin { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }

/* toast */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100% - 36px)); }
.tst { background: #121110; color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; animation: tin .3s ease; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; }
.tst .btn { height: 32px; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars div { flex: 1; background: var(--yel); border-radius: 6px 6px 0 0; position: relative; min-height: 2px; }
.bars div span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--mut); }
.bars div b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; }
.empty { text-align: center; color: var(--mut); padding: 30px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; height: auto; position: fixed; bottom: 0; top: auto; left: 0; right: 0; z-index: 40; padding: 6px; justify-content: space-around; overflow-x: auto; }
  .side .lg, .side .sp, .side span.l { display: none; }
  .side button { width: 44px; height: 44px; flex: none; }
  main { padding: 16px 14px 90px; }
  .hd h1 { font-size: 34px; }
  .chatlay { grid-template-columns: 1fr; height: auto; }
  .convs { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hilo .mm { min-height: 320px; }
  .kanban { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
}

/* ajustes: columnas tipo mosaico, sin huecos */
.cfg { columns: 3 360px; column-gap: 16px; }
.cfg > .card { break-inside: avoid; margin-bottom: 16px; width: 100%; }
.cfg .f2 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.cfg .hor { display: grid; grid-template-columns: 86px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cfg .hor input[type=time] { width: 100%; min-width: 0; padding: 0 8px; }

/* centro de avisos de pedidos (estilo Menüpp) */
#avisos { position: fixed; top: 74px; right: 18px; z-index: 90; width: min(400px, calc(100% - 32px)); display: grid; gap: 10px; }
#avisos:empty { display: none; }
.av-banner { position: fixed; left: 96px; bottom: 18px; max-width: min(520px, calc(100% - 112px)); display: flex; align-items: center; gap: 8px; background: #121110; color: #fff; border-radius: 14px; padding: 10px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.av-banner span { flex: 1; }
.av-banner .btn.ghost { background: transparent; color: #cfc6b4; border-color: #3a3530; }
.av-panel { background: #ecebe8; border-radius: 22px; padding: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.22); animation: avIn .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes avIn { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.av-hd { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; }
.av-hd b { display: block; font-size: 17px; }
.av-hd small { color: var(--mut); font-size: 14px; }
.av-ic { width: 52px; height: 52px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 26px; flex: none; animation: avRing 1.2s ease-in-out infinite; }
@keyframes avRing { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .av-ic, .av-panel { animation: none; } }
.av-b { width: 34px; height: 34px; border-radius: 10px; color: #6a604f; font-size: 15px; font-weight: 700; }
.av-b:hover { background: #fff; }
.av-list { display: grid; gap: 10px; max-height: calc(100vh - 160px); overflow-y: auto; overflow-x: hidden; padding: 8px 8px 2px 0; }
.av-panel.pleg .av-list { display: none; }
.av-card { position: relative; background: #fff; border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.av-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); font-size: 12px; color: #6a604f; }
.av-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.av-t { font-size: 17px; flex: 1; }
.av-t small { color: var(--mut); font-weight: 600; font-size: 13px; }
.av-chip { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; }
.av-chip.ok { background: #5ccf8a; color: #0b3b1e; }
.av-chip.warn { background: #fff0cc; color: #8a6200; }
.av-chip.bad { background: #fde3e0; color: #b02a20; }
.av-r > span:first-child { flex: 1; }
.av-m { color: #a49b8b; }
.av-m2 { color: #3c362e; }
.av-tot { font-size: 15px; }
.av-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.av-acc .btn { justify-content: center; height: 40px; }
@media (max-width: 760px) { .av-banner { left: 16px; bottom: 84px; max-width: calc(100% - 32px); } }
.av-card > .av-r:first-of-type { padding-right: 30px; }
.av-food { font-size: 20px; }
.av-ic { font-size: 22px; letter-spacing: -2px; }

/* arrastrar pedidos */
.kanban .ped { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.ped-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; margin: 0; cursor: grabbing; box-shadow: 0 24px 50px rgba(0,0,0,.25); opacity: .96; }
.ped-orig { opacity: .35; }
body.arrastrando, body.arrastrando * { cursor: grabbing !important; }
.col { transition: background .15s, box-shadow .15s; }
.col.drop-on { background: #fff6cf; box-shadow: inset 0 0 0 2px var(--yel); }
