:root {
  --c: #ea1d2c; --c2: #b8121f; --bg: #f5f5f7; --card: #fff; --tx: #1d1d1f; --mut: #6e6e73; --ln: #e5e5ea;
  --ok: #1a9f53; --warn: #f5a524; --bad: #e5484d; --info: #2f6fed; --r: 14px;
  --sh: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--tx); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--c); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
img { max-width: 100%; }
.mut { color: var(--mut); } .sm { font-size: 13px; } .xs { font-size: 12px; } .b { font-weight: 600; } .center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; background: var(--c); color: #fff; text-decoration: none; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(.94); } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--tx); border: 1px solid var(--ln); } .btn.ghost:hover { background: #f0f0f3; }
.btn.light { background: #f0f0f3; color: var(--tx); }
.btn.ok { background: var(--ok); } .btn.danger { background: var(--bad); } .btn.dark { background: #1d1d1f; }
.btn.wa { background: #25d366; } .btn.wa:hover { background: #1fb457; filter: none; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; } .btn.lg { padding: 15px 22px; font-size: 16px; border-radius: 12px; } .btn.block { width: 100%; }
.icon-btn { border: 0; background: #f0f0f3; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; color: var(--tx); }

/* formulários */
label.f { display: block; margin-bottom: 12px; } label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #3a3a3c; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: var(--tx); outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--c); margin: 0; flex: none; }
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d2d2d7; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); } .switch input:checked + span::after { transform: translateX(18px); }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--ln); background: #fff; border-radius: 99px; padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 14px; user-select: none; }
.chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); color: var(--c); font-weight: 600; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #f0f0f3; color: #3a3a3c; }
.tag.ok { background: #e3f6ea; color: #137a40; } .tag.bad { background: #fde8e8; color: #b42318; } .tag.warn { background: #fff3dc; color: #a15c00; } .tag.info { background: #e6eeff; color: #2353c4; } .tag.c { background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 18px; }
.sep { height: 1px; background: var(--ln); margin: 14px 0; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; position: relative; animation: pop .18s; }
.modal.wide { max-width: 760px; }
.modal-body { padding: 22px; }
.modal-x { position: absolute; right: 12px; top: 12px; z-index: 3; border: 0; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.15); font-size: 22px; cursor: pointer; line-height: 1; }
@media (max-width: 640px) { .modal-bg { align-items: flex-end; padding: 0; } .modal { border-radius: 18px 18px 0 0; max-height: 94vh; } }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(16px); opacity: 0; } }

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1d1d1f; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.25); transition: .3s; max-width: 90vw; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); } .toast.out { opacity: 0; transform: translateY(-8px); }

/* tabelas */
.tbl { width: 100%; border-collapse: collapse; } .tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--ln); vertical-align: middle; } .tbl th { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.tbl-wrap { overflow-x: auto; }

/* qty stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--ln); border-radius: 10px; overflow: hidden; }
.qty button { border: 0; background: #fff; width: 36px; height: 36px; font-size: 20px; color: var(--c); cursor: pointer; font-weight: 600; }
.qty button:disabled { color: #c7c7cc; cursor: default; }
.qty span { min-width: 28px; text-align: center; font-weight: 600; }

.empty { text-align: center; padding: 40px 16px; color: var(--mut); } .empty .ico { font-size: 42px; margin-bottom: 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid #e5e5ea; border-top-color: var(--c); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }
