:root {
  --roxo: #4e254c; --roxo-2: #6b3a68; --terra: #b74d2c; --bg: #f6f2f6; --card: #fff;
  --txt: #231623; --mut: #6f6272; --bor: #e2d9e3; --ok: #2e7d4f; --err: #b3261e;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hide { display: none !important; }

header.top { background: var(--roxo); color: #fff; padding: 8px 14px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10; }
header.top img { height: 40px; background: #fff; border-radius: 8px; padding: 2px 6px; }
header.top .who { margin-left: auto; font-size: 14px; text-align: right; }
header.top .who button { background: none; border: 0; color: #e9d3e7; text-decoration: underline; padding: 0 0 0 8px; }
nav.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--bor); position: sticky; top: 56px; z-index: 9; }
nav.tabs button { flex: 1; padding: 13px 4px; border: 0; background: none; font-weight: 600; color: var(--mut);
  border-bottom: 3px solid transparent; }
nav.tabs button.on { color: var(--roxo); border-color: var(--terra); }

main { max-width: 1100px; margin: 0 auto; padding: 14px; padding-bottom: 40px; }
.card { background: var(--card); border: 1px solid var(--bor); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
h2 { margin: 0 0 10px; font-size: 17px; color: var(--roxo); }
label.f { display: block; font-size: 13px; color: var(--mut); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 12px; border: 1px solid var(--bor); border-radius: 10px; background: #fff; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--roxo-2); border-color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.btn { border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; background: var(--roxo); color: #fff; min-height: 48px; }
.btn.sec { background: #fff; color: var(--roxo); border: 1.5px solid var(--roxo); }
.btn.danger { background: var(--err); }
.btn.big { width: 100%; font-size: 18px; padding: 16px; background: var(--terra); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { padding: 8px 12px; min-height: 38px; font-size: 14px; }

.pos { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pos { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .pos .side { position: sticky; top: 120px; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px;
  max-height: 55vh; overflow: auto; padding: 2px; }
@media (min-width: 900px) { .grid { max-height: 62vh; } }
.prod { text-align: left; background: #fff; border: 1.5px solid var(--bor); border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 84px; }
.prod:active { background: #f1e6f0; border-color: var(--roxo-2); }
.prod b { font-size: 13px; line-height: 1.2; }
.prod span { color: var(--terra); font-weight: 800; }

.cart-line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--bor); }
.cart-line .n { flex: 1; font-size: 14px; }
.cart-line .n small { color: var(--mut); display: block; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--roxo); background: #fff;
  color: var(--roxo); font-size: 20px; font-weight: 700; }
.qty b { min-width: 22px; text-align: center; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; font-weight: 800;
  color: var(--roxo); margin: 12px 0; }
.empty { color: var(--mut); text-align: center; padding: 16px 0; }

.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt { border: 2px solid var(--bor); background: #fff; border-radius: 12px; padding: 14px 4px; font-weight: 700; min-height: 56px; }
.opt.on { border-color: var(--roxo); background: var(--roxo); color: #fff; }
.opt small { display: block; font-weight: 500; opacity: .8; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.stat { background: #f6eef5; border-radius: 12px; padding: 10px 12px; }
.stat small { color: var(--mut); display: block; font-size: 12px; }
.stat b { font-size: 18px; color: var(--roxo); }
.stat.hl { background: var(--roxo); } .stat.hl small, .stat.hl b { color: #fff; }

.sale { border: 1px solid var(--bor); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.sale.off { opacity: .6; background: #f5f0f0; }
.sale .h { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.sale .m { font-size: 13px; color: var(--mut); margin-top: 2px; }
.sale ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eadbe9; color: var(--roxo); margin-right: 4px; }
.tag.red { background: #f8dcd8; color: var(--err); }

table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px 6px; border-bottom: 1px solid var(--bor); text-align: left; font-size: 14px; }
td input[type=text], td input[type=number] { min-height: 38px; padding: 6px 8px; }

.login { max-width: 380px; margin: 8vh auto 0; padding: 0 16px; text-align: center; }
.login img { width: 240px; max-width: 80%; }
.login .card { text-align: left; }
.err { color: var(--err); font-size: 14px; margin: 8px 0 0; min-height: 20px; }

.ok-box { text-align: center; padding: 10px 0; }
.ok-box .tick { font-size: 54px; color: var(--ok); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(80px); background: #222; color: #fff;
  padding: 12px 18px; border-radius: 12px; transition: transform .25s; z-index: 50; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--err); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 16px; width: 100%; max-width: 420px; }
