:root { color-scheme: light; font-family: Inter, "Microsoft YaHei", sans-serif; color: #17231d; background: #f4f6f5; }
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.eyebrow { margin: 0 0 7px; color: #78857e; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(120deg, #edf3ef 0 52%, #dde9e2 52%); }
.login-panel { width: min(420px, 100%); padding: 46px; background: #fff; border: 1px solid #d9e2dd; border-radius: 8px; box-shadow: 0 18px 50px rgba(22,54,39,.12); }
.brand-mark { width: 54px; height: 54px; margin-bottom: 28px; display: grid; place-items: center; color: #fff; background: #16784b; border-radius: 8px; font-size: 25px; font-weight: 800; }
.brand-mark.small { width: 38px; height: 38px; margin: 0; font-size: 18px; }
.login-panel h1 { margin: 0; font-size: 28px; }
.login-copy { margin: 12px 0 30px; color: #66736c; line-height: 1.7; }
.login-note { margin: 16px 0 0; color: #89948e; font-size: 12px; text-align: center; }
.primary, .secondary, .danger, .text-button, .icon-button, .nav-item { border: 0; }
.primary { min-height: 40px; padding: 0 18px; color: #fff; background: #16784b; border-radius: 6px; font-weight: 700; }
.primary:hover { background: #11633d; }
.primary:disabled { opacity: .55; cursor: wait; }
.wide { width: 100%; min-height: 46px; }
.secondary { min-height: 40px; padding: 0 18px; color: #304139; background: #edf1ef; border-radius: 6px; }
.danger { min-height: 40px; padding: 0 18px; color: #a62f2f; background: #f8eaea; border-radius: 6px; font-weight: 700; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; color: #eaf2ed; background: #153a2a; }
.brand-lockup { padding: 0 8px 28px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup span { margin-top: 2px; color: #aebfb5; font-size: 12px; }
nav { margin-top: 24px; display: grid; gap: 6px; }
.nav-item { width: 100%; height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 11px; color: #bfcfc5; background: transparent; border-radius: 6px; text-align: left; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.11); }
.nav-icon { width: 20px; color: #86b49a; text-align: center; }
.sidebar-account { margin-top: auto; padding: 18px 8px 0; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.text-button { padding: 5px; color: #9fb4a8; background: transparent; }
.workspace { min-width: 0; }
.topbar { height: 92px; padding: 0 40px; display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid #dfe5e1; }
.topbar h2 { margin: 0; font-size: 22px; }
.role-badge { margin-left: auto; padding: 6px 10px; color: #176943; background: #e4f0e9; border-radius: 5px; font-size: 12px; font-weight: 700; }
.icon-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; color: #516159; background: transparent; border-radius: 5px; font-size: 22px; }
#menuButton { display: none; }
.page-content { width: min(1280px, 100%); margin: 0 auto; padding: 34px 40px 60px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #dce4df; background: #fff; }
.metrics > div { min-height: 112px; padding: 24px 28px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #e3e9e5; }
.metrics > div:last-child { border-right: 0; }
.metrics span { color: #748079; font-size: 13px; }
.metrics strong { margin-top: 9px; font-size: 27px; }
.section-toolbar, .account-heading { margin-top: 36px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.section-toolbar h3, .account-heading h3 { margin: 0; font-size: 18px; }
.section-toolbar p, .account-heading p { margin: 6px 0 0; color: #7b8780; font-size: 13px; }
.table-wrap { margin-top: 16px; overflow-x: auto; background: #fff; border: 1px solid #dce4df; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 44px; padding: 0 20px; color: #748079; background: #f7f9f8; font-size: 12px; font-weight: 600; text-align: left; }
td { height: 70px; padding: 0 20px; border-top: 1px solid #e7ece9; font-size: 13px; }
.unit-name { display: block; font-weight: 700; }
.unit-address { display: block; max-width: 280px; margin-top: 5px; overflow: hidden; color: #87918b; font-size: 12px; text-overflow: ellipsis; }
.status { display: inline-flex; align-items: center; gap: 6px; color: #24734d; }
.status::before { content: ''; width: 7px; height: 7px; background: #2f9b67; border-radius: 50%; }
.status.inactive { color: #7c8580; }
.status.inactive::before { background: #a5aca8; }
.row-button { min-height: 32px; padding: 0 10px; color: #176943; background: #e9f2ed; border: 0; border-radius: 5px; }
.empty-state { padding: 72px 20px; color: #7d8982; text-align: center; }
.money-metrics { margin-top: 24px; }
.member-list { margin-top: 16px; background: #fff; border: 1px solid #dce4df; }
.member-row { min-height: 68px; padding: 12px 20px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid #e7ece9; }
.member-row:last-child { border-bottom: 0; }
.member-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #176943; background: #e3efe8; border-radius: 50%; font-weight: 700; }
.member-copy strong, .member-copy span { display: block; }
.member-copy span, .member-status { margin-top: 3px; color: #7c8881; font-size: 12px; }
.member-actions { display: flex; align-items: center; gap: 12px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.search-input { width: 250px; height: 40px; margin: 0; background: #fff; }
.form-note { margin: 18px 0 0; color: #7c8881; font-size: 12px; line-height: 1.6; }
.compact-select { width: 132px; margin: 0; }
.split-actions { display: grid; grid-template-columns: auto 1fr auto auto; }
.access-tools { margin-top: 22px; padding: 12px 0; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e1e7e3; color: #6f7d75; font-size: 12px; }
.check-all { display: flex; align-items: center; gap: 8px; color: #34443b; }
.check-all input, .access-row input { width: 16px; height: 16px; margin: 0; accent-color: #16784b; }
.access-list { max-height: 380px; overflow-y: auto; }
.access-row { min-height: 62px; padding: 10px 4px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 12px; border-bottom: 1px solid #e7ece9; cursor: pointer; }
.access-row strong, .access-row span { display: block; }
.access-row span { margin-top: 4px; color: #849088; font-size: 12px; font-weight: 400; }
.audit-heading { margin-top: 0; }
.audit-list { margin-top: 18px; background: #fff; border: 1px solid #dce4df; }
.audit-row { min-height: 70px; padding: 14px 20px; display: grid; grid-template-columns: 165px 150px 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid #e7ece9; }
.audit-row:last-child { border-bottom: 0; }
.audit-time, .audit-target { color: #7c8881; font-size: 12px; }
.audit-action { font-size: 13px; font-weight: 700; }
.audit-actor { font-size: 13px; }
.table-actions { display: flex; justify-content: flex-end; gap: 8px; }
.qr-content { padding: 26px; }
.qr-dialog { width: min(440px, calc(100% - 32px)); }
.qr-loading { height: 280px; margin-top: 22px; display: grid; place-items: center; color: #748079; background: #f5f7f6; border: 1px solid #e1e7e3; }
.qr-image { width: min(280px, 100%); aspect-ratio: 1; margin: 22px auto 0; display: block; object-fit: contain; border: 1px solid #e1e7e3; }
.qr-hint { margin: 14px 0 0; color: #7c8881; font-size: 12px; line-height: 1.6; text-align: center; }
dialog { width: min(720px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 80px rgba(18,41,30,.25); }
dialog::backdrop { background: rgba(15,29,22,.48); }
dialog form { padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-head h3 { margin: 0; font-size: 21px; }
.form-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { color: #47564e; font-size: 13px; font-weight: 600; }
label.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 10px 11px; color: #17231d; background: #fff; border: 1px solid #cfd9d3; border-radius: 5px; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: #24835a; box-shadow: 0 0 0 3px rgba(36,131,90,.1); }
textarea { resize: vertical; }
.dialog-actions { margin-top: 26px; display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; z-index: 20; top: 20px; left: 50%; max-width: calc(100% - 32px); padding: 10px 15px; color: #fff; background: #26352d; border-radius: 5px; opacity: 0; transform: translate(-50%, -10px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #9b3434; }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; left: -250px; width: 232px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 16px 0 40px rgba(18,41,30,.2); }
  #menuButton { display: grid; }
  .topbar { height: 78px; padding: 0 18px; }
  .page-content { padding: 24px 18px 48px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics > div { min-height: 82px; border-right: 0; border-bottom: 1px solid #e3e9e5; }
  .metrics > div:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  label.full { grid-column: auto; }
  .login-panel { padding: 34px 26px; }
  .unit-toolbar { align-items: flex-end; }
  .toolbar-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .search-input { width: 100%; }
  .audit-row { grid-template-columns: 1fr auto; gap: 7px 12px; }
  .audit-action { grid-column: 1 / -1; }
}
.operation-section { margin-top: 24px; padding: 24px; background: #fff; border: 1px solid #dfe7e2; border-radius: 8px; }
.operation-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.operation-heading h3 { margin: 0; font-size: 18px; }
.operation-heading p { margin: 5px 0 0; color: #77847c; font-size: 13px; }
.content-editor-list { display: grid; gap: 12px; }
.content-editor { display: flex; align-items: flex-end; gap: 16px; padding: 16px; border: 1px solid #e2e8e4; background: #f9fbfa; border-radius: 6px; }
.editor-fields { min-width: 0; flex: 1; display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 12px; }
.editor-fields label { color: #647168; font-size: 12px; }
.editor-fields label.wide { grid-column: span 2; }
.editor-fields input { width: 100%; box-sizing: border-box; margin-top: 6px; }
.editor-fields input[type="color"] { min-height: 40px; padding: 4px; }
.banner-image-control { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; color: #647168; font-size: 12px; }
.banner-image-control > span:first-child { grid-column: 1 / -1; }
.banner-upload-button { min-height: 40px; box-sizing: border-box; padding: 10px 14px; border: 1px solid #cfd9d3; border-radius: 5px; background: #fff; color: #176943; cursor: pointer; text-align: center; }
.banner-upload-button input { display: none; }
.banner-image-preview { position: relative; min-height: 74px; overflow: hidden; border: 1px solid #dce5df; border-radius: 5px; background: #eef2f0; }
.banner-image-preview img { width: 100%; height: 74px; display: block; object-fit: cover; }
.banner-image-preview button { position: absolute; right: 6px; bottom: 6px; padding: 5px 8px; border: 0; border-radius: 4px; background: rgba(126,27,27,.9); color: #fff; cursor: pointer; }
.editor-actions { width: 76px; flex: 0 0 76px; display: grid; gap: 12px; justify-items: end; padding-bottom: 6px; }
.toggle-label { display: flex; align-items: center; gap: 6px; color: #4c5d53; font-size: 13px; }
.danger-link { padding: 0; border: 0; background: transparent; color: #a62f2f; cursor: pointer; }
@media (max-width: 900px) {
  .content-editor { align-items: stretch; flex-direction: column; }
  .editor-fields { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-actions { width: 100%; display: flex; justify-content: space-between; }
}
.field-help { display: block; margin-top: 6px; color: #849088; font-size: 12px; }
.expired-label { display: inline-block; margin-left: 8px; color: #a62f2f; font-size: 12px; }
.expiry-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.expiry-summary div { padding: 14px; border: 1px solid #dfe6e2; border-radius: 6px; background: #f7f9f8; }
.expiry-summary span, .expiry-summary strong { display: block; }
.expiry-summary span { color: #718078; font-size: 12px; }.expiry-summary strong { margin-top: 5px; font-size: 22px; }
.expiry-query-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.expiry-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e1e7e3; border-radius: 6px; }
.expiry-row strong, .expiry-row div span { display: block; }.expiry-row div span { margin-top: 4px; color: #7b8780; font-size: 12px; }
.expiry-state { justify-self: end; padding: 5px 8px; border-radius: 4px; background: #e9f2ed; color: #176943; font-size: 12px; }
.expiry-state.expired { background: #f9e8e8; color: #a62f2f; }.expiry-state.seven { background: #fff0df; color: #a85a12; }.expiry-state.thirty { background: #fff7d8; color: #79610b; }.expiry-state.permanent { background: #edf0ee; color: #5f6c65; }
@media (max-width: 680px) { .expiry-summary { grid-template-columns: repeat(2, 1fr); }.expiry-row { grid-template-columns: minmax(0, 1fr) auto; }.expiry-row > span:nth-child(2) { display: none; } }
.upload-preview { grid-column: 1 / -1; height: 180px; overflow: hidden; border: 1px solid #dce5df; border-radius: 6px; background: #eef2f0; }
.upload-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.switch-setting { align-self: end; min-height: 42px; display: flex; align-items: center; gap: 8px; }
.wide-dialog { width: min(820px, calc(100vw - 32px)); }
.merchant-content-list { display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.merchant-content-row { min-height: 72px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px; border: 1px solid #e1e7e3; border-radius: 6px; }
.merchant-content-row img, .merchant-image-placeholder { width: 72px; height: 72px; border-radius: 5px; object-fit: cover; }
.merchant-image-placeholder { background: #16784b; color: #fff; font-weight: 700; line-height: 72px; text-align: center; }
.merchant-content-row strong, .merchant-content-row span { display: block; }
.merchant-content-row div > span { margin-top: 6px; color: #7b8780; font-size: 13px; }
.merchant-row-actions { display: flex; align-items: center; gap: 12px; }
.join-applications-list { display: grid; gap: 12px; max-height: 60vh; overflow: auto; }
.join-application { padding: 16px; border: 1px solid #dfe6e2; border-radius: 6px; background: #f9fbfa; }
.join-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.join-heading strong, .join-heading span { display: block; }
.join-heading span { margin-top: 5px; color: #758078; font-size: 13px; }
.join-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-top: 14px; color: #526158; font-size: 13px; }
.help-replies-list { display: grid; gap: 10px; max-height: 58vh; overflow: auto; }
.help-reply-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid #dfe6e2; border-radius: 6px; }
.help-reply-row p { margin: 6px 0; color: #34443b; line-height: 1.55; }.help-reply-row span { color: #89938d; font-size: 12px; }
.merchant-gallery-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.gallery-image { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #e8eeea; }
.gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.gallery-image span { position: absolute; left: 6px; top: 6px; min-width: 22px; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; text-align: center; }
.gallery-image button { position: absolute; right: 6px; bottom: 6px; padding: 5px 8px; border: 0; border-radius: 4px; background: rgba(126,27,27,.9); color: #fff; }
.merchant-menu-editor { padding-top: 16px; border-top: 1px solid #e1e7e3; }
.menu-editor-head, .menu-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-editor-head span { display: block; margin-top: 4px; color: #7b8780; font-size: 12px; }
#merchantMenuSections { display: grid; gap: 12px; margin-top: 12px; }
.menu-section-editor { padding: 12px; border: 1px solid #dce5df; border-radius: 6px; background: #f8faf9; }
.menu-section-title input { flex: 1; font-weight: 700; }
.menu-item-list { display: grid; gap: 8px; margin: 10px 0; }
.menu-item-editor { display: grid; grid-template-columns: 1.3fr .7fr .7fr 1.5fr auto; gap: 8px; align-items: center; }
.empty-state.compact { padding: 18px; }
@media (max-width: 760px) { .merchant-gallery-list { grid-template-columns: repeat(2, 1fr); }.menu-item-editor { grid-template-columns: 1fr 1fr; }.menu-item-editor input:nth-child(4) { grid-column: 1 / -1; } }
.wide-dialog { width: min(820px, calc(100vw - 32px)); }
.merchant-content-list { display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.merchant-content-row { min-height: 72px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px; border: 1px solid #e1e7e3; border-radius: 6px; }
.merchant-content-row img, .merchant-image-placeholder { width: 72px; height: 72px; border-radius: 5px; object-fit: cover; }
.merchant-image-placeholder { background: #16784b; color: #fff; font-weight: 700; line-height: 72px; text-align: center; }
.merchant-content-row strong, .merchant-content-row span { display: block; }
.merchant-content-row div > span { margin-top: 6px; color: #7b8780; font-size: 13px; }
.upload-preview { position: relative; }
.remove-image { position: absolute; right: 10px; bottom: 10px; padding: 8px 12px; border: 0; border-radius: 5px; background: rgba(126, 27, 27, .9); color: #fff; cursor: pointer; }
.image-editor-dialog { width: min(900px, calc(100vw - 32px)); }
.crop-stage { width: 100%; overflow: hidden; background: #17221d; border-radius: 6px; }
.crop-stage canvas { width: 100%; height: auto; display: block; }
.crop-controls { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.zoom-control { min-width: 240px; flex: 1; display: flex; align-items: center; gap: 12px; }
.zoom-control input { flex: 1; }
.position-controls { display: flex; align-items: center; gap: 8px; }
@media (max-width: 680px) { .crop-controls { align-items: stretch; flex-direction: column; }.position-controls { flex-wrap: wrap; } }
.withdrawal-list { margin-top: 18px; max-height: 520px; overflow: auto; }
.withdrawal-review-row { min-width: 680px; padding: 16px 0; border-bottom: 1px solid #e2e9e5; display: grid; grid-template-columns: minmax(180px, 1fr) 110px 80px 220px; gap: 16px; align-items: center; }
.withdrawal-review-copy { display: flex; flex-direction: column; gap: 4px; }
.withdrawal-review-copy span, .withdrawal-review-copy small { color: #78847d; font-size: 12px; }
.withdrawal-review-amount { font-size: 17px; }
.withdrawal-review-status { font-size: 13px; font-weight: 700; }
.withdrawal-review-actions { display: flex; justify-content: flex-end; gap: 8px; }
.compact { min-height: 34px; padding: 0 12px; }
.status-pending { color: #9a6823; }
.status-approved { color: #16784b; }
.status-rejected { color: #b14e4e; }
