:root {
  --cream: #fffaf0;
  --paper: #fffefb;
  --yellow: #f8c65c;
  --yellow-soft: #fff0bd;
  --orange: #ef7d3c;
  --orange-dark: #c95822;
  --brown: #5d402f;
  --muted: #8c7465;
  --green: #4f9a70;
  --red: #d8574f;
  --line: #f1dfc8;
  --shadow: 0 10px 35px rgba(119, 75, 33, .10);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0; color: var(--brown); background:
  radial-gradient(circle at 8% 2%, rgba(248,198,92,.20), transparent 22rem),
  radial-gradient(circle at 92% 16%, rgba(239,125,60,.10), transparent 25rem), var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1180px; margin: auto; padding: 24px; }
.narrow { max-width: 520px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; }
.brand-mark { width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; overflow: hidden; background: #fff7e7; box-shadow: 0 8px 20px rgba(248,198,92,.38); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand small { display:block; font-size: 11px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.card { background: rgba(255,254,251,.94); border: 1px solid rgba(241,223,200,.9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.hero { background: linear-gradient(135deg, #f7c15c, #f08a49); color: #fff; position: relative; overflow: hidden; }
.hero::after { content:""; width: 180px; height: 180px; border: 38px solid rgba(255,255,255,.12); border-radius:50%; position:absolute; right:-58px; top:-78px; }
.hero h1 { margin: 8px 0 4px; font-size: clamp(26px,5vw,40px); }
.hero p { margin: 0; opacity: .92; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.mt { margin-top: 20px; }
.mt-small { margin-top: 12px; }
.mb { margin-bottom: 20px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.section-title { margin: 30px 0 14px; display:flex; align-items:end; justify-content:space-between; gap:12px; }
.section-title h2 { margin:0; font-size: 21px; }
.btn { border: 0; border-radius: 14px; padding: 11px 18px; background: var(--orange); color:#fff; font-weight:700; box-shadow: 0 6px 15px rgba(239,125,60,.20); }
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.btn-secondary { background: var(--yellow-soft); color: var(--brown); box-shadow:none; }
.btn-ghost { background: transparent; color:var(--muted); border:1px solid var(--line); box-shadow:none; }
.btn-danger { background: var(--red); }
.btn-small { padding: 7px 11px; border-radius:10px; font-size:13px; }
.field { margin-bottom: 16px; }
.field label { display:block; font-size:13px; font-weight:700; margin-bottom:7px; }
.input { width:100%; border:1px solid var(--line); background:#fffdfa; border-radius:14px; padding:12px 14px; color:var(--brown); outline:none; }
.input:focus { border-color:var(--yellow); box-shadow:0 0 0 3px rgba(248,198,92,.20); }
textarea.input { min-height:88px; resize:vertical; }
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(100%,470px); padding:34px; }
.login-head { text-align:center; margin-bottom:28px; }
.login-head .brand-mark { margin:0 auto 14px; width:64px; height:64px; border-radius:22px; font-size:28px; }
.tabs { display:flex; background:#f8eddd; border-radius:14px; padding:4px; gap:4px; margin-bottom:20px; }
.tab { flex:1; border:0; background:transparent; padding:9px 6px; border-radius:11px; color:var(--muted); font-weight:700; }
.tab.active { background:#fff; color:var(--orange-dark); box-shadow:0 2px 8px rgba(90,60,30,.08); }
.notice { padding:13px 15px; border-radius:14px; background:var(--yellow-soft); border:1px solid #f2d67e; font-size:14px; }
.notice.error { background:#fff0ee; border-color:#f2b5ae; color:#a53d38; }
.notice.success { background:#edf8f1; border-color:#b9dfc7; color:#31704c; }
.hidden { display:none !important; }
.coupon { position:relative; overflow:hidden; padding:0; display:grid; grid-template-columns:112px 1fr; min-height:150px; }
.coupon-side { display:grid; place-items:center; text-align:center; padding:18px 10px; color:#fff; background:linear-gradient(160deg,var(--yellow),var(--orange)); }
.coupon-value { font-size:25px; font-weight:900; line-height:1.1; }
.coupon-main { padding:20px; }
.coupon-main h3 { margin:0 0 6px; font-size:18px; }
.coupon-main p { margin:5px 0; font-size:13px; color:var(--muted); }
.coupon.used, .coupon.expired, .coupon.not_started { filter:grayscale(.7); opacity:.72; }
.member-page .member-coupon { grid-template-columns:112px minmax(0,1fr); gap:10px; padding:10px; align-items:stretch; }
.member-page .member-coupon .coupon-side { border-radius:18px; min-height:130px; }
.member-page .member-coupon .coupon-main { align-self:center; padding:10px 10px 10px 4px; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 9px; font-size:12px; font-weight:800; background:#edf8f1; color:var(--green); }
.badge.warn { background:#fff2d3; color:#a46410; }
.badge.gray { background:#eee9e5; color:#786e67; }
.stat { padding:20px; }
.stat .num { font-size:31px; line-height:1; font-weight:900; color:var(--orange-dark); margin-top:8px; }
.modal { position:fixed; inset:0; background:rgba(75,52,37,.38); backdrop-filter:blur(4px); display:grid; place-items:center; padding:20px; z-index:20; }
.modal-card { width:min(100%,560px); max-height:90vh; overflow:auto; }
.modal-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:18px; }
.modal-head h2 { margin:0; }
.icon-btn { border:0; background:#f6eadb; width:36px; height:36px; border-radius:12px; color:var(--brown); }
.qr { width:min(100%,260px); aspect-ratio:1; display:block; margin:14px auto; border:10px solid #fff; border-radius:18px; box-shadow:var(--shadow); }
.code { font-size:24px; letter-spacing:4px; font-weight:900; text-align:center; color:var(--orange-dark); }
.timer { text-align:center; color:var(--muted); font-size:13px; margin:8px 0 18px; }
.app-layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:24px; align-items:start; }
.sidebar { position:sticky; top:20px; padding:16px; }
.nav-btn { width:100%; text-align:left; padding:12px 14px; border-radius:13px; background:transparent; border:0; color:var(--muted); margin:2px 0; font-weight:700; }
.nav-btn.active { background:var(--yellow-soft); color:var(--orange-dark); }
.page { display:none; }
.page.active { display:block; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:660px; }
th,td { text-align:left; padding:13px 10px; border-bottom:1px solid #f2e6d7; font-size:14px; }
th { color:var(--muted); font-size:12px; letter-spacing:.5px; }
.empty { text-align:center; padding:45px 15px; color:var(--muted); }
.scanner { text-align:center; padding:30px; }
.scanner-icon { width:100px; height:100px; margin:0 auto 18px; border:3px dashed var(--yellow); border-radius:25px; display:grid; place-items:center; font-size:42px; }
.search-row { display:flex; gap:10px; }
.search-row .input { flex:1; }
.form-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.footer { text-align:center; color:#a89080; font-size:12px; padding:35px 10px 15px; }
.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:#4f3a2f; color:#fff; border-radius:13px; padding:11px 18px; z-index:50; box-shadow:var(--shadow); }
.password-banner { margin-bottom:18px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.balance-record { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:18px 20px; }
.balance-record h3 { margin:8px 0 3px; font-size:16px; }
.balance-record p { margin:3px 0; }
.balance-change { text-align:right; font-size:20px; font-weight:900; white-space:nowrap; }
.balance-change small { display:block; margin-top:5px; font-size:11px; color:var(--muted); font-weight:600; }
.money-plus { color:var(--green); }
.money-minus { color:var(--red); }
.success-mark { margin:auto; background:var(--green); color:white; }
.member-code-card { display:grid; grid-template-columns:minmax(0,1fr) 180px; align-items:center; gap:20px; }
.member-code-card h2 { margin:9px 0 5px; }
.member-code-card p { font-size:14px; line-height:1.6; }
.member-qr { width:180px; height:180px; display:block; border:8px solid #fff; border-radius:18px; box-shadow:0 7px 22px rgba(93,64,47,.12); }
.quick-card { align-self:start; }
.quick-launch { display:flex; flex-direction:column; min-height:178px; }
.quick-launch .quick-main-btn { margin-top:auto; }
.quick-main-btn { width:100%; padding:15px 20px; font-size:17px; }
.quick-title { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.quick-title h3 { margin:0 0 3px; font-size:19px; }
.quick-title p { margin:0; }
.quick-icon { width:46px; height:46px; flex:0 0 46px; border-radius:15px; display:grid; place-items:center; color:#fff; background:linear-gradient(145deg,var(--yellow),var(--orange)); font-weight:900; font-size:20px; }
.wallet-icon { background:linear-gradient(145deg,#72b88f,var(--green)); }
.quick-result { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.quick-result h3 { margin:10px 0 5px; }
.secondary-option { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:12px; margin:2px 0 8px; }
.secondary-option::before,.secondary-option::after { content:""; height:1px; background:var(--line); flex:1; }
.compact-grid { gap:12px; }
.filter-bar { display:grid; grid-template-columns:2fr 1fr 1fr auto; gap:12px; align-items:end; padding:18px; }
.filter-bar .field { margin:0; }
.member-picker { max-height:330px; overflow:auto; margin-bottom:18px; border:1px solid var(--line); border-radius:16px; background:#fffdfa; }
.member-option { display:flex; align-items:center; gap:12px; padding:13px 15px; border-bottom:1px solid #f2e6d7; cursor:pointer; }
.member-option:last-child { border-bottom:0; }
.member-option:hover { background:#fff8e9; }
.member-option input { width:20px; height:20px; flex:0 0 20px; margin:0; accent-color:var(--orange); }
.member-option span { min-width:0; }
.member-option small { display:block; margin-top:4px; color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
@media (max-width: 800px) {
  .shell { padding:16px; }
  .grid-4,.grid-3,.grid-2 { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .app-layout { grid-template-columns:1fr; }
  .sidebar { position:static; display:flex; overflow:auto; padding:8px; gap:4px; }
  .nav-btn { width:auto; white-space:nowrap; margin:0; }
  .coupon { grid-template-columns:94px 1fr; }
  .member-page .member-coupon { grid-template-columns:94px minmax(0,1fr); }
  .topbar { align-items:flex-start; }
  .member-code-card { grid-template-columns:1fr; text-align:center; }
  .member-qr { margin:auto; width:220px; height:220px; }
  .filter-bar { grid-template-columns:1fr 1fr; }
  .table-wrap { overflow:visible; padding:0; border:0; background:transparent; box-shadow:none; }
  .responsive-table { display:block; min-width:0; }
  .responsive-table thead { display:none; }
  .responsive-table tbody,.responsive-table tr { display:block; }
  .responsive-table tr { margin-bottom:12px; padding:8px 14px; border:1px solid var(--line); border-radius:16px; background:var(--paper); box-shadow:0 6px 20px rgba(119,75,33,.08); }
  .responsive-table td { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; padding:10px 0; border-bottom:1px solid #f2e6d7; text-align:right; overflow-wrap:anywhere; }
  .responsive-table td:last-child { border-bottom:0; }
  .responsive-table td::before { content:attr(data-label); flex:0 0 92px; color:var(--muted); font-size:12px; font-weight:800; text-align:left; }
  .responsive-table td[data-label="操作"] { align-items:center; }
  .responsive-table td[data-label="操作"] .form-actions { justify-content:flex-end; }
  .responsive-table td.empty { display:block; text-align:center; }
  .responsive-table td.empty::before { display:none; }
}
@media (max-width: 440px) {
  .login-card { padding:24px 19px; }
  .card { padding:19px; }
  .coupon { grid-template-columns:84px 1fr; }
  .member-page .member-coupon { grid-template-columns:84px minmax(0,1fr); gap:8px; padding:8px; }
  .member-page .member-coupon .coupon-side { border-radius:15px; min-height:120px; }
  .member-page .member-coupon .coupon-main { padding:8px 8px 8px 2px; }
  .coupon-main { padding:16px; }
  .coupon-value { font-size:20px; }
  .balance-record { align-items:flex-start; }
  .filter-bar { grid-template-columns:1fr; }
  .search-row { flex-direction:column; }
  .search-row .btn { width:100%; }
  .section-title { align-items:flex-start; }
  .responsive-table td { display:block; text-align:left; }
  .responsive-table td::before { display:block; margin-bottom:5px; }
  .responsive-table td[data-label="操作"] .form-actions { justify-content:flex-start; }
  .responsive-table td[data-label="操作"] .btn { flex:1 1 auto; }
}

/* Formal interface */
.admin-shell { max-width: 1460px; }
.admin-content { min-width: 0; }
.admin-topbar { padding: 2px 4px; }
.overview-grid { display:grid; grid-template-columns:minmax(250px,.72fr) minmax(420px,1.28fr); gap:18px; margin-bottom:18px; }
.overview-scan { padding:0; min-height:290px; overflow:hidden; background:linear-gradient(145deg,#ffc85d,#f57a36); border:0; }
.scan-only { width:100%; height:100%; min-height:290px; border-radius:22px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; font-size:28px; box-shadow:none; background:transparent; }
.scan-only:hover { filter:none; transform:none; background:rgba(255,255,255,.08); }
.scan-mark { width:126px; height:126px; padding:12px; border-radius:34px; background:rgba(255,255,255,.18); }
.scan-mark svg { width:100%; height:100%; overflow:visible; }
.scan-mark path { fill:none; stroke:#fff; stroke-linecap:round; stroke-linejoin:round; }
.scan-mark .scan-corners { stroke-width:4; }
.scan-mark .scan-code { fill:#fff; stroke:none; }
.scan-mark .scan-beam { stroke-width:4; animation:scanBeam 1.8s ease-in-out infinite alternate; transform-origin:center; }
@keyframes scanBeam { from { transform:translateY(-9px); opacity:.55; } to { transform:translateY(9px); opacity:1; } }
.shortcut-panel h2,.recent-panel h2,.card-head h3 { margin:0; }
.shortcut-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:18px; }
.shortcut-grid button { min-height:102px; display:flex; align-items:center; gap:14px; padding:18px; border:1px solid var(--line); border-radius:18px; background:#fffdfa; color:var(--brown); text-align:left; }
.shortcut-grid button:hover { border-color:#efbb75; background:#fff7e8; transform:translateY(-1px); }
.shortcut-grid span { width:44px; height:44px; flex:0 0 44px; border-radius:15px; display:grid; place-items:center; color:#fff; font-weight:900; background:linear-gradient(145deg,var(--yellow),var(--orange)); }
.shortcut-grid b { font-size:16px; }
.recent-panel { padding:22px 24px; }
.card-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.text-button { border:0; background:transparent; color:var(--orange-dark); font-weight:800; padding:7px 2px; }
.recent-list > div,.history-list > div { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:13px; padding:14px 2px; border-bottom:1px solid #f3e6d7; }
.recent-list > div:last-child,.history-list > div:last-child { border-bottom:0; }
.recent-list p,.history-list p { min-width:0; margin:0; }
.recent-list p b,.history-list p b { display:block; font-size:15px; }
.recent-list p small,.history-list p small { display:block; margin-top:4px; color:var(--muted); overflow-wrap:anywhere; }
.recent-list strong,.history-list strong { white-space:nowrap; color:var(--orange-dark); }
.recent-icon,.history-icon { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; color:#fff; font-weight:900; background:linear-gradient(145deg,var(--yellow),var(--orange)); }
.recent-icon.consume,.history-icon.consume { background:linear-gradient(145deg,#75bc91,var(--green)); }
.recent-icon.recharge,.history-icon.recharge { background:linear-gradient(145deg,#76abd1,#4b88b2); }
.recent-icon.coupon_deduct,.history-icon.coupon_deduct { background:linear-gradient(145deg,#ef817b,var(--red)); }
.operation-tabs { display:flex; gap:6px; width:max-content; max-width:100%; padding:5px; margin-bottom:14px; border-radius:16px; background:#f8eddd; }
.operation-tabs button { border:0; border-radius:12px; background:transparent; padding:10px 18px; color:var(--muted); font-weight:800; }
.operation-tabs button.active { background:#fff; color:var(--orange-dark); box-shadow:0 3px 10px rgba(93,64,47,.08); }
.operation-panel { display:none; max-width:760px; }
.operation-panel.active { display:block; }
.notice { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.store-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:18px; }
.store-summary article { display:flex; flex-direction:column; gap:9px; padding:20px; }
.store-summary b { color:var(--orange-dark); font-size:30px; }
.store-summary small { color:var(--muted); }
.stats-store { width:auto; min-width:180px; }
.calendar-card { overflow:hidden; }
.calendar-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.calendar-head button { width:42px; height:42px; border:1px solid var(--line); border-radius:14px; background:#fff9ef; color:var(--brown); font-size:26px; }
.calendar-head div { text-align:center; }
.calendar-head h3 { margin:0 0 4px; }
.calendar-head span { color:var(--muted); font-size:13px; }
.week-head,.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.week-head { color:var(--muted); text-align:center; font-size:12px; font-weight:800; margin-bottom:7px; }
.week-head span:first-child,.week-head span:last-child,.calendar-day.weekend .day-number { color:var(--red); }
.calendar-day { min-height:94px; padding:9px; border:1px solid #f3e7d9; margin:-1px 0 0 -1px; background:#fffdfa; }
.calendar-day.today { background:#fff1c6; box-shadow:inset 0 0 0 2px var(--yellow); }
.day-number { display:block; font-weight:800; }
.check-count { display:block; margin-top:14px; color:var(--muted); font-size:11px; }
.check-count b { color:var(--orange-dark); font-size:18px; }
.check-count small { display:block; margin-top:3px; }
.organization-grid { display:grid; gap:18px; }
.organization-grid > .card { min-width:0; padding:22px; }
.compact-table { padding:0; border:0; border-radius:0; box-shadow:none; }
.scan-action-btn { width:100%; min-height:82px; display:flex; justify-content:center; align-items:center; gap:12px; font-size:19px; }
.scan-mini { width:40px; height:40px; border-radius:12px; display:grid; place-items:center; background:rgba(255,255,255,.18); }
.camera-wrap { position:relative; overflow:hidden; aspect-ratio:3/4; max-height:68vh; border-radius:20px; background:#241c17; }
.camera-wrap video { width:100%; height:100%; object-fit:cover; }
.camera-reticle { position:absolute; width:min(68%,260px); aspect-ratio:1; inset:50% auto auto 50%; transform:translate(-50%,-50%); border-radius:24px; box-shadow:0 0 0 999px rgba(0,0,0,.28); }
.camera-reticle::before,.camera-reticle::after,.camera-reticle i::before,.camera-reticle i::after { content:""; position:absolute; width:42px; height:42px; border-color:#fff; border-style:solid; }
.camera-reticle::before { left:0; top:0; border-width:4px 0 0 4px; border-radius:16px 0 0; }
.camera-reticle::after { right:0; top:0; border-width:4px 4px 0 0; border-radius:0 16px 0 0; }
.camera-reticle i::before { left:0; bottom:0; border-width:0 0 4px 4px; border-radius:0 0 0 16px; }
.camera-reticle i::after { right:0; bottom:0; border-width:0 4px 4px 0; border-radius:0 0 16px; }

.member-shell { max-width:980px; }
.member-hero { position:relative; overflow:hidden; padding:48px; border-radius:34px; color:#fff; background:linear-gradient(135deg,#ffc65a,#f8883e); box-shadow:0 14px 35px rgba(190,111,42,.17); }
.member-hero::after { content:""; width:300px; height:300px; border:60px solid rgba(255,255,255,.11); border-radius:50%; position:absolute; right:-110px; top:-140px; pointer-events:none; }
.member-welcome { position:relative; z-index:1; min-height:230px; }
.member-welcome > span { font-size:18px; }
.member-welcome h1 { margin:14px 0 12px; font-size:clamp(42px,9vw,64px); line-height:1; }
.member-welcome p { margin:0; font-size:19px; }
.member-welcome .password-banner { width:max-content; max-width:100%; margin:28px 0 0; padding:10px 13px; border:1px solid rgba(255,255,255,.65); border-radius:14px; background:rgba(255,255,255,.12); color:#fff; }
.member-welcome .password-banner .btn { background:#fff; color:var(--orange-dark); }
.member-hero-bottom { position:relative; z-index:1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.member-hero-stat,.member-code-button { border:1px solid rgba(255,255,255,.72); background:rgba(255,255,255,.16); color:#fff; border-radius:24px; }
.member-hero-stat { min-height:142px; padding:24px; display:flex; flex-direction:column; align-items:flex-start; }
.member-hero-stat > span { font-size:14px; font-weight:700; }
.member-hero-stat > b { margin:12px 0 5px; font-size:34px; line-height:1; }
.member-hero-stat small { opacity:.9; }
.member-code-button { grid-column:1/-1; min-height:126px; padding:18px; display:flex; align-items:center; justify-content:center; gap:24px; text-align:left; }
.member-code-button img { width:88px; height:88px; padding:6px; background:#fff; border-radius:12px; }
.member-code-button b { display:block; font-size:20px; }
.member-code-button small { display:block; margin-top:6px; color:rgba(255,255,255,.86); }
.member-section { margin-top:26px; }
.member-section .section-title { margin:0 0 13px; }
.coupon-group-list { display:grid; gap:12px; }
.coupon-group-card { width:100%; min-height:105px; display:grid; grid-template-columns:120px minmax(0,1fr) auto; align-items:stretch; padding:0; overflow:hidden; border:1px solid var(--line); border-radius:22px; background:var(--paper); color:var(--brown); box-shadow:var(--shadow); text-align:left; }
.coupon-group-card:hover { transform:translateY(-1px); }
.coupon-group-color { display:grid; place-items:center; padding:16px; color:#fff; background:linear-gradient(145deg,#ffc252,#f47d38); border-radius:21px; text-align:center; }
.coupon-group-main { align-self:center; padding:17px 20px; min-width:0; }
.coupon-group-main b { display:block; font-size:17px; overflow-wrap:anywhere; }
.coupon-group-main small { display:block; margin-top:8px; color:var(--muted); }
.coupon-group-card em { align-self:center; padding-right:20px; color:var(--orange-dark); font-style:normal; font-weight:800; white-space:nowrap; }
.history-list { padding:4px 20px; }
.history-list .empty { display:block; }
.record-filter { display:flex; overflow:auto; gap:6px; margin-bottom:12px; padding-bottom:4px; }
.record-filter button { border:1px solid var(--line); border-radius:999px; padding:8px 13px; background:#fffdfa; color:var(--muted); white-space:nowrap; }
.record-filter button.active { background:var(--orange); color:#fff; border-color:var(--orange); }
.coupon-detail .coupon-qr,.member-qr-large { width:min(100%,300px); display:block; margin:4px auto 12px; padding:10px; border-radius:22px; background:#fff; box-shadow:var(--shadow); }
.coupon-description { font-size:16px; }
.rules { white-space:pre-wrap; line-height:1.75; padding:16px; border:1px solid #f0d27d; border-radius:16px; background:#fff2bd; }
.coupon-meta { display:flex; flex-direction:column; gap:7px; margin-top:14px; color:var(--muted); }
.coupon-meta b { color:var(--orange-dark); }
.qr-modal-card { text-align:center; }
.qr-modal-card p { color:var(--muted); }

@media (max-width: 900px) {
  .admin-shell { padding:14px; }
  .admin-topbar { margin-bottom:14px; }
  .app-layout { gap:14px; }
  .sidebar { position:sticky; top:0; z-index:10; border-radius:16px; }
  .overview-grid { grid-template-columns:1fr; }
  .overview-scan,.scan-only { min-height:220px; }
  .organization-grid { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .topbar .brand { font-size:17px; }
  .topbar .brand-mark { width:40px; height:40px; border-radius:13px; }
  .admin-topbar,.member-topbar { align-items:center; }
  .admin-topbar .form-actions,.member-topbar .form-actions { gap:5px; }
  .admin-topbar .btn,.member-topbar .btn { padding:8px 10px; font-size:12px; }
  .overview-scan,.scan-only { min-height:190px; }
  .scan-mark { width:98px; height:98px; border-radius:27px; }
  .shortcut-panel,.recent-panel { padding:18px; }
  .shortcut-grid button { min-height:82px; padding:13px 11px; gap:9px; }
  .shortcut-grid span { width:36px; height:36px; flex-basis:36px; border-radius:12px; }
  .shortcut-grid b { font-size:14px; }
  .member-stats,.record-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .member-stats .stat,.record-stats .stat { padding:16px; }
  .member-stats .num,.record-stats .num { font-size:25px; }
  .section-title { flex-wrap:wrap; }
  .stats-store { width:100%; }
  .calendar-card { padding:13px; }
  .calendar-day { min-height:70px; padding:6px 4px; }
  .check-count { margin-top:8px; font-size:9px; }
  .check-count b { font-size:14px; }
  .check-count small { font-size:9px; }
  .member-shell { padding:12px; }
  .member-hero { padding:30px 22px 22px; border-radius:28px; }
  .member-welcome { min-height:205px; }
  .member-welcome h1 { font-size:48px; }
  .member-welcome p { font-size:16px; }
  .member-welcome .password-banner { align-items:flex-start; flex-direction:column; font-size:12px; }
  .member-hero-stat { min-height:118px; padding:18px 15px; }
  .member-hero-stat > b { font-size:27px; }
  .member-code-button { min-height:112px; gap:16px; }
  .member-code-button img { width:76px; height:76px; }
  .coupon-group-card { grid-template-columns:94px minmax(0,1fr); min-height:98px; }
  .coupon-group-card em { display:none; }
  .coupon-group-main { padding:14px; }
  .history-list { padding:3px 14px; }
  .recent-list > div,.history-list > div { grid-template-columns:38px minmax(0,1fr) auto; gap:9px; }
  .recent-icon,.history-icon { width:36px; height:36px; border-radius:12px; }
  .recent-list strong,.history-list strong { font-size:13px; }
  .modal { padding:10px; }
  .modal-card { padding:18px; max-height:94vh; }
}
@media (max-width: 360px) {
  .member-hero-bottom { grid-template-columns:1fr; }
  .member-code-button { grid-column:1; }
  .shortcut-grid { grid-template-columns:1fr; }
  .member-stats,.record-stats { grid-template-columns:1fr; }
}

/* Refined interface */
:root {
  --cream: #fffaf2;
  --paper: #fffefa;
  --line: #eddcc7;
  --shadow: 0 14px 40px rgba(105, 70, 42, .075);
}
body {
  background:
    radial-gradient(circle at 7% 0%, rgba(250,199,100,.17), transparent 25rem),
    radial-gradient(circle at 95% 10%, rgba(244,134,67,.08), transparent 28rem),
    linear-gradient(180deg,#fffaf1 0%,#fffdf8 48%,#fffaf3 100%);
}
.shell { padding-top:28px; }
.card { border-color:rgba(232,211,188,.82); box-shadow:var(--shadow); }
.btn { transition:transform .18s ease,filter .18s ease,box-shadow .18s ease; }
.btn:hover { box-shadow:0 9px 22px rgba(220,105,46,.18); }
.btn-ghost:hover,.btn-secondary:hover { box-shadow:none; }
.topbar { min-height:54px; }
.brand { letter-spacing:.2px; }
.brand-mark { border:1px solid rgba(225,191,145,.58); box-shadow:0 9px 24px rgba(184,120,52,.16); }
.section-title h2 { font-size:23px; letter-spacing:-.2px; }
.input { min-height:46px; border-color:#ead8c1; background:rgba(255,254,250,.96); }
.modal { background:rgba(73,52,38,.38); }
.modal-card { border-radius:26px; }

/* Member: desktop has a genuine horizontal membership card. */
.member-shell { max-width:1120px; }
.member-topbar {
  margin-bottom:20px;
  padding:10px 13px;
  border-radius:18px;
  background:linear-gradient(135deg,#f5a044,#ef7d3c);
  box-shadow:0 12px 30px rgba(194,109,42,.14);
}
.member-topbar .brand > div:last-child { color:#fff; }
.member-topbar .btn-ghost { color:#fff; border-color:rgba(255,255,255,.65); background:rgba(255,255,255,.10); }
.member-shell > #banner .password-banner {
  margin:0 0 16px;
  padding:12px 15px;
  border:1px solid #f0d37d;
  border-radius:16px;
  background:#fff3c6;
  color:var(--brown);
  box-shadow:0 8px 24px rgba(122,86,52,.06);
}
.member-hero {
  min-height:360px;
  padding:38px;
  display:grid;
  grid-template-columns:minmax(300px,.88fr) minmax(470px,1.22fr);
  align-items:stretch;
  gap:34px;
  border-radius:32px;
  background:linear-gradient(135deg,#fac45b 0%,#f7a34c 55%,#f47b38 100%);
  box-shadow:0 20px 50px rgba(194,109,42,.16);
}
.member-hero::after {
  width:235px;
  height:235px;
  top:-112px;
  right:-72px;
  border-width:46px;
  opacity:.72;
}
.member-welcome {
  min-height:0;
  padding:14px 8px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:22px;
}
.member-welcome-copy { min-width:0; }
.member-welcome-copy > span { font-size:17px; font-weight:650; opacity:.88; }
.member-welcome h1 { margin:18px 0 16px; font-size:clamp(46px,5.2vw,62px); letter-spacing:-2px; }
.member-welcome p { font-size:18px; opacity:.92; }
.member-inline-qr { position:relative; z-index:2; flex:0 0 auto; padding:0; border:0; border-radius:15px; background:transparent; box-shadow:0 10px 28px rgba(111,61,25,.15); }
.member-inline-qr:hover { transform:scale(1.025); }
.member-inline-qr img { width:104px; height:104px; display:block; border-radius:15px; }
.member-hero-bottom {
  align-self:stretch;
  grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
  gap:12px;
}
.member-hero-stat,.member-code-button {
  border-color:rgba(255,255,255,.66);
  background:rgba(255,255,255,.145);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14);
  border-radius:21px;
}
.member-hero-stat {
  min-height:126px;
  padding:21px 22px;
  justify-content:center;
}
.member-hero-stat > span { opacity:.9; }
.member-hero-stat > b {
  width:100%;
  margin:10px 0 5px;
  font-size:clamp(26px,3vw,37px);
  line-height:1.08;
  letter-spacing:-1px;
  overflow-wrap:anywhere;
}
.member-code-button {
  min-height:112px;
  padding:16px 22px;
  justify-content:flex-start;
}
.member-code-button:hover { background:rgba(255,255,255,.22); }
.member-code-button img { width:82px; height:82px; border-radius:15px; }
.member-code-button b { font-size:19px; }
.member-section { margin-top:30px; }
.member-section > .section-title { padding:0 3px; }
.coupon-group-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.coupon-group-card {
  min-height:112px;
  grid-template-columns:112px minmax(0,1fr) auto;
  border-radius:23px;
  box-shadow:0 11px 34px rgba(105,70,42,.07);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.coupon-group-card:hover { transform:translateY(-2px); border-color:#e8bd86; box-shadow:0 15px 38px rgba(126,77,38,.11); }
.coupon-group-color { border-radius:22px; }
.coupon-group-color b { color:#fff; white-space:nowrap; }
.coupon-group-card em { display:inline-flex; align-items:center; justify-content:center; margin-right:16px; padding:9px 13px; border-radius:999px; background:var(--orange); color:#fff; box-shadow:0 6px 15px rgba(239,125,60,.18); }
.history-list { border-radius:23px; }
.history-list .history-detail { color:var(--brown); font-weight:700; }
.history-list strong { max-width:180px; text-align:right; white-space:normal; overflow-wrap:anywhere; }
.password-banner .btn { flex:0 0 auto; white-space:nowrap; }

/* Admin polish */
.admin-shell { max-width:1480px; }
.admin-topbar { margin-bottom:20px; gap:8px; }
.admin-topbar .brand { min-width:0; gap:clamp(8px,2vw,12px); }
.admin-brand-copy { min-width:0; }
.admin-brand-title { min-width:0; font-size:clamp(15px,4.8vw,24px); line-height:1.15; white-space:nowrap; }
.admin-topbar .brand-mark,.admin-topbar > .form-actions { flex:0 0 auto; }
.coupon-main h3 { font-size:clamp(17px,2.2vw,22px); overflow-wrap:anywhere; }
.app-layout { grid-template-columns:214px minmax(0,1fr); gap:22px; }
.sidebar { top:18px; padding:12px; border-radius:20px; }
.nav-btn { min-height:45px; padding:12px 15px; border-radius:12px; transition:background .17s ease,color .17s ease,transform .17s ease; }
.nav-btn:hover { background:#fff7e8; color:var(--brown); transform:translateX(2px); }
.nav-btn.active { background:linear-gradient(135deg,#fff1bb,#ffe7a6); box-shadow:inset 0 0 0 1px rgba(235,190,91,.15); }
.overview-grid { grid-template-columns:minmax(260px,.68fr) minmax(480px,1.32fr); }
.overview-scan,.scan-only { min-height:250px; }
.scan-mark { width:112px; height:112px; border-radius:30px; }
.shortcut-panel,.recent-panel { padding:24px; }
.shortcut-grid button { min-height:91px; background:linear-gradient(180deg,#fffefa,#fffbf4); transition:transform .17s ease,border-color .17s ease,box-shadow .17s ease; }
.shortcut-grid button:hover { box-shadow:0 10px 24px rgba(119,75,33,.08); }
.member-stats .stat,.record-stats .stat { padding:21px 22px; }
.stat .num { letter-spacing:-1px; }
.table-wrap.card { padding:10px 18px; }
.responsive-table tbody tr { transition:background .15s ease; }
.responsive-table tbody tr:hover { background:#fffaf0; }
.operation-panel { padding:28px; }
.calendar-card { padding:26px; }
.organization-grid > .card { border-radius:24px; }

/* Login polish */
.login-wrap { padding:32px 20px; }
.login-card { width:min(100%,440px); padding:34px 36px 36px; border-radius:30px; }
.login-head { margin-bottom:24px; }
.login-head h1 { margin:12px 0 0; font-size:29px; letter-spacing:1px; }
.login-head .brand-mark { width:72px; height:72px; border-radius:24px; }
.tabs { padding:5px; border-radius:16px; }
.tab { min-height:42px; border-radius:12px; }

@media (max-width: 980px) {
  .member-hero {
    grid-template-columns:minmax(250px,.76fr) minmax(410px,1.24fr);
    gap:22px;
    padding:30px;
  }
  .coupon-group-list { grid-template-columns:1fr; }
  .admin-page .app-layout { grid-template-columns:1fr; gap:14px; }
  .admin-page .sidebar { position:sticky; top:0; z-index:10; display:flex; overflow-x:auto; padding:7px; gap:4px; border-radius:15px; }
  .admin-page .nav-btn { width:auto; flex:0 0 auto; white-space:nowrap; margin:0; }
  .admin-page .nav-btn:hover { transform:none; }
  .admin-page .overview-grid { grid-template-columns:1fr; }
  .admin-page .organization-grid { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .member-shell { padding:14px; }
  .member-topbar { margin-bottom:14px; padding:8px 10px; }
  .member-shell > #banner .password-banner { align-items:flex-start; flex-direction:column; font-size:12px; }
  .member-hero {
    min-height:0;
    display:block;
    padding:28px 22px 22px;
    border-radius:27px;
  }
  .member-hero::after { width:210px; height:210px; top:-105px; right:-90px; border-width:40px; }
  .member-welcome { min-height:180px; padding:5px 2px 22px; grid-template-columns:minmax(0,1fr) auto; gap:15px; }
  .member-welcome h1 { margin:15px 0 13px; font-size:46px; }
  .member-welcome p { font-size:16px; }
  .member-inline-qr img { width:88px; height:88px; border-radius:13px; }
  .member-hero-bottom { grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
  .member-hero-stat { min-height:112px; padding:17px 15px; }
  .member-hero-stat > b { font-size:clamp(24px,7vw,31px); }
  .member-code-button { min-height:105px; padding:14px 18px; justify-content:center; }
  .member-code-button img { width:72px; height:72px; }
  .member-section { margin-top:24px; }
  .history-list > div { grid-template-columns:36px minmax(0,1fr); align-items:start; }
  .history-list strong { grid-column:2; justify-self:start; max-width:100%; text-align:left; }
  .coupon-group-card { grid-template-columns:82px minmax(0,1fr) auto; min-height:98px; }
  .coupon-group-color { border-radius:20px; }
  .coupon-group-color b { font-size:13px; }
  .coupon-group-card em { display:inline-flex; margin-right:9px; padding:8px 9px; font-size:12px; }
  .admin-shell { padding:13px; }
  .app-layout { grid-template-columns:1fr; gap:14px; }
  .sidebar { top:0; padding:7px; border-radius:15px; }
  .nav-btn:hover { transform:none; }
  .overview-grid { grid-template-columns:1fr; }
  .overview-scan,.scan-only { min-height:180px; }
  .scan-mark { width:94px; height:94px; }
}
@media (max-width: 420px) {
  .shell { padding:11px; }
  .member-hero { padding:24px 17px 18px; }
  .member-welcome { min-height:168px; gap:10px; }
  .member-welcome h1 { font-size:40px; }
  .member-inline-qr img { width:76px; height:76px; }
  .member-hero-stat { min-height:106px; }
  .member-hero-stat > span { font-size:12px; }
  .member-hero-stat > b { font-size:24px; letter-spacing:-.5px; }
  .coupon-group-card { grid-template-columns:72px minmax(0,1fr) auto; }
  .coupon-group-main { padding:12px 9px; }
  .coupon-group-card em { margin-right:7px; padding:7px 8px; }
  .login-card { padding:28px 20px 30px; }
}
