.cwm, .cwm * { color:#000 !important; font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial; box-sizing:border-box; direction:rtl; }
.cwm { max-width:1200px; margin:18px auto; padding:0 12px; }

.cwm-shell{ background:#fff; border:1px solid #e6e6e6; border-radius:16px; box-shadow:0 10px 28px rgba(0,0,0,.06); overflow:hidden; }
.cwm-body{ padding:14px; }

.cwm-alert{ border:1px solid #e6e6e6; border-radius:12px; padding:10px 12px; margin-bottom:12px; background:#fafafa; font-weight:900; }
.cwm-alert.ok{ border-color:#bde5c8; background:#f2fff6; }
.cwm-alert.err{ border-color:#ffb3b3; background:#fff1f1; }

.cwm-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.cwm-tabbtn{ border:1px solid #e6e6e6; background:#fafafa; padding:10px 12px; border-radius:999px; font-weight:1000; cursor:pointer; text-decoration:none; }
.cwm-tabbtn.active{ background:#000; border-color:#000; color:#fff !important; }

.cwm-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media(max-width:768px){ .cwm-grid{ grid-template-columns:1fr; } }

.cwm-card{ border:1px solid #e6e6e6; border-radius:16px; padding:12px; background:#fff; }

.cwm-field{ margin-bottom:10px; }
.cwm-field label{ display:block; margin-bottom:6px; font-weight:1000; font-size:12px; }
.cwm-field input[type="text"], .cwm-field input[type="password"], .cwm-field select, .cwm-field input[type="file"]{
  width:100%; padding:10px 12px; border:1px solid #d8d8d8; border-radius:12px; background:#fff; font-weight:900;
}

.cwm-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
@media(max-width:768px){ .cwm-row{ flex-direction:column; align-items:stretch; } }

.cwm-btn{ display:inline-flex; align-items:center; justify-content:center; padding:10px 12px; border:1px solid #d8d8d8; border-radius:12px; background:#fafafa; font-weight:1000; cursor:pointer; text-decoration:none; }
.cwm-btn.primary{ background:#000; border-color:#000; color:#fff !important; }
.cwm-btn.danger{ background:#fff; border-color:#cc0000; color:#cc0000 !important; }
.cwm-btn.full{ width:100%; }

.cwm-divider{ height:1px; background:#eee; margin:12px 0; }

.cwm-tablewrap{ overflow:auto; }
.cwm-table{ width:100%; border:1px solid #e6e6e6; border-radius:16px; border-collapse:separate; border-spacing:0; overflow:hidden; }
.cwm-table th,.cwm-table td{ padding:10px; border-bottom:1px solid #eee; text-align:right; vertical-align:middle; font-weight:1000; }
.cwm-table thead th{ background:#fafafa; }

.cwm-cards{ display:none; gap:10px; }
@media(max-width:768px){ .cwm-tablewrap{ display:none; } .cwm-cards{ display:grid; } }

.cwm-item{ border:1px solid #e6e6e6; border-radius:16px; padding:10px; background:#fff; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
@media(max-width:768px){ .cwm-item{ flex-direction:column; align-items:stretch; } }
.cwm-item .name{ margin:0 0 6px; font-weight:1100; }
.cwm-item .meta{ font-size:12px; font-weight:900; }
.cwm-item .btns{ display:flex; gap:8px; flex-wrap:wrap; position:relative; z-index:5; pointer-events:auto; }
.cwm-item .btns .cwm-btn{ position:relative; z-index:6; pointer-events:auto; }
@media(max-width:768px){ .cwm-item .btns .cwm-btn{ width:100%; } }

.cwm-thumb{ width:54px; height:54px; border-radius:12px; border:1px solid #e6e6e6; object-fit:cover; background:#fff; }
.cwm-drag{ cursor:grab; user-select:none; touch-action:none; -webkit-user-select:none; font-size:20px; line-height:1; display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid #e6e6e6; border-radius:10px; background:#fafafa; }
.cwm-sortable-placeholder{ border:2px dashed #999 !important; background:#fafafa !important; min-height:56px; }
.cwm-sortable-row.ui-sortable-helper{ display:table; background:#fff; box-shadow:0 12px 30px rgba(0,0,0,.12); }
.cwm-orderbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cwm-orderbar .cwm-note{ margin:0; }

.cwm-pagination{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.cwm-pagination a{ border:1px solid #e6e6e6; background:#fafafa; padding:8px 12px; border-radius:12px; text-decoration:none; font-weight:1000; }
.cwm-pagination a.active{ background:#000; border-color:#000; color:#fff !important; }

.cwm-modalbg{ position:fixed; inset:0; background:rgba(0,0,0,.55); display:none; z-index:999999; padding:16px; align-items:flex-end; }
.cwm-modal{ width:100%; max-width:760px; margin:0 auto; background:#fff; border:1px solid #e6e6e6; border-radius:16px 16px 0 0; box-shadow:0 20px 70px rgba(0,0,0,.25); overflow:hidden; }
.cwm-modalhead{ padding:12px 14px; border-bottom:1px solid #eee; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.cwm-modalbody{ padding:12px 14px; max-height:80vh; overflow:auto; }

.cwm-note{ font-size:12px; font-weight:900; margin-top:8px; }

/* Caliber Woo Manager mobile polish */
.cwm, .cwm *{ box-sizing:border-box; }
.cwm{ direction:rtl; }
.cwm-btn{ min-height:44px; -webkit-tap-highlight-color:rgba(0,0,0,.12); touch-action:manipulation; transition:transform .08s ease, box-shadow .08s ease, background .12s ease, border-color .12s ease; }
.cwm-btn:hover{ box-shadow:0 6px 16px rgba(0,0,0,.08); }
.cwm-btn:active, .cwm-btn.cwm-tap-active{ transform:scale(.97); box-shadow:inset 0 2px 6px rgba(0,0,0,.12); }
.cwm-btn:focus-visible{ outline:3px solid rgba(37,99,235,.35); outline-offset:2px; }

@media(max-width:768px){
  .cwm{ width:100%; max-width:100%; margin:0 auto; padding:10px; }
  .cwm-shell{ border-radius:18px; overflow:hidden; }
  .cwm-body{ padding:10px; }
  .cwm-tabs{ display:grid; grid-template-columns:1fr 1fr; gap:8px; position:sticky; top:0; z-index:20; background:#fff; padding:8px 0; margin-bottom:10px; }
  .cwm-tabbtn{ width:100%; text-align:center; padding:12px 10px; }
  .cwm-card{ border-radius:18px; padding:12px; }
  .cwm-field input[type="text"], .cwm-field input[type="password"], .cwm-field select, .cwm-field input[type="file"]{ min-height:46px; font-size:16px; }
  .cwm-orderbar{ display:block; }
  .cwm-orderbar .cwm-note{ margin-bottom:10px; line-height:1.7; }
  .cwm-orderbar .cwm-btn{ width:100%; }
  .cwm-cards{ gap:12px; }
  .cwm-item{ position:relative; display:grid; grid-template-columns:48px 72px 1fr; align-items:center; gap:10px; padding:12px; border-radius:18px; box-shadow:0 8px 22px rgba(0,0,0,.05); }
  .cwm-item > div:not(.btns){ min-width:0; }
  .cwm-item .name{ font-size:15px; line-height:1.4; overflow-wrap:anywhere; }
  .cwm-item .meta{ line-height:1.6; color:#555; }
  .cwm-thumb{ width:72px; height:72px; border-radius:14px; }
  .cwm-drag{ width:44px; height:44px; font-size:22px; touch-action:none; cursor:grab; }
  .cwm-item .btns{ grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
  .cwm-item .btns form{ margin:0 !important; width:100%; }
  .cwm-item .btns .cwm-btn{ width:100%; }
  .cwm-modalbg{ align-items:flex-end; padding:8px; }
  .cwm-modal{ max-height:92vh; border-radius:18px 18px 0 0; }
  .cwm-modalbody{ max-height:78vh; }
}

@media(max-width:420px){
  .cwm{ padding:8px; }
  .cwm-item{ grid-template-columns:44px 64px 1fr; gap:8px; }
  .cwm-thumb{ width:64px; height:64px; }
  .cwm-item .btns{ grid-template-columns:1fr; }
}


/* CWM cleaner app-like layout */
.cwm-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 12px; padding:12px; border:1px solid #e9e9e9; border-radius:18px; background:#fbfbfb; }
.cwm-toolbar-title{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.cwm-toolbar-title strong{ font-size:18px; font-weight:1100; }
.cwm-toolbar-title span{ font-size:12px; font-weight:900; color:#555 !important; line-height:1.5; }
.cwm-filter-card{ margin-bottom:12px; }
.cwm-filter-form{ display:grid; grid-template-columns:minmax(220px, 1fr) minmax(180px, .8fr) auto; gap:10px; align-items:end; }
.cwm-filter-form .cwm-field{ margin-bottom:0; }
.cwm-filter-actions{ display:flex; gap:8px; align-items:center; }
.cwm-filter-actions .cwm-btn{ min-width:78px; }
.cwm-modalhead strong{ font-weight:1100; font-size:16px; }
.cwm-small-modal{ max-width:520px; }

@media(max-width:768px){
  .cwm-toolbar{ align-items:stretch; flex-direction:column; padding:12px; }
  .cwm-toolbar .cwm-btn{ width:100%; min-height:48px; font-size:15px; }
  .cwm-toolbar-title strong{ font-size:17px; }
  .cwm-filter-form{ grid-template-columns:1fr; gap:8px; }
  .cwm-filter-actions{ display:grid; grid-template-columns:1fr auto; gap:8px; }
  .cwm-filter-actions .cwm-btn{ width:100%; padding-inline:14px; }
  .cwm-filter-search input{ min-height:44px !important; }
  .cwm-filter-category select{ min-height:44px !important; }
  .cwm-divider{ margin:8px 0; }
}

.cwm-field textarea{width:100%;min-height:86px;padding:10px 12px;border:1px solid #d8d8d8;border-radius:12px;background:#fff;font-weight:800;resize:vertical}
.cwm-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cwm-check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.cwm-check{display:flex!important;align-items:center;gap:8px;padding:9px 10px;border:1px solid #e6e6e6;border-radius:12px;background:#fafafa;font-weight:900!important}
.cwm-check input{margin:0}
.cwm-status{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:1000}
.cwm-status.available{background:#eafaf0;color:#087a35!important;border:1px solid #a9e7be}
.cwm-status.unavailable{background:#fff0f0;color:#b42318!important;border:1px solid #ffc6c6}
.cwm-btn.availability.available{border-color:#8fd5a7;color:#087a35!important;background:#f3fff7}
.cwm-btn.availability.unavailable{border-color:#ffb8b8;color:#b42318!important;background:#fff5f5}
.cwm-autosave-status{min-width:128px;text-align:center;padding:7px 10px;border-radius:999px;background:#f2f2f2;font-size:12px;font-weight:1000;color:#555!important}
.cwm-autosave-status.saving{background:#fff8db;color:#7a5b00!important}.cwm-autosave-status.saved{background:#eafaf0;color:#087a35!important}.cwm-autosave-status.error{background:#fff0f0;color:#b42318!important}
.cwm-subtext{display:block;margin-top:3px;color:#666!important;font-size:11px;font-weight:800}
.cwm-badges-inline{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}.cwm-badges-inline span{font-size:10px;padding:3px 6px;border-radius:999px;background:#f0f0f0;font-weight:900}
.cwm-lang-box{margin-bottom:12px}.cwm-lang-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:5px;background:#f2f2f2;border:1px solid #e3e3e3;border-radius:14px;margin-bottom:10px}.cwm-lang-tab{appearance:none;border:0;background:transparent;border-radius:10px;min-height:42px;padding:9px 12px;font-weight:1000;cursor:pointer}.cwm-lang-tab.active{background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.08)}.cwm-lang-panel{display:none}.cwm-lang-panel.active{display:block}.cwm-lang-panel[data-lang-panel="ar"]{direction:rtl!important;text-align:right}.cwm-lang-panel[data-lang-panel="en"]{direction:ltr!important;text-align:left}.cwm-lang-panel[data-lang-panel="en"] .cwm-field,.cwm-lang-panel[data-lang-panel="en"] .cwm-field label,.cwm-lang-panel[data-lang-panel="en"] input,.cwm-lang-panel[data-lang-panel="en"] textarea{direction:ltr!important;text-align:left!important}
@media(max-width:768px){.cwm-field-pair,.cwm-check-grid{grid-template-columns:1fr}.cwm-orderbar{align-items:flex-start}.cwm-autosave-status{width:100%}}
/* v2.0.13: scoped touch sorting, recoverable forms and category selection. */
.cwm [hidden]{display:none!important}
.cwm-form-message{margin-bottom:12px;line-height:1.7}
.cwm-btn:disabled{cursor:wait;opacity:.65}
.cwm-category-picker{border:1px solid #d8d8d8;border-radius:12px;padding:10px;background:#fff}
.cwm-category-picker summary{cursor:pointer;min-height:24px;font-weight:800;overflow-wrap:anywhere}
.cwm-category-options{max-height:220px;overflow:auto;display:grid;gap:5px;margin-top:10px;overscroll-behavior:contain}
.cwm-category-options .cwm-check{margin:0;font-size:13px;line-height:1.5}
.cwm-category-options input[type=checkbox]{flex-shrink:0;width:18px;height:18px}
.cwm-category-search{margin-top:8px}
.cwm-reauth-modal{z-index:1000001;align-items:center}
.cwm-reauth-modal .cwm-modal{border-radius:18px;max-width:420px}
.cwm-modalbg.is-open{display:flex}
.cwm-sortable-products,.cwm-sortable-categories{touch-action:pan-y}
.cwm-drag{touch-action:none}
.cwm-global-message{position:sticky;top:6px;z-index:25}
