/* Shared shell — reset, body, header/nav. Feature-specific styles (cards,
   tabs, tables, etc.) are added per-feature as they're ported (T10-T13). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6fa;
  color: #1a1a2e;
  min-height: 100vh;
}

header {
  background: #1a1a2e;
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; white-space: nowrap; }

nav { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; }
nav a {
  padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: #8888aa; text-decoration: none;
}
nav a:hover { color: #fff; }
nav a.active { color: #fff; background: #4f6ef7; }

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

/* ---------------------------------------------------------------------
   Shared feature-page widgets (cards, forms, buttons, tables, toasts).
   Ported from OLD/templates/index.html — reused by products/reviews too.
   --------------------------------------------------------------------- */

.card {
  background: #fff; border-radius: 10px;
  border: 1px solid #e4e7ee; padding: 20px 24px; margin-bottom: 20px;
}

.filter-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 500; color: #666; text-transform: uppercase; letter-spacing: 0.4px; }
.field input[type="date"] {
  height: 38px; padding: 0 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 14px; color: #1a1a2e; background: #fff; outline: none;
}
.field input[type="date"]:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79,110,247,0.12); }

.btn {
  height: 38px; padding: 0 18px; border-radius: 6px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #4f6ef7; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3a5ae8; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-outline { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover:not(:disabled) { background: #f9fafb; }

.stats-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.stats { display: flex; gap: 24px; }
.stat { text-align: center; }
.stat-value { font-size: 22px; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid #e4e7ee; margin-bottom: 0; }
.tab-btn {
  padding: 11px 20px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: none; background: none; color: #6b7280;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color 0.15s;
}
.tab-btn:hover { color: #374151; }
.tab-btn.active { color: #4f6ef7; border-bottom-color: #4f6ef7; }
.tab-count {
  display: inline-block; background: #f3f4f6; color: #6b7280;
  border-radius: 99px; padding: 1px 8px; font-size: 11.5px; font-weight: 600;
}
.tab-btn.active .tab-count { background: #eef1fe; color: #4f6ef7; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600;
  color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid #e4e7ee; white-space: nowrap;
}
tbody tr.order-row { border-bottom: 1px solid #f0f2f7; transition: background 0.1s; }
tbody tr.order-row:hover { background: #f8f9fc; }
tbody td { padding: 11px 14px; vertical-align: middle; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500; text-transform: capitalize;
}
.badge-paid     { background: #dcfce7; color: #15803d; }
.badge-pending  { background: #fef9c3; color: #a16207; }
.badge-refunded { background: #fee2e2; color: #dc2626; }
.badge-voided   { background: #f3f4f6; color: #6b7280; }
.badge-partial  { background: #ede9fe; color: #7c3aed; }

.sync-badge { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-synced   { background: #16a34a; }
.dot-unsynced { background: #d1d5db; }

/* Detail expand row */
tr.detail-row td { padding: 0 !important; border: none !important; }
.detail-panel {
  background: #f8f9fc; border-top: 2px solid #e4e7ee;
  border-bottom: 2px solid #e4e7ee; padding: 16px 20px; font-size: 12.5px;
}
.detail-section { margin-bottom: 14px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: #9ca3af; margin-bottom: 8px;
}
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th {
  font-size: 10px; font-weight: 600; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 4px 8px; text-align: left; border-bottom: 1px solid #e4e7ee;
}
.detail-table td { padding: 7px 8px; vertical-align: top; border-bottom: 1px solid #f0f2f7; }
.detail-table tr:last-child td { border-bottom: none; }
.ok   { color: #16a34a; }
.err  { color: #dc2626; }
.warn { color: #d97706; }
.muted { color: #9ca3af; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tag-igst { background: #ede9fe; color: #7c3aed; }
.tag-cgst { background: #dbeafe; color: #1d4ed8; }
.tag-none { background: #f3f4f6; color: #6b7280; }
.detail-totals {
  display: inline-flex; gap: 20px; align-items: center;
  background: #fff; border: 1px solid #e4e7ee; border-radius: 6px; padding: 10px 16px;
}
.total-item { text-align: center; }
.total-val { font-size: 15px; font-weight: 700; }
.total-lbl { font-size: 10px; color: #9ca3af; text-transform: uppercase; margin-top: 2px; }
.chevron-btn {
  width: 26px; height: 26px; border-radius: 5px;
  border: 1px solid #e4e7ee; background: #f9fafb;
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; padding: 0; flex-shrink: 0;
}
.chevron-btn:hover { background: #eff0f5; }
.chevron-btn svg { transition: transform 0.2s; }
.chevron-btn.open svg { transform: rotate(180deg); }

#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 1000;
}
.toast {
  padding: 12px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  animation: slide-in 0.2s ease; max-width: 340px;
}
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #1d4ed8; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.badge-match-ready  { background: #dcfce7; color: #15803d; }
.badge-match-issues { background: #fef9c3; color: #a16207; cursor: default; }
.badge-match-error  { background: #fee2e2; color: #dc2626; }

.empty { text-align: center; padding: 48px 24px; color: #9ca3af; }
.empty svg { margin-bottom: 12px; opacity: 0.4; }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle;
}
.spinner-dark {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(0,0,0,0.1); border-top-color: #4f6ef7;
  border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

.progress-wrap { margin-top: 10px; }
.progress-bar-track { height: 6px; background: #e4e7ee; border-radius: 99px; overflow: hidden; }
.progress-bar-fill  { height: 100%; background: #4f6ef7; border-radius: 99px; transition: width 0.3s; width: 0%; }
.progress-label { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* ---------------------------------------------------------------------
   Products page — scoped under .products-page. OLD/templates/products.html
   duplicated several class names from index.html (.btn, .chevron-btn,
   .detail-row, thead th, tbody td, .stats gap) with slightly different
   values/behavior (e.g. .detail-row's visibility toggle is the opposite
   mechanism from orders' .hidden-based one). Scoping avoids silently
   breaking one page's look when the other page's rule "wins".
   --------------------------------------------------------------------- */

.products-page main { max-width: 1400px; }

.products-page .stats { gap: 28px; }

.products-page .btn {
  height: 36px; padding: 0 16px; border-radius: 6px; font-size: 13.5px;
  font-weight: 500; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.products-page .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.products-page .btn-primary { background: #4f6ef7; color: #fff; }
.products-page .btn-primary:hover:not(:disabled) { background: #3a5ae8; }
.products-page .btn-success { background: #16a34a; color: #fff; }
.products-page .btn-success:hover:not(:disabled) { background: #15803d; }
.products-page .btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.products-page .btn-ghost { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.products-page .btn-ghost:hover:not(:disabled) { background: #f9fafb; }
.products-page .btn-warning { background: #d97706; color: #fff; }
.products-page .btn-warning:hover:not(:disabled) { background: #b45309; }
.products-page .btn-reviews { background: #7c3aed; color: #fff; }
.products-page .btn-reviews:hover:not(:disabled) { background: #6d28d9; }

.products-page thead th { background: #fafafa; }
.products-page tbody tr.main-row { border-bottom: 1px solid #f0f2f7; transition: background 0.1s; }
.products-page tbody tr.main-row:hover { background: #f8f9fc; }
.products-page tbody td { padding: 10px 12px; vertical-align: middle; }

.products-page .chevron-btn {
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  color: #9ca3af; font-size: 14px; border-radius: 4px;
  transition: color 0.15s, transform 0.2s;
  line-height: 1;
}
.products-page .chevron-btn:hover { color: #4f6ef7; background: #eef1fe; }
.products-page .chevron-btn.open { transform: rotate(180deg); color: #4f6ef7; }

.products-page .detail-row { display: none; }
.products-page .detail-row.visible { display: table-row; }
.products-page .detail-panel {
  padding: 16px 20px 20px 44px;
  background: #f8faff;
  border-bottom: 2px solid #e4e7ee;
}

.products-page .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.products-page .detail-section-title {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.products-page .preview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.products-page .preview-table th {
  padding: 6px 10px; text-align: left; font-size: 11px; font-weight: 600;
  color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px;
  border-bottom: 1px solid #e4e7ee; background: #f0f2f7;
}
.products-page .preview-table td { padding: 7px 10px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.products-page .preview-table tr:last-child td { border-bottom: none; }

.products-page .ok   { color: #15803d; }
.products-page .warn { color: #d97706; }
.products-page .err  { color: #dc2626; }
.products-page .muted { color: #9ca3af; font-style: italic; }
.products-page .arrow { color: #6b7280; margin: 0 4px; }

.products-page .conf-badge { display: inline-block; padding: 1px 6px; border-radius: 99px; font-size: 10.5px; font-weight: 600; }
.products-page .conf-exact  { background: #dcfce7; color: #15803d; }
.products-page .conf-strong { background: #dbeafe; color: #1d4ed8; }
.products-page .conf-weak   { background: #fef9c3; color: #92400e; }

.products-page .match-cell { min-width: 200px; }
.products-page .match-found .match-name { font-weight: 600; color: #15803d; }
.products-page .match-found .match-detail { color: #6b7280; margin-top: 2px; font-size: 12px; }
.products-page .no-match { color: #9ca3af; font-size: 12.5px; font-style: italic; }

.products-page .field-diff { display: flex; flex-direction: column; gap: 3px; min-width: 160px; }
.products-page .diff-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.products-page .diff-label { color: #9ca3af; width: 42px; flex-shrink: 0; }
.products-page .diff-val { color: #374151; }
.products-page .diff-ok { color: #16a34a; }
.products-page .diff-warn { color: #d97706; }
.products-page .diff-missing { color: #dc2626; font-style: italic; }

.products-page select, .products-page input[type="text"] {
  height: 28px; padding: 0 8px; border: 1px solid #d1d5db;
  border-radius: 5px; font-size: 12.5px; color: #1a1a2e;
  background: #fff; outline: none; width: 100%;
}
.products-page select:focus, .products-page input[type="text"]:focus {
  border-color: #4f6ef7;
  box-shadow: 0 0 0 2px rgba(79,110,247,0.12);
}
.products-page .fields-col { display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.products-page .field-row { display: flex; flex-direction: column; gap: 2px; }
.products-page .field-row label { font-size: 10.5px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.3px; }

.products-page .badge-synced   { background: #dcfce7; color: #15803d; }
.products-page .badge-matched  { background: #dbeafe; color: #1d4ed8; }
.products-page .badge-possible { background: #fef9c3; color: #92400e; }
.products-page .badge-pending  { background: #f3f4f6; color: #6b7280; }

.products-page .loading-row td { text-align: center; padding: 48px; color: #9ca3af; }

.products-page .spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}

.products-page .search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e4e7ee; border-radius: 8px;
  padding: 0 12px; height: 36px; margin-bottom: 16px;
}
.products-page .search-bar svg { color: #9ca3af; flex-shrink: 0; }
.products-page .search-bar input {
  border: none; outline: none; font-size: 13.5px; color: #1a1a2e;
  background: transparent; flex: 1; height: 100%;
}
.products-page .search-bar input::placeholder { color: #9ca3af; }
.products-page .search-clear {
  background: none; border: none; cursor: pointer; color: #9ca3af;
  font-size: 16px; line-height: 1; padding: 0; display: none;
}
.products-page .search-clear:hover { color: #374151; }
.products-page .search-meta { font-size: 12px; color: #9ca3af; white-space: nowrap; }

/* ---------------------------------------------------------------------
   Reviews page — scoped under .reviews-page for the same reason as
   .products-page (OLD/templates/reviews.html duplicated .card/.btn/
   table/.badge/.spinner/.muted/toast names with yet another set of
   slightly different values).
   --------------------------------------------------------------------- */

.reviews-page main { max-width: 1100px; }

/* Product header */
.reviews-page .product-header { display: flex; align-items: center; gap: 16px; }
.reviews-page .product-thumb {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover;
  border: 1px solid #e4e7ee; background: #f0f2f7; flex-shrink: 0;
}
.reviews-page .product-thumb-placeholder {
  width: 64px; height: 64px; border-radius: 8px; border: 1px solid #e4e7ee;
  background: #f0f2f7; display: flex; align-items: center; justify-content: center;
  color: #c9cdd6; font-size: 24px; flex-shrink: 0;
}
.reviews-page .product-meta h2 { font-size: 20px; font-weight: 700; }
.reviews-page .product-meta .sub { font-size: 13px; color: #6b7280; margin-top: 4px; }
.reviews-page .back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: #6b7280; text-decoration: none;
  padding: 5px 10px; border-radius: 6px; border: 1px solid #e4e7ee;
  background: #fff; transition: background 0.15s;
}
.reviews-page .back-link:hover { background: #f5f6fa; }

/* Stars */
.reviews-page .stars { display: inline-flex; gap: 2px; }
.reviews-page .star { font-size: 16px; color: #d1d5db; cursor: default; }
.reviews-page .star.filled { color: #f59e0b; }
.reviews-page .star.interactive { cursor: pointer; transition: color 0.1s; }
.reviews-page .star.interactive:hover { color: #f59e0b; }

/* Info notice */
.reviews-page .info-notice {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: #78350f;
  display: flex; gap: 10px; align-items: flex-start;
}
.reviews-page .info-notice ul { margin: 4px 0 0 16px; }
.reviews-page .info-notice li { margin-top: 3px; }

/* Buttons */
.reviews-page .btn {
  height: 36px; padding: 0 16px; border-radius: 6px; font-size: 13.5px;
  font-weight: 500; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.reviews-page .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.reviews-page .btn-primary   { background: #4f6ef7; color: #fff; }
.reviews-page .btn-primary:hover:not(:disabled)   { background: #3a5ae8; }
.reviews-page .btn-success   { background: #16a34a; color: #fff; }
.reviews-page .btn-success:hover:not(:disabled)   { background: #15803d; }
.reviews-page .btn-ghost     { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.reviews-page .btn-ghost:hover:not(:disabled)     { background: #f9fafb; }
.reviews-page .btn-danger    { background: #dc2626; color: #fff; }
.reviews-page .btn-danger:hover:not(:disabled)    { background: #b91c1c; }
.reviews-page .btn-sm        { height: 28px; padding: 0 10px; font-size: 12.5px; }
.reviews-page .btn-disabled-look { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }

/* Section titles */
.reviews-page .section-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Reviews table */
.reviews-page table { width: 100%; border-collapse: collapse; font-size: 13px; }
.reviews-page thead th {
  padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600;
  color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid #e4e7ee; background: #fafafa;
}
.reviews-page tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: top; }
.reviews-page tbody tr:last-child td { border-bottom: none; }
.reviews-page .review-body-cell { max-width: 340px; }
.reviews-page .review-body-text { color: #374151; line-height: 1.5; }
.reviews-page .review-pics { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.reviews-page .review-pic  { width: 48px; height: 48px; object-fit: cover; border-radius: 5px; border: 1px solid #e4e7ee; }

.reviews-page .badge-pub   { background: #dcfce7; color: #15803d; }
.reviews-page .badge-unpub { background: #fee2e2; color: #991b1b; }

/* Empty state */
.reviews-page .empty-state {
  text-align: center; padding: 48px 24px; color: #9ca3af;
}
.reviews-page .empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: #6b7280; }

/* Textarea / input */
.reviews-page textarea, .reviews-page input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 7px; font-size: 13.5px; color: #1a1a2e; font-family: inherit;
  resize: vertical; outline: none; background: #fff;
}
.reviews-page textarea:focus, .reviews-page input[type="text"]:focus {
  border-color: #4f6ef7;
  box-shadow: 0 0 0 2px rgba(79,110,247,0.12);
}
.reviews-page label.field-label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 5px; }

/* Image upload zone */
.reviews-page .upload-zone {
  border: 2px dashed #d1d5db; border-radius: 8px; padding: 20px;
  text-align: center; color: #9ca3af; font-size: 13px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.reviews-page .upload-zone:hover { border-color: #4f6ef7; background: #f5f7ff; color: #4f6ef7; }
.reviews-page .upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.reviews-page .upload-thumbnails { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.reviews-page .upload-thumb-wrap {
  position: relative; width: 64px; height: 64px;
}
.reviews-page .upload-thumb-wrap img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid #e4e7ee;
}
.reviews-page .upload-thumb-remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%; background: #dc2626;
  color: #fff; border: none; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.reviews-page .upload-thumb-error {
  font-size: 10px; color: #dc2626; text-align: center; margin-top: 2px;
  max-width: 64px; word-break: break-word;
}

/* Review cards (approval UI) */
.reviews-page .review-cards { display: flex; flex-direction: column; gap: 16px; }
.reviews-page .review-card {
  border: 1px solid #e4e7ee; border-radius: 9px; padding: 16px;
  background: #fff; transition: border-color 0.15s, opacity 0.15s;
}
.reviews-page .review-card.discarded { opacity: 0.45; border-color: #f3f4f6; background: #fafafa; }
.reviews-page .review-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.reviews-page .card-approve-toggle { flex-shrink: 0; margin-top: 2px; }
.reviews-page .card-star-row { display: flex; gap: 1px; }
.reviews-page .card-fields { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.reviews-page .card-field-row { display: flex; gap: 8px; align-items: flex-start; }
.reviews-page .card-field-label {
  font-size: 10.5px; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.3px; width: 52px; flex-shrink: 0; padding-top: 7px;
}
.reviews-page .card-field-input { flex: 1; }
.reviews-page .card-field-input input[type="text"],
.reviews-page .card-field-input textarea {
  font-size: 13px; padding: 6px 10px;
}
.reviews-page .card-image-assign { margin-top: 10px; }
.reviews-page .card-image-assign-label { font-size: 11px; color: #6b7280; margin-bottom: 6px; }
.reviews-page .card-image-options { display: flex; gap: 8px; flex-wrap: wrap; }
.reviews-page .card-img-checkbox { position: relative; cursor: pointer; }
.reviews-page .card-img-checkbox input[type="checkbox"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.reviews-page .card-img-thumb {
  width: 48px; height: 48px; object-fit: cover; border-radius: 5px;
  border: 2px solid transparent; transition: border-color 0.1s;
}
.reviews-page .card-img-checkbox:has(input:checked) .card-img-thumb { border-color: #4f6ef7; }
.reviews-page .card-img-check-indicator {
  position: absolute; bottom: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%; background: #4f6ef7;
  color: #fff; font-size: 9px; display: none;
  align-items: center; justify-content: center;
}
.reviews-page .card-img-checkbox:has(input:checked) .card-img-check-indicator { display: flex; }

/* Bulk actions bar */
.reviews-page .bulk-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 14px; border-bottom: 1px solid #e4e7ee; margin-bottom: 16px;
}

/* Progress indicator */
.reviews-page .post-progress { margin-top: 12px; }
.reviews-page .post-progress-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 5px 0;
}
.reviews-page .progress-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.reviews-page .dot-pending { background: #d1d5db; }
.reviews-page .dot-ok      { background: #16a34a; }
.reviews-page .dot-fail    { background: #dc2626; }
.reviews-page .dot-working { background: #4f6ef7; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity: 0.4 } }

/* Spinner */
.reviews-page .spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.reviews-page .spinner-dark {
  border-color: rgba(0,0,0,0.1); border-top-color: #374151;
}

.reviews-page .hidden { display: none !important; }
.reviews-page .muted  { color: #9ca3af; font-style: italic; }

/* Model selector */
.reviews-page .model-selector { display: flex; gap: 0; border: 1px solid #e4e7ee; border-radius: 8px; overflow: hidden; }
.reviews-page .model-tab {
  flex: 1; padding: 8px 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: #f9fafb; color: #6b7280;
  transition: background 0.15s, color 0.15s; text-align: center;
  border-right: 1px solid #e4e7ee;
}
.reviews-page .model-tab:last-child { border-right: none; }
.reviews-page .model-tab.active { background: #4f6ef7; color: #fff; }
.reviews-page .model-tab:hover:not(.active) { background: #f0f2ff; color: #4f6ef7; }

.reviews-page .model-dropdown-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.reviews-page .model-dropdown-row label { font-size: 12px; color: #6b7280; white-space: nowrap; }
.reviews-page .model-dropdown-row select {
  flex: 1; height: 32px; padding: 0 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 13px; background: #fff; color: #1a1a2e; outline: none;
}
.reviews-page .model-dropdown-row select:focus { border-color: #4f6ef7; box-shadow: 0 0 0 2px rgba(79,110,247,.12); }
.reviews-page .provider-badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.reviews-page .badge-anthropic { background: #fce7f3; color: #9d174d; }
.reviews-page .badge-openai    { background: #dcfce7; color: #15803d; }
.reviews-page .badge-deepseek  { background: #dbeafe; color: #1e40af; }

/* System prompt editor */
.reviews-page .prompt-editor-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #4f6ef7; cursor: pointer;
  background: none; border: none; padding: 0; font-weight: 500;
}
.reviews-page .prompt-editor-toggle:hover { text-decoration: underline; }
.reviews-page .prompt-editor-panel {
  margin-top: 10px; border: 1px solid #e4e7ee; border-radius: 8px; overflow: hidden;
}
.reviews-page .prompt-editor-panel textarea {
  border: none; border-radius: 0; resize: vertical; font-size: 12.5px;
  font-family: 'SF Mono', 'Fira Code', monospace; line-height: 1.5;
  background: #fafafa; min-height: 160px;
}
.reviews-page .prompt-editor-panel textarea:focus { box-shadow: none; border-color: transparent; }
.reviews-page .prompt-editor-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: #f5f6fa; border-top: 1px solid #e4e7ee;
  font-size: 11.5px; color: #9ca3af;
}

/* Product description panel */
.reviews-page .product-desc-box {
  background: #f8faff; border: 1px solid #dbeafe; border-radius: 8px;
  padding: 12px 14px; font-size: 13px; color: #374151; line-height: 1.6;
  max-height: 120px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.reviews-page .product-desc-empty { color: #9ca3af; font-style: italic; }
.reviews-page .include-desc-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: #6b7280; }
.reviews-page .include-desc-row input[type="checkbox"] { cursor: pointer; }

/* Product analysis panel */
.reviews-page .analyse-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 6px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; border: 1.5px solid #f59e0b;
  background: #fffbeb; color: #92400e;
  transition: background 0.15s, border-color 0.15s;
}
.reviews-page .analyse-btn:hover:not(:disabled) { background: #fef3c7; border-color: #d97706; }
.reviews-page .analyse-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.reviews-page .analysis-panel {
  margin-top: 12px; border: 1px solid #e4e7ee; border-radius: 10px; overflow: hidden;
}
.reviews-page .analysis-category {
  padding: 10px 14px; border-bottom: 1px solid #f0f2f7;
}
.reviews-page .analysis-category:last-child { border-bottom: none; }
.reviews-page .analysis-category-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px;
}
.reviews-page .cat-audience { color: #1d4ed8; }
.reviews-page .cat-reasons  { color: #7c3aed; }
.reviews-page .cat-pros     { color: #15803d; }
.reviews-page .cat-cons     { color: #b45309; }

.reviews-page .tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reviews-page .tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; border: 1.5px solid transparent;
  transition: all 0.12s; user-select: none;
}
/* unselected */
.reviews-page .tag-chip.unselected { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.reviews-page .tag-chip.unselected:hover { border-color: #9ca3af; background: #fff; }
/* selected by category */
.reviews-page .tag-chip.sel-audience { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.reviews-page .tag-chip.sel-reasons  { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.reviews-page .tag-chip.sel-pros     { background: #dcfce7; color: #15803d; border-color: #86efac; }
.reviews-page .tag-chip.sel-cons     { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.reviews-page .tag-chip-remove { font-size: 11px; opacity: 0.6; }
.reviews-page .tag-chip-remove:hover { opacity: 1; }

/* Selected tags row above textarea */
.reviews-page .selected-tags-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 0; min-height: 36px;
}
.reviews-page .no-tags-hint { font-size: 12px; color: #c9cdd6; font-style: italic; }

/* Custom tag input */
.reviews-page .custom-tag-input {
  display: flex; gap: 6px; margin-top: 6px;
}
.reviews-page .custom-tag-input input {
  flex: 1; height: 30px; padding: 0 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 12.5px; outline: none;
}
.reviews-page .custom-tag-input input:focus { border-color: #4f6ef7; }
.reviews-page .custom-tag-input button {
  height: 30px; padding: 0 12px; border-radius: 6px; border: none;
  background: #f3f4f6; color: #374151; font-size: 12.5px; cursor: pointer;
  font-weight: 500; transition: background 0.12s;
}
.reviews-page .custom-tag-input button:hover { background: #e5e7eb; }

/* ---------------------------------------------------------------------
   Library browser component — INTENTIONALLY UNSCOPED (not under
   .library-page). LibraryBrowser() in library-browser.js is a reusable
   component embedded both on the full /library page AND inside a modal
   on the studio session page (T22) — scoping it to .library-page would
   break it in the modal context. All its classes are prefixed `lib-` so
   they can't collide with orders/products/reviews page classes.
   --------------------------------------------------------------------- */

.lib-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lib-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.lib-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.lib-crumb { color: #6b7280; }
.lib-crumb-link { cursor: pointer; color: #4f6ef7; }
.lib-crumb-link:hover { text-decoration: underline; }
.lib-crumb-current { color: #1a1a2e; font-weight: 600; }
.lib-crumb-sep { color: #d1d5db; }

.lib-body { min-height: 120px; }
.lib-loading, .lib-empty, .lib-error { text-align: center; padding: 40px 20px; color: #9ca3af; }
.lib-error { color: #dc2626; }

.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}
.lib-tile {
  cursor: pointer; border-radius: 8px; border: 1px solid #e4e7ee;
  background: #fff; padding: 10px; text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lib-tile:hover { border-color: #4f6ef7; box-shadow: 0 2px 8px rgba(79,110,247,0.12); }
.lib-tile-disabled { cursor: default; opacity: 0.55; }
.lib-tile-disabled:hover { border-color: #e4e7ee; box-shadow: none; }
.lib-tile-icon { font-size: 32px; margin-bottom: 6px; }
.lib-tile-image img {
  width: 100%; height: 88px; object-fit: cover; border-radius: 5px; margin-bottom: 6px;
  background: #f0f2f7;
}
.lib-tile-name { font-size: 12px; color: #374151; word-break: break-word; }
.lib-tile-meta { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.lib-connect { text-align: center; padding: 40px 20px; }
.lib-connect-status { margin-top: 14px; font-size: 13px; color: #374151; }

.lib-preview-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.lib-preview-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.lib-preview-content {
  position: relative; background: #fff; border-radius: 10px; padding: 20px;
  max-width: min(90vw, 800px); max-height: 90vh; display: flex; flex-direction: column; gap: 10px;
}
.lib-preview-content img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 6px; }
.lib-preview-content.lib-picker-content { width: min(90vw, 700px); min-height: 420px; overflow: hidden; }
.lib-picker-browser { flex: 1; overflow-y: auto; min-height: 0; }
.lib-preview-close {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: #f3f4f6; cursor: pointer; font-size: 13px; color: #374151;
}
.lib-preview-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #6b7280; gap: 12px; }
.lib-preview-meta a { color: #4f6ef7; }

/* ---------------------------------------------------------------------
   Studio page — scoped under .studio-page, same reasoning as
   .products-page/.reviews-page (section-title/empty-state/btn-ghost/
   prompt-editor-toggle/back-link all already have page-specific copies
   with slightly different values elsewhere).
   --------------------------------------------------------------------- */

.studio-page .section-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.studio-page .empty-state { text-align: center; padding: 40px 20px; color: #9ca3af; }
.studio-page .btn-ghost { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.studio-page .btn-ghost:hover:not(:disabled) { background: #f9fafb; }
.studio-page textarea, .studio-page input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 7px; font-size: 13.5px; color: #1a1a2e; font-family: inherit;
  resize: vertical; outline: none; background: #fff;
}
.studio-page textarea:focus, .studio-page input[type="text"]:focus {
  border-color: #4f6ef7; box-shadow: 0 0 0 2px rgba(79,110,247,0.12);
}
.studio-page .back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: #6b7280; text-decoration: none;
  padding: 5px 10px; border-radius: 6px; border: 1px solid #e4e7ee;
  background: #fff; transition: background 0.15s;
}
.studio-page .back-link:hover { background: #f5f6fa; }

/* Session list (studio home) */
.studio-page .session-list { display: flex; flex-direction: column; gap: 2px; }
.studio-page .session-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 8px;
  border-bottom: 1px solid #f0f2f7; text-decoration: none; color: inherit;
  transition: background 0.1s;
}
.studio-page .session-row:hover { background: #f8f9fc; }
.studio-page .session-row-title { flex: 1; font-weight: 600; font-size: 13.5px; }
.studio-page .session-row-date { font-size: 12px; color: #9ca3af; }
.studio-page .session-status-active   { background: #dcfce7; color: #15803d; }
.studio-page .session-status-archived { background: #f3f4f6; color: #6b7280; }
.studio-page .session-intent-badge { background: #eef1fe; color: #4f6ef7; }
.studio-page .session-mode-badge   { background: #fce7f3; color: #db2777; }

/* New-session wizard modal */
.studio-page .wizard-modal-content { width: min(90vw, 460px); text-align: left; }
.studio-page .wizard-field { margin-bottom: 14px; }
.studio-page .wizard-field label {
  display: block; font-size: 12.5px; font-weight: 500; color: #374151; margin-bottom: 5px;
}
.studio-page .wizard-field select {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid #d1d5db;
  border-radius: 7px; font-size: 13.5px; color: #1a1a2e; background: #fff; outline: none;
}
.studio-page .wizard-field select:focus {
  border-color: #4f6ef7; box-shadow: 0 0 0 2px rgba(79,110,247,0.12);
}
.studio-page .wizard-custom-size { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.studio-page .wizard-custom-size input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid #d1d5db;
  border-radius: 7px; font-size: 13.5px;
}
.studio-page .wizard-mode-radios { display: flex; flex-direction: column; gap: 8px; }
.studio-page .wizard-mode-radios label {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 400;
  color: #1a1a2e; cursor: pointer;
}
.studio-page .wizard-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px;
}

/* Session header (session page) */
.studio-page .session-header-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.studio-page input.session-title-input {
  flex: 1; border: 1px solid transparent; background: transparent;
  font-size: 18px; font-weight: 700; color: #1a1a2e; padding: 4px 8px;
  border-radius: 6px; outline: none;
}
.studio-page input.session-title-input:hover,
.studio-page input.session-title-input:focus { border-color: #d1d5db; background: #fff; box-shadow: none; }
.studio-page .session-brief-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.studio-page .session-brief-chip { background: #eef1fe; color: #4f6ef7; }
.studio-page .session-brief-panel {
  margin-bottom: 12px; padding: 14px; border: 1px solid #e4e7ee; border-radius: 8px;
  background: #f8f9fc; display: flex; flex-direction: column; gap: 12px;
}
.studio-page .session-folder-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.studio-page #session-folder-info { font-size: 12.5px; color: #6b7280; text-decoration: none; }
.studio-page #session-folder-info[href]:not([href="#"]) { color: #4f6ef7; }
.studio-page #session-folder-info[href]:not([href="#"]):hover { text-decoration: underline; }
.studio-page .session-prompt-toggle-row { margin-bottom: 4px; }
.studio-page .prompt-editor-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #4f6ef7; cursor: pointer;
  background: none; border: none; padding: 0; font-weight: 500;
}
.studio-page .prompt-editor-toggle:hover { text-decoration: underline; }
.studio-page .session-prompt-panel { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

/* Reference strip */
.studio-page .reference-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.studio-page .reference-thumb {
  position: relative; width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden; border: 1px solid #e4e7ee;
}
.studio-page .reference-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-page .reference-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* Product photos (T52) */
.studio-page .product-photos-section { margin-top: 12px; }
.studio-page .product-photos-label { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.studio-page .product-photos-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.studio-page .product-photo-thumb {
  width: 72px; height: 72px; flex-shrink: 0; padding: 0; border-radius: 6px; overflow: hidden;
  border: 1px solid #e4e7ee; cursor: pointer; background: none;
}
.studio-page .product-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-page .product-photo-thumb:hover { border-color: #4f6ef7; }

/* Chat */
.studio-page .chat-card { display: flex; flex-direction: column; }
.studio-page .chat-messages {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 420px; overflow-y: auto; padding: 4px 2px; margin-bottom: 12px;
}
.studio-page .chat-msg { display: flex; }
.studio-page .chat-msg-user { justify-content: flex-end; }
.studio-page .chat-msg-assistant { justify-content: flex-start; }
.studio-page .chat-msg-bubble {
  max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  white-space: normal;
}
.studio-page .chat-msg-user .chat-msg-bubble { background: #4f6ef7; color: #fff; border-bottom-right-radius: 3px; }
.studio-page .chat-msg-assistant .chat-msg-bubble { background: #f3f4f6; color: #1a1a2e; border-bottom-left-radius: 3px; }
.studio-page .chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.studio-page .chat-input-row textarea { flex: 1; }
.studio-page #chat-model-select {
  height: 32px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12.5px; background: #fff; color: #1a1a2e; outline: none;
}

/* Generation cards inside the chat flow */
.studio-page .chat-msg-generation-bubble { max-width: 100%; background: #f8faff; border: 1px solid #dbeafe; }
.studio-page .gen-prompt-label { font-size: 12.5px; color: #374151; margin-bottom: 8px; }
.studio-page .gen-image-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.studio-page .gen-image-card {
  position: relative; width: 140px; border-radius: 8px;
  overflow: hidden; border: 1px solid #e4e7ee; background: #fff;
}
.studio-page .gen-image-card img { width: 100%; height: 140px; object-fit: cover; display: block; cursor: pointer; }
.studio-page .gen-iterate-btn {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 5px;
  font-size: 10.5px; padding: 3px 7px; cursor: pointer;
}
.studio-page .gen-iterate-btn:hover { background: rgba(0,0,0,0.8); }
.studio-page .gen-approve-btn {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 5px;
  font-size: 13px; line-height: 1; padding: 3px 6px; cursor: pointer;
}
.studio-page .gen-approve-btn:hover { background: rgba(0,0,0,0.8); }
.studio-page .gen-approve-btn-active { background: #f59e0b; color: #fff; }
.studio-page .gen-image-card.gen-image-approved { outline: 2px solid #f59e0b; outline-offset: -2px; }
.studio-page .gen-model-badge {
  position: absolute; bottom: 32px; left: 4px; right: 4px;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 10px; padding: 2px 6px;
  border-radius: 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.studio-page .gen-save-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 4px; font-size: 10.5px; min-height: 26px;
}
.studio-page .gen-save-row .btn { height: 22px; padding: 0 8px; font-size: 10.5px; }
.studio-page .gen-choose-folder-link {
  background: none; border: none; color: #4f6ef7; font-size: 10.5px; cursor: pointer; padding: 0;
}
.studio-page .gen-choose-folder-link:hover { text-decoration: underline; }
.studio-page .gen-save-status { color: #15803d; font-weight: 600; text-decoration: none; }
.studio-page a.gen-save-status:hover { text-decoration: underline; }

/* Generation panel */
.studio-page label.field-label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 5px; }
.studio-page .gen-panel { display: flex; flex-direction: column; gap: 14px; }
.studio-page .gen-panel-row { display: flex; gap: 20px; flex-wrap: wrap; }
.studio-page .gen-model-col { min-width: 200px; }
.studio-page .gen-refs-col { flex: 1; min-width: 200px; }
.studio-page #gen-model-select {
  height: 34px; width: 100%; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; background: #fff; color: #1a1a2e; outline: none;
}
.studio-page .gen-reference-checkboxes { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-page .gen-ref-checkbox { position: relative; cursor: pointer; width: 44px; height: 44px; }
.studio-page .gen-ref-checkbox input[type="checkbox"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.studio-page .gen-ref-checkbox img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 5px;
  border: 2px solid #e4e7ee;
}
.studio-page .gen-ref-checkbox input:checked + img { border-color: #4f6ef7; }

.studio-page .gen-mode-col { min-width: 200px; }
.studio-page .gen-size-col { min-width: 140px; }
.studio-page .gen-mode-radios { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #374151; }
.studio-page .gen-mode-radios label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.studio-page .gen-size-chip {
  height: 34px; display: flex; align-items: center; padding: 0 10px;
  border: 1px solid #e4e7ee; border-radius: 6px; background: #f8f9fc;
  font-size: 13px; color: #6b7280;
}
.studio-page .gen-meta-line { font-size: 11.5px; color: #6b7280; margin: -4px 0 8px; }
.studio-page .gen-iteration-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.studio-page .gen-template-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.studio-page #gen-template-select {
  height: 30px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12.5px; background: #fff; color: #1a1a2e; outline: none;
}
.studio-page .gen-checkbox-label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; cursor: pointer;
}

/* Ad copy panel (T50) */
.studio-page .copy-model-row { margin-bottom: 12px; }
.studio-page #copy-model-select {
  height: 34px; width: 100%; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; background: #fff; color: #1a1a2e; outline: none;
}
.studio-page .copy-fields { display: flex; flex-direction: column; gap: 12px; }
.studio-page .copy-field input[type="text"] {
  height: 34px; width: 100%; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; background: #fff; color: #1a1a2e; outline: none;
}
.studio-page .copy-save-row { margin-top: 12px; }

/* ---------------------------------------------------------------------
   Dashboard page (T28+)
   --------------------------------------------------------------------- */

.dashboard-page .dash-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.dashboard-page .dash-timeframe { display: flex; gap: 4px; }
.dashboard-page .dash-tf-btn {
  height: 30px; padding: 0 12px; border: 1px solid #d1d5db; background: #fff;
  border-radius: 6px; font-size: 12.5px; font-weight: 500; color: #374151; cursor: pointer;
}
.dashboard-page .dash-tf-btn:hover { background: #f9fafb; }
.dashboard-page .dash-tf-btn.active { background: #4f6ef7; border-color: #4f6ef7; color: #fff; }
.dashboard-page .dash-custom-range { display: flex; align-items: center; gap: 6px; }
.dashboard-page .dash-custom-range input[type="date"] {
  height: 30px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12.5px;
}
.dashboard-page .dash-toolbar .btn { margin-left: auto; }

.dashboard-page .dash-skeleton { display: flex; flex-direction: column; gap: 16px; }
.dashboard-page .dash-skel-block {
  height: 90px; border-radius: 10px; background: linear-gradient(90deg, #eef0f5 25%, #f7f8fb 37%, #eef0f5 63%);
  background-size: 400% 100%; animation: dash-skel-shimmer 1.4s ease infinite;
}
.dashboard-page .dash-skel-tall { height: 220px; }
@keyframes dash-skel-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.dashboard-page .dash-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px;
}
.dashboard-page .dash-kpi-tile { padding: 16px 18px; margin-bottom: 0; }
.dashboard-page .dash-kpi-label { font-size: 11.5px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; }
.dashboard-page .dash-kpi-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.dashboard-page .dash-kpi-delta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; }
.dashboard-page .dash-kpi-delta-good { color: #16a34a; }
.dashboard-page .dash-kpi-delta-bad  { color: #dc2626; }
.dashboard-page .dash-kpi-delta-flat { color: #9ca3af; }

.dashboard-page .dash-section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.dashboard-page .dash-section-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.dashboard-page .dash-section-title-row .dash-section-title { margin-bottom: 0; }

.dashboard-page .dash-toggle-group { display: flex; gap: 4px; }
.dashboard-page .dash-toggle-btn {
  height: 26px; padding: 0 10px; border: 1px solid #d1d5db; background: #fff;
  border-radius: 5px; font-size: 11.5px; font-weight: 500; color: #374151; cursor: pointer;
}
.dashboard-page .dash-toggle-btn.active { background: #eef1fe; border-color: #4f6ef7; color: #4f6ef7; }

.dashboard-page .dash-table { width: 100%; border-collapse: collapse; }
.dashboard-page .dash-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
  color: #9ca3af; padding: 6px 8px; border-bottom: 1px solid #e4e7ee;
}
.dashboard-page .dash-table td { padding: 8px; border-bottom: 1px solid #f0f2f7; font-size: 13px; }
.dashboard-page .dash-table tr:last-child td { border-bottom: none; }

.dashboard-page .dash-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start;
}
.dashboard-page .dash-stat-pair { display: flex; gap: 20px; flex-wrap: wrap; }
.dashboard-page .dash-stat-value { font-size: 20px; font-weight: 700; }
.dashboard-page .dash-stat-label { font-size: 11px; color: #9ca3af; text-transform: uppercase; margin-top: 2px; }

.dashboard-page .dash-connect-card { text-align: left; }

.dashboard-page .dash-campaigns-table th[data-col] { cursor: pointer; user-select: none; }
.dashboard-page .dash-campaigns-table th[data-col]:hover { color: #4f6ef7; }
.dashboard-page .dash-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.dashboard-page .dash-badge-meta   { background: #dbeafe; color: #1d4ed8; }
.dashboard-page .dash-badge-google { background: #fef9c3; color: #a16207; }
.dashboard-page .dash-status-pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500;
}
.dashboard-page .dash-status-active { background: #dcfce7; color: #15803d; }
.dashboard-page .dash-status-paused { background: #f3f4f6; color: #6b7280; }
.dashboard-page .dash-status-other  { background: #ede9fe; color: #7c3aed; }
.dashboard-page .dash-deeplink { color: #4f6ef7; text-decoration: none; font-size: 13px; }
.dashboard-page .dash-deeplink:hover { text-decoration: underline; }
.dashboard-page tr.dash-low-engagement { background: #fef2f2; }

.dashboard-page .dash-insights-panel { margin-bottom: 20px; }
.dashboard-page .dash-insights-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dashboard-page .dash-insight-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5;
}
.dashboard-page .dash-insight-icon { flex-shrink: 0; font-weight: 700; }
.dashboard-page .dash-insight-warn { background: #fef2f2; color: #991b1b; }
.dashboard-page .dash-insight-good { background: #f0fdf4; color: #166534; }
.dashboard-page .dash-insight-info { background: #eff6ff; color: #1e40af; }
.dashboard-page .dash-digest-row { display: flex; justify-content: flex-end; }
.dashboard-page .dash-digest-card { font-size: 13.5px; line-height: 1.7; }

/* ---------------------------------------------------------------------
   Analytics page (T62+) — toolbar/timeframe classes deliberately mirror
   dashboard-page's dash-* naming (an- prefix instead) since it's the same
   pattern (timeframe buttons + custom range + localStorage persistence).
   --------------------------------------------------------------------- */

.analytics-page .an-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.analytics-page .an-timeframe { display: flex; gap: 4px; }
.analytics-page .an-tf-btn {
  padding: 6px 12px; border: 1px solid #e4e7ee; border-radius: 6px;
  background: #fff; font-size: 12.5px; font-weight: 600; color: #374151; cursor: pointer;
}
.analytics-page .an-tf-btn:hover { background: #f9fafb; }
.analytics-page .an-tf-btn.active { background: #4f6ef7; border-color: #4f6ef7; color: #fff; }
.analytics-page .an-custom-range { display: flex; align-items: center; gap: 6px; }
.analytics-page .an-custom-range input[type="date"] {
  height: 32px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12.5px;
}
.analytics-page .an-toolbar .btn { margin-left: auto; }

.analytics-page .an-status-banner { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.analytics-page .an-status-chip {
  display: inline-block; padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 500;
}
.analytics-page .an-status-chip-error { background: #fef2f2; color: #991b1b; }
.analytics-page .an-status-chip-warn  { background: #fffbeb; color: #92400e; }
.analytics-page .an-status-chip-grey  { background: #f3f4f6; color: #6b7280; }

.analytics-page .an-tabs { display: flex; gap: 6px; padding: 8px; }
.analytics-page .an-tab-btn {
  padding: 8px 16px; border: none; border-radius: 6px; background: transparent;
  font-size: 13.5px; font-weight: 600; color: #6b7280; cursor: pointer;
}
.analytics-page .an-tab-btn:hover { background: #f9fafb; color: #374151; }
.analytics-page .an-tab-btn.active { background: #eef1fe; color: #4f6ef7; }

.analytics-page .an-geo-table { width: 100%; border-collapse: collapse; }
.analytics-page .an-geo-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; color: #9ca3af;
  padding: 8px; border-bottom: 1px solid #e4e7ee;
}
.analytics-page .an-geo-table td { padding: 8px; border-bottom: 1px solid #f0f2f7; font-size: 13px; }
.analytics-page .an-geo-table tr:last-child td { border-bottom: none; }
.analytics-page .an-geo-toggle {
  background: none; border: none; cursor: pointer; color: #6b7280; font-size: 11px;
  width: 16px; display: inline-block; text-align: center;
}
.analytics-page .an-geo-toggle-spacer { display: inline-block; width: 16px; }

.analytics-page .an-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px;
}
.analytics-page .an-kpi-tile { padding: 16px 18px; margin-bottom: 0; }
.analytics-page .an-kpi-label { font-size: 11.5px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; }
.analytics-page .an-kpi-value { font-size: 22px; font-weight: 700; margin-top: 4px; }

.analytics-page .an-section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.analytics-page .an-section-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.analytics-page .an-section-title-row .an-section-title { margin-bottom: 0; }
.analytics-page .an-toggle-group { display: flex; gap: 4px; }
.analytics-page .an-toggle-btn {
  padding: 5px 10px; border: 1px solid #e4e7ee; border-radius: 6px; background: #fff;
  font-size: 12px; font-weight: 600; color: #6b7280; cursor: pointer;
}
.analytics-page .an-toggle-btn.active { background: #eef1fe; border-color: #4f6ef7; color: #4f6ef7; }

.analytics-page .an-cohort-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.analytics-page .an-cohort-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; color: #9ca3af;
  padding: 6px 8px; border-bottom: 1px solid #e4e7ee;
}
.analytics-page .an-cohort-table td { padding: 6px 8px; border-bottom: 1px solid #f0f2f7; white-space: nowrap; }
.analytics-page .an-cohort-cell { text-align: center; font-weight: 600; color: #1a1a2e; }
.analytics-page .an-cohort-cell-empty { text-align: center; color: #d1d5db; font-weight: 400; }
.analytics-page .an-guest-footnote { font-size: 12px; padding: 4px 4px 16px; }

.analytics-page .an-products-table { width: 100%; border-collapse: collapse; }
.analytics-page .an-products-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; color: #9ca3af;
  padding: 8px; border-bottom: 1px solid #e4e7ee; cursor: pointer; user-select: none;
}
.analytics-page .an-products-table th:hover { color: #4f6ef7; }
.analytics-page .an-products-table td { padding: 8px; border-bottom: 1px solid #f0f2f7; font-size: 13px; }
.analytics-page .an-products-table tr:last-child td { border-bottom: none; }
.analytics-page .an-refund-flag { color: #dc2626; font-weight: 700; }

.analytics-page .an-grid-2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
}
.analytics-page .an-simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analytics-page .an-simple-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; color: #9ca3af;
  padding: 6px 8px; border-bottom: 1px solid #e4e7ee;
}
.analytics-page .an-simple-table td { padding: 6px 8px; border-bottom: 1px solid #f0f2f7; }
.analytics-page .an-simple-table tr:last-child td { border-bottom: none; }
.analytics-page .an-connect-card { text-align: left; }
.analytics-page .an-thresholding-note { font-size: 12px; padding: 8px 2px 0; }

.analytics-page .an-funnel-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.analytics-page .an-funnel-step-chip {
  padding: 5px 10px; border-radius: 6px; background: #f3f4f6; font-size: 12px; font-weight: 600; color: #374151;
}

.analytics-page .an-span-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.analytics-page .an-span-badge {
  padding: 4px 10px; border-radius: 6px; background: #fffbeb; color: #92400e; font-size: 11.5px; font-weight: 600;
}

/* ---------------------------------------------------------------------
   Settings page
   --------------------------------------------------------------------- */

.settings-page .settings-intro { margin-bottom: 20px; line-height: 1.6; }
.settings-page .settings-intro code {
  background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 12px;
}
.settings-page .settings-section { margin-bottom: 24px; }
.settings-page .settings-section:last-child { margin-bottom: 0; }
.settings-page .settings-section-title {
  font-size: 13.5px; font-weight: 700; color: #1a1a2e; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid #e4e7ee;
}
.settings-page .settings-field { margin-bottom: 12px; }
.settings-page .settings-field label {
  display: block; font-size: 12.5px; font-weight: 500; color: #666; margin-bottom: 4px;
}
.settings-page .settings-input-row { display: flex; align-items: center; gap: 8px; }
.settings-page .settings-input-row input {
  flex: 1; height: 34px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; outline: none;
}
.settings-page .settings-input-row input:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79,110,247,0.12); }
.settings-page .settings-toggle-btn { flex-shrink: 0; }
.settings-page .settings-status {
  flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 10px;
  white-space: nowrap;
}
.settings-page .settings-status-set   { background: #dcfce7; color: #15803d; }
.settings-page .settings-status-unset { background: #f3f4f6; color: #9ca3af; }
.settings-page .settings-save-row { margin-top: 8px; }

/* ---------------------------------------------------------------------
   Brand Manager (studio.studio-page, /studio/brand)
   --------------------------------------------------------------------- */

.studio-page .brand-intro { color: #6b7280; font-size: 13px; line-height: 1.6; }
.studio-page .brand-section-card { margin-bottom: 16px; }
.studio-page .brand-save-row {
  margin-top: 10px; display: flex; align-items: center; gap: 10px;
}
.studio-page .brand-save-status { font-size: 12px; color: #15803d; font-weight: 600; }
.studio-page .brand-save-all-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.studio-page .brand-kit-current { font-size: 13px; color: #374151; margin: 10px 0; }

/* ---------------------------------------------------------------------
   Analytics — Geography tab: Table/India Map toggle
   --------------------------------------------------------------------- */

.analytics-page #an-geo-view-toggle { margin-bottom: 14px; }
.analytics-page #an-geo-map-view .card { overflow: hidden; }
.analytics-page #an-geo-map {
  height: 520px; width: 100%; background: #f4f6fb; border-radius: 6px;
}
.analytics-page .an-geo-map-empty { padding: 60px 20px; text-align: center; }
.analytics-page .an-geo-legend {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12px; color: #6b7280;
}
.analytics-page .an-geo-legend-swatch { display: inline-flex; align-items: center; gap: 6px; }
.analytics-page .an-geo-legend-chip {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid #e4e7ee;
}
.analytics-page .an-geo-chart-canvas-wrap { height: 420px; margin-top: 8px; }
.analytics-page #an-geo-chart-empty { padding: 40px 20px; text-align: center; }

/* ---------------------------------------------------------------------
   Customers page — scoped under .customers-page for the same reason as
   .products-page/.reviews-page (search-bar/loading-row have no generic
   definition; every page that wants them defines its own scoped copy).
   --------------------------------------------------------------------- */

.customers-page .search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e4e7ee; border-radius: 8px;
  padding: 0 12px; height: 36px; margin-bottom: 16px;
}
.customers-page .search-bar svg { color: #9ca3af; flex-shrink: 0; }
.customers-page .search-bar input {
  border: none; outline: none; font-size: 13.5px; color: #1a1a2e;
  background: transparent; flex: 1; height: 100%;
}
.customers-page .search-bar input::placeholder { color: #9ca3af; }
.customers-page .search-clear {
  background: none; border: none; cursor: pointer; color: #9ca3af;
  font-size: 16px; line-height: 1; padding: 0; display: none;
}
.customers-page .search-clear:hover { color: #374151; }
.customers-page .search-meta { font-size: 12px; color: #9ca3af; white-space: nowrap; }
.customers-page .loading-row td { text-align: center; padding: 48px; color: #9ca3af; }
.customers-page .bulk-action-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f0f5ff; border: 1px solid #c7d7fe; border-radius: 8px;
  padding: 8px 12px; margin-bottom: 14px; font-size: 13px;
}
.customers-page .bulk-action-bar #bulk-selected-count { font-weight: 700; color: #1d4ed8; white-space: nowrap; }
.customers-page .bulk-action-bar #bulk-tag-input {
  flex: 1; min-width: 220px; padding: 6px 10px; border: 1px solid #d1d5db;
  border-radius: 5px; font-size: 13px;
}
.customers-page .bulk-action-hint { font-size: 11.5px; }

/* ---------------------------------------------------------------------
   Login page + signed-in user in the header (features/auth, T113)
   --------------------------------------------------------------------- */
.login-page { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.login-card .field input {
  height: 38px; padding: 0 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 14px; color: #1a1a2e; background: #fff; outline: none;
}
.login-card .field input:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79,110,247,0.12); }
.login-submit { justify-content: center; }
.login-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; font-size: 13.5px; }

.header-user { display: flex; align-items: center; gap: 10px; margin-left: 12px; font-size: 12.5px; color: #8888aa; flex-shrink: 0; white-space: nowrap; }
.header-user form { display: inline; }
.header-user button {
  background: none; border: 1px solid #3a3a5a; color: #c8c8dd; border-radius: 6px;
  padding: 4px 10px; font-size: 12.5px; cursor: pointer;
}
.header-user button:hover { color: #fff; border-color: #6b6b9a; }
/* The nav is already ten links wide — show the email only where it fits
   (it's also the Log out button's tooltip). */
@media (max-width: 1360px) { .header-user-email { display: none; } }

/* Which machine is this tab talking to? (deploy phase T117) */
.env-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; padding: 3px 7px;
  border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.env-local      { background: #f59e0b; color: #1a1a2e; }
.env-production { background: #16a34a; color: #fff; }
