:root {
  --crm-bg: #f5f7fa;
  --crm-panel: #ffffff;
  --crm-border: #dfe5ec;
  --crm-text: #17202a;
  --crm-muted: #657386;
  --crm-primary: #1f5f74;
  --crm-primary-dark: #16495a;
  --crm-accent: #b48942;
  --crm-sidebar: #102733;
  --crm-danger: #a33a3a;
  --crm-success: #236b4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--crm-bg);
  color: var(--crm-text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--crm-primary);
  text-decoration: none;
}

.crm-icon {
  display: block;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.crm-phone-display {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
}

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

.crm-whatsapp-link {
  align-items: center;
  background: #25d366;
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  width: 32px;
}

.crm-whatsapp-link:hover {
  background: #128c4a;
  color: #ffffff;
  transform: translateY(-1px);
}

.crm-whatsapp-link .crm-icon {
  height: 18px;
  width: 18px;
}

input,
select,
textarea,
button {
  font: inherit;
}

.crm-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.crm-sidebar {
  background: var(--crm-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.crm-brand {
  align-items: center;
  display: flex;
  gap: 10px;
  color: #ffffff;
  padding: 8px 10px 28px;
}

.crm-brand-mark {
  border-radius: 6px;
  flex: 0 0 42px;
  height: 42px;
  width: 42px;
}

.crm-brand-logo {
  display: block;
  flex: 0 0 auto;
  height: 74px;
  max-width: 244px;
  object-fit: contain;
  width: 244px;
}

.crm-brand-mark {
  align-items: center;
  background: var(--crm-accent);
  color: #ffffff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
}

.crm-brand-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.crm-brand strong {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.crm-brand small {
  color: #b9c8d2;
  font-size: 12px;
  text-transform: uppercase;
}

.crm-footer {
  align-items: center;
  background: #0A1120;
  border-top: 1px solid rgba(0, 184, 245, 0.28);
  color: #d7e3ea;
  display: flex;
  font-size: 16px;
  font-weight: 700;
  gap: 6px;
  padding: 12px 28px;
  position: fixed;
  bottom: 0;
  left: 280px;
  right: 0;
  z-index: 100;
}

.crm-footer img {
  display: block;
  height: 28px;
  margin-right: 4px;
  object-fit: contain;
  width: 39px;
}

.crm-footer a {
  color: #00B8F5;
  font-weight: 700;
}

.crm-nav {
  display: grid;
  gap: 6px;
}

.crm-nav a {
  border-radius: 6px;
  color: #d7e3ea;
  padding: 11px 12px;
}

.crm-nav a:hover,
.crm-nav a.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.crm-sidebar-hub {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: #ffffff;
  display: block;
  margin-top: auto;
  padding: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.crm-sidebar-hub:hover {
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.crm-sidebar-hub em {
  background: #ffffff;
  border-radius: 6px;
  display: block;
  padding: 8px;
}

.crm-sidebar-hub img {
  display: block;
  height: auto;
  width: 100%;
}

.crm-main {
  min-width: 0;
  padding-bottom: 53px;
}

.crm-topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  justify-content: space-between;
  min-height: 86px;
  padding: 18px 28px;
}

.crm-topbar p,
.crm-kicker {
  color: var(--crm-muted);
  font-size: 13px;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.crm-topbar h1,
.crm-auth-card h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}

.crm-user {
  align-items: center;
  display: flex;
  gap: 14px;
}

.crm-user-profile {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 8px 10px;
}

.crm-user-profile strong {
  color: var(--crm-text);
  font-size: 14px;
}

.crm-user span,
.crm-user-profile span {
  color: var(--crm-muted);
  font-size: 13px;
}

.crm-content {
  padding: 28px;
}

.crm-stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 22px;
}

.crm-stats article,
.crm-panel {
  background: var(--crm-panel);
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 39, 51, 0.06);
}

.crm-stats article {
  padding: 20px;
}

.crm-stats span {
  color: var(--crm-muted);
  display: block;
  margin-bottom: 8px;
}

.crm-stats strong {
  font-size: 34px;
}

.crm-grid-two {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
}

.crm-grid-three {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.crm-section-gap {
  margin-top: 20px;
}

.crm-panel {
  min-width: 0;
  padding: 20px;
}

.crm-narrow-panel {
  max-width: 620px;
}

.crm-panel h2,
.crm-task-list h3 {
  margin: 0;
}

.crm-task-list h3 a {
  color: var(--crm-text);
}

.crm-export-list article h3 {
  margin: 0 0 6px;
}

.crm-export-list article p {
  margin: 0;
}

.crm-panel-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

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

.crm-table th,
.crm-table td {
  border-bottom: 1px solid var(--crm-border);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

.crm-compact-table th,
.crm-compact-table td {
  padding: 10px 8px;
}

.crm-table th {
  color: var(--crm-muted);
  font-size: 13px;
  font-weight: 700;
}

.crm-pill {
  background: #eaf3f6;
  border-radius: 999px;
  color: var(--crm-primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.crm-pill-warning {
  background: #fff4df;
  color: #7a5520;
}

.crm-list {
  display: grid;
  gap: 10px;
}

.crm-list a,
.crm-list > div,
.crm-task-list article,
.crm-notes article {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  padding: 13px;
}

.crm-list a,
.crm-task-list article {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.crm-list small,
.crm-notes small,
.crm-task-list p {
  color: var(--crm-muted);
}

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

.crm-detail-list {
  display: grid;
  gap: 12px;
}

.crm-detail-list div {
  border-bottom: 1px solid var(--crm-border);
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
}

.crm-detail-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.crm-detail-list span {
  color: var(--crm-muted);
  font-size: 13px;
}

.crm-profile-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.crm-profile-main,
.crm-profile-side {
  display: grid;
  gap: 20px;
  align-content: start;
}

.crm-profile-hero {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 76px minmax(0, 1fr) auto;
}

.crm-profile-avatar {
  align-items: center;
  background: var(--crm-primary);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  font-size: 24px;
  font-weight: 700;
  height: 76px;
  justify-content: center;
  width: 76px;
}

.crm-profile-title {
  min-width: 0;
}

.crm-profile-title h2 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.crm-profile-title span {
  color: var(--crm-muted);
}

.crm-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.crm-profile-fields {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-profile-fields div,
.crm-security-list div {
  border-top: 1px solid var(--crm-border);
  display: grid;
  gap: 5px;
  padding: 15px 0;
}

.crm-profile-fields div:nth-child(1),
.crm-profile-fields div:nth-child(2),
.crm-security-list div:first-child {
  border-top: 0;
}

.crm-profile-fields div:nth-child(odd) {
  padding-right: 18px;
}

.crm-profile-fields div:nth-child(even) {
  border-left: 1px solid var(--crm-border);
  padding-left: 18px;
}

.crm-profile-fields span,
.crm-security-list span {
  color: var(--crm-muted);
  font-size: 13px;
}

.crm-profile-fields strong,
.crm-security-list strong {
  overflow-wrap: anywhere;
}

.crm-profile-access-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.crm-profile-access-list span {
  background: #f7fafc;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  color: var(--crm-text);
  font-weight: 700;
  min-height: 72px;
  padding: 14px;
}

.crm-profile-actions {
  margin-top: 18px;
}

.crm-profile-actions .crm-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.crm-help-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
}

.crm-help-topics {
  display: grid;
  gap: 14px;
}

.crm-help-topic {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  padding: 18px;
}

.crm-help-topic-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.crm-help-topic h3 {
  font-size: 18px;
  margin: 4px 0 0;
}

.crm-help-topic p {
  color: var(--crm-muted);
  margin: 12px 0;
}

.crm-help-topic ol {
  margin: 0;
  padding-left: 20px;
}

.crm-help-topic li {
  margin: 7px 0;
}

.crm-help-category {
  color: var(--crm-primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.crm-help-category-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.crm-help-category-list a {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  color: var(--crm-text);
  padding: 11px 12px;
}

.crm-help-category-list a:hover,
.crm-help-category-list a.is-active {
  background: #eef3f6;
  border-color: #c9d7df;
  color: var(--crm-primary-dark);
}

.crm-tools-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 330px minmax(0, 1fr);
}

.crm-tool-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.crm-tool-search {
  color: var(--crm-muted);
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 16px;
}

.crm-tool-search input {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  color: var(--crm-text);
  min-height: 42px;
  padding: 10px 11px;
  width: 100%;
}

.crm-tool-list a {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  color: var(--crm-text);
  display: grid;
  gap: 5px;
  padding: 12px;
}

.crm-tool-list a[hidden],
.crm-tools-layout [hidden] {
  display: none !important;
}

.crm-tool-list a:hover,
.crm-tool-list a.is-active {
  background: #eef6ff;
  border-color: rgba(13, 110, 253, 0.32);
}

.crm-tool-list em {
  color: var(--crm-primary-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.crm-tool-list span {
  color: var(--crm-muted);
  font-size: 13px;
  line-height: 1.4;
}

.crm-tool-form {
  margin-top: 16px;
}

.crm-tool-disclaimer {
  background: #fff8e6;
  border: 1px solid #f2d48a;
  border-radius: 8px;
  color: #6f5200;
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0 0;
  padding: 11px 12px;
}

.crm-tool-save-hint {
  color: var(--crm-muted);
  font-size: 13px;
  margin: 12px 0 0;
}

.crm-tool-result {
  background: #f7fbff;
  border: 1px solid rgba(13, 110, 253, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 18px;
}

.crm-tool-result h3 {
  margin: 0;
}

.crm-tool-result dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.crm-tool-result dl div {
  align-items: center;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.crm-tool-result dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.crm-tool-result dt {
  color: var(--crm-muted);
  font-size: 13px;
  font-weight: 700;
}

.crm-tool-result dd {
  font-weight: 700;
  margin: 0;
  text-align: right;
}

.crm-tool-save {
  display: grid;
  gap: 12px;
}

.crm-tool-save-card {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.crm-tool-save-card h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.crm-tool-save-card p {
  color: var(--crm-muted);
  font-size: 13px;
  margin: 0;
}

.crm-related-search-results {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 39, 51, 0.12);
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.crm-related-search-option {
  background: #ffffff;
  border: 0;
  border-radius: 6px;
  color: var(--crm-text);
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.crm-related-search-option:hover,
.crm-related-search-option:focus {
  background: #eef6ff;
  outline: none;
}

.crm-related-search-option strong {
  font-size: 13px;
}

.crm-related-search-option small {
  color: var(--crm-muted);
  font-size: 12px;
}

.crm-muted {
  color: var(--crm-muted);
}

.crm-code {
  color: var(--crm-muted);
  font-size: 12px;
  white-space: pre-wrap;
}

.crm-dashboard-panel {
  margin-top: 20px;
}

.crm-dashboard-hero {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.crm-dashboard-hero span {
  color: var(--crm-primary-dark);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.crm-dashboard-hero h2 {
  font-size: 28px;
  margin: 4px 0;
}

.crm-dashboard-hero p {
  color: var(--crm-muted);
  margin: 0;
}

.crm-dashboard-search {
  align-items: center;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  display: flex;
  max-width: 410px;
  overflow: hidden;
  width: 100%;
}

.crm-dashboard-search input {
  border: 0;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.crm-dashboard-search button {
  background: #eef3f6;
  border: 0;
  color: var(--crm-primary-dark);
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 14px;
}

.crm-dashboard-top {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
  margin-bottom: 14px;
}

.crm-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-snapshot-grid article {
  border-right: 1px solid var(--crm-border);
  display: grid;
  gap: 8px;
  padding: 12px 20px 4px 0;
}

.crm-snapshot-grid article:not(:first-child) {
  padding-left: 20px;
}

.crm-snapshot-grid article:last-child {
  border-right: 0;
}

.crm-dash-icon {
  align-items: center;
  background: #eaf3ff;
  border-radius: 7px;
  color: var(--crm-primary);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.crm-snapshot-grid small,
.crm-dashboard-card small {
  color: var(--crm-text);
  font-size: 13px;
  font-weight: 700;
}

.crm-snapshot-grid strong,
.crm-dashboard-card strong {
  font-size: 26px;
  line-height: 1.1;
}

.crm-snapshot-grid em,
.crm-dashboard-card p,
.crm-insight-panel p {
  color: var(--crm-muted);
  font-size: 13px;
  font-style: normal;
  margin: 0;
}

.crm-insight-panel ul {
  color: var(--crm-text);
  display: grid;
  gap: 9px;
  line-height: 1.45;
  margin: 14px 0;
  padding-left: 18px;
}

.crm-dashboard-kpis {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
}

.crm-dashboard-card {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 39, 51, 0.05);
  display: grid;
  gap: 9px;
  min-height: 166px;
  padding: 18px;
}

.crm-dashboard-card a,
.crm-panel-heading a {
  font-size: 13px;
  font-weight: 700;
}

.crm-trend-positive {
  color: #128a46 !important;
}

.crm-trend-negative {
  color: #c42828 !important;
}

.crm-trend-neutral {
  color: var(--crm-muted) !important;
}

.crm-dashboard-main {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(280px, 1fr);
  margin-bottom: 14px;
}

.crm-pipeline-list,
.crm-priority-list,
.crm-appointment-list,
.crm-activity-list,
.crm-compliance-overview {
  display: grid;
  gap: 10px;
}

.crm-pipeline-list div {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 26px 120px minmax(0, 1fr) 28px;
}

.crm-pipeline-list b {
  border-radius: 999px;
  display: block;
  height: 12px;
  width: var(--pipeline-width);
}

.crm-stage-icon {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-style: normal;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.crm-stage-icon .crm-icon {
  height: 15px;
  width: 15px;
}

.crm-stage-blue,
.crm-priority-icon-document {
  background: #e8f1ff;
  color: #0d6efd;
}

.crm-stage-sky {
  background: #e9f4ff;
  color: #2f8bf2;
}

.crm-stage-cyan {
  background: #e4fbff;
  color: #12b8cc;
}

.crm-stage-orange,
.crm-priority-icon-call {
  background: #ffeceb;
  color: #f04438;
}

.crm-stage-amber,
.crm-priority-icon-message {
  background: #fff4dc;
  color: #f59e0b;
}

.crm-stage-green,
.crm-priority-icon-calendar {
  background: #e8f8ee;
  color: #16a34a;
}

.crm-stage-red {
  background: #ffeceb;
  color: #c42828;
}

.crm-stage-bar-blue {
  background: linear-gradient(90deg, #0d6efd, #00a3ff);
}

.crm-stage-bar-sky {
  background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

.crm-stage-bar-cyan {
  background: linear-gradient(90deg, #19c6d5, #72e5ec);
}

.crm-stage-bar-orange {
  background: linear-gradient(90deg, #ff4b2b, #ffb199);
}

.crm-stage-bar-amber {
  background: linear-gradient(90deg, #f59e0b, #ffd166);
}

.crm-stage-bar-green {
  background: linear-gradient(90deg, #00b050, #75dd8a);
}

.crm-stage-bar-red {
  background: linear-gradient(90deg, #ef4444, #fca5a5);
}

.crm-pipeline-list span,
.crm-pipeline-list strong {
  font-size: 13px;
}

.crm-priority-list a,
.crm-appointment-list a {
  align-items: center;
  background: #fbfcff;
  border-radius: 8px;
  color: var(--crm-text);
  display: grid;
  gap: 12px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  padding: 10px;
}

.crm-priority-icon {
  align-items: center;
  border-radius: 8px;
  display: flex;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  line-height: 1;
  width: 36px;
}

.crm-priority-icon .crm-icon {
  height: 18px;
  width: 18px;
}

.crm-priority-list strong,
.crm-appointment-list strong,
.crm-activity-list strong {
  display: block;
  font-size: 13px;
}

.crm-activity-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-priority-list small,
.crm-appointment-list small,
.crm-activity-list small {
  color: var(--crm-muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.crm-activity-list small {
  margin-top: 0;
  text-align: right;
  white-space: nowrap;
}

.crm-priority-list em,
.crm-appointment-list em {
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  padding: 5px 8px;
}

.crm-priority-high {
  background: #ffeceb;
  color: #c42828;
}

.crm-priority-medium {
  background: #fff5df;
  color: #a86400;
}

.crm-priority-low,
.crm-appointment-list em {
  background: #e8f6ee;
  color: #177245;
}

.crm-appointment-list time {
  background: #eaf3ff;
  border-radius: 8px;
  color: var(--crm-primary);
  font-weight: 800;
  padding: 12px 6px;
  text-align: center;
}

.crm-dashboard-lower {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
}

.crm-activity-list div,
.crm-compliance-overview div {
  align-items: center;
  border-bottom: 1px solid var(--crm-border);
  display: grid;
  gap: 10px;
  grid-template-columns: 30px minmax(0, 1fr);
  padding-bottom: 10px;
}

.crm-activity-list div {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.crm-activity-list div:last-child,
.crm-compliance-overview div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.crm-compliance-overview div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.crm-compliance-overview span {
  color: var(--crm-text);
  font-size: 13px;
}

.crm-compliance-overview strong {
  background: #ffeceb;
  border-radius: 999px;
  color: #c42828;
  min-width: 32px;
  padding: 5px 8px;
  text-align: center;
}

.crm-form {
  display: grid;
  gap: 14px;
}

.crm-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-form label {
  color: var(--crm-muted);
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.crm-form input,
.crm-form select,
.crm-form textarea,
.crm-filter input,
.crm-filter select {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  color: var(--crm-text);
  min-height: 42px;
  padding: 10px 11px;
  width: 100%;
}

.crm-filter-bar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  margin-bottom: 18px;
}

.crm-filter-bar-short {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.crm-filter-bar-appointments {
  grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(120px, 0.7fr) auto;
}

.crm-filter-bar-communications {
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.7fr) minmax(150px, 1fr) minmax(130px, 0.8fr) auto;
}

.crm-filter-bar-help {
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 0.7fr) auto;
}

.crm-filter-bar label {
  color: var(--crm-muted);
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.crm-filter-actions {
  display: flex;
  gap: 8px;
}

.crm-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-button-light {
  align-items: center;
  background: #eef3f6;
  color: var(--crm-primary-dark);
  display: inline-flex;
  justify-content: center;
}

.crm-button-light:hover {
  background: #dde9ee;
}

.crm-form textarea {
  resize: vertical;
}

.crm-check {
  align-items: center;
  display: flex !important;
  gap: 10px !important;
}

.crm-check input {
  min-height: auto;
  width: auto;
}

.crm-compliance-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-compliance-check {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  color: var(--crm-text) !important;
  font-weight: 700 !important;
  padding: 12px;
}

.crm-collapsible-panel {
  padding: 0;
}

.crm-collapsible-panel > form,
.crm-collapsible-panel > .crm-file-review-summary {
  margin-left: 20px;
  margin-right: 20px;
}

.crm-collapsible-panel > form {
  padding-bottom: 20px;
}

.crm-collapsible-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  padding: 20px;
}

.crm-collapsible-summary::-webkit-details-marker {
  display: none;
}

.crm-collapsible-title {
  display: grid;
  gap: 4px;
}

.crm-collapsible-title strong {
  color: var(--crm-text);
  font-size: 20px;
}

.crm-collapsible-title small {
  color: var(--crm-muted);
  font-weight: 700;
}

.crm-collapsible-meta {
  align-items: center;
  display: flex;
  gap: 10px;
}

.crm-collapsible-toggle {
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  color: var(--crm-primary);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  text-transform: uppercase;
}

.crm-collapsible-panel[open] .crm-collapsible-toggle {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #ffffff;
}

.crm-collapsible-panel[open] .crm-collapsible-toggle::before {
  content: "Hide";
}

.crm-collapsible-panel[open] .crm-collapsible-toggle {
  font-size: 0;
}

.crm-collapsible-panel[open] .crm-collapsible-toggle::before {
  font-size: 12px;
}

.crm-file-review-summary {
  background:
    radial-gradient(circle at top left, rgba(31, 95, 116, 0.14), transparent 30%),
    linear-gradient(135deg, #f8fafc, #eef5f7);
  border: 1px solid var(--crm-border);
  border-radius: 14px;
  padding: 16px;
}

.crm-file-review-progress {
  background: rgba(31, 95, 116, 0.12);
  border-radius: 999px;
  height: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}

.crm-file-review-progress span {
  background: linear-gradient(90deg, var(--crm-primary), #2c9b75);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.crm-file-review-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-file-review-summary-grid article {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.crm-file-review-summary-grid span {
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.crm-file-review-summary-grid strong {
  color: var(--crm-text);
  font-size: 30px;
  line-height: 1;
}

.crm-file-review-summary-grid .is-yes {
  border-left: 5px solid var(--crm-success);
}

.crm-file-review-summary-grid .is-no {
  border-left: 5px solid var(--crm-danger);
}

.crm-file-review-summary-grid .is-na {
  border-left: 5px solid var(--crm-accent);
}

.crm-file-review-summary-grid .is-unchecked {
  border-left: 5px solid var(--crm-muted);
}

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

@media (max-width: 620px) {
  .crm-collapsible-summary,
  .crm-collapsible-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-file-review-summary-grid {
    grid-template-columns: 1fr;
  }
}

.crm-file-review-table-wrap {
  background: #f8fafc;
  border: 1px solid var(--crm-border);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  max-height: 720px;
  padding: 12px;
}

.crm-file-review-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.crm-file-review-table thead th {
  background: #f8fafc;
  border-bottom: 0;
  color: var(--crm-muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 2;
}

.crm-file-review-table th:nth-child(1),
.crm-file-review-table td:nth-child(1) {
  text-align: center;
  width: 64px;
}

.crm-file-review-table th:nth-child(4),
.crm-file-review-table td:nth-child(4) {
  width: 150px;
}

.crm-file-review-table th:nth-child(5),
.crm-file-review-table td:nth-child(5) {
  width: 280px;
}

.crm-file-review-table td {
  background: #ffffff;
  border-bottom: 1px solid var(--crm-border);
  border-top: 1px solid var(--crm-border);
  padding: 16px 14px;
  vertical-align: top;
}

.crm-file-review-item-row td:first-child {
  border-left: 1px solid var(--crm-border);
  border-radius: 14px 0 0 14px;
}

.crm-file-review-item-row td:last-child {
  border-radius: 0 14px 14px 0;
  border-right: 1px solid var(--crm-border);
}

.crm-file-review-item-row.is-status-yes td:first-child {
  border-left: 5px solid var(--crm-success);
}

.crm-file-review-item-row.is-status-no td:first-child {
  border-left: 5px solid var(--crm-danger);
}

.crm-file-review-item-row.is-status-na td:first-child {
  border-left: 5px solid var(--crm-accent);
}

.crm-file-review-item-row.is-status-unchecked td:first-child {
  border-left: 5px solid var(--crm-muted);
}

.crm-file-review-number {
  align-items: center;
  background: rgba(31, 95, 116, 0.1);
  border-radius: 999px;
  color: var(--crm-primary);
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 8px;
}

.crm-file-review-item-title {
  display: grid;
  gap: 6px;
}

.crm-file-review-item-title strong {
  color: var(--crm-text);
  font-size: 15px;
  line-height: 1.35;
}

.crm-file-review-item-title small {
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crm-file-review-guidance {
  color: #405163;
  line-height: 1.5;
  margin: 0;
}

.crm-file-review-table select,
.crm-file-review-table textarea {
  background: #f9fbfc;
  border-color: #d5dee8;
  border-radius: 10px;
  min-width: 100%;
}

.crm-file-review-table textarea {
  min-height: 74px;
  resize: vertical;
}

.crm-file-review-section-row td {
  background: linear-gradient(135deg, var(--crm-primary), var(--crm-primary-dark));
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 11px 16px;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .crm-file-review-table th:nth-child(3),
  .crm-file-review-table td:nth-child(3) {
    min-width: 320px;
  }

  .crm-file-review-table th:nth-child(5),
  .crm-file-review-table td:nth-child(5) {
    min-width: 240px;
  }
}

.crm-template-editor-list {
  display: grid;
  gap: 14px;
}

.crm-template-editor-card {
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.crm-template-editor-card.is-inactive {
  opacity: 0.72;
}

.crm-template-editor-actions,
.crm-template-editor-state-form {
  display: flex;
  justify-content: flex-end;
}

.crm-button {
  background: var(--crm-primary);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 11px 16px;
}

.crm-button:hover {
  background: var(--crm-primary-dark);
}

.crm-button-secondary {
  background: var(--crm-accent);
}

.crm-alert {
  border-radius: 8px;
  margin: 18px 28px 0;
  padding: 12px 14px;
}

.crm-panel .crm-alert,
.crm-auth-card .crm-alert {
  margin: 0;
}

.crm-alert-success {
  background: #eaf6f1;
  color: var(--crm-success);
}

.crm-alert-error {
  background: #faecec;
  color: var(--crm-danger);
}

.crm-notes {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.crm-notes p {
  margin: 0 0 8px;
}

.crm-timeline {
  display: grid;
  gap: 14px;
}

.crm-timeline-item {
  display: grid;
  gap: 12px;
  grid-template-columns: 36px minmax(0, 1fr);
  position: relative;
}

.crm-timeline-item:not(:last-child)::before {
  background: var(--crm-border);
  bottom: -14px;
  content: "";
  left: 17px;
  position: absolute;
  top: 36px;
  width: 2px;
}

.crm-timeline-marker {
  align-items: center;
  background: var(--crm-primary);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  position: relative;
  width: 36px;
  z-index: 1;
}

.crm-timeline-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.crm-timeline-heading h3 {
  font-size: 16px;
  margin: 0;
}

.crm-timeline-item p {
  margin: 8px 0;
}

.crm-timeline-item small {
  color: var(--crm-muted);
}

.crm-auth-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.crm-auth-card {
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(16, 39, 51, 0.12);
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.crm-portal-card {
  max-width: 620px;
}

.crm-portal-summary {
  box-shadow: none;
  margin-bottom: 18px;
  padding: 18px;
}

.crm-portal-summary p {
  margin: 0 0 10px;
}

.crm-auth-card h1 {
  margin-bottom: 8px;
  text-align: center;
}

.crm-auth-tagline {
  color: var(--crm-muted);
  line-height: 1.5;
  margin: 0 0 22px;
  text-align: center;
}

.crm-auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.crm-auth-brand .crm-brand-logo {
  height: auto;
  max-width: 390px;
  width: 92%;
}

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

  .crm-footer {
    left: 0;
  }

  .crm-sidebar {
    padding: 16px;
  }

  .crm-sidebar-hub {
    margin-top: 16px;
    max-width: 260px;
  }

  .crm-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .crm-nav a {
    text-align: center;
  }

  .crm-stats,
  .crm-grid-two,
  .crm-grid-three,
  .crm-dashboard-top,
  .crm-dashboard-main,
  .crm-dashboard-lower,
  .crm-tools-layout,
  .crm-profile-layout,
  .crm-help-layout {
    grid-template-columns: 1fr;
  }

  .crm-dashboard-kpis,
  .crm-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-snapshot-grid article,
  .crm-snapshot-grid article:not(:first-child) {
    border-right: 0;
    padding: 12px 0;
  }

  .crm-profile-hero {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .crm-profile-badges {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .crm-dashboard-hero {
    align-items: stretch;
    display: grid;
  }

  .crm-dashboard-kpis,
  .crm-snapshot-grid {
    grid-template-columns: 1fr;
  }

  .crm-pipeline-list div {
    grid-template-columns: 94px minmax(0, 1fr) 24px;
  }

  .crm-content,
  .crm-topbar {
    padding: 18px;
  }

  .crm-topbar {
    align-items: flex-start;
    display: grid;
    gap: 12px;
  }

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

  .crm-form-grid {
    grid-template-columns: 1fr;
  }

  .crm-compliance-grid {
    grid-template-columns: 1fr;
  }

  .crm-profile-hero,
  .crm-profile-fields,
  .crm-profile-access-list,
  .crm-filter-bar-help {
    grid-template-columns: 1fr;
  }

  .crm-help-topic-heading {
    display: grid;
  }

  .crm-profile-fields div,
  .crm-profile-fields div:nth-child(even),
  .crm-profile-fields div:nth-child(odd) {
    border-left: 0;
    border-top: 1px solid var(--crm-border);
    padding-left: 0;
    padding-right: 0;
  }

  .crm-profile-fields div:first-child {
    border-top: 0;
  }

  .crm-filter-bar {
    grid-template-columns: 1fr;
  }

  .crm-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
.crm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #dfe8f3;
}

.crm-tabs a {
    padding: 10px 14px;
    color: #5b6b85;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.crm-tabs a.is-active {
    color: var(--crm-primary);
    border-bottom-color: var(--crm-primary);
    font-weight: 700;
}

.crm-notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 420px;
}

.crm-notification-actions input[type="datetime-local"] {
    min-width: 175px;
}

@media (max-width: 700px) {
    .crm-tabs {
        overflow-x: auto;
    }

    .crm-tabs a {
        flex: 0 0 auto;
    }

    .crm-notification-actions {
        min-width: 0;
    }

    .crm-notification-actions input[type="datetime-local"] {
        width: 100%;
    }
}
