/* ==========================================================
 * Client List Dashboard — per-client drill-in
 *
 * Aesthetic: Refined Editorial Dashboard. Same visual language as
 * My View — one large white card on grey-blue, generous internal
 * padding, KPI-style sub-cards with tiny uppercase letter-spaced
 * muted labels and crisp content. Tabs use a subtle orange underline
 * for the active state. Status pills are pastel pairs. Forms have
 * tight typographic rhythm, gentle focus halos, no shouting.
 *
 * Token scope: only the global tokens declared in ui/css/styles.css.
 * No new variables, no new fonts.
 * ========================================================== */

/* ===== Page shell — large white card on grey-blue bg ===== */
.cl-dashboard-page {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100% - 4px);
  min-height: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cl-dashboard-loading {
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

.cl-empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.cl-empty-inline {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  padding: 6px 0;
}

/* ===== Header ===== */
.cl-dashboard-header {
  flex-shrink: 0;
  margin-bottom: 18px;
}

.cl-dashboard-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Name block holds the title + the discreet rating-tier badge inline. It owns
   the flexible width so the action toolbar stays pinned to the right. */
.cl-dashboard-nameblock {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.cl-dashboard-title {
  margin: 0;
  font-family: var(--font-family);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
  min-width: 0;
  word-break: break-word;
}

/* Rating-tier badge — small, discreet, sits beside the client name. The pill
   chrome itself comes from ui/css/rating-badge.css; this only seats it. */
.cl-dashboard-rating {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.cl-dashboard-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Action buttons ===== */
.cl-action-btn {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cl-action-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.22);
}
.cl-action-btn:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}
.cl-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cl-action-btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(212, 121, 26, 0.18);
}
.cl-action-btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  border-color: transparent;
}

.cl-action-btn-warn {
  border-color: rgba(217, 119, 6, 0.32);
  color: #b45309;
  background: var(--color-secondary);
}
.cl-action-btn-warn:hover:not(:disabled) {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.5);
}

.cl-action-btn-danger {
  background: #c23b3b;
  color: #fff;
  border-color: #c23b3b;
}
.cl-action-btn-danger:hover:not(:disabled) {
  background: #a83333;
  border-color: #a83333;
}

.cl-action-btn-small {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.cl-action-kebab-wrap {
  position: relative;
}
.cl-action-kebab {
  font-size: 16px;
  padding: 6px 11px;
  line-height: 1;
}

.cl-action-kebab-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.06);
  min-width: 220px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.cl-action-kebab-item {
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-family);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.cl-action-kebab-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ===== Tabs — neutral, active gets orange underline ===== */
.cl-dashboard-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
  margin-bottom: 0;
}

.cl-dashboard-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  margin-bottom: -1px;
  letter-spacing: 0.005em;
}
.cl-dashboard-tab:hover {
  color: var(--text-primary);
}
.cl-dashboard-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--color-accent-light);
  font-weight: 600;
}

/* ===== Content scroll area ===== */
.cl-dashboard-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 4px 12px 0;
}

/* ===== Detail-pane — kanban-style sub-cards ===== */
.cl-details-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}
.cl-details-left,
.cl-details-right {
  display: grid;
  gap: 18px;
  align-items: start;
  min-width: 0;
}
.cl-details-left {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
/* Single-column at narrow widths: panel drops below the company cards. */
@media (max-width: 900px) {
  .cl-details-pane {
    grid-template-columns: 1fr;
  }
}

/* ===== Signed Booking Forms panel (Details tab, right column) ===== */
.cl-sbf-card {
  position: sticky;
  top: 0;
}
.cl-sbf-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cl-sbf-row {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8f9fb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-sbf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cl-sbf-titleblock {
  min-width: 0;
}
.cl-sbf-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}
.cl-sbf-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.cl-sbf-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f5ec;
  color: #1f7a45;
}
.cl-sbf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cl-sbf-toggle.active {
  background: var(--color-accent-light);
  color: #fff;
  border-color: var(--color-accent-light);
}
.cl-sbf-checklist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
}
.cl-sbf-caption {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.35;
}
.cl-sbf-preview {
  margin-top: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-secondary);
}
.cl-sbf-frame {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
}

.cl-card,
.cl-card-wide {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  word-break: break-word;
  white-space: normal;
}
.cl-card-wide {
  grid-column: 1 / -1;
}

.cl-card-title {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Form fields ===== */
.cl-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.cl-field-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}
.cl-field-row .cl-field-label {
  margin: 0;
}
.cl-field-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cl-field-input {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
.cl-field-input:hover:not(:focus) {
  border-color: rgba(0, 0, 0, 0.2);
}
.cl-field-input:focus {
  border-color: var(--color-accent-light);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}
.cl-field-input::placeholder {
  color: var(--text-muted);
}
.cl-field-input.saved {
  border-color: #3ea96a;
  box-shadow: 0 0 0 3px rgba(62, 169, 106, 0.14);
}
.cl-field-input.error {
  border-color: #c23b3b;
  box-shadow: 0 0 0 3px rgba(194, 59, 59, 0.14);
}
.cl-field-multi {
  align-items: flex-start;
}

/* ===== Industry chip multiselect ===== */
.cl-industry-wrap { width: 100%; }
.cl-industry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cl-industry-pill {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  padding: 4px 8px 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.cl-industry-pill-x {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.cl-industry-pill-x:hover {
  opacity: 1;
  color: #c23b3b;
}
.cl-industry-add {
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-family);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cl-industry-add:hover {
  border-color: var(--color-accent-light);
  color: var(--color-accent-dark);
}

/* ===== Country chips ===== */
.cl-countries-wrap { width: 100%; }
.cl-countries-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cl-chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--color-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cl-chip:hover {
  background: rgba(245, 166, 35, 0.06);
  border-color: rgba(245, 166, 35, 0.25);
  color: var(--text-primary);
}
.cl-chip:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}
.cl-chip.active {
  background: rgba(245, 166, 35, 0.16);
  border-color: rgba(245, 166, 35, 0.55);
  color: var(--color-accent-dark);
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.35);
}
.cl-chip.active:hover {
  background: rgba(245, 166, 35, 0.22);
}

/* ===== Locations ===== */
.cl-locations-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cl-location-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.012);
}
.cl-location-main {
  border-color: rgba(245, 166, 35, 0.32);
  background: rgba(245, 166, 35, 0.04);
}
.cl-location-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cl-location-label {
  flex: 1;
  font-weight: 600;
}
.cl-location-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}
.cl-location-remove:hover {
  background: rgba(194, 59, 59, 0.08);
  color: #c23b3b;
}
.cl-location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.cl-add-loc-btn {
  margin-top: 12px;
}

/* ===== File History ===== */
.cl-file-history-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-file-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-file-history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cl-file-history-item:hover {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}
.cl-fh-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.2;
}
.cl-fh-info {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.cl-fh-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.35;
}
.cl-fh-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cl-fh-see-all {
  display: inline-block;
  margin-top: 10px;
  color: var(--color-accent-dark);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.cl-fh-see-all:hover {
  text-decoration: underline;
}

/* ===== Library pane ===== */
.cl-library-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-library-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.cl-library-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.cl-library-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cl-library-chip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.cl-library-chip {
  background: var(--color-secondary);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cl-library-chip:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}
.cl-library-chip.active {
  background: rgba(245, 166, 35, 0.12);
  color: var(--color-accent-dark);
  border-color: rgba(245, 166, 35, 0.4);
}
.cl-library-chip-edit {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.cl-library-chip-wrap:hover .cl-library-chip-edit {
  display: flex;
}
.cl-library-chip-add {
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-family);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cl-library-chip-add:hover {
  border-color: var(--color-accent-light);
  color: var(--color-accent-dark);
}

/* AI Analyze button — primary CTA */
.cl-ai-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(212, 121, 26, 0.18);
  transition: filter 0.15s ease;
}
.cl-ai-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}
.cl-ai-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cl-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.cl-library-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}
.cl-library-card {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.18s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.cl-library-card:hover {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}
.cl-library-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cl-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cl-library-thumb.no-image::after {
  content: 'No preview';
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}
.cl-library-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px 4px;
  gap: 8px;
}
.cl-library-heading {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.35;
}
.cl-library-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.cl-library-dots {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 4px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}
.cl-library-dots:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}
.cl-library-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px 12px;
  gap: 8px;
}
.cl-library-tag-pill {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: var(--font-family);
  transition: background 0.15s ease, color 0.15s ease;
}
.cl-library-tag-pill:hover {
  background: rgba(0, 0, 0, 0.09);
  color: var(--text-primary);
}
.cl-library-download {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cl-library-download:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
}

/* ===== Modals ===== */
.cl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: cd-modal-fade 0.18s ease;
}
.cl-modal-overlay-light {
  background: rgba(15, 23, 42, 0.28);
}
@keyframes cd-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cl-modal {
  background: var(--color-secondary);
  border-radius: 14px;
  padding: 24px 26px 22px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
  animation: cd-modal-pop 0.2s ease;
}
@keyframes cd-modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cl-modal-large { width: 600px; }
.cl-modal-small { min-width: 260px; max-width: 440px; }

.cl-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.cl-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.cl-json-viewer {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 60vh;
  overflow: auto;
  white-space: pre;
  padding: 12px 14px;
  margin: 0;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: 6px;
}
[data-theme="dark"] .cl-json-viewer,
.theme-dark .cl-json-viewer {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.cl-modal-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cl-modal-pick-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cl-modal-pick-row:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.cl-asset-preview {
  width: 100%;
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  overflow: hidden;
}
.cl-asset-preview img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}

/* ===== Lightbox ===== */
.cl-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  animation: cd-modal-fade 0.18s ease;
}
.cl-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.cl-lightbox-caption {
  color: #fff;
  margin-top: 14px;
  text-align: center;
  max-width: 80vw;
}
.cl-lightbox-title {
  font-size: 16px;
  font-weight: 600;
}
.cl-lightbox-alt {
  font-size: 13px;
  opacity: 0.78;
  margin-top: 4px;
}
.cl-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cl-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* ===== Website pane ===== */
.cl-website-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-website-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 768px) {
  .cl-website-grid { grid-template-columns: 1fr; }
}
.cl-website-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.cl-website-history {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 18px 20px;
  position: sticky;
  top: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.cl-website-history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cl-website-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-family);
  width: 100%;
  color: var(--text-secondary);
  transition: background 0.15s ease;
}
.cl-website-history-row:hover {
  background: rgba(0, 0, 0, 0.03);
}
.cl-website-history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.cl-website-history-dot.green { background: #27ae60; }
.cl-website-history-dot.orange { background: var(--color-accent-light); }
.cl-website-history-dot.red { background: #c23b3b; }
.cl-website-history-time {
  color: var(--text-primary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.cl-website-history-actor {
  color: var(--text-muted);
  margin-left: auto;
  font-size: 11px;
}

.cl-website-snapshot-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.28);
  border-radius: 10px;
  color: #92400e;
  font-size: 13px;
}
.cl-website-snapshot-msg {
  font-weight: 500;
}

.cl-website-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.cl-website-header-left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Status pill */
.cl-website-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid transparent;
}
.cl-website-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}
.cl-website-status.is-loading { color: var(--text-muted); }
.cl-website-status.is-scraped { background: rgba(39, 174, 96, 0.12); color: #1e7a48; }
.cl-website-status.is-scraping { background: rgba(245, 166, 35, 0.12); color: var(--color-accent-dark); }
.cl-website-status.is-incomplete { background: rgba(234, 179, 8, 0.14); color: #92400e; }
.cl-website-status.is-failed { background: rgba(231, 76, 60, 0.12); color: #b91c1c; }
.cl-website-status.is-none { color: var(--text-muted); }

.cl-website-last {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cl-website-rescrape {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-family);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(212, 121, 26, 0.18);
  transition: filter 0.15s ease;
}
.cl-website-rescrape:disabled { opacity: 0.55; cursor: not-allowed; }
.cl-website-rescrape:hover:not(:disabled) { filter: brightness(1.05); }

.cl-website-error {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(194, 59, 59, 0.05);
  border: 1px solid rgba(194, 59, 59, 0.22);
  color: #b91c1c;
  font-size: 13px;
}
.cl-website-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cl-website-card {
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.cl-website-card .cl-card-title {
  margin-bottom: 14px;
}

.cl-website-failure {
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(194, 59, 59, 0.05);
  border: 1px solid rgba(194, 59, 59, 0.22);
  color: #b91c1c;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-website-failure-detail {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.cl-website-about p {
  margin: 0 0 8px;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 13px;
}
.cl-website-about ul {
  margin: 0 0 8px;
  padding-left: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 13px;
}
.cl-website-about-h {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.cl-website-about-hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin: 12px 0;
}

/* Products with images */
.cl-website-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.cl-website-product-card {
  background: rgba(0, 0, 0, 0.012);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-website-product-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}
.cl-website-product-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
  color: var(--text-primary);
  line-height: 1.35;
}
.cl-website-product-desc {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
  line-height: 1.45;
}
.cl-website-product-prop {
  display: flex;
  gap: 6px;
  font-size: 12px;
}
.cl-website-prop-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.cl-website-prop-value {
  color: var(--text-primary);
}
/* AI alt-text caption under a product image */
.cl-website-product-alt {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  word-break: break-word;
  line-height: 1.4;
}
/* Low-confidence / unverified warning chip */
.cl-website-product-warn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.4);
}
.cl-website-product-warn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-light);
  flex: 0 0 auto;
}
.cl-website-product-warn-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b9760a;
  white-space: nowrap;
}

/* ── Manual product manager ─────────────────────────────────────────────── */
.cl-products-section {
  background: var(--color-secondary, #fff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cl-products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cl-products-head .cl-card-title {
  margin: 0;
}
.cl-products-add {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(212, 121, 26, 0.18);
}
.cl-products-add:hover { filter: brightness(1.05); }
.cl-products-add:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 2px; }

.cl-product-img-wrap { width: 100%; }
.cl-product-img-placeholder {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.02);
}
.cl-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.cl-product-btn {
  appearance: none;
  flex: 1 1 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.cl-product-btn:hover { background: rgba(0, 0, 0, 0.05); }
.cl-product-btn:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 1px; }
.cl-product-btn-danger { color: #b91c1c; border-color: rgba(231, 76, 60, 0.4); }
.cl-product-btn-danger:hover { background: rgba(231, 76, 60, 0.1); }

/* Product create/edit modal */
.cl-product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.cl-product-modal {
  background: var(--color-secondary, #fff);
  border-radius: 14px;
  padding: 22px 24px 20px;
  width: 420px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
}
.cl-product-modal-title { margin: 0; }
.cl-product-field { display: flex; flex-direction: column; gap: 4px; }
.cl-product-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cl-product-field-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
}
textarea.cl-product-field-input { min-height: 72px; resize: vertical; }
.cl-product-field-input:focus-visible {
  outline: none;
  border-color: var(--color-accent-light);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}
.cl-product-modal-err { font-size: 12px; color: #b91c1c; }
.cl-product-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Branches */
.cl-website-branch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-website-branch {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.012);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.cl-website-branch-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.cl-website-branch-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Contact cards */
.cl-website-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.cl-website-contact-card {
  background: rgba(0, 0, 0, 0.012);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cl-website-contact-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.cl-website-contact-line {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}
.cl-muted {
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Finances ===== */
.cl-finances-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-finances-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 768px) {
  .cl-finances-grid { grid-template-columns: 1fr; }
}
.cl-card-payment-conditions {
  position: sticky;
  top: 0;
}
.cl-card-records {
  /* Right column: financial records table card. Inherits .cl-card chrome
     (white bg, soft border, 12px radius, 20/22px padding); no overrides
     needed beyond what .cl-card and .cl-records-* selectors already define. */
}
.cl-pc-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cl-pc-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.cl-pc-reextract {
  margin-top: 8px;
}
.cl-records-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.cl-records-header .cl-card-title {
  margin-bottom: 0;
}
.cl-records-header-actions {
  display: flex;
  gap: 8px;
}
.cl-records-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cl-bulk-count {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.cl-records-host {
  display: block;
  width: 100%;
}
.cl-records-add-host {
  display: block;
  width: 100%;
}
.cl-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cl-records-table th,
.cl-records-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-align: left;
  word-break: break-word;
  white-space: normal;
  vertical-align: top;
}
.cl-records-table th {
  font-weight: 700;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px;
}
.cl-records-table tr:last-child td {
  border-bottom: none;
}
.cl-records-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.cl-records-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}
.cl-records-status-paid    { background: rgba(39, 174, 96, 0.12);  color: #1e7a48; }
.cl-records-status-sent    { background: rgba(52, 152, 219, 0.12); color: #1d4ed8; }
.cl-records-status-overdue { background: rgba(231, 76, 60, 0.12);  color: #b91c1c; }
.cl-records-status-draft   { background: rgba(0, 0, 0, 0.05);      color: var(--text-muted); }
.cl-records-overdue-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c23b3b;
  margin-left: 8px;
  vertical-align: middle;
}
.cl-row-overdue {
  background: rgba(194, 59, 59, 0.025);
}

/* Override the global cc-sidebar-avatar (defined in dev/css/dev.css with a
   solid orange gradient) so per-client dashboards use a smaller, neutral
   avatar that matches the rest of the CRM's restraint. */
.cc-sidebar-avatar {
  width: 36px !important;
  height: 36px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  letter-spacing: 0.04em;
}
.cc-sidebar-section {
  padding: 12px 4px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.cc-sidebar-client-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.cc-sidebar-meta {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ===== Detail-mode sidebar blocks (cc-sidebar-*) =====
   Most cc-sidebar-* classes live in dev/css/dev.css, which is NOT loaded in the
   main SPA shell (index.html) — so the per-client dashboard must style them
   itself. Avatar / section / client-name / meta are overridden above; the
   blocks below cover the section header, Contact Info rows, Social Links and
   the Team list. Without these the label + value spans render glued together
   (e.g. "ContactTest Contact"). */
.cc-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0 12px 6px;
}

/* Contact Info — stacked micro-label above its value, one clean pair per row. */
.cc-sidebar-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px;
}
.cc-sidebar-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cc-sidebar-info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cc-sidebar-info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

/* Social Links */
.cc-sidebar-social-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}
.cc-sidebar-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cc-sidebar-social-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Team list (row layout — cl-team-stack supplies the column flex + gap) */
.cc-sidebar-team-list {
  padding: 0 8px;
}
.cc-sidebar-team-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
}
.cc-sidebar-team-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cc-sidebar-team-info {
  min-width: 0;
}
.cc-sidebar-team-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}
.cc-sidebar-team-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.cl-records-add-form {
  margin-top: 14px;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.012);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
}

/* ===== Timeline ===== */
.cl-timeline-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-timeline-main-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cl-timeline-row {
  display: grid;
  grid-template-columns: 140px 100px 100px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  align-items: baseline;
  transition: background 0.15s ease;
}
.cl-timeline-row:hover { background: rgba(0, 0, 0, 0.025); }
.cl-timeline-time {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cl-timeline-actor {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
}
.cl-timeline-verb {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cl-timeline-summary {
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.45;
}
.cl-timeline-cat-tag {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}

.cl-timeline-block {
  position: relative;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid;
  margin: 6px 0;
}
.cl-timeline-block-label {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-secondary);
}
.cl-timeline-block-content_calendar { background: rgba(245, 166, 35, 0.05); border-color: rgba(245, 166, 35, 0.22); }
.cl-timeline-block-agri4all         { background: rgba(39, 174, 96, 0.05);  border-color: rgba(39, 174, 96, 0.22); }
.cl-timeline-block-online_articles  { background: rgba(52, 152, 219, 0.05); border-color: rgba(52, 152, 219, 0.22); }
.cl-timeline-block-booking_forms    { background: rgba(124, 58, 237, 0.05); border-color: rgba(124, 58, 237, 0.22); }
.cl-timeline-block-financials       { background: rgba(236, 72, 153, 0.05); border-color: rgba(236, 72, 153, 0.22); }
.cl-timeline-block-other            { background: rgba(0, 0, 0, 0.018);     border-color: rgba(0, 0, 0, 0.06); }

.cl-timeline-sub-feeds {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-timeline-sub-details {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.012);
}
.cl-timeline-sub-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.cl-timeline-sub-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===== Forms & Deliverables ===== */
.cl-forms-deliv-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-fd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.cl-fd-header .cl-card-title {
  margin-bottom: 0;
}
/* --- Booking-form chains: checklist -> unsigned -> signed --- */
.cl-fd-chain-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-fd-chain {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
  background: #f8f9fb;
}
.cl-fd-chain-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cl-fd-chain-id {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  font-size: 13px;
}
.cl-fd-chain-dates {
  color: var(--text-secondary);
  font-size: 12px;
}
.cl-fd-chain-status {
  text-transform: capitalize;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.05);
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--text-muted);
}
.cl-fd-chain-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.cl-fd-chain-arrow {
  align-self: center;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

/* Each chain node is its own mini-card. */
.cl-fd-node {
  flex: 1 1 0;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}
.cl-fd-node-signed {
  border-color: rgba(31, 122, 69, 0.3);
}
.cl-fd-node-head {
  min-width: 0;
}
.cl-fd-node-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.cl-fd-node-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}
.cl-fd-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.cl-fd-node-toggle.active {
  background: var(--color-accent-light);
  color: #fff;
  border-color: var(--color-accent-light);
}
.cl-fd-node-preview {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-secondary);
}
.cl-fd-node-frame {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
}
.cl-fd-chain-json {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  font-size: 11px;
  line-height: 1.45;
  background: #f8f9fb;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Portal approvals --- */
.cl-fd-appr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.cl-fd-appr-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: #f8f9fb;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.cl-fd-appr-card:hover {
  border-color: rgba(245, 166, 35, 0.4);
  background: rgba(245, 166, 35, 0.025);
  transform: translateY(-1px);
}
.cl-fd-appr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cl-fd-appr-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.cl-fd-appr-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f5ec;
  color: #1f7a45;
}
.cl-fd-appr-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}
.cl-fd-appr-date {
  font-size: 11px;
  color: var(--text-muted);
}
.cl-fd-appr-hint {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
}

/* Approval modal */
.cl-fd-appr-modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cl-fd-appr-modal-body {
  max-height: 50vh;
  overflow: auto;
}
.cl-fd-appr-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cl-fd-appr-kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 30%) 1fr;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.cl-fd-appr-kv-row:last-child { border-bottom: none; }
.cl-fd-appr-kv-key {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  word-break: break-word;
}
.cl-fd-appr-kv-val {
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== Sidebar — detail mode ===== */
.cl-sidebar-back {
  cursor: pointer;
}
.cl-sidebar-sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 14px 12px;
}

.cl-team-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.cl-team-member-hoverable {
  transition: transform 0.15s ease;
  position: relative;
}
.cl-team-member-hoverable:hover {
  transform: translateY(-1px);
  z-index: 5;
}

.cl-team-tooltip {
  position: fixed;
  background: #1a1a1a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
.cl-team-tooltip-name { font-weight: 700; font-size: 13px; }
.cl-team-tooltip-role { color: #cbd5e1; margin-top: 2px; font-size: 11px; }
.cl-team-tooltip-email { color: #94a3b8; font-size: 11px; margin-top: 2px; }

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  .cl-finances-grid { grid-template-columns: 280px 1fr; }
}
@media (max-width: 1024px) {
  .cl-dashboard-page {
    padding: 20px 22px 24px;
  }
  .cl-dashboard-title { font-size: 22px; }
}
@media (max-width: 768px) {
  .cl-dashboard-page {
    padding: 18px 16px 20px;
    border-radius: 10px;
  }
  .cl-dashboard-title { font-size: 20px; }
  .cl-dashboard-tab { padding: 10px 14px; font-size: 12px; }
  .cl-timeline-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0;
  }
  .cl-fd-chain-track {
    flex-direction: column;
    align-items: stretch;
  }
  .cl-fd-node { min-width: 0; }
  .cl-fd-chain-arrow {
    transform: rotate(90deg);
    align-self: center;
  }
  .cl-field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ===== Field hint + Sentiment tab (ticket #67) ===== */
.cl-field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: -2px 0 6px;
}
/* Sentiment pane: single column (only one card), max readable width. */
.cl-sentiment-pane {
  display: block;
  max-width: 560px;
}
.cl-sentiment-help {
  margin: 0 0 12px;
}
.cl-sentiment-comment {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}
.cl-sentiment-status {
  margin: 6px 0 0;
  font-style: italic;
}

/* ── Files tab ────────────────────────────────────────────── */
.cl-files-pane {
  display: block;
  max-width: 760px;
}
.cl-files-drop {
  margin: 12px 0 10px;
  padding: 26px 16px;
  border: 2px dashed rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cl-files-drop:hover,
.cl-files-drop.dragover {
  border-color: var(--color-primary, #16a34a);
  background: rgba(22, 163, 74, 0.06);
}
.cl-files-drop.busy {
  opacity: 0.6;
  pointer-events: none;
}
.cl-files-drop-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.cl-files-status {
  margin: 0 0 10px;
  min-height: 16px;
  font-style: italic;
}
.cl-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.015);
}
.cl-file-main {
  min-width: 0;
  flex: 1 1 auto;
}
.cl-file-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-file-name:hover {
  text-decoration: underline;
}
.cl-file-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}
.cl-file-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.cl-file-actions .cl-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  text-decoration: none;
}
.cl-file-delete {
  color: #b91c1c;
}

@media (max-width: 640px) {
  .cl-file-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cl-file-actions .cl-action-btn {
    flex: 1 1 0;
    text-align: center;
  }
}

/* ── #134 dark mode overrides ─────────────────────────────── */
/* The surfaces and text tiers are token-driven, so theme.css carries them.
   What is left is a long run of rgba(0,0,0,.0x) films standing in for borders,
   hovers, chip fills and inset wells — invisible over slate — plus a handful of
   pastel status pairs. The films flip to white films of comparable weight; the
   pastel pairs become a translucent tint of the same hue with a light label.
   The .cl-json-viewer rule above already has a dark variant and is left as is. */

/* page shell + cards */
html[data-theme="dark"] .cl-dashboard-page {
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .cl-card,
html[data-theme="dark"] .cl-card-wide,
html[data-theme="dark"] .cl-library-card,
html[data-theme="dark"] .cl-website-history,
html[data-theme="dark"] .cl-website-header-card,
html[data-theme="dark"] .cl-website-card,
html[data-theme="dark"] .cl-products-section {
  border-color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.30);
}

/* action buttons */
html[data-theme="dark"] .cl-action-btn { border-color: #334155; }
html[data-theme="dark"] .cl-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: #475569;
}
html[data-theme="dark"] .cl-action-btn-primary,
html[data-theme="dark"] .cl-ai-btn,
html[data-theme="dark"] .cl-products-add,
html[data-theme="dark"] .cl-website-rescrape,
html[data-theme="dark"] .cl-sbf-toggle.active,
html[data-theme="dark"] .cl-fd-node-toggle.active { color: #0b1220; }

html[data-theme="dark"] .cl-action-btn-warn {
  border-color: rgba(245, 158, 11, 0.38);
  color: #fbbf24;
}
html[data-theme="dark"] .cl-action-btn-warn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.55);
}

html[data-theme="dark"] .cl-action-kebab-menu {
  border-color: #334155;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.60), 0 2px 6px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .cl-action-kebab-item:hover { background: rgba(255, 255, 255, 0.06); }

html[data-theme="dark"] .cl-dashboard-tabs { border-bottom-color: #334155; }

/* signed booking forms panel */
html[data-theme="dark"] .cl-sbf-row {
  border-color: rgba(148, 163, 184, 0.14);
  background: #273449;
}
html[data-theme="dark"] .cl-sbf-pill,
html[data-theme="dark"] .cl-fd-appr-pill {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}
html[data-theme="dark"] .cl-sbf-preview,
html[data-theme="dark"] .cl-fd-node-preview { border-color: #334155; }

/* form fields — the input shares --color-secondary with its card, so it drops
   to the recessed tone to stay readable as a field */
html[data-theme="dark"] .cl-field-input {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme="dark"] .cl-field-input:hover:not(:focus) { border-color: #475569; }
html[data-theme="dark"] .cl-field-input:focus { box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.20); }

/* industry + country chips */
html[data-theme="dark"] .cl-industry-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .cl-industry-pill-x:hover { color: #fca5a5; }
html[data-theme="dark"] .cl-industry-add,
html[data-theme="dark"] .cl-library-chip-add { border-color: #475569; }

html[data-theme="dark"] .cl-chip {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme="dark"] .cl-chip:hover {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.32);
}
html[data-theme="dark"] .cl-chip.active {
  background: rgba(245, 166, 35, 0.20);
  border-color: rgba(245, 166, 35, 0.60);
  color: #f5a623;
}
html[data-theme="dark"] .cl-chip.active:hover { background: rgba(245, 166, 35, 0.28); }

/* locations */
html[data-theme="dark"] .cl-location-card {
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .cl-location-main {
  border-color: rgba(245, 166, 35, 0.38);
  background: rgba(245, 166, 35, 0.10);
}
html[data-theme="dark"] .cl-location-remove:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

/* file history */
html[data-theme="dark"] .cl-file-history-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.12);
}
html[data-theme="dark"] .cl-file-history-item:hover {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

/* library */
html[data-theme="dark"] .cl-library-chip {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme="dark"] .cl-library-chip:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .cl-library-chip.active {
  background: rgba(245, 166, 35, 0.18);
  color: #f5a623;
  border-color: rgba(245, 166, 35, 0.45);
}
html[data-theme="dark"] .cl-library-chip-edit {
  border-color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .cl-library-card:hover {
  border-color: #475569;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .cl-library-thumb,
html[data-theme="dark"] .cl-asset-preview { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .cl-library-dots:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .cl-library-tag-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .cl-library-tag-pill:hover { background: rgba(255, 255, 255, 0.13); }
html[data-theme="dark"] .cl-library-download { border-color: #334155; }
html[data-theme="dark"] .cl-library-download:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #475569;
}

/* modals */
html[data-theme="dark"] .cl-modal-overlay,
html[data-theme="dark"] .cl-product-modal-overlay { background: rgba(0, 0, 0, 0.62); }
html[data-theme="dark"] .cl-modal-overlay-light { background: rgba(0, 0, 0, 0.50); }
html[data-theme="dark"] .cl-modal {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.60), 0 4px 12px rgba(0, 0, 0, 0.40);
}
html[data-theme="dark"] .cl-modal-pick-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.16);
}

/* website pane */
html[data-theme="dark"] .cl-website-history-row:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .cl-website-history-dot { background: rgba(255, 255, 255, 0.28); }
html[data-theme="dark"] .cl-website-snapshot-banner {
  background: rgba(245, 166, 35, 0.14);
  border-color: rgba(245, 166, 35, 0.38);
  color: #fcd34d;
}
html[data-theme="dark"] .cl-website-status { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .cl-website-status.is-scraped { background: rgba(39, 174, 96, 0.18); color: #6ee7a8; }
html[data-theme="dark"] .cl-website-status.is-scraping { background: rgba(245, 166, 35, 0.18); color: #f5a623; }
html[data-theme="dark"] .cl-website-status.is-incomplete { background: rgba(234, 179, 8, 0.18); color: #fcd34d; }
html[data-theme="dark"] .cl-website-status.is-failed { background: rgba(231, 76, 60, 0.18); color: #fca5a5; }

html[data-theme="dark"] .cl-website-error,
html[data-theme="dark"] .cl-website-failure {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
  color: #fca5a5;
}
html[data-theme="dark"] .cl-website-about-hr { border-top-color: rgba(148, 163, 184, 0.14); }

html[data-theme="dark"] .cl-website-product-card,
html[data-theme="dark"] .cl-website-branch,
html[data-theme="dark"] .cl-website-contact-card,
html[data-theme="dark"] .cl-records-add-form,
html[data-theme="dark"] .cl-timeline-sub-details {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(148, 163, 184, 0.14);
}
html[data-theme="dark"] .cl-website-product-warn {
  background: rgba(245, 166, 35, 0.18);
  border-color: rgba(245, 166, 35, 0.45);
}
html[data-theme="dark"] .cl-website-product-warn-text { color: #f5a623; }

/* manual product manager */
html[data-theme="dark"] .cl-product-img-placeholder {
  border-color: #475569;
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .cl-product-btn {
  border-color: #334155;
  background: rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .cl-product-btn:hover { background: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .cl-product-btn-danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.38);
}
html[data-theme="dark"] .cl-product-btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
html[data-theme="dark"] .cl-product-modal { box-shadow: 0 18px 48px rgba(0, 0, 0, 0.60); }
html[data-theme="dark"] .cl-product-field-input {
  border-color: #334155;
  background: #0f172a;
}
html[data-theme="dark"] .cl-product-modal-err { color: #fca5a5; }

/* finances */
html[data-theme="dark"] .cl-records-bulk-bar {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.34);
}
html[data-theme="dark"] .cl-records-table th,
html[data-theme="dark"] .cl-records-table td { border-bottom-color: rgba(148, 163, 184, 0.12); }
html[data-theme="dark"] .cl-records-table th { border-bottom-color: rgba(148, 163, 184, 0.18); }
html[data-theme="dark"] .cl-records-status,
html[data-theme="dark"] .cl-records-status-draft { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .cl-records-status-paid { background: rgba(39, 174, 96, 0.18); color: #6ee7a8; }
html[data-theme="dark"] .cl-records-status-sent { background: rgba(52, 152, 219, 0.18); color: #93c5fd; }
html[data-theme="dark"] .cl-records-status-overdue { background: rgba(231, 76, 60, 0.18); color: #fca5a5; }
html[data-theme="dark"] .cl-row-overdue { background: rgba(239, 68, 68, 0.10); }

/* detail-mode sidebar blocks */
html[data-theme="dark"] .cc-sidebar-avatar {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
html[data-theme="dark"] .cc-sidebar-social-link:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .cl-sidebar-sep { background: rgba(148, 163, 184, 0.14); }

/* timeline */
html[data-theme="dark"] .cl-timeline-row:hover { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .cl-timeline-cat-tag,
html[data-theme="dark"] .cl-fd-chain-status { background: rgba(255, 255, 255, 0.08); }
/* The label chip sat on a near-white wash; on dark it has to darken, not lighten,
   or it burns a hole through the block it labels. */
html[data-theme="dark"] .cl-timeline-block-label { background: rgba(15, 23, 42, 0.70); }
/* The 5% hue washes vanish against slate, so each block roughly doubles. */
html[data-theme="dark"] .cl-timeline-block-content_calendar { background: rgba(245, 166, 35, 0.12); border-color: rgba(245, 166, 35, 0.30); }
html[data-theme="dark"] .cl-timeline-block-agri4all { background: rgba(39, 174, 96, 0.12); border-color: rgba(39, 174, 96, 0.30); }
html[data-theme="dark"] .cl-timeline-block-online_articles { background: rgba(52, 152, 219, 0.12); border-color: rgba(52, 152, 219, 0.30); }
html[data-theme="dark"] .cl-timeline-block-booking_forms { background: rgba(124, 58, 237, 0.14); border-color: rgba(124, 58, 237, 0.32); }
html[data-theme="dark"] .cl-timeline-block-financials { background: rgba(236, 72, 153, 0.12); border-color: rgba(236, 72, 153, 0.30); }
html[data-theme="dark"] .cl-timeline-block-other { background: rgba(255, 255, 255, 0.04); border-color: rgba(148, 163, 184, 0.14); }

/* forms + deliverables */
/* The chain is a container well and its nodes are cards, so the well recesses
   to the page tone and the nodes keep the raised surface. */
html[data-theme="dark"] .cl-fd-chain {
  border-color: rgba(148, 163, 184, 0.14);
  background: #0f172a;
}
html[data-theme="dark"] .cl-fd-node { border-color: #334155; }
html[data-theme="dark"] .cl-fd-node-signed { border-color: rgba(74, 222, 128, 0.34); }
html[data-theme="dark"] .cl-fd-chain-json { background: #0f172a; }
html[data-theme="dark"] .cl-fd-appr-card {
  background: #273449;
  border-color: #334155;
}
html[data-theme="dark"] .cl-fd-appr-card:hover {
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.10);
}
html[data-theme="dark"] .cl-fd-appr-kv-row { border-bottom-color: rgba(148, 163, 184, 0.12); }

/* The team tooltip was near-black on a light page; on dark it has to be lighter
   than the surface it floats over. */
html[data-theme="dark"] .cl-team-tooltip {
  background: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) {
  html[data-theme="dark"] .cl-timeline-row { border-bottom-color: rgba(148, 163, 184, 0.12); }
}

/* Files tab */
html[data-theme="dark"] .cl-files-drop {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .cl-files-drop:hover,
html[data-theme="dark"] .cl-files-drop.dragover {
  background: rgba(22, 163, 74, 0.12);
}
html[data-theme="dark"] .cl-file-row {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .cl-file-delete {
  color: #f87171;
}
