/* ==========================================================
 * 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;
}

.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;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.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: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.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: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  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);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cl-chip:hover {
  background: rgba(0, 0, 0, 0.03);
}
.cl-chip.active {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.4);
  color: var(--color-accent-dark);
}

/* ===== 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-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);
}

/* 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;
}
.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;
}
.cl-fd-bf-list,
.cl-fd-d-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cl-fd-bf-row {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.012);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cl-fd-bf-row[open] {
  border-color: rgba(245, 166, 35, 0.3);
  background: rgba(245, 166, 35, 0.025);
}
.cl-fd-bf-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  flex-wrap: wrap;
}
.cl-fd-bf-summary::-webkit-details-marker { display: none; }
.cl-fd-bf-summary::before {
  content: '\25B8';
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--text-muted);
  font-size: 10px;
}
.cl-fd-bf-row[open] .cl-fd-bf-summary::before {
  transform: rotate(90deg);
  color: var(--color-accent-light);
}
.cl-fd-bf-id {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.cl-fd-bf-dates {
  color: var(--text-secondary);
  font-size: 12px;
}
.cl-fd-bf-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-bf-actions {
  margin-left: auto;
}
.cl-fd-bf-inner {
  margin-top: 12px;
  padding-top: 12px;
  padding-left: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 2px solid rgba(245, 166, 35, 0.32);
  margin-left: 4px;
}

.cl-fd-d-row {
  display: grid;
  grid-template-columns: 1fr 100px 130px 80px 100px;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 6px;
  font-size: 13px;
  align-items: baseline;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease;
}
.cl-fd-d-row:last-child { border-bottom: none; }
.cl-fd-d-row:hover { background: rgba(0, 0, 0, 0.025); }
.cl-fd-d-title {
  font-weight: 600;
  word-break: break-word;
  color: var(--text-primary);
}
.cl-fd-d-type, .cl-fd-d-bf, .cl-fd-d-status, .cl-fd-d-updated {
  font-size: 12px;
  color: var(--text-muted);
}
.cl-fd-d-status {
  text-transform: capitalize;
}

.cl-fd-filters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cl-fd-chip-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cl-fd-chip-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.cl-fd-chip {
  background: var(--color-secondary);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cl-fd-chip:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}
.cl-fd-chip.active {
  background: rgba(245, 166, 35, 0.12);
  color: var(--color-accent-dark);
  border-color: rgba(245, 166, 35, 0.4);
}

/* ===== 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; }
  .cl-fd-d-row {
    grid-template-columns: 1fr 100px 100px 100px;
  }
  .cl-fd-d-bf { display: none; }
}
@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-d-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .cl-field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
