/* Tab styles */
.tab-btn { cursor: pointer; padding: 0.75rem 1.5rem; font-weight: 700; font-size: 0.95rem; border-bottom: 3px solid transparent; transition: all 0.2s; color: #6B7280; }
.tab-btn:hover { color: #F97316; }
.tab-btn.active { color: #F97316; border-bottom-color: #F97316; }

/* Status badges */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.status-active { background: #DCFCE7; color: #166534; }
.status-paused { background: #FEF3C7; color: #92400E; }
.status-archived { background: #F3F4F6; color: #6B7280; }

/* Severity badges */
.severity-critical { border-left: 4px solid #EF4444; }
.severity-warning { border-left: 4px solid #F59E0B; }
.severity-info { border-left: 4px solid #3B82F6; }
.severity-opportunity { border-left: 4px solid #10B981; }
.severity-dot-critical { color: #EF4444; }
.severity-dot-warning { color: #F59E0B; }
.severity-dot-info { color: #3B82F6; }
.severity-dot-opportunity { color: #10B981; }

/* Sort */
.sort-btn { cursor: pointer; user-select: none; }
.sort-btn:hover { color: #F97316; }
.sort-btn .sort-icon { opacity: 0.3; }
.sort-btn.active .sort-icon { opacity: 1; color: #F97316; }

/* Creative preview */
.creative-preview { display: flex; align-items: center; gap: 8px; max-width: 280px; }
.creative-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.creative-preview .creative-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #4B5563; }

/* Suggestion card */
.suggestion-card { transition: all 0.2s; }
.suggestion-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* AI action board */
.ai-action-board {
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.ai-action-stat {
  background: #fff;
  border: 1px solid #ffedd5;
  border-radius: 14px;
  padding: 14px;
}
.ai-action-stat-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}
.ai-action-stat-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: #111827;
}
.ai-priority-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f3f4f6;
}
.ai-priority-row + .ai-priority-row {
  margin-top: 8px;
}
.ai-priority-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.ai-priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
}
.ai-priority-chip.critical { background: #fee2e2; color: #b91c1c; }
.ai-priority-chip.warning { background: #fef3c7; color: #92400e; }
.ai-priority-chip.opportunity { background: #dcfce7; color: #166534; }
.ai-priority-chip.info { background: #dbeafe; color: #1d4ed8; }
.ai-decision-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.ai-decision-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  padding: 7px 8px;
  min-width: 0;
}
.ai-decision-label {
  font-size: 9px;
  font-weight: 900;
  color: #9ca3af;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}
.ai-decision-value {
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-decision-detail {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.35;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-decision-item.good { border-color: #bbf7d0; background: #f0fdf4; }
.ai-decision-item.good .ai-decision-value { color: #166534; }
.ai-decision-item.warning { border-color: #fde68a; background: #fffbeb; }
.ai-decision-item.warning .ai-decision-value { color: #92400e; }
.ai-decision-item.critical { border-color: #fecaca; background: #fef2f2; }
.ai-decision-item.critical .ai-decision-value { color: #b91c1c; }
@media (max-width: 900px) { .ai-decision-line { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ai-priority-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.ai-priority-desc {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}
.ai-priority-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ai-priority-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
}
.ai-priority-actions .primary {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}
.ai-priority-actions .ghost:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}
.ai-priority-actions .primary:hover {
  background: #ea580c;
}
.ai-suggestion-section {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}
.ai-suggestion-section.ready { border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%); }
.ai-suggestion-section.caution { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%); }
.ai-suggestion-section.blocked { border-color: #fecaca; background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%); }
.ai-suggestion-section.other { border-color: #e5e7eb; background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%); }
.ai-suggestion-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}
.ai-suggestion-section-note {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}
.ai-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
}
.experiment-log-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.experiment-log-item {
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.experiment-log-item + .experiment-log-item {
  margin-top: 8px;
}
.experiment-log-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
}
.experiment-log-chip.planned { background: #fef3c7; color: #92400e; }
.experiment-log-chip.running { background: #dbeafe; color: #1d4ed8; }
.experiment-log-chip.done { background: #dcfce7; color: #166534; }
.experiment-log-chip.verified { background: #dcfce7; color: #166534; }
.experiment-log-chip.due { background: #ffedd5; color: #c2410c; }
.experiment-log-chip.rejected { background: #fee2e2; color: #b91c1c; }
.experiment-verification-box {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  font-size: 11px;
  color: #4b5563;
}
.experiment-verification-box.verified { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.experiment-verification-box.rejected { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.experiment-verification-box.review { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.experiment-verification-box.pending { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.experiment-log-section {
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.experiment-log-section + .experiment-log-section {
  margin-top: 10px;
}
.experiment-log-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
}
.experiment-log-section-note {
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
}
.validation-card {
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.validation-stat {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.validation-stat-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}
.validation-stat-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: #111827;
}
.validation-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}
.validation-chip.good { background: #dcfce7; color: #166534; }
.validation-chip.warning { background: #fef3c7; color: #92400e; }
.validation-chip.critical { background: #fee2e2; color: #b91c1c; }
.validation-chip.info { background: #dbeafe; color: #1d4ed8; }
.validation-note {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
}
.validation-note.warning { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.validation-note.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.compare-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}
.compare-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}
.compare-pill.good { background: #dcfce7; color: #166534; }
.compare-pill.warning { background: #fef3c7; color: #92400e; }
.compare-pill.critical { background: #fee2e2; color: #b91c1c; }
.compare-stat-box {
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}
.compare-stat-title {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
}
.compare-stat-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}
.compare-stat-metric {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.55;
}

/* Drawer (side panel) — used for offline conversions detail */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 250; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 92vw); background: #fff; z-index: 251; box-shadow: -12px 0 40px rgba(0,0,0,0.15); transform: translateX(100%); transition: transform 0.25s ease; display: flex; flex-direction: column; }
.drawer-panel.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #E5E7EB; flex-shrink: 0; background: #fff; }
.drawer-header h3 { font-size: 16px; font-weight: 700; color: #1F2937; margin: 0; display: flex; align-items: center; gap: 8px; }
.drawer-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: #F3F4F6; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; color: #6B7280; }
.drawer-close:hover { background: #E5E7EB; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

/* AI Vision quality score badges */
.quality-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.quality-badge.high { background: #10B981; }
.quality-badge.mid { background: #F59E0B; }
.quality-badge.low { background: #EF4444; }
.quality-badge i { font-size: 10px; }

/* Creative analysis suggestion card (Vision) */
.creative-analysis-card {
  background: linear-gradient(180deg, #FFFBEB 0%, #FFF 100%);
  border: 2px solid #FDE68A;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 14px;
}
.creative-analysis-card .thumb {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
}
.creative-analysis-card .ca-body { flex: 1; min-width: 0; }
.creative-analysis-card .ca-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.creative-analysis-card .ca-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.creative-analysis-card .ca-score-pill.high { background: #10B981; }
.creative-analysis-card .ca-score-pill.mid { background: #F59E0B; }
.creative-analysis-card .ca-score-pill.low { background: #EF4444; }
.creative-analysis-card .ca-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}
.creative-analysis-card .ca-section {
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.5;
}
.creative-analysis-card .ca-section.strong { color: #047857; }
.creative-analysis-card .ca-section.weak { color: #B91C1C; }
.creative-analysis-card .ca-section.rec {
  color: #1F2937;
  background: #FEF3C7;
  padding: 6px 8px;
  border-radius: 6px;
  margin-top: 6px;
}
.creative-analysis-card .ca-actions { margin-top: 8px; display: flex; gap: 6px; }
.creative-analysis-card .ca-actions button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.creative-analysis-card .ca-actions .btn-replace {
  background: #F97316;
  color: #fff;
}
.creative-analysis-card .ca-actions .btn-replace:hover { background: #EA580C; }
.creative-analysis-card .ca-actions .btn-dismiss {
  background: #F3F4F6;
  color: #6B7280;
}
.creative-analysis-card .ca-actions .btn-dismiss:hover { background: #E5E7EB; }

/* Form input */
.form-input { border: 1px solid #D1D5DB; border-radius: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; width: 100%; transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: #F97316; box-shadow: 0 0 0 2px rgba(249,115,22,0.15); }
.form-select { border: 1px solid #D1D5DB; border-radius: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; width: 100%; background: white; }
.form-select:focus { outline: none; border-color: #F97316; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 100; padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(100px); opacity: 0; transition: all 0.3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #DCFCE7; color: #166534; }
.toast-error { background: #FEE2E2; color: #991B1B; }

/* Loading spinner */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #FFF; border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline hierarchy rows */
.adset-inline-row td { background: #F9FAFB; }
.adset-inline-row:hover td { background: #F3F4F6 !important; }
.ad-inline-row td { background: #F3F4F6; }
.ad-inline-row:hover td { background: #E5E7EB !important; }
.expand-btn { cursor: pointer; transition: transform 0.2s; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; }
.expand-btn:hover { background: #F3F4F6; }
.expand-btn.open { transform: rotate(90deg); }
.count-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; background: #EFF6FF; color: #1D4ED8; cursor: pointer; }
.count-badge:hover { background: #DBEAFE; }
.ad-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid #E5E7EB; }

/* Creative Replace Modal */
.replace-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.replace-modal-overlay.open { opacity: 1; pointer-events: auto; }
.replace-modal-content { background: #fff; border-radius: 16px; max-width: 720px; width: 95%; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.replace-asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.replace-asset-card { border: 2px solid #E5E7EB; border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.2s; }
.replace-asset-card:hover { border-color: #F97316; box-shadow: 0 2px 8px rgba(249,115,22,0.2); }
.replace-asset-card.selected { border-color: #F97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.3); }
.replace-asset-card { position: relative; }
.replace-asset-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #F3F4F6; }
.replace-asset-card .info { padding: 8px; font-size: 11px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replace-asset-card .replace-status-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.replace-play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; pointer-events: none; }
.replace-asset-card:hover .replace-play-overlay { opacity: 0; }

/* Creative Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-content { background: #fff; border-radius: 16px; max-width: 560px; width: 92%; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #E5E7EB; position: sticky; top: 0; background: #fff; border-radius: 16px 16px 0 0; z-index: 1; }
.modal-header h3 { font-size: 15px; font-weight: 700; color: #1F2937; margin: 0; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: #F3F4F6; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; color: #6B7280; }
.modal-close:hover { background: #E5E7EB; }
.modal-body { padding: 16px; }
.cr-card { background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.cr-card:last-child { margin-bottom: 0; }
.cr-card-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.cr-card-body { padding: 16px; }
.cr-name { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cr-name .cr-idx { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: #F97316; color: #fff; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.cr-field { margin-bottom: 10px; }
.cr-field:last-child { margin-bottom: 0; }
.cr-field-label { font-size: 11px; font-weight: 700; color: #F97316; margin-bottom: 3px; letter-spacing: 0.5px; }
.cr-field-value { font-size: 13px; color: #374151; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.cr-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.cr-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #fff; border: 1px solid #E5E7EB; color: #6B7280; }

/* Creative Grid Card */
.asset-card { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; overflow: hidden; transition: all 0.2s; }
.asset-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.asset-card.in-use { border-color: #86EFAC; box-shadow: 0 0 0 1px rgba(34,197,94,0.16); }
.asset-card-thumb { position: relative; width: 100%; aspect-ratio: 1; background: #F3F4F6; overflow: hidden; }
.asset-card-thumb img, .asset-card-thumb video { width: 100%; height: 100%; object-fit: cover; }
.asset-card-thumb .type-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; color: #fff; }
.asset-card-thumb .type-badge.image { background: #3B82F6; }
.asset-card-thumb .type-badge.video { background: #EF4444; }
.asset-card-thumb .duration-badge { position: absolute; bottom: 8px; right: 8px; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; background: rgba(0,0,0,0.7); color: #fff; }
.asset-card-thumb .video-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.asset-card-thumb .video-play-overlay i { width: 44px; height: 44px; background: rgba(0,0,0,0.55); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; padding-left: 3px; }
.asset-card-info { padding: 10px 12px; }
.asset-card-name { font-size: 12px; font-weight: 600; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; }
.asset-card-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.meta-badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; display: inline-flex; align-items: center; }
.meta-badge.ready { background: #E0F2FE; color: #075985; }
.meta-badge.used { background: #ECFDF5; color: #047857; }
.meta-badge.unused { background: #F3F4F6; color: #6B7280; }
.meta-badge.pending { background: #FEF3C7; color: #92400E; }
.meta-badge.done { background: #DCFCE7; color: #166534; }
.meta-badge.error { background: #FEE2E2; color: #991B1B; }
.meta-badge.uploading { background: #DBEAFE; color: #1E40AF; }
.meta-badge.locked { background: #DCFCE7; color: #166534; }
.asset-card { position: relative; }
.asset-card.selected { outline: 3px solid #2563EB; outline-offset: -3px; border-radius: 12px; }
.asset-checkbox { position: absolute; top: 8px; left: 8px; z-index: 10; width: 24px; height: 24px; border-radius: 6px; border: 2px solid #fff; background: rgba(0,0,0,0.3); cursor: pointer; display: flex; align-items: center; justify-content: center; color: transparent; transition: all 0.15s; }
.asset-checkbox:hover { background: rgba(37,99,235,0.6); color: #fff; }
.asset-checkbox.checked { background: #2563EB; border-color: #2563EB; color: #fff; }
.asset-card-actions { display: flex; gap: 4px; }
.asset-card-actions button { flex: 1; padding: 5px 4px; border: 1px solid #E5E7EB; border-radius: 6px; font-size: 10px; font-weight: 600; background: #fff; cursor: pointer; transition: all 0.15s; }
.asset-card-actions button:hover { background: #F97316; color: #fff; border-color: #F97316; }
.asset-card-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.asset-card-actions button:disabled:hover { background: #fff; color: inherit; border-color: #E5E7EB; }
#upload-dropzone.drag-over { border-color: #3B82F6 !important; background: #EFF6FF !important; }
.creative-upload-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.creative-upload-location { display: flex; align-items: center; gap: 10px; min-width: 0; }
.creative-upload-location label { display: inline-flex; align-items: center; gap: 7px; color: #374151; font-size: 13px; font-weight: 900; white-space: nowrap; }
.creative-upload-location select { width: 260px; max-width: 48vw; }
.creative-folder-subtabs { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.creative-folder-tab { padding: 8px 11px; border-radius: 999px; border: 1px solid #E5E7EB; background: #fff; color: #4B5563; font-size: 11px; font-weight: 900; cursor: pointer; transition: all 0.15s; }
.creative-folder-tab:hover { transform: translateY(-1px); border-color: #F97316; color: #EA580C; background: #FFF7ED; }
.creative-folder-tab.danger { color: #B91C1C; border-color: #FECACA; background: #FEF2F2; }
.creative-folder-tab.danger:hover { border-color: #EF4444; background: #EF4444; color: #fff; }
.creative-folder-tab:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.creative-folder-help { margin-bottom: 12px; color: #8A94A6; font-size: 12px; }
.folder-input-body { padding: 20px; }
.folder-input-body p { margin: 0 0 14px; color: #6B7280; font-size: 13px; line-height: 1.5; }
.folder-input-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.folder-input-actions button { border: none; border-radius: 10px; padding: 9px 14px; font-size: 12px; font-weight: 900; cursor: pointer; }
.folder-input-cancel { background: #F3F4F6; color: #4B5563; }
.folder-input-submit { background: #F97316; color: #fff; }
.folder-input-submit:hover { background: #EA580C; }
@media (max-width: 760px) { .creative-upload-bar { align-items: flex-start; flex-direction: column; } .creative-folder-subtabs { margin-left: 0; flex-wrap: wrap; } .creative-upload-location { width: 100%; } .creative-upload-location select { flex: 1; max-width: none; } }
.asset-usage-summary { margin-bottom: 8px; padding: 6px 8px; border-radius: 8px; background: #F9FAFB; color: #4B5563; font-size: 10px; line-height: 1.45; }
.asset-usage-summary.active { background: #F0FDF4; color: #166534; }
.asset-usage-summary strong { color: #111827; }
.asset-usage-summary.active strong { color: #14532D; }
.asset-usage-location { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-usage-detail { margin-top: 3px; color: #6B7280; }
.asset-folder-label { font-size: 10px; color: #6B7280; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-actions .danger:hover { background: #EF4444; color: #fff; border-color: #EF4444; }

/* Targeting UI (Step 2) */
.targeting-section { border: 1px solid #E5E7EB; border-radius: 12px; overflow: hidden; margin-top: 1rem; }
.targeting-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #F9FAFB; cursor: pointer; user-select: none; font-weight: 700; color: #374151; font-size: 13px; }
.targeting-header:hover { background: #F3F4F6; }
.targeting-header .chev { transition: transform 0.2s; }
.targeting-section.open .chev { transform: rotate(90deg); }
.targeting-body { display: none; padding: 16px; background: #fff; }
.targeting-section.open .targeting-body { display: block; }
.targeting-subtitle { font-size: 11px; font-weight: 700; color: #6B7280; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.targeting-field { margin-bottom: 18px; }
.targeting-field:last-child { margin-bottom: 0; }

/* Segment control (gender) */
.seg-control { display: inline-flex; border: 1px solid #D1D5DB; border-radius: 8px; overflow: hidden; background: #fff; }
.seg-control button { padding: 6px 14px; font-size: 12px; font-weight: 600; color: #6B7280; background: #fff; border: none; cursor: pointer; transition: all 0.15s; }
.seg-control button + button { border-left: 1px solid #E5E7EB; }
.seg-control button.active { background: #F97316; color: #fff; }

/* Age dual slider */
.age-slider-wrap { position: relative; padding: 6px 4px 30px 4px; }
.age-slider-track { position: relative; height: 4px; background: #E5E7EB; border-radius: 2px; }
.age-slider-range { position: absolute; height: 4px; background: #F97316; border-radius: 2px; }
.age-slider-input { position: absolute; top: -8px; left: 0; width: 100%; height: 20px; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.age-slider-input::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #F97316; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.age-slider-input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #F97316; cursor: pointer; }
.age-slider-labels { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; font-weight: 600; color: #374151; }
.age-slider-value { font-weight: 800; color: #F97316; }

/* Chip (interests, custom, lookalike) */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #F3F4F6; color: #374151; border: 1px solid #E5E7EB; cursor: pointer; transition: all 0.15s; }
.chip:hover { background: #FED7AA; color: #9A3412; border-color: #F97316; }
.chip.active { background: #F97316; color: #fff; border-color: #F97316; }
.chip.removable { padding-right: 4px; }
.chip .x { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,0.12); font-size: 10px; cursor: pointer; }
.chip .x:hover { background: rgba(0,0,0,0.25); }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-group .chip { margin: 0; }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); max-height: 240px; overflow-y: auto; z-index: 50; display: none; }
.autocomplete-dropdown.open { display: block; }
.autocomplete-item { padding: 8px 12px; font-size: 13px; color: #374151; cursor: pointer; border-bottom: 1px solid #F3F4F6; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.highlighted { background: #FFF7ED; color: #9A3412; }
.autocomplete-item .meta { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* Multi-select dropdown */
.multiselect-wrap { position: relative; }
.multiselect-trigger { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 6px 12px; border: 1px solid #D1D5DB; border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; color: #6B7280; }
.multiselect-trigger:hover { border-color: #F97316; }
.multiselect-trigger.has-selection { color: #111827; }
.multiselect-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); max-height: 280px; overflow-y: auto; z-index: 50; display: none; }
.multiselect-dropdown.open { display: block; }
.multiselect-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: #374151; cursor: pointer; border-bottom: 1px solid #F3F4F6; }
.multiselect-item:last-child { border-bottom: none; }
.multiselect-item:hover { background: #FFF7ED; }
.multiselect-item input[type="checkbox"] { accent-color: #F97316; }
.multiselect-item .size { margin-left: auto; font-size: 11px; color: #9CA3AF; }
.multiselect-empty { padding: 20px; text-align: center; font-size: 12px; color: #9CA3AF; }

/* Action summary cards */
.home-action-card { border-radius: 18px; padding: 18px; border: 1px solid #E5E7EB; background: linear-gradient(180deg, #fff, #FAFAFA); }
.home-action-card.good { border-color: #BBF7D0; background: linear-gradient(180deg, #F0FDF4, #fff); }
.home-action-card.warning { border-color: #FED7AA; background: linear-gradient(180deg, #FFF7ED, #fff); }
.home-action-card.critical { border-color: #FECACA; background: linear-gradient(180deg, #FEF2F2, #fff); }
.home-action-title { font-size: 14px; font-weight: 950; color: #111827; margin-bottom: 6px; }
.home-action-note { font-size: 12px; color: #4B5563; line-height: 1.55; }
.operation-notes-strip { border: 1px solid #e5e7eb; border-radius: 16px; background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%); }
.operation-note-item { border: 1px solid #f3f4f6; border-radius: 12px; background: #fff; padding: 10px 12px; }
.operation-note-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #fff7ed; color: #c2410c; font-size: 10px; font-weight: 800; }
.operation-note-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.operation-note-actions button { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 7px; border: 1px solid #e5e7eb; background: #fff; color: #4b5563; font-size: 10px; font-weight: 800; white-space: nowrap; }
.operation-note-actions button:hover { border-color: #f97316; background: #fff7ed; color: #c2410c; }
.operation-note-actions .primary { background: #111827; color: #fff; border-color: #111827; }
.operation-note-actions .primary:hover { background: #374151; border-color: #374151; color: #fff; }
.home-health-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 900; }
.home-health-pill.good { background: #DCFCE7; color: #166534; }
.home-health-pill.warning { background: #FEF3C7; color: #92400E; }
.home-health-pill.critical { background: #FEE2E2; color: #B91C1C; }
.storage-health-wrap { position: relative; display: inline-flex; margin-top: 6px; }
.storage-health-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; font-size: 10px; font-weight: 800; }
.storage-health-toggle.good { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.storage-health-toggle.warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.storage-health-toggle.critical { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.storage-health-strip { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; width: min(560px, calc(100vw - 48px)); flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid #e5e7eb; background: #fff; box-shadow: 0 16px 40px rgba(15,23,42,0.14); }
.storage-health-strip.open { display: flex; }
.storage-health-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 900; border: 1px solid transparent; }
.storage-health-pill.good { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.storage-health-pill.warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.storage-health-pill.critical { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.storage-health-pill.info { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.experiment-log-helper { border: 1px solid #dbeafe; background: #eff6ff; color: #1d4ed8; border-radius: 12px; padding: 9px 11px; font-size: 11px; line-height: 1.45; margin-bottom: 10px; }
.experiment-log-list-scroll { max-height: 720px; overflow-y: auto; padding-right: 4px; }
.experiment-log-list-scroll.is-collapsed { max-height: none; overflow: visible; }
.experiment-log-more-btn { width: 100%; border: 1px dashed #cbd5e1; color: #475569; background: #f8fafc; border-radius: 12px; padding: 9px; font-size: 11px; font-weight: 900; }
.experiment-log-more-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.experiment-log-filter-tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid #e5e7eb; background: #f8fafc; border-radius: 999px; }
.experiment-log-filter-tab { border: 0; background: transparent; color: #64748b; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 900; transition: all 0.15s; }
.experiment-log-filter-tab:hover { color: #0f172a; background: #fff; }
.experiment-log-filter-tab.active { background: #0f172a; color: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16); }
.analytics-control-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.analytics-insight-card { border: 1px solid #E5E7EB; border-radius: 16px; padding: 16px; background: #fff; }
.analytics-insight-card.good { border-color: #BBF7D0; background: #F0FDF4; }
.analytics-insight-card.warning { border-color: #FED7AA; background: #FFF7ED; }
.analytics-insight-card.critical { border-color: #FECACA; background: #FEF2F2; }
.analytics-insight-label { font-size: 11px; font-weight: 900; color: #6B7280; margin-bottom: 6px; }
.analytics-insight-value { font-size: 22px; font-weight: 950; color: #111827; }
.analytics-insight-note { font-size: 11px; color: #4B5563; line-height: 1.5; margin-top: 6px; }
.analytics-decision-panel { border-radius: 20px; padding: 18px; border: 1px solid #e5e7eb; background: linear-gradient(135deg, #fff7ed 0%, #ffffff 55%, #f8fafc 100%); }
.analytics-decision-panel.good { border-color: #bbf7d0; background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%, #f8fafc 100%); }
.analytics-decision-panel.warning { border-color: #fed7aa; background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%, #f8fafc 100%); }
.analytics-decision-panel.critical { border-color: #fecaca; background: linear-gradient(135deg, #fef2f2 0%, #ffffff 60%, #f8fafc 100%); }
.analytics-decision-eyebrow { font-size: 11px; font-weight: 950; color: #64748b; letter-spacing: .02em; margin-bottom: 6px; }
.analytics-decision-title { font-size: 20px; font-weight: 950; color: #111827; line-height: 1.25; }
.analytics-decision-note { font-size: 12px; color: #475569; line-height: 1.55; margin-top: 8px; max-width: 780px; }
.analytics-decision-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.analytics-decision-item { border: 1px solid #e5e7eb; border-radius: 14px; background: rgba(255,255,255,.78); padding: 11px 12px; }
.analytics-decision-item-label { font-size: 10px; font-weight: 950; color: #94a3b8; margin-bottom: 4px; }
.analytics-decision-item-value { font-size: 12px; font-weight: 900; color: #1f2937; line-height: 1.35; }
.analytics-section-note { border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; border-radius: 12px; padding: 10px 12px; font-size: 11px; line-height: 1.5; margin-bottom: 14px; }
@media (max-width: 768px) { .analytics-decision-list { grid-template-columns: 1fr; } }
