/* Kalymnos Shop — estilo único, mobile-first. Sem dependências; sem estilo inline (CSP). */
:root {
  --brand: #1F6F4A; --ink: #1d2327; --muted: #5d6870; --line: #e2e6e9; --bg: #f6f7f8; --card: #fff;
  --ok: #1e7b45; --ok-bg: #e7f5ec; --warn: #8a5300; --warn-bg: #fff4e0; --danger: #b3261e; --danger-bg: #fdecea;
  --wa: #128C4A; --radius: 12px; --shadow: 0 1px 3px rgba(0,0,0,.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: .2rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
code { background: #eef1f3; padding: .05rem .3rem; border-radius: 4px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ----- formulários ----- */
.field { display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; flex: 1; min-width: 0; }
.field > span { font-weight: 600; font-size: .92rem; }
input, select, textarea { font: inherit; padding: .65rem .75rem; border: 1px solid #c5ccd2; border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; width: 100%; }
input[type=checkbox], input[type=radio] { width: 1.25rem; height: 1.25rem; min-height: 0; accent-color: var(--brand); margin: 0 .4rem 0 0; vertical-align: middle; }
input[type=color] { padding: .2rem; width: 4rem; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: .3rem; margin: .5rem 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; margin: .6rem 0; }
legend { font-weight: 600; padding: 0 .3rem; }
.choice label { display: flex; align-items: center; min-height: 44px; }
.affix { display: flex; align-items: center; gap: .3rem; }
.affix span { color: var(--muted); white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid #c5ccd2; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.block, .block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link, button.link { background: none; border: 0; color: var(--brand); padding: .3rem; font: inherit; cursor: pointer; text-decoration: underline; min-height: 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: .4rem; }
.inline { display: inline; }
.error { color: var(--danger); font-weight: 600; }
.warn { color: var(--warn); }
.flash { padding: .7rem 1rem; border-radius: 10px; margin: .6rem 0; background: #eef1f3; display: block; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin: .8rem 0; }
.card.highlight { border: 2px solid var(--brand); }
.card.danger { border: 2px solid var(--danger); }
.card.subtle { background: transparent; box-shadow: none; border: 1px solid var(--line); }
.card.narrow, .narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.center, .center-page { display: flex; justify-content: center; padding: 1rem; }
.center-page { min-height: 100vh; align-items: center; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: #eef1f3; font-size: .8rem; font-weight: 600; }
.badge.big { font-size: 1rem; padding: .3rem .8rem; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.empty { text-align: center; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.total td { font-weight: 700; }
.table tr.danger td { background: var(--danger-bg); }
.prose p { margin: .6rem 0; }
pre.prose { white-space: pre-wrap; font-family: inherit; }

/* ----- vitrine ----- */
body.store { background: #fff; max-width: 760px; margin: 0 auto; padding-bottom: 6rem; }
.preview-bar { background: var(--warn-bg); color: var(--warn); text-align: center; padding: .4rem; font-size: .9rem; }
.store-head { padding: 0 1rem 1rem; }
.store-head .cover { width: calc(100% + 2rem); margin: 0 -1rem; aspect-ratio: 3 / 1; object-fit: cover; display: block; }
.store-id { display: flex; gap: .8rem; align-items: center; margin-top: .8rem; }
.store-id .logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); }
.status { font-weight: 700; margin: .2rem 0; }
.status.open { color: var(--ok); }
.status.closed { color: var(--danger); }
.status.paused { color: var(--warn); }
.welcome { color: var(--muted); }
.facts { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.facts li { background: #f1f3f4; border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; }
.facts li.warn { background: var(--warn-bg); }
.sections { position: sticky; top: 0; z-index: 5; background: #fff; display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 1rem; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sections a { white-space: nowrap; padding: .4rem .8rem; border-radius: 999px; background: #f1f3f4; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.menu { padding: 0 1rem; }
.search input { margin: .8rem 0; }
.menu-section h2 { margin-top: 1.2rem; }
.items { list-style: none; padding: 0; margin: 0; }
.item-btn { display: flex; width: 100%; gap: .8rem; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: .9rem 0; font: inherit; color: inherit; cursor: pointer; }
.item-btn img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.item-text { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.item-text .desc { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; margin-right: .3rem; }
.item.unavailable { opacity: .55; }
.tag { align-self: flex-start; background: #eef1f3; border-radius: 6px; padding: 0 .4rem; font-size: .8rem; }
.store-foot { margin: 2rem 0; color: var(--muted); font-size: .9rem; }
.hours ul { list-style: none; padding: 0; }
.hours li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .3rem 0; text-transform: capitalize; }
.cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(1rem, env(safe-area-inset-bottom)); width: min(728px, calc(100% - 2rem));
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--brand); color: #fff; border: 0; border-radius: 14px;
  padding: 1rem 1.2rem; font: inherit; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; z-index: 10; }
.cart-bar[hidden] { display: none; }
dialog.sheet { border: 0; padding: 0; width: min(640px, 100%); max-height: 92vh; border-radius: 18px 18px 0 0; margin: auto auto 0; display: none; flex-direction: column; }
dialog.sheet[open] { display: flex; }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; }
.sheet-body { overflow-y: auto; padding: 1rem; flex: 1; }
.sheet-foot { padding: .8rem 1rem; border-top: 1px solid var(--line); }
.close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; }
.item-photo { width: 100%; border-radius: 12px; margin-bottom: .6rem; aspect-ratio: 16 / 9; object-fit: cover; }
.group legend { display: flex; justify-content: space-between; width: 100%; }
.group legend small { color: var(--muted); font-weight: 400; }
.group.pending { border-color: var(--danger); background: var(--danger-bg); }
.option { display: flex; align-items: center; gap: .3rem; min-height: 44px; border-bottom: 1px solid var(--line); }
.option:last-child { border-bottom: 0; }
.option span:nth-of-type(1) { flex: 1; }
.option.off { opacity: .5; }
.delta { color: var(--muted); font-size: .9rem; }
.stepper { display: flex; align-items: center; border: 1px solid #c5ccd2; border-radius: 10px; }
.stepper button { background: none; border: 0; font-size: 1.4rem; min-width: 44px; min-height: 44px; cursor: pointer; }
.qty-n { min-width: 1.8rem; text-align: center; font-weight: 700; }
.add-total { margin-left: auto; }
.cart-lines { list-style: none; padding: 0; margin: 0 0 .6rem; }
.cart-lines li { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.cart-lines li small { display: block; color: var(--muted); }
.totals > div { display: flex; justify-content: space-between; padding: .2rem 0; }
.totals .total, .total { font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .3rem; }
.checkout h3 { margin-top: 1rem; }
.track { padding: 1rem; }
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; }
.steps li { padding: .5rem .8rem; border-left: 4px solid var(--line); color: var(--muted); }
.steps li.done { border-color: var(--ok); color: var(--ink); }
.steps li.current { border-color: var(--brand); color: var(--ink); font-weight: 700; background: #f1f6f3; }
.status-line { font-weight: 600; }
.qr { display: block; margin: .6rem auto; image-rendering: pixelated; background: #fff; }

/* ----- painel e admin ----- */
body.panel { padding-bottom: 5rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #13392a; color: #fff; padding: .6rem 1rem; }
.topbar .brand { color: #fff; font-weight: 800; text-decoration: none; }
.topnav { display: none; gap: .3rem; align-items: center; }
.topnav a, .topnav .link { color: #dfe9e3; text-decoration: none; padding: .4rem .6rem; border-radius: 8px; }
.topnav a.active { background: rgba(255,255,255,.15); color: #fff; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem 0; font-size: .75rem; color: var(--muted); text-decoration: none; min-height: 52px; }
.bottomnav a span { font-size: 1.2rem; }
.bottomnav a.active { color: var(--brand); font-weight: 700; }
.page { max-width: 1100px; margin: 0 auto; padding: .6rem 1rem; }
.page.wide { max-width: 1400px; }
.board-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; align-items: center; }
.board-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.menu-pop { position: relative; }
.menu-pop > summary { list-style: none; cursor: pointer; }
.menu-pop > summary::-webkit-details-marker { display: none; }
.menu-pop .pop { position: absolute; right: 0; z-index: 30; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.15); border-radius: 12px; padding: .7rem; min-width: 250px; }
.menu-pop .pop .btn { margin: .2rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0; }
.chips button { min-height: 40px; padding: .4rem .8rem; border-radius: 999px; border: 1px solid #c5ccd2; background: #fff; font: inherit; cursor: pointer; }
.chips.big button { min-height: 52px; min-width: 76px; font-weight: 700; }
.chips button.selected { border-color: var(--brand); background: #e8f2ec; }
.alert-banner { position: sticky; top: 0; z-index: 25; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #c62828; color: #fff;
  padding: .8rem 1rem; border-radius: 12px; margin: .6rem 0; animation: pulse 1s ease-in-out infinite alternate; }
.alert-banner[hidden] { display: none; }
@keyframes pulse { from { opacity: 1; } to { opacity: .82; } }
@media (prefers-reduced-motion: reduce) { .alert-banner { animation: none; } }
.board { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: .6rem; }
.col { background: #eceff1; border-radius: var(--radius); padding: .6rem; min-height: 4rem; }
.col h2 { font-size: 1rem; display: flex; gap: .4rem; }
.col .count { background: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .85rem; }
.order-card { background: #fff; border-radius: 10px; padding: .7rem; margin-bottom: .6rem; box-shadow: var(--shadow); border-left: 5px solid transparent; }
.order-card.new { border-left-color: #c62828; }
.order-card.flagged { border-left-color: #e08a00; }
.order-card header { display: flex; align-items: center; gap: .5rem; }
.order-card .code { font-size: 1.25rem; font-weight: 800; text-decoration: none; color: var(--ink); }
.order-card .time { color: var(--muted); font-size: .85rem; }
.order-card .badge { margin-left: auto; }
.order-card p { margin: .25rem 0; font-size: .92rem; }
.flags { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.flags li { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 0 .4rem; font-size: .8rem; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.actions .btn { flex: 1; min-width: 7rem; }
.done-list { margin: 1rem 0; }
.done-list .order-card { opacity: .75; }
.timeline { list-style: none; padding: 0; }
.timeline li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: .85rem; margin-right: .4rem; }
.note { background: var(--warn-bg); padding: .4rem .6rem; border-radius: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; margin: .8rem 0; }
.tiles a { display: flex; flex-direction: column; gap: .2rem; background: #fff; border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); min-height: 64px; }
.tiles a small { color: var(--muted); font-weight: 400; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li a { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.list li a small { color: var(--muted); }
.list li.selected { background: #f1f6f3; }
.list li.draft { opacity: .6; }
.list li img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.list li.dragging { opacity: .4; }
.handle { cursor: grab; color: var(--muted); padding: 0 .3rem; user-select: none; }
.switch { display: flex; align-items: center; gap: .2rem; font-size: .85rem; white-space: nowrap; }
.thumbs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); }
.advanced { margin: .8rem 0; }
.advanced > summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.options-table input { min-width: 6rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.filters .field { flex: 1 1 160px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: .8rem 0; }
.kpi { background: #fff; border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi strong { font-size: 1.35rem; }
.kpi small { color: var(--muted); }
.ranking { padding-left: 1.2rem; }
.ranking li { display: flex; justify-content: space-between; gap: .6rem; padding: .25rem 0; }
.bars { list-style: none; padding: 0; }
.bars li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .5rem; align-items: center; padding: .2rem 0; font-size: .85rem; }
.bar { display: block; height: .8rem; background: var(--brand); border-radius: 4px; }
.w0 { width: 0; } .w1 { width: 5%; } .w2 { width: 10%; } .w3 { width: 15%; } .w4 { width: 20%; } .w5 { width: 25%; } .w6 { width: 30%; } .w7 { width: 35%; }
.w8 { width: 40%; } .w9 { width: 45%; } .w10 { width: 50%; } .w11 { width: 55%; } .w12 { width: 60%; } .w13 { width: 65%; } .w14 { width: 70%; }
.w15 { width: 75%; } .w16 { width: 80%; } .w17 { width: 85%; } .w18 { width: 90%; } .w19 { width: 95%; } .w20 { width: 100%; }
.progress { height: .6rem; background: var(--line); border-radius: 999px; overflow: hidden; margin: .6rem 0; }
.progress span { display: block; height: 100%; background: var(--brand); }
.p0 { width: 0; } .p20 { width: 20%; } .p40 { width: 40%; } .p60 { width: 60%; } .p80 { width: 80%; } .p100 { width: 100%; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.checklist li.done a { color: var(--muted); }
.day { display: flex; flex-direction: column; gap: .3rem; }
.day legend { text-transform: capitalize; }
.day .range input { width: auto; flex: 1; }
.big-link { font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.manual { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.pick { list-style: none; padding: 0; max-height: 60vh; overflow-y: auto; }
.pick-btn { display: flex; justify-content: space-between; width: 100%; padding: .7rem; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; cursor: pointer; text-align: left; min-height: 44px; }
.ticket { max-width: 80mm; margin: 0 auto; padding: .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; background: #fff; }
.ticket h1 { font-size: 2rem; text-align: center; }
.ticket p { margin: .15rem 0; }
.indent { padding-left: 1rem; }
@media print { .no-print { display: none !important; } body { background: #fff; } }

@media (min-width: 760px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  body.panel { padding-bottom: 1rem; }
  .board { grid-template-columns: repeat(4, 1fr); }
  .grid2, .manual { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  dialog.sheet { border-radius: 18px; margin: auto; }
}
