:root {
  --crm-sidebar-width: 17.5rem;
  --crm-topbar-height: 4.5rem;
  --crm-content-max: 100rem;
  --crm-body-bg: #f5f7fb;
  --crm-surface: #ffffff;
  --crm-surface-subtle: #f8fafc;
  --crm-border: #e5e9f2;
  --crm-border-strong: #d7deea;
  --crm-text: #172033;
  --crm-text-muted: #6c7890;
  --crm-primary: #5b5bd6;
  --crm-primary-dark: #4545b8;
  --crm-primary-soft: #eeeeff;
  --crm-secondary: #64748b;
  --crm-success: #168568;
  --crm-success-soft: #e8f8f2;
  --crm-warning: #b66a08;
  --crm-warning-soft: #fff5df;
  --crm-danger: #d1435b;
  --crm-danger-soft: #fff0f2;
  --crm-info: #2878c7;
  --crm-info-soft: #eaf4ff;
  --crm-purple: #7c4dcc;
  --crm-purple-soft: #f3edff;
  --crm-sidebar-bg: #151a2d;
  --crm-sidebar-bg-deep: #101426;
  --crm-sidebar-text: #aeb8cf;
  --crm-sidebar-active: #ffffff;
  --crm-shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.04), 0 4px 14px rgba(23, 32, 51, 0.04);
  --crm-shadow-md: 0 12px 30px rgba(23, 32, 51, 0.09);
  --crm-shadow-lg: 0 24px 60px rgba(23, 32, 51, 0.14);
  --crm-radius-sm: 0.625rem;
  --crm-radius: 0.875rem;
  --crm-radius-lg: 1.25rem;
  --crm-transition: 180ms ease;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--crm-text);
  background: var(--crm-body-bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.crm-sidebar-open {
  overflow: hidden;
}

::selection {
  color: var(--crm-primary-dark);
  background: #dcdcff;
}

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

a:hover {
  color: var(--crm-primary-dark);
}

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

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  max-width: 100%;
}

hr {
  border-color: var(--crm-border);
  opacity: 1;
}

:focus-visible {
  outline: 0.1875rem solid rgba(91, 91, 214, 0.32);
  outline-offset: 0.1875rem;
}

.crm-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.625rem 0.875rem;
  color: #ffffff;
  background: var(--crm-primary-dark);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow-md);
  transform: translateY(-150%);
  transition: transform var(--crm-transition);
}

.crm-skip-link:focus {
  color: #ffffff;
  transform: translateY(0);
}

.crm-app {
  min-height: 100vh;
}

.crm-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  width: var(--crm-sidebar-width);
  height: 100vh;
  flex-direction: column;
  color: var(--crm-sidebar-text);
  background:
    radial-gradient(circle at 10% 5%, rgba(119, 111, 255, 0.19), transparent 25%),
    linear-gradient(180deg, var(--crm-sidebar-bg) 0%, var(--crm-sidebar-bg-deep) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 8px 0 30px rgba(16, 20, 38, 0.08);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
  transition: width var(--crm-transition), transform 240ms ease, visibility 240ms ease;
}

.crm-sidebar::-webkit-scrollbar {
  width: 0.375rem;
}

.crm-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.crm-sidebar-header {
  display: flex;
  min-height: var(--crm-topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.crm-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.crm-brand:hover,
.crm-brand:focus {
  color: #ffffff;
}

.crm-brand-mark {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, #8585f4, #5b5bd6 70%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(91, 91, 214, 0.35);
  font-size: 0.9rem;
  font-weight: 800;
}

.crm-brand-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-sidebar-close {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--crm-sidebar-text);
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 0.625rem;
  transition: color var(--crm-transition), background var(--crm-transition);
}

.crm-sidebar-close:hover,
.crm-sidebar-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.crm-sidebar-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 1.15rem 0.85rem 1rem;
}

.crm-nav-section + .crm-nav-section {
  margin-top: 1.35rem;
}

.crm-nav-label {
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
  color: #6f7a96;
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.crm-sidebar-nav {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crm-sidebar-nav .nav-link {
  position: relative;
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.625rem 0.75rem;
  color: var(--crm-sidebar-text);
  border-radius: 0.7rem;
  font-size: 0.875rem;
  font-weight: 550;
  transition: color var(--crm-transition), background var(--crm-transition), transform var(--crm-transition);
}

.crm-sidebar-nav .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.065);
}

.crm-sidebar-nav .nav-link:focus-visible {
  color: #ffffff;
  outline-color: rgba(255, 255, 255, 0.5);
}

.crm-sidebar-nav .nav-link.active,
.crm-sidebar-nav .nav-link[aria-current="page"] {
  color: var(--crm-sidebar-active);
  background: linear-gradient(90deg, rgba(111, 105, 244, 0.25), rgba(111, 105, 244, 0.12));
  box-shadow: inset 0 0 0 1px rgba(151, 146, 255, 0.14);
}

.crm-sidebar-nav .nav-link.active::before,
.crm-sidebar-nav .nav-link[aria-current="page"]::before {
  position: absolute;
  top: 50%;
  left: -0.85rem;
  width: 0.2rem;
  height: 1.6rem;
  background: #9290ff;
  border-radius: 0 999px 999px 0;
  content: "";
  transform: translateY(-50%);
}

.crm-nav-icon {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  place-items: center;
  font-size: 1rem;
}

.crm-nav-label-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-nav-count {
  display: inline-flex;
  min-width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.4rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.crm-nav-count[data-count="0"] {
  display: none;
}

.crm-sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.crm-sidebar-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.045);
  border: 0;
  border-radius: 0.8rem;
  text-align: left;
  transition: background var(--crm-transition);
}

.crm-sidebar-user:hover,
.crm-sidebar-user:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

.crm-sidebar-user-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.crm-sidebar-user-name,
.crm-sidebar-user-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 650;
}

.crm-sidebar-user-role {
  margin-top: 0.1rem;
  color: #7f8aa3;
  font-size: 0.7rem;
}

.crm-sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 1035;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(11, 15, 29, 0.56);
  border: 0;
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(2px);
  transition: opacity 200ms ease, visibility 200ms ease;
}

.crm-sidebar-scrim.is-visible {
  opacity: 1;
  visibility: visible;
}

.crm-content-wrap {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--crm-sidebar-width);
  transition: margin var(--crm-transition);
}

.crm-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  min-height: var(--crm-topbar-height);
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem clamp(1rem, 2.4vw, 2rem);
  background: rgba(255, 255, 255, 0.91);
  border-bottom: 1px solid var(--crm-border);
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.015);
  backdrop-filter: blur(14px);
}

.crm-topbar-brand {
  display: none;
  align-items: center;
  gap: 0.625rem;
  color: var(--crm-text);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.crm-topbar-brand:hover {
  color: var(--crm-text);
}

.crm-topbar-brand .crm-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
}

.crm-topbar-search {
  position: relative;
  width: min(28rem, 40vw);
}

.crm-topbar-search .form-control {
  height: 2.65rem;
  padding-right: 4.2rem;
  background: var(--crm-surface-subtle);
  border-color: transparent;
}

.crm-topbar-search .form-control:focus {
  background: var(--crm-surface);
  border-color: rgba(91, 91, 214, 0.45);
  box-shadow: 0 0 0 0.22rem rgba(91, 91, 214, 0.12);
}

.crm-search-shortcut {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  padding: 0.15rem 0.4rem;
  color: #8b95a8;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 0.35rem;
  box-shadow: 0 1px 1px rgba(23, 32, 51, 0.04);
  font-size: 0.6875rem;
  font-weight: 650;
  transform: translateY(-50%);
}

.crm-topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.crm-icon-button {
  position: relative;
  display: inline-grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  place-items: center;
  color: #56627a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  transition: color var(--crm-transition), background var(--crm-transition), border-color var(--crm-transition);
}

.crm-icon-button:hover,
.crm-icon-button:focus-visible,
.crm-icon-button.show {
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  border-color: rgba(91, 91, 214, 0.13);
}

.crm-notification-dot {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--crm-danger);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(209, 67, 91, 0.12);
}

.crm-notification-dot[hidden] {
  display: none;
}

.crm-topbar-divider {
  width: 1px;
  height: 1.8rem;
  margin: 0 0.25rem;
  background: var(--crm-border);
}

.crm-content {
  width: 100%;
  max-width: var(--crm-content-max);
  margin: 0 auto;
  padding: clamp(1.15rem, 2.5vw, 2rem);
}

.crm-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.crm-page-title {
  margin: 0;
  color: var(--crm-text);
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.crm-page-description {
  max-width: 45rem;
  margin: 0.35rem 0 0;
  color: var(--crm-text-muted);
  font-size: 0.9rem;
}

.crm-page-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.crm-breadcrumb {
  --bs-breadcrumb-divider-color: #a6afbf;
  --bs-breadcrumb-item-active-color: var(--crm-text-muted);
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
}

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

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

.crm-card-header {
  display: flex;
  min-height: 3.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: transparent;
  border-bottom: 1px solid var(--crm-border);
  border-radius: var(--crm-radius) var(--crm-radius) 0 0 !important;
}

.crm-card-title {
  margin: 0;
  color: var(--crm-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.crm-card-subtitle {
  margin: 0.2rem 0 0;
  color: var(--crm-text-muted);
  font-size: 0.78rem;
}

.crm-card-body {
  padding: 1.25rem;
}

.crm-card-footer {
  padding: 0.85rem 1.25rem;
  background: var(--crm-surface-subtle);
  border-top: 1px solid var(--crm-border);
  border-radius: 0 0 var(--crm-radius) var(--crm-radius) !important;
}

.crm-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 650;
}

.crm-section-title {
  margin: 0;
  color: var(--crm-text);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.crm-divider {
  height: 1px;
  margin: 1.25rem 0;
  background: var(--crm-border);
}

.crm-btn {
  --crm-btn-focus: rgba(91, 91, 214, 0.25);
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.7rem;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: none;
  transition: color var(--crm-transition), background-color var(--crm-transition), border-color var(--crm-transition), box-shadow var(--crm-transition), transform var(--crm-transition);
}

.crm-btn:hover {
  transform: translateY(-1px);
}

.crm-btn:active {
  transform: translateY(0);
}

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

.crm-btn-primary:hover {
  color: #ffffff;
  background: var(--crm-primary-dark);
  border-color: var(--crm-primary-dark);
  box-shadow: 0 8px 18px rgba(91, 91, 214, 0.22);
}

.crm-btn-primary:focus-visible {
  box-shadow: 0 0 0 0.25rem var(--crm-btn-focus);
}

.crm-btn-light,
.crm-btn-light:focus,
.crm-btn-light:active {
  color: #4b5870;
  background: var(--crm-surface);
  border-color: var(--crm-border-strong);
}

.crm-btn-light:hover {
  color: var(--crm-primary);
  background: var(--crm-surface-subtle);
  border-color: #c6cde0;
}

.crm-btn-light:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(91, 91, 214, 0.15);
}

.crm-btn-ghost {
  color: var(--crm-text-muted);
  background: transparent;
  border-color: transparent;
}

.crm-btn-ghost:hover {
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
}

.crm-btn-danger-soft {
  color: var(--crm-danger);
  background: var(--crm-danger-soft);
  border-color: transparent;
}

.crm-btn-danger-soft:hover {
  color: #a92e44;
  background: #ffe3e8;
}

.crm-btn-icon {
  width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.35rem;
}

.crm-btn:disabled,
.crm-btn.is-loading {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.crm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.crm-metric-card {
  position: relative;
  min-width: 0;
  padding: 1.2rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-sm);
  overflow: hidden;
  transition: border-color var(--crm-transition), box-shadow var(--crm-transition), transform var(--crm-transition);
}

.crm-metric-card:hover {
  border-color: #d8dced;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.075);
  transform: translateY(-2px);
}

.crm-metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.crm-metric-label {
  margin: 0;
  color: var(--crm-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.crm-metric-icon {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  border-radius: 0.75rem;
  font-size: 1.05rem;
}

.crm-metric-icon.is-success {
  color: var(--crm-success);
  background: var(--crm-success-soft);
}

.crm-metric-icon.is-warning {
  color: var(--crm-warning);
  background: var(--crm-warning-soft);
}

.crm-metric-icon.is-danger {
  color: var(--crm-danger);
  background: var(--crm-danger-soft);
}

.crm-metric-icon.is-info {
  color: var(--crm-info);
  background: var(--crm-info-soft);
}

.crm-metric-value {
  display: block;
  margin-top: 0.9rem;
  color: var(--crm-text);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1;
}

.crm-metric-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
  color: var(--crm-text-muted);
  font-size: 0.75rem;
}

.crm-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--crm-success);
  font-weight: 700;
}

.crm-trend.is-down {
  color: var(--crm-danger);
}

.crm-status-badge {
  --crm-status-color: var(--crm-secondary);
  --crm-status-bg: #f0f2f6;
  display: inline-flex;
  min-height: 1.65rem;
  align-items: center;
  gap: 0.38rem;
  padding: 0.25rem 0.55rem;
  color: var(--crm-status-color);
  background: var(--crm-status-bg);
  border: 1px solid color-mix(in srgb, var(--crm-status-color) 15%, transparent);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.crm-status-badge::before {
  width: 0.38rem;
  height: 0.38rem;
  flex: 0 0 auto;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.crm-status-active,
.crm-status-resolved,
.crm-status-paid,
.crm-status-open {
  --crm-status-color: var(--crm-success);
  --crm-status-bg: var(--crm-success-soft);
}

.crm-status-pending,
.crm-status-pendingpayment,
.crm-status-inprogress,
.crm-status-medium {
  --crm-status-color: var(--crm-warning);
  --crm-status-bg: var(--crm-warning-soft);
}

.crm-status-overdue,
.crm-status-high,
.crm-status-urgent,
.crm-status-failed,
.crm-status-cancelled {
  --crm-status-color: var(--crm-danger);
  --crm-status-bg: var(--crm-danger-soft);
}

.crm-status-draft,
.crm-status-inactive,
.crm-status-low {
  --crm-status-color: var(--crm-secondary);
  --crm-status-bg: #f0f2f6;
}

.crm-status-new,
.crm-status-scheduled,
.crm-status-info {
  --crm-status-color: var(--crm-info);
  --crm-status-bg: var(--crm-info-soft);
}

.crm-status-negotiation,
.crm-status-custom {
  --crm-status-color: var(--crm-purple);
  --crm-status-bg: var(--crm-purple-soft);
}

.crm-table-card {
  overflow: hidden;
}

.crm-table-responsive {
  margin: 0;
  overflow-x: auto;
  scrollbar-color: #c8cfdd transparent;
  scrollbar-width: thin;
}

.crm-table {
  width: 100%;
  min-width: 44rem;
  margin: 0;
  color: var(--crm-text);
  vertical-align: middle;
}

.crm-table > thead > tr > th {
  padding: 0.8rem 1rem;
  color: #7b869b;
  background: #fafbfe;
  border-bottom: 1px solid var(--crm-border);
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-table > tbody > tr > td {
  padding: 0.95rem 1rem;
  border-color: #edf0f5;
  font-size: 0.83rem;
  vertical-align: middle;
}

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

.crm-table > tbody > tr {
  transition: background-color var(--crm-transition);
}

.crm-table > tbody > tr:hover > * {
  background-color: #fafbff;
}

.crm-table-primary {
  color: var(--crm-text);
  font-weight: 650;
}

.crm-table-secondary {
  display: block;
  margin-top: 0.15rem;
  color: var(--crm-text-muted);
  font-size: 0.74rem;
}

.crm-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
}

.crm-table-compact > tbody > tr > td,
.crm-table-compact > thead > tr > th {
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

.crm-empty-state {
  display: grid;
  min-height: 15rem;
  place-items: center;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.crm-empty-icon {
  display: inline-grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  margin-bottom: 0.9rem;
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  border-radius: 1rem;
  font-size: 1.4rem;
}

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

.crm-empty-copy {
  max-width: 25rem;
  margin: 0.35rem auto 1rem;
  color: var(--crm-text-muted);
  font-size: 0.82rem;
}

.crm-form-label,
.form-label {
  margin-bottom: 0.4rem;
  color: #465168;
  font-size: 0.78rem;
  font-weight: 650;
}

.crm-form-hint {
  margin-top: 0.35rem;
  color: var(--crm-text-muted);
  font-size: 0.72rem;
}

.crm-required {
  color: var(--crm-danger);
}

.form-control,
.form-select,
.input-group-text {
  min-height: 2.75rem;
  color: var(--crm-text);
  background-color: #ffffff;
  border-color: var(--crm-border-strong);
  border-radius: 0.7rem;
  font-size: 0.875rem;
  box-shadow: none;
  transition: color var(--crm-transition), background-color var(--crm-transition), border-color var(--crm-transition), box-shadow var(--crm-transition);
}

.form-control::placeholder {
  color: #a1aaba;
}

.form-control:hover:not(:disabled),
.form-select:hover:not(:disabled) {
  border-color: #bcc5d6;
}

.form-control:focus,
.form-select:focus,
.input-group-text:focus-within {
  color: var(--crm-text);
  background-color: #ffffff;
  border-color: #8989e6;
  box-shadow: 0 0 0 0.22rem rgba(91, 91, 214, 0.12);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  color: #748096;
  background-color: #f5f7fa;
  opacity: 1;
}

textarea.form-control {
  min-height: 7rem;
  resize: vertical;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
  border-radius: 0;
}

.input-group > :first-child {
  border-top-left-radius: 0.7rem;
  border-bottom-left-radius: 0.7rem;
}

.input-group > :last-child {
  border-top-right-radius: 0.7rem;
  border-bottom-right-radius: 0.7rem;
}

.input-group-text {
  color: #7c879b;
  background: #fafbfe;
}

.form-check-input {
  border-color: #b8c1d2;
  box-shadow: none;
}

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

.form-check-input:focus {
  border-color: #8989e6;
  box-shadow: 0 0 0 0.22rem rgba(91, 91, 214, 0.12);
}

.form-check-label {
  color: #4b5770;
  font-size: 0.82rem;
}

.valid-feedback,
.invalid-feedback {
  font-size: 0.72rem;
}

.form-control.is-valid,
.form-select.is-valid,
.was-validated .form-control:valid,
.was-validated .form-select:valid {
  border-color: #5bb79a;
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #e07a8c;
}

.was-validated .form-control:valid:focus,
.form-control.is-valid:focus {
  box-shadow: 0 0 0 0.22rem rgba(22, 133, 104, 0.12);
}

.was-validated .form-control:invalid:focus,
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 0.22rem rgba(209, 67, 91, 0.12);
}

.crm-password-field {
  position: relative;
}

.crm-password-field .form-control {
  padding-right: 3rem;
}

.crm-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #7b869b;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  transform: translateY(-50%);
}

.crm-password-toggle:hover,
.crm-password-toggle:focus-visible {
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
}

.crm-form-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  color: #9f3044;
  background: var(--crm-danger-soft);
  border: 1px solid #f4c5cd;
  border-radius: 0.7rem;
  font-size: 0.8rem;
}

.crm-form-error[hidden],
.crm-form-success[hidden] {
  display: none;
}

.crm-form-success {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  color: #116d57;
  background: var(--crm-success-soft);
  border: 1px solid #bce7d9;
  border-radius: 0.7rem;
  font-size: 0.8rem;
}

.crm-form-alert-list {
  margin: 0;
  padding-left: 1.1rem;
}

.crm-form-alert-list li + li {
  margin-top: 0.2rem;
}

.crm-progress {
  height: 0.45rem;
  background: #eaedf4;
  border-radius: 999px;
}

.crm-progress .progress-bar {
  background: var(--crm-primary);
  border-radius: inherit;
}

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

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

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

.crm-avatar {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: var(--crm-primary-dark);
  background: var(--crm-primary-soft);
  border: 1px solid rgba(91, 91, 214, 0.12);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

.crm-avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.65rem;
}

.crm-avatar-lg {
  width: 3rem;
  height: 3rem;
  font-size: 0.9rem;
}

.crm-avatar-xl {
  width: 4.75rem;
  height: 4.75rem;
  border-width: 3px;
  border-color: #ffffff;
  box-shadow: 0 6px 18px rgba(23, 32, 51, 0.14);
  font-size: 1.25rem;
}

.crm-avatar-stack {
  display: flex;
  padding-left: 0.4rem;
}

.crm-avatar-stack .crm-avatar {
  margin-left: -0.4rem;
  border: 2px solid #ffffff;
}

.crm-avatar-status {
  position: relative;
}

.crm-avatar-status::after {
  position: absolute;
  right: 0;
  bottom: 0.05rem;
  width: 0.65rem;
  height: 0.65rem;
  background: #9aa4b5;
  border: 2px solid #ffffff;
  border-radius: 50%;
  content: "";
}

.crm-avatar-status.is-online::after {
  background: #29b487;
}

.crm-timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crm-timeline::before {
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 1.05rem;
  width: 1px;
  background: #dce2ec;
  content: "";
}

.crm-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-bottom: 1.35rem;
}

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

.crm-timeline-marker {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #dfe2f3;
  font-size: 0.72rem;
}

.crm-timeline-marker.is-success {
  color: var(--crm-success);
  background: var(--crm-success-soft);
  box-shadow: 0 0 0 1px #cdebe1;
}

.crm-timeline-marker.is-warning {
  color: var(--crm-warning);
  background: var(--crm-warning-soft);
  box-shadow: 0 0 0 1px #f2e1bc;
}

.crm-timeline-marker.is-danger {
  color: var(--crm-danger);
  background: var(--crm-danger-soft);
  box-shadow: 0 0 0 1px #f2cdd4;
}

.crm-timeline-marker.is-muted {
  color: #7e899d;
  background: #f0f2f6;
  box-shadow: 0 0 0 1px #dfe3eb;
}

.crm-timeline-content {
  min-width: 0;
  padding-top: 0.18rem;
}

.crm-timeline-title {
  margin: 0;
  color: var(--crm-text);
  font-size: 0.84rem;
  font-weight: 650;
}

.crm-timeline-copy {
  margin: 0.25rem 0 0;
  color: var(--crm-text-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.crm-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
  color: #8a94a7;
  font-size: 0.7rem;
}

.crm-contact-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.crm-contact-item {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.crm-contact-icon {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: #6f7b91;
  background: #f2f4f8;
  border-radius: 0.65rem;
}

.crm-contact-label {
  display: block;
  margin-bottom: 0.1rem;
  color: #8a94a7;
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.crm-contact-value {
  display: block;
  color: #435069;
  font-size: 0.8rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.crm-customer-hero {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 95% 0%, rgba(133, 133, 244, 0.16), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #fafaff 100%);
  border-bottom: 1px solid var(--crm-border);
  overflow: hidden;
}

.crm-customer-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.crm-customer-name {
  margin: 0;
  color: var(--crm-text);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.crm-customer-company {
  margin: 0.2rem 0 0.55rem;
  color: var(--crm-text-muted);
  font-size: 0.84rem;
}

.crm-customer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.crm-customer-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  color: #657188;
  background: #f1f3f8;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.crm-customer-health {
  display: flex;
  min-width: 8.5rem;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--crm-border);
  border-radius: 0.85rem;
  box-shadow: 0 6px 18px rgba(23, 32, 51, 0.05);
}

.crm-health-ring {
  --crm-health: 50%;
  display: inline-grid;
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(var(--crm-success) var(--crm-health), #e8ebf1 0);
  border-radius: 50%;
}

.crm-health-ring::before {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: var(--crm-text);
  background: #ffffff;
  border-radius: 50%;
  content: attr(data-value);
  font-size: 0.68rem;
  font-weight: 750;
}

.crm-health-copy strong,
.crm-health-copy span {
  display: block;
}

.crm-health-copy strong {
  color: var(--crm-text);
  font-size: 0.75rem;
}

.crm-health-copy span {
  margin-top: 0.1rem;
  color: var(--crm-text-muted);
  font-size: 0.67rem;
}

.crm-customer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 1.1rem 0;
}

.crm-customer-stat {
  min-width: 0;
  padding: 0.2rem 1.25rem;
  border-right: 1px solid var(--crm-border);
}

.crm-customer-stat:last-child {
  border-right: 0;
}

.crm-customer-stat-label {
  display: block;
  color: var(--crm-text-muted);
  font-size: 0.7rem;
}

.crm-customer-stat-value {
  display: block;
  margin-top: 0.18rem;
  color: var(--crm-text);
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.crm-customer-tabs {
  gap: 0.35rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-customer-tabs .nav-link {
  padding: 0.85rem 0.75rem 0.7rem;
  color: var(--crm-text-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 650;
}

.crm-customer-tabs .nav-link:hover,
.crm-customer-tabs .nav-link.active {
  color: var(--crm-primary);
  background: transparent;
  border-bottom-color: var(--crm-primary);
}

.crm-ticket-header {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background: linear-gradient(180deg, #ffffff, #fbfbfe);
  border-bottom: 1px solid var(--crm-border);
}

.crm-ticket-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.crm-ticket-id {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--crm-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crm-ticket-title {
  margin: 0;
  color: var(--crm-text);
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
  font-weight: 740;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.crm-ticket-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.crm-ticket-description {
  margin: 1rem 0 0;
  color: #536078;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-line;
}

.crm-ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--crm-border);
}

.crm-ticket-meta-item {
  min-width: 0;
  padding: 0 1rem;
  border-right: 1px solid var(--crm-border);
}

.crm-ticket-meta-item:first-child {
  padding-left: 0;
}

.crm-ticket-meta-item:last-child {
  padding-right: 0;
  border-right: 0;
}

.crm-ticket-meta-label {
  display: block;
  margin-bottom: 0.28rem;
  color: #8a94a7;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crm-ticket-meta-value {
  display: block;
  color: #435069;
  font-size: 0.78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.crm-ticket-description-box {
  padding: 1rem;
  color: #4c5870;
  background: #f8f9fc;
  border: 1px solid var(--crm-border);
  border-radius: 0.8rem;
  font-size: 0.84rem;
  line-height: 1.7;
  white-space: pre-line;
}

.crm-ticket-activity {
  display: grid;
  gap: 1rem;
}

.crm-ticket-update {
  padding: 0.95rem 1rem;
  background: #fbfcff;
  border: 1px solid var(--crm-border);
  border-radius: 0.8rem;
}

.crm-ticket-update-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.crm-ticket-update-author {
  color: var(--crm-text);
  font-size: 0.78rem;
  font-weight: 650;
}

.crm-ticket-update-time {
  margin-left: auto;
  color: #8a94a7;
  font-size: 0.68rem;
}

.crm-ticket-update p {
  margin: 0;
  color: #56627a;
  font-size: 0.79rem;
  line-height: 1.65;
  white-space: pre-line;
}

.crm-sla-meter {
  padding: 0.9rem;
  background: #f8f9fc;
  border: 1px solid var(--crm-border);
  border-radius: 0.8rem;
}

.crm-sla-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  font-weight: 650;
}

.crm-sla-time {
  color: var(--crm-warning);
}

.crm-auth-page {
  min-height: 100vh;
  background: #f6f7fc;
}

.crm-auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(21rem, 0.9fr) minmax(30rem, 1.1fr);
}

.crm-auth-aside {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem);
  color: #ffffff;
  background:
    radial-gradient(circle at 85% 15%, rgba(152, 148, 255, 0.38), transparent 28%),
    radial-gradient(circle at 10% 90%, rgba(69, 173, 193, 0.18), transparent 28%),
    linear-gradient(145deg, #171c33 0%, #20234b 55%, #34327a 100%);
  overflow: hidden;
}

.crm-auth-aside::before,
.crm-auth-aside::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.crm-auth-aside::before {
  top: -10rem;
  right: -12rem;
  width: 30rem;
  height: 30rem;
}

.crm-auth-aside::after {
  right: -4rem;
  bottom: -12rem;
  width: 25rem;
  height: 25rem;
}

.crm-auth-aside > * {
  position: relative;
  z-index: 1;
}

.crm-auth-content {
  max-width: 31rem;
}

.crm-auth-kicker {
  margin: 0 0 0.9rem;
  color: #b9b7ff;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.crm-auth-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 770;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.crm-auth-copy {
  max-width: 27rem;
  margin: 1.1rem 0 0;
  color: #b6bdd2;
  font-size: 0.95rem;
  line-height: 1.7;
}

.crm-auth-features {
  display: grid;
  gap: 0.8rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.crm-auth-feature {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #d9ddef;
  font-size: 0.82rem;
}

.crm-auth-feature-icon {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  place-items: center;
  color: #d7d6ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
}

.crm-auth-footer {
  color: #7f89a6;
  font-size: 0.72rem;
}

.crm-auth-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.crm-auth-form-wrap {
  width: min(100%, 27rem);
}

.crm-auth-form-header {
  margin-bottom: 1.75rem;
}

.crm-auth-form-title {
  margin: 0;
  color: var(--crm-text);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.04em;
}

.crm-auth-form-copy {
  margin: 0.45rem 0 0;
  color: var(--crm-text-muted);
  font-size: 0.875rem;
}

.crm-auth-form .form-control {
  min-height: 3rem;
  padding-right: 0.9rem;
  padding-left: 0.9rem;
}

.crm-auth-form .crm-btn {
  min-height: 3rem;
}

.crm-auth-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.crm-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: #8d97aa;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.crm-auth-divider::before,
.crm-auth-divider::after {
  height: 1px;
  flex: 1 1 auto;
  background: var(--crm-border);
  content: "";
}

.crm-setup-shell {
  width: min(100%, 62rem);
}

.crm-setup-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.crm-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-sm);
}

.crm-setup-step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #8a94a7;
  font-size: 0.78rem;
  font-weight: 650;
}

.crm-setup-step + .crm-setup-step::before {
  position: absolute;
  top: 50%;
  right: 50%;
  width: 50%;
  height: 1px;
  background: var(--crm-border);
  content: "";
}

.crm-setup-step-number {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  color: #738097;
  background: #f0f2f6;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 750;
}

.crm-setup-step.is-active {
  color: var(--crm-primary);
}

.crm-setup-step.is-active .crm-setup-step-number {
  color: #ffffff;
  background: var(--crm-primary);
  box-shadow: 0 5px 12px rgba(91, 91, 214, 0.25);
}

.crm-setup-step.is-complete {
  color: var(--crm-success);
}

.crm-setup-step.is-complete .crm-setup-step-number {
  color: #ffffff;
  background: var(--crm-success);
}

.crm-setup-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  box-shadow: var(--crm-shadow-md);
}

.crm-setup-panel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.crm-setup-panel-copy {
  margin: 0.35rem 0 1.5rem;
  color: var(--crm-text-muted);
  font-size: 0.83rem;
}

.crm-system-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--crm-border);
}

.crm-system-check:last-child {
  border-bottom: 0;
}

.crm-system-check-name {
  color: #4b5770;
  font-size: 0.8rem;
  font-weight: 600;
}

.crm-system-check-detail {
  color: #8a94a7;
  font-size: 0.7rem;
}

.crm-notification-menu {
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 6rem));
  padding: 0;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-lg);
  overflow: hidden;
}

.crm-notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-notification-feed {
  max-height: 20rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.crm-notification-item {
  display: grid;
  grid-template-columns: 0.55rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--crm-border);
}

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

.crm-notification-item.is-unread {
  background: #f8f8ff;
}

.crm-notification-indicator {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.35rem;
  background: var(--crm-primary);
  border-radius: 50%;
}

.crm-notification-title {
  display: block;
  color: var(--crm-text);
  font-size: 0.77rem;
  font-weight: 650;
}

.crm-notification-message {
  display: block;
  margin-top: 0.18rem;
  color: var(--crm-text-muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.crm-notification-time {
  display: block;
  margin-top: 0.3rem;
  color: #98a1b2;
  font-size: 0.65rem;
}

.crm-toast-container {
  z-index: 1100;
}

.crm-toast {
  color: var(--crm-text);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--crm-border);
  border-radius: 0.8rem;
  box-shadow: var(--crm-shadow-lg);
  backdrop-filter: blur(12px);
}

.crm-toast-header {
  color: var(--crm-text);
  background: transparent;
  border-bottom: 1px solid var(--crm-border);
}

.crm-toast.is-success {
  border-left: 0.22rem solid var(--crm-success);
}

.crm-toast.is-danger {
  border-left: 0.22rem solid var(--crm-danger);
}

.crm-toast.is-warning {
  border-left: 0.22rem solid var(--crm-warning);
}

.crm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-sm);
}

.crm-filter-search {
  position: relative;
  min-width: min(100%, 16rem);
  flex: 1 1 16rem;
}

.crm-filter-search .form-control {
  padding-left: 2.5rem;
}

.crm-filter-search-icon {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  color: #8b95a8;
  transform: translateY(-50%);
  pointer-events: none;
}

.crm-pagination {
  gap: 0.3rem;
}

.crm-pagination .page-link {
  display: grid;
  min-width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0.3rem 0.6rem;
  color: #5f6b82;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  border-radius: 0.55rem !important;
  font-size: 0.76rem;
  font-weight: 600;
}

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

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

.crm-pagination .page-item.disabled .page-link {
  color: #a5adbc;
  background: #fafbfc;
}

.crm-kbd {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.08rem 0.32rem;
  color: #667187;
  background: #f2f4f8;
  border: 1px solid #dce1e9;
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.crm-sticky-panel {
  position: sticky;
  top: calc(var(--crm-topbar-height) + 1.25rem);
}

.crm-link-danger {
  color: var(--crm-danger);
}

.crm-link-danger:hover {
  color: #a92e44;
}

.crm-shadow-primary {
  box-shadow: 0 10px 25px rgba(91, 91, 214, 0.22);
}

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

  .crm-auth-shell {
    grid-template-columns: minmax(19rem, 0.8fr) minmax(28rem, 1.2fr);
  }

  .crm-auth-aside {
    padding: 2.5rem;
  }
}

@media (max-width: 991.98px) {
  .crm-topbar-brand {
    display: inline-flex;
  }

  .crm-content-wrap {
    margin-left: 0;
  }

  .crm-sidebar:not(.offcanvas) {
    transform: translateX(-100%);
    visibility: hidden;
  }

  .crm-sidebar:not(.offcanvas).is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .crm-sidebar.offcanvas {
    --bs-offcanvas-width: min(var(--crm-sidebar-width), 88vw);
    width: min(var(--crm-sidebar-width), 88vw);
  }

  .crm-sidebar.offcanvas:not(.show) {
    transform: translateX(-100%);
    visibility: hidden;
  }

  .crm-sidebar.offcanvas.show {
    transform: translateX(0);
    visibility: visible;
  }

  .crm-topbar-search {
    width: min(24rem, 42vw);
  }

  .crm-customer-stats,
  .crm-ticket-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1rem;
  }

  .crm-customer-stat:nth-child(2),
  .crm-ticket-meta-item:nth-child(2) {
    border-right: 0;
  }

  .crm-customer-stat:nth-child(3),
  .crm-ticket-meta-item:nth-child(3) {
    padding-left: 0;
  }

  .crm-auth-shell {
    grid-template-columns: minmax(18rem, 0.8fr) minmax(25rem, 1.2fr);
  }

  .crm-auth-aside {
    padding: 2rem;
  }

  .crm-auth-features {
    display: none;
  }
}

@media (max-width: 767.98px) {
  :root {
    --crm-topbar-height: 4rem;
  }

  .crm-topbar {
    padding: 0.65rem 0.85rem;
  }

  .crm-topbar-search {
    display: none;
  }

  .crm-topbar-brand {
    font-size: 0.92rem;
  }

  .crm-topbar-divider,
  .crm-topbar-user-copy {
    display: none;
  }

  .crm-content {
    padding: 1rem 0.85rem 1.5rem;
  }

  .crm-page-header {
    flex-direction: column;
    margin-bottom: 1.15rem;
  }

  .crm-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .crm-page-actions .crm-btn {
    flex: 1 1 auto;
  }

  .crm-metrics {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
  }

  .crm-metric-card {
    padding: 1rem;
  }

  .crm-metric-value {
    font-size: 1.65rem;
  }

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

  .crm-filter-bar {
    padding: 0.75rem;
  }

  .crm-filter-bar .form-select {
    min-width: calc(50% - 0.35rem);
    flex: 1 1 calc(50% - 0.35rem);
  }

  .crm-customer-summary {
    align-items: flex-start;
  }

  .crm-customer-health {
    min-width: auto;
    margin-left: 0;
  }

  .crm-health-copy {
    display: none;
  }

  .crm-ticket-heading {
    flex-direction: column;
  }

  .crm-ticket-badges {
    justify-content: flex-start;
  }

  .crm-auth-shell {
    display: block;
  }

  .crm-auth-aside {
    display: none;
  }

  .crm-auth-main {
    min-height: 100vh;
    padding: 1.5rem 1rem;
  }

  .crm-setup-steps {
    padding: 0.8rem 0.5rem;
  }

  .crm-setup-step {
    gap: 0.35rem;
    font-size: 0.7rem;
  }

  .crm-setup-step + .crm-setup-step::before {
    display: none;
  }
}

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

  .crm-page-actions .crm-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .crm-customer-hero {
    padding: 1rem;
  }

  .crm-customer-summary {
    flex-wrap: wrap;
  }

  .crm-customer-health {
    width: 100%;
    justify-content: center;
  }

  .crm-health-copy {
    display: block;
  }

  .crm-customer-stats,
  .crm-ticket-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .crm-customer-stat,
  .crm-ticket-meta-item {
    padding: 0 0.75rem;
  }

  .crm-customer-stat:nth-child(odd),
  .crm-ticket-meta-item:nth-child(odd) {
    padding-left: 0;
  }

  .crm-customer-stat:nth-child(even),
  .crm-ticket-meta-item:nth-child(even) {
    padding-right: 0;
  }

  .crm-customer-tabs {
    padding: 0 0.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .crm-customer-tabs .nav-link {
    white-space: nowrap;
  }

  .crm-ticket-header {
    padding: 1rem;
  }

  .crm-ticket-update-head {
    flex-wrap: wrap;
  }

  .crm-ticket-update-time {
    width: 100%;
    margin-left: 0;
  }

  .crm-setup-step-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  .crm-card,
  .crm-metric-card,
  .crm-filter-bar,
  .form-control,
  .form-select {
    border-color: #7c879b;
  }

  .crm-sidebar-nav .nav-link.active,
  .crm-sidebar-nav .nav-link[aria-current="page"] {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
  }
}

@media (forced-colors: active) {
  .crm-status-badge,
  .crm-metric-icon,
  .crm-health-ring,
  .crm-timeline-marker {
    border: 1px solid CanvasText;
  }

  .crm-health-ring::before {
    border: 1px solid CanvasText;
  }
}

@media print {
  .crm-sidebar,
  .crm-topbar,
  .crm-page-actions,
  .crm-filter-bar,
  .crm-table-actions,
  .crm-sidebar-scrim {
    display: none !important;
  }

  .crm-content-wrap {
    margin: 0;
  }

  .crm-content {
    max-width: none;
    padding: 0;
  }

  .crm-card,
  .crm-metric-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

.crm-shell {
  min-height: 100vh;
}

.crm-main {
  min-height: 100vh;
  margin-left: var(--crm-sidebar-width);
}

.crm-sidebar {
  padding: 1rem 0.85rem;
}

.crm-brand-centered {
  justify-content: center;
  color: var(--crm-text);
}

.crm-brand-centered:hover,
.crm-brand-centered:focus {
  color: var(--crm-text);
}

.crm-brand-centered .crm-brand-mark {
  box-shadow: 0 8px 18px rgba(91, 91, 214, 0.2);
}

.crm-nav {
  display: grid;
  gap: 0.2rem;
  margin-top: 1.25rem;
}

.crm-nav-link {
  display: flex;
  min-height: 2.7rem;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.75rem;
  color: var(--crm-sidebar-text);
  border-radius: 0.7rem;
  font-size: 0.875rem;
  font-weight: 550;
  transition: color var(--crm-transition), background var(--crm-transition);
}

.crm-nav-link:hover,
.crm-nav-link:focus,
.crm-nav-link.active {
  color: #ffffff;
  background: rgba(111, 105, 244, 0.22);
}

.crm-nav-link span {
  display: inline-grid;
  width: 1.25rem;
  place-items: center;
  font-size: 1rem;
}

.crm-store-label {
  margin: 1.4rem 0 0.6rem;
  color: #6f7a96;
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crm-store-list {
  display: grid;
  gap: 0.25rem;
}

.crm-store-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  color: #c4cbe0;
  border-radius: 0.55rem;
  font-size: 0.78rem;
}

.crm-store-item span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-store-dot {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  background: #57c99b;
  border-radius: 50%;
  box-shadow: 0 0 0 0.2rem rgba(87, 201, 155, 0.12);
}

.crm-sidebar-footer {
  margin-top: auto;
  padding: 0.85rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.crm-menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--crm-text-muted);
  background: var(--crm-surface-subtle);
  border: 1px solid var(--crm-border);
  border-radius: 0.65rem;
}

.crm-topbar {
  justify-content: space-between;
}

.crm-topbar h1 {
  margin: 0;
  color: var(--crm-text);
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.crm-eyebrow {
  color: var(--crm-primary);
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.crm-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.crm-avatar {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, #8585f4, #5b5bd6 70%);
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 800;
}

.crm-user-name {
  color: var(--crm-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.crm-user-role {
  color: var(--crm-text-muted);
  font-size: 0.7rem;
}

.crm-content {
  padding: clamp(1.25rem, 2.4vw, 2.25rem);
}

.crm-auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 34rem);
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 15% 10%, rgba(91, 91, 214, 0.12), transparent 30%), var(--crm-body-bg);
}

.crm-auth-card {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: 1.25rem;
  box-shadow: var(--crm-shadow-lg);
}

.crm-auth-card-wide {
  max-width: 48rem;
}

.crm-auth-card h2 {
  margin: 0.6rem 0 0.35rem;
  color: var(--crm-text);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.04em;
}

.crm-form {
  margin-top: 1.5rem;
}

.crm-form .form-control {
  min-height: 2.8rem;
  border-color: var(--crm-border-strong);
  border-radius: 0.7rem;
}

.crm-form .form-control:focus {
  border-color: rgba(91, 91, 214, 0.5);
  box-shadow: 0 0 0 0.22rem rgba(91, 91, 214, 0.12);
}

.crm-form .btn-primary {
  min-height: 2.8rem;
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  border-radius: 0.7rem;
  font-weight: 700;
}

.crm-dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.crm-dashboard-head h2 {
  max-width: 40rem;
  margin: 0.5rem 0 0.35rem;
  color: var(--crm-text);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 760;
  letter-spacing: -0.04em;
}

.crm-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.crm-stat-card {
  min-height: 9rem;
  padding: 1.25rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-sm);
}

.crm-stat-primary {
  color: #ffffff;
  background: linear-gradient(145deg, #6767df, #4c4cc0);
  border-color: transparent;
}

.crm-stat-label {
  color: var(--crm-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.crm-stat-primary .crm-stat-label,
.crm-stat-primary .crm-stat-caption {
  color: rgba(255, 255, 255, 0.72);
}

.crm-stat-value {
  margin: 0.7rem 0 0.25rem;
  color: var(--crm-text);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.crm-stat-primary .crm-stat-value {
  color: #ffffff;
}

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

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

.crm-panel {
  min-width: 0;
  padding: 1.25rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-sm);
}

.crm-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.crm-panel h3 {
  margin: 0.3rem 0 0;
  color: var(--crm-text);
  font-size: 1.1rem;
  font-weight: 750;
}

.crm-panel-link {
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
}

.crm-status-list,
.crm-activity-list {
  display: grid;
  gap: 0.2rem;
}

.crm-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-status-row:last-child,
.crm-activity-row:last-child {
  border-bottom: 0;
}

.crm-status-name,
.crm-status-count {
  font-size: 0.84rem;
}

.crm-status-name {
  color: var(--crm-text);
  font-weight: 650;
}

.crm-status-count {
  color: var(--crm-text-muted);
  font-weight: 750;
}

.crm-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--crm-border);
}

.crm-activity-icon {
  display: inline-grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--crm-success);
  background: var(--crm-success-soft);
  border-radius: 50%;
  font-size: 0.7rem;
}

.crm-activity-title {
  color: var(--crm-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.crm-activity-meta {
  margin-top: 0.15rem;
  color: var(--crm-text-muted);
  font-size: 0.72rem;
}

.crm-empty {
  padding: 2rem 0.5rem;
  color: var(--crm-text-muted);
  text-align: center;
  font-size: 0.85rem;
}

@media (max-width: 991.98px) {
  .crm-main {
    margin-left: 0;
  }

  .crm-menu-toggle {
    display: inline-grid;
    place-items: center;
  }
}

@media (max-width: 767.98px) {
  .crm-dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .crm-user-name,
  .crm-user-role {
    display: none;
  }
}

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

.crm-auth-body {
  min-height: 100vh;
  margin: 0;
  background: #f4f5fa;
}

.crm-auth-shell {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at 12% 16%, rgba(104, 104, 222, 0.2), transparent 28%),
    radial-gradient(circle at 88% 84%, rgba(52, 181, 161, 0.16), transparent 26%),
    linear-gradient(135deg, #f7f7fc 0%, #eef0fa 100%);
}

.crm-auth-shell::before,
.crm-auth-shell::after {
  position: absolute;
  display: block;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(91, 91, 214, 0.12);
  border-radius: 50%;
  content: "";
}

.crm-auth-shell::before {
  top: -12rem;
  right: -5rem;
}

.crm-auth-shell::after {
  bottom: -14rem;
  left: -7rem;
  border-color: rgba(52, 181, 161, 0.13);
}

.crm-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 31rem;
  padding: clamp(1.75rem, 5vw, 3rem);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 222, 237, 0.9);
  border-radius: 1.5rem;
  box-shadow: 0 2rem 5rem rgba(42, 44, 82, 0.14), 0 0.25rem 1rem rgba(42, 44, 82, 0.05);
  backdrop-filter: blur(1.25rem);
}

.crm-auth-card-glow {
  position: absolute;
  top: -8rem;
  right: -7rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 91, 214, 0.16), transparent 68%);
  pointer-events: none;
}

.crm-auth-card > *:not(.crm-auth-card-glow) {
  position: relative;
  z-index: 1;
}

.crm-auth-brand {
  margin-bottom: 2.6rem;
}

.crm-auth-heading h2 {
  margin-top: 0.55rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.055em;
}

.crm-auth-heading p {
  max-width: 25rem;
  margin-bottom: 0;
  line-height: 1.65;
}

.crm-auth-form {
  margin-top: 2rem;
}

.crm-auth-form .form-label {
  margin-bottom: 0.5rem;
  color: #3b3d55;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.crm-auth-form .form-control {
  min-height: 3.1rem;
  padding: 0.75rem 0.95rem;
  background: rgba(250, 250, 253, 0.9);
  border-color: #dfe1ed;
  border-radius: 0.8rem;
  color: #24263b;
}

.crm-auth-form .form-control::placeholder {
  color: #a2a5b6;
}

.crm-auth-form .form-control:focus {
  background: #fff;
  border-color: rgba(91, 91, 214, 0.62);
  box-shadow: 0 0 0 0.25rem rgba(91, 91, 214, 0.12);
}

.crm-auth-submit {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border-radius: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow: 0 0.7rem 1.3rem rgba(76, 76, 192, 0.2);
}

.crm-auth-submit-arrow {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.crm-auth-submit:hover .crm-auth-submit-arrow {
  transform: translateX(0.2rem);
}

.crm-auth-submit.is-loading {
  pointer-events: none;
  opacity: 0.78;
}

.crm-auth-footer-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.8rem;
  color: #8a8da1;
  font-size: 0.73rem;
  line-height: 1.45;
}

.crm-auth-lock {
  color: #36ae8a;
  font-size: 0.65rem;
}

.crm-auth-card-wide {
  max-width: 52rem;
}

.crm-auth-card-wide .crm-brand {
  margin-bottom: 1.5rem;
}

.crm-auth-card-wide .crm-form {
  margin-top: 1.75rem;
}

@media (max-width: 575.98px) {
  .crm-auth-shell {
    align-items: flex-start;
    padding: 1rem;
  }

  .crm-auth-card {
    margin: auto 0;
    padding: 1.5rem;
    border-radius: 1.2rem;
  }

  .crm-auth-brand {
    margin-bottom: 2rem;
  }
}


/* Customer 360: type badges, documents and call queue */
.crm-customer-type {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.crm-customer-type-vip { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.crm-customer-type-new { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.crm-customer-type-high-profile { background: rgba(168, 85, 247, 0.14); color: #7e22ce; }
.crm-customer-type-simple { background: rgba(100, 116, 139, 0.14); color: #475569; }
.crm-customer-type-default { background: rgba(15, 23, 42, 0.06); color: #64748b; }

.crm-documents { margin-top: 1rem; }

.crm-doc-slot {
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.9rem;
  background: #fff;
}

.crm-doc-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.crm-doc-slot-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
}

.crm-doc-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 7.5rem;
  padding: 0.75rem;
  border: 1.5px dashed rgba(15, 23, 42, 0.18);
  border-radius: 0.7rem;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.crm-doc-drop:hover,
.crm-doc-drop:focus,
.crm-doc-drop.is-dragover {
  border-color: #36ae8a;
  background: rgba(54, 174, 138, 0.07);
  outline: none;
}

.crm-doc-drop.is-cropping {
  min-height: 16rem;
}

.crm-doc-drop img.crm-doc-thumb {
  max-width: 100%;
  max-height: 9rem;
  border-radius: 0.5rem;
  object-fit: contain;
}

.crm-doc-drop img.crm-doc-crop-canvas {
  display: none;
  max-width: 100%;
}

.crm-doc-drop.is-cropping img.crm-doc-crop-canvas {
  display: block;
}

.crm-doc-drop.is-cropping .crm-doc-empty,
.crm-doc-drop.is-cropping .crm-doc-file-name {
  display: none;
}

.crm-doc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: #8a8da1;
}

.crm-doc-empty-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.crm-doc-empty-text,
.crm-doc-file-name {
  font-size: 0.72rem;
}

.crm-doc-file-name {
  color: #0f172a;
  font-weight: 600;
  word-break: break-all;
}

.crm-doc-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.crm-doc-hint {
  margin-top: 0.4rem;
  min-height: 1.1rem;
}

.crm-doc-hint.is-error { color: #b91c1c; }
.crm-doc-hint.is-success { color: #047857; }

.crm-doc-crop-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.crm-call-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.9rem;
  background: #fff;
}

.crm-call-card .crm-call-note {
  min-height: 4.5rem;
}

.crm-select2-container .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
  border-color: rgba(15, 23, 42, 0.18);
  border-radius: 0.5rem;
}

.crm-select2-container .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.75rem);
  color: #0f172a;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.5rem;
}

.crm-crop-open { overflow: hidden; }

.crm-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.crm-crop-modal[hidden] { display: none; }

.crm-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.crm-crop-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(60rem, 100%);
  max-height: 92vh;
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.3);
}

.crm-crop-head,
.crm-crop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.crm-crop-stage {
  flex: 1 1 auto;
  min-height: 16rem;
  overflow: hidden;
  background: #0f172a;
}

.crm-crop-stage img {
  display: block;
  max-width: 100%;
}
