.adm {
  --purple: #401473; --purple-900: #1a0833; --magenta: #b606e3; --magenta-600: #9c05c4;
  --bg: #f5f2f9; --panel: #ffffff; --ink: #1d1030; --ink-2: #5d5070; --line: #e4dcee;
  --ok: #138a52; --ok-bg: #e3f6ec; --warn: #9a6100; --warn-bg: #fff2d6; --bad: #b3261e; --bad-bg: #fde8e7;
  --font: 'Montserrat', system-ui, sans-serif; --r: 12px;
}
.adm, .adm * { box-sizing: border-box; }
.adm { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
.adm [hidden] { display: none !important; }
.adm h1, .adm h2 { margin: 0; letter-spacing: -0.02em; }
.adm h1 { font-size: 26px; font-weight: 800; }
.adm h2 { font-size: 18px; font-weight: 700; }
.adm .muted { color: var(--ink-2); font-size: 14px; margin: 0; }
.adm .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.adm :focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.adm code { background: #efe8f7; padding: 1px 6px; border-radius: 6px; }
.adm .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 0; font: 700 14px var(--font); cursor: pointer; text-decoration: none; transition: background-color .2s, transform .15s; white-space: nowrap; }
.adm .btn:active { transform: scale(.97); }
.adm .btn--primary { background: var(--magenta); color: #fff; }
.adm .btn--primary:hover { background: var(--magenta-600); }
.adm .btn--primary:disabled { opacity: .6; cursor: progress; }
.adm .btn--ghost { background: #ece4f5; color: var(--purple); }
.adm .btn--ghost:hover { background: #e0d3ef; }
.adm .btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.adm .btn--danger { background: var(--bad-bg); color: var(--bad); }
.adm .link { background: none; border: 0; padding: 4px 0; color: var(--magenta-600); font: 600 14px var(--font); cursor: pointer; text-decoration: underline; }
.adm .icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #ece4f5; color: var(--purple); font-size: 22px; cursor: pointer; }
.adm input, .adm select, .adm textarea { width: 100%; font: 500 15px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.adm textarea { resize: vertical; min-height: 64px; }
.adm input:focus, .adm select:focus, .adm textarea:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(182, 6, 227, .15); }
.adm label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.adm .check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.adm .check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--magenta); }
.adm .form-msg { margin: 0; font-size: 14px; font-weight: 600; color: var(--bad); min-height: 1em; }
.adm .form-msg.ok { color: var(--ok); }
.adm .auth { min-height: 100svh; display: grid; place-items: center; padding: 16px; background: var(--purple-900); }
.adm .auth__card { width: min(400px, 100%); background: #fff; border-radius: 20px; padding: 36px 32px; display: grid; gap: 16px; }
.adm .auth__card img { border-radius: 50%; }
.adm .app { display: grid; grid-template-columns: 240px 1fr; min-height: 100svh; }
.adm .side { background: var(--purple-900); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100svh; }
.adm .side__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; }
.adm .side__brand img { border-radius: 50%; }
.adm .side__nav { display: grid; gap: 4px; }
.adm .side__nav button { text-align: left; background: none; border: 0; color: rgba(255,255,255,.75); font: 600 15px var(--font); padding: 11px 14px; border-radius: 10px; cursor: pointer; }
.adm .side__nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.adm .side__nav button[aria-current="page"] { background: var(--magenta); color: #fff; }
.adm .side__foot { margin-top: auto; display: grid; gap: 8px; }
.adm .side__foot .muted { color: rgba(255,255,255,.6); font-size: 13px; word-break: break-all; }
.adm .main { padding: 28px clamp(16px, 3vw, 40px) 64px; min-width: 0; }
.adm .tab__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.adm .banner-warn { background: var(--warn-bg); color: var(--warn); padding: 12px 16px; border-radius: var(--r); font-weight: 600; margin: 0 0 20px; }
.adm .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.adm .toolbar input { max-width: 320px; }
.adm .toolbar select { max-width: 220px; }
.adm .seg { display: inline-flex; background: #ece4f5; border-radius: 999px; padding: 4px; flex-wrap: wrap; }
.adm .seg button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font: 600 14px var(--font); color: var(--purple); cursor: pointer; }
.adm .seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.adm .stats { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.adm .table-wrap { background: var(--panel); border-radius: 16px; overflow-x: auto; border: 1px solid var(--line); }
.adm .table { width: 100%; border-collapse: collapse; min-width: 860px; }
.adm .table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf8fc; }
.adm .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm .table tr:last-child td { border-bottom: 0; }
.adm .table tr.is-sold td:first-child { opacity: .6; }
.adm .prod { display: flex; align-items: center; gap: 12px; }
.adm .prod img, .adm .prod .noimg { width: 52px; height: 52px; border-radius: 10px; object-fit: contain; background: #f3eef8; flex: none; }
.adm .prod .noimg { display: grid; place-items: center; color: #b9a8cc; font-weight: 800; }
.adm .prod b { display: block; }
.adm .prod small { color: var(--ink-2); }
.adm .table select { min-height: 36px; padding: 4px 8px; width: auto; font-size: 14px; }
.adm .sel-disponivel { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.adm .sel-reservado, .adm .sel-encomenda { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.adm .sel-vendido { background: #eee; color: #555; border-color: transparent; }
.adm .switch { appearance: none; width: 42px; height: 24px; min-height: 0; padding: 0; border-radius: 99px; background: #d9cfe6; border: 0; position: relative; cursor: pointer; transition: background .2s; }
.adm .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.adm .switch:checked { background: var(--magenta); }
.adm .switch:checked::after { transform: translateX(18px); }
.adm .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.adm .empty { padding: 40px; text-align: center; color: var(--ink-2); }
.adm .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.adm .cardx { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.adm .cardx img { width: 100%; aspect-ratio: 16/10; object-fit: contain; background: #f3eef8; border-radius: 10px; }
.adm .cards--photos .cardx img { aspect-ratio: 4/5; object-fit: cover; }
.adm .cardx .row-actions { justify-content: flex-start; flex-wrap: wrap; }
.adm .pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); }
.adm .pill--off { background: #eee; color: #666; }
.adm .settings { display: grid; gap: 18px; }
.adm .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 14px; }
.adm .panel.narrow { max-width: 460px; }
.adm .panel h2 { margin-bottom: 4px; }
.adm .panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm .panel .full { grid-column: 1 / -1; }
.adm .img-setting { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.adm .img-setting img { width: 120px; height: 120px; object-fit: contain; background: #2a0d4d; border-radius: 12px; }
.adm .dlg { border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100% - 24px)); max-height: calc(100svh - 24px); }
.adm .dlg::backdrop { background: rgba(26, 8, 51, .6); }
.adm .dlg form { display: flex; flex-direction: column; max-height: calc(100svh - 24px); }
.adm .dlg__head, .adm .dlg__foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; }
.adm .dlg__head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.adm .dlg__foot { border-top: 1px solid var(--line); justify-content: flex-end; flex-wrap: wrap; }
.adm .dlg__foot .form-msg { margin-right: auto; }
.adm .dlg__body { padding: 20px 22px; overflow-y: auto; }
.adm .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; align-content: start; }
.adm .span-2 { grid-column: 1 / -1; }
.adm .checks { display: flex; gap: 24px; flex-wrap: wrap; }
.adm .photo-field { display: flex; gap: 16px; align-items: center; }
.adm .photo-field > div:last-child { display: grid; gap: 6px; justify-items: start; }
.adm .photo-prev { width: 120px; height: 120px; border-radius: 14px; background: #f3eef8; display: grid; place-items: center; overflow: hidden; color: var(--ink-2); font-size: 13px; flex: none; }
.adm .photo-prev img { width: 100%; height: 100%; object-fit: contain; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--purple-900); color: #fff; padding: 12px 20px; border-radius: 99px; font-weight: 600; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }
@media (max-width: 860px) {
.adm .app { grid-template-columns: 1fr; }
.adm .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
.adm .side__nav { display: flex; overflow-x: auto; order: 3; width: 100%; }
.adm .side__nav button { white-space: nowrap; }
.adm .side__foot { margin: 0 0 0 auto; display: flex; align-items: center; }
.adm .side__foot .muted { display: none; }
.adm .form-grid, .adm .panel .grid2 { grid-template-columns: 1fr; }
.adm .toolbar input, .adm .toolbar select { max-width: none; }
}

/* ---------- Painel como camada sobre o site ---------- */
.adm { position: fixed; inset: 0; z-index: 200; overflow: auto; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); color-scheme: light;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.adm .app { min-height: 100%; }
.adm .side { height: 100%; min-height: 100svh; }
.adm-open { overflow: hidden; }
.edit-fab { position: fixed; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px;
  background: #fff; color: #401473; font: 700 14px 'Montserrat', system-ui, sans-serif; cursor: pointer; box-shadow: 0 12px 30px -10px rgba(0,0,0,.55); }
.edit-fab:hover { background: #f4effa; }
.adm .save-state { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); }
.adm .save-state.is-busy { color: #ffd27a; }
.adm .save-state.is-err { color: #ff9b94; }
.adm .note { background: #ece4f5; color: #2a0d4d; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin: 0 0 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: #1a0833; color: #fff; padding: 12px 20px; border-radius: 99px; font: 600 15px 'Montserrat', system-ui, sans-serif; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 300; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b3261e; }
.adm .btn { text-transform: none; letter-spacing: 0; }

/* ---------- Painel no celular ---------- */
@media (max-width: 860px) {
  .adm .app { grid-template-columns: minmax(0, 1fr); }
  .adm .side, .adm .main { min-width: 0; }
  .adm .side { position: sticky; top: 0; z-index: 5; height: auto; min-height: 0; padding: 12px 16px; gap: 10px; }
  .adm .side__brand { font-size: 16px; }
  .adm .side__foot { order: 2; width: 100%; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .adm .side__foot .save-state { flex: 1 1 100%; margin: 0; }
  .adm .side__foot .btn { flex: 1 1 0; min-width: 0; }
  .adm .side__nav { order: 3; width: 100%; min-width: 0; padding-bottom: 2px; }
  .adm .main { padding: 18px 16px 48px; }
  .adm .tab__head .btn { width: 100%; }
  .adm .dlg { width: calc(100% - 16px); }
  .adm .photo-field { flex-wrap: wrap; }
}
