@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  color: #333;
  padding: 0;
}

.container {
  max-width: 100%;
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Filter Row */
.filter-row {
  background: #f8f8f8;
  border-bottom: 1px solid #ddd;
  padding: 5px 10px;
  flex-shrink: 0;
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 8px 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
}

.filter-title svg {
  color: #555;
}

.filter-collapse {
  cursor: pointer;
  font-size: 0.7rem;
  color: #666;
  transition: transform 0.2s;
  user-select: none;
}

.filter-collapse:hover { color: #333; }
.filter-collapse.collapsed { transform: rotate(-90deg); }

.filter-content {
  margin-left: 25px;
  overflow: visible;
  transition: max-height 0.3s ease;
}

.filter-content.collapsed {
  max-height: 0 !important;
  padding: 0;
  overflow: hidden;
}

.filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.filter-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-header {
  font-size: 0.7rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
}

.filter-row input[type="date"],
.filter-row input[type="number"],
.filter-row input[type="text"],
.filter-row select {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
  height: 24px;
}

.filter-row input[type="number"] {
  -moz-appearance: textfield;
}

.filter-row input[type="number"]::-webkit-outer-spin-button,
.filter-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-stack input { width: 70px; }
.filter-stack.w80 input { width: 104px; }
.filter-col.w314 input { width: 314px; }
.filter-col.w218 input, .filter-col.w218 .multi-select-btn { width: 218px; }
.filter-col.w218 .multi-select-dropdown { min-width: 218px; }
.filter-col.w104 input, .filter-col.w104 .multi-select-btn, .filter-col.w104 select { width: 104px; }
.filter-col.w104 .multi-select-dropdown { min-width: 104px; }
.filter-col.wdate { width: 152px; }
.filter-col.wdate .filter-row-item input { width: 120px; }
.filter-row-top { margin-bottom: 8px; }

.filter-row-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-label {
  font-size: 0.7rem;
  color: #666;
  min-width: 28px;
}

/* Multi-select dropdown */
.multi-select { position: relative; }

.multi-select-btn {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  box-sizing: border-box;
}

.multi-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 195px;
}

.multi-select-dropdown.active { display: block; }

.multi-select-dropdown label {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.multi-select-dropdown label input[type="checkbox"] {
  margin: 0 6px 0 0;
  vertical-align: middle;
  width: auto !important;
  cursor: pointer;
}

.multi-select-dropdown label:hover { background: #f0f0f0; }

.sku-actions {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.sku-actions span {
  cursor: pointer;
  color: #0066cc;
}

.sku-actions span:hover { text-decoration: underline; }

/* Typography */
h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #333;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
}

/* Table */
.table-container {
  background: #fff;
  border-radius: 0;
  padding: 0;
  margin: 0;
  overflow: auto;
  border-top: none;
  flex: 1;
  min-height: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid #ddd;
}

th, td {
  padding: 0 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #ddd;
}

th { padding: 12px 15px; }
th:last-child, td:last-child { border-right: none; }

th {
  background: #f8f8f8;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #eee; }
.sort-arrow { margin-left: 5px; font-size: 0.7rem; }

tr { height: 45px; background: #f5f5f5; }

td {
  color: #333;
  font-weight: 300;
  height: 45px;
  vertical-align: middle;
}

td.editable-cell { background: #fff; }

/* Status badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: normal;
  display: inline-block;
}

.number-cell, .date-cell { line-height: normal; }
.number-cell.estimated { color: #888; font-style: italic; }
.number-cell.mismatch { color: #d32f2f; }

/* Instant tooltip for mismatch cells */
.mismatch-tooltip {
  position: fixed;
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 10000;
  pointer-events: none;
  white-space: nowrap;
}
.status-pending { background: #f0f0f0; color: #666; }
.status-claimed { background: #fff3cd; color: #856404; }
.status-completed { background: #e8e8e8; color: #333; }
.status-processing { background: #eee; color: #555; }

/* Highlight entire row for Claimed status */
tr.row-claimed, tr.row-claimed td, tr.row-claimed td.editable-cell { background-color: #fff3cd; }
tr.row-claimed:hover, tr.row-claimed:hover td, tr.row-claimed:hover td.editable-cell { background-color: #ffe69c; }

/* Loading & Empty states */
.loading { text-align: center; padding: 50px; color: #666; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ddd;
  border-top-color: #888;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 50px; color: #666; }

/* Buttons */
.refresh-btn {
  background: transparent;
  border: 1px solid #333;
  color: #333;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  margin: 0;
  transition: all 0.2s;
}

.refresh-btn:hover { background: #333; color: #fff; }

/* Cells */
.number-cell { color: #333; }
.date-cell { color: #555; }
.wide-col { min-width: 200px; }
.midwide-col { min-width: 120px; }
.datewide-col { min-width: 150px; }

/* Editable cells */
.editable-cell { cursor: pointer; position: relative; }
.editable-cell:hover { background: #f0f0f0 !important; }

.editable-cell input, .editable-cell select {
  background: #fff;
  border: 1px solid #999;
  color: #333;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.editable-cell input[type="number"] { -moz-appearance: textfield; }
.editable-cell input[type="number"]::-webkit-outer-spin-button,
.editable-cell input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.editable-cell input:focus, .editable-cell select:focus { outline: none; border-color: #666; box-shadow: 0 0 5px rgba(0,0,0,0.2); }

.editable-cell select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 120px;
}

.editable-cell select.status-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.editable-cell select option { background: #fff; color: #333; padding: 8px 12px; cursor: pointer; }
.editable-cell select option:hover { background: #eee; }

.editable-cell select.sku-cell-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-width: 180px;
  max-height: 240px;
  overflow-y: auto;
}

.saving-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #555;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
}

/* Login page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #f5f5f5;
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.login-box h1 { text-align: center; margin-bottom: 10px; font-size: 1.8rem; }
.login-box .subtitle { text-align: center; margin-bottom: 30px; color: #666; }
.login-box .form-group { margin-bottom: 20px; }
.login-box label { display: block; margin-bottom: 5px; font-weight: 500; color: #333; }

.login-box input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.login-box input:focus { outline: none; border-color: #666; }

/* Password toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  cursor: pointer;
  color: #666;
  user-select: none;
  display: flex;
  align-items: center;
}

.password-toggle:hover { color: #333; }
.password-toggle svg { display: block; }

.login-box button {
  width: 100%;
  padding: 12px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box button:hover { background: #555; }

.login-box .register-toggle-btn {
  background: transparent;
  border: 1px solid #999;
  color: #666;
  margin-top: 10px;
}

.login-box .register-toggle-btn:hover { background: #f5f5f5; color: #333; }

.login-error {
  color: #d32f2f;
  text-align: center;
  margin-bottom: 15px;
  display: none;
}

/* User info header */
.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.85rem;
  color: #666;
}

.user-info span { padding: 4px 8px; background: #eee; border-radius: 4px; }

.logout-btn {
  background: transparent;
  border: 1px solid #999;
  color: #666;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.logout-btn:hover { background: #333; color: #fff; border-color: #333; }

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 { font-size: 1.35rem; margin: 0; }

.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.header-right .subtitle { font-size: 0.85rem; margin: 0; }

#mainApp { display: none; height: 100%; }

/* Approval page styles */
.approval-box {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 450px;
}

.approval-box h1 { text-align: center; margin-bottom: 10px; font-size: 1.5rem; }
.approval-box .subtitle { text-align: center; margin-bottom: 30px; color: #666; }
.info-row { margin-bottom: 15px; }
.info-row label { font-weight: 500; color: #333; }
.info-row span { color: #666; }
.role-select { margin: 20px 0; }
.role-select label { display: block; margin-bottom: 8px; font-weight: 500; }

.role-select select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.buttons { display: flex; gap: 10px; margin-top: 20px; }

.btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-approve { background: #2e7d32; color: #fff; }
.btn-approve:hover { background: #1b5e20; }
.btn-reject { background: #c62828; color: #fff; }
.btn-reject:hover { background: #b71c1c; }

.message { text-align: center; padding: 20px; }
.message.success { color: #2e7d32; }
.message.error { color: #c62828; }
.login-prompt { text-align: center; margin-top: 20px; }
.login-prompt a { color: #333; }

/* Reset password page */
.reset-box {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.reset-box h1 { text-align: center; margin-bottom: 10px; font-size: 1.5rem; }
.reset-box .subtitle { text-align: center; margin-bottom: 30px; color: #666; }
.reset-box .form-group { margin-bottom: 20px; }
.reset-box .form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #333; }

.reset-box .form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.reset-box .form-group input:focus { outline: none; border-color: #333; }

.requirements {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.requirements h4 { margin-bottom: 10px; color: #333; }
.requirements ul { margin-left: 20px; color: #666; }
.requirements li { margin-bottom: 5px; }
.requirements li.valid { color: #28a745; }
.requirements li.invalid { color: #dc3545; }

.reset-box .btn {
  width: 100%;
  padding: 12px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.reset-box .btn:hover { background: #555; }
.reset-box .btn:disabled { background: #999; cursor: not-allowed; }

.error { color: #dc3545; margin-bottom: 15px; display: none; text-align: center; }
.success { color: #28a745; margin-bottom: 15px; display: none; text-align: center; }
.back-link { text-align: center; margin-top: 20px; }
.back-link a { color: #333; text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* Pending Registrations Notification */
.pending-notification {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  margin: 10px 20px;
  overflow: hidden;
}

.pending-header {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: #856404;
}

.pending-header:hover { background: #ffecb5; }

.pending-toggle {
  transition: transform 0.2s;
  font-size: 0.8rem;
}

.pending-toggle.open { transform: rotate(180deg); }

.pending-list {
  border-top: 1px solid #ffc107;
  max-height: 300px;
  overflow-y: auto;
}

.pending-item {
  padding: 10px 15px;
  border-bottom: 1px solid #ffeeba;
  cursor: pointer;
  background: #fffbf0;
}

.pending-item:last-child { border-bottom: none; }
.pending-item:hover { background: #fff3cd; }

.pending-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pending-item-email { font-weight: 500; color: #333; }
.pending-item-merchant { font-size: 0.85rem; color: #666; }
.pending-item-date { font-size: 0.75rem; color: #999; }

.pending-item-details {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.pending-item-details.expanded { display: block; }

.pending-detail-row {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.pending-detail-row label {
  font-weight: 500;
  color: #555;
  display: inline-block;
  min-width: 100px;
}

.pending-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.pending-actions button {
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  border: none;
  transition: background 0.2s;
}

.pending-approve { background: #28a745; color: #fff; }
.pending-approve:hover { background: #218838; }
.pending-reject { background: #dc3545; color: #fff; }
.pending-reject:hover { background: #c82333; }

.pending-role-select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Status single-select dropdown */
.status-select { position: relative; }

.status-select-btn {
  width: 104px;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  box-sizing: border-box;
}

.dropdown-arrows {
  font-size: 0.45rem;
  color: #666;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  z-index: 1000;
  min-width: 104px;
}

.status-select-dropdown.active { display: block; }

.status-option {
  padding: 6px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.status-option:hover { background: #f0f0f0; }
.status-option.selected { background: #e8e8e8; font-weight: 500; }

/* Directory Button */
.directory-btn {
  background: transparent;
  border: 1px solid #999;
  color: #666;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.directory-btn:hover { background: #333; color: #fff; border-color: #333; }

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.directory-modal {
  width: 625px;
  max-width: 90vw;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 60vh;
}

/* Directory List */
.directory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.directory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8f8f8;
  border-radius: 4px;
  gap: 10px;
}

.directory-row.editing { background: #fff8e6; }

.directory-email {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-email-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-role-select {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #fff;
  min-width: 80px;
}

.directory-role-select:disabled {
  background: #eee;
  color: #666;
  cursor: not-allowed;
}

.directory-role-select.editable {
  background: #fff;
  cursor: pointer;
}

.directory-edit-btn, .directory-save-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid #999;
  background: transparent;
  color: #666;
  transition: all 0.2s;
}

.directory-edit-btn:hover { background: #333; color: #fff; border-color: #333; }

.directory-save-btn {
  background: #28a745;
  color: #fff;
  border-color: #28a745;
}

.directory-save-btn:hover { background: #218838; border-color: #218838; }

.directory-current-user {
  font-size: 0.7rem;
  color: #999;
  margin-left: 5px;
}

.directory-merchant {
  font-size: 0.8rem;
  color: #666;
  min-width: 80px;
}

.directory-superadmin {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}
/* Section dropdown (header-left) */
.section-select { position: relative; }

.section-select-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.section-select:hover .section-select-btn {
  background: #f4f4f4;
  border-radius: 4px;
}

.section-select-btn h1 {
  margin: 0;
  padding: 0;
}

.section-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  min-width: 200px;
  padding: 6px 0;
  flex-direction: column;
}

.section-select:hover .section-select-dropdown { display: flex; }

.section-option {
  padding: 8px 16px;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.section-option:hover { background: #f4f4f4; }
.section-option.selected { background: #f0f0f0; font-weight: 500; }

.header-favicon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.placeholder-section {
  padding: 60px 24px;
  text-align: center;
  color: #666;
}

.placeholder-section h2 {
  margin: 0 0 12px 0;
  font-size: 1.4rem;
}

/* Make Clients/Partners sections fill available vertical space so the
   table-container inside can flex:1 and become scrollable. */
#clientProfileSection,
#partnersSection,
#catalogManagerSection {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#clientProfileSection .cp-toolbar,
#partnersSection .cp-toolbar { flex-shrink: 0; }
#clientProfileSection .filter-row,
#partnersSection .filter-row,
#catalogManagerSection .filter-row { flex-shrink: 0; }

/* Clients: unified section — table on left, detail panel on right, sharing
   one outer border with a subtle vertical divider between them. */
.cp-split {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}
.cp-left {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e0e0e0;
}
.cp-left .table-container { flex: 1; min-height: 0; border: none; }
.cp-right {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  padding: 16px;
  gap: 16px;
}
.cp-right-left {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Notes section grows to fill leftover vertical space; the three doc cards
   below it stay at content height so the last (Inspiration Photos) sits
   exactly at the bottom edge of the right pane. */
.cp-right-left .cp-notes-section { flex: 1; min-height: 168px; }
.cp-right-left .cp-notes-section .cp-notes-box { flex: 1; min-height: 0; }
.cp-right-left .cp-notes-section .cp-notes-input { flex: 1; min-height: 0; }
.cp-right-left .cp-doc-card { flex: 0 0 auto; }
.cp-right-right {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.cp-right-top {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}
.cp-right-bottom {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.cp-detail-empty {
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

/* ===== Catalog Manager left table (hover/select like Clients tab) ===== */
/* Fixed layout so column widths in <th style="width:..."> are honored exactly,
   instead of browser auto-expanding columns to fit longer header text. */
.cp-split #catalogTableContent table { table-layout: fixed; }
.cp-split #catalogTableContent th,
.cp-split #catalogTableContent td { overflow: hidden; }
.cp-split #catalogTableContent tr { background: #fff; cursor: pointer; }
.cp-split #catalogTableContent td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  background: #fff;
}
.cp-split #catalogTableContent tr:hover td { background: #f5faf5; }
.cp-split #catalogTableContent tr.cp-active td { background: #eef7ee !important; }
.cp-split #catalogTableContent .cp-editable {
  min-width: 60px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: text;
  min-height: 18px;
}
.cp-split #catalogTableContent .cp-editable:hover { border-color: #ccc; background: #fff; }
.cp-split #catalogTableContent .cp-editable:focus {
  border-color: #2a7d2f;
  background: #fff;
  outline: none;
}
.cp-split #catalogTableContent .cp-saving { background: #fffbe6; }
.cp-split #catalogTableContent .cp-saved { background: #eaffea; }
.cp-split #catalogTableContent .cp-error-bg { background: #ffe6e6; }

/* Left = 65%, right = 35% — extra width for the table now that the right
   pane no longer renders a visible scrollbar. */
#catalogManagerSection .cp-split .cp-left { flex: 1 1 65%; }

/* Collapsed (no-selection) state: hide the right pane entirely and let the
   table fill the full split width. The pane reappears when a row is
   selected; selection is cleared by the inline collapse triangle or Esc. */
#catalogManagerSection .cp-split.cm-detail-collapsed .cm-right { display: none; }
#catalogManagerSection .cp-split.cm-detail-collapsed .cp-left {
  flex: 1 1 100%;
  border-right: none;
}

/* ===== Catalog Manager detail panel (mirrors Unity DetailPanel) ===== */
/* The panel itself does not scroll — it's the positioned ancestor for the
   collapse triangle. Content scrolls inside `.cm-scroll` so the triangle
   stays vertically centered in the viewport regardless of scroll. */
.cm-right {
  flex: 1 1 35%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #2d2d2d;
  color: #fff;
  position: relative;
}
.cm-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  overflow-y: auto;
  scrollbar-width: none;
}
.cm-scroll::-webkit-scrollbar { display: none; }

/* Inline collapse triangle pinned to the left-center of the panel. Solid
   white glyph, tight bounds (no visible rectangular click-target). Hover
   brightens the glyph slightly to hint interactivity. */
.cm-collapse-btn {
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px;
  z-index: 1;
  transition: filter 0.15s, transform 0.15s;
  line-height: 1;
}
.cm-collapse-btn:hover {
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.7));
  transform: translateY(-50%) scale(1.15);
}
/* Image+thumb row mirrors Unity DetailPanel proportions:
   image = 80% of row width (square), thumb column ≈18.5% with 1.5% gap.
   Row aspect-ratio 5:4 fixes the row height at 0.8 × row width = image height,
   so the thumb column has a bounded height and scrolls when too many thumbs. */
.cm-image-row {
  display: flex;
  width: 100%;
  aspect-ratio: 5 / 4;
  column-gap: 1.5%;
  flex: 0 0 auto;
}
.cm-large-image {
  flex: 0 0 80%;
  height: 100%;
  background: #2d2d2d;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-large-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* Round the image content itself, not just the container letterbox area.
     When the image's aspect ratio doesn't fill the square container the
     image gets letterboxed; the container's border-radius alone wouldn't
     round the visible image edges, so apply it to the <img> too. */
  border-radius: 8px;
}
.cm-image-placeholder {
  color: #888;
  font-size: 0.8rem;
}
.cm-thumbs {
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 6px;
  overflow-y: auto;
  scrollbar-width: none;
  /* Rounded viewport so a thumbnail that gets cut off by the scroll
     boundary is clipped with a rounded corner instead of a hard
     horizontal line. */
  border-radius: 8px;
}
.cm-thumbs::-webkit-scrollbar { display: none; }
.cm-thumb {
  position: relative;
  width: 90%;
  aspect-ratio: 1 / 1;
  background: #2d2d2d;
  border-radius: 8px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
}
.cm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cm-thumb:hover { border-color: rgba(255,255,255,0.5); }
.cm-thumb.selected { border-color: #fff; }
.cm-thumb[draggable="true"] { cursor: grab; }
.cm-thumb[draggable="true"]:active { cursor: grabbing; }

/* Delete X — hidden until thumb hover, top-right corner. Same visual style
   as Unity's note popup close button (small white × on dark disc). */
.cm-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.95rem;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.cm-thumb:hover .cm-thumb-delete { opacity: 1; }
.cm-thumb-delete:hover { background: #c94040; }

/* "+" upload tile sits at the bottom of the strip. Dashed outline, no
   background image, plus glyph centered. */
.cm-thumb.cm-thumb-add {
  background: transparent;
  border: 2px dashed rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 1.6rem;
  line-height: 1;
}
.cm-thumb.cm-thumb-add:hover {
  border-color: rgba(255,255,255,0.8);
  color: #fff;
}

.cm-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
/* Row 1 — title (Brand SKU). Larger and bolder than the rest. */
.cm-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
/* Row 2 — attribute subtitle (dimensions • Grade • Material • Finish).
   Light grey and roughly half the title font size. */
.cm-attrs {
  font-size: 0.7rem;
  color: #b0b0b0;
  line-height: 1.4;
}
/* ===== Pricing block (hero + numbered card + trust badge) ===== */

/* Hero card — only shown when there's a rebate (effective price ≠ pay-now).
   Subtle green tint as the integration cue; no loud border so the card feels
   like part of the panel rather than a popup. Stacked content (no icon). */
.cm-hero-card {
  margin-top: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(46, 204, 113, 0.10);
  border: none;
  border-radius: 10px;
}
.cm-hero-label {
  font-size: 0.7rem;
  color: #b0b0b0;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cm-hero-sub {
  color: #888;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.cm-hero-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.cm-hero-amount {
  font-family: 'Roboto', sans-serif;
  color: #2ecc71;
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.1;
}
.cm-hero-unit {
  font-family: 'Roboto', sans-serif;
  color: #2ecc71;
  font-size: 0.95rem;
  font-weight: 500;
}
.cm-hero-savings {
  margin-top: 4px;
  font-size: 0.7rem;
  color: #cfead8;
  background: rgba(46, 204, 113, 0.18);
  border-radius: 12px;
  padding: 3px 10px;
  display: inline-block;
  align-self: flex-start;
}

/* Numbered Pay Now / Earn Back card */
.cm-pricing-card {
  margin-top: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cm-pricing-card-plain {
  flex-direction: column;
  gap: 4px;
}
.cm-numbered-divider {
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cm-numbered-section {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cm-numbered-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cm-num {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  margin-top: 2px;
}
.cm-num-red   { background: #FF3030; }
.cm-num-green { background: #2ecc71; }

/* Trust badge — sits inside the Earn Back section, just under the rebate %.
   No background/border so it reads as a subtitle of that section rather
   than a separate card. */
.cm-trust-badge {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #b0b0b0;
}
.cm-pricing-label {
  font-size: 0.7rem;
  color: #b0b0b0;
  text-transform: none;
  letter-spacing: 0.01em;
}
.cm-pricing-sub {
  color: #888;
  font-weight: 400;
  font-size: 0.95em;
}
.cm-pricing-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
/* Pay-now amounts. font-family pinned explicitly so the price stays Roboto
   regardless of any future change to the global body font. */
.cm-price-discounted {
  font-family: 'Roboto', sans-serif;
  color: #FF3030;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
}
.cm-price-listprice {
  font-family: 'Roboto', sans-serif;
  color: #fff;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
}
.cm-price-unit {
  color: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
}
/* List price strikethrough below the discounted figure */
.cm-list-price {
  color: #888;
  font-size: 0.75rem;
  margin-top: 2px;
}
.cm-list-price s { color: #888; }
/* Earn-back rebate text — green to read as money you get back */
.cm-rebate-pct {
  font-family: 'Roboto', sans-serif;
  color: #2ecc71;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
}
.cm-rebate-label {
  color: #2ecc71;
  font-size: 0.85rem;
  font-weight: 500;
}
.cm-effective-price {
  color: #b0b0b0;
  font-size: 0.75rem;
  margin-top: 2px;
}
/* Effective price amount itself is green (matches the rebate %), while the
   "Effective price:" label stays grey for hierarchy. */
.cm-effective-amount {
  color: #2ecc71;
  font-weight: 600;
}
/* Discount % pill — red rounded rectangle inline with the price */
.cm-discount-pill {
  display: inline-block;
  background: #FF3030;
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* Footnote at the bottom of the pricing card — small grey explainer text */
.cm-pricing-footnote {
  font-size: 0.72rem;
  color: #999;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px;
  line-height: 1.4;
}
.cm-savings-badge {
  color: #ddd;
}
.cm-savings-badge b {
  color: #ffd966;
  font-weight: 700;
}
.cm-about-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.cm-about {
  font-size: 0.8rem;
  color: #ddd;
}
/* Pencil toggle next to "About this …". Bare glyph, no chrome — only a
   faint hover highlight signals interactivity. */
.cm-edit-btn {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.cm-edit-btn:hover { opacity: 1; }
.cm-edit-btn img {
  width: 14px;
  height: 14px;
  /* Source PNG is dark; invert to render white on the dark panel. */
  filter: invert(1);
  display: block;
}
/* Comment text — same visual whether read-only or editing. No outline,
   no background change. The pencil button is the only edit affordance;
   when contenteditable is active, the system caret signals edit mode. */
.cm-comment {
  font-size: 0.85rem;
  color: #ccc;
  line-height: 1.5;
  white-space: pre-wrap;
  outline: none;
  min-height: 1.5em;
}
.cm-comment-editing { caret-color: #fff; }
.cm-comment-empty { color: #888; font-style: italic; }

/* Title-bar actions: Active Only + Clear + count, sitting immediately to
   the right of the "▼ Filters" label (no margin-left: auto, so they hug the
   collapse arrow rather than floating to the far edge). */
#cmFilterRow .cm-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}
#cmFilterRow .cm-title-actions .cp-btn {
  height: 22px;
  padding: 0 10px;
  font-size: 0.75rem;
  line-height: 20px;
  box-sizing: border-box;
}
#cmFilterRow .cm-title-actions .cp-info {
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
}
#cmFilterRow .cm-active-only {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #333;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
#cmFilterRow .cm-active-only input { margin: 0; width: auto; }

/* Min - Max range filter on one row */
#cmFilterContent .cm-range {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
#cmFilterContent .cm-range input { width: 56px; }
#cmFilterContent .cm-range .cm-range-sep { color: #888; font-size: 0.75rem; }

/* Active checkbox cell in left table */
#catalogManagerSection .cm-cell-center { text-align: center; }
#catalogManagerSection .cm-cell-center input[type="checkbox"] { cursor: pointer; }

/* (Old .cm-discount-tag rules removed — discount % is now its own pill row,
   styled by .cm-discount-pill above.) */

/* Notes — match bareone Dashboard textarea exactly */
.cp-notes-section { display: flex; flex-direction: column; }
.cp-notes-style {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #111;
  margin-bottom: 8px;
}
.cp-notes-label {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: normal;
  color: #6b7280;
}
/* Notes box: bordered card containing the label as inline title and the
   editable textarea below it. */
.cp-notes-box {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.cp-notes-box:focus-within { border-color: #000; }
.cp-notes-box .cp-notes-label { padding: 10px 16px 0; }
.cp-notes-input {
  width: 100%;
  min-height: 168px;
  border: none;
  border-radius: 0 0 12px 12px;
  padding: 4px 16px 18px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  resize: none;
  background: transparent;
  box-sizing: border-box;
}
.cp-notes-count {
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 0.625rem;
  color: #d1d5db;
  pointer-events: none;
}

/* Upload doc cards — match bareone DocUploadCard */
.cp-doc-card {
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s;
  overflow: hidden;
}
.cp-doc-card:hover { border-color: #d1d5db; }
.cp-doc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cp-doc-icon { color: #9ca3af; flex-shrink: 0; }
.cp-doc-title {
  font-size: 0.6875rem;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.25;
  flex: 1;
}
.cp-doc-empty {
  text-align: center;
  font-size: 0.625rem;
  color: #d1d5db;
  padding: 8px 0;
}

/* Override thumbnails inside the detail cards: 56×56 like bareone */
.cp-upload-detail .cp-upload-row { width: 100%; flex-wrap: nowrap; gap: 8px; overflow-x: auto; }
.cp-upload-detail .cp-upload-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #f3f4f6;
  border: none;
}
.cp-upload-detail::-webkit-scrollbar { display: none; }

.cp-detail-recipe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cp-detail-recipe-list li { padding: 2px 0; }

/* Version-box: latest image is fixed-size; the dropdown is a popover that
   anchors below the image and overlays the recipes panel. */
.cp-version-box { position: relative; }
.cp-version-empty {
  width: 100%;
  aspect-ratio: 16/9;
  background: #f3f4f6;
  border: 2px dashed #e5e7eb;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.85rem;
  font-style: italic;
  flex: 0 0 auto;
}
/* Version with no PNG yet (e.g., raw save before screenshot is generated) */
.cp-version-noimg {
  background: #f3f4f6;
  border-style: dashed;
}
.cp-version-overlay-noimg {
  background: linear-gradient(to top, rgba(255,255,255,0.85), rgba(255,255,255,0.4));
}
.cp-version-overlay-noimg .cp-version-label { color: #555; text-shadow: none; }
.cp-version-thumb-noimg {
  background: #f3f4f6 !important;
  border-style: dashed !important;
}
.cp-version-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 50;
}

#clientProfileTableContent tr { cursor: pointer; }
#clientProfileTableContent tr.cp-active td { background: #eef7ee !important; }
/* Header row stays white in the unified section */
#clientProfileTableContent th { background: #fff !important; }

/* Client Profile table */
.cp-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  flex-wrap: wrap;
}

.cp-btn {
  padding: 6px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.cp-btn:hover:not(:disabled) { background: #f0f0f0; }
.cp-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cp-btn.cp-add {
  background: #2a7d2f;
  color: #fff;
  border-color: #2a7d2f;
}
.cp-btn.cp-add:hover:not(:disabled) { background: #23692a; }

.cp-btn.cp-delete {
  background: #c94040;
  color: #fff;
  border-color: #c94040;
}
.cp-btn.cp-delete:hover:not(:disabled) { background: #a93434; }

.cp-info {
  color: #666;
  font-size: 0.8rem;
  margin-left: auto;
}

#clientProfileTableContent table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

#clientProfileTableContent th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

#clientProfileTableContent tr { background: #fff; }
#clientProfileTableContent td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  background: #fff;
}

#clientProfileTableContent tr:hover td { background: #f5faf5; }
#clientProfileTableContent tr.cp-selected td { background: #fffbe6; }

#clientProfileTableContent .cp-checkbox { width: 16px; }
#clientProfileTableContent .cp-key-cell { color: #999; font-style: italic; }

#clientProfileTableContent .cp-editable {
  min-width: 60px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: text;
  min-height: 18px;
}
#clientProfileTableContent .cp-editable:hover { border-color: #ccc; background: #fff; }
#clientProfileTableContent .cp-editable:focus {
  border-color: #2a7d2f;
  background: #fff;
  outline: none;
}
#clientProfileTableContent .cp-saving { background: #fff8e1 !important; }
#clientProfileTableContent .cp-saved { background: #e8f5e9 !important; }
#clientProfileTableContent .cp-error-bg { background: #ffebee !important; }


.cp-add-form label {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
}
.cp-add-form .cp-req { color: #c94040; }
.cp-add-form input,
.cp-add-form textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.cp-add-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.cp-error {
  margin-top: 12px;
  color: #c94040;
  font-size: 0.85rem;
}

.dp-role-select {
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.8rem;
  background: #fff;
  cursor: pointer;
}

#partnersTableContent .cp-saving { background: #fff8e1 !important; }
#partnersTableContent .cp-saved { background: #e8f5e9 !important; }
#partnersTableContent .cp-error-bg { background: #ffebee !important; }

.cp-add-form select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: #fff;
}
.cp-hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}
.pt-combo { width: 100%; }
.pt-combo input { width: 100%; }

.pt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pt-badge-active { background: #e8f5e9; color: #2e7d32; }
.pt-badge-seed { background: #fff3e0; color: #e65100; }

/* Wider Add Client modal with 2-column form layout */
.cp-modal {
  width: 880px;
  max-width: 92vw;
}
.cp-modal .modal-body { max-height: 70vh; padding: 24px 28px; }
.cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.cp-grid .cp-field { display: flex; flex-direction: column; }
.cp-grid .cp-span-2 { grid-column: 1 / -1; }
.cp-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cp-hint-inline {
  font-weight: 400;
  font-size: 0.7rem;
  color: #999;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}
.cp-grid input,
.cp-grid select,
.cp-grid textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
}
.cp-grid input:focus,
.cp-grid select:focus,
.cp-grid textarea:focus {
  outline: none;
  border-color: #2a7d2f;
  box-shadow: 0 0 0 2px rgba(42,125,47,0.15);
}

/* Multi-creator widget — stacked rows. + lives inside the last row. */
.cp-creator-multi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.cp-creator-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 4px;
  width: 100%;
  box-sizing: border-box;
}
.cp-creator-row .cp-creator-select { flex: 1; min-width: 0; }
.cp-creator-row .cp-creator-remove { margin-left: auto; }
.cp-creator-row select {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
  min-width: 140px;
}
.cp-creator-remove {
  background: none;
  border: none;
  color: #999;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.cp-creator-remove:hover { color: #c94040; }
.cp-creator-add {
  background: transparent;
  border: none;
  color: #555;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  align-self: center;
}
.cp-creator-add:hover { color: #2a7d2f; }

/* In-table cell version is more compact */
#clientProfileTableContent .cp-creator-multi { padding: 4px 0; }
#clientProfileTableContent .cp-creator-row { background: #fff; border-color: #ccc; }

/* Upload thumbnails (Floor Plan / Space Photos / Inspirations) */
.cp-upload-cell {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.cp-upload-row {
  display: flex;
  gap: 4px;
  padding: 2px 0;
  width: max-content;
}

/* When the recipe row is expanded, upload cells get more vertical room.
   Wrap thumbnails so more are visible at once. */
tr.cp-row-expanded .cp-upload-cell {
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
}
tr.cp-row-expanded .cp-upload-row {
  flex-wrap: wrap;
  width: 100%;
}
.cp-upload-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
  border: 1px solid #ddd;
}
.cp-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.cp-upload-empty { color: #bbb; font-size: 0.8rem; }
.cp-upload-cell::-webkit-scrollbar { height: 6px; }
.cp-upload-cell::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.cp-image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  cursor: zoom-out;
}
.cp-image-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* Table width: column widths are fixed so toggling Details only changes the
   table's overall width, never the width of remaining columns. The container
   scrolls horizontally when total exceeds viewport. */
#clientProfileTableContent table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

/* ========== Recipes + Versions ========== */

.cp-recipe-cell {
  min-width: 160px;
  max-width: 260px;
  white-space: nowrap;
  position: relative;
}

.cp-recipe-link {
  color: #1a73e8;
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
}
.cp-recipe-link:hover { text-decoration: underline; }

.cp-recipe-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  color: #555;
  vertical-align: middle;
  padding: 0;
}
.cp-recipe-expand:hover { color: #2a7d2f; }

.cp-recipe-loading { color: #999; font-size: 0.8rem; }

.cp-recipe-expand-list {
  margin-top: 8px;
  padding: 6px 0;
  border-top: 1px solid #eee;
}

.cp-recipe-item {
  padding: 3px 0;
}
.cp-recipe-item .cp-recipe-link {
  font-size: 0.82rem;
}

/* Version image box */
.cp-version-box {
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.cp-version-latest {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #e0e0e0;
  transition: border-color 0.2s;
  flex: 0 0 auto;
}
.cp-version-latest:hover { border-color: #333; }

.cp-version-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  padding: 20px 10px 8px;
}

.cp-version-label {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.cp-version-expand-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.cp-version-expand-btn:hover { background: rgba(0,0,0,0.7); }

/* Note: .cp-version-dropdown is also styled near the detail-panel section
   above; that absolute-popover style supersedes the older inline layout. */

.cp-version-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid #e0e0e0;
  transition: border-color 0.2s;
}
.cp-version-thumb:hover { border-color: #333; }

.cp-version-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  padding: 12px 6px 4px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

/* v51 */
