.products-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 4px 0 22px; }
.page-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 140px; color: #78519b; }
body[hidden] { display: block; }
body[hidden] > :not(.session-loading-indicator) { display: none; }
.session-loading-indicator { display: none; }
body[hidden] > .session-loading-indicator { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 100vh; color: #78519b; }
.loading-spinner { width: 20px; height: 20px; border: 2px solid #e5d9ef; border-top-color: #8051bb; border-radius: 50%; animation: loading-spin .8s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.products-heading h1 { font-size: clamp(25px, 2.5vw, 34px); margin-top: 7px; }
.products-heading p, .products-toolbar p, .editor-heading p { color: #82758a; font-size: 12px; }
.products-count { flex: none; padding: 7px 13px; border-radius: 10px; background: #f0e8f8; color: #78519b; font-size: 12px; font-weight: 700; }
.preview-notice { display: flex; gap: 12px; align-items: center; border: 1px solid #e6d9f1; background: #f6f0fb; border-radius: 12px; padding: 12px 15px; color: #715788; font-size: 12px; margin-bottom: 16px; }
.preview-notice strong { flex: none; color: #69428c; }
.products-panel { background: white; border: 1px solid #e7e3ec; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 5px #28153804; }
.products-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; }
.product-bulk-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 22px 16px; }
.bulk-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bulk-tools[hidden] { display: none; }
.bulk-tools label { display: flex; align-items: center; gap: 7px; color: #786b80; font-size: 12px; }
.bulk-tools select { padding: 7px 9px; }
.bulk-selected-count { color: #6c5e73; font-size: 12px; }
.product-select-checkbox { accent-color: #8053ae; width: 17px; height: 17px; flex: none; cursor: pointer; }
.products-toolbar h2 { margin-bottom: 3px; }
.product-sort { padding: 0 22px 18px; border-bottom: 1px solid #f0ecf3; }
.product-sort-heading, .product-sort-rule { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.product-sort-heading span, .product-sort p, .product-sort-rule span { color: #82758a; font-size: 11px; }
.product-sort-heading [data-export] { margin-right: auto; }
.product-sort-rules:not(:empty) { display: grid; gap: 8px; margin: 12px 0; }
.product-sort-rule button { border: 1px solid #e4dfea; border-radius: 8px; padding: 3px 10px; }
.product-sort-rule button:disabled { opacity: .4; }
.product-sort p { margin-top: 8px; }
.product-lazy-status:not(:empty) { padding: 12px 22px; color: #78519b; font-size: 12px; }
.product-search { display: flex; align-items: center; gap: 8px; width: min(290px, 45%); border: 1px solid #e6e0eb; border-radius: 10px; padding: 7px 12px; color: #a38dae; }
.product-search span[aria-hidden] { font-size: 24px; line-height: 1; }
.product-search input { width: 100%; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 12px; color: #30283c; }
.product-search:focus-within { outline: 2px solid #8057c4; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.products-list-labels, .product-row { display: grid; grid-template-columns: minmax(230px, 2fr) minmax(125px, 1fr) minmax(90px, .7fr) 95px; align-items: center; gap: 12px; padding: 12px 22px; }
.products-list-labels { background: #faf8fc; color: #998a9f; font-size: 11px; }
.product-item + .product-item { border-top: 1px solid #f0ecf3; }
.product-row { min-height: 76px; }
.product-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-name strong, .product-name small { display: block; overflow-wrap: anywhere; }
.product-name strong { font-size: 13px; }
.product-name small { color: #9a8da1; font-size: 11px; text-align: right; }
.product-avatar { flex: none; width: 42px; height: 42px; display: grid; place-items: center; background: #f4edf9; color: #9974b7; border-radius: 12px; }
.product-avatar svg { width: 20px; height: 20px; }
.product-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.product-barcode { text-align: right; color: #776a80; font-size: 12px; }
.product-status { display: inline-block; padding: 4px 10px; border-radius: 8px; font-size: 11px; color: #816a72; background: #f7eff0; }
.product-status.active { background: #eaf6ef; color: #438362; }
.product-actions { display: flex; gap: 7px; }
.product-actions button { width: 34px; height: 34px; display: grid; place-items: center; color: #8056a7; background: #f7f2fa; border-radius: 9px; }
.product-actions button svg { width: 17px; height: 17px; }
.product-actions .delete-product { color: #b56c76; background: #fcf2f3; }
.products-empty { padding: 45px 20px; text-align: center; color: #918397; }
.trash-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; padding: 0 22px 22px; }
.trash-product-card { overflow: hidden; border: 1px solid #e9e1ef; border-radius: 14px; background: #fff; }
.trash-product-image { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #f7f2fa; color: #ab8cc0; }
.trash-product-image img { width: 100%; height: 100%; object-fit: cover; }
.trash-product-image svg { width: 40px; height: 40px; }
.trash-product-content { padding: 15px; }
.trash-product-content h3 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.trash-product-content p { margin: 3px 0 12px; color: #96869e; font-size: 11px; overflow-wrap: anywhere; }
.trash-product-details { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; color: #88798f; font-size: 12px; }
.trash-product-details b { color: #51445a; overflow-wrap: anywhere; }
.trash-restore { width: 100%; margin-top: 12px; }
.trash-feedback:not(:empty) { padding: 0 22px 18px; color: #78519b; font-size: 12px; }
.trash-products-empty { grid-column: 1 / -1; padding: 30px 0; text-align: center; color: #918397; }
.products-feedback { padding: 0 22px; color: #61866e; font-size: 12px; }
.products-feedback:not(:empty) { padding: 12px 22px; border-top: 1px solid #f0ecf3; }
.product-editor { margin: 0 22px 20px; padding: 24px; border: 1px solid #eee7f2; border-radius: 13px; background: #fff; }
.editor-kicker { display: block; color: #8d6eaa; font-size: 11px; margin-bottom: 5px; }
.product-editor .editor-heading h3 { font-size: 18px; }
.product-editor .editor-heading p { color: #918397; font-size: 12px; }
.editor-section { padding: 4px 0 22px; margin-bottom: 20px; border-bottom: 1px solid #f0ebf3; }
.editor-section h4 { margin: 0 0 14px; font-size: 13px; color: #50445b; }
.product-editor .product-meta { margin-top: 0; }
.editor-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 18px; }
.editor-heading h3 { margin: 0 0 2px; font-size: 15px; }
.editor-close { font-size: 22px; line-height: 1; color: #97869f; }
.product-images { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid #eee7f2; }
.product-images-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.product-images-heading h4 { margin: 0 0 3px; font-size: 13px; }
.product-images-heading p { color: #928499; font-size: 11px; }
.product-images-count { flex: none; color: #97879f; font-size: 11px; }
.product-images-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.product-image-slot { position: relative; min-width: 0; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid #e6ddec; border-radius: 12px; }
.product-image-slot.empty { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border-style: dashed; background: #fff; color: #a592af; font-size: 11px; cursor: pointer; }
.product-image-slot.empty:hover { background: #f7f1fa; border-color: #b595cc; }
.product-image-slot.empty:focus-within { outline: 2px solid #8057c4; outline-offset: 2px; }
.product-image-slot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-image-plus { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f3ebf8; color: #916eb0; font-size: 22px; line-height: 1; }
.product-image-slot.filled { background: #f3edf6; }
.product-image-slot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.product-image-slot.filled:hover img, .product-image-slot.filled:focus-within img { opacity: .35; }
.product-image-remove { position: absolute; inset: 0; margin: auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #b65e70; box-shadow: 0 3px 12px #4630472b; opacity: 0; transition: opacity .2s; }
.product-image-remove svg { width: 19px; height: 19px; }
.product-image-slot:hover .product-image-remove, .product-image-slot:focus-within .product-image-remove { opacity: 1; }
.product-image-main { position: absolute; right: 5px; left: 5px; bottom: 5px; padding: 5px 3px; border-radius: 7px; background: #ffffffeb; color: #755296; font-size: 10px; font-weight: 650; line-height: 1.4; }
.product-image-main.selected { background: #8053ae; color: white; }
.product-images-error { color: #b65e70; font-size: 11px; }
.product-images-error:not(:empty) { margin-top: 8px; }
.product-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-field { display: flex; flex-direction: column; gap: 5px; color: #716478; font-size: 12px; font-weight: 600; }
.product-field.wide { grid-column: span 3; }
.product-field i { color: #c26778; font-style: normal; }
.product-field-error { color: #b65e70; font-size: 11px; font-weight: 500; }
.product-field-error:empty { display: none; }
.product-field [aria-invalid="true"] { border-color: #c26778; }
.product-field input, .product-field select, .product-field textarea { width: 100%; min-width: 0; border: 1px solid #e5ddea; border-radius: 9px; padding: 9px 10px; background: white; color: #403347; font: inherit; font-weight: 400; }
.product-field textarea { resize: vertical; }
.product-brand-picker { position: relative; }
.product-brand-anchor { position: relative; }
.product-brand-control { display: flex; align-items: center; border: 1px solid #e5ddea; border-radius: 9px; background: #fff; color: #a38dae; }
.product-brand-control:focus-within { outline: 2px solid #8057c4; outline-offset: 2px; }
.product-field .product-brand-control input { border: 0; outline: 0; background: transparent; }
.product-brand-toggle { display: grid; place-items: center; flex: none; width: 38px; height: 34px; margin: 3px; border-radius: 7px; color: #8054aa; background: #f5effa; cursor: pointer; }
.product-brand-toggle:hover, .product-brand-toggle[aria-expanded="true"] { background: #eadcf5; }
.product-brand-toggle svg { width: 19px; height: 19px; }
.product-brand-popup { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; left: 0; padding: 8px; border: 1px solid #eee5f2; border-radius: 12px; background: white; box-shadow: 0 12px 30px #38204b24; }
.product-brand-popup[hidden] { display: none; }
.product-field .product-brand-query { background: #faf8fc; border-color: #eae3ef; }
.product-brand-list { max-height: 200px; overflow-y: auto; margin-top: 5px; }
.product-brand-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; border-radius: 8px; color: #514359; text-align: right; font: inherit; cursor: pointer; }
.product-brand-option:hover, .product-brand-option.is-active, .product-brand-option[aria-selected="true"] { background: #f6f0fb; color: #754da0; }
.product-brand-mark { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 8px; background: #ede4f6; color: #8054aa; font-weight: 700; }
.product-brand-empty { padding: 12px 8px; color: #96869e; font-size: 11px; line-height: 1.8; }
.product-brand-hint { color: #998c9f; font-size: 10px; font-weight: 400; }
.product-field.ai-changed input, .product-field.ai-changed textarea { border-color: #69b98a; box-shadow: 0 0 0 3px #8dd5a95c, 0 3px 12px #55a87326; }
.product-assistant { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 14px; border: 1px solid #e4d6ef; border-radius: 12px; background: #faf6fd; color: #6f537d; }
.product-assistant strong { font-size: 12px; }
.product-assistant p { color: #928499; font-size: 11px; }
.product-assist-instructions { display: flex; flex: 1 0 100%; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.product-assist-instructions textarea { width: 100%; min-width: 0; resize: vertical; border: 1px solid #e5ddea; border-radius: 9px; padding: 9px 10px; background: white; color: #403347; font: inherit; font-weight: 400; }
.product-assist-instructions textarea:focus-visible { outline: 2px solid #8057c4; outline-offset: 2px; }
.product-assist-button { margin-right: auto; color: #8053ae; }
.product-assist-button:disabled { opacity: .55; cursor: wait; }
.product-assistant .product-assist-message { flex-basis: 100%; color: #627f6b; }
.product-field input:focus-visible, .product-field textarea:focus-visible { outline: 2px solid #8057c4; outline-offset: 2px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; padding: 14px 0; border-top: 1px solid #eee7f2; color: #928499; font-size: 11px; }
.product-meta b { color: #6c5e73; font-weight: 500; }
.editor-actions, .confirm-actions { display: flex; align-items: center; justify-content: end; gap: 9px; }
.editor-actions > span { margin-left: auto; color: #9a8da1; font-size: 11px; }
.button-primary, .button-secondary, .button-danger { border-radius: 9px; padding: 9px 15px; font-size: 12px; font-weight: 650; }
.button-primary { background: #8053ae; color: white; }
.button-primary:hover { background: #6e4599; color: white; }
.button-secondary { border: 1px solid #e7dfec; background: white; color: #786b80; }
.button-danger { background: #b65e70; color: white; }
.button-danger:hover { background: #a44e60; color: white; }
.add-back-link { color: #8053a6; font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.add-back-link span { margin-right: 5px; }
.add-product-form { width: 100%; }
.add-section { padding: 24px; }
.add-section + .add-section { border-top: 1px solid #f0ecf3; }
.add-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.add-section-heading h2 { font-size: 16px; }
.add-section-heading p { color: #928499; font-size: 11px; }
.add-section-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: #f2eaf9; color: #9068b1; }
.add-product-form .product-images { margin: 0; padding: 0; border: 0; }
.add-product-form .product-images-heading h4 { font-size: 15px; }
.add-product-actions { display: flex; align-items: center; justify-content: end; gap: 10px; padding: 18px 24px; background: #fcfafd; border-top: 1px solid #f0ecf3; }
.add-product-actions a { text-decoration: none; }
.add-product-actions p { margin-left: auto; color: #928499; font-size: 11px; }
#confirm-dialog { width: min(420px, 92%); text-align: right; }
#confirm-dialog h2 { margin: 12px 0 6px; }
#confirm-dialog p { color: #786d7e; overflow-wrap: anywhere; }
.confirm-icon { width: 40px; height: 40px; display: grid; place-items: center; background: #faecee; color: #b65e70; font-size: 20px; font-weight: bold; border-radius: 12px; }
.confirm-actions { margin-top: 25px; }
@media (max-width: 920px) { .product-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .product-field.wide { grid-column: span 2; } }
@media (max-width: 670px) {
  nav { flex-wrap: wrap; justify-content: end; gap: 4px; }
  nav p { display: none; }
  nav a { white-space: nowrap; }
  .products-heading { align-items: start; }
  .preview-notice { align-items: start; flex-direction: column; gap: 3px; }
  .products-toolbar { align-items: stretch; flex-direction: column; padding: 17px; }
  .product-bulk-toolbar { padding: 0 17px 15px; }
  .bulk-tools { width: 100%; }
  .bulk-tools > * { flex: 1 1 auto; }
  .product-search { width: 100%; }
  .products-list-labels { display: none; }
  .product-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 15px 17px; }
  .product-name { grid-column: 1; }
  .product-barcode { grid-column: 1; grid-row: 2; padding-right: 54px; text-align: left; width: fit-content; }
  .product-row > div:nth-child(3) { grid-column: 2; grid-row: 1; }
  .product-actions { grid-column: 2; grid-row: 2; }
  .product-editor { margin: 0 12px 14px; padding: 15px; }
  .add-section { padding: 18px; }
  .add-product-actions { padding: 16px 18px; }
  .product-images-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-image-remove { opacity: 1; }
  .product-form-grid { grid-template-columns: 1fr; }
  .product-field.wide { grid-column: span 1; }
  .editor-actions { flex-wrap: wrap; }
  .editor-actions > span { width: 100%; }
}
.app-notifications { position: fixed; z-index: 1000; left: 20px; bottom: 20px; display: grid; gap: 10px; width: min(430px, calc(100vw - 32px)); }
.app-notification { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid #b7dfc4; border-radius: 12px; background: #e9f7ed; color: #315f40; box-shadow: 0 8px 28px #271b301c; font-size: 12px; animation: notification-in .18s ease-out; }
.app-notification-pending { background: #e9f7ed; }
.app-notification-cancel { flex: none; padding: 6px 10px; border: 1px solid #9dc9aa; border-radius: 8px; background: #fff; color: #315f40; font-size: 11px; }
.app-notification-error { border-color: #e6b5bc; background: #fff0f1; color: #8f3f4d; }
@keyframes notification-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .app-notification { animation: none; } }
