/* ============================================================
   Clube de Recompensas — RECO64
   Estilo: limpo, corporativo, azul + cinza-frio
   ============================================================ */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6eaf0;
  --border-2: #eef1f6;
  --text: #0f1729;
  --text-2: #515c6e;
  --text-3: #9aa4b4;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-50: #eef4ff;
  --success: #0a8b54;
  --success-bg: #e6f5ee;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --warning: #b87810;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03);
  --shadow: 0 4px 14px rgba(16,24,40,.06), 0 14px 38px rgba(16,24,40,.07);
  --ring: 0 0 0 1px rgba(16,24,40,.04);
  --sidebar: 252px;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Public Sans", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 460px at 78% -8%, rgba(37,99,235,.06), transparent 62%),
    radial-gradient(900px 420px at 0% 0%, rgba(124,58,237,.035), transparent 55%);
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--text-3); }
.strong { font-weight: 600; }
.pos { color: var(--success); }
.neg { color: var(--danger); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
  background: linear-gradient(150deg, var(--primary), var(--primary-600));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px;
  box-shadow: 0 4px 10px rgba(37,99,235,.28); letter-spacing: -0.03em;
}
.logo-mark.sm { width: 26px; height: 26px; flex: 0 0 26px; font-size: 14px; border-radius: 7px; }
.brand-txt strong { display: block; font-size: 16px; letter-spacing: -0.02em; line-height: 1.1; }
.brand-txt em { font-style: normal; font-size: 11.5px; color: var(--text-3); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; }
.nav-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; background: none;
  border-radius: 10px; color: var(--text-2); font-size: 14.5px; font-weight: 500;
  text-align: left; width: 100%; transition: .15s;
}
.nav-item svg { color: var(--text-3); transition: .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.on { background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.nav-item.on svg { color: var(--primary); }
.nav-item.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: var(--primary); }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border-2); font-size: 12px; color: var(--text-3); }
.sidebar-foot strong { color: var(--text-2); display: block; font-size: 12.5px; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: none; align-items: center; gap: 12px; padding: 12px 18px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.content { padding: 34px 40px 80px; max-width: 1200px; margin: 0 auto; }

/* ---------- Page ---------- */
.page { animation: slidein .25s ease; }
.page.narrow { max-width: 680px; }
@keyframes slidein { from { transform: translateY(5px); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; }
.page-sub { color: var(--text-3); font-size: 14px; margin-top: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  padding: 9px 15px; transition: .14s; white-space: nowrap; line-height: 1;
}
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-full { width: 100%; }
.btn-primary { background: linear-gradient(180deg, #3273f2, var(--primary)); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.4), 0 4px 12px rgba(37,99,235,.22); }
.btn-primary:hover { background: linear-gradient(180deg, #2a6bf0, var(--primary-600)); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(37,99,235,.4), 0 8px 18px rgba(37,99,235,.26); }
.btn-primary:active { transform: translateY(0); }
.btn-soft { background: var(--primary-50); color: var(--primary-600); }
.btn-soft:hover { background: #e2ecff; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text-3); transition: .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.link-btn { border: 0; background: none; color: var(--primary-600); font-weight: 600; font-size: 13px; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
.linklike { border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; padding: 0; text-align: left; }
.linklike:hover { color: var(--primary-600); text-decoration: underline; }
.backlink { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--text-3); font-weight: 600; font-size: 13.5px; padding: 0 0 14px; }
.backlink:hover { color: var(--primary-600); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--border-2); }
.card-head h3 { font-size: 15.5px; }
.card-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.card-pad { padding: 20px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 19px; display: flex; gap: 14px; align-items: flex-start; transition: .18s; cursor: default; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dbe4f0; }
.stat-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 46px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.stat-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.stat-value { display: block; font-size: 29px; font-weight: 800; letter-spacing: -0.03em; margin-top: 1px; }
.stat-sub { font-size: 12px; color: var(--text-3); }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

/* ---------- Charts ---------- */
.bar-labels { display: flex; justify-content: space-around; margin-top: 8px; }
.bar-labels span { font-size: 12px; color: var(--text-3); text-transform: capitalize; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut-num { font: 700 22px var(--sans); fill: var(--text); }
.donut-lbl { font: 500 11px var(--sans); fill: var(--text-3); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; min-width: 140px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-lbl { flex: 1; color: var(--text-2); }
.legend-val { font-family: var(--mono); font-weight: 600; }

/* ---------- Rank list ---------- */
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border: 0; background: none; border-top: 1px solid var(--border-2); width: 100%; text-align: left; transition: .1s; }
.rank-row:first-child { border-top: 0; }
.rank-row:hover { background: var(--surface-2); }
.rank-pos { width: 22px; font-family: var(--mono); font-weight: 700; color: var(--text-3); font-size: 14px; }
.rank-info { flex: 1; min-width: 0; }
.rank-info strong { display: block; font-size: 14.5px; }
.rank-info span { font-size: 12.5px; color: var(--text-3); }
.rank-pts { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.rank-pts em { font-style: normal; font-size: 11px; color: var(--text-3); font-weight: 500; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.searchbox { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 13px; flex: 1; min-width: 240px; color: var(--text-3); }
.searchbox input { border: 0; outline: 0; background: none; padding: 10px 0; font: inherit; flex: 1; color: var(--text); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg-btn { border: 0; background: none; padding: 6px 13px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.seg-btn:hover { color: var(--text-2); }
.seg-btn.on { background: var(--primary-50); color: var(--primary-600); }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-click { cursor: pointer; transition: .1s; }
.table tbody tr.row-click:hover { background: var(--surface-2); }
.cell-user { display: flex; align-items: center; gap: 11px; }
.cell-user strong { display: block; font-size: 14px; }
.cell-user .muted { font-size: 12.5px; }
.acts { text-align: right; white-space: nowrap; }
.acts .icon-btn { vertical-align: middle; }
.obs { color: var(--text-3); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expired { color: var(--danger); font-size: 13px; }

/* ---------- Avatar / badges ---------- */
.avatar { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.tier { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.tier-sm { padding: 3px 9px 3px 7px; font-size: 11.5px; }
.tier-dot { width: 7px; height: 7px; border-radius: 50%; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-on { background: var(--success-bg); color: var(--success); }
.pill-off { background: #f1f3f7; color: var(--text-3); }

/* ---------- Forms / Modal ---------- */
.field { display: block; margin-bottom: 15px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field-label .req { color: var(--danger); font-style: normal; margin-left: 2px; }
.field-hint { display: block; font-size: 12px; color: var(--text-3); margin-top: 5px; }
.input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface); transition: .12s; }
.input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.textarea { resize: vertical; min-height: 56px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.select-wrap { position: relative; }
.select { appearance: none; padding-right: 36px; cursor: pointer; }
.select-arrow { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,41,.42); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 24px; z-index: 100; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 480px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease; }
.modal-wide { max-width: 560px; }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 18px; }
.modal-head p { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.modal-body { padding: 4px 22px 8px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-2); background: var(--surface-2); }
.confirm-txt { color: var(--text-2); line-height: 1.55; }

/* ---------- Switch ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0 4px; }
.switch-row strong { display: block; font-size: 14px; }
.switch-row em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.switch { width: 44px; height: 25px; border-radius: 999px; background: #d3d9e2; border: 0; position: relative; transition: .16s; flex: 0 0 44px; }
.switch span { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .16s; }
.switch.on { background: var(--primary); }
.switch.on span { left: 22px; }

/* ---------- Points preview / banners ---------- */
.points-preview { background: var(--success-bg); border-radius: var(--radius-sm); padding: 9px 14px; display: flex; flex-direction: column; justify-content: center; align-self: stretch; margin-top: 24px; }
.points-preview span { font-size: 12px; color: var(--success); font-weight: 600; }
.points-preview strong { font-size: 22px; color: var(--success); }
.saldo-banner { display: flex; align-items: center; justify-content: space-between; background: var(--primary-50); border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 15px; }
.saldo-banner span { font-size: 13px; color: var(--primary-600); font-weight: 600; }
.saldo-banner strong { font-size: 18px; color: var(--primary-600); }
.resgate-resumo { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.rr-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.rr-row span { color: var(--text-2); }
.rr-warn { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 9px 11px; background: var(--danger-bg); color: var(--danger); border-radius: 8px; font-size: 13px; font-weight: 600; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 54px 20px; }
.empty-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--surface-2); color: var(--text-3); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h4 { font-size: 16px; }
.empty p { color: var(--text-3); font-size: 13.5px; margin: 5px 0 16px; }

/* ---------- Detail ---------- */
.detail-head { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 18px; position: relative; overflow: hidden; }
.detail-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tier, var(--primary)); }
.detail-id { flex: 1; min-width: 0; }
.detail-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-name h1 { font-size: 23px; }
.detail-meta { color: var(--text-3); font-size: 13.5px; margin-top: 5px; }
.detail-actions { display: flex; gap: 10px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: .16s; }
.mini:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mini span { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.mini strong { display: block; font-size: 23px; font-weight: 700; margin-top: 3px; letter-spacing: -.02em; }
.mini.hl { background: var(--primary-50); border-color: #d4e2ff; }
.mini.hl strong { color: var(--primary-600); }
.progress-card { padding: 18px 20px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 8px 0; }
.tl-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; }
.tl-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 34px; }
.tl-venda .tl-ic { background: var(--primary-50); color: var(--primary); }
.tl-resgate .tl-ic { background: #f3eefe; color: #7c3aed; }
.tl-main { flex: 1; min-width: 0; }
.tl-main strong { display: block; font-size: 14.5px; }
.tl-sub { font-size: 12.5px; color: var(--text-3); }
.tl-right { text-align: right; }
.tl-pts { display: block; font-family: var(--mono); font-weight: 700; font-size: 14px; }
.tl-date { font-size: 12px; color: var(--text-3); }
.tier-range { font-family: var(--mono); font-size: 13px; color: var(--text-2); }

/* ---------- Tier progress ---------- */
.tierprog-bar { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-2); }
.tierprog-fill { height: 100%; border-radius: 999px; transition: width .4s; }
.tierprog-meta { font-size: 13px; color: var(--text-2); margin-top: 9px; }

/* ---------- Prize grid ---------- */
.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.prize { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 13px; transition: .18s; }
.prize:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #dbe4f0; }
.prize.off { opacity: .72; }
.prize.off:hover { transform: none; }
.prize-thumb { height: 76px; border-radius: var(--radius-sm); background: linear-gradient(135deg, #e9f0ff 0%, #f4f8ff 55%, #eef4ff 100%); display: grid; place-items: center; color: var(--primary); position: relative; overflow: hidden; }
.prize-thumb::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.12), transparent 70%); top: -30px; right: -20px; }
.prize-thumb svg { position: relative; z-index: 1; }
.prize-body { flex: 1; }
.prize-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.prize-top h4 { font-size: 15.5px; }
.prize-desc { font-size: 13px; color: var(--text-3); margin: 6px 0 12px; line-height: 1.45; }
.prize-meta { display: flex; align-items: center; justify-content: space-between; }
.prize-cost { font-size: 18px; font-weight: 700; color: var(--primary-600); }
.prize-cost em { font-style: normal; font-size: 12px; color: var(--text-3); font-weight: 500; }
.prize-stock { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.prize-stock.out { color: var(--danger); }
.prize-acts { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border-2); padding-top: 12px; }
.prize-acts .btn { margin-right: auto; }

/* ---------- Config ---------- */
.rule-builder { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; font-size: 15px; color: var(--text-2); }
.rule-input { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; background: var(--surface); }
.rule-input em { font-style: normal; color: var(--text-3); font-weight: 600; }
.rule-input input { border: 0; outline: 0; width: 70px; padding: 9px 0; font: 600 16px var(--mono); }
.rule-fixed { background: var(--success-bg); color: var(--success); padding: 8px 14px; border-radius: var(--radius-sm); font-size: 15px; }
.rule-eg { font-size: 13.5px; color: var(--text-3); margin-top: 16px; }
.tier-config { padding: 8px 0; }
.tier-config-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border-2); border-left: 3px solid var(--c); }
.tier-config-row:last-child { border-bottom: 0; }
.config-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* ---------- Receipt ---------- */
.receipt { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: var(--surface); }
.receipt-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.receipt-brand { display: flex; align-items: center; gap: 11px; }
.receipt-brand strong { display: block; font-size: 16px; }
.receipt-brand em { font-style: normal; font-size: 12px; color: var(--text-3); }
.receipt-tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--text-3); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; }
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px dashed var(--border); }
.receipt-grid span { display: block; font-size: 12px; color: var(--text-3); }
.receipt-grid strong { font-size: 14.5px; }
.receipt-prize { padding: 16px 0; }
.receipt-prize span { font-size: 12px; color: var(--text-3); }
.receipt-prize strong { display: block; font-size: 20px; margin-top: 3px; }
.receipt-points { display: flex; gap: 14px; }
.receipt-points > div { flex: 1; background: var(--surface-2); border-radius: var(--radius-sm); padding: 13px 16px; }
.receipt-points span { display: block; font-size: 12px; color: var(--text-3); }
.receipt-points strong { font-size: 21px; }
.receipt-foot { font-size: 12px; color: var(--text-3); margin-top: 18px; text-align: center; line-height: 1.5; }

/* ---------- Portal (área do cliente) ---------- */
.client-picker { min-width: 220px; }
.portal { max-width: 760px; }
.loyalty-card { border-radius: 20px; padding: 26px; color: #fff; background: linear-gradient(140deg, #243349 0%, #0f1729 70%); position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(15,23,41,.3); margin-bottom: 18px; }
.loyalty-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%); }
.loyalty-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: var(--tier); opacity: .22; }
.lc-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.lc-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13.5px; letter-spacing: .01em; }
.lc-name { font-size: 21px; font-weight: 700; margin-top: 22px; letter-spacing: -.01em; }
.lc-saldo { margin-top: 6px; }
.lc-saldo span { font-size: 12.5px; opacity: .7; }
.lc-saldo strong { display: block; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.lc-saldo em { font-style: normal; font-size: 15px; opacity: .7; }
.lc-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 12px; opacity: .65; }
.portal-progress { padding: 16px 20px; }
.pp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.portal-prizes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.pp-prize { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.pp-prize.ok { border-color: #c9dcff; background: var(--primary-50); }
.pp-prize-ic { width: 40px; height: 40px; border-radius: 9px; background: var(--surface-2); color: var(--text-3); display: grid; place-items: center; flex: 0 0 40px; }
.pp-prize.ok .pp-prize-ic { background: #fff; color: var(--primary); }
.pp-prize-info { flex: 1; min-width: 0; }
.pp-prize-info strong { display: block; font-size: 14px; }
.pp-prize-info span { font-size: 12.5px; color: var(--text-3); }
.pp-ok { font-size: 12px; font-weight: 700; color: var(--success); display: inline-flex; align-items: center; gap: 4px; }
.pp-falta { font-size: 12px; color: var(--text-3); font-weight: 600; }
.portal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-list { list-style: none; margin: 0; padding: 8px 0; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border-2); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list strong { display: block; font-size: 13.5px; }
.mini-list span { font-size: 12px; color: var(--text-3); }
.mini-list .mono { font-size: 14px; font-weight: 700; }
.mini-empty { color: var(--text-3); font-size: 13px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 200; align-items: center; }
.toast { display: flex; align-items: center; gap: 9px; background: #0f1729; color: #fff; padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow); font-size: 14px; font-weight: 500; animation: toastin .2s; }
.toast-ok svg { color: #4ade80; }
.toast-err { background: #7f1d1d; }
.toast-err svg { color: #fca5a5; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stat-grid, .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .portal-cols, .portal-prizes { grid-template-columns: 1fr; }
  .content { padding: 22px; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: .22s; z-index: 50; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; }
  .main { width: 100%; }
  .scrim { position: fixed; inset: 0; background: rgba(15,23,41,.4); z-index: 45; }
  .page-head { flex-direction: column; align-items: stretch; }
  .form-row { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; text-align: center; align-items: center; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
}

/* ---------- Image picker (prêmios) ---------- */
.img-pick { display: flex; align-items: flex-start; gap: 14px; }
.img-pick-zone { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 16px; border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; color: var(--text-3); font-size: 13px; transition: .15s; text-align: center; background: none; width: 100%; }
.img-pick-zone:hover { border-color: var(--primary); background: #f4f8ff; color: var(--primary); }
.img-pick-preview { position: relative; flex-shrink: 0; }
.img-pick-preview img { display: block; width: 110px; height: 110px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.img-pick-remove { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; border: 2px solid var(--surface); cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.prize-thumb img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 2; display: block; }

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden !important; }
  #receipt-print, #receipt-print * { visibility: visible !important; }
  #receipt-print { position: fixed; inset: 0; margin: 0; border: 0; padding: 30px; box-shadow: none; }
  .modal-overlay { background: #fff; }
}
