:root {
  --rose: #9d5566; --rose-deep: #7c3f4f; --ink: #4a2630; --muted: #8f6f77; --blush: #f6e3e7; --blush-2: #fbeff1;
  --cream: #fffaf7; --line: #eed9de; --ok: #25a35a; --danger: #c0392b; --ifood: #ea1d2c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Quicksand", system-ui, sans-serif; background: var(--cream); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .2s, filter .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--rose); color: #fff; }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--rose-deep); }
.btn.add { background: var(--blush); color: var(--rose-deep); width: 100%; justify-content: center; padding: 14px; margin-top: 12px; border: 2px dashed #e4bcc6; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: #fdecea; color: var(--danger); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 80% at 50% 0%, #b56a7b 0%, var(--rose) 50%, var(--rose-deep) 100%); }
.login-card { background: #fff; border-radius: 28px; padding: 32px 26px; width: min(360px, 100%); text-align: center; display: grid; gap: 12px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
.login-card img { margin: 0 auto; border-radius: 50%; }
.login-card h1 { font-family: "Great Vibes", cursive; font-weight: 400; color: var(--rose); font-size: 2.4rem; margin: 0; }
.login-card input { padding: 12px 16px; border-radius: 999px; border: 2px solid var(--line); outline: none; text-align: center; }
.login-card input:focus { border-color: var(--rose); }
.err { color: var(--danger); margin: 0; min-height: 1.2em; font-size: .9rem; }

.bar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(255,250,247,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.bar-title img { border-radius: 50%; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dirty { color: #c77d00; font-size: .85rem; font-weight: 600; }
.who { color: var(--muted); font-size: .8rem; font-weight: 600; }

.tabs { display: flex; gap: 6px; padding: 12px 16px 0; overflow-x: auto; max-width: 900px; margin: 0 auto; }
.tab { border: 0; background: transparent; padding: 10px 14px; border-radius: 12px 12px 0 0; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.active { background: #fff; color: var(--rose); box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line); }
main { max-width: 900px; margin: 0 auto; padding: 0 16px 80px; }
.hint { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 12px; }
.panel h3 { margin-top: 0; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.field { display: grid; gap: 4px; margin-bottom: 12px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream); outline: none; font-weight: 500; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose); background: #fff; }
.field small { font-weight: 500; }
.fields-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .fields-2 { grid-template-columns: 1fr 1fr; } .fields-3 { grid-template-columns: 90px 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--rose); }

.cat { background: #fff; border: 1px solid var(--line); border-radius: 18px; margin-top: 12px; overflow: hidden; }
.cat.off { opacity: .6; }
.cat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; }
.cat-head .emo { font-size: 1.6rem; }
.cat-head .name { font-weight: 700; flex: 1; min-width: 0; }
.cat-head .meta { font-size: .8rem; color: var(--muted); font-weight: 600; display: block; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tag.ifood { background: #fde8ea; color: var(--ifood); }
.tag.wa { background: #e3f6ea; color: #1d7d45; }
.mini { display: flex; gap: 4px; }
.mini button { border: 1px solid var(--line); background: #fff; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: .9rem; }
.mini button:hover { background: var(--blush-2); }
.mini button.del:hover { background: #fdecea; color: var(--danger); }
.cat-body { padding: 4px 14px 14px; border-top: 1px dashed var(--line); }
.chev { transition: transform .25s; color: var(--muted); }
.cat.open .chev { transform: rotate(90deg); }

.items-title { font-weight: 700; margin: 14px 0 6px; }
.item { border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; background: var(--cream); }
.item-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.item-head .thumb { width: 42px; height: 42px; border-radius: 10px; background: var(--blush); display: grid; place-items: center; overflow: hidden; flex: none; }
.item-head .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-head .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-head .price { font-size: .85rem; color: var(--muted); font-weight: 600; }
.item-body { padding: 10px 12px 4px; border-top: 1px dashed var(--line); background: #fff; border-radius: 0 0 14px 14px; }
.item.off .name { text-decoration: line-through; color: var(--muted); }

.photo { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.photo .preview { width: 90px; height: 90px; border-radius: 14px; background: var(--blush); overflow: hidden; display: grid; place-items: center; font-size: 2rem; }
.photo .preview img { width: 100%; height: 100%; object-fit: cover; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; opacity: 0; transition: .3s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

@media (max-width: 560px) {
  .item-head { flex-wrap: wrap; }
  .item-head .name { flex: 1 1 calc(100% - 80px); white-space: normal; }
  .item-head .price { margin-left: 62px; flex: 1; }
  .cat-head { flex-wrap: wrap; }
  .cat-head .name { flex: 1 1 calc(100% - 50px); }
  .cat-head .tag { margin-left: 40px; }
  .cat-head .mini { margin-left: auto; }
}
.login-card .btn { justify-content: center; padding: 13px; }

.item-head .thumb { position: relative; cursor: pointer; width: 52px; height: 52px; border: 2px dashed #e4bcc6; }
.item-head .thumb:has(img) { border-style: solid; border-color: transparent; }
.item-head .thumb .cam { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--rose); border: 2px solid #fff;
  display: grid; place-items: center; font-size: .7rem; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.item-head .thumb:hover { filter: brightness(.95); }

.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 1.1rem; opacity: .6; }
.login-card > input { width: 100%; }
