.crm-shell {
  max-width: 1720px;
  margin: 0 auto;
}

.crm-pagehead,
.crm-grid,
.crm-layout,
.crm-two-col,
.crm-filter,
.crm-case-top,
.crm-section-title,
.crm-head-actions,
.crm-ops-panel,
.crm-workspace-nav,
.crm-local-nav,
.crm-board,
.crm-board-items,
.crm-sync-grid,
.crm-source-list {
  display: grid;
  gap: 16px;
}

.crm-pagehead {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin: 0 0 14px;
  padding: 22px 24px;
  border: 1px solid #ddcfb7;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .98), rgba(247, 237, 220, .88)),
    #fffdf8;
  box-shadow: 0 18px 48px rgba(44, 35, 23, .08);
}

.crm-eyebrow {
  margin: 0 0 6px;
  color: #8a6729;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.crm-pagehead h1,
.crm-section-title h2 {
  margin: 0;
  color: #20232a;
}

.crm-head-actions {
  grid-auto-flow: column;
  align-items: center;
}

.crm-workspace-nav,
.crm-local-nav {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  overflow-x: auto;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fffdf8;
}

.crm-workspace-nav a,
.crm-local-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid #ddcfb7;
  border-radius: 8px;
  color: #20232a !important;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  background: #fffefa;
}

.crm-local-nav {
  margin-top: -4px;
}

.crm-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.crm-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  margin-top: 18px;
}

.crm-layout.wide {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.crm-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.crm-panel,
.crm-stat,
.crm-case-card {
  border: 1px solid #ddcfb7;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 14px 38px rgba(44, 35, 23, .08);
}

.crm-panel {
  padding: 18px;
}

.crm-stat {
  padding: 18px;
}

.crm-ops-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
  background:
    linear-gradient(135deg, #20232a, #2b2925 62%, #33281b),
    #20232a;
}

.crm-ops-copy h2 {
  margin: 0;
  color: #fffdf8;
  font-size: 30px;
  line-height: 1.12;
}

.crm-ops-copy p:not(.crm-eyebrow) {
  max-width: 840px;
  margin: 10px 0 0;
  color: rgba(255, 253, 248, .74);
  font-size: 15px;
  line-height: 1.55;
}

.crm-ops-panel .crm-eyebrow {
  color: #d8ad58;
}

.crm-ops-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.crm-stat span,
.crm-stat em,
.crm-section-title span,
.crm-muted,
.crm-facts dt,
.crm-card-meta,
.crm-case-card p,
.crm-table span,
.crm-client-row span,
.crm-timeline-row span,
.crm-note span,
.crm-event span,
.crm-access-row span,
.crm-access-row small {
  color: #6b6258;
}

.crm-stat span,
.crm-facts dt {
  display: block;
  margin-bottom: 6px;
  color: #8a6729;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.crm-stat strong {
  display: block;
  color: #20232a;
  font-size: 26px;
  line-height: 1.12;
}

.lead-summary .crm-stat strong {
  font-size: 19px;
}

.crm-stat em {
  display: block;
  margin-top: 8px;
  font-style: normal;
}

.crm-filter {
  grid-template-columns: minmax(260px, 1fr) 180px 190px 170px auto;
  align-items: end;
}

.crm-filter label,
.crm-form p {
  margin: 0;
}

.crm-filter span,
.crm-form label {
  display: block;
  margin-bottom: 6px;
  color: #4d5660;
  font-weight: 700;
}

.crm-input,
.crm-form input[type="text"],
.crm-form input[type="email"],
.crm-form input[type="datetime-local"],
.crm-form input[type="file"],
.crm-form select,
.crm-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d9c8ad;
  border-radius: 6px;
  background: #fffefa;
  color: #20232a;
  font: inherit;
}

.crm-form textarea {
  min-height: 86px;
}

.crm-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: #bd8e38;
}

.crm-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #bd8e38;
  border-radius: 6px;
  background: #fffdf8;
  color: #20232a !important;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
}

.crm-button.primary {
  background: linear-gradient(180deg, #c89a42, #ad7d2d);
  color: #fffdf8 !important;
}

.crm-button.ghost {
  border-color: #ddcfb7;
}

.crm-board-panel {
  margin-bottom: 18px;
}

.crm-board {
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  overflow-x: auto;
  padding-bottom: 2px;
}

.crm-board-column {
  min-width: 220px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 10px;
  background: #fbf7ef;
}

.crm-board-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.crm-board-column header span {
  color: #20232a;
  font-weight: 800;
}

.crm-board-column header strong {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f1e2c8;
  color: #7b5621;
}

.crm-board-items {
  gap: 10px;
}

.crm-board-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 9px;
  background: #fffefa;
  color: #20232a !important;
  text-decoration: none !important;
}

.crm-board-card span,
.crm-board-card small {
  color: #6b6258;
}

.crm-case-list,
.crm-client-list,
.crm-timeline,
.crm-note-list,
.crm-event-list,
.crm-access-list {
  display: grid;
  gap: 12px;
}

.crm-case-card {
  padding: 16px;
}

.crm-case-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.crm-case-title {
  color: #245b78 !important;
  font-size: 18px;
  font-weight: 700;
}

.crm-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #f5ead8;
  color: #7b5621;
  font-weight: 700;
}

.crm-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}

.crm-facts dd {
  margin: 0;
  color: #20232a;
}

.crm-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.crm-side {
  display: grid;
  gap: 18px;
}

.crm-section-title {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.crm-section-title.offset {
  margin-top: 28px;
}

.crm-client-row,
.crm-timeline-row,
.crm-access-row,
.crm-note,
.crm-event,
.crm-source-list a,
.crm-source-list article {
  display: block;
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffefa;
  text-decoration: none !important;
}

.crm-client-row strong,
.crm-timeline-row strong,
.crm-access-row strong,
.crm-event strong,
.crm-source-list strong {
  display: block;
  color: #20232a;
}

.crm-source-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.crm-source-list span {
  display: block;
  margin-top: 4px;
  color: #6b6258;
  line-height: 1.45;
}

.crm-court-panel {
  margin-top: 18px;
}

.crm-sync-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.crm-sync-grid div {
  padding: 14px;
  border: 1px solid #eadfce;
  border-radius: 9px;
  background: #fbf7ef;
}

.crm-sync-grid span {
  display: block;
  margin-bottom: 6px;
  color: #8a6729;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.crm-sync-grid strong {
  display: block;
  color: #20232a;
  line-height: 1.25;
}

.crm-table-wrap {
  overflow-x: auto;
}

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

.crm-table th,
.crm-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #eadfce;
  vertical-align: top;
}

.crm-table th {
  color: #4d5660;
  text-align: left;
}

.crm-file-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.crm-file-icon {
  width: 38px;
  height: 42px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9c8ad;
  border-radius: 8px;
  background: #f5ead8;
  color: #7b5621 !important;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}

.crm-link {
  color: #245b78 !important;
  font-weight: 700;
}

.crm-form,
.compact-form {
  display: grid;
  gap: 12px;
}

.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form p:nth-child(4),
.grid-form p:nth-child(11),
.grid-form .crm-button {
  grid-column: 1 / -1;
}

.compact-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eadfce;
}

.crm-empty {
  padding: 18px;
  border: 1px dashed #ddcfb7;
  border-radius: 8px;
  color: #6b6258;
  background: #fffefa;
}

.crm-empty.compact {
  padding: 12px;
}

.crm-note.important {
  border-color: #c89a42;
  background: #fff6e4;
}

.crm-note p,
.crm-event p {
  margin: 0 0 8px;
}

@media (max-width: 1200px) {
  .crm-layout,
  .crm-layout.wide,
  .crm-pagehead,
  .crm-ops-panel,
  .crm-filter {
    grid-template-columns: 1fr;
  }

  .crm-grid,
  .crm-facts,
  .crm-two-col,
  .crm-sync-grid,
  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-ops-actions {
    justify-content: start;
  }
}

@media (max-width: 700px) {
  .crm-grid,
  .crm-facts,
  .crm-two-col,
  .crm-sync-grid,
  .grid-form,
  .crm-case-top {
    grid-template-columns: 1fr;
  }

  .crm-head-actions {
    grid-auto-flow: row;
  }

  .crm-pagehead,
  .crm-ops-panel,
  .crm-panel {
    padding: 16px;
  }

  .crm-ops-copy h2 {
    font-size: 23px;
  }
}
