.crm-surface-card,
.crm-panel {
  border: 1px solid var(--stroke, #e2e8f0);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-soft, 0 18px 45px rgba(15, 23, 42, 0.08));
}

.crm-kpi-label {
  color: var(--muted, #64748b);
  font-size: 13px;
}

.crm-kpi-value {
  color: var(--ink, #0f172a);
  font-size: 24px;
  font-weight: 800;
}

.company-workspace-page {
  display: grid;
  gap: 20px;
}

.company-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.company-metric-card,
.company-card {
  border: 1px solid var(--border-main, #e2e8f0);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-soft-main, 0 18px 45px rgba(15, 23, 42, 0.08));
}

.company-metric-card {
  min-height: 108px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.company-metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
}

.company-metric-icon--violet { background: linear-gradient(135deg, #8b5cf6, #a855f7); }
.company-metric-icon--blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.company-metric-icon--green { background: linear-gradient(135deg, #22c55e, #4ade80); }
.company-metric-icon--orange { background: linear-gradient(135deg, #fb923c, #f97316); }

.company-metric-copy {
  display: grid;
  gap: 4px;
}

.company-metric-copy span {
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-weight: 700;
}

.company-metric-copy strong {
  font-size: 19px;
  line-height: 1.1;
}

.company-metric-copy small {
  font-size: 12px;
  font-weight: 700;
}

.company-metric-copy .trend-up { color: #16a34a; }
.company-metric-copy .trend-down { color: #dc2626; }

.company-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.company-main-column,
.company-side-column {
  display: grid;
  gap: 18px;
}

.company-card {
  padding: 18px 20px;
}

/* .company-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
} */

.company-card-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* .company-card-header a {
  color: var(--brand-primary, #2563eb);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
} */

.company-view-switcher,
.company-table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.company-toolbar-button--compact {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
}

.company-stage-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.company-stage-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 124px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.company-stage-card strong {
  font-size: 13px;
  color: var(--text-main, #0f172a);
}

.company-stage-count {
  font-size: 24px;
  font-weight: 800;
}

.company-stage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-main, #0f172a);
  font-size: 12px;
  font-weight: 700;
}

.company-stage-meta small {
  color: var(--text-muted, #64748b);
}

.company-stage-progress {
  display: block;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: auto;
}

.company-stage-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.company-stage-progress-bar--blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.company-stage-progress-bar--sky { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.company-stage-progress-bar--violet { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.company-stage-progress-bar--orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.company-stage-progress-bar--amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.company-stage-progress-bar--green { background: linear-gradient(135deg, #4ade80, #16a34a); }

.company-table-header {
  margin-bottom: 12px;
}

.company-table-search {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 320px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-main, #e2e8f0);
  border-radius: 14px;
}

.company-table-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.company-table-shell {
  overflow-x: auto;
}

.company-table {
  width: 100%;
  border-collapse: collapse;
}

.company-table th {
  padding: 12px 10px;
  text-align: left;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  font-weight: 800;
  border-bottom: 1px solid var(--border-main, #e2e8f0);
}

.company-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 13px;
  vertical-align: middle;
}

.company-name-cell,
.company-contact-cell,
.company-action-cell,
.company-activity-row,
.company-alert-row,
.company-task-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-mini-avatar,
.company-contact-avatar,
.company-activity-avatar,
.company-alert-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.company-mini-avatar {
  background: linear-gradient(135deg, var(--brand-primary, #2563eb), #4f46e5);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.company-contact-avatar {
  border-radius: 999px;
  background: linear-gradient(135deg, #93c5fd, #c4b5fd);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.company-contact-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-contact-cell strong,
.company-name-cell strong {
  display: block;
  color: var(--text-main, #0f172a);
}

.company-contact-cell small {
  display: block;
  color: var(--text-muted, #64748b);
}

.company-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
}

.company-status-pill.status-blue { background: #dbeafe; color: #2563eb; }
.company-status-pill.status-sky { background: #e0f2fe; color: #0284c7; }
.company-status-pill.status-violet { background: #ede9fe; color: #7c3aed; }
.company-status-pill.status-orange { background: #ffedd5; color: #ea580c; }
.company-status-pill.status-amber { background: #fef3c7; color: #d97706; }
.company-status-pill.status-green { background: #dcfce7; color: #16a34a; }

.company-score-ring {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #22c55e;
  color: #16a34a;
  font-weight: 800;
  font-size: 12px;
}

.company-score-ring.is-risk {
  border-color: #ef4444;
  color: #dc2626;
}

.company-score-ring.is-strong {
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.08);
}

.company-open-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
}

.company-table-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.company-table-footer span {
  color: var(--text-muted, #64748b);
  font-size: 13px;
}

.company-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-pagination-current {
  background: linear-gradient(135deg, var(--brand-primary, #2563eb), #1d4ed8);
  color: #fff;
  border-color: transparent;
}

.company-assistant-card,
.company-activity-card,
.company-tasks-card {
  display: grid;
  gap: 14px;
}

.company-alert-list,
.company-activity-list,
.company-task-list {
  display: grid;
  gap: 12px;
}

.company-alert-row,
.company-activity-row,
.company-task-row {
  align-items: flex-start;
}

.company-alert-row strong,
.company-activity-row strong,
.company-task-row strong {
  flex: 1;
  font-size: 13px;
  color: var(--text-main, #0f172a);
}

.company-alert-row a {
  color: var(--brand-primary, #2563eb);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.company-alert-icon {
  background: rgba(59, 130, 246, 0.08);
  color: var(--brand-primary, #2563eb);
}

.company-assistant-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(59, 130, 246, 0.1));
  color: #6d28d9;
  font-weight: 800;
  text-decoration: none;
}

.company-activity-avatar {
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-primary, #2563eb);
}

.company-activity-row div,
.company-task-row div {
  display: grid;
  gap: 4px;
}

.company-activity-row small,
.company-task-row small {
  color: var(--text-muted, #64748b);
  font-size: 11px;
}

.company-activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.company-task-row input {
  margin-top: 4px;
}

@media (max-width: 1480px) {
  .company-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-stage-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .company-content-grid {
    display: grid;
  }

  .company-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .company-summary-grid,
  .company-stage-row {
    grid-template-columns: 1fr;
  }

  .company-card-header,
  .company-table-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
