/* =============================================================================
   DinePilot — owner console
   ============================================================================= */
:root { --bg: #f5f2ed; --card: #fff; --ink: #1c1511; --mut: #6f655d; --line: #ebe5dd; --acc: #e0702e; --acc-soft: #fdf0e7; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --side: #16110e; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Manrope', system-ui, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.serif { font-family: 'Fraunces', Georgia, serif; }
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #d9cfc6; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; text-decoration: none; color: #fff; }
.side .brand .mk { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--acc), #f5a623); display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.side .brand b { display: block; font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; }
.side .brand small { display: block; font-size: .7rem; color: #9c8f84; letter-spacing: .06em; }
.side h6 { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: #7d7067; margin: 16px 10px 6px; }
.side a.nv { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: .9rem; transition: background .15s; }
.side a.nv i { font-size: 1.05rem; color: #a2948a; }
.side a.nv:hover { background: rgba(255, 255, 255, .06); }
.side a.nv.on { background: rgba(224, 112, 46, .18); color: #fff; } .side a.nv.on i { color: var(--acc); }
.side a.nv .ct { margin-left: auto; background: var(--acc); color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.side .foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.side .foot .av { width: 34px; height: 34px; border-radius: 50%; background: #3a2d25; display: grid; place-items: center; font-weight: 800; color: #fff; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: rgba(245, 242, 237, .9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar h1 { font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.topbar .sub { color: var(--mut); font-size: .86rem; }
.topbar .acts { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu-tg { display: none; }
.content { padding: 28px 32px 60px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: .88rem; text-decoration: none; white-space: nowrap; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.pri { background: var(--ink); color: #fff; }
.btn.acc { background: var(--acc); color: #fff; }
.btn.gh { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.wa { background: #1faa59; color: #fff; }
.btn.sm { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: 1fr 1fr; } .g21 { grid-template-columns: 2fr 1fr; } .g12 { grid-template-columns: 1fr 2fr; }
.card { background: var(--card); border-radius: 20px; padding: 22px; box-shadow: 0 0 0 1px var(--line); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-h h3 i { color: var(--acc); }
.card-h small { color: var(--mut); font-weight: 600; }
.kpi { position: relative; overflow: hidden; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); font-size: 1.15rem; }
.kpi b { display: block; font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 600; margin-top: 14px; letter-spacing: -.02em; }
.kpi span { color: var(--mut); font-size: .84rem; font-weight: 600; }
.kpi .tr { position: absolute; top: 22px; right: 22px; font-size: .76rem; font-weight: 800; color: var(--ok); background: #e8f7ee; padding: 4px 9px; border-radius: 999px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid #f3eee8; vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fbf8f4; }
.tbl-wrap { overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; background: #f1ece6; color: var(--ink); }
.chip.ok { background: #e8f7ee; color: #15803d; } .chip.warn { background: #fef3e2; color: #b45309; } .chip.bad { background: #fde8e8; color: #b91c1c; }
.chip.acc { background: var(--acc-soft); color: #c2410c; } .chip.blue { background: #e8f0fe; color: #1d4ed8; } .chip.vio { background: #f1ebfe; color: #6d28d9; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: inline-grid; place-items: center; font-weight: 800; font-size: .78rem; flex: none; }
.who { display: flex; align-items: center; gap: 10px; } .who b { display: block; font-size: .9rem; } .who small { color: var(--mut); font-size: .76rem; }
.mut { color: var(--mut); }
.bar-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: .86rem; }
.bar-row > span:first-child { width: 150px; flex: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar { flex: 1; height: 10px; border-radius: 999px; background: #f1ece6; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--acc), #f5a623); }
.bar-row b { width: 46px; text-align: right; }
.chart svg { width: 100%; height: auto; display: block; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f3eee8; }
.feed-item:last-child { border: 0; }
.feed-item .fi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 1rem; }
.feed-item b { font-size: .88rem; } .feed-item p { margin: 2px 0 0; font-size: .82rem; color: var(--mut); }
.inp, select.inp, textarea.inp { width: 100%; border: 0; background: #faf8f5; border-radius: 12px; padding: 11px 13px; font: inherit; font-size: .9rem; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); outline: 0; }
.inp:focus { box-shadow: inset 0 0 0 1.5px var(--acc); }
label.lb { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); margin: 14px 0 6px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--mut); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--acc); }
.tg { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #d8d0c7; border: 0; transition: background .2s; flex: none; }
.tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.tg.on { background: var(--ok); } .tg.on::after { left: 21px; }
.empty { text-align: center; color: var(--mut); padding: 40px 10px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 14px; font-weight: 700; font-size: .88rem; z-index: 100; opacity: 0; transition: all .3s; pointer-events: none; display: flex; gap: 10px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); display: inline-block; animation: pl 1.6s infinite; }
@keyframes pl { 50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } }
.demo-note { background: #1c1511; color: #e7ded5; border-radius: 16px; padding: 14px 18px; font-size: .84rem; display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.demo-note i { color: #f5a623; font-size: 1.1rem; }
.demo-note a { color: #f5a623; font-weight: 700; }
/* floor plan in console */
.floor svg { width: 100%; height: auto; display: block; }
.tb .shape { fill: #f1ece6; stroke: #e2d9ce; stroke-width: 2; }
.tb.free .shape { fill: #e8f7ee; stroke: #22c55e; }
.tb.taken .shape { fill: #fde9dc; stroke: var(--acc); }
.tb.nofit .shape { fill: #f1ece6; stroke: #e2d9ce; }
.tb.pick .shape { fill: var(--acc); stroke: var(--acc); } .tb.pick text { fill: #fff; }
.tb text { font: 700 13px 'Manrope', sans-serif; fill: var(--ink); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.tb { cursor: pointer; }
.zone-lbl { font: 800 11px 'Manrope', sans-serif; letter-spacing: .14em; fill: var(--mut); }
:root { --line-svg: #e2d9ce; }
.floor svg line { stroke: #e2d9ce; }
/* chat transcript */
.conv-list { max-height: 640px; overflow-y: auto; }
.conv { display: flex; gap: 12px; padding: 12px; border-radius: 14px; cursor: pointer; }
.conv:hover, .conv.on { background: #faf6f1; }
.conv b { font-size: .88rem; display: block; } .conv p { margin: 2px 0 4px; font-size: .8rem; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.tr-feed { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; padding: 4px; }
.bub { max-width: 80%; padding: 10px 13px; border-radius: 16px; font-size: .86rem; line-height: 1.45; }
.bub.guest { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.bub.bot { background: #f5f0ea; align-self: flex-start; border-bottom-left-radius: 5px; }
/* phone preview */
.wa-phone { background: #0b141a; border-radius: 30px; padding: 10px; max-width: 320px; margin: 0 auto; }
.wa-phone .scr { background: #efeae2; border-radius: 22px; overflow: hidden; }
.wa-phone .hd { background: #075e54; color: #fff; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: .86rem; }
.wa-phone .hd .av { background: #fff; color: #075e54; }
.wa-phone .bd { padding: 16px 12px 22px; min-height: 260px; }
.wa-msg { background: #fff; border-radius: 10px 10px 10px 2px; padding: 10px 12px 18px; font-size: .84rem; line-height: 1.5; position: relative; max-width: 92%; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); white-space: pre-wrap; }
.wa-msg small { position: absolute; right: 8px; bottom: 4px; font-size: .64rem; color: #8696a0; }
/* menu manager */
.mrow { display: grid; grid-template-columns: 56px 1fr 110px 120px 120px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f3eee8; }
.mrow img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.mrow b { display: block; font-size: .92rem; } .mrow small { color: var(--mut); font-size: .76rem; }
.mrow .price input { width: 90px; }
.mrow.so { opacity: .55; }
@media (max-width: 1200px) { .g4 { grid-template-columns: 1fr 1fr; } .g21, .g12 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .3s; }
    .nav-open .side { transform: none; }
    .menu-tg { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 1.2rem; }
    .topbar { padding: 14px 16px; } .content { padding: 18px 16px 50px; }
    .g3, .g2 { grid-template-columns: 1fr; }
    .topbar .acts .btn span { display: none; }
    .mrow { grid-template-columns: 48px 1fr 90px; } .mrow .so-t, .mrow .sp-t { grid-column: 2 / -1; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } .topbar .sub { display: none; } }
@media (max-width: 560px) { .topbar { gap: 10px; } .topbar .acts .chip { display: none; } .topbar h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .topbar > div:nth-child(2) { min-width: 0; flex: 1; } }
/* dish editor (Menu & specials) */
.mrow { grid-template-columns: 56px 1fr 110px 120px 130px 84px; }
.mrow .acts { display: flex; gap: 6px; justify-content: flex-end; }
.ico-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); display: inline-grid; place-items: center; color: var(--ink); }
.ico-btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.ico-btn.del:hover { color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 14, 10, .45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--bg); z-index: 61; transform: translateX(104%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .5); }
.sheet-open .sheet { transform: none; } .sheet-open .sheet-bg { opacity: 1; pointer-events: auto; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.sheet-h h2 { margin: 0; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.4rem; }
.sheet-b { flex: 1; overflow-y: auto; padding: 8px 24px 24px; display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; }
.sheet-f { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--card); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: .82rem; color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; box-shadow: none; }
.photo-lib { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px; }
.photo-lib button { border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #eee; box-shadow: 0 0 0 2px transparent; }
.photo-lib button.on { box-shadow: 0 0 0 3px var(--acc); }
.photo-lib img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-card { position: sticky; top: 10px; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); margin-top: 22px; }
.pv-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #f1ece6; }
.pv-card .b { padding: 14px; }
.pv-card b { display: block; font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 600; }
.pv-card p { margin: 6px 0 10px; font-size: .82rem; color: var(--mut); line-height: 1.45; }
.pv-card .pr { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.err { color: var(--bad); font-size: .8rem; font-weight: 700; margin-top: 6px; }
@media (max-width: 900px) { .mrow { grid-template-columns: 48px 1fr 84px; } .mrow .so-t, .mrow .sp-t { grid-column: 2 / 3; } .mrow .acts { grid-column: 3; grid-row: 2 / 4; flex-direction: column; } .sheet-b { grid-template-columns: 1fr; } .pv-card { position: static; } .photo-lib { grid-template-columns: repeat(4, 1fr); } }
