/* ════════════ CLIENTS PANEL ════════════ */

/* ── Page header ── */
.clients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Stats row ── */
.clients-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.clients-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.clients-stat__value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.clients-stat__label {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Filter/search bar ── */
.clients-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.clients-search {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: .88rem;
  outline: none;
}
.clients-search:focus { border-color: #6366f1; }
.clients-filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: .82rem;
  cursor: pointer;
}

/* ── Client cards grid ── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ── Client card ── */
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.client-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 20px rgba(99,102,241,.12);
}
.client-card__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.client-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.client-card__info { flex: 1; min-width: 0; }
.client-card__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-card__company {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}
.client-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.client-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
}
.client-badge--lead       { background: #6366f120; color: #6366f1; }
.client-badge--active     { background: #22c55e20; color: #22c55e; }
.client-badge--proposal   { background: #f59e0b20; color: #f59e0b; }
.client-badge--completed  { background: #94a3b820; color: #94a3b8; }
.client-badge--on_hold    { background: #ef444420; color: #ef4444; }
.client-card__summary {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.client-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--muted);
}
.client-card__drive {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #22c55e;
  font-weight: 600;
  text-decoration: none;
  font-size: .75rem;
}
.client-card__drive:hover { text-decoration: underline; }

/* ── Detail Modal ── */
.client-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
  overflow-y: auto;
}
.client-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.client-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.client-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.client-modal__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ── Form ── */
.client-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.client-form-grid--full { grid-column: 1 / -1; }
.client-field { display: flex; flex-direction: column; gap: 5px; }
.client-label { font-size: .8rem; font-weight: 600; color: var(--text); }
.client-input, .client-select, .client-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .88rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.client-input:focus, .client-select:focus, .client-textarea:focus {
  border-color: #6366f1;
}
.client-textarea { resize: vertical; min-height: 80px; }

/* Section divider inside form */
.client-form-section {
  font-size: .78rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Detail view (read mode) ── */
.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.client-detail-item {}
.client-detail-label {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.client-detail-value {
  font-size: .88rem;
  color: var(--text);
  word-break: break-word;
}
.client-detail-full { grid-column: 1 / -1; }

/* Drive folder link */
.client-drive-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #22c55e15;
  border: 1px solid #22c55e40;
  border-radius: 8px;
  color: #22c55e;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.client-drive-link:hover { background: #22c55e25; }

/* ── Consultant-style section headers ── */
.cf-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 6px;
}
.cf-section-num {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.cf-section-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.3;
}
.cf-section-sub {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Required asterisk */
.cf-req { color: #ef4444; margin-left: 2px; }

/* Hint text next to label */
.cf-hint { font-weight: 400; color: var(--muted); font-size: .75rem; }

/* Tip below a field */
.cf-field-tip {
  font-size: .72rem;
  color: #6366f1;
  margin-top: 3px;
  display: block;
}

/* ── Empty state ── */
.clients-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.clients-empty__icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Priority dot ── */
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.priority-dot--high   { background: #ef4444; }
.priority-dot--medium { background: #f59e0b; }
.priority-dot--low    { background: #22c55e; }

/* ── Tab switcher (List / Kanban view) ── */
.clients-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
}
.clients-view-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.clients-view-tab--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

@media (max-width: 600px) {
  .clients-grid { grid-template-columns: 1fr; }
  .client-form-grid { grid-template-columns: 1fr; }
  .client-detail-grid { grid-template-columns: 1fr; }
  .client-modal__body { padding: 16px; }
}
