body { margin:0; min-height:100vh; background:var(--background); font-family:var(--font-sans); color:var(--foreground); }
.page { max-width:1100px; margin:0 auto; padding:20px 20px 60px; }

/* Header */
.page-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.page-hdr h1 { font-size:20px; font-weight:700; margin:0; }
.page-hdr p { font-size:13px; color:var(--muted-fg); margin:2px 0 0; }

/* Stats Cards */
  .stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:20px; }
.stat-card { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:16px 18px; }
.stat-card .label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-fg); margin-bottom:6px; }
.stat-card .value { font-size:26px; font-weight:700; line-height:1.1; }
.stat-card .sub { font-size:12px; color:var(--muted-fg); margin-top:4px; }
.stat-card .value.success { color:var(--success); }
.stat-card .value.warn { color:var(--warn); }
.stat-card .value.primary { color:var(--primary); }

/* Progress bar */
.progress-bar-wrap { background:var(--muted); border-radius:6px; height:8px; overflow:hidden; margin-top:8px; }
.progress-bar-fill { height:100%; border-radius:6px; background:var(--success); transition:width .5s ease; }

/* Filter Bar */
.filter-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:12px 16px; background:var(--card); border:1px solid var(--border); border-radius:10px; margin-bottom:14px; }
.filter-bar select, .filter-bar input {
  padding:8px 12px; border:1px solid var(--border); border-radius:8px; font:inherit; font-size:13px; background:var(--card); color:var(--foreground); outline:none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(59,89,152,0.08); }
.filter-bar .search-input { flex:1; min-width:180px; }
  .filter-actions { display:flex; gap:6px; margin-left:auto; flex-wrap:wrap; justify-content:flex-end; }

/* Product Table */
.product-table { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.product-table thead th { padding:12px 14px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-fg); text-align:left; border-bottom:1px solid var(--border); background:var(--muted); }
.product-table tbody td { padding:12px 14px; font-size:13px; border-bottom:1px solid var(--border); vertical-align:middle; }
.product-table tbody tr { transition:background .12s; cursor:pointer; }
.product-table tbody tr:hover { background:var(--accent); }
.product-table tbody tr:last-child td { border-bottom:none; }

/* Product cell */
.product-cell { display:flex; align-items:center; gap:10px; }
.product-cell img { width:44px; height:44px; border-radius:6px; object-fit:cover; flex-shrink:0; background:var(--muted); border:1px solid var(--border); }
.product-cell .info { min-width:0; }
.product-cell .name { font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:250px; }
.product-cell .code { font-size:11px; color:var(--muted-fg); font-family:var(--font-mono); }

/* Status badge */
.status-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; }
.status-badge.done { background:var(--success-light); color:var(--success); }
.status-badge.pending { background:#fff3cd; color:#856404; }
.status-badge.missing { background:var(--warn-light); color:var(--warn); }
.status-badge.loading { background:var(--info-light); color:var(--info); }

/* Color dots */
.color-dots { display:flex; gap:3px; flex-wrap:wrap; }
.color-dot { width:14px; height:14px; border-radius:50%; border:1px solid var(--border); }

/* Detail Panel */
.detail-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.25); z-index:100; justify-content:center; align-items:flex-start; padding:40px 20px; overflow-y:auto; backdrop-filter:blur(2px); }
.detail-overlay.open { display:flex; }
.detail-panel { background:var(--card); border:1px solid var(--border); border-radius:14px; width:720px; max-width:100%; box-shadow:var(--shadow-lg); }
.detail-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); }
.detail-header h2 { font-size:16px; font-weight:700; margin:0; }
.detail-body { padding:20px; max-height:70vh; overflow-y:auto; }

/* Description preview */
.desc-group { margin-bottom:16px; }
.desc-group-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-fg); margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.desc-row { display:flex; padding:8px 0; gap:12px; }
.desc-label { width:120px; min-width:120px; font-size:12px; font-weight:600; color:var(--muted-fg); text-transform:uppercase; letter-spacing:.03em; padding-top:2px; }
.desc-value { flex:1; font-size:13.5px; line-height:1.65; }
.desc-tagline { font-style:italic; color:var(--primary); }

/* FAQ */
.faq-item { padding:10px 0; border-bottom:1px solid var(--border); }
.faq-item:last-child { border-bottom:none; }
.faq-q { font-size:13px; font-weight:600; color:var(--primary); margin-bottom:4px; }
.faq-a { font-size:13px; color:var(--secondary-fg); line-height:1.6; padding-left:14px; border-left:2px solid var(--border); }

/* Pagination */
.pagination { display:flex; justify-content:center; gap:6px; margin-top:16px; }
.pagination button { padding:6px 14px; border:1px solid var(--border); border-radius:6px; background:var(--card); font:inherit; font-size:12px; cursor:pointer; color:var(--foreground); }
.pagination button:hover { border-color:var(--primary); color:var(--primary); }
.pagination button.active { background:var(--primary); color:var(--primary-fg); border-color:var(--primary); }
.pagination button:disabled { opacity:.4; cursor:not-allowed; }

/* Loading */
.table-loading { text-align:center; padding:40px; color:var(--muted-fg); }
.spinner-sm { display:inline-block; width:18px; height:18px; border:2px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Inline Edit Popup */
.agent-editing { padding: 0 4px; border-radius: 4px; transition: all 0.3s; font-weight: 500;}
#inlineEditPopup {
    display: none; position: absolute; z-index: 10000; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    width: 250px; overflow: hidden; font-family: var(--font-sans);
}
.inline-edit-btn {
    display: block; width: 100%; text-align: left; padding: 10px 14px;
    border: none; background: none; font-size: 13px; color: #475569;
    cursor: pointer; transition: all 0.15s; border-bottom: 1px solid #f1f5f9;
}
.inline-edit-btn:hover { background: #f8fafc; color: #0f172a; padding-left: 18px; }
.inline-edit-btn i { width: 18px; text-align: center; margin-right: 6px; color: #64748b; }
.inline-edit-btn:last-child { border-bottom: none; }
.btn-dark { background:#1e293b; color:#fff; border:1px solid #0f172a; }
.btn-dark:hover { background:#334155; }
.btn-outline-dark { background:transparent; color:#1e293b; border:1px solid #cbd5e1; }
.btn-outline-dark:hover { background:#f1f5f9; border-color:#94a3b8; }


/* Responsive */
@media (max-width:768px) {
  .stats-row { grid-template-columns:repeat(2,1fr); }
  .desc-row { flex-direction:column; gap:2px; }
  .desc-label { width:auto; min-width:auto; }
}
