:root,html[data-theme="light"],html[data-theme="dark"]{--primary:#70283f;--secondary:#70283f;--accent:#f0dce5;--primary-fg:#fff;--body-fg:#30242b;--body-bg:#faf8f9;--body-quiet-color:#7d6872;--body-loud-color:#402d37;--header-color:#fff;--header-branding-color:#fff;--header-bg:#70283f;--header-link-color:#fff;--breadcrumbs-fg:#e9d7e0;--breadcrumbs-bg:#8a4863;--link-fg:#863e5c;--link-hover-color:#512236;--link-selected-fg:#672b46;--hairline-color:#e3d6df;--border-color:#d9c9d1;--error-fg:#b72a48;--message-success-bg:#e7f0e5;--message-warning-bg:#fff2d6;--message-error-bg:#ffe3e8;--darkened-bg:#f1eaee;--selected-bg:#eee1e8;--selected-row:#f5e8ed;--close-button-bg:#85717d;--close-button-hover-bg:#5c4150}body{font-size:14px;font-family:Arial,Helvetica,sans-serif}#header{padding:20px 35px}#branding #site-name a{font-weight:600;font-size:22px;letter-spacing:-.5px}.admin-dashboard{padding:8px 12px;font-size:13px!important}#content{padding:30px 35px}.module{border-radius:9px;overflow:hidden;border:1px solid #e3d8de}.module h2,.module caption{font-size:14px;padding:13px 16px}.submit-row{border-radius:10px}input[type=text],input[type=password],input[type=email],input[type=number],input[type=url],textarea,select{border-radius:7px;padding:10px;font-size:14px}input[type=submit],.button{border-radius:8px!important;padding:12px 18px}.form-row{padding:18px 15px}#changelist .actions{padding:13px}.aligned label{font-size:14px}td,th{padding:13px 15px}.zone-editor{max-width:850px}.zone-editor textarea{display:block;width:100%;max-width:700px}.zone-editor .zone-map{z-index:1}.zone-editor p{margin-left:0!important;padding-left:0!important}.zone-editor button{padding:8px 12px;border:1px solid #bea5b3;border-radius:5px;background:#f8f2f5;color:#70283f}#nav-sidebar{font-size:13px}.theme-toggle{display:none}@media(max-width:767px){#header{padding:16px}#content{padding:20px 15px}.admin-dashboard{font-size:12px!important}.zone-editor .zone-map{min-width:0!important;width:100%}.aligned .form-row>div{width:100%}}
/* Workspace layout and comfortable form controls. */
:root,html[data-theme=light],html[data-theme=dark]{--header-bg:#fff;--header-color:#786672;--header-branding-color:#70283f;--header-link-color:#70283f;--breadcrumbs-bg:#f7f3f5;--breadcrumbs-fg:#8c7883;--body-bg:#f7f5f6;--darkened-bg:#faf7f9;--selected-row:#faf1f5}
#header{min-height:76px;box-sizing:border-box;padding:18px 30px;border-bottom:1px solid #e8dfe4;gap:25px}#branding #site-name a{color:#70283f;font-size:26px}.admin-brand-caption{display:block;font-size:11px;font-weight:400;letter-spacing:.3px;color:#8a7580;margin:6px 0 0 28px}#user-tools{display:flex;align-items:center;flex-wrap:wrap;gap:13px;font-size:11px;letter-spacing:0;text-transform:none}#user-tools a,#logout-form button{color:#786572;border:0;font-size:12px}.breadcrumbs{padding:14px 30px!important;font-size:12px!important}.breadcrumbs a{color:#70283f!important}.admin-side{width:237px;flex:0 0 237px;box-sizing:border-box;background:white;border-right:1px solid #e7dfe3;padding:22px 15px;position:sticky;top:0;height:calc(100vh - 20px);overflow-y:auto}.main>.content{min-width:0;width:100%}.main.shifted>.content{max-width:none}#content{padding:30px;max-width:1440px;box-sizing:border-box;width:100%}#content h1{font-size:28px;font-weight:600;letter-spacing:-.8px;color:#362a32;margin:0 0 25px}#content h2{color:#53404c}#content .module{background:#fff;border-radius:14px;border:1px solid #e6dce2;margin-bottom:20px;overflow:visible}#content .module h2,#content .module caption{border-radius:13px 13px 0 0;background:#fff;color:#49313f;padding:20px 24px;font-weight:600;border-bottom:1px solid #eee7eb;letter-spacing:0;font-size:16px;text-transform:none}#content fieldset .description{margin:0;padding:16px 24px 8px;color:#8a737f;font-size:13px;line-height:1.6}.form-row{padding:20px 24px;border-bottom:1px solid #f0eaee;overflow:visible}.form-row:last-child{border-bottom:0}.aligned label{color:#5d4754;font-size:13px;line-height:1.5;padding-top:12px;width:180px}.aligned label.required{font-weight:600}#content input[type=text],#content input[type=password],#content input[type=email],#content input[type=number],#content input[type=url],#content textarea,#content select{box-sizing:border-box;border:1px solid #dcd0d7;border-radius:9px;padding:11px 13px;font:14px/1.5 Arial,Helvetica,sans-serif;color:#352b32;background:#fff;min-height:44px;max-width:100%}#content select{height:auto;min-width:230px;padding-right:35px}#content select[multiple]{min-height:150px}#content input[type=checkbox]{accent-color:#70283f;width:17px;height:17px}#content .vTextField{width:420px}#content textarea{width:620px;min-height:115px}#content .vIntegerField,#content input[type=number]{width:180px}#content input:focus,#content select:focus,#content textarea:focus{outline:3px solid #ecd7e2;outline-offset:2px;border-color:#a7748c}.related-widget-wrapper{float:none;display:inline-flex;flex-wrap:wrap;align-items:center;gap:9px;max-width:100%}.related-widget-wrapper select{flex:0 1 auto}.related-widget-wrapper-link{display:inline-flex;align-items:center;justify-content:center;padding:5px;min-width:20px;min-height:22px}.related-widget-wrapper-link img{vertical-align:middle}.help,.helptext{font-size:12px!important;color:#927c88!important;line-height:1.6!important}form .aligned p.help,form .aligned div.help{margin-left:180px;padding-left:10px;max-width:620px}.submit-row{position:sticky;bottom:0;z-index:5;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:flex-end;background:#fffcfefa;border:1px solid #e4d7df;padding:17px 20px;box-shadow:0 -6px 25px #30242b07}#content .submit-row input{margin:0;padding:13px 18px;min-height:44px}.submit-row input.default{background:#70283f}.submit-row input:not(.default){background:#f2e9ee;color:#70283f}.form-jumps{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 22px}.form-jumps a{padding:8px 12px;border:1px solid #e4d9df;border-radius:30px;color:#826170;font-size:12px;background:#fff}.form-jumps a:hover{background:#efe1e7}fieldset.module{scroll-margin-top:15px}.object-tools{margin-top:-53px}.object-tools a:link,.object-tools a:visited{background:#70283f;border-radius:9px;padding:12px 17px;font-size:12px;text-transform:none;letter-spacing:0}.object-tools a.addlink{padding-right:30px}#changelist{background:transparent!important;gap:20px}#changelist .changelist-form-container{background:#fff;border:1px solid #e7dee3;border-radius:14px;overflow:hidden;min-width:0}#changelist #toolbar{padding:18px 22px;background:#fff;border:0}#changelist #toolbar form{display:flex;align-items:center;flex-wrap:wrap;gap:10px}#changelist #toolbar #searchbar{width:300px;height:44px}#changelist #toolbar input[type=submit]{min-height:44px;padding:10px 18px;border:1px solid #d8c5cf;color:#70283f;background:#fff}#changelist .actions{padding:14px 22px;border-top:1px solid #eee6eb;background:#fff}#changelist .actions select{min-width:180px;font-size:12px;min-height:36px;padding:6px 26px 6px 10px}#changelist .actions .button{border:1px solid #d7c8d0;background:#f8f3f6;color:#70283f;padding:8px 12px;min-height:36px}#changelist table thead th{background:#faf7f9;text-transform:none;font-size:12px;color:#8b7580;border-bottom:1px solid #e9e0e5}#changelist table tbody tr{background:#fff}#changelist table tbody tr:hover{background:#fcf7fa}#changelist table td,#changelist table th{vertical-align:middle;border-bottom:1px solid #eee7eb;padding:16px 18px}#changelist table td:first-child,#changelist table th:first-child{padding-right:7px}#changelist .product-thumb{display:block;width:60px;height:70px;object-fit:cover;border-radius:9px}#changelist td.field-thumbnail{width:60px;padding-left:8px;padding-right:0}#changelist-filter{border:1px solid #e7dee3;border-radius:14px;background:#fff;overflow:hidden;flex-basis:190px}#changelist-filter h2{background:#fff;color:#523b48;font-size:14px;padding:19px}#changelist-filter h3,#changelist-filter details summary{font-size:13px}#changelist-filter ul{padding:5px 18px 15px}#changelist .paginator{padding:18px 22px;border:0;font-size:12px}.errornote{border-radius:10px;padding:16px!important}.errorlist{color:#b02d4b}.zone-editor .zone-map{max-width:100%}.login #container{border-radius:18px!important;box-shadow:0 16px 60px #46233814}.login #content{padding:25px!important}.login #header{border-radius:18px 18px 0 0}.login #branding #site-name a{font-size:26px}.login #content h1{font-size:21px}.login .submit-row{position:static;box-shadow:none;border:0;padding:10px 0;justify-content:stretch}.login .submit-row input{width:100%}body.popup #content{padding:20px}body.popup .submit-row{position:static}
@media(max-width:1100px){.admin-side{width:205px;flex-basis:205px;padding:20px 10px}#content{padding:25px 20px}.aligned label{float:none;display:block;width:auto;padding:0 0 9px}.aligned .flex-container{display:block}form .aligned p.help,form .aligned div.help{margin-left:0;padding-left:0}.aligned .checkbox-row{display:flex;align-items:center;gap:8px}.aligned .checkbox-row label{padding:0}.aligned .related-widget-wrapper{max-width:100%}#changelist-filter{flex-basis:160px}}
@media(max-width:767px){#header{padding:18px 20px;align-items:flex-start;gap:18px}#user-tools{justify-content:flex-start;text-align:left;font-size:11px;margin:0}#branding{float:none}.main{display:block}.admin-side{width:100%;height:auto;position:static;padding:12px 16px;border-right:0;border-bottom:1px solid #e8dfe4}.main>.content{width:100%}#content{padding:24px 16px}#content h1{font-size:24px;padding:0}.object-tools{margin:0 0 22px}.object-tools li{padding:0}#content .module h2{padding:17px 18px}.form-row{padding:18px}#content input:not([type=checkbox]):not([type=submit]):not([type=radio]),#content select,#content textarea{max-width:100%;min-width:0}.related-widget-wrapper{display:flex}.related-widget-wrapper select{flex:1;min-width:150px!important}.submit-row{position:static;padding:16px;flex-direction:column;align-items:stretch}.submit-row input{width:100%}.form-jumps{flex-wrap:nowrap;overflow:auto;padding-bottom:6px}.form-jumps a{white-space:nowrap}#changelist #toolbar{padding:15px}#changelist .actions{padding:12px 15px}.breadcrumbs{padding:12px 20px!important}.form-row .flex-container{display:block}.aligned .checkbox-row{display:flex}.field-image_preview img{max-width:100%}}
#changelist td.field-price_rub,#changelist td.field-total_rub,#changelist td.field-balance_rub,#changelist td.field-amount_rub{white-space:nowrap}.admin-side{scrollbar-width:thin;scrollbar-color:#dfd3da transparent}#content .field-image_preview img{width:170px!important;max-height:210px;object-fit:cover}.workspace-nav a{transition:background .15s}#changelist td.field-name{min-width:100px}

/* Collapsible fieldsets use one full-width header, not a nested heading card. */
#content fieldset.module>details>summary{display:flex;align-items:center;gap:14px;box-sizing:border-box;min-height:62px;width:100%;margin:0;padding:20px 24px;border:0;border-radius:13px;background:#fff;color:#49313f;list-style:none;cursor:pointer}
#content fieldset.module>details>summary::-webkit-details-marker{display:none}
#content fieldset.module>details>summary::marker{content:""}
#content fieldset.module>details>summary::before{content:"";display:block;flex:0 0 7px;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg)}
#content fieldset.module>details[open]>summary{border-radius:13px 13px 0 0;border-bottom:1px solid #eee7eb}
#content fieldset.module>details[open]>summary::before{transform:rotate(45deg)}
#content fieldset.module>details>summary:hover{background:#fcf8fa}
#content fieldset.module>details>summary:focus-visible{outline:2px solid #a7748c;outline-offset:-4px}
#content fieldset.module>details>summary>.fieldset-heading{display:block;flex:1;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:inherit;font-size:16px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:767px){#content fieldset.module>details>summary{padding:17px 18px;min-height:58px}}

#header{height:auto;flex-shrink:0}#branding .admin-brand-link{display:block;line-height:1.3}#branding .admin-brand-link img{display:block;width:160px;height:66px;max-width:100%;object-fit:contain;object-position:left center}.admin-brand-link .admin-brand-caption{margin-left:0}@media(max-width:767px){#branding .admin-brand-link img{width:140px;height:58px}}

/* Match Django's main-container selector so mobile navigation sits above forms. */
#content-main,.form-row .flex-container,.related-widget-wrapper{min-width:0}
#content .form-row input[type=file]{box-sizing:border-box;max-width:100%}
#changelist .results{overflow-x:auto}
#changelist-filter{margin:0}
@media(max-width:1024px){
  #container>.main{display:block}
  #container>.main>.content{width:100%;max-width:100%;min-width:0}
  #container>.main>.admin-side{width:100%;height:auto;position:static;box-sizing:border-box;border-right:0;border-bottom:1px solid #e8dfe4;padding:12px 16px}
  .admin-side .workspace-nav{flex-direction:row;overflow:auto;gap:6px;padding-bottom:5px}
  .admin-side .workspace-nav a{white-space:nowrap;background:#faf7f9;padding:9px 12px;font-size:13px}
  .admin-side .workspace-nav .nav-label{display:none}
  #changelist #toolbar #searchbar{max-width:100%;min-width:0;flex:1 1 180px}
}
@media(max-width:767px){
  #container>.main{display:block}
  #container>.main>.content{width:100%;max-width:100%;min-width:0}
  #container>.main>.admin-side{width:100%;height:auto;position:static;box-sizing:border-box}
  #content .related-widget-wrapper select{min-width:0!important;width:100%;flex:1 1 180px}
  #content .submit-row input{white-space:normal;height:auto;line-height:1.5}
  #content fieldset .description{overflow-wrap:anywhere}
}
/* Keep the search button visible beside the input on narrow screens. */
#changelist #toolbar #changelist-search{width:100%;min-width:0}
#changelist #toolbar #changelist-search>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%;min-width:0}
#changelist #toolbar #searchbar{flex:1 1 120px;width:auto;min-width:0;max-width:100%;margin:0}
#changelist #toolbar #changelist-search input[type=submit]{flex:0 0 auto;margin:0;min-height:44px}
#changelist #toolbar #changelist-search label{flex:0 0 auto;margin:0}
#changelist #toolbar #changelist-search .small{flex-basis:100%;margin:0}
@media(max-width:767px){
  #content .related-widget-wrapper{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
  #content .related-widget-wrapper select{flex:1 1 120px;width:auto!important;min-width:0!important}
  #content .related-widget-wrapper-link{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;margin:0;padding:0}
}
@media(max-width:360px){#content .related-widget-wrapper select{flex-basis:100%}}
