:root{--green:#07633e;--dark:#073b2b;--line:#e2e8e0;--muted:#63736a;--paper:#f5f7f3;--red:#c22e27}*{box-sizing:border-box}body{margin:0;background:var(--paper);font:14px/1.55 -apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;color:#17291e}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{cursor:pointer;border:0;border-radius:9px;padding:10px 16px;background:var(--green);color:white;font-weight:650}button:hover{filter:brightness(.96)}button:disabled{opacity:.5;cursor:default}button.quiet{background:#edf2e9;color:#195336}button.danger{background:#fff0ed;color:var(--red)}a{color:var(--green);text-decoration:none}aside{position:fixed;inset:0 auto 0 0;width:228px;background:var(--dark);color:white;padding:30px 20px;display:flex;flex-direction:column;gap:18px}.brand{font-size:25px;font-weight:800;color:#f8ffdc}.brand small{display:block;margin:4px 0 0 27px;font-size:12px;color:#bdcfbe;font-weight:500}.environment{font-size:11px;border:1px solid #4a6f59;border-radius:20px;padding:5px 10px;align-self:flex-start;color:#d7e5bd}nav{display:flex;flex-direction:column;gap:5px;margin-top:10px}nav button{display:flex;align-items:center;gap:12px;background:transparent;text-align:left;color:#d6e5da;padding:12px 14px;font-size:14px}nav button.active{background:#e7f0d8;color:#134d31}nav button b{font-size:17px;width:20px;font-weight:400}.mobile-link{margin-top:auto;color:#d8ebcf;font-size:13px}#logout{border:1px solid #52735e;background:transparent;text-align:left}main{margin-left:228px;padding:32px 40px;max-width:1640px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}.eyebrow{font-size:10px;letter-spacing:2px;color:#728172;margin:0 0 7px}h1{font-size:28px;line-height:1.3;margin:0}#identity{font-size:12px;color:var(--muted)}h2{font-size:18px;margin:0 0 16px}h3{font-size:15px;margin:0 0 5px}p{margin:0 0 12px}.muted{color:var(--muted);font-size:12px}.notice{border:1px solid #eadbaf;padding:13px 16px;border-radius:10px;background:#fff9e9;color:#775620;font-size:13px;margin-bottom:20px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}.stat,.panel{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 2px 4px #12331304}.stat{padding:20px}.stat small{display:block;color:var(--muted);font-size:12px}.stat strong{display:block;font-size:29px;line-height:1.3;margin:8px 0 3px;font-variant-numeric:tabular-nums}.panel{padding:22px;margin-bottom:20px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}.toolbar p{margin:0}.actions{display:flex;gap:8px;flex-wrap:wrap}.actions button{font-size:12px;padding:7px 11px}table{width:100%;border-collapse:collapse;text-align:left;font-size:13px}th{font-size:11px;color:var(--muted);font-weight:600;background:#f6f8f3}td,th{padding:13px 12px;border-bottom:1px solid var(--line);vertical-align:top}tbody tr:last-child td{border:0}td small{display:block;color:var(--muted);font-size:11px;margin-top:4px}.tablewrap{overflow:auto}.badge{display:inline-block;font-size:11px;border-radius:20px;padding:3px 9px;white-space:nowrap;background:#e9f4df;color:#246031}.badge.warn{background:#fff1d0;color:#976717}.badge.bad{background:#fcebe7;color:#ab4033}.product-cell{display:flex;gap:10px;align-items:center}.product-thumb{width:48px;height:58px;border-radius:8px;background-position:center;background-size:cover;flex:none}.product-thumb.phone{background-image:url('/demo-product.jpg')}.product-thumb.headphones{background-image:url('/catalog-accessories.jpg');background-size:200% 100%;background-position:left center}.product-thumb.laptop{background-image:url('/catalog-accessories.jpg');background-size:200% 100%;background-position:right center}.login{max-width:420px;margin:70px auto;padding:30px}.login h2{font-size:23px}.login p{color:var(--muted)}label{display:block;margin-bottom:15px;font-size:12px;font-weight:600}input,select,textarea{width:100%;display:block;margin-top:6px;padding:10px 12px;min-height:42px;background:#fff;border:1px solid #d8e0d5;border-radius:8px;color:#17291e}textarea{min-height:90px;resize:vertical}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.formgrid .full{grid-column:1/-1}.error{color:var(--red);font-size:13px}.empty{padding:40px;text-align:center;color:var(--muted)}dialog{width:min(650px,calc(100% - 30px));max-height:90dvh;border:1px solid var(--line);border-radius:18px;padding:24px;color:#17291e}dialog::backdrop{background:#00251960;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.dialog-head h2{margin:0}.dialog-head button{width:32px;height:32px;padding:0;background:#edf2e9;color:#164e31;font-size:25px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);padding:12px 24px;border-radius:12px;background:#123e2c;color:white;box-shadow:0 4px 18px #00341830;z-index:10}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}.steps{display:grid;gap:12px}.steps a{padding:14px;background:#f2f6ec;border-radius:9px;display:block}.preview-link{font-size:13px}.code{font-family:ui-monospace,monospace;font-size:11px;overflow-wrap:anywhere}details{margin-top:8px}summary{cursor:pointer;color:var(--green)}pre{white-space:pre-wrap;font-size:11px;background:#f3f6f0;padding:12px;border-radius:8px}input[type=checkbox]{display:inline-block;width:18px;min-height:18px;vertical-align:middle;margin:0 7px 0 0}.check{display:flex;align-items:center;min-height:40px}.money{font-variant-numeric:tabular-nums;color:#bd2a20;font-weight:750}.small{font-size:11px}@media(max-width:1000px){main{padding:28px 22px}.stats{grid-template-columns:repeat(2,1fr)}.two-col{grid-template-columns:1fr}aside{width:195px;padding:25px 16px}main{margin-left:195px}}@media(max-width:650px){aside{position:static;width:auto;padding:18px;gap:12px}.brand small{display:inline;margin-left:8px}nav{flex-direction:row;overflow:auto;margin:0}nav button{white-space:nowrap;font-size:12px;padding:8px}.environment,.mobile-link,#logout{display:none}main{margin:0;padding:22px 14px}header{gap:14px}h1{font-size:23px}#identity{display:none}.panel{padding:16px}.formgrid{grid-template-columns:1fr}.formgrid .full{grid-column:auto}.stat{padding:16px}.stat strong{font-size:24px}.toolbar{align-items:flex-start}.actions{gap:5px}}
.login-caption{margin-top:16px}

/* Security settings use native, accessible form controls. */
.security-permission{width:18px;min-height:18px;display:inline-block;margin:0 8px 0 0;vertical-align:middle}
#content fieldset{border:1px solid #dce4df;border-radius:12px;padding:12px;margin:12px 0}
#content fieldset label{display:inline-flex;align-items:center;min-width:180px;margin:8px}
#content input[readonly]{font-family:monospace;letter-spacing:.08em}
#content [role=status]{color:#076239;overflow-wrap:anywhere}
/* Shared depth for dashboard panels and controls. */
main .panel,main .stat,#editor{box-shadow:0 2px 4px rgba(16,43,27,.04),0 8px 22px rgba(16,43,27,.07),inset 0 1px 0 rgba(255,255,255,.8)}
main button,#editor button{box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 2px 5px rgba(16,43,27,.12)}
main button:active,#editor button:active{transform:translateY(1px)}
/* One consistent, semantic SVG icon set for the navigation. */
#navigation .admin-nav-icon{display:block;width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#navigation button{min-height:44px}
#navigation button span{min-width:0}
#navigation button:focus-visible{outline:2px solid #e4efcf;outline-offset:2px}
#navigation button.active:focus-visible{outline-color:#459565}
aside{overflow-y:auto}
@media(max-width:650px){#navigation{max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}#navigation::-webkit-scrollbar{display:none}#navigation button{flex:0 0 auto}}

@media(max-width:650px){#logout:not([hidden]){display:block;align-self:flex-start;padding:8px 14px;font-size:12px}#navigation{scrollbar-width:thin}#navigation::-webkit-scrollbar{display:block;height:4px}#navigation::-webkit-scrollbar-thumb{background:#b5c9ad;border-radius:8px}.tablewrap{max-width:100%;overflow-x:auto}}
/* Keep long navigation and data tables usable on smaller screens. */
@media(min-width:651px){aside{min-height:0}#navigation{min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#6f8a72 transparent}.mobile-link{flex-shrink:0}#logout{flex-shrink:0}}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #9acb6a;outline-offset:2px}
.tablewrap{border:1px solid #e8eee5;border-radius:10px}th{letter-spacing:.02em}tbody tr:hover{background:#f8fbf6}.toolbar h2{margin-bottom:5px}.stat,.panel{box-shadow:0 5px 20px #143f2910}.stat strong{color:#123e2c}

/* Winning claim review states and confirmed recipient details. */
.claim-win{margin-top:5px;background:#fff0e9;color:#a8201a}
.claim-status{font-weight:650;color:#315b43}
.claim-recipient{padding:14px;margin:8px 0 18px;border:1px solid #d6e6d9;border-radius:10px;background:#f4faf4;color:#173d2a;overflow-wrap:anywhere}
.claim-recipient p{margin:6px 0 0}

/* Refined operations workspace: a consistent hierarchy for tables and review forms. */
:root{--admin-ink:#153126;--admin-muted:#50695a;--admin-border:#dbe6dc;--admin-soft:#f4f8f2;--admin-focus:#a6d46f}
body{color:var(--admin-ink);font-size:14px;line-height:1.55}
aside{background:#073c2b}
aside .brand{letter-spacing:-.025em}
#navigation{gap:4px}
#navigation button{border:1px solid transparent;border-radius:10px;color:#dcebe0;line-height:1.3;transition:background-color .15s ease,border-color .15s ease}
#navigation button:hover:not(.active){background:#ffffff12;border-color:#ffffff18;filter:none}
#navigation button.active{background:#e8f2db;border-color:#d6e7c1;color:#104b30;font-weight:700}
#navigation button:focus-visible{outline:3px solid #cdeca3;outline-offset:1px}
main>header{gap:24px;align-items:end;margin-bottom:26px}
main h1{font-size:clamp(24px,2.3vw,30px);letter-spacing:-.025em;color:#112f20}
#identity{padding:6px 10px;border:1px solid #dfe9dd;border-radius:8px;background:#f7faf5;color:#486354;overflow-wrap:anywhere}
main .notice{line-height:1.65}
main .stat,main .panel,#editor{border-color:var(--admin-border);box-shadow:0 3px 12px #1d4c3109,0 12px 30px #1d4c3109}
main .stat{min-width:0;padding:20px 22px}
main .stat small{color:#526a5b;font-size:12px;line-height:1.45}
main .stat strong{margin:9px 0 5px;overflow-wrap:anywhere;letter-spacing:-.025em}
main .panel{padding:24px}
main .toolbar{align-items:center;gap:18px;margin-bottom:20px}
main .toolbar h2{margin:0 0 5px;font-size:19px;line-height:1.35}
main .toolbar .muted{font-size:13px;line-height:1.55;color:#516b5a}
main .toolbar>button{flex-shrink:0;min-height:42px}
main button,#editor button{min-height:40px;border-radius:9px;box-shadow:none;line-height:1.3}
main .actions button{min-height:36px;padding:8px 12px;font-size:12px}
main button.quiet,#editor button.quiet{background:#edf5ea;color:#1a5737}
main button.danger,#editor button.danger{background:#fff0ed;color:#9f241c}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--admin-focus);outline-offset:2px}
.tablewrap{max-width:100%;border-color:#dfe9df;border-radius:12px;overflow:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
table{font-size:13px;line-height:1.5}
th{background:#f3f7f0;color:#50685a;font-size:12px;letter-spacing:0}
td,th{padding:14px 15px;border-color:#e8eee7}
td strong{color:#17392a}td small{color:#526a5b;font-size:12px;line-height:1.45}
tbody tr:hover{background:#f8fbf6}
.badge{padding:4px 9px;font-size:12px;font-weight:650;line-height:1.35}
.claim-win{background:#fff0ed;color:#9e211b}
.claim-status{margin-top:6px;color:#26563a;font-size:12px;line-height:1.45}
.claim-recipient{padding:16px;border-color:#cde0d0;background:#f2f8f1}
.claim-recipient strong{font-size:14px;line-height:1.5}.claim-recipient p{font-size:13px;line-height:1.6}
#editor{max-width:min(650px,calc(100% - 24px));max-height:min(90dvh,850px);padding:26px;border-color:#d9e5da}
#editor .dialog-head{gap:12px;padding-bottom:16px;border-bottom:1px solid #e5eee3}
#editor .dialog-head h2{font-size:20px;line-height:1.3}
#editor .dialog-head button{flex:none;width:44px;height:44px;min-height:44px;border-radius:10px;font-size:24px}
#editor label,#content form label{color:#294a37;font-size:13px;line-height:1.4}
#editor input:not([type=checkbox]),#editor select,#editor textarea,#content input:not([type=checkbox]):not([type=radio]),#content select,#content textarea{min-height:44px;border-color:#cbdacf;border-radius:9px;color:#17392a}
#editor textarea,#content textarea{min-height:96px;line-height:1.55}
#editor .error,#content .error{font-size:13px;line-height:1.5}
#editorBody .code,#content .code{font-size:12px;line-height:1.5}
@media(max-width:1000px){main .panel{padding:20px}.stats{gap:12px}}
@media(max-width:650px){
  aside{padding:16px 14px;gap:11px}
  aside .brand{font-size:21px;line-height:1.2}
  #navigation{margin:0;gap:6px;padding:2px 1px 6px}
  #navigation button{min-height:44px;padding:9px 12px;font-size:13px}
  aside .mobile-link{display:inline-flex;align-items:center;min-height:40px;margin:0;color:#e2efda}
  #logout:not([hidden]){min-height:40px;padding:8px 13px}
  main{padding:20px 14px}
  main>header{align-items:flex-start;flex-direction:column;gap:10px;margin-bottom:20px}
  #identity{display:block;max-width:100%;font-size:12px}
  main .panel{padding:16px}
  main .toolbar{align-items:flex-start;flex-wrap:wrap;gap:12px}
  main .toolbar>button,main .actions button{min-height:44px}
  .tablewrap table{min-width:680px}
  td,th{padding:12px}
  main .stat{padding:15px;min-width:0}
  main .stat strong{font-size:clamp(20px,6vw,26px)}
  #editor{padding:20px 16px;max-height:calc(100dvh - 24px)}
}
@media(max-width:360px){.stats{gap:8px}main .stat{padding:13px}main .toolbar h2{font-size:17px}}
@media(prefers-reduced-motion:reduce){#navigation button{transition:none}main button:active,#editor button:active{transform:none}}
#identity:empty{display:none}

/* Product gallery editor: the first card is the public cover. */
.product-gallery-editor{padding:16px;border:1px solid #dce8db;border-radius:12px;background:#f8fbf7;margin:0 0 16px;min-width:0}
.product-gallery-editor>strong{display:block;font-size:14px;color:#174a32;margin-bottom:4px}
.product-gallery-editor>p{margin:0 0 10px}
.product-gallery-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin-bottom:12px}
.product-gallery-item{min-width:0;background:#fff;border:1px solid #dfe9df;border-radius:10px;overflow:hidden}
.product-gallery-preview{position:relative;aspect-ratio:1;overflow:hidden;background:#edf3ed}
.product-gallery-preview>img,.product-gallery-preset{display:block;width:100%;height:100%;object-fit:cover;background-size:cover;background-position:center}
.product-gallery-preset.phone{background-image:url('/demo-product.jpg')}
.product-gallery-preset.headphones{background-image:url('/catalog-accessories.jpg');background-size:200% 100%;background-position:left center}
.product-gallery-preset.laptop{background-image:url('/catalog-accessories.jpg');background-size:200% 100%;background-position:right center}
.product-gallery-preview>span:not(.product-gallery-preset){position:absolute;top:6px;left:6px;padding:3px 7px;color:#fff;background:#075d39;border-radius:6px;font-size:11px;font-weight:700}
.product-gallery-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:6px}
.product-gallery-actions button{padding:6px 3px;font-size:11px;white-space:nowrap}
.product-gallery-add{display:flex;align-items:end;gap:8px}
.product-gallery-add label{flex:1;margin:0;min-width:0}
.product-gallery-add button{flex:none;min-height:42px}
.product-gallery-editor>label{margin:12px 0 0}
.product-gallery-editor [data-gallery-status]{margin:8px 0 0;color:#3b6550}
@media(max-width:480px){.product-gallery-list{grid-template-columns:repeat(2,minmax(0,1fr))}.product-gallery-editor{padding:12px}}
.product-thumb img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}

/* Clearly distinguish the selected draw period from past results. */
.draw-selected{padding:12px 14px;border:1px solid #cfe4d1;border-radius:10px;background:#eff8ef;color:#155f37;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
.draw-history-search{display:block;max-width:460px;margin:0 0 8px;font-weight:650;color:#274536}
.draw-history-search input{display:block;width:100%;margin-top:6px}
#drawHistoryCount{margin:4px 0 12px}
#drawHistoryTable .code{color:#ac1f20;font-weight:750;overflow-wrap:anywhere}
.draw-history-pages{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:14px;color:#53685b;font-size:13px}
.draw-history-pages[hidden]{display:none}
.draw-history-pages button{min-height:38px}
@media(max-width:480px){.draw-history-pages{justify-content:space-between;gap:6px}}

/* Read-only points history in the user directory. */
.admin-points .admin-points-balance{margin:14px 0;color:#174c31}
.admin-points .admin-points-balance strong{font-size:22px;font-variant-numeric:tabular-nums}
.admin-points-pagination{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:16px;flex-wrap:wrap}
.admin-points-pagination button{min-height:40px}

/* Align each record to the same reading edge and keep controls compact. */
#content .tablewrap:not(.catalog-table) tbody td{vertical-align:top;overflow-wrap:anywhere;word-break:normal}
#content .tablewrap:not(.catalog-table) tbody td.money{white-space:nowrap}
#content .tablewrap:not(.catalog-table) tbody td.money small{white-space:normal}
#content .tablewrap:not(.catalog-table) tbody td .actions{align-items:flex-start}
#content .tablewrap:not(.catalog-table) tbody td button{min-height:34px;padding:6px 10px;font-size:12px;line-height:20px}
#content .tablewrap:not(.catalog-table) tbody td details{margin:0}
#content .tablewrap:not(.catalog-table) tbody td details summary{min-height:34px;padding:6px 0;line-height:20px}
#content .tablewrap:not(.catalog-table) tbody td details pre{max-width:360px;white-space:pre-wrap;overflow-wrap:anywhere}
#content .admin-order-controls label{min-width:0;flex:0 1 180px}
#content .admin-order-controls input,#content .admin-order-controls select{width:100%;max-width:none}
#content .admin-order-controls>span{white-space:nowrap}
@media(max-width:650px){
  #content .tablewrap:not(.catalog-table) tbody td button{min-height:44px}
  #content .tablewrap:not(.catalog-table) tbody td details summary{min-height:44px;align-items:center}
  #content .admin-order-controls label{flex:1 1 140px}
  #content .admin-order-controls button{height:auto;min-height:44px}
}

/* Keep the log action on one line; long entries can scroll with the table. */
#content .tablewrap:has(details) table{min-width:720px}
#content .tablewrap:has(details) :is(th,td):last-child{width:80px;min-width:80px}
#content .tablewrap:has(details) summary{white-space:nowrap;word-break:keep-all}
#content .admin-order-controls{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
#content .admin-order-filters,#content .admin-order-pagination{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;min-width:0}
#content .admin-order-filters{flex:1 1 360px}
#content .admin-order-filters label{flex:0 1 180px;min-width:130px}
#content .admin-order-pagination{flex:0 1 auto;align-items:center}
#content .admin-order-pagination span{font-size:12px;line-height:1.4;white-space:nowrap}
@media(max-width:650px){#content .admin-order-filters label{flex:1 1 130px}#content .admin-order-pagination{width:100%;justify-content:flex-end}}
