@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --crm-primary: #0f766e;
  --crm-primary-hover: #0d9488;
  --crm-primary-soft: #ccfbf1;
  --crm-ink: #0f172a;
  --crm-muted: #64748b;
  --crm-border: #e2e8f0;
  --crm-bg: #f1f5f9;
  --crm-surface: #ffffff;
  --crm-danger: #dc2626;
  --crm-warning: #d97706;
  --crm-success: #059669;
  --crm-sidebar-w: 260px;
  --crm-radius: 14px;
  --crm-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  /* Vazirmatn ss02 draws Latin digits as Persian numerals. */
  font-feature-settings: "ss02";
}

input,
textarea,
select {
  font-family: inherit;
  font-feature-settings: "ss02";
}

.bi {
  font-feature-settings: normal;
}

body.crm-body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--crm-bg);
  color: var(--crm-ink);
  font-size: 0.95rem;
}

a {
  text-decoration: none;
}

.crm-shell {
  min-height: 100vh;
  display: flex;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(15, 118, 110, 0.08), transparent 60%),
    radial-gradient(900px 400px at 0% 100%, rgba(15, 23, 42, 0.04), transparent 55%),
    var(--crm-bg);
}

.crm-sidebar {
  width: var(--crm-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0b3f3b 0%, #0f766e 55%, #115e59 100%);
  color: #ecfdf5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1040;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.12);
}

.crm-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.crm-brand img,
.crm-brand svg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.crm-brand img.is-org-logo,
.auth-brand img.is-org-logo {
  object-fit: cover;
  background: #fff;
}

.crm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.crm-brand-text strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.crm-brand-text span {
  font-size: 0.75rem;
  opacity: 0.8;
}

.crm-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.crm-nav-label {
  font-size: 0.72rem;
  opacity: 0.65;
  padding: 0.65rem 0.85rem 0.35rem;
  letter-spacing: 0.02em;
}

.crm-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: rgba(236, 253, 245, 0.92);
  transition: background 0.15s ease, transform 0.15s ease;
}

.crm-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.crm-nav-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.crm-nav-link i {
  font-size: 1.15rem;
  width: 1.35rem;
  text-align: center;
}

.crm-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.crm-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--crm-border);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.crm-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.crm-search i {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--crm-muted);
}

.crm-search input {
  width: 100%;
  border: 1px solid var(--crm-border);
  background: #f8fafc;
  border-radius: 999px;
  padding: 0.55rem 2.4rem 0.55rem 1rem;
  outline: none;
}

.crm-search input:focus {
  border-color: var(--crm-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.crm-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
}

.crm-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--crm-border);
  background: #fff;
  color: var(--crm-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.crm-icon-btn:hover {
  background: var(--crm-primary-soft);
  border-color: #99f6e4;
  color: var(--crm-primary);
}

.crm-user-area {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.crm-user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--crm-border);
  background: #fff;
}

.crm-logout-btn {
  width: auto;
  min-width: 34px;
  padding: 0 0.55rem;
  gap: 0.35rem;
  color: #64748b;
}

.crm-logout-btn:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.crm-logout-label {
  font-size: 0.78rem;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .crm-logout-label {
    display: none;
  }
}

.crm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.crm-avatar.has-photo,
.crm-person-avatar.has-photo,
.crm-profile-avatar-preview.has-photo {
  overflow: hidden;
  padding: 0;
}

.crm-avatar.has-photo img,
.crm-person-avatar.has-photo img,
.crm-profile-avatar-preview.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.crm-profile-avatar-preview {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  font-size: 1.1rem;
  border-radius: 12px;
}

.crm-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

a.crm-user-chip {
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.crm-user-chip:hover {
  border-color: #99f6e4;
  background: var(--crm-primary-soft);
}

.crm-login-device {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.crm-login-device-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.crm-login-device-icon.is-desktop {
  background: #dbeafe;
  color: #2563eb;
}

.crm-login-device-icon.is-mobile {
  background: #dcfce7;
  color: #059669;
}

.crm-login-device-icon.is-tablet {
  background: #ede9fe;
  color: #7c3aed;
}

.crm-login-device-icon.is-bot {
  background: #fee2e2;
  color: #dc2626;
}

.crm-icon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.crm-icon-chip > i {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.crm-icon-chip.is-browser > i {
  background: #fef3c7;
  color: #d97706;
}

.crm-icon-chip.is-browser.is-chrome > i {
  background: #dbeafe;
  color: #2563eb;
}

.crm-icon-chip.is-browser.is-firefox > i {
  background: #ffedd5;
  color: #ea580c;
}

.crm-icon-chip.is-browser.is-safari > i {
  background: #e0f2fe;
  color: #0284c7;
}

.crm-icon-chip.is-browser.is-edge > i {
  background: #dbeafe;
  color: #1d4ed8;
}

.crm-icon-chip.is-os > i {
  background: #f1f5f9;
  color: #475569;
}

.crm-icon-chip.is-os.is-windows > i {
  background: #dbeafe;
  color: #2563eb;
}

.crm-icon-chip.is-os.is-apple > i {
  background: #f1f5f9;
  color: #0f172a;
}

.crm-icon-chip.is-os.is-android > i {
  background: #dcfce7;
  color: #16a34a;
}

.crm-icon-chip.is-os.is-linux > i {
  background: #ffedd5;
  color: #c2410c;
}

.crm-icon-chip.is-time > i {
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
}

.crm-icon-chip.is-ip > i {
  background: #f1f5f9;
  color: #64748b;
}

.crm-activity-log-list {
  display: flex;
  flex-direction: column;
}

.crm-activity-log-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-activity-log-item:last-child {
  border-bottom: 0;
}

.crm-activity-log-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.crm-activity-log-icon.is-event-success {
  background: #dcfce7;
  color: #059669;
}

.crm-activity-log-icon.is-event-info {
  background: #dbeafe;
  color: #2563eb;
}

.crm-activity-log-icon.is-event-danger {
  background: #fee2e2;
  color: #dc2626;
}

.crm-activity-log-icon.is-event-primary {
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
}

.crm-activity-log-icon.is-event-warning {
  background: #fef3c7;
  color: #d97706;
}

.crm-activity-log-icon.is-event-neutral {
  background: #f1f5f9;
  color: #64748b;
}

.crm-activity-log-body {
  flex: 1;
  min-width: 0;
}

.crm-activity-log-desc {
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.crm-activity-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-activity-log-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.crm-badge i {
  font-size: 0.68rem;
}

.crm-activity-log-time {
  white-space: nowrap;
  flex-shrink: 0;
}

.crm-content {
  padding: 1.25rem;
}

.crm-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.crm-page-head h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.crm-page-head p {
  margin: 0;
  color: var(--crm-muted);
  font-size: 0.85rem;
}

.crm-card {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow);
}

.crm-card-body {
  padding: 1rem 1.1rem;
}

.crm-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.crm-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  font-size: 1.25rem;
}

.crm-stat strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}

.crm-stat span {
  color: var(--crm-muted);
  font-size: 0.85rem;
}

.crm-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
}

.crm-task {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--crm-border);
}

.crm-task:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.crm-task:first-child {
  padding-top: 0;
}

.crm-task.is-overdue .crm-task-title {
  color: #b91c1c;
}

.crm-task-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--crm-ink);
}

.crm-task-title:hover {
  color: var(--crm-primary);
}

.crm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.4rem;
  flex-shrink: 0;
}

.crm-dot.high { background: var(--crm-danger); }
.crm-dot.medium { background: var(--crm-warning); }
.crm-dot.low { background: var(--crm-success); }

.crm-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.crm-pipe-col {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 0.65rem;
  min-height: 160px;
}

.crm-pipe-col h6 {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--crm-muted);
  display: flex;
  justify-content: space-between;
}

.crm-deal-card {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.crm-deal-card strong {
  display: block;
  font-size: 0.85rem;
}

.crm-deal-card span {
  font-size: 0.75rem;
  color: var(--crm-muted);
}

.crm-contact-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--crm-border);
}

.crm-contact-row:last-child {
  border-bottom: 0;
}

.crm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.crm-badge.lead { background: #fef3c7; color: #92400e; }
.crm-badge.customer { background: #d1fae5; color: #065f46; }
.crm-badge.hot { background: #ffe4e6; color: #9f1239; }

.btn-crm {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8125rem;
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1.2;
}

.btn-crm:hover,
.btn-crm:focus {
  background: var(--crm-primary-hover);
  border-color: var(--crm-primary-hover);
  color: #fff;
}

.btn-crm-outline {
  border: 1px solid var(--crm-border);
  background: #fff;
  color: var(--crm-ink);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8125rem;
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1.2;
}

.btn-crm-lg {
  min-height: 36px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.crm-hero-panel {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
  align-items: center;
  overflow: hidden;
}

.crm-hero-panel img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.crm-mobile-toggle {
  display: none;
}

@media (max-width: 991.98px) {
  .crm-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform 0.2s ease;
  }

  .crm-sidebar.open {
    transform: translateX(0);
  }

  .crm-mobile-toggle {
    display: inline-flex;
  }

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

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

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

  .crm-search {
    display: none;
  }
}

.crm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1035;
}

.crm-backdrop.show {
  display: block;
}

/* Bootstrap pagination (Laravel Paginator::useBootstrapFive) */
.crm-pagination {
  display: block;
  margin-top: 1rem;
}

.crm-pager {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

.crm-pager-summary {
  margin: 0;
  text-align: start;
  color: var(--crm-muted);
  font-size: 0.82rem;
}

.crm-pager-pages {
  justify-content: center;
  flex-wrap: wrap;
}

.crm-list-shell > .crm-pagination {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--crm-border);
}

.crm-pagination .pagination,
.crm-pager-pages {
  margin-bottom: 0;
  gap: 0.15rem;
}

.crm-pagination .page-link,
.crm-pager .page-link {
  border-radius: 10px !important;
  border-color: var(--crm-border);
  color: var(--crm-ink);
  min-width: 2.25rem;
  text-align: center;
}

.crm-pagination .page-item.active .page-link,
.crm-pager .page-item.active .page-link {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #fff;
}

.crm-pagination .page-link:hover,
.crm-pager .page-link:hover {
  background: var(--crm-primary-soft);
  border-color: #99f6e4;
  color: var(--crm-primary);
}

.crm-pagination .page-item.disabled .page-link,
.crm-pager .page-item.disabled .page-link {
  color: var(--crm-muted);
  background: #f8fafc;
}

/* ??? Polished forms (minimal) ??? */
.crm-form-card {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.crm-form-card .crm-form-section {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-form-card .crm-form-section:last-child {
  border-bottom: 0;
}

.crm-form-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--crm-ink);
}

.crm-form-section-title i {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  font-size: 0.85rem;
}

.crm-body .form-label {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
  color: #475569;
}

.crm-body .form-control,
.crm-body .form-select {
  min-height: 36px;
  border-radius: 8px;
  border-color: #e2e8f0;
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-body .form-control:focus,
.crm-body .form-select:focus {
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.crm-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-start;
  padding-top: 0.15rem;
}

.crm-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  background: #fff;
}

.crm-switch .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  margin: 0;
  cursor: pointer;
}

.crm-switch .form-check-input:checked {
  background-color: var(--crm-primary);
  border-color: var(--crm-primary);
}

.crm-switch-copy strong {
  display: block;
  font-size: 0.85rem;
}

.crm-switch-copy span {
  color: var(--crm-muted);
  font-size: 0.75rem;
}

.crm-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

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

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

.crm-choice {
  position: relative;
  margin: 0;
}

.crm-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.crm-choice-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.crm-choice-card:hover {
  border-color: #99f6e4;
  background: #f8fffd;
}

.crm-choice input:checked + .crm-choice-card {
  border-color: var(--crm-primary);
  background: #f0fdfa;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.crm-choice-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.9rem;
}

.crm-choice input:checked + .crm-choice-card .crm-choice-icon {
  background: var(--crm-primary);
  color: #fff;
}

.crm-choice-body {
  min-width: 0;
  flex: 1;
}

.crm-choice-body strong {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 0.05rem;
}

.crm-choice-body span {
  display: block;
  color: var(--crm-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.crm-choice-check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.65rem;
}

.crm-choice input:checked + .crm-choice-card .crm-choice-check {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #fff;
}

.crm-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e8eef5;
  border-radius: 8px;
  background: #fff;
  height: 100%;
  font-size: 0.82rem;
}

.crm-perm-item .form-check-input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
}

.crm-perm-item .form-check-input:checked {
  background-color: var(--crm-primary);
  border-color: var(--crm-primary);
}

.crm-table .btn,
.crm-table .btn-sm {
  min-height: 28px;
  padding: 0.2rem 0.5rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* ??? Polished lists (minimal) ??? */
.crm-list-shell {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.crm-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--crm-border);
  background: #fafbfc;
}

.crm-list-toolbar-search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  position: relative;
}

.crm-list-toolbar-search i {
  position: absolute;
  inset-inline-start: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--crm-muted);
  font-size: 0.85rem;
  line-height: 1;
  pointer-events: none;
}

.crm-body .crm-list-toolbar-search input.form-control {
  padding-inline-start: 2.15rem;
  padding-inline-end: 0.75rem;
  min-height: 34px;
}

.crm-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.crm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
}

.crm-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.crm-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  border-bottom: 1px solid var(--crm-border);
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}

.crm-table tbody td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
  font-size: 0.875rem;
}

.crm-table tbody tr:last-child td {
  border-bottom: 0;
}

.crm-table tbody tr {
  transition: background 0.12s ease;
}

.crm-table tbody tr:hover {
  background: #f8fffd;
}

.crm-person {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.crm-person-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
}

.crm-person-avatar.soft {
  background: #ecfdf5;
  color: var(--crm-primary);
}

.crm-person-text {
  min-width: 0;
}

.crm-person-text a,
.crm-person-text strong {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--crm-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-person-text span {
  display: block;
  color: var(--crm-muted);
  font-size: 0.75rem;
}

.crm-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.crm-badge.neutral { background: #e2e8f0; color: #334155; }
.crm-badge.info { background: #e0f2fe; color: #075985; }

.crm-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.crm-actions .btn {
  min-height: 30px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
}

.crm-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.crm-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  font-size: 1.2rem;
}

.crm-empty h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.crm-empty p {
  color: var(--crm-muted);
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.crm-top-actions .btn {
  white-space: nowrap;
  min-height: 32px;
  font-size: 0.8125rem;
  padding: 0.35rem 0.7rem;
}

.crm-quick-create-trigger {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #fff;
}

.crm-quick-create-trigger:hover {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}

.crm-quick-create-dropdown {
  min-width: 240px;
  padding: 0;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.crm-quick-create-dropdown-head {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--crm-border);
  background: #f8fafc;
  font-size: 0.82rem;
}

.crm-quick-create-dropdown-head strong {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.crm-quick-create-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
}

.crm-quick-create-item i {
  color: var(--crm-primary);
  font-size: 1rem;
}

.crm-quick-create-modal .modal-body {
  min-height: 120px;
}

.crm-quick-create-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  color: var(--crm-muted);
}

.crm-quick-create-modal .crm-form-card {
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  padding: 0;
}

.crm-quick-create-modal .crm-card {
  border: none;
  box-shadow: none;
}

.crm-quick-create-chooser .crm-create-card {
  width: 100%;
  text-align: right;
  cursor: pointer;
  border: 1px solid var(--crm-border);
  background: #fff;
}

.crm-quick-create-toast {
  min-width: 320px;
}

.crm-quick-create-toast-msg {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.crm-quick-create-toast-link {
  display: inline-block;
  color: #fff;
  text-decoration: underline;
  font-size: 0.85rem;
  opacity: 0.95;
}

.crm-quick-create-toast-link:hover {
  color: #fff;
  opacity: 1;
}

/* ??? Contacts ??? */
.crm-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

@media (max-width: 767.98px) {
  .crm-stat-row { grid-template-columns: 1fr; }
}

.crm-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: 10px;
}

.crm-stat-pill i {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  font-size: 0.95rem;
}

.crm-stat-pill strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
}

.crm-stat-pill span {
  color: var(--crm-muted);
  font-size: 0.75rem;
}

.crm-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.crm-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--crm-border);
  background: #fff;
  color: var(--crm-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.crm-filter-pill:hover,
.crm-filter-pill.active {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: var(--crm-primary);
}

.crm-create-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  max-width: 720px;
}

@media (max-width: 767.98px) {
  .crm-create-chooser { grid-template-columns: 1fr; }
}

.crm-create-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.crm-create-card:hover {
  border-color: #99f6e4;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
  color: inherit;
}

.crm-create-card i {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  font-size: 1.1rem;
}

.crm-create-card strong { font-size: 0.95rem; }

.crm-create-card span {
  color: var(--crm-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.crm-contact-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  margin-bottom: 0.85rem;
}

.crm-contact-hero-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.crm-contact-hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.crm-contact-hero-avatar.company {
  background: linear-gradient(135deg, #0f172a, #334155);
}

.crm-contact-hero h1 {
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
  font-weight: 700;
}

.crm-contact-hero .meta {
  color: var(--crm-muted);
  font-size: 0.8rem;
  margin: 0;
}

.crm-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  color: var(--crm-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.crm-tab:hover { color: var(--crm-ink); }

.crm-tab.active {
  color: var(--crm-primary);
  border-bottom-color: var(--crm-primary);
}

.crm-placeholder-panel {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--crm-muted);
  font-size: 0.85rem;
}

.crm-placeholder-panel i {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
  color: #94a3b8;
}

.crm-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

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

.crm-kv dd {
  margin: 0;
  font-weight: 600;
}

.crm-audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.crm-audit-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
}

.crm-audit-list li:last-child { border-bottom: 0; }

/* ??? Kanban / Pipelines ??? */
.crm-kanban-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.crm-deals-filter-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-width: min(100%, 520px);
}

.crm-deals-date-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.crm-deals-date-label {
  font-size: 0.75rem;
  color: var(--crm-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.crm-filter-pills-inline .crm-filter-pill {
  cursor: pointer;
  font-family: inherit;
}

.crm-deals-date-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.crm-deals-date-custom .crm-date-field {
  width: auto;
}

.crm-deals-date-custom .form-control {
  width: auto;
  min-width: 132px;
  min-height: 32px;
}

.crm-kanban {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  align-items: flex-start;
}

.crm-kanban-col {
  flex: 0 0 240px;
  max-width: 260px;
  background: #f8fafc;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  border-top: 3px solid var(--stage-color, var(--crm-primary));
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.crm-kanban-col-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.7rem 0.4rem;
}

.crm-kanban-col-head strong {
  display: block;
  font-size: 0.8rem;
}

.crm-kanban-col-head span,
.crm-kanban-col-meta {
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-kanban-drop {
  flex: 1;
  padding: 0.35rem 0.55rem 0.65rem;
  min-height: 120px;
}

.crm-kanban-drop.drag-over {
  background: #f0fdfa;
  outline: 1px dashed #99f6e4;
  border-radius: 8px;
}

.crm-deal-card {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.45rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: grab;
}

.crm-deal-card.dragging {
  opacity: 0.55;
}

.crm-deal-card-link {
  color: inherit;
  display: block;
}

.crm-deal-card-link strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.crm-deal-card-link span {
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-deal-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-deal-move-form {
  margin-top: 0.4rem;
}

.crm-deal-move-form .form-select {
  min-height: 28px;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
}

.crm-kanban-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 1rem 0.5rem;
}

.crm-stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.crm-stage-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  background: #fff;
}

.crm-stage-item.dragging {
  opacity: 0.5;
}

.crm-stage-handle {
  color: #94a3b8;
  cursor: grab;
}

.crm-stage-color {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.crm-pipeline {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
}

.crm-pipe-col {
  flex: 0 0 200px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 0.65rem;
  min-height: 160px;
}

/* ??? Activities / Timeline ??? */
.crm-activity-composer {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 70%);
}

.crm-activity-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.crm-activity-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--crm-muted);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}

.crm-activity-type-pill i { font-size: 0.85rem; }

.crm-activity-type-pill.is-active,
.crm-activity-type-pill:has(input:checked) {
  border-color: var(--crm-primary);
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  font-weight: 600;
}

.crm-activity-type-pill.tone-call:has(input:checked) { border-color: #0284c7; color: #0369a1; background: #e0f2fe; }
.crm-activity-type-pill.tone-meeting:has(input:checked) { border-color: #7c3aed; color: #6d28d9; background: #ede9fe; }
.crm-activity-type-pill.tone-email:has(input:checked) { border-color: #ea580c; color: #c2410c; background: #ffedd5; }
.crm-activity-type-pill.tone-note:has(input:checked) { border-color: #ca8a04; color: #a16207; background: #fef9c3; }
.crm-activity-type-pill.tone-sms:has(input:checked) { border-color: #059669; color: #047857; background: #d1fae5; }

.crm-activity-call-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.crm-activity-outcome {
  margin: 0;
  cursor: pointer;
}

.crm-activity-outcome input { display: none; }

.crm-activity-outcome span {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: var(--crm-muted);
  background: #fff;
}

.crm-activity-outcome input:checked + span {
  border-color: #0284c7;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

.crm-timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.crm-timeline-filter {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--crm-muted);
  border: 1px solid transparent;
  background: #f1f5f9;
}

.crm-timeline-filter:hover { color: var(--crm-ink); }

.crm-timeline-filter.is-active {
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  border-color: #99f6e4;
  font-weight: 600;
}

.crm-timeline-day { margin-bottom: 1rem; }

.crm-timeline-day-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--crm-muted);
  margin-bottom: 0.55rem;
}

.crm-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-right: 2px solid #e2e8f0;
  margin-right: 0.85rem;
}

.crm-timeline-item {
  position: relative;
  display: flex;
  gap: 0.65rem;
  padding: 0 0 0.85rem 0;
  margin-right: -0.85rem;
}

.crm-timeline-item:last-child { padding-bottom: 0; }

.crm-timeline-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: var(--crm-muted);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  z-index: 1;
}

.crm-timeline-item.tone-call .crm-timeline-icon { background: #e0f2fe; color: #0369a1; }
.crm-timeline-item.tone-meeting .crm-timeline-icon { background: #ede9fe; color: #6d28d9; }
.crm-timeline-item.tone-email .crm-timeline-icon { background: #ffedd5; color: #c2410c; }
.crm-timeline-item.tone-note .crm-timeline-icon { background: #fef9c3; color: #a16207; }
.crm-timeline-item.tone-sms .crm-timeline-icon { background: #d1fae5; color: #047857; }
.crm-timeline-item.tone-system .crm-timeline-icon { background: #f1f5f9; color: #475569; }

.crm-timeline-body {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.65rem 0.45rem;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #fff;
}

.crm-timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.crm-timeline-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.crm-timeline-type {
  font-size: 0.68rem;
  color: var(--crm-muted);
  font-weight: 600;
}

.crm-timeline-title {
  font-size: 0.84rem;
  font-weight: 600;
}

.crm-timeline-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--crm-muted);
  white-space: nowrap;
}

.crm-timeline-text {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* ??? Tags ??? */
.crm-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.crm-tag-chips-compact { margin-top: 0.25rem; }

.crm-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tag-color, var(--crm-primary));
  background: var(--tag-soft, var(--crm-primary-soft));
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--crm-primary)) 28%, transparent);
  line-height: 1.3;
}

.crm-tag-chip i { font-size: 0.72rem; }

.crm-tag-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.crm-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 140px;
  overflow: auto;
  padding: 0.15rem 0;
}

.crm-tag-option {
  margin: 0;
  cursor: pointer;
}

.crm-tag-option input { display: none; }

.crm-tag-option span {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: var(--crm-muted);
  background: #fff;
}

.crm-tag-option input:checked + span {
  color: var(--tag-color, var(--crm-primary));
  background: var(--tag-soft, var(--crm-primary-soft));
  border-color: color-mix(in srgb, var(--tag-color, var(--crm-primary)) 35%, transparent);
  font-weight: 600;
}

.crm-tag-create-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.crm-tag-create-row .form-control { flex: 1; }

.crm-tag-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  vertical-align: middle;
}

.crm-tag-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.crm-tag-palette-item {
  margin: 0;
  cursor: pointer;
}

.crm-tag-palette-item span {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.crm-tag-palette-item:has(input:checked) span {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #0f172a33;
}

.crm-advanced-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--crm-border);
  background: #fafbfc;
}

.crm-advanced-filters .form-select {
  width: auto;
  min-height: 32px;
  font-size: 0.8rem;
}

/* ??? Notifications ??? */
.crm-notif-bell { position: relative; }

.crm-notif-trigger { position: relative; }

.crm-notif-trigger.has-unread {
  border-color: #99f6e4;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
}

.crm-notif-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #be123c;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
  animation: crm-notif-pulse 1.8s ease-in-out infinite;
}

@keyframes crm-notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.crm-notif-dropdown {
  width: min(360px, calc(100vw - 1.5rem));
  padding: 0;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.crm-notif-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  font-size: 0.85rem;
}

.crm-notif-dropdown-list {
  max-height: 340px;
  overflow: auto;
}

.crm-notif-dropdown-foot {
  padding: 0.55rem 0.75rem;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.crm-notif-empty {
  padding: 1.4rem 1rem;
  text-align: center;
  color: var(--crm-muted);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.crm-notif-empty i { font-size: 1.25rem; color: var(--crm-success); }

.crm-notif-feed .crm-notif-item {
  border-bottom: 1px solid #f1f5f9;
}

.crm-notif-feed .crm-notif-item:last-child { border-bottom: 0; }

.crm-notif-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: #fff;
  transition: background .12s;
}

.crm-notif-item:hover { background: #f8fafc; }

.crm-notif-item.is-unread {
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.06), transparent 55%);
}

.crm-notif-item.is-compact {
  padding: 0.55rem 0.75rem;
}

.crm-notif-icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  background: #f1f5f9;
  color: var(--crm-muted);
}

.crm-notif-item.tone-task .crm-notif-icon { background: #ccfbf1; color: #0f766e; }
.crm-notif-item.tone-lead .crm-notif-icon { background: #fef9c3; color: #a16207; }
.crm-notif-item.tone-deal .crm-notif-icon { background: #e0f2fe; color: #0369a1; }
.crm-notif-item.tone-due .crm-notif-icon { background: #ffe4e6; color: #be123c; }

.crm-notif-body { flex: 1; min-width: 0; }

.crm-notif-link {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  color: inherit;
}

.crm-notif-link strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.crm-notif-text {
  font-size: 0.8rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-notif-meta {
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-notif-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--crm-muted);
}

.crm-notif-actions {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

/* ??? Dashboard Home ??? */
.crm-dash-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--crm-border);
  background:
    radial-gradient(600px 180px at 100% 0%, rgba(15, 118, 110, 0.12), transparent 60%),
    linear-gradient(180deg, #fff, #f8fafc);
}

.crm-dash-kicker {
  margin: 0 0 0.25rem;
  color: var(--crm-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.crm-dash-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.crm-dash-hero-text p:last-child {
  margin: 0.35rem 0 0;
  color: var(--crm-muted);
  font-size: 0.85rem;
}

.crm-dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.crm-dash-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.crm-dash-counter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--crm-border);
  background: #fff;
  color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  min-height: 64px;
}

.crm-dash-counter:hover {
  border-color: #99f6e4;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.crm-dash-counter i {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: #f1f5f9;
  color: var(--crm-muted);
}

.crm-dash-counter strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.1;
  font-weight: 700;
}

.crm-dash-counter span {
  display: block;
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-dash-counter small {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.crm-dash-counter.is-today i { background: #ccfbf1; color: #0f766e; }
.crm-dash-counter.is-overdue i { background: #ffedd5; color: #c2410c; }
.crm-dash-counter.is-meet i { background: #ede9fe; color: #6d28d9; }
.crm-dash-counter.is-deal i { background: #e0f2fe; color: #0369a1; }
.crm-dash-counter.is-lead i { background: #fef9c3; color: #a16207; }
.crm-dash-counter.is-bell i { background: #ffe4e6; color: #be123c; }

.crm-dash-counter.has-alert {
  border-color: #fdba74;
  background: #fff7ed;
}

.crm-roadmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}

.crm-roadmap-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: inherit;
  text-align: center;
}

.crm-roadmap-day:hover {
  background: #f8fafc;
  border-color: var(--crm-border);
}

.crm-roadmap-day.is-today {
  background: var(--crm-primary-soft);
  border-color: #99f6e4;
}

.crm-roadmap-label {
  font-size: 0.68rem;
  color: var(--crm-muted);
  font-weight: 600;
}

.crm-roadmap-bar-wrap {
  height: 76px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.crm-roadmap-bar {
  width: 18px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  min-height: 8px;
}

.crm-roadmap-day strong {
  font-size: 0.85rem;
}

.crm-roadmap-date {
  font-size: 0.65rem;
  color: #94a3b8;
}

.crm-dash-task {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.crm-dash-task:last-child { border-bottom: 0; }

.crm-dash-task.is-overdue .crm-task-title { color: #c2410c; }

.crm-dash-meeting {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.crm-dash-meeting:last-child { border-bottom: 0; }

.crm-dash-meeting .crm-notif-icon {
  background: #ede9fe;
  color: #6d28d9;
}

.crm-funnel { display: flex; flex-direction: column; gap: 0.55rem; }

.crm-funnel-row {
  display: block;
  color: inherit;
  padding: 0.35rem 0.25rem;
  border-radius: 8px;
}

.crm-funnel-row:hover { background: #f8fafc; }

.crm-funnel-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.crm-funnel-track {
  height: 8px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.crm-funnel-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--stage-color, var(--crm-primary));
  transition: width .25s ease;
}

.crm-funnel-sub { font-size: 0.7rem; margin-top: 0.15rem; }

.crm-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  min-height: 120px;
}

.crm-bars-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.crm-bars-value {
  font-size: 0.68rem;
  color: var(--crm-muted);
  font-weight: 600;
}

.crm-bars-fill {
  width: 100%;
  max-width: 28px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #5eead4, #0f766e);
  min-height: 4px;
}

.crm-bars-label {
  font-size: 0.62rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.2;
}

.crm-dash-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.crm-dash-shortcuts a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  color: var(--crm-ink);
  font-size: 0.82rem;
  font-weight: 500;
}

.crm-dash-shortcuts a:hover {
  border-color: #99f6e4;
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
}

.crm-dash-shortcuts i { color: var(--crm-primary); }

@media (max-width: 768px) {
  .crm-roadmap { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crm-dash-hero { padding: 0.85rem; }
}

/* Dashboard v2 */
.crm-dash-v2 { display: flex; flex-direction: column; gap: 0.85rem; }

.crm-dash-hero-v2 {
  margin-bottom: 0;
  background:
    radial-gradient(700px 200px at 0% 0%, rgba(15, 118, 110, 0.14), transparent 55%),
    radial-gradient(500px 160px at 100% 100%, rgba(3, 105, 161, 0.08), transparent 50%),
    linear-gradient(180deg, #fff, #f8fafc);
}

.crm-dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.45rem;
}

.crm-dash-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--crm-border);
  background: #fff;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--crm-ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.crm-dash-action:hover {
  border-color: #99f6e4;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  color: inherit;
}

.crm-dash-action i {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: #f1f5f9;
  color: var(--crm-primary);
}

.crm-dash-action.is-primary i { background: #ccfbf1; color: #0f766e; }
.crm-dash-action.is-lead i { background: #fef9c3; color: #a16207; }
.crm-dash-action.is-deal i { background: #e0f2fe; color: #0369a1; }
.crm-dash-action.is-calendar i { background: #ede9fe; color: #6d28d9; }
.crm-dash-action.is-report i { background: #ecfdf5; color: #059669; }
.crm-dash-action.is-invoice i { background: #fce7f3; color: #be185d; }
.crm-dash-action.is-bell i { background: #ffe4e6; color: #be123c; }

.crm-dash-month {
  border: 1px solid var(--crm-border);
  border-radius: 14px;
  background: #fff;
  padding: 0.85rem 1rem;
}

.crm-dash-month-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.crm-dash-month-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.crm-dash-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.crm-dash-stat {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}

.crm-dash-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-dash-stat strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 0.15rem;
}

.crm-dash-stat small {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
}

.crm-dash-stat.is-won { border-color: #a7f3d0; background: #ecfdf5; }
.crm-dash-stat.is-money { border-color: #bae6fd; background: #f0f9ff; }
.crm-dash-stat.is-alert { border-color: #fed7aa; background: #fff7ed; }

.crm-dash-stat-link {
  font-size: 0.68rem;
  color: var(--crm-primary);
  font-weight: 600;
}

.crm-dash-chart-card {
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 1rem;
  height: 100%;
}

.crm-dash-chart-wrap {
  position: relative;
  height: 260px;
}

.crm-dash-chart-wrap.is-donut {
  height: 200px;
  max-width: 220px;
  margin: 0 auto;
}

.crm-dash-type-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.crm-dash-type-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.82rem;
}

.crm-dash-type-row i { color: var(--crm-primary); }
.crm-dash-type-row strong { margin-inline-start: auto; }

.crm-dash-feed-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  color: inherit;
  text-decoration: none;
}

.crm-dash-feed-row:last-child { border-bottom: 0; }
.crm-dash-feed-row:hover strong { color: var(--crm-primary); }

.crm-dash-feed-row i {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: var(--crm-muted);
  flex-shrink: 0;
}

.crm-dash-feed-row strong {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-dash-feed-row span {
  display: block;
  font-size: 0.68rem;
  color: var(--crm-muted);
}

.crm-dash-report-cta {
  background: linear-gradient(135deg, #f0fdfa, #fff);
  border-color: #99f6e4;
}

@media (max-width: 768px) {
  .crm-dash-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-dash-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ??? Calendar wall ??? */
.crm-cal-shell { display: flex; flex-direction: column; gap: 0.75rem; }

.crm-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-end;
}

.crm-cal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.crm-cal-subtitle {
  margin: 0.2rem 0 0;
  color: var(--crm-muted);
  font-size: 0.82rem;
}

.crm-cal-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.crm-cal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
}

.crm-cal-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.crm-cal-filter-form .form-select {
  width: auto;
  min-height: 32px;
  font-size: 0.8rem;
}

.crm-cal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.crm-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.crm-cal-weekdays div {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--crm-muted);
  padding: 0.25rem;
}

.crm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.crm-cal-cell {
  min-height: 118px;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: border-color .15s, box-shadow .15s;
}

.crm-cal-cell.is-muted {
  background: #f8fafc;
  opacity: 0.72;
}

.crm-cal-cell.is-today {
  border-color: #5eead4;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
  background: linear-gradient(180deg, #f0fdfa, #fff);
}

.crm-cal-cell.is-focus:not(.is-today) {
  border-color: #99f6e4;
}

.crm-cal-cell:hover {
  border-color: #99f6e4;
}

.crm-cal-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.25rem;
}

.crm-cal-daynum {
  color: inherit;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.crm-cal-daynum strong {
  font-size: 0.95rem;
}

.crm-cal-daynum span {
  font-size: 0.62rem;
  color: var(--crm-muted);
}

.crm-cal-add {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-muted);
  border: 1px solid transparent;
  font-size: 0.85rem;
}

.crm-cal-add:hover {
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  border-color: #99f6e4;
}

.crm-cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-height: 0;
}

.crm-cal-event {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1.25;
}

.crm-cal-event:hover {
  border-color: #99f6e4;
  background: #fff;
}

.crm-cal-event.is-dense {
  padding: 0.18rem 0.35rem;
}

.crm-cal-event.tone-task {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.crm-cal-event.tone-meeting {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.crm-cal-event.is-overdue {
  border-color: #fdba74;
  background: #fff7ed;
}

.crm-cal-event.is-done {
  opacity: 0.65;
  text-decoration: line-through;
}

.crm-cal-event-time {
  font-weight: 700;
  color: var(--crm-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.crm-cal-event.tone-meeting .crm-cal-event-time { color: #6d28d9; }

.crm-cal-event-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-cal-event-status,
.crm-cal-event-meta {
  color: var(--crm-muted);
  font-size: 0.68rem;
}

.crm-cal-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.crm-cal-more {
  font-size: 0.68rem;
  color: var(--crm-primary);
  font-weight: 600;
}

.crm-cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.crm-cal-week-col {
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.crm-cal-week-col.is-today {
  border-color: #5eead4;
  background: linear-gradient(180deg, #f0fdfa, #fff);
}

.crm-cal-week-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}

.crm-cal-week-head a {
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.crm-cal-week-head strong { font-size: 0.82rem; }
.crm-cal-week-head span { font-size: 0.7rem; color: var(--crm-muted); }

.crm-cal-week-body {
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.crm-cal-empty {
  margin: 0.75rem 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
}

.crm-cal-day-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-end;
  padding: 0.9rem 1rem;
  border: 1px solid var(--crm-border);
  border-radius: 14px;
  background:
    radial-gradient(500px 160px at 0% 0%, rgba(15, 118, 110, 0.1), transparent 60%),
    #fff;
  margin-bottom: 0.75rem;
}

.crm-cal-day-hero h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
}

.crm-cal-agenda {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.crm-cal-agenda-card {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--crm-border);
  background: #fff;
}

.crm-cal-agenda-card.tone-task { border-color: #99f6e4; }
.crm-cal-agenda-card.tone-meeting { border-color: #ddd6fe; }
.crm-cal-agenda-card.is-overdue { border-color: #fdba74; background: #fff7ed; }

.crm-cal-agenda-time {
  min-width: 64px;
  text-align: center;
}

.crm-cal-agenda-time strong {
  display: block;
  font-size: 1.05rem;
  color: var(--crm-primary);
}

.crm-cal-agenda-time span {
  font-size: 0.7rem;
  color: var(--crm-muted);
}

.crm-cal-agenda-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--crm-ink);
  font-size: 0.95rem;
}

.crm-cal-agenda-main { flex: 1; min-width: 0; }

@media (max-width: 1100px) {
  .crm-cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .crm-cal-grid,
  .crm-cal-weekdays { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-cal-weekdays div:nth-child(n+3) { display: none; }
}

/* --- Calendar v2 (time grid) --- */
.crm-cal-shell-v2 { gap: 0.5rem; }

.crm-cal-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
}

.crm-cal-topbar-start,
.crm-cal-topbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.crm-cal-view-toggle {
  display: inline-flex;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.crm-cal-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--crm-muted);
  text-decoration: none;
  border-left: 1px solid var(--crm-border);
}

.crm-cal-view-btn:first-child { border-left: none; }
.crm-cal-view-btn:hover { color: var(--crm-ink); background: #fff; }
.crm-cal-view-btn.active { background: #fff; color: var(--crm-ink); box-shadow: inset 0 0 0 1px #e2e8f0; }

.crm-cal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.crm-cal-range {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--crm-ink);
  padding: 0 0.35rem;
  white-space: nowrap;
}

.crm-cal-typebar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
}

.crm-cal-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--crm-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.crm-cal-type-pill:hover { color: var(--crm-ink); background: #f8fafc; }
.crm-cal-type-pill.active {
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  border-color: #99f6e4;
}

.crm-cal-advanced-filters {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
}

.crm-cal-view-pills {
  display: inline-flex;
  gap: 0.25rem;
}

.crm-cal-timegrid {
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
}

.crm-cal-timegrid-scroll {
  overflow: auto;
}

.crm-cal-timegrid-inner {
  position: relative;
  min-width: 900px;
}

.crm-cal-timegrid-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr)) 56px;
  grid-auto-rows: var(--cal-slot-height, 48px);
  position: relative;
}

.crm-cal-timegrid-events {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.crm-cal-timegrid-events .crm-cal-timegrid-event {
  pointer-events: auto;
}

.crm-cal-timegrid-dayhead {
  grid-row: 1;
  text-align: center;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--crm-border);
  border-right: 1px solid #f1f5f9;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  height: auto;
  min-height: 52px;
}

.crm-cal-timegrid-corner {
  grid-row: 1;
  border-bottom: 1px solid var(--crm-border);
  border-right: 1px solid #f1f5f9;
  background: #fafbfc;
}

.crm-cal-timegrid-dayhead strong {
  font-size: 0.82rem;
  font-weight: 700;
}

.crm-cal-timegrid-dayhead span {
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-cal-timegrid-dayhead.is-today {
  background: linear-gradient(180deg, #f0fdfa, #fafbfc);
}

.crm-cal-timegrid-slot {
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f8fafc;
  background: #fff;
  min-height: var(--cal-slot-height, 48px);
}

.crm-cal-timegrid-slot.is-today {
  background: rgba(240, 253, 250, 0.35);
}

.crm-cal-timegrid-slot.drag-over {
  background: rgba(153, 246, 228, 0.25);
  outline: 2px dashed #5eead4;
  outline-offset: -2px;
}

.crm-cal-timegrid-time {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.15rem;
  border-bottom: 1px solid #f8fafc;
  border-right: 1px solid #f1f5f9;
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  background: #fafbfc;
  min-height: var(--cal-slot-height, 48px);
}

.crm-cal-timegrid-event {
  position: absolute;
  z-index: 2;
  margin: 0;
  border-radius: 6px;
  overflow: visible;
  font-size: 0.72rem;
  line-height: 1.2;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: box-shadow .15s, opacity .15s;
  min-height: 20px;
  box-sizing: border-box;
  max-width: calc((100% - var(--cal-time-col, 56px)) / var(--cal-cols, 7) - 6px);
}

.crm-cal-timegrid-event-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  height: 100%;
  padding: 0.25rem 0.4rem;
  color: inherit;
  text-decoration: none;
  border-radius: 5px;
  overflow: hidden;
  box-sizing: border-box;
}

.crm-cal-timegrid-event.dragging {
  opacity: 0.55;
  cursor: grabbing;
  z-index: 10;
}

.crm-cal-timegrid-event.dragging .crm-cal-event-tooltip {
  display: none;
}

.crm-cal-timegrid-event:hover {
  z-index: 25;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.crm-cal-timegrid-event:hover .crm-cal-event-tooltip {
  opacity: 1;
  visibility: visible;
}

.crm-cal-event-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 200px;
  max-width: 280px;
  padding: 0.55rem 0.65rem;
  background: #0f172a;
  color: #f1f5f9;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  transition: opacity .15s, visibility .15s;
  white-space: normal;
}

.crm-cal-event-tooltip-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fff;
}

.crm-cal-event-tooltip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.2rem;
  color: #cbd5e1;
}

.crm-cal-event-tooltip-row.is-muted {
  color: #94a3b8;
}

.crm-cal-event-tooltip-row i {
  margin-left: 0.2rem;
}

.crm-cal-event-tooltip-body {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.68rem;
  line-height: 1.55;
}

.crm-cal-timegrid-event-label {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-cal-timegrid-event-title {
  font-size: 0.68rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-cal-timegrid-event.tone-task {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.crm-cal-timegrid-event.tone-meeting {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
}

.crm-cal-timegrid-event.tone-call {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
}

.crm-cal-timegrid-event.tone-note {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #854d0e;
}

.crm-cal-timegrid-event.tone-sms {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.crm-cal-timegrid-event.tone-email {
  background: #fce7f3;
  border: 1px solid #f9a8d4;
  color: #9d174d;
}

.crm-cal-timegrid-event.is-overdue {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.crm-cal-timegrid-event.is-done {
  opacity: 0.55;
}

.crm-cal-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.crm-cal-list-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
}

.crm-cal-list-item.tone-task { border-color: #93c5fd; }
.crm-cal-list-item.tone-meeting { border-color: #c4b5fd; }
.crm-cal-list-item.is-overdue { border-color: #fdba74; background: #fff7ed; }

.crm-cal-list-date {
  min-width: 72px;
  text-align: center;
}

.crm-cal-list-date strong {
  display: block;
  font-size: 1rem;
  color: var(--crm-primary);
}

.crm-cal-list-date span {
  display: block;
  font-size: 0.68rem;
  color: var(--crm-muted);
}

.crm-cal-list-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--crm-ink);
  text-decoration: none;
}

@media (max-width: 768px) {
  .crm-cal-range { font-size: 0.72rem; white-space: normal; }
  .crm-cal-typebar { overflow-x: auto; flex-wrap: nowrap; }
  .crm-cal-timegrid-grid { grid-template-columns: repeat(7, minmax(90px, 1fr)) 44px; min-width: 680px; }
}

/* --- Reports --- */
.crm-rpt-shell { display: flex; flex-direction: column; gap: 0.85rem; }

.crm-rpt-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.crm-rpt-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--crm-ink);
}

.crm-rpt-hero-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.crm-rpt-filters .crm-card-body { padding: 0.85rem 1rem; }

.crm-rpt-tabs { flex-wrap: wrap; }

.crm-rpt-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}

.crm-rpt-kpi {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fff;
  min-height: 0;
}

.crm-rpt-kpi i {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.crm-rpt-kpi strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.crm-rpt-kpi span {
  display: block;
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-rpt-kpi small {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.crm-rpt-kpi.is-won i { background: #d1fae5; color: #059669; }
.crm-rpt-kpi.is-rate i { background: #e0f2fe; color: #0369a1; }
.crm-rpt-kpi.is-alert { border-color: #fed7aa; }
.crm-rpt-kpi.is-alert i { background: #ffedd5; color: #c2410c; }

.crm-rpt-hbar { margin-bottom: 0.55rem; }
.crm-rpt-hbar:last-child { margin-bottom: 0; }

.crm-rpt-hbar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.crm-rpt-hbar-track {
  height: 7px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.crm-rpt-hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--bar-color, var(--crm-primary));
  transition: width .25s ease;
}

.crm-rpt-hbar-sub {
  font-size: 0.68rem;
  color: var(--crm-muted);
  margin-top: 0.15rem;
}

.crm-rpt-funnel-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.crm-rpt-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #f8fafc;
  flex: 1 1 140px;
}

.crm-rpt-step.is-won { background: #ecfdf5; border-color: #a7f3d0; }

.crm-rpt-step-n {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crm-rpt-step strong { display: block; font-size: 1rem; }
.crm-rpt-step span { display: block; font-size: 0.7rem; color: var(--crm-muted); }
.crm-rpt-step small { display: block; font-size: 0.68rem; color: #0f766e; }

.crm-rpt-step-arrow { color: #cbd5e1; font-size: 0.85rem; }

.crm-rpt-conv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.crm-rpt-conv-grid > div {
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.crm-rpt-conv-grid span {
  display: block;
  font-size: 0.68rem;
  color: var(--crm-muted);
}

.crm-rpt-conv-grid strong {
  display: block;
  font-size: 1rem;
  margin-top: 0.1rem;
}

.crm-rpt-footnote {
  font-size: 0.72rem;
  color: var(--crm-muted);
  line-height: 1.6;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
}

.crm-rpt-footnote code {
  font-size: 0.68rem;
  background: #eef2f7;
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
}

.crm-rpt-rank {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.crm-rpt-rank:last-child { border-bottom: 0; }

.crm-rpt-rank-n {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-rpt-rank strong { display: block; font-size: 0.82rem; }
.crm-rpt-rank-amt { font-size: 0.8rem; color: #0f766e; }

.crm-rpt-wonlost {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.crm-rpt-wl {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid #eef2f7;
}

.crm-rpt-wl.is-won { background: #ecfdf5; border-color: #a7f3d0; }
.crm-rpt-wl.is-lost { background: #fef2f2; border-color: #fecaca; }
.crm-rpt-wl.is-won i { color: #059669; }
.crm-rpt-wl.is-lost i { color: #dc2626; }
.crm-rpt-wl strong { display: block; font-size: 1.1rem; }
.crm-rpt-wl span { display: block; font-size: 0.72rem; color: var(--crm-muted); }
.crm-rpt-wl small { display: block; font-size: 0.68rem; margin-top: 0.15rem; }

.crm-rpt-act-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.crm-rpt-act-card {
  padding: 0.55rem 0.65rem;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fff;
}

.crm-rpt-act-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

.crm-rpt-act-head i { color: var(--crm-primary); }
.crm-rpt-act-head span { flex: 1; }
.crm-rpt-act-head strong { font-size: 0.9rem; }

.crm-rpt-task-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.crm-rpt-task-stats > div {
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}

.crm-rpt-task-stats strong { display: block; font-size: 1.15rem; }
.crm-rpt-task-stats span { font-size: 0.72rem; color: var(--crm-muted); }
.crm-rpt-task-stats .is-alert { border-color: #fed7aa; background: #fff7ed; }

@media (max-width: 1200px) {
  .crm-rpt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .crm-rpt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-rpt-act-grid { grid-template-columns: 1fr; }
  .crm-rpt-conv-grid { grid-template-columns: 1fr; }
  .crm-rpt-step-arrow { display: none; }
}

.crm-rpt-delta {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  margin-inline-start: 0.25rem;
  vertical-align: middle;
}

.crm-rpt-delta.is-up { background: #dcfce7; color: #166534; }
.crm-rpt-delta.is-down { background: #fee2e2; color: #991b1b; }
.crm-rpt-delta.is-flat { background: #f1f5f9; color: #64748b; }

.crm-rpt-chart-card {
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 1rem;
  height: 100%;
}

.crm-rpt-chart-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.crm-rpt-chart-wrap {
  position: relative;
  height: 240px;
}

.crm-rpt-chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--crm-muted);
}

.crm-rpt-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-inline-end: 0.25rem;
  vertical-align: middle;
}

.crm-rpt-legend-dot.is-current { background: rgba(15, 118, 110, 0.75); }
.crm-rpt-legend-dot.is-previous { background: rgba(148, 163, 184, 0.65); }

.crm-rpt-compare-hbar { margin-bottom: 0.65rem; }
.crm-rpt-compare-tracks { display: flex; flex-direction: column; gap: 0.2rem; }

.crm-rpt-hbar-fill.is-current { background: #0f766e; }
.crm-rpt-hbar-fill.is-previous { background: #94a3b8; }
.crm-rpt-hbar-track.is-muted { opacity: 0.85; }
.crm-rpt-hbar-fill.is-warning { background: #f59e0b; }

.crm-rpt-table-card { margin-top: 0.5rem; }
.crm-rpt-table thead th { font-size: 0.75rem; white-space: nowrap; }

/* --- Automations --- */
.crm-auto-chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: #f8fafc;
  font-size: 0.82rem;
}
.crm-auto-chip:last-child { margin-bottom: 0; }
.crm-auto-row .form-label.small { margin-bottom: 0.15rem; }

.crm-dl { display: grid; grid-template-columns: 110px 1fr; gap: 0.35rem 0.75rem; margin: 0; font-size: 0.84rem; }
.crm-dl dt { color: var(--crm-muted); margin: 0; }
.crm-dl dd { margin: 0; }

/* --- Settings hub --- */
.crm-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.55rem;
}

.crm-settings-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fff;
  color: var(--crm-ink);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.crm-settings-card:hover {
  border-color: #99f6e4;
  background: var(--crm-primary-soft);
  color: var(--crm-ink);
}

.crm-settings-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #ccfbf1;
  color: #0f766e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.crm-settings-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.crm-settings-card-body strong {
  font-size: 0.88rem;
  font-weight: 700;
}

.crm-settings-card-body span {
  font-size: 0.72rem;
  color: var(--crm-muted);
  line-height: 1.35;
}

.crm-settings-card-arrow {
  color: #cbd5e1;
  font-size: 0.85rem;
}

/* --- Catalog choice rows --- */
.crm-choice-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  margin: 0;
}
.crm-choice-row:has(input:checked) {
  border-color: #99f6e4;
  background: var(--crm-primary-soft);
}
.crm-choice-row input { margin: 0; }
.crm-choice-row i { color: var(--crm-primary); }

.crm-inv-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.crm-inv-totals > div {
  padding: 0.5rem 0.6rem;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #f8fafc;
}
.crm-inv-totals span { display: block; font-size: 0.7rem; color: var(--crm-muted); }
.crm-inv-totals strong { display: block; font-size: 0.95rem; margin-top: 0.1rem; }
.crm-inv-totals .is-grand { background: #ecfdf5; border-color: #a7f3d0; }

/* Jalali date picker ? CRM theme */
.crm-date-field { position: relative; }

jdp-container {
  --jdp-day-size: 36px;
  --jdp-primary: var(--crm-primary);
  --jdp-color-0: var(--crm-surface);
  --jdp-color-1: #f8fafc;
  --jdp-color-2: var(--crm-border);
  --jdp-color-3: #cbd5e1;
  --jdp-color-4: var(--crm-muted);
  --jdp-color-5: var(--crm-ink);
  --jdp-red: var(--crm-danger);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  border-radius: 10px;
  box-shadow: var(--crm-shadow);
  z-index: 1060 !important;
}

jdp-container .jdp-days-header {
  border-radius: 8px;
}

jdp-container .jdp-btn-today,
jdp-container .jdp-btn-empty,
jdp-container .jdp-btn-close {
  background: var(--crm-primary);
  font-size: 0.78rem;
  min-height: 30px;
}

jdp-container .jdp-btn-today:hover,
jdp-container .jdp-btn-empty:hover,
jdp-container .jdp-btn-close:hover {
  background: var(--crm-primary-hover);
}

/* --- Dark theme --- */
[data-theme="dark"] {
  color-scheme: dark;

  --crm-primary: #2dd4bf;
  --crm-primary-hover: #5eead4;
  --crm-primary-soft: rgba(45, 212, 191, 0.14);
  --crm-ink: #e2e8f0;
  --crm-muted: #94a3b8;
  --crm-border: #334155;
  --crm-bg: #0f172a;
  --crm-surface: #1e293b;
  --crm-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .crm-shell {
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(45, 212, 191, 0.08), transparent 60%),
    radial-gradient(900px 400px at 0% 100%, rgba(15, 23, 42, 0.5), transparent 55%),
    var(--crm-bg);
}

[data-theme="dark"] .crm-topbar {
  background: rgba(15, 23, 42, 0.88);
  border-bottom-color: var(--crm-border);
}

[data-theme="dark"] .crm-search input {
  background: #0b1220;
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .crm-search input:focus {
  background: #111827;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

[data-theme="dark"] .crm-search input::placeholder {
  color: #64748b;
}

[data-theme="dark"] .crm-icon-btn,
[data-theme="dark"] .crm-user-chip,
[data-theme="dark"] .crm-switch,
[data-theme="dark"] .crm-choice-card,
[data-theme="dark"] .crm-perm-item {
  background: var(--crm-surface);
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .crm-icon-btn:hover,
[data-theme="dark"] .crm-theme-toggle:hover {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--crm-primary);
}

[data-theme="dark"] .crm-logout-btn {
  color: var(--crm-muted);
}

[data-theme="dark"] .crm-logout-btn:hover {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="dark"] .crm-body .form-label {
  color: #cbd5e1;
}

[data-theme="dark"] .crm-body .form-control,
[data-theme="dark"] .crm-body .form-select,
[data-theme="dark"] .crm-body textarea.form-control {
  background: #0b1220;
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .crm-body .form-control:focus,
[data-theme="dark"] .crm-body .form-select:focus {
  background: #111827;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

[data-theme="dark"] .crm-body .form-control::placeholder {
  color: #64748b;
}

[data-theme="dark"] .crm-choice-card:hover {
  background: rgba(45, 212, 191, 0.06);
  border-color: rgba(45, 212, 191, 0.35);
}

[data-theme="dark"] .crm-choice input:checked + .crm-choice-card {
  background: rgba(45, 212, 191, 0.1);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

[data-theme="dark"] .crm-choice-icon {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .crm-choice-check {
  border-color: #475569;
}

[data-theme="dark"] .crm-list-toolbar {
  background: #172033;
}

[data-theme="dark"] .crm-chip {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .crm-table thead th {
  background: #172033;
  color: #94a3b8;
}

[data-theme="dark"] .crm-table tbody td {
  border-bottom-color: #273449;
}

[data-theme="dark"] .crm-table tbody tr:hover {
  background: rgba(45, 212, 191, 0.06);
}

[data-theme="dark"] .crm-badge.neutral {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .crm-filter-pill {
  background: var(--crm-surface);
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .crm-filter-pill:hover,
[data-theme="dark"] .crm-filter-pill.active {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--crm-primary);
}

[data-theme="dark"] .crm-kanban-col {
  background: #172033;
  border-color: var(--crm-border);
}

[data-theme="dark"] .crm-kanban-drop.drag-over {
  background: rgba(45, 212, 191, 0.08);
  outline-color: rgba(45, 212, 191, 0.45);
}

[data-theme="dark"] .crm-deal-card,
[data-theme="dark"] .crm-stage-item {
  background: var(--crm-surface);
  border-color: var(--crm-border);
}

[data-theme="dark"] .crm-deal-card:hover {
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .crm-dash-hero {
  background:
    radial-gradient(600px 180px at 100% 0%, rgba(45, 212, 191, 0.12), transparent 60%),
    linear-gradient(180deg, #1e293b, #172033);
}

[data-theme="dark"] .crm-dash-counter,
[data-theme="dark"] .crm-dash-stat,
[data-theme="dark"] .crm-rpt-chart-card,
[data-theme="dark"] .crm-settings-card {
  background: var(--crm-surface);
  color: inherit;
}

[data-theme="dark"] .crm-dash-counter:hover,
[data-theme="dark"] .crm-settings-card:hover {
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .crm-dash-counter i,
[data-theme="dark"] .crm-roadmap-day:hover {
  background: #334155;
}

[data-theme="dark"] .crm-dash-task,
[data-theme="dark"] .crm-dash-meeting,
[data-theme="dark"] .crm-notif-item,
[data-theme="dark"] .crm-timeline-card {
  border-color: #273449;
}

[data-theme="dark"] .crm-timeline-item.tone-system .crm-timeline-icon {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .crm-timeline-card,
[data-theme="dark"] .crm-notif-dropdown,
[data-theme="dark"] .crm-quick-create-dropdown,
[data-theme="dark"] .dropdown-menu {
  background: var(--crm-surface);
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .dropdown-item {
  color: var(--crm-ink);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: rgba(45, 212, 191, 0.1);
  color: var(--crm-ink);
}

[data-theme="dark"] .crm-notif-dropdown-head,
[data-theme="dark"] .crm-notif-dropdown-foot,
[data-theme="dark"] .crm-quick-create-dropdown-head {
  border-color: var(--crm-border);
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .crm-quick-create-modal {
  background: var(--crm-surface);
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: var(--crm-border);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .btn-crm-outline {
  background: transparent;
  border-color: var(--crm-border);
  color: var(--crm-ink);
}

[data-theme="dark"] .btn-crm-outline:hover {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--crm-primary);
}

[data-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}

[data-theme="dark"] .alert {
  border-color: var(--crm-border);
}

[data-theme="dark"] .crm-auto-chip,
[data-theme="dark"] .crm-choice-row,
[data-theme="dark"] .crm-inv-totals > div,
[data-theme="dark"] .crm-rpt-task-stats > div {
  background: #172033;
  border-color: var(--crm-border);
}

[data-theme="dark"] .crm-settings-card-icon {
  background: rgba(45, 212, 191, 0.14);
  color: var(--crm-primary);
}

[data-theme="dark"] .crm-settings-card:hover {
  background: rgba(45, 212, 191, 0.08);
  color: var(--crm-ink);
}

[data-theme="dark"] .crm-rpt-delta.is-flat {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] a.crm-user-chip:hover {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
}

[data-theme="dark"] .crm-activity-log-item {
  border-bottom-color: #273449;
}

[data-theme="dark"] jdp-container {
  --jdp-color-1: #172033;
  --jdp-color-3: #475569;
}
