.product-panel{display:flex;flex-direction:column;height:calc(100vh - 99px);padding:8px 3px 0;overflow:hidden}
.product-panel[hidden]{display:none !important}
.product-toolbar{justify-content:flex-end;margin-bottom:10px}
.product-search{min-height:42px;width:100%}
.toolbar-search{width:240px;min-width:220px;max-width:280px;height:36px;min-height:36px;border-radius:12px}
.search-input-wrap{flex:0 0 210px;width:210px;min-width:210px;max-width:210px;margin-right:27px}
.search-input-wrap .product-search{width:100%;max-width:none;box-sizing:border-box;padding-right:64px}
.product-actions .search-clear-btn{
  font-size:14px;
  right:10px;
}
.search-result-count{right:26px;font-size:12px;min-width:22px;text-align:right}
.product-actions{justify-content:flex-start;flex-wrap:nowrap;width:100%}
#btn-add{margin-left:0}
.filter-search-group{flex:0 0 auto}
.operation-group{flex:0 0 auto;margin-left:auto}
.toolbar-item{position:relative;transform:translate(var(--tx,0px),var(--ty,0px))}
#category-trigger{--tx:0px;--ty:0px}
#btn-add{--tx:0px;--ty:0px}
#product-search{--tx:0px;--ty:0px}
#btn-edit,#btn-delete,#btn-import,#btn-export,#btn-columns,#btn-batch,#btn-product-listing{--tx:0px;--ty:0px}
.product-actions [hidden]{display:none !important}
.product-actions .primary{background:#fff;color:#1f2937;border-color:#cfd8e4}
#product-search-clear{
  right:5px !important;
  display:block;
}
#product-search-count{right:22px}
.product-master-search-wrap{
  margin-right:0;
}
.product-actions .search-input-wrap.toolbar-item{
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  outline:0;
}
.product-master-search-wrap .product-search{
  padding-right:28px;
}
#product-search-count.product-master-search-count{
  position:static;
  top:auto;
  right:auto;
  transform:none;
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  height:36px;
  min-width:78px;
  color:#64748b;
  font-size:12px;
  font-weight:600;
  line-height:1;
  text-align:left;
  white-space:nowrap;
  pointer-events:none;
}
.product-table-wrap{flex:1;height:100%;overflow:scroll;scrollbar-gutter:stable both-edges;border:0.8px solid #dce3ec;border-radius:12px}
.product-pager{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:8px 12px;border:1px solid #dce3ec;border-top:0;border-radius:0 0 12px 12px;background:#fff}
.product-pager[hidden]{display:none!important}
.product-pager button{height:30px;padding:0 12px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc;color:#334155;font-weight:700;cursor:pointer}
.product-pager button:disabled{opacity:.45;cursor:not-allowed}
.product-pager span{color:#64748b;font-size:13px;font-weight:700}
.product-table{border-collapse:separate;border-spacing:0}
.product-table th,.product-table td{padding:6px 8px;border:0.8px solid #dce3ec;font-size:12px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.product-table thead th{z-index:20;padding-top:8px;padding-bottom:8px;box-shadow:0 1px 0 #dce3ec}
.product-table tbody td{color:#4b5563}
.sort-button{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:0;font:inherit;font-weight:700;color:#1f2937;cursor:pointer}
.sort-icon{color:#90a0b5;font-size:12px;min-width:14px;text-align:center}
.col-resizer{right:-1px;width:10px}
.product-table tbody tr.parent-variant-row{background:#f8fbff}
.product-table tbody tr.parent-variant-row > td:first-child{box-shadow:inset 3px 0 0 #93c5fd}
.variant-parent-badge{display:inline-flex;align-items:center;gap:4px;max-width:100%;height:22px;padding:0 8px;border:1px solid #bfdbfe;border-radius:999px;background:#eff6ff;color:#1e3a8a;font-weight:600;line-height:1;white-space:nowrap}
.product-table tbody tr.row-selected{background:#e9f2ff}
.product-table tbody tr.parent-variant-row.row-selected{background:#e9f2ff}
.product-table tbody tr.row-selected > td{background:#dbeafe !important;box-shadow:inset 0 1px 0 #bfdbfe,inset 0 -1px 0 #bfdbfe}
.product-table tbody tr.row-selected > td:first-child{box-shadow:inset 3px 0 0 #2563eb,inset 0 1px 0 #bfdbfe,inset 0 -1px 0 #bfdbfe}
.variant-panel .product-table tbody tr{cursor:pointer}
.product-table td{user-select:text}
.category-dropdown{position:relative}
.category-dropdown{margin-right:0}
.category-trigger{height:36px;padding:0 12px;border:1px solid #cfd8e4;border-radius:12px;background:#fff;color:#1f2937;font-size:13px;cursor:pointer}
.column-search-dropdown{position:relative}
.column-search-trigger{height:36px;white-space:nowrap}
.column-search-menu{position:absolute;top:40px;left:0;min-width:120px;max-height:480px;overflow:auto;border:1px solid #dce3ec;border-radius:10px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.12);z-index:1000;padding:6px}
#view-filter-menu{overflow:visible}
.column-search-menu[hidden]{display:none}
.column-search-item{display:block;width:100%;text-align:left;border:1px solid transparent;font-size:12px;padding:7px 9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.column-search-branch{position:relative}
.column-search-parent{position:relative;padding-right:22px}
.column-search-parent::after{content:'›';position:absolute;right:9px;color:#64748b}
.column-search-submenu{position:absolute;top:0;left:calc(100% + 6px);min-width:112px;border:1px solid #dce3ec;border-radius:10px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.12);z-index:1001;padding:6px}
.column-search-submenu[hidden]{display:none}
.category-popup{position:fixed;top:0;left:0;width:260px;min-width:260px;max-width:260px;max-height:90vh;overflow:auto;border:1px solid #dce3ec;border-radius:12px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.12);z-index:999;padding:8px;box-sizing:border-box}
.category-popup[hidden]{display:none}
.category-popup .category-tree{padding:0;overflow:visible}
.batch-dropdown{position:relative}
.batch-menu{position:absolute;top:40px;left:0;min-width:180px;max-height:420px;overflow:auto;border:1px solid #dce3ec;border-radius:10px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.12);z-index:1050;padding:6px}
.batch-menu[hidden]{display:none}
.batch-item{display:block;width:100%;text-align:left;border:1px solid transparent;background:#fff;color:#334155;font-size:12px;border-radius:8px;padding:7px 9px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.batch-item:hover{background:#eef5ff;border-color:#c7d6ea}


.product-content{display:flex;flex:1;min-height:0;height:100%}
.category-panel{border:0.8px solid #dce3ec;border-radius:12px;background:#fff;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.category-panel .cp-head{display:flex;align-items:center;justify-content:center;padding:8px 10px;border-bottom:0.8px solid #dce3ec;font-size:12px;line-height:1.25;font-weight:700;background:#f3f6fb}
.category-panel .cp-search{padding:8px 10px;border-top:none;border-bottom:1px solid #e7edf6}
.category-panel .cp-search input{display:block;width:100%;max-width:100%;height:34px;border:0.8px solid #dce3ec;border-radius:8px;padding:0 10px;font-size:12px;box-sizing:border-box}
.category-tree{padding:8px 8px 10px 8px;overflow:auto;min-height:0}
.category-tree details{border:1px solid #cfd8e4;border-radius:8px;margin-bottom:6px;background:#fff;transition:background-color .15s ease,border-color .15s ease}
.category-search-row{display:flex;gap:6px;margin-bottom:6px;align-items:stretch;height:40px;min-height:40px;max-height:40px}
.category-search-card{flex:1;border:1px solid #cfd8e4;border-radius:8px;background:#fff;padding:0 10px;height:100%;min-height:100%;max-height:100%;display:flex;align-items:center;box-sizing:border-box}
.category-search-card input{width:100%;min-width:0;height:100%;margin:0;padding:0;box-sizing:border-box;border:0;outline:none;font-size:12px;line-height:40px;color:#334155;background:transparent}
.category-search-btn{flex:0 0 56px;height:100%;min-height:100%;max-height:100%;padding:0 10px;border:1px solid #cfd8e4;border-radius:8px;background:#fff;color:#334155;font-size:12px;cursor:pointer;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;justify-content:center;line-height:1;appearance:none;-webkit-appearance:none}
.category-tree summary{list-style:none;cursor:pointer;padding:8px 10px;font-size:12px;font-weight:600;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between;gap:8px}
.category-summary-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.category-count{margin-left:8px;color:#64748b;font-weight:600;font-size:12px}
.category-tree details:hover{background:#eef5ff;border-color:#c7d6ea}
.category-tree details:hover ul{background:#f8fbff}
.category-tree summary::-webkit-details-marker{display:none}
.category-tree ul{margin:0;padding:0 8px 8px 18px;list-style:none;background:#f8fbff;border-radius:6px}
.category-tree li{padding:3px 10px;font-size:12px;color:#475569;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #cfd8e4;border-radius:999px;background:#fff;margin-bottom:4px;min-height:28px;box-sizing:border-box}
.category-tree details.category-shared-primary{background:#ecfdf3;border-color:#9bd9b5}
.category-tree details.category-shared-primary:hover{background:#dcfce7;border-color:#86efac}
.category-tree li.category-shared-secondary{background:#ecfdf3;border-color:#9bd9b5}
.category-tree li .category-item-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.category-tree li:hover{color:#2563eb;background:#eef5ff;border-color:#c7d6ea}
.category-tree details.category-special ul{display:none !important}
.table-area{width:100%;display:flex;flex-direction:column;flex:1;min-height:0;height:100%}

.product-table td::selection{background:#8eb4ff;color:#111827}
.multi-category-cell{background:#ecfdf3 !important}
.multi-category-text{display:inline-block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:980px){.product-toolbar{justify-content:flex-start}.product-actions{justify-content:flex-start;flex-wrap:wrap}.search-input-wrap{width:100%;max-width:none}.toolbar-search{width:100%;max-width:none}.table-area{width:100%}}

@media (max-width:760px){
  .product-panel{
    flex:1 1 0;
    height:auto;
    min-height:0;
    padding:6px 3px 0;
    overflow:hidden;
  }
  .product-toolbar{
    margin-bottom:8px;
  }
  .product-actions{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    grid-template-rows:auto auto;
    gap:8px;
    flex-direction:row;
    align-items:stretch;
    flex-wrap:nowrap;
    overflow:hidden;
    padding-bottom:0;
  }
  .product-actions > .category-dropdown{
    grid-column:1;
    grid-row:1;
    min-width:0;
  }
  .product-actions > .filter-search-group{
    grid-column:2;
    grid-row:1;
    min-width:0;
  }
  .product-actions > .operation-group{
    grid-column:1 / -1;
    grid-row:2;
    min-width:0;
  }
  .filter-search-group,
  .operation-group{
    margin-left:0;
  }
  .search-input-wrap{
    flex:1 1 var(--ct-mobile-search-min, clamp(148px, 52vw, 240px));
    width:auto;
    min-width:min(180px, calc(100vw - 136px));
    max-width:var(--ct-mobile-search-max, min(280px, calc(100vw - 120px)));
    margin-right:0;
  }
  .toolbar-search{
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .category-popup{
    left:10px !important;
    width:min(320px, calc(100vw - 20px));
    min-width:0;
    max-width:calc(100vw - 20px);
    max-height:70vh;
  }
  .batch-menu,.column-search-menu{
    max-height:60vh;
  }
  .product-content,.table-area{
    flex:1 1 0;
    min-height:0;
    height:auto;
  }
  .product-table-wrap{
    flex:1 1 0;
    min-height:0;
    height:auto;
    max-height:none;
  }
  .tab-placeholder,.analysis-empty{
    flex:1 1 0;
    height:auto;
    min-height:0;
  }
  .analysis-toolbar{
    overflow:hidden;
  }
  .analysis-summary{
    grid-template-columns:repeat(2,minmax(128px,1fr));
    width:100%;
  }
  .analysis-ai{
    grid-template-columns:1fr;
    padding:10px;
  }
}

.main{margin-left:0;}
.head{justify-content:flex-start;gap:12px}
.head-tab{color:#334155;font-weight:600}
.head-tab.active{border-color:#93c5fd;color:#1e3a8a;font-weight:600}
.tab-placeholder{height:calc(100vh - 150px);border:0.8px solid #dce3ec;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;color:#64748b;font-size:14px}
.analysis-panel{display:flex;flex-direction:column;gap:10px}
.analysis-empty{height:calc(100vh - 150px);border:0.8px solid #dce3ec;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;color:#64748b;font-size:14px}
.analysis-toolbar{padding:10px;border:1px solid #dce3ec;border-radius:12px}
.analysis-summary{display:grid;grid-template-columns:repeat(4,minmax(112px,1fr));gap:8px;min-width:0;flex:1}
.analysis-card{height:54px;border:1px solid #dce3ec;border-radius:10px;background:#f8fbff;padding:8px 10px;display:flex;flex-direction:column;justify-content:center;gap:4px}
.analysis-card-title{font-size:12px;color:#64748b;line-height:1}
.analysis-card-value{font-size:18px;font-weight:700;color:#1f2937;line-height:1}
.analysis-search-row{flex:0 0 auto}
.analysis-table-wrap{border:1px solid #dce3ec;border-radius:12px;height:calc(100vh - 230px)}
.analysis-table{min-width:100%;border-collapse:separate;border-spacing:0;font-size:13px;color:#334155}
.analysis-table th,.analysis-table td{height:40px;border-right:1px solid #dce3ec;border-bottom:1px solid #dce3ec;padding:6px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#fff}
.analysis-table th{z-index:1;color:#1f2937}
.analysis-table img{width:46px;height:34px;object-fit:contain;display:block}
.analysis-tabs{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #dce3ec;border-radius:12px;background:#fff}
.analysis-tab{height:34px;padding:0 12px;border:1px solid #cfd8e4;border-radius:10px;background:#fff;color:#334155;font-size:13px;font-weight:600;cursor:pointer}
.analysis-tab.active{background:#eef5ff;border-color:#93c5fd;color:#1e3a8a}
.analysis-search{width:260px;height:34px;border-radius:10px}
.analysis-status{font-size:12px;color:#64748b;white-space:nowrap}
.analysis-number{text-align:right;font-variant-numeric:tabular-nums}
.analysis-rank{width:52px;text-align:right;color:#64748b}
.analysis-ai{padding:12px;display:grid;grid-template-columns:minmax(280px,420px) minmax(0,1fr);gap:12px}
.analysis-ai-box{border:1px solid #dce3ec;border-radius:10px;background:#fff;padding:10px;min-height:0}
.analysis-ai-title{margin:0 0 8px;font-size:15px;color:#1f2937}
.analysis-ai-input{width:100%;height:120px;resize:vertical;border:1px solid #cfd8e4;border-radius:8px;padding:8px 10px;font-size:13px;line-height:1.45;color:#1f2937;box-sizing:border-box}
.analysis-ai-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}
.analysis-ai-actions button{height:34px;border:1px solid #cfd8e4;border-radius:10px;background:#fff;padding:0 12px;color:#1f2937;font-size:13px;cursor:pointer}
.analysis-ai-actions button:hover{background:#eef5ff;border-color:#c7d6ea}
.analysis-ai-output{white-space:pre-wrap;font-size:13px;line-height:1.55;color:#334155;max-height:520px;overflow:auto}
