/* ULLA FITNESS — painel das proprietárias */
body { background: #F7F1F4; }
.a-top {
  position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--ameixa); color: var(--nevoa);
}
.a-top-in { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 16px; max-width: 1100px; margin: 0 auto; }
.a-top img { height: 30px; width: auto; }
.a-top .a-title { font-weight: 700; color: var(--nevoa-2); font-size: 15px; }
.a-top .a-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.a-top a, .a-top button.link { color: var(--nevoa); background: none; border: 0; font-weight: 600; font-size: 14px; padding: 8px; text-decoration: none; }

.a-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px calc(110px + env(safe-area-inset-bottom, 0px)); }
.a-h1 { margin: 0 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.a-lead { margin: 0 0 20px; color: var(--tinta-2); }

/* Abas (rodapé no celular, topo no computador) */
.a-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--branco); border-top: 1px solid var(--malva-2);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.a-tabs button { min-height: 62px; border: 0; background: none; font-weight: 700; font-size: 13px; color: var(--tinta-2); display: grid; place-items: center; gap: 2px; padding: 8px 4px; position: relative; }
.a-tabs button[aria-selected="true"] { color: var(--ameixa); }
.a-tabs button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ameixa); }
.a-tabs .badge-n { position: absolute; top: 8px; right: calc(50% - 26px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--lima); color: var(--ameixa); font-size: 11px; line-height: 18px; padding: 0 5px; }
@media (min-width: 900px) {
  .a-tabs { position: sticky; top: 60px; bottom: auto; max-width: 1100px; margin: 0 auto; grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px; padding: 0 16px; background: #F7F1F4; border: 0; border-bottom: 1px solid var(--malva-2); }
  .a-tabs button { min-height: 52px; font-size: 15px; padding: 0 14px; }
  .a-tabs button[aria-selected="true"]::before { top: auto; bottom: -1px; left: 14px; right: 14px; border-radius: 3px 3px 0 0; }
  .a-main { padding-bottom: 60px; }
}

/* Login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: var(--ameixa); }
.login-card { width: min(400px, 100%); background: var(--branco); border-radius: 22px; padding: 28px; display: grid; gap: 16px; }
.login-card .logo-box { background: var(--ameixa); border-radius: 14px; padding: 18px; display: grid; place-items: center; }
.login-card .logo-box img { height: 64px; width: auto; }
.login-card h1 { margin: 0; font-size: 22px; }
.msg { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; }
.msg.err { background: #fbe9e8; color: var(--erro); }
.msg.ok { background: #e7f4ec; color: var(--ok); }
.msg.info { background: var(--malva); color: var(--tinta); }
code { font-size: 13px; background: var(--malva); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* Barra de ferramentas */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .input { flex: 1 1 200px; min-height: 44px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--malva-2); background: var(--branco); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--ameixa); border-color: var(--ameixa); color: var(--nevoa); }

/* Lista de produtos */
.plist { display: grid; gap: 10px; }
.prow { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; background: var(--branco); border-radius: var(--r-md); border: 1px solid var(--malva-2); }
.prow img, .prow .ph { width: 64px; height: 80px; border-radius: 10px; object-fit: cover; background: var(--malva); }
.prow-name { margin: 0; font-weight: 700; font-size: 16px; line-height: 1.25; }
.prow-meta { margin: 2px 0 0; font-size: 13px; color: var(--tinta-2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); background: var(--malva); }
.pill.off { background: #ececec; color: #555; }
.pill.out { background: var(--ameixa); color: var(--nevoa); }
.pill.new { background: var(--lima); color: var(--ameixa); }
.pill.warn { background: #fdecd0; color: #7a4a00; }
.prow-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 10px; border-top: 1px solid var(--malva); }
.prow-actions .btn { margin-left: auto; }
@media (min-width: 720px) {
  .prow { grid-template-columns: 64px 1fr auto; align-items: center; }
  .prow-actions { grid-column: auto; border: 0; padding: 0; }
}

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 12px; background: var(--malva-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--ameixa); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ameixa); outline-offset: 2px; }

/* Editor de produto */
.editor { width: 100%; height: 100%; margin: 0; inset: 0; background: #F7F1F4; }
@media (min-width: 760px) { .editor { width: min(760px, 94vw); height: auto; max-height: 92vh; margin: auto; border-radius: 22px; } }
.editor::backdrop { background: rgba(28, 12, 22, .6); }
.ed-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 18px; background: var(--branco); border-bottom: 1px solid var(--malva-2); }
.ed-head h2 { margin: 0; font-size: 20px; flex: 1; }
.ed-body { padding: 18px; display: grid; gap: 18px; }
.ed-card { background: var(--branco); border-radius: var(--r-md); padding: 18px; display: grid; gap: 16px; border: 1px solid var(--malva-2); }
.ed-card h3 { margin: 0; font-size: 16px; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.ed-foot { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--branco); border-top: 1px solid var(--malva-2); }
.ed-foot .btn-ameixa { flex: 1; }
.ed-danger { display: flex; justify-content: center; }
.link-danger { border: 0; background: none; color: var(--erro); font-weight: 700; padding: 10px; text-decoration: underline; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 600px) { .photos { grid-template-columns: repeat(4, 1fr); } }
.photo { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--malva); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .cover { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: var(--r-pill); background: var(--lima); color: var(--ameixa); }
.photo .ph-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.photo .ph-actions button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); font-weight: 800; display: grid; place-items: center; }
.photo .ph-actions button:disabled { opacity: .35; }
.photo-add { aspect-ratio: 4 / 5; border-radius: 12px; border: 2px dashed var(--malva-2); display: grid; place-items: center; text-align: center; gap: 4px; padding: 8px; font-size: 13px; font-weight: 700; color: var(--tinta-2); cursor: pointer; background: var(--branco); }
.photo-add:hover { border-color: var(--ameixa); color: var(--ameixa); }
.photo-add input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo.loading::after { content: "Enviando…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); font-size: 13px; font-weight: 700; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.tog input { position: absolute; opacity: 0; }
.tog span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--malva-2); font-weight: 600; font-size: 14px; cursor: pointer; background: var(--branco); }
.tog input:checked + span { background: var(--ameixa); border-color: var(--ameixa); color: var(--nevoa); }
.tog input:focus-visible + span { outline: 2px solid var(--ameixa); outline-offset: 2px; }
.tog .dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.tag-x { border: 0; background: none; color: inherit; font-weight: 800; padding: 0 0 0 4px; font-size: 16px; line-height: 1; }
.add-row { display: flex; gap: 8px; }
.add-row .input { min-height: 44px; }

/* Pedidos */
.olist { display: grid; gap: 12px; }
.order { background: var(--branco); border-radius: var(--r-md); border: 1px solid var(--malva-2); padding: 16px; display: grid; gap: 10px; }
.order-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.order-top h3 { margin: 0; font-size: 17px; }
.order-top p { margin: 2px 0 0; font-size: 13px; color: var(--tinta-2); }
.order ul { margin: 0; padding: 0 0 0 18px; font-size: 14px; }
.order-total { font-weight: 800; font-size: 18px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.st { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.st-novo { background: var(--lima); color: var(--ameixa); }
.st-confirmado { background: #e7f4ec; color: var(--ok); }
.st-cancelado { background: #ececec; color: #555; }

/* Desempenho */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--branco); border: 1px solid var(--malva-2); border-radius: var(--r-md); padding: 14px 16px; }
.kpi b { display: block; font-size: 24px; font-weight: 800; }
.kpi span { font-size: 13px; color: var(--tinta-2); }
.table-wrap { overflow-x: auto; background: var(--branco); border: 1px solid var(--malva-2); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--malva); white-space: nowrap; }
th { font-size: 13px; color: var(--tinta-2); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name { white-space: normal; min-width: 160px; font-weight: 600; }

/* Site */
.site-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .site-grid { grid-template-columns: 1fr 1fr; } }
.img-slot { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.img-slot .prev { width: 96px; height: 120px; border-radius: 12px; overflow: hidden; background: var(--ameixa-2); }
.img-slot .prev img { width: 100%; height: 100%; object-fit: cover; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-grid .photo { aspect-ratio: 1 / 1; }
.tlist { display: grid; gap: 10px; }
.titem { border: 1px solid var(--malva-2); border-radius: 12px; padding: 12px; display: grid; gap: 8px; font-size: 14px; }
.titem-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.empty-a { padding: 32px 16px; text-align: center; border: 1.5px dashed var(--malva-2); border-radius: var(--r-md); color: var(--tinta-2); display: grid; gap: 12px; justify-items: center; }
.empty-a h3 { margin: 0; color: var(--tinta); }
.loading-a { padding: 32px; text-align: center; color: var(--tinta-2); }

@media (max-width: 899px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
