/* UI craft guidance: unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */
:root{--admin-page:#f6f7f5;--admin-surface:#fff;--admin-line:#e1e6e1;--admin-text:#24372b;--admin-secondary:#586a5e}
body{background:var(--admin-page);color:var(--admin-text)}
aside{background:#073c2b}
aside .brand{font-weight:600;letter-spacing:0}
aside .environment{border-color:#617d69;border-radius:8px;color:#dce9df;font-size:12px;letter-spacing:0}
#navigation{gap:4px}
#navigation button{min-height:40px;gap:12px;padding:8px 12px;border-radius:8px;font-size:14px;font-weight:500;box-shadow:none}
#navigation button.active,#navigation button[aria-current="page"]{background:#1e5942;border-color:#3b795b;color:#fff;box-shadow:inset 3px 0 #d3ad56;font-weight:600}
#navigation .admin-nav-icon{width:20px;height:20px;flex-basis:20px;stroke-width:1.8}
aside .mobile-link{font-size:13px;line-height:20px}
#logout:not([hidden]){min-height:44px;border-radius:8px;box-shadow:none;font-weight:500}
main{min-width:0}
main>header{gap:16px;align-items:flex-end;margin-bottom:24px;padding-bottom:16px}
main>header .eyebrow{margin-bottom:8px;color:#64776a;font-size:11px;letter-spacing:.04em;line-height:16px}
main>header h1{color:var(--admin-text);font-size:24px;line-height:32px;font-weight:600;letter-spacing:0}
#identity:not(:empty){padding:8px 12px;border:1px solid var(--admin-line);border-radius:8px;background:#fff;color:var(--admin-secondary);font-size:13px;line-height:20px}
#content>.notice{margin-bottom:20px;padding:12px 16px;border:1px solid var(--admin-line);border-left:3px solid #c7a04c;border-radius:10px;background:#f7f8f4;color:var(--admin-secondary);font-size:13px;line-height:20px}
#content>.panel,#content .two-col>.panel,#content .stat{border:1px solid var(--admin-line);background:var(--admin-surface);box-shadow:0 2px 8px #00000008}
#content>.panel,#content .two-col>.panel{padding:24px;border-radius:14px}
#content .stats{gap:16px;margin-bottom:20px}
#content .stat{min-width:0;min-height:112px;padding:16px 20px;border-radius:12px}
#content .stat::before{display:none}
#content .stat small{color:var(--admin-secondary);font-size:13px;line-height:20px}
#content .stat strong{margin:8px 0 4px;color:#164c35;font-size:24px;line-height:28px;font-weight:600;letter-spacing:0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#content .stats .stat:nth-child(4) strong{color:#aa3028}
#content .two-col{gap:20px}
#content .two-col>.panel h2,#content .toolbar h2{margin:0 0 4px;color:var(--admin-text);font-size:18px;line-height:24px;font-weight:600}
#content .steps{gap:8px}
#content .steps a{min-height:44px;padding:10px 12px;border:1px solid var(--admin-line);border-radius:8px;background:#f8f9f7;color:#145e3f;font-size:13px;line-height:20px;font-weight:500}
#content .steps a:hover{background:#edf4ee;border-color:#cbdace}
#content .two-col>.panel p{color:var(--admin-secondary);font-size:13px;line-height:20px}
#content .toolbar{gap:16px;margin-bottom:20px}
#content .toolbar p,#content .muted{color:var(--admin-secondary);font-size:13px;line-height:20px}
#content thead th{padding:12px;background:#f3f6f3;color:#43584a;font-size:13px;line-height:20px;font-weight:600;letter-spacing:0}
#content tbody td{padding:12px;border-color:#e7ebe7;font-size:13px;line-height:20px}
#content tbody tr:hover{background:#f8faf7}
#content .tablewrap{border-color:var(--admin-line);border-radius:10px}
#content .tablewrap :is(th,td){vertical-align:middle}
#content button,#editor button{border-radius:8px;box-shadow:none;font-weight:600}
#content button.quiet,#editor button.quiet{background:#f3f6f2;color:#1d6140}
#content button.danger,#editor button.danger{background:#fbefec;color:#a32e27}
#content button:not(:disabled):hover,#editor button:not(:disabled):hover{filter:brightness(.97)}
#content :is(button,a,input,select,textarea,summary):focus-visible,#editor :is(button,input,select,textarea,summary):focus-visible{outline:2px solid #087448;outline-offset:2px}
#editor{width:min(720px,calc(100% - 32px));max-width:720px;max-height:calc(100dvh - 32px);border:1px solid var(--admin-line);border-radius:14px;background:#fff;box-shadow:0 12px 32px #00000024;overscroll-behavior:contain}
#editor .dialog-head{gap:16px;margin-bottom:20px;padding-bottom:16px;border-color:var(--admin-line)}
#editor .dialog-head h2{min-width:0;color:var(--admin-text);font-size:18px;line-height:24px;font-weight:600;overflow-wrap:anywhere}
#editor .dialog-head button{flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border-radius:8px;background:#f3f6f2;color:#23543c;font-size:24px;line-height:1}
#editorBody :is(p,small){overflow-wrap:anywhere}
@media(max-width:1000px){#content>.panel,#content .two-col>.panel{padding:20px}}
@media(max-width:650px){#navigation button{min-height:44px}main>header{align-items:flex-start;gap:12px}main>header h1{font-size:22px;line-height:28px}#content>.panel,#content .two-col>.panel{padding:16px}#content .stats{gap:8px}#content .stat{min-height:104px;padding:16px}#content .stat strong{font-size:22px;line-height:28px}#editor{width:calc(100% - 20px);max-height:calc(100dvh - 24px);padding:20px 16px}}
@media(prefers-reduced-motion:reduce){#navigation button{transition:none}}
/* The dialog remains scrollable without visible tracks; its sticky header stays within mobile padding. */
#editor{scrollbar-width:none}
#editor::-webkit-scrollbar{display:none}
@media(max-width:650px){#editor .dialog-head::before{left:-16px;right:-16px;top:-20px;height:20px}}
@media(max-width:360px){
 aside .brand{display:grid;grid-template-columns:26px auto;column-gap:6px;row-gap:0;align-items:center;justify-content:start;line-height:24px}
 aside .brand img{grid-row:1 / 3}
 aside .brand small{grid-column:2;display:block;margin:0;line-height:12px}
}

/* Short feedback overlays stay clear of the page actions and navigation. */
#toast{top:42dvh;bottom:auto;max-width:min(420px,calc(100vw - 32px));width:max-content;box-sizing:border-box;transform:translate(-50%,-50%);padding:10px 16px;text-align:center;line-height:1.5;overflow-wrap:anywhere;pointer-events:none}

/* Stable page edges and shared desktop control sizing across admin modules. */
html{scrollbar-gutter:stable}
#content .toolbar{min-width:0;align-items:flex-start}
#content .toolbar-copy{min-width:0;flex:1}
#content .toolbar-copy p:empty{display:none}
#content .toolbar .toolbar-actions{align-items:center;gap:8px}
#content .toolbar button{min-height:40px;padding:8px 16px;font-size:13px;line-height:20px;white-space:nowrap}
#content :is(#drawForm,#settingsForm) textarea,#editor #editorBody textarea{min-height:96px;height:auto;line-height:20px}
#content #settingsForm input{min-height:40px;padding:9px 11px;line-height:20px}
#content #settingsForm>h3{margin:24px 0 12px}
#content #settingsForm>h3:first-child{margin-top:0}
#editor .product-gallery-add button{height:40px;min-height:40px}

/* The private conversation list is part of the workspace, not the global nav. */
#content .admin-chat-workspace{grid-template-columns:280px minmax(0,1fr);min-height:420px;height:calc(100dvh - 320px);max-height:760px;border-color:var(--admin-line);border-radius:10px}
#content .admin-chat-sidebar{min-width:0;padding:0;gap:0;background:#f7f9f5;color:var(--admin-text)}
#content #adminChatList .admin-chat-thread{width:100%;min-width:0;padding:12px 14px;border:0;border-bottom:1px solid var(--admin-line);border-radius:0;background:transparent;color:var(--admin-text);box-shadow:none;white-space:normal;text-align:left}
#content #adminChatList .admin-chat-thread[aria-pressed=true]{background:#e9f2e8;color:#174b32}
#content #adminChatList .admin-chat-thread:hover{background:#eef4ec;filter:none}
#content #adminChatList .admin-chat-thread strong{font-size:13px;line-height:20px}
#content #adminChatList .admin-chat-thread p{margin:4px 0;font-size:12px;line-height:18px;color:var(--admin-secondary)}
#content #adminChatList .admin-chat-thread small{color:var(--admin-secondary);line-height:18px}
#content .admin-chat-conversation>header{display:flex;align-items:center;flex:none;min-height:52px;margin:0;padding:12px 16px;border-bottom:1px solid var(--admin-line);font-size:14px;line-height:20px}
#content .admin-chat-conversation .support-chat-form{align-items:flex-end;gap:8px;margin:0;padding:12px}
#content #adminChatInput{height:48px;min-height:48px;max-height:144px;margin:0;padding:12px;resize:vertical;line-height:22px;font-size:14px}
#content #adminChatSend{flex:none;min-height:48px;padding:12px 16px;line-height:22px}
#content .admin-chat-paging{flex:none;gap:8px;padding:12px}
#content .admin-chat-paging button{min-height:40px;padding:8px 12px;line-height:20px}
@media(max-width:1000px){#content .admin-chat-workspace{grid-template-columns:220px minmax(0,1fr)}}
@media(max-width:650px){
 #content .toolbar{flex-wrap:wrap;gap:12px}
 #content .toolbar-copy{flex-basis:100%}
 #content .toolbar button,#editor .product-gallery-add button{min-height:44px;height:auto}
 #content #settingsForm input{min-height:44px;font-size:16px}
 #content .admin-chat-workspace{grid-template-columns:minmax(0,1fr);height:auto;max-height:none}
 #content .admin-chat-sidebar{max-height:240px}
 #content .admin-chat-conversation{height:500px}
 #content #adminChatInput{font-size:16px}
 #content .admin-chat-paging button{min-height:44px}
}

/* Fine craft pass: unslop by Damir Sokolovsky (@heydamir), CC BY 4.0.
   Quiet operations chrome; business values carry the hierarchy. */
:root{--admin-page:#f6f7f6;--admin-line:#e2e6e3;--admin-text:#26332c;--admin-secondary:#59675f}
body{font-variant-numeric:tabular-nums}
main{padding:28px 32px}
main>header .eyebrow{letter-spacing:0;font-size:12px;font-weight:400}
aside{padding:24px 16px;gap:16px;overflow-y:auto;overscroll-behavior:contain}
aside .brand{font-size:22px;line-height:28px}
#navigation{margin-top:4px;gap:4px}
#navigation button{min-height:36px;padding:6px 12px;gap:10px;font-weight:400}
#navigation button.active{font-weight:500;box-shadow:inset 2px 0 #c5a255}
#navigation .admin-nav-icon{width:18px;height:18px;flex-basis:18px;stroke-width:1.5}
#content .stat strong,#content .stats .stat:nth-child(4) strong{color:var(--admin-text);font-weight:500}
#content .stat{min-height:104px;box-shadow:none}
#content>.panel,#content .two-col>.panel{box-shadow:none}
#content :is(button,input:not([type=checkbox],[type=radio],[type=hidden]),select),#editor :is(button,input:not([type=checkbox],[type=radio],[type=hidden]),select){min-height:40px;font-size:13px;line-height:20px}
#content button,#editor button{padding:8px 12px;font-weight:500;transition:background-color 140ms ease-out,color 140ms ease-out,border-color 140ms ease-out;transform:none}
#content button:active,#editor button:active{transform:none}
#content :is(input,select,textarea),#editor :is(input,select,textarea){border-color:#cfd7d1;accent-color:#07633e}
#content label,#editor label{font-weight:500}
#content :is(input,select,textarea):disabled,#editor :is(input,select,textarea):disabled{background:#f2f4f2;color:#69746c}
#content button:disabled,#editor button:disabled{opacity:1;background:#eef1ee;color:#849087;cursor:not-allowed}
#content .actions{align-items:center;gap:8px}
#content .actions button{min-height:36px;padding:6px 12px;white-space:nowrap}
#content .badge{font-size:12px;line-height:18px;font-weight:500;border-radius:6px;padding:3px 8px}
#content tbody td.money{color:var(--admin-text);text-align:right}
#content th.admin-numeric-heading{text-align:right}
#content td.admin-money-cell{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.admin-amount{display:inline-flex;align-items:baseline;gap:.25em;white-space:nowrap;font-variant-numeric:tabular-nums}
.admin-currency{font-size:.72em;font-weight:400;color:var(--admin-secondary)}
#content .stat .admin-currency{font-size:14px}
#content td small .admin-amount{font-size:inherit;font-weight:400}
#content .empty{padding:32px 20px;color:var(--admin-secondary);font-size:13px;line-height:24px}
#content .error:empty,#editor .error:empty{display:none}
#content .error:not(:empty),#editor .error:not(:empty){margin:12px 0;padding:12px;border:1px solid #ead1cd;border-radius:8px;background:#fff5f3;color:#9b3028;overflow-wrap:anywhere}
#content .admin-loading{display:flex;align-items:center;justify-content:center;gap:12px;min-height:160px}
#content .admin-loading::before{content:'';width:16px;height:16px;border:2px solid #dce4dd;border-top-color:#07633e;border-radius:50%;animation:admin-load .8s linear infinite}
@keyframes admin-load{to{transform:rotate(360deg)}}
#editor::backdrop{background:#14221a66;backdrop-filter:none}
#editor .dialog-head button{padding:0;min-height:40px;width:40px;height:40px;flex-basis:40px;font-weight:400}
#editor .admin-form-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:24px;padding-top:16px;border-top:1px solid var(--admin-line)}
#editor .admin-form-actions .error{flex-basis:100%}
#editor .formgrid{gap:0 16px}
#editor :is(input,select,textarea){max-width:100%}
#editor .code,#content .code{font-size:12px;line-height:20px}
#content .security-section{border-top:1px solid var(--admin-line);padding-top:20px;margin-top:24px}
#content .security-section h3{margin-bottom:12px}
#content .security-sessions{list-style:none;margin:0 0 16px;padding:0}
#content .security-sessions li{padding:12px 0;border-bottom:1px solid var(--admin-line);font-size:13px;overflow-wrap:anywhere}
#content .security-fields{max-width:760px}
#content .toolbar-actions{display:flex;flex-wrap:wrap;justify-content:flex-end}
#content .tablewrap{scrollbar-width:thin;scrollbar-color:#c4cec6 transparent}
#content td{overflow-wrap:anywhere}
#content td .actions{min-width:max-content}
#content :is(.admin-order-pagination,.admin-points-pagination,.admin-order-number-pages){font-variant-numeric:tabular-nums;align-items:center}
#content .login{margin:32px auto;padding:24px;max-width:440px}
#content .login h2{font-size:20px;font-weight:500;margin-bottom:8px}
@media(min-width:1001px){aside{width:228px}main{margin-left:228px}}
@media(max-width:1000px){main{padding:24px}#content .toolbar-actions{justify-content:flex-start}}
@media(max-width:650px){aside{overflow:visible;padding:16px}#navigation button{min-height:44px}main{padding:20px 16px}#content .login{margin:0 auto;padding:8px}#content .toolbar-actions{width:100%}#content :is(input:not([type=checkbox],[type=radio],[type=hidden]),select),#editor :is(input:not([type=checkbox],[type=radio],[type=hidden]),select){font-size:16px;min-height:44px}#editor .admin-form-actions{margin-top:20px}#content .actions button{min-height:40px}}
@media(prefers-reduced-motion:reduce){#content .admin-loading::before{animation:none}#content button,#editor button{transition:none}}
#content .admin-chat-empty{margin:0;padding:24px 16px;color:var(--admin-secondary);font-size:13px;line-height:24px}
#content .admin-chat-empty small{font-size:12px}
#content #adminChatMessages[data-empty=true]::before{content:'从左侧选择会话，查看消息并回复';display:block;margin:64px 20px;text-align:center;color:var(--admin-secondary);font-size:13px;line-height:24px}
#content .admin-chat-paging{align-items:center;justify-content:space-between;font-size:12px}
#content .admin-chat-conversation>header{font-weight:500}
/* Compact editable prize rows still retain a usable field width at narrow desktops. */
#content .wheel-prize-table :is(input,select){margin-top:0;min-height:40px;border-radius:8px;font-size:13px}
#content .wheel-prize-table td{vertical-align:top}
#content .wheel-table-footer{gap:12px;align-items:center;flex-wrap:wrap;padding-top:16px}
#content .wheel-row-actions{gap:8px}
#content .wheel-row-actions button{min-height:36px;white-space:nowrap}
#content .wheel-prize-table [data-wheel-field=probability],#content .wheel-prize-table [data-wheel-field=stock]{text-align:right;font-variant-numeric:tabular-nums}
#content .wheel-reward-setting input{text-align:right}
#content .admin-modal-cancel{display:none}
