.crm-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.crm-shell__hero {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

.crm-entity-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 45%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.crm-entity-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, 0.9) 0 8px, transparent 9px),
    radial-gradient(circle at 82% 28%, rgba(255, 255, 255, 0.35) 0 18px, transparent 19px),
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.22) 0 28px, transparent 29px);
  opacity: 0.8;
}

.crm-entity-hero > * {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.crm-entity-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 24px rgba(15, 23, 42, 0.12);
}

.crm-entity-hero__icon svg {
  width: 38px;
  height: 38px;
  display: block;
}

.crm-entity-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.crm-entity-hero__eyebrow {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
}

.crm-entity-hero__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.crm-entity-hero__title-row h1,
.crm-entity-hero__title-row h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.crm-entity-hero__subtitle {
  margin: 0;
  color: #475569;
  font-size: 0.98rem;
  line-height: 1.5;
}

.crm-entity-hero__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.crm-entity-hero__badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.crm-entity-hero--lead {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 42%, rgba(248, 250, 252, 0.98) 100%);
}

.crm-entity-hero--lead .crm-entity-hero__icon {
  background: linear-gradient(180deg, #4f86ff 0%, #2563eb 100%);
}

.crm-entity-hero--lead .crm-entity-hero__eyebrow {
  color: #2563eb;
}

.crm-entity-hero--lead .crm-entity-hero__badge {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.crm-entity-hero--job {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98) 0%, rgba(255, 255, 255, 0.98) 42%, rgba(248, 250, 252, 0.98) 100%);
}

.crm-entity-hero--job .crm-entity-hero__icon {
  background: linear-gradient(180deg, #68c26a 0%, #16a34a 100%);
}

.crm-entity-hero--job .crm-entity-hero__eyebrow {
  color: #15803d;
}

.crm-entity-hero--job .crm-entity-hero__badge {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.crm-entity-hero--project {
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.99) 0%, rgba(255, 255, 255, 0.98) 42%, rgba(255, 251, 235, 0.95) 100%);
}

.crm-entity-hero--project .crm-entity-hero__icon {
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
  color: #713f12;
}

.crm-entity-hero--project .crm-entity-hero__eyebrow {
  color: #b45309;
}

.crm-entity-hero--project .crm-entity-hero__badge {
  background: rgba(250, 204, 21, 0.18);
  color: #92400e;
}

.crm-entity-hero--project .crm-entity-hero__title-row h1,
.crm-entity-hero--project .crm-entity-hero__title-row h2 {
  color: #3f2d0d;
}

.crm-entity-hero--job .crm-entity-hero__title-row h1,
.crm-entity-hero--job .crm-entity-hero__title-row h2 {
  color: #0f172a;
}

.crm-entity-hero--job .crm-entity-hero__subtitle {
  color: #475569;
}

.crm-shell__hero > *,
.crm-shell__status {
  min-width: 0;
}

.crm-shell__hero-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-shell__eyebrow {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.crm-shell__hero-copy h1,
.crm-shell__hero-copy h2 {
  margin: 0;
}

.crm-shell__hero-copy p,
.crm-shell__detail,
.crm-shell__action-list {
  margin: 0;
  color: var(--fg-muted);
}

.crm-shell__status {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(226, 232, 240, 0.92) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.crm-shell__status-label {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crm-shell__status-label[data-state="ready"] {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.crm-shell__status-label[data-state="pending"] {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.crm-shell__message {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.crm-shell__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.crm-stat-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.crm-stat-card__label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.crm-stat-card__value {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}

.crm-shell__table-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crm-shell__table-card h2 {
  margin: 0;
}

.crm-shell__empty {
  margin: 0;
  color: var(--fg-muted);
}

.crm-shell__action-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-shell__placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.crm-shell__placeholder-grid .card h2 {
  margin-top: 0;
}

@media (max-width: 900px) {
  .crm-shell__hero {
    grid-template-columns: 1fr;
  }

  .crm-entity-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crm-entity-hero__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .crm-entity-hero {
    grid-template-columns: 1fr;
  }

  .crm-entity-hero__icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
}
