*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:#1c1c1e;background:#fafafa;line-height:1.5}
.site-header{padding:1rem 1.5rem;background:#111;color:#fff}
.site-header a{color:#fff;text-decoration:none;font-weight:600}
.container{max-width:960px;margin:2rem auto;padding:0 1rem}
a{color:#0b5fff}
h1{margin-top:0}
.portal-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.portal-header nav{display:flex;gap:1rem;align-items:center;flex-wrap:wrap}
.auth-body{display:grid;place-items:center;min-height:100vh;padding:1rem}
.auth-card{width:100%;max-width:400px;background:#fff;padding:1.5rem;border:1px solid #e3e3e6;border-radius:10px}
.brand{display:block;margin-bottom:1rem;font-weight:700;text-decoration:none;color:#111}
label{display:block;margin-bottom:.9rem;font-size:.9rem;font-weight:500}
input{display:block;width:100%;margin-top:.25rem;padding:.55rem .65rem;border:1px solid #c9c9ce;border-radius:6px;font:inherit}
input:disabled{background:#f0f0f2}
input[hidden]{display:none}
input[type=checkbox]{display:inline;width:auto;margin:0 .35rem 0 0}
.check{font-weight:400}
fieldset{border:1px solid #e3e3e6;border-radius:6px;margin-bottom:1rem}
.btn{display:inline-block;padding:.55rem 1rem;background:#111;color:#fff;border:0;border-radius:6px;font:inherit;cursor:pointer;text-decoration:none}
.link{background:none;border:0;padding:0;color:#0b5fff;font:inherit;cursor:pointer}
.portal-header .link{color:#fff}
.inline{display:inline;margin:0}
.error{display:block;color:#b00020;font-weight:400;margin-top:.2rem}
.alert{padding:.6rem .8rem;border-radius:6px;margin-bottom:1rem;font-size:.9rem}
.alert.ok{background:#e6f6ec;color:#116329}
.alert.bad{background:#fdecee;color:#b00020}
.muted{color:#6b6b73}
.card-form{max-width:440px}
table{width:100%;border-collapse:collapse;background:#fff}
th,td{padding:.55rem .7rem;border-bottom:1px solid #e3e3e6;text-align:left;font-size:.9rem}
.row-between{display:flex;justify-content:space-between;align-items:center}
.badge{padding:.1rem .5rem;border-radius:99px;font-size:.78rem}
.badge.active{background:#e6f6ec;color:#116329}
.badge.disabled{background:#eee;color:#555}
.stats{display:flex;gap:1rem;flex-wrap:wrap}
.stat{background:#fff;border:1px solid #e3e3e6;border-radius:8px;padding:1rem 1.5rem;display:flex;flex-direction:column}
.stat strong{font-size:1.8rem}
@media (max-width:600px){table{display:block;overflow-x:auto}}
select,textarea{display:block;width:100%;margin-top:.25rem;padding:.55rem .65rem;border:1px solid #c9c9ce;border-radius:6px;font:inherit;background:#fff}
.card-form.wide{max-width:760px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 1rem}
.filters{display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0}
.filters input,.filters select{width:auto;margin:0}
.num{text-align:right;white-space:nowrap}
.thumb{width:40px;height:40px;object-fit:cover;border-radius:4px;display:block}
.danger{color:#b00020}
.badge.sale{background:#fff1d6;color:#8a5a00}
.badge.draft{background:#eee;color:#555}
.pager{display:flex;gap:1rem;align-items:center;margin-top:1rem}
.gallery{display:flex;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.gallery figure{margin:0;width:140px}
.gallery img{width:140px;height:140px;object-fit:cover;border-radius:6px;display:block}
.gallery figcaption{font-size:.8rem;display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.3rem}
section{margin-top:2rem}
input.narrow{width:90px}
.inline-form{display:flex;gap:.75rem;align-items:end;max-width:none}
.inline-form label{margin:0}
@media (max-width:600px){.grid2{grid-template-columns:1fr}}
.header-search{flex:1;max-width:320px}
.header-search input{margin:0;background:#fff}
.grid-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem}
.card{display:block;background:#fff;border:1px solid #e3e3e6;border-radius:8px;overflow:hidden;color:inherit;text-decoration:none}
.card:hover{border-color:#111}
.card-img{position:relative;aspect-ratio:1/1;background:#f0f0f2;display:grid;place-items:center}
.card-img img{width:100%;height:100%;object-fit:cover}
.card-img .tag{position:absolute;top:.5rem;left:.5rem}
.card-body{padding:.7rem .8rem;display:flex;flex-direction:column;gap:.2rem}
.price{font-weight:600}
.price s{font-weight:400;margin-left:.3rem}
.product-page{display:grid;grid-template-columns:1fr 1fr;gap:2rem}
.product-gallery img.big,.product-gallery .card-img.big{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:8px;background:#f0f0f2}
.thumbs{display:flex;gap:.5rem;margin-top:.5rem;flex-wrap:wrap}
.thumbs img{width:64px;height:64px;object-fit:cover;border-radius:4px;cursor:pointer;border:1px solid #e3e3e6}
.big-price{font-size:1.5rem}
.desc{line-height:1.6}
.btn.secondary{background:#fff;color:#111;border:1px solid #c9c9ce}
tr.unavailable{opacity:.6}
@media (max-width:700px){.product-page{grid-template-columns:1fr}.header-search{max-width:none;order:3;flex-basis:100%}}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.notice{background:#eef4ff;border:1px solid #cfe0ff;padding:.7rem .9rem;border-radius:6px}
.checkout{display:grid;grid-template-columns:1fr 340px;gap:2rem;align-items:start}
.checkout h2{margin:1.2rem 0 .6rem;font-size:1.1rem}
.summary{background:#fff;border:1px solid #e3e3e6;border-radius:8px;padding:1rem;position:sticky;top:1rem}
.summary h2{margin-top:0}
.plain{list-style:none;padding:0;margin:0}
.plain li{padding:.3rem 0;gap:1rem}
.grid3{display:grid;grid-template-columns:2fr 2fr 1fr;gap:0 1rem}
.pay{display:block;border:1px solid #c9c9ce;border-radius:6px;padding:.7rem .9rem;font-weight:400;cursor:pointer}
.pay input{display:inline;width:auto;margin-right:.4rem}
.big-btn{width:100%;padding:.8rem;font-size:1.05rem}
.order-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}
.info h3,section h3{margin-bottom:.3rem}
.timeline{padding-left:1.1rem}
.badge.st-pending{background:#fff1d6;color:#8a5a00}
.badge.st-processing{background:#e1ecff;color:#0b3fa0}
.badge.st-shipped{background:#ece1ff;color:#4a1fa0}
.badge.st-completed{background:#e6f6ec;color:#116329}
.badge.st-cancelled{background:#fdecee;color:#b00020}
@media (max-width:800px){.checkout{grid-template-columns:1fr}.summary{position:static;order:-1}.grid3{grid-template-columns:1fr}}
.badge.cm-pending{background:#fff1d6;color:#8a5a00}
.badge.cm-approved{background:#e1ecff;color:#0b3fa0}
.badge.cm-paid{background:#e6f6ec;color:#116329}
.badge.cm-rejected{background:#fdecee;color:#b00020}
.saved-addresses a.on{font-weight:600;text-decoration:none;color:inherit}
.addr-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem;margin:1rem 0}
.addr{background:#fff;border:1px solid #e3e3e6;border-radius:8px;padding:1rem}
.addr form{display:inline}
.wish{margin-top:1rem}
.brand-logo{height:36px;width:auto;max-width:96px;object-fit:contain;vertical-align:middle;border-radius:4px}
.brand-line{display:flex;align-items:center;gap:.5rem}
.ptype{display:flex;flex-wrap:wrap;gap:.5rem 1.5rem;align-items:center}
.ptype .radio{display:inline-flex;align-items:center;gap:.4rem;margin:0;font-weight:500}
.ptype .radio input{width:auto;margin:0}
.var-head,.var-row{display:grid;grid-template-columns:1.2fr 1fr 1fr 1fr 2rem;gap:.5rem;align-items:center}
.var-head{font-size:.8rem;color:#6b6b73;margin-bottom:.25rem}
.var-row{margin-bottom:.4rem}
.var-row input{min-width:0;width:100%}
.var-row .icon-btn{font-size:1.2rem;line-height:1;cursor:pointer}
.var-row.has-error input.err{border-color:#b00020}
@media (max-width:700px){.var-head{display:none}.var-row{grid-template-columns:1fr 1fr;padding:.5rem;border:1px solid #e3e3e6;border-radius:6px}.var-row .icon-btn{justify-self:end}}
.var-row .error{grid-column:1/-1}
.images-field .img-drop{border:2px dashed #c9c9ce;border-radius:10px;padding:.75rem;cursor:pointer;transition:border-color .15s,background .15s}
.images-field .img-drop.over{border-color:#0b5fff;background:rgba(11,95,255,.06)}
.images-field .img-drop.full{cursor:default}
.images-field .img-drop:focus-visible{outline:2px solid #0b5fff;outline-offset:2px}
.images-field.busy .img-drop{opacity:.6}
.img-tiles{display:flex;flex-wrap:wrap;gap:.6rem}
.img-tile{position:relative;width:112px;height:112px;border-radius:8px;overflow:hidden;background:#f1f1f4;border:1px solid #e3e3e6;cursor:grab;flex:0 0 auto}
.img-tile:focus-visible{outline:2px solid #0b5fff;outline-offset:2px}
.img-tile.dragging{opacity:.4}
.img-tile.drop-target{outline:2px dashed #0b5fff;outline-offset:2px}
.img-tile.broken::after{content:"?";position:absolute;inset:0;display:grid;place-items:center;color:#8a8a93}
.img-thumb{width:112px;height:112px;display:block}
.img-badge{position:absolute;left:4px;top:4px;background:#111;color:#fff;font-size:.7rem;padding:.1rem .4rem;border-radius:4px}
.img-x{position:absolute;right:4px;top:4px;width:22px;height:22px;border:0;border-radius:50%;background:rgba(0,0,0,.65);color:#fff;font-size:1rem;line-height:1;cursor:pointer;padding:0}
.img-x:hover{background:#b00020}
.img-add{display:grid;place-items:center;border:2px dashed #c9c9ce;background:transparent;color:#8a8a93;font-size:2rem;cursor:pointer}
.img-hint{margin:.6rem 0 0;color:#6b6b73;font-size:.9rem}
:root[data-theme=dark] .img-tile{background:#26262b;border-color:#3a3a42}
:root[data-theme=dark] .images-field .img-drop,:root[data-theme=dark] .img-add{border-color:#4a4a54}
textarea[hidden]{display:none}
.rt-field>label{display:block;margin-bottom:.25rem}
.rt-field .ql-toolbar.ql-snow{border:1px solid #c9c9ce;border-radius:6px 6px 0 0;background:#fafafb}
.rt-field .ql-container.ql-snow{border:1px solid #c9c9ce;border-top:0;border-radius:0 0 6px 6px;font:inherit}
.rt-field .ql-editor{min-height:140px;max-height:360px;overflow-y:auto;font-size:.95rem;line-height:1.5}
.rt-field .ql-editor.ql-blank::before{font-style:normal;color:#8a8a93}
.desc p,.desc ul,.desc ol,.desc blockquote,.desc h2,.desc h3{margin:.5em 0}
.desc ul,.desc ol{padding-left:1.4em}
.desc blockquote{border-left:3px solid #d5d5da;padding-left:.8em;color:#4a4a52}
.desc a{color:#0b5fff;text-decoration:underline}
:root[data-theme=dark] .rt-field .ql-toolbar.ql-snow{background:#202026;border-color:#3a3a42}
:root[data-theme=dark] .rt-field .ql-container.ql-snow{border-color:#3a3a42;background:#17171c;color:#e8e8ec}
:root[data-theme=dark] .rt-field .ql-snow .ql-stroke{stroke:#d0d0d6}
:root[data-theme=dark] .rt-field .ql-snow .ql-fill{fill:#d0d0d6}
:root[data-theme=dark] .rt-field .ql-snow .ql-picker,:root[data-theme=dark] .rt-field .ql-snow .ql-picker-label{color:#d0d0d6}
:root[data-theme=dark] .rt-field .ql-snow .ql-picker-options{background:#202026;border-color:#3a3a42}
:root[data-theme=dark] .rt-field .ql-editor.ql-blank::before{color:#7d7d86}
:root[data-theme=dark] .desc blockquote{border-color:#4a4a54;color:#b8b8c0}
.stock-note{margin:.2rem 0 .6rem;font-size:.92rem}
