.crm-unified-page {
  --crm-page-bg: #f4f7fb;
  --crm-page-surface: #fff;
  --crm-page-soft: #f8fafc;
  --crm-page-border: #dce4ee;
  --crm-page-heading: #0f172a;
  --crm-page-text: #172033;
  --crm-page-muted: #617086;
  --crm-page-primary: #335eea;
  --crm-page-primary-soft: #eef2ff;
  --crm-page-cyan: #087f8c;
  --crm-page-cyan-soft: #e8f7f8;
  --crm-page-violet: #6d44c5;
  --crm-page-violet-soft: #f3efff;
  --crm-page-success: #087f5b;
  --crm-page-success-soft: #e8f7f1;
  --crm-page-warning: #a55b04;
  --crm-page-warning-soft: #fff5df;
  --crm-page-danger: #b4232d;
  --crm-page-danger-soft: #fff0f1;
  --crm-page-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .045);
  color: var(--crm-page-text);
  direction: rtl;
  text-align: right;
}

.crm-unified-page input[type="tel"],
.crm-unified-page input[inputmode="tel"],
.crm-unified-page [dir="ltr"],
.crm-unified-page .phone-input,
.crm-unified-page .token-value,
.crm-unified-page .code-block {
  direction: ltr !important;
  text-align: left !important;
}

.crm-unified-page .crm-content {
  min-width: 0;
  background:
    radial-gradient(circle at 92% 0, rgba(51, 94, 234, .065), transparent 28rem),
    var(--crm-page-bg) !important;
}

.crm-unified-page .crm-page-shell {
  width: min(100%, 1560px) !important;
  max-width: 1560px !important;
  margin: 0 auto !important;
  padding: 24px clamp(14px, 2.2vw, 30px) 88px !important;
  background: transparent !important;
}
.crm-unified-page .crm-page-shell.crm-page-shell-wide {
  width: 100% !important;
  max-width: 1780px !important;
}

.crm-unified-page .crm-page-header {
  position: relative;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1.25rem !important;
  padding: 0 0 1.1rem !important;
  border: 0 !important;
  border-bottom: 1px solid var(--crm-page-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--crm-page-text) !important;
}
.crm-unified-page .crm-page-header::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 76px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--crm-page-primary), var(--crm-page-cyan));
}
.crm-unified-page .crm-page-header h1,
.crm-unified-page .crm-page-header h2,
.crm-unified-page .crm-page-header h4,
.crm-unified-page .crm-page-header .page-title,
.crm-unified-page .crm-page-header .contacts-title {
  margin: 0 !important;
  color: var(--crm-page-heading) !important;
  font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
  font-weight: 800 !important;
  letter-spacing: -.02em;
}
.crm-unified-page .crm-page-header p,
.crm-unified-page .crm-page-header .text-muted,
.crm-unified-page .crm-page-header .contacts-subtitle {
  max-width: 760px;
  margin: .38rem 0 0 !important;
  color: var(--crm-page-muted) !important;
  font-size: .88rem !important;
  line-height: 1.7;
}
.crm-unified-page .crm-page-header > i,
.crm-unified-page .crm-page-header h1 > i,
.crm-unified-page .crm-page-header h2 > i,
.crm-unified-page .crm-page-header h4 > i,
.crm-unified-page .crm-page-header .page-title > i {
  color: var(--crm-page-primary) !important;
}
.crm-unified-page .crm-page-header .header-icon-wrapper,
.crm-unified-page .crm-page-header .header-icon-wrapper-wa,
.crm-unified-page .crm-page-header .header-title-icon {
  color: var(--crm-page-primary) !important;
  background: var(--crm-page-primary-soft) !important;
  box-shadow: none !important;
}
.crm-unified-page .crm-page-header .btn,
.crm-unified-page .crm-page-header button,
.crm-unified-page .crm-page-header a[class*="btn"] {
  min-height: 40px;
  border-radius: 10px !important;
}

.crm-unified-page .crm-page-stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: .75rem !important;
  margin-bottom: 1rem !important;
}
.crm-unified-page .crm-page-stats > *,
.crm-unified-page .crm-page-stats .stat-card,
.crm-unified-page .crm-page-stats .stats-card,
.crm-unified-page .crm-page-stats .call-stat-card,
.crm-unified-page .crm-page-stats .fc-stat-card {
  min-width: 0;
  min-height: 80px;
  margin: 0 !important;
  padding: .85rem 1rem !important;
  border: 1px solid var(--crm-page-border) !important;
  border-radius: 13px !important;
  background: var(--crm-page-surface) !important;
  box-shadow: var(--crm-page-shadow) !important;
  transform: none;
}
.crm-unified-page .crm-page-stats > *:hover,
.crm-unified-page .crm-page-stats .stat-card:hover,
.crm-unified-page .crm-page-stats .stats-card:hover,
.crm-unified-page .crm-page-stats .call-stat-card:hover {
  transform: translateY(-2px);
  border-color: #b9c9f8 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08) !important;
}
.crm-unified-page .crm-page-stats .stat-icon,
.crm-unified-page .crm-page-stats .call-stat-icon,
.crm-unified-page .crm-page-stats .fc-stat-icon {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px;
  border-radius: 11px !important;
}
.crm-unified-page .crm-page-stats .stat-value,
.crm-unified-page .crm-page-stats .stat-value-num,
.crm-unified-page .crm-page-stats .stats-value,
.crm-unified-page .crm-page-stats .call-stat-value,
.crm-unified-page .crm-page-stats .num {
  color: var(--crm-page-heading) !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
}

.crm-unified-page .crm-page-filters,
.crm-unified-page .crm-page-surface,
.crm-unified-page .crm-page-card {
  border: 1px solid var(--crm-page-border) !important;
  border-radius: 14px !important;
  background: var(--crm-page-surface) !important;
  box-shadow: var(--crm-page-shadow) !important;
}
.crm-unified-page .crm-page-filters {
  margin-bottom: 1rem !important;
  padding: 1rem !important;
}
.crm-unified-page .crm-page-filters label {
  margin-bottom: .32rem;
  color: var(--crm-page-muted) !important;
  font-size: .75rem !important;
  font-weight: 800 !important;
}
.crm-unified-page .crm-page-filters .form-control,
.crm-unified-page .crm-page-filters .form-select,
.crm-unified-page .crm-page-filters input,
.crm-unified-page .crm-page-filters select {
  min-height: 40px;
  border: 1px solid var(--crm-page-border) !important;
  border-radius: 9px !important;
  color: var(--crm-page-text);
  background-color: var(--crm-page-surface);
}
.crm-unified-page .crm-page-filter-advanced {
  border-style: dashed !important;
  background: var(--crm-page-soft) !important;
}

.crm-unified-page .crm-page-surface,
.crm-unified-page .crm-page-card { overflow: hidden; }
.crm-unified-page .crm-page-surface .card-header,
.crm-unified-page .crm-page-card .card-header,
.crm-unified-page .crm-page-card-header {
  padding: .9rem 1rem !important;
  border-bottom: 1px solid var(--crm-page-border) !important;
  color: var(--crm-page-heading) !important;
  background: var(--crm-page-soft) !important;
}
.crm-unified-page .crm-page-card .card-body { padding: 1rem; }

/* Normalize the native card systems used by the different CRM modules. */
.crm-unified-page .content-card,
.crm-unified-page .summary-card,
.crm-unified-page .campaign-card,
.crm-unified-page .rating-distribution,
.crm-unified-page .filter-card,
.crm-unified-page .ratings-table,
.crm-unified-page .employee-rating-card,
.crm-unified-page .settings-card,
.crm-unified-page .tab-content-wrapper,
.crm-unified-page .api-card,
.crm-unified-page .section-card,
.crm-unified-page .billing-card,
.crm-unified-page .template-card > .card,
.crm-unified-page .permissions-card {
  border: 1px solid var(--crm-page-border) !important;
  border-radius: 14px !important;
  background: var(--crm-page-surface) !important;
  box-shadow: var(--crm-page-shadow) !important;
}
.crm-unified-page .content-card-header,
.crm-unified-page .summary-card-header,
.crm-unified-page .api-card-header,
.crm-unified-page .section-header,
.crm-unified-page .settings-card > .card-header,
.crm-unified-page .template-card > .card > .card-header {
  border-bottom: 1px solid var(--crm-page-border) !important;
  color: var(--crm-page-heading) !important;
  background: var(--crm-page-soft) !important;
}
.crm-unified-page .campaign-card,
.crm-unified-page .employee-rating-card,
.crm-unified-page .template-card > .card {
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.crm-unified-page .campaign-card:hover,
.crm-unified-page .employee-rating-card:hover,
.crm-unified-page .template-card > .card:hover {
  transform: translateY(-2px);
  border-color: #b9c9f8 !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08) !important;
}

.ratings-unified-page .crm-page-stats > [class*="col-"] {
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.ratings-unified-page .crm-page-stats > [class*="col-"]:hover {
  transform: none;
  border-color: transparent !important;
  box-shadow: none !important;
}
.facebook-comments-page .crm-page-stats > [class*="col-"] {
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.facebook-comments-page .crm-page-stats > [class*="col-"]:hover {
  transform: none;
  border-color: transparent !important;
  box-shadow: none !important;
}
.ratings-unified-page .filter-card { padding: 1rem !important; }
.permissions-unified-page .container-fluid > .card { border: 1px solid var(--crm-page-border) !important; border-radius: 14px; box-shadow: var(--crm-page-shadow); }
.orders-unified-page .content-header > .container-fluid,
.orders-unified-page .content > .container-fluid { padding-right: 0; padding-left: 0; }
.billing-unified-page .billing-grid { gap: 1rem; }
.billing-unified-page .billing-card { margin-bottom: 1rem; }

.crm-unified-page .nav-tabs {
  gap: .35rem;
  padding: .35rem;
  border: 1px solid var(--crm-page-border) !important;
  border-radius: 12px;
  background: var(--crm-page-surface);
}
.crm-unified-page .nav-tabs .nav-link {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  color: var(--crm-page-muted) !important;
  background: transparent !important;
}
.crm-unified-page .nav-tabs .nav-link.active {
  color: var(--crm-page-primary) !important;
  background: var(--crm-page-primary-soft) !important;
  box-shadow: inset 0 0 0 1px rgba(51, 94, 234, .12);
}

.crm-unified-page table thead th {
  color: #42526a !important;
  background: var(--crm-page-soft) !important;
  border-bottom-color: var(--crm-page-border) !important;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.crm-unified-page table tbody td { border-bottom-color: #e9eef5 !important; }
.crm-unified-page table tbody tr:hover { background: rgba(51, 94, 234, .035) !important; }

.crm-unified-page .btn-primary,
.crm-unified-page a.btn-primary {
  border-color: var(--crm-page-primary) !important;
  background: var(--crm-page-primary) !important;
}
.crm-unified-page .btn-primary:hover,
.crm-unified-page a.btn-primary:hover { background: #2348c4 !important; }
.crm-unified-page .empty-state,
.crm-unified-page [class*="empty-state"] { color: var(--crm-page-muted); }

html[data-theme="dark"] .crm-unified-page {
  --crm-page-bg: #0b1220;
  --crm-page-surface: #111c2e;
  --crm-page-soft: #172033;
  --crm-page-border: #2b3a50;
  --crm-page-heading: #f8fafc;
  --crm-page-text: #dbe7f5;
  --crm-page-muted: #9aabc0;
  --crm-page-primary-soft: rgba(51, 94, 234, .16);
  --crm-page-cyan-soft: rgba(8, 127, 140, .16);
  --crm-page-violet-soft: rgba(109, 68, 197, .16);
}
html[data-theme="dark"] .crm-unified-page table thead th { color: #b8c7da !important; }
html[data-theme="dark"] .crm-unified-page table tbody td { border-bottom-color: var(--crm-page-border) !important; }

@media (max-width: 767.98px) {
  .crm-unified-page .crm-page-shell {
    padding: 14px 10px 72px !important;
  }
  .crm-unified-page .crm-page-header { flex-direction: column; }
  .crm-unified-page .crm-page-header > :last-child:not(:first-child) { width: 100%; }
  .crm-unified-page .crm-page-header .btn { flex: 1 1 auto; }
  .crm-unified-page .crm-page-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
  }
  .crm-unified-page .crm-page-stats > *,
  .crm-unified-page .crm-page-stats .stat-card,
  .crm-unified-page .crm-page-stats .stats-card,
  .crm-unified-page .crm-page-stats .call-stat-card { min-height: 70px; padding: .7rem !important; }
  .crm-unified-page .crm-page-filters { padding: .8rem !important; }
  .crm-unified-page .crm-page-filters .row > [class*="col-"] { width: 100%; }
  .crm-unified-page .crm-page-surface { overflow-x: auto; }
}
