/* ============================================================================
   DESIGN TOKENS — chỉnh ở đây để đồng bộ toàn web
   ============================================================================ */
:root {
  /* Brand & accent */
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --c-primary-light: #dbeafe;
  --c-success: #059669;
  --c-success-light: #d1fae5;
  --c-warning: #d97706;
  --c-warning-light: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-light: #fee2e2;
  --c-info: #0891b2;
  --c-info-light: #cffafe;
  --c-purple: #7c3aed;
  --c-purple-light: #ede9fe;
  --c-pink: #ec4899;
  --c-pink-light: #fce7f3;

  /* Neutrals */
  --c-bg: #cfe5d3;
  --c-surface: #ffffff;
  --c-surface-2: #e8f1e7;
  --c-border: #c5d8c8;
  --c-border-strong: #cbd5e1;
  --c-text: #0f172a;
  --c-text-2: #475569;
  --c-text-3: #94a3b8;

  /* Typography */
  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Consolas", monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Radius */
  --r-sm: 4px;
  --r: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Shadow */
  --sh-sm: 0 1px 2px rgba(15,23,42,.04);
  --sh: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --sh-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.05);
  --sh-lg: 0 10px 15px -3px rgba(15,23,42,.10), 0 4px 6px -4px rgba(15,23,42,.05);
  --sh-xl: 0 20px 25px -5px rgba(15,23,42,.12), 0 8px 10px -6px rgba(15,23,42,.05);

  /* Transition */
  --t-fast: .12s ease;
  --t: .18s ease;
}

* { box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-primary-hover); text-decoration: none; }

/* ============================================================================
   TOAST (notification trượt từ trên)
   ============================================================================ */
#toastRoot {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastSlideIn .25s ease;
  border-left: 4px solid var(--c-info);
}
.toast.is-success { border-left-color: var(--c-success); }
.toast.is-error { border-left-color: var(--c-danger); }
.toast.is-warn { border-left-color: var(--c-warning); }
.toast.is-leaving { animation: toastSlideOut .2s ease forwards; }
.toast-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.toast.is-success .toast-icon { background: var(--c-success); }
.toast.is-error .toast-icon { background: var(--c-danger); }
.toast.is-warn .toast-icon { background: var(--c-warning); }
.toast.is-info .toast-icon { background: var(--c-info); }
.toast-body { flex: 1; font-size: 13px; color: var(--c-text); line-height: 1.4; }
.toast-body strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.toast-close {
  background: none;
  border: none;
  color: var(--c-text-3);
  cursor: pointer;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
}
.toast-close:hover { color: var(--c-text); }
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ============================================================================
   FLOATING WORKER CHIP (góc dưới phải)
   ============================================================================ */
.worker-chip[hidden] { display: none !important; }
.worker-chip {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 10px 18px 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh-lg);
  cursor: pointer;
  font-size: 13px;
  z-index: 100;
  transition: transform var(--t), box-shadow var(--t), padding var(--t), gap var(--t), opacity var(--t);
}
.worker-chip:hover { transform: translateY(-2px); box-shadow: var(--sh-xl); }
.worker-chip.is-stopped { border-color: var(--c-danger-light); }

/* MINI mode — khi không có job, chỉ hiện 1 chấm tròn nhỏ */
.worker-chip.is-mini {
  padding: 8px;
  gap: 0;
  opacity: 0.55;
}
.worker-chip.is-mini:hover { opacity: 1; }
.worker-chip.is-mini .worker-chip-label,
.worker-chip.is-mini .worker-chip-val,
.worker-chip.is-mini .worker-chip-pending { display: none; }
.worker-chip.is-mini .worker-chip-dot { margin: 0 4px; }
.worker-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-text-3);
  flex: 0 0 10px;
}
.worker-chip.is-running .worker-chip-dot {
  background: var(--c-success);
  animation: pulseDot 1.6s ease-in-out infinite;
}
.worker-chip.is-waiting .worker-chip-dot { background: var(--c-warning); animation: pulseDot 1.6s ease-in-out infinite; }
.worker-chip.is-idle .worker-chip-dot { background: var(--c-text-3); }
.worker-chip.is-stopped .worker-chip-dot { background: var(--c-danger); }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,.5); }
  50% { box-shadow: 0 0 0 6px rgba(5,150,105,0); }
}
.worker-chip-label { color: var(--c-text-2); }
.worker-chip-val { font-weight: 600; color: var(--c-text); }
.worker-chip-pending {
  background: var(--c-warning-light);
  color: var(--c-warning);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.worker-chip-pending.zero { background: var(--c-success-light); color: var(--c-success); }
.worker-popup {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 360px;
  max-height: 520px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xl);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.worker-popup[hidden] { display: none !important; }
.worker-popup-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-surface-2);
}
.worker-popup-head strong { font-size: 13px; }
.worker-popup-collapse,
.worker-popup-cancel-all {
  font-size: 11px !important;
  padding: 4px 10px !important;
  background: var(--c-surface) !important;
  color: var(--c-text-2) !important;
  border-color: var(--c-border) !important;
}
.worker-popup-cancel-all {
  background: var(--c-danger-light) !important;
  color: var(--c-danger) !important;
  border-color: #fca5a5 !important;
}
.worker-popup-cancel-all:hover { background: #fecaca !important; }
.worker-popup-cancel-all[hidden] { display: none !important; }
.worker-popup-collapse:hover {
  background: var(--c-surface-2) !important;
  color: var(--c-text) !important;
}
.worker-popup-body { padding: 12px 16px; font-size: 12px; overflow: auto; flex: 1; }
.worker-popup-body .row { display: flex; justify-content: space-between; padding: 4px 0; }
.worker-popup-body .row span:first-child { color: var(--c-text-2); }
.wp-active-list {
  margin-top: 12px;
  border-top: 1px solid var(--c-border);
  padding-top: 10px;
}
.wp-active-list[hidden] { display: none !important; }
.wp-active-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.wp-active-hint { color: var(--c-text-3); font-weight: 400; text-transform: none; letter-spacing: 0; }
.wp-job-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: var(--r-sm);
}
.wp-job-row:hover { background: var(--c-surface-2); }
.wp-job-id { color: var(--c-text-2); font-family: var(--font-mono); font-size: 11px; }
.wp-job-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }
.wp-job-time { color: var(--c-text-3); font-size: 11px; font-family: var(--font-mono); }
.wp-job-cancel {
  background: none;
  border: 0;
  color: var(--c-text-3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}
.wp-job-cancel:hover:not(:disabled) { background: var(--c-danger-light); color: var(--c-danger); }
.wp-job-cancel:disabled { opacity: 0.3; cursor: not-allowed; }

.worker-popup pre {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 8px;
  font-size: 11px;
  margin: 8px 0 0 0;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text) !important;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--sh);
}
.brand-name { color: var(--c-text); }
.topnav { display: flex; gap: 6px; align-items: center; }
.nav-link {
  color: var(--c-text-2);
  padding: 8px 14px;
  border-radius: var(--r);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--t-fast);
}
.nav-link:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.nav-link.is-active {
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-weight: 600;
}
.btn-sm { padding: 6px 12px !important; font-size: 13px !important; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all var(--t-fast);
  line-height: 1;
}
.btn:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--c-success); color: #fff !important; border-color: var(--c-success); }
.btn-primary:hover { background: #047857; border-color: #047857; }
.btn-blue { background: var(--c-primary); color: #fff !important; border-color: var(--c-primary); }
.btn-blue:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
.btn-danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.btn-danger:hover { background: #fef2f2; }

main { padding: 24px 32px; max-width: 1480px; margin: 0 auto; }

.page-head {
  margin: 0 0 18px 0;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.page-sub {
  margin: 0;
  color: var(--c-text-2);
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--t);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.stat:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  flex: 0 0 36px;
}
.stat-body { flex: 1; min-width: 0; }
.stat-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.stat-label {
  color: var(--c-text-2);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}
.stat-draft .stat-icon  { background: var(--c-surface-2); color: var(--c-text-2); }
.stat-queued .stat-icon { background: var(--c-warning-light); color: var(--c-warning); }
.stat-running .stat-icon{ background: var(--c-primary-light); color: var(--c-primary); }
.stat-done .stat-icon   { background: var(--c-success-light); color: var(--c-success); }
.stat-failed .stat-icon { background: var(--c-danger-light); color: var(--c-danger); }
.stat-redesign .stat-icon{ background: var(--c-pink-light); color: var(--c-pink); }
.stat-posted .stat-icon { background: var(--c-purple-light); color: var(--c-purple); }
.stat-running .stat-num { color: var(--c-primary); }
.stat-done .stat-num    { color: var(--c-success); }
.stat-failed .stat-num  { color: var(--c-danger); }
.stat-queued .stat-num  { color: var(--c-warning); }
.stat-redesign .stat-num{ color: var(--c-pink); }
.stat-posted .stat-num  { color: var(--c-purple); }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  box-shadow: var(--sh-sm);
}
.filters input[type="text"],
.filters select,
.filters .tag-filter-btn,
.filters .btn {
  height: 34px;
  font-size: 13px;
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  background: var(--c-surface);
  font-family: inherit;
  color: var(--c-text);
  box-sizing: border-box;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.filters input[type="text"]:focus,
.filters select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-light);
}
.filters input[type="text"] {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  padding: 0 10px;
}
.filters input[type="text"]::placeholder { color: #9ca3af; }
.filters select {
  padding: 0 24px 0 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}
.filters input[type="text"]:focus,
.filters select:focus {
  outline: 0;
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22,163,74,.12);
}
.filters .btn {
  padding: 0 14px;
  cursor: pointer;
  background: #f9fafb;
}
.filters .btn:hover { background: #f3f4f6; }
.reset { color: #9ca3af; font-size: 12px; margin-left: 2px; }
.reset:hover { color: #4b5563; }
.filter-date-right { margin-left: auto; }

.tag-filter { position: relative; }
.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  cursor: pointer;
  min-width: 160px;
  justify-content: space-between;
}
.tag-filter-btn:hover { background: #f9fafb; }
.tag-filter-caret { color: #9ca3af; font-size: 9px; }
.tag-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 240px;
  z-index: 100;
  padding: 8px;
}
.tag-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 6px;
}
.tag-search:focus {
  outline: 0;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.tag-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
}
.tag-option {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  color: #1a1a1a;
}
.tag-option:hover { background: #f3f4f6; }
.tag-option.is-active { background: #e0e7ff; color: #3730a3; font-weight: 500; }

table.mockups {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  table-layout: fixed;
}
table.mockups thead th {
  text-align: left;
  padding: 12px 14px;
  background: var(--c-surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.mockups tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
  background: var(--c-surface);
  transition: background var(--t-fast);
}
table.mockups tbody tr:last-child td { border-bottom: 0; }
table.mockups tbody tr:hover td { background: var(--c-surface-2); }
table.mockups tbody tr.is-selected td { background: var(--c-primary-light) !important; }

/* ============================================================================
   STICKY BULK ACTION BAR (xuất hiện khi chọn 1+ item)
   ============================================================================ */
.bulk-bar {
  position: sticky;
  top: 56px;
  z-index: 30;
  background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-hover) 100%);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh-md);
  animation: bulkBarSlide .2s ease;
}
.bulk-bar.is-hidden { display: none; }
.bulk-bar-count { font-weight: 600; font-size: 14px; }
.bulk-bar-count strong { font-size: 16px; padding: 0 4px; }
.bulk-bar .btn {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  font-size: 13px;
}
.bulk-bar .btn:hover { background: rgba(255,255,255,0.28); }
.bulk-bar .btn-clear { background: transparent; }
@keyframes bulkBarSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-2);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
}
.empty-state-msg {
  font-size: 13px;
  margin-bottom: 16px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.col-check { width: 36px; }
.col-time { width: 84px; padding-left: 8px !important; padding-right: 6px !important; }
td.time { font-size: 11px; }
td.col-type-cell { font-size: 11px; color: #4b5563; }
.col-mockup { width: 23%; }
.col-tags { width: 16%; }
.col-type { width: 8%; }
.col-shop { width: 9%; }
.col-status { width: 8%; }
.col-drive { width: 22%; }
.col-etsytag { width: 6%; }
.drive-empty { color: #cbd5e1; font-size: 13px; }

.etsy-tag-btn {
  background: transparent;
  border: 0;
  color: #4b5563;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  transition: background .12s;
}
.etsy-tag-btn:hover { background: #f3f4f6; }
.etsy-tag-svg { width: 32px; height: 32px; display: block; }
.etsy-tag-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 8px;
  width: 320px;
  z-index: 50;
}
.col-etsytag-cell { position: relative; }
.etsy-tag-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin: 2px;
  text-decoration: none;
  border: 1px solid #fde68a;
}
.etsy-tag-pill:hover { background: #fde68a; text-decoration: none; }
table.mockups th.col-check, table.mockups td.col-check {
  text-align: center !important;
  padding: 12px 0 0 !important;
  vertical-align: top !important;
}
.col-check input[type="checkbox"] {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: #16a34a;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  gap: 14px;
  position: sticky;
  top: 56px;          /* dưới topbar (≈54px) */
  z-index: 20;        /* dưới topbar (50) */
  background: var(--c-bg);
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
}
.toolbar-left { display: flex; align-items: center; gap: 10px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

.btn-danger-strong {
  height: 30px;
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}
.btn-danger-strong:hover:not(:disabled) { background: #fee2e2; border-color: #fca5a5; }
.btn-danger-strong:disabled {
  background: #fafbfc;
  color: #cbd5e1;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
.btn-run {
  background: #16a34a;
  color: #fff !important;
  border: 1px solid #16a34a;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-run:hover { background: #15803d; }
.btn-run:disabled { background: #e5e7eb; color: #9ca3af !important; border-color: #e5e7eb; cursor: not-allowed; }

.rd-notify-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid;
}
.rd-notify-bar[hidden] { display: none; }
.rd-notify-bar.rd-notify-running {
  background: #ecfdf5;
  color: #065f46;
  border-bottom-color: #a7f3d0;
}
.rd-notify-bar.rd-notify-waiting {
  background: #fef3c7;
  color: #92400e;
  border-bottom-color: #fde68a;
}
.rd-notify-spinner {
  display: inline-block;
  font-size: 16px;
  animation: rd-spin 1.4s linear infinite;
}
@keyframes rd-spin { to { transform: rotate(360deg); } }
.rd-notify-link {
  margin-left: auto;
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}
.rd-notify-bar { cursor: pointer; }
.rd-notify-bar:hover { filter: brightness(0.96); }

.rd-notify-panel {
  position: fixed;
  top: 42px;
  left: 16px;
  right: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  z-index: 199;
  font-size: 13px;
}
.rd-notify-panel[hidden] { display: none; }
.rd-notify-panel-head {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafbfc;
  border-radius: 8px 8px 0 0;
}
.rd-job-row {
  display: grid;
  grid-template-columns: 18px 50px 1fr 90px 60px;
  gap: 8px;
  padding: 8px 14px;
  align-items: center;
  border-bottom: 1px solid #f1f3f5;
  font-size: 12px;
}
.rd-job-row:last-child { border-bottom: 0; }
.rd-job-id { color: #6b7280; font-family: monospace; }
.rd-job-mockup { color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-job-prof { color: #4b5563; font-size: 11px; text-align: right; }
.rd-job-time { color: #9ca3af; font-family: monospace; text-align: right; }
.rd-empty-msg { padding: 16px; text-align: center; color: #9ca3af; font-style: italic; }

.btn-action {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.per-label {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}
.per-label select {
  height: 30px;
  padding: 0 24px 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  font-family: inherit;
}
.match-count { color: #6b7280; font-size: 12px; }
.match-count strong { color: #1a1a1a; font-weight: 600; }
.hint { font-weight: 400; color: #9ca3af; font-size: 11px; margin-left: 4px; }

.cell-tags {
  cursor: pointer;
  user-select: none;
  line-height: 1.9;
}
.cell-tags:hover { outline: 1px dashed #cbd5e1; outline-offset: -2px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #e0e7ff;
  color: #3730a3;
  padding: 1px 3px 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  margin: 1px 2px 1px 0;
  white-space: nowrap;
  line-height: 1.4;
}
.pill-x {
  background: transparent;
  border: 0;
  color: #6366f1;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 999px;
}
.pill-x:hover { background: rgba(99,102,241,.15); color: #b91c1c; }
.pill-empty {
  color: #9ca3af;
  font-size: 11px;
  font-style: italic;
}
.pill-more {
  background: #f3f4f6;
  color: #4b5563;
  padding: 1px 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 9px;
  border: 0;
  font-family: inherit;
}
.pill-more:hover { background: #e5e7eb; }
.more-tag-panel {
  position: absolute;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
  min-width: 200px;
  max-width: 280px;
  z-index: 50;
  margin-top: 4px;
}
.cell-tags { position: relative; }
.pill-more:hover { background: #e5e7eb; }

.action-group { position: relative; }
.btn-action {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e5e7eb;
  font-family: inherit;
  cursor: pointer;
}
.btn-action:hover:not(:disabled) { background: #f9fafb; }
.btn-action:disabled { background: #fafbfc; color: #cbd5e1; border-color: #e5e7eb; cursor: not-allowed; }
.action-count {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 6px;
  margin: 0 4px;
  background: #2563eb;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.btn-action:disabled .action-count { background: #cbd5e1; }

.action-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px;
  padding: 6px 0;
  z-index: 100;
}
.action-menu .menu-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9ca3af;
  padding: 6px 14px 4px;
  font-weight: 600;
}
.action-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
  cursor: pointer;
}
.action-menu .menu-item:hover:not(:disabled) { background: #f3f4f6; }
.action-menu .menu-item:disabled { color: #cbd5e1; cursor: not-allowed; }
.action-menu .menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}
.action-menu .menu-parent-wrapper { position: relative; }
.action-menu .menu-parent {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
  cursor: pointer;
  font-weight: 500;
}
.action-menu .menu-parent-wrapper:hover .menu-parent { background: #f3f4f6; }
.action-menu .menu-parent .caret {
  color: #9ca3af;
  font-size: 10px;
}
.action-menu .menu-parent-wrapper:hover .menu-parent .caret { color: #16a34a; }

.action-menu .submenu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 2px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 180px;
  padding: 6px 0;
  display: none;
  z-index: 10;
}
.action-menu .menu-parent-wrapper:hover .submenu { display: block; }
.action-menu .menu-empty {
  padding: 8px 14px;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}
.action-menu .menu-empty a { color: #2563eb; }

.cell-mockup { display: flex; align-items: flex-start; gap: 12px; }
.thumb {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
  cursor: zoom-in;
  transition: transform .12s, box-shadow .12s;
}
.thumb:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,.15); }

#zoomPreview {
  position: fixed;
  width: 256px;
  height: 256px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  z-index: 9999;
  pointer-events: none;
  display: none;
  background-color: #f3f4f6;
}
.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 18px;
}
.cell-text { min-width: 0; }
.cell-text .title {
  font-weight: 600;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.35;
}
.cell-text .meta {
  color: #6b7280;
  font-size: 12px;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.badge-draft   { background: var(--c-surface-2); color: var(--c-text-2); }
.badge-queued  { background: var(--c-warning-light); color: #92400e; }
.badge-running { background: var(--c-primary-light); color: #1e3a8a; animation: pulse-bg 1.6s ease-in-out infinite; }
.badge-done    { background: var(--c-success-light); color: #065f46; }
.badge-failed  { background: var(--c-danger-light); color: #991b1b; cursor: help; }
.badge-posted  { background: var(--c-purple-light); color: #5b21b6; }
.badge-redesign{ background: var(--c-pink-light); color: #9d174d; }
.redesign-of {
  display: inline-block;
  font-size: 10px;
  color: #9d174d;
  background: #fce7f3;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin-left: 6px;
  vertical-align: middle;
}

.btn-redesign-row {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 6px;
  background: var(--c-primary-light);
  color: var(--c-primary);
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.4;
  transition: all var(--t-fast);
}
.btn-redesign-row:hover { background: #bfdbfe; border-color: var(--c-primary); }
.time-date { line-height: 1.3; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%; max-width: 1100px; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
  padding: 14px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: transparent; border: 0;
  font-size: 24px; line-height: 1; cursor: pointer; color: #6b7280;
  padding: 0 4px;
}
.modal-close:hover { color: #1a1a1a; }
.modal-body { padding: 16px 20px; flex: 1; overflow: auto; }
.modal-footer {
  padding: 12px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
}
.rd-queue-info { margin-right: auto; font-size: 12px; color: #6b7280; }
.rd-queue-info .qi-free { color: #059669; font-weight: 600; }
.rd-queue-info .qi-busy { color: #d97706; font-weight: 600; }
.rd-queue-info .qi-pending { color: #2563eb; font-weight: 600; }
.rd-engine-group {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  padding: 6px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-right: 6px;
}
.rd-engine-cb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.rd-engine-cb input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

.redesign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.redesign-image-col { display: flex; flex-direction: column; gap: 10px; }
.redesign-img-wrap {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 16px;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
  overflow: hidden;
}
.redesign-img-wrap img {
  max-width: 100%; max-height: 400px;
  transition: transform .2s;
  border-radius: 4px;
}
.redesign-img-tools { display: flex; gap: 6px; align-items: center; }
.rotate-label { margin-left: auto; font-size: 13px; color: #6b7280; min-width: 40px; text-align: right; }
.redesign-img-slider { padding: 0 4px; }
.redesign-img-slider input[type="range"] { width: 100%; cursor: pointer; }
.rd-hint { font-size: 12px; color: #9ca3af; font-style: italic; }
.rd-label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; font-weight: 500; }
.redesign-prompt-col textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  resize: vertical;
  line-height: 1.5;
}
.rd-status { margin-top: 10px; font-size: 13px; min-height: 20px; }

.modal-lg { max-width: 1200px; }

.rd-tabs { display: flex; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.rd-tab {
  background: transparent;
  border: 0;
  padding: 8px 16px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  font-weight: 500;
}
.rd-tab.active { color: #16a34a; border-bottom-color: #16a34a; }
.rd-tab:hover:not(.active) { color: #1a1a1a; }

.rd-csv-summary { font-size: 13px; color: #4b5563; margin-bottom: 8px; }
.rd-csv-summary strong { color: #16a34a; }
.rd-err { color: #b91c1c; }
.rd-csv-preview {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 11px;
}
.rd-csv-row {
  display: grid;
  grid-template-columns: 32px 1fr 1.5fr;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid #f1f3f5;
}
.rd-csv-row:last-child { border-bottom: 0; }
.rd-csv-i { color: #9ca3af; font-weight: 600; }
.rd-csv-title { color: #1a1a1a; font-weight: 500; }
.rd-csv-prompt { color: #6b7280; font-family: ui-monospace, monospace; font-size: 10px; }
.rd-csv-more { padding: 6px; color: #9ca3af; text-align: center; font-style: italic; }

.redesign-img-wrap { min-height: 300px; max-height: 60vh; padding: 8px; }
.redesign-img-wrap img { max-width: 100%; max-height: 100%; display: block; }
@keyframes pulse-bg { 50% { background: #bfdbfe; } }
.drive-icon { margin-left: 6px; font-size: 14px; text-decoration: none; }

.drive-cell-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}
.drive-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
}
.thumb-mini {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  cursor: zoom-in;
  display: block;
  transition: transform .12s, box-shadow .12s;
}
.thumb-mini:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.drive-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.drive-mp4 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: 4px;
  text-decoration: none;
  transition: transform .12s;
}
.drive-mp4:hover { transform: scale(1.1); text-decoration: none; }
.drive-folder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 28px;
  height: 22px;
  border-radius: 4px;
  transition: background .12s;
}
.drive-folder-icon:hover { background: #f3f4f6; text-decoration: none; }
.menu-item-strong { font-weight: 600; color: #2563eb !important; }

.time { color: #6b7280; font-size: 11px; white-space: nowrap; line-height: 1.4; }
.time-hm { color: #9ca3af; font-size: 10px; }

.actions { white-space: nowrap; }
.inline-form { display: inline; margin-left: 8px; }
.link-edit { font-size: 13px; }

.empty { text-align: center; padding: 48px; color: #6b7280; }

.form-mockup {
  background: #fff;
  padding: 28px;
  border-radius: 8px;
  max-width: 640px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.form-mockup h2 { margin-top: 0; margin-bottom: 20px; font-size: 20px; }
.form-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -28px 20px -28px;
  padding: 12px 28px 14px 28px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 8px 8px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.form-header-bar h2 { margin: 0 !important; font-size: 18px; }
.form-header-bar .form-actions { margin: 0; gap: 8px; display: flex; align-items: center; }
.form-mockup label {
  display: block;
  margin-bottom: 16px;
}
.form-mockup label > span {
  display: block;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 5px;
  font-weight: 500;
}
.form-mockup input,
.form-mockup select,
.form-mockup textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-mockup input:focus,
.form-mockup select:focus,
.form-mockup textarea:focus {
  outline: 0;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.form-mockup textarea { min-height: 90px; resize: vertical; }

.form-preview {
  display: block;
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin: -8px 0 16px;
  object-fit: cover;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #f1f3f5;
}
.form-actions .cancel { color: #6b7280; }
.form-hint { display: block; color: #9ca3af; font-size: 11px; margin-top: 4px; }
.form-hint a { color: #6b7280; }

.page-title { font-size: 24px; margin: 0 0 4px; }
.page-sub { color: #6b7280; font-size: 13px; margin: 0 0 24px; }

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}
.config-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.config-card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  padding: 14px 20px;
  background: #f1f3f5;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.config-card h2::after {
  content: attr(data-count);
  font-size: 12px;
  color: #6b7280;
  background: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
}

.option-list {
  list-style: none;
  padding: 8px;
  margin: 0;
  background: #f8f9fa;
  max-height: 360px;
  overflow-y: auto;
}
.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  transition: background .15s;
}
.option-row:hover { background: #fafbfc; }
.option-row:last-child { margin-bottom: 0; }
.option-value { color: #1a1a1a; font-weight: 500; }
.option-empty {
  padding: 24px 12px;
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
  text-align: center;
}
.add-option-form {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.add-option-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.add-option-form input:focus {
  outline: 0;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}

table.logs-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin-top: 12px;
}
table.logs-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}
table.logs-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
  vertical-align: top;
}
table.logs-table tr.day-sep td {
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  padding: 8px 14px;
}
.day-sep-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.log-details {
  margin-top: 6px;
  font-size: 11px;
}
.log-details summary {
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  font-style: italic;
}
.log-details summary:hover { color: #2563eb; }
.log-details pre {
  margin: 6px 0 4px 0;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 11px;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow: auto;
}
.action-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  font-weight: 500;
}
.action-add, .action-import { background: #d1fae5; color: #065f46; }
.action-delete, .action-bulk-delete, .action-delete-bulk { background: #fee2e2; color: #991b1b; }
.action-edit, .action-bulk-status, .action-bulk-product-type { background: #dbeafe; color: #1e40af; }
.action-tag-add, .action-tag-remove, .action-bulk-add-tag, .action-ai-tag, .action-ai-tag-batch { background: #e0e7ff; color: #3730a3; }
.action-status-done, .action-status-running, .action-status-queued, .action-status-failed { background: #fef3c7; color: #92400e; }
.action-drive-upload, .action-queue-grok { background: #ede9fe; color: #5b21b6; }

.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  background: #f3f4f6;
  color: #6b7280;
}
.source-user { background: #dbeafe; color: #1e40af; }
.source-ai { background: #e0e7ff; color: #3730a3; }
.source-etsy_crawl { background: #fef3c7; color: #92400e; }

.mockup-link {
  font-family: monospace;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}
.mockup-link:hover { text-decoration: underline; }
.mockup-title-mini {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 24px 16px;
  margin: 16px auto 0;
}
.page-link {
  padding: 6px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--c-text-2);
  font-size: 13px;
  background: var(--c-surface);
  font-weight: 500;
  transition: all var(--t-fast);
  min-width: 36px;
  text-align: center;
}
.page-link:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.page-link.is-active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.page-link.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
}
.page-link.is-dots { border: 0; background: transparent; cursor: default; padding: 6px 4px; }
.page-info { font-size: 13px; color: var(--c-text-2); }

/* Worker widget */
.worker-widget {
  margin: 12px 0 16px;
  padding: 8px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.worker-widget:hover { background: #f3f4f6; }
.worker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.worker-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
}
.worker-dot.is-running { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.worker-dot.is-stopped { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }
.worker-text { color: #6b7280; }
.worker-status { font-weight: 600; }
.worker-status.is-running { color: #059669; }
.worker-status.is-stopped { color: #dc2626; }
.worker-pending { font-weight: 600; color: #d97706; }
.worker-pending.zero { color: #6b7280; font-weight: 400; }
.worker-last { color: #374151; font-family: ui-monospace, monospace; font-size: 12px; }
.worker-sep { color: #d1d5db; }
.worker-toggle {
  margin-left: auto;
  color: #6b7280;
  font-size: 14px;
}
.worker-log {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #111827;
  color: #d1d5db;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
}

/* Menu item danger (delete in action menu) */
.menu-item-danger {
  color: #dc2626 !important;
  font-weight: 600;
}
.menu-item-danger:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}
