:root {
  --ink: #17212b;
  --muted: #75808b;
  --line: #e7ebee;
  --paper: #f5f7f8;
  --panel: #fff;
  --navy: #111820;
  --navy-2: #1a2630;
  --gold: #c59445;
  --gold-soft: #f8efdf;
  --red: #a9252e;
  --green: #25865b;
  --amber: #b67618;
  --shadow: 0 12px 30px rgba(19, 32, 44, .07);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
body.modal-open { overflow: hidden; padding-right: var(--modal-scrollbar-width, 0px); }
body.modal-open .modal-backdrop { right: var(--modal-scrollbar-width, 0px); }
body:has(.shell.menu-open) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef1f3; }
.login-card { width: min(460px, 100%); padding: 40px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--red); font-weight: 800; letter-spacing: 0; }
.login-card h1 { margin: 22px 0 6px; font-size: 28px; letter-spacing: 0; }
.login-card p { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.field { display: grid; gap: 8px; margin-top: 16px; }
.field label { color: #4e5a64; font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 13px; color: var(--ink); background: #fbfcfc; border: 1px solid #dce2e6; outline: 0; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,148,69,.12); }
.field input:disabled, .field textarea:disabled, .field select:disabled { color: #6f7a83; background: #f2f4f5; border-color: var(--line); opacity: 1; cursor: not-allowed; }
.button { min-height: 42px; padding: 0 18px; color: #fff; background: var(--navy); border: 0; border-radius: 3px; font-weight: 750; }
.button.gold { color: #3e2a12; background: var(--gold); }
.button.light { color: var(--ink); background: #f1f4f5; border: 1px solid var(--line); }
.button.danger { background: var(--red); }
.button.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.login-error { min-height: 22px; margin-top: 14px; color: var(--red); font-size: 13px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 16px 140px; overflow-y: auto; color: #e9eef2; background: var(--navy); }
.side-brand { position: relative; padding: 0 12px 26px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand strong { display: block; font-size: 18px; letter-spacing: 0; }
.side-brand span { display: block; margin-top: 7px; color: #8f9aa4; font-size: 12px; }
.nav-list { display: grid; gap: 4px; margin-top: 20px; }
.nav-item { width: 100%; min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 10px; color: #aab4bc; background: transparent; border: 0; text-align: left; border-radius: 3px; font-size: 14px; }
.nav-item:hover, .nav-item.active { color: #fff; background: var(--navy-2); }
.nav-dot { width: 6px; height: 6px; flex: 0 0 auto; background: currentColor; border-radius: 50%; }
.side-footer { position: absolute; left: 16px; right: 16px; bottom: 24px; display: grid; gap: 12px; padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.1); }
.user-small { display: flex; align-items: center; gap: 9px; }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: #56636d; border-radius: 50%; font-size: 12px; }
.user-small strong { display: block; font-size: 13px; }
.user-small span { display: block; margin-top: 3px; color: #87939c; font-size: 11px; }
.logout { padding: 0; color: #adb7bf; background: transparent; border: 0; text-align: left; font-size: 12px; }
.side-actions { display: flex; gap: 16px; }
.main { min-width: 0; }
.topbar { min-height: 76px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: 0; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.role-chip { padding: 6px 9px; color: #76501e; background: var(--gold-soft); border: 1px solid #ead6b3; border-radius: 20px; }
.redemption-relation { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border: 1px solid; border-radius: 14px; white-space: nowrap; box-sizing: border-box; font-size: 12px; font-weight: 700; }
.redemption-relation.cross-store { color: #8b6025; background: #fff6e5; border-color: #e5c68a; }
.redemption-relation.same-store { color: #627078; background: #f4f6f7; border-color: #dbe1e4; }
.redemption-filter-panel, .list-filter-panel { padding: 16px 18px; margin-bottom: 16px; }
.redemption-filters, .list-filters { display: grid; grid-template-columns: minmax(240px, 1.8fr) repeat(5, minmax(120px, 1fr)) auto; align-items: end; gap: 12px; }
.redemption-filter-field, .list-filter-field { min-width: 0; display: grid; gap: 6px; }
.redemption-filter-field span, .list-filter-field span { color: #66727c; font-size: 12px; font-weight: 700; }
.redemption-filter-field input, .redemption-filter-field select, .list-filter-field input, .list-filter-field select { width: 100%; min-width: 0; height: 36px; padding: 0 10px; color: var(--ink); background: #fbfcfc; border: 1px solid #dce2e6; outline: 0; font-size: 13px; }
.redemption-filter-field input:focus, .redemption-filter-field select:focus, .list-filter-field input:focus, .list-filter-field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,148,69,.12); }
.redemption-filter-actions, .list-filter-actions { display: flex; align-items: center; gap: 7px; min-height: 54px; }
.redemption-filter-actions .button, .list-filter-actions .button { white-space: nowrap; }
.redemption-filter-note { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.redemption-pagination, .list-pagination { min-height: 42px; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.redemption-pagination > div, .list-pagination > div { display: flex; gap: 8px; }
.content { max-width: 1500px; margin: 0 auto; padding: 30px 34px 48px; }
.toolbar { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.toolbar-copy h3 { margin: 0; font-size: 17px; }
.toolbar-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-config-toolbar { position: sticky; top: 0; z-index: 30; margin: -10px -10px 20px; padding: 10px; background: rgba(245,247,248,.96); border-bottom: 1px solid rgba(220,226,230,.9); box-shadow: 0 8px 18px rgba(19,32,44,.06); backdrop-filter: blur(8px); }
.page-config-toolbar select { min-width: 132px; min-height: 42px; padding: 0 30px 0 12px; color: var(--ink); background: #fff; border: 1px solid #dce2e6; border-radius: 3px; outline: 0; }
.page-config-toolbar select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,148,69,.12); }
.page-config-toolbar #page-config-scope-id { max-width: 260px; }
.back-to-top { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--navy); border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 10px 24px rgba(17,24,32,.24); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease, visibility .18s; }
.back-to-top.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.back-to-top span { font-size: 24px; line-height: 1; }
.back-to-top:hover { background: var(--navy-2); }
.back-to-top:focus-visible { outline: 3px solid rgba(197,148,69,.45); outline-offset: 2px; }
.grid { display: grid; gap: 16px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { padding: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(19,32,44,.03); }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { display: block; margin-top: 12px; font-size: 29px; font-weight: 800; letter-spacing: 0; }
.metric-note { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.metric-value.gold { color: var(--gold); }
.metric-value.green { color: var(--green); }
.metric-value.red { color: var(--red); }
.two-col { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); margin-top: 18px; }
.panel { min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(19,32,44,.03); }
.panel-head { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head span { color: var(--muted); font-size: 12px; }
.role-tabs { margin-bottom: 16px; padding: 5px; display: flex; gap: 6px; flex-wrap: wrap; background: #f6f8f9; border: 1px solid var(--line); }
.role-tab { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: #65717b; background: transparent; border: 1px solid transparent; border-radius: 3px; font-weight: 750; }
.role-tab:hover { color: var(--ink); background: #fff; border-color: #e5ebee; }
.role-tab.active { color: #3e2a12; background: #fff; border-color: #ead6b3; box-shadow: 0 4px 12px rgba(19,32,44,.06); }
.role-tab b { min-width: 22px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; color: #7a858e; background: #e9eef1; border-radius: 11px; font-size: 12px; }
.role-tab.active b { color: #76501e; background: var(--gold-soft); }
.table-wrap { overflow: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 13px 12px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: middle; font-size: 13px; white-space: nowrap; }
th { color: #66727c; background: #fafbfb; font-size: 12px; font-weight: 700; }
td.muted { color: var(--muted); }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 12px; color: #64717a; background: #eef1f3; font-size: 12px; }
.status.success, .status.paid, .status.locked { color: #1f754e; background: #e8f5ed; }
.status.completed { color: #1f754e; background: #e8f5ed; }
.status.contacted { color: #94631c; background: #fff4df; }
.status.pending, .status.requested, .status.qualified_pending_lock { color: #94631c; background: #fff4df; }
.status.danger, .status.refunded, .status.invalidated, .status.recovery_pending { color: #9d2b35; background: #fbeaec; }
.status.recovery_waived, .status.waived { color: #7a5a1d; background: #fff4df; }
.status.processing { color: #315b88; background: #e9f1fb; }
.status.wechat-bound { color: #1f754e; background: #f7fff9; border: 1px solid #9fd8b7; font-weight: 700; }
.status.wechat-unbound { color: #8b641d; background: #fff8e7; border: 1px solid #ead3a0; font-weight: 700; }
.status .wechat-nick { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status .wechat-nick::before { content: "·"; margin: 0 4px; color: currentColor; opacity: .7; }
.empty { padding: 42px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.alert-list { display: grid; gap: 12px; margin-top: 16px; }
.alert-item { padding: 12px; background: #fff8f0; border-left: 3px solid var(--amber); }
.alert-item strong { display: block; font-size: 13px; }
.alert-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; white-space: normal; line-height: 1.45; }
.todo-panel { margin-top: 18px; }
.todo-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.todo-item { min-width: 0; min-height: 96px; padding: 14px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; color: var(--ink); background: #fbfcfc; border: 1px solid var(--line); border-radius: 3px; text-align: left; }
.todo-item:hover { background: #fff; border-color: #d3dbe0; box-shadow: 0 6px 16px rgba(19,32,44,.06); }
.todo-count { width: 38px; height: 38px; display: grid; place-items: center; color: #76501e; background: var(--gold-soft); border: 1px solid #ead6b3; border-radius: 50%; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.todo-copy { min-width: 0; display: grid; gap: 5px; }
.todo-copy strong { overflow-wrap: anywhere; font-size: 13px; }
.todo-copy small { color: var(--muted); font-size: 12px; line-height: 1.45; white-space: normal; }
.todo-open { color: #68747d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.todo-item.danger .todo-count { color: #922c35; background: #fbeaec; border-color: #f0cbd0; }
.todo-item.success .todo-count { color: #1f754e; background: #e8f5ed; border-color: #b6dfc5; }
.bar-chart { height: 220px; margin-top: 16px; padding: 12px 0 26px; display: flex; align-items: end; gap: 8px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 7px; }
.bar { width: min(32px, 70%); min-height: 3px; background: var(--gold); border-radius: 3px 3px 0 0; }
.bar-col small { color: var(--muted); font-size: 10px; }
.json-editor { min-height: 520px; width: 100%; margin-top: 18px; padding: 16px; color: #d9e5ed; background: #101920; border: 0; resize: vertical; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12px; line-height: 1.6; }
.split-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.split-form .full { grid-column: 1 / -1; }
.inline-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.inline-actions:empty { min-height: 32px; }
.inline-actions > .button:first-child { margin-left: 0; }
.notice { margin-top: 14px; padding: 12px 14px; color: #74511f; background: var(--gold-soft); border: 1px solid #eedbbb; font-size: 13px; line-height: 1.5; }
.danger-note { color: #922c35; background: #fbeaec; border-color: #f0cbd0; }
.wrap-cell { min-width: 180px; max-width: 340px; white-space: normal; line-height: 1.5; }
.readonly { min-height: 44px; padding: 12px 13px; color: var(--muted); background: #f2f4f5; border: 1px solid var(--line); }
.field-note { margin: -2px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-item { min-height: 42px; padding: 9px 11px; display: flex; align-items: center; gap: 9px; background: #f8f9fa; border: 1px solid var(--line); font-size: 13px; }
.check-item input { width: 17px; height: 17px; accent-color: var(--gold); }
.check-item.disabled { color: #6f7a83; background: #f2f4f5; cursor: not-allowed; }
.check-item.disabled input { cursor: not-allowed; }
.detail-grid, .impact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.impact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.detail-grid > div, .impact-grid > div { min-width: 0; padding: 14px; background: #f7f9fa; border: 1px solid var(--line); }
.detail-grid span:not(.status), .impact-grid span { display: block; color: var(--muted); font-size: 12px; }
.detail-grid strong, .impact-grid strong { display: block; margin-top: 7px; overflow-wrap: anywhere; font-size: 14px; }
.detail-grid .status { width: fit-content; max-width: 100%; margin-top: 7px; }
.section-title { margin: 24px 0 4px; font-size: 14px; }
.compact { margin-top: 8px; }
.compact table { min-width: 560px; }
.json-preview { max-height: 300px; margin: 16px 0 0; padding: 14px; overflow: auto; color: #d9e5ed; background: #101920; font-size: 12px; line-height: 1.55; }
.copy-box { margin-top: 16px; padding: 12px; display: flex; align-items: center; gap: 12px; background: #f7f9fa; border: 1px solid var(--line); }
.copy-box code { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 12px; }
.staff-invite-qr { margin-top: 16px; padding: 20px; display: grid; justify-items: center; background: #f7f9fa; border: 1px solid var(--line); text-align: center; }
.staff-invite-qr-frame { width: 220px; height: 220px; padding: 8px; background: #fff; border: 1px solid #dce2e6; box-shadow: 0 8px 24px rgba(19,32,44,.08); }
.staff-invite-qr-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }
.staff-invite-qr strong { margin-top: 13px; color: var(--ink); font-size: 15px; }
.staff-invite-qr span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.staff-invite-warning { color: #8a3f29; background: #fff3ed; border-color: #f0d2c5; }
.staff-invite-countdown { font-variant-numeric: tabular-nums; }
.staff-invite-countdown-expired { color: #922c35; background: #fbeaec; border-color: #f0cbd0; }
.staff-invite-auto-status { margin: 14px 0 0; color: #64707a; font-size: 12px; line-height: 1.5; text-align: center; }
.staff-invite-copy { margin-top: 18px; }
.staff-invite-copy > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.staff-invite-copy strong { font-size: 13px; }
.staff-invite-copy span { color: var(--muted); font-size: 11px; text-align: right; }
.staff-invite-copy .copy-box { margin-top: 8px; }
.package-editor { margin-top: 8px; padding: 18px; background: #f8f9fa; border: 1px solid var(--line); }
.package-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.package-editor > header strong { font-size: 15px; }
.package-editor > header span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.package-editor-layout { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 18px; }
.package-editor-fields { min-width: 0; }
.package-editor-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.package-editor-meta .field { margin-top: 0; }
.package-editor-meta .full { grid-column: 1 / -1; }
.package-editor-list { margin-top: 16px; display: grid; gap: 12px; }
.package-editor-row { min-width: 0; padding: 14px; background: #fff; border: 1px solid #dfe4e7; box-shadow: 0 3px 10px rgba(19,32,44,.035); }
.package-editor-row-head { min-height: 32px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.package-editor-row-fields { min-width: 0; display: grid; grid-template-columns: minmax(140px, 1.15fr) minmax(86px, .35fr) minmax(160px, 1fr); align-items: end; gap: 10px; }
.package-editor-row .field { margin-top: 0; }
.package-editor-index { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; color: #76501e; background: var(--gold-soft); border: 1px solid #ead6b3; font-size: 12px; font-weight: 800; }
.gift-tier-row { background: #fffdf8; border-color: #e7cf9d; }
.gift-tier-row > .package-editor-row-fields { grid-template-columns: minmax(120px, .45fr) minmax(180px, 1fr); }
.gift-tier-options { margin-top: 12px; }
.gift-tier-options .package-editor-row { background: #fff; box-shadow: none; }
.package-remove { min-height: 32px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; color: var(--red); background: #fff; border: 1px solid #eadde0; border-radius: 3px; font-size: 12px; font-weight: 700; }
.package-remove span { font-size: 18px; line-height: 1; }
.package-remove:hover { background: #fbeaec; }
.package-remove:disabled { color: #b9c0c5; background: #f1f3f4; border-color: var(--line); cursor: not-allowed; }
.package-preview { position: sticky; top: 0; min-width: 0; padding: 12px; background: #eef1f2; border: 1px solid #dde3e6; }
.package-preview-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.package-preview-card { overflow: hidden; background: #fff; border: 1px solid #e5e0dc; box-shadow: 0 8px 20px rgba(19,32,44,.08); }
.package-preview-head { min-height: 58px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; background: #8f1720; }
.package-preview-head strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.package-preview-head span { flex: 0 0 auto; padding: 4px 7px; color: #6e4518; background: #f7e4b5; font-size: 10px; font-weight: 800; }
.package-preview-list { padding: 4px 12px 12px; }
.package-preview-row { min-height: 58px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid #eee9e5; }
.package-preview-row:last-child { border-bottom: 0; }
.package-preview-index { color: #a71d28; font-size: 10px; font-weight: 800; }
.package-preview-row div { min-width: 0; }
.package-preview-row strong, .package-preview-row small { display: block; overflow-wrap: anywhere; }
.package-preview-row strong { color: #2b2c2f; font-size: 11px; }
.package-preview-row small { margin-top: 3px; color: #908984; font-size: 9px; line-height: 1.35; }
.package-preview-row b { color: #a71d28; font-size: 11px; white-space: nowrap; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; overflow: auto; overscroll-behavior: contain; background: rgba(10, 17, 23, .58); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #fff; border: 1px solid rgba(255,255,255,.2); box-shadow: 0 28px 70px rgba(0,0,0,.25); }
.modal.wide { width: min(920px, 100%); }
.modal-head { min-height: 62px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; color: #5d6871; background: transparent; border: 0; font-size: 27px; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { min-height: 66px; padding: 12px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.modal-foot:has(> :only-child) { justify-content: center; }
.modal-foot .button { min-width: 100px; }
.toast-root { position: fixed; z-index: 200; top: 88px; right: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { width: fit-content; max-width: min(360px, calc(100vw - 40px)); padding: 13px 16px; color: #fff; background: var(--green); box-shadow: var(--shadow); font-size: 13px; line-height: 1.45; }
.toast.error { background: var(--red); }

.module-editor { display: grid; gap: 14px; margin-top: 18px; }
.module-block { padding: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(19,32,44,.03); }
.module-block > header { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.module-block > header strong { font-size: 15px; }
.module-block > header span { color: var(--muted); font-size: 12px; }
.module-block .field { margin-top: 0; }
.module-block textarea { min-height: 112px; resize: vertical; }
.config-image-upload { min-width: 0; }
.config-image-card { min-width: 0; display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: 16px; padding: 14px; background: #fbfcfc; border: 1px solid #dce2e6; }
.config-image-preview-wrap { min-width: 0; height: 210px; display: grid; place-items: center; overflow: hidden; background: #f1f4f5; border: 1px solid var(--line); }
.config-image-preview { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.config-image-empty { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.config-image-side { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.config-image-side p { margin: 0; color: #4e5a64; font-size: 13px; line-height: 1.55; }
.config-image-picker { position: relative; overflow: hidden; display: inline-grid; place-items: center; }
.config-image-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.config-image-status { min-height: 20px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.poster-layout-editor { min-width: 0; }
.poster-layout-editor > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.poster-layout-body { display: grid; grid-template-columns: minmax(180px, 360px) minmax(0, 1fr); gap: 16px; padding: 14px; background: #fbfcfc; border: 1px solid #dce2e6; }
.poster-layout-stage { position: relative; width: 100%; min-height: 180px; overflow: hidden; background: #f1f4f5; border: 1px solid var(--line); line-height: 0; }
.poster-layout-stage.is-empty { display: grid; place-items: center; }
.poster-layout-image { width: 100%; height: auto; display: block; background: #fff; }
.poster-layout-empty { color: var(--muted); font-size: 13px; line-height: 1.4; }
.poster-code-marker { position: absolute; z-index: 2; box-sizing: border-box; display: grid; place-items: center; padding: 4px; color: #754819; background: rgba(255,255,255,.88); border: 2px solid #b78028; box-shadow: 0 2px 8px rgba(71,47,13,.22); font-size: 11px; font-weight: 700; line-height: 1.2; text-align: center; touch-action: none; cursor: grab; }
.poster-code-marker:active { cursor: grabbing; }
.poster-layout-stage.is-empty .poster-code-marker { display: none; }
.poster-layout-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 12px; }
.poster-layout-fields .field { margin-top: 0; }
.store-image-field > input,
.store-image-field > textarea { margin-bottom: 8px; }
.store-image-tools { min-height: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.store-image-status { min-height: 20px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.config-toggle { min-height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fbfcfc; border: 1px solid #dce2e6; font-size: 13px; font-weight: 700; }
.config-toggle input { width: 36px; height: 20px; accent-color: var(--gold); }
.redemption-mode-toggle { min-height: 58px; }
.redemption-mode-toggle span { display: grid; gap: 3px; }
.redemption-mode-toggle small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.45; }
.redemption-mode-note { margin-top: 0; }
.advanced-config { margin-top: 16px; background: #fff; border: 1px solid var(--line); }
.advanced-config summary { padding: 15px 18px; cursor: pointer; font-size: 13px; font-weight: 700; }
.advanced-config .json-editor { margin: 0; }
.page-config-history { margin-top: 16px; }
.page-config-history .panel-head { align-items: flex-start; }
.page-config-history .panel-head > div { min-width: 0; }
.page-config-history .panel-head span { display: block; margin-top: 5px; line-height: 1.5; white-space: normal; }
.page-preview-grid { margin-top: 16px; }
.page-preview-copy { margin-top: 18px; }
.permission-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.permission-group:first-child { padding-top: 0; }
.permission-group:last-child { border-bottom: 0; }
.permission-group h4 { margin: 0 0 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.mobile-menu, .side-menu-close, .mobile-menu-backdrop { display: none; }
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .todo-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .redemption-filters, .list-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .redemption-filter-keyword, .list-filter-keyword { grid-column: span 2; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: -270px; z-index: 50; width: 248px; transition: left .2s ease; box-shadow: 10px 0 30px rgba(0,0,0,.18); }
  .shell.menu-open .sidebar { left: 0; }
  .mobile-menu-backdrop { position: fixed; inset: 0; z-index: 45; display: block; padding: 0; background: rgba(10,17,23,.5); border: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s; }
  .shell.menu-open .mobile-menu-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
  .side-brand { padding-right: 46px; }
  .side-menu-close { position: absolute; top: -9px; right: 0; width: 38px; height: 38px; display: grid; place-items: center; color: #e9eef2; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 3px; font-size: 26px; line-height: 1; }
  .side-menu-close:hover { background: rgba(255,255,255,.12); }
  .mobile-menu { display: grid; place-items: center; width: 38px; height: 38px; color: var(--ink); background: #f1f4f5; border: 1px solid var(--line); border-radius: 3px; font-size: 20px; }
  .topbar { padding: 0 18px; }
  .topbar h2 { font-size: 18px; }
  .topbar-meta { font-size: 11px; }
  .role-chip { display: none; }
  .content { padding: 20px 16px 34px; }
  .metric-grid { gap: 10px; }
  .todo-list { grid-template-columns: 1fr; }
  .todo-item { min-height: 82px; }
  .metric { padding: 15px; }
  .metric-value { margin-top: 8px; font-size: 23px; }
  .redemption-filter-panel, .list-filter-panel { padding: 14px; }
  .redemption-filters, .list-filters { grid-template-columns: 1fr; }
  .redemption-filter-keyword, .list-filter-keyword { grid-column: auto; }
  .redemption-filter-actions, .list-filter-actions { min-height: 36px; }
  .redemption-pagination, .list-pagination { align-items: flex-start; flex-direction: column; }
  .panel { padding: 16px; }
  .split-form { grid-template-columns: 1fr; }
  .split-form .full { grid-column: auto; }
  .toolbar { align-items: flex-start; }
  .page-config-toolbar { margin: -8px -6px 16px; padding: 8px 6px; }
  .page-config-toolbar .toolbar-copy { display: none; }
  .page-config-toolbar .toolbar-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-config-toolbar #page-select, .page-config-toolbar #page-config-scope-type, .page-config-toolbar #page-config-scope-id { grid-column: 1 / -1; width: 100%; max-width: none; min-height: 42px; }
  .page-config-toolbar .button { width: 100%; min-width: 0; padding: 0 6px; white-space: nowrap; }
  .page-config-history .panel-head { display: block; }
  .back-to-top { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 92vh; border: 0; }
  .modal.wide { width: 100%; }
  .modal-head { min-height: 58px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .modal-foot .button { flex: 1; }
  .check-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .impact-grid { grid-template-columns: 1fr; }
  .copy-box { align-items: stretch; flex-direction: column; }
  .staff-invite-qr { padding: 16px; }
  .staff-invite-qr-frame { width: min(200px, 70vw); height: min(200px, 70vw); }
  .staff-invite-copy > div:first-child { align-items: flex-start; flex-direction: column; gap: 4px; }
  .staff-invite-copy span { text-align: left; }
  .package-editor > header { align-items: flex-start; }
  .package-editor-layout { grid-template-columns: 1fr; }
  .package-editor-meta { grid-template-columns: 1fr; }
  .package-editor-meta .full { grid-column: auto; }
  .package-editor-row { padding: 12px; }
  .package-editor-row-head { margin-bottom: 10px; }
  .package-editor-row-fields { grid-template-columns: minmax(0, 1fr) 82px; }
  .package-editor-row-fields .field:nth-child(3) { grid-column: 1 / -1; }
  .package-preview { position: static; }
  .config-image-card { grid-template-columns: 1fr; }
  .config-image-preview-wrap { height: 180px; }
  .poster-layout-body { grid-template-columns: 1fr; }
  .poster-layout-fields { grid-template-columns: 1fr; }
  .toast-root { top: 72px; right: 12px; }
}
