:root {
  --crm-blue: rgb(50, 129, 248);
  --crm-blue-2: #1f6fee;
  --crm-cyan: #23d3ee;
  --crm-green: #1fe6a8;
  --crm-purple: #8b5cf6;
  --crm-amber: #f6bd3d;
  --crm-red: #ff5f76;

  --crm-bg: #060910;
  --crm-bg-2: #09101b;
  --crm-panel: #0d1422;
  --crm-panel-2: #101a2b;
  --crm-panel-3: #131f33;
  --crm-line: rgba(148, 163, 184, 0.16);
  --crm-line-strong: rgba(148, 163, 184, 0.28);
  --crm-text: #eef5ff;
  --crm-muted: #91a1b8;
  --crm-soft: #c6d4e8;

  --crm-radius-sm: 8px;
  --crm-radius-md: 12px;
  --crm-radius-lg: 16px;
  --crm-sidebar-w: 278px;
  --crm-topbar-h: 72px;
  --crm-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --crm-shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.24);
  --crm-focus: 0 0 0 4px rgba(50, 129, 248, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--crm-bg);
}

body.crm-admin-body,
.crm-login-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(50, 129, 248, 0.08), transparent 280px),
    linear-gradient(135deg, #060910 0%, #0a111d 48%, #07131a 100%);
  color: var(--crm-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

/* Login */
.crm-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(360px, 520px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px);
}

.crm-login-panel,
.crm-login-card {
  position: relative;
  border: 1px solid var(--crm-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--crm-panel);
  box-shadow: var(--crm-shadow);
}

.crm-login-panel {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 20px;
}

.crm-login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(50, 129, 248, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(50, 129, 248, 0.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, black, transparent 85%);
  opacity: 0.34;
}

.crm-login-brand,
.crm-login-copy,
.crm-login-metrics {
  position: relative;
  z-index: 1;
}

.crm-login-brand,
.crm-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.crm-login-brand img {
  width: 112px;
  height: auto;
}

.crm-login-brand span,
.crm-sidebar-brand span {
  color: var(--crm-blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(50, 129, 248, 0.35);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(50, 129, 248, 0.1);
}

.crm-kicker {
  color: var(--crm-green);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.crm-login-copy h1 {
  max-width: 520px;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2.15rem, 3.35vw, 3.15rem);
  line-height: 1.06;
  font-weight: 760;
  letter-spacing: 0;
}

.crm-login-copy p {
  max-width: 460px;
  color: var(--soft, var(--crm-soft));
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.crm-login-card .form-control {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.045)),
    #0b1220 !important;
  border-color: rgba(148, 163, 184, 0.22);
  color: #fff !important;
}

.crm-login-card .form-control:focus {
  border-color: rgba(50, 129, 248, 0.58);
  background: #0e1728 !important;
}

.crm-login-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.crm-login-metrics div {
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.crm-login-metrics strong {
  display: block;
  color: #fff;
  font-size: 1.18rem;
  line-height: 1;
}

.crm-login-metrics span {
  display: block;
  margin-top: 8px;
  color: var(--crm-muted);
  font-size: 0.78rem;
}

.crm-login-card {
  border-radius: 20px;
  padding: clamp(24px, 4vw, 36px);
}

.crm-login-card::before,
.card::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--crm-blue), var(--crm-cyan), transparent);
  opacity: 0.85;
}

.crm-login-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.crm-login-card h2 {
  margin: 0;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.crm-login-lock,
.crm-icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(50, 129, 248, 0.32);
  border-radius: var(--crm-radius-md);
  background: rgba(50, 129, 248, 0.12);
  color: var(--crm-blue);
}

.crm-inline-alert {
  margin-bottom: 18px;
  border-radius: var(--crm-radius-md);
  padding: 12px 14px;
  font-weight: 700;
}

.crm-inline-alert-error {
  color: #ffd9df;
  border: 1px solid rgba(255, 95, 118, 0.32);
  background: rgba(255, 95, 118, 0.11);
}

/* Admin shell */
.wrapper {
  min-height: 100vh;
  background: transparent;
}

.crm-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--crm-sidebar-w);
  z-index: 1040;
  border-right: 1px solid var(--crm-line);
  background:
    linear-gradient(180deg, rgba(50, 129, 248, 0.1), transparent 220px),
    #070b13;
  box-shadow: 18px 0 55px rgba(0, 0, 0, 0.28);
}

.sidebar-header {
  min-height: var(--crm-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--crm-line);
}

.crm-sidebar-brand {
  text-decoration: none;
}

.crm-sidebar-brand img {
  width: 118px;
  height: auto;
}

.sidebar-body {
  height: calc(100vh - var(--crm-topbar-h));
  overflow-y: auto;
  padding: 18px 14px 24px;
}

.sidebar-body::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar-body::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

.metismenu,
.metismenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-label {
  padding: 12px 12px 8px;
}

.nav-label_text {
  color: #5e718d;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--crm-radius-md);
  color: var(--crm-muted);
  font-weight: 700;
  text-decoration: none;
  transition: 0.18s ease;
}

.sidebar-nav a svg,
.sidebar-nav a i {
  color: #6d82a0;
  flex: 0 0 auto;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-nav .mm-active > a {
  color: #fff;
  border-color: rgba(50, 129, 248, 0.28);
  background:
    linear-gradient(135deg, rgba(50, 129, 248, 0.18), rgba(35, 211, 238, 0.06)),
    rgba(255, 255, 255, 0.035);
}

.sidebar-nav a:hover svg,
.sidebar-nav a.active svg,
.sidebar-nav .mm-active > a svg {
  color: var(--crm-blue);
}

.nav-second-level {
  padding: 2px 0 8px 18px;
  border-left: 1px solid rgba(50, 129, 248, 0.18);
  margin-left: 18px;
}

.nav-second-level a {
  min-height: 34px;
  padding: 8px 11px;
  font-size: 0.9rem;
  font-weight: 650;
}

.content-wrapper {
  min-height: 100vh;
  margin-left: var(--crm-sidebar-w);
  background: transparent;
}

.main-content {
  min-height: 100vh;
}

.crm-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--crm-topbar-h);
  padding: 0 26px;
  border-bottom: 1px solid var(--crm-line);
  background: rgba(7, 11, 19, 0.86);
  backdrop-filter: blur(18px);
}

.crm-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--crm-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.crm-topbar-title strong {
  color: #fff;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar-toggle {
  display: none;
  margin-right: 14px;
}

.crm-icon-button {
  padding: 0;
  cursor: pointer;
}

.crm-user-trigger {
  border: 1px solid var(--crm-line);
  border-radius: 999px;
  padding: 7px 12px 7px 7px !important;
  background: rgba(255, 255, 255, 0.035);
  color: #fff !important;
}

.crm-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--crm-blue), var(--crm-cyan));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(50, 129, 248, 0.16);
  overflow: hidden;
}

.crm-avatar span {
  line-height: 1;
}

.profile-text {
  margin-left: 10px;
}

.profile-text h6 {
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
}

.profile-text span {
  display: block;
  max-width: 190px;
  overflow: hidden;
  color: var(--crm-muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-user-menu {
  min-width: 260px;
  padding: 10px;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-lg);
  background: #0b1220;
  box-shadow: var(--crm-shadow);
}

.user-header {
  padding: 14px;
  border-bottom: 1px solid var(--crm-line);
  margin-bottom: 8px;
}

.user-header .img-user {
  margin-bottom: 10px;
}

.user-header h6 {
  color: #fff;
  margin: 0 0 4px;
  font-weight: 800;
}

.user-header span {
  color: var(--crm-muted);
  font-size: 0.82rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--crm-radius-sm);
  color: var(--crm-soft);
  font-weight: 700;
  padding: 10px 12px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: #fff;
  background: rgba(50, 129, 248, 0.12);
}

.body-content {
  padding: 24px;
}

.body-content > .container {
  max-width: 1440px;
}

.crm-page {
  width: 100%;
}

.crm-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.crm-page-header h1,
.crm-page-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  line-height: 1;
  font-weight: 720;
}

/* Bootstrap compatibility layer */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #fff;
  letter-spacing: 0;
}

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

.card {
  position: relative;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--crm-panel);
  color: var(--crm-text);
  box-shadow: var(--crm-shadow-soft);
  overflow: hidden;
}

.card-header {
  border-bottom: 1px solid var(--crm-line);
  background: rgba(255, 255, 255, 0.025);
  color: #fff;
  font-weight: 800;
  padding: 15px 18px;
}

.card-body {
  padding: 18px;
}

.card.border {
  border-color: var(--crm-line) !important;
}

.display-6,
.fw-bold,
.fw-semibold,
strong {
  color: #fff;
}

.btn {
  min-height: 40px;
  border-radius: var(--crm-radius-md);
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none !important;
}

.btn:focus,
.btn:active,
.form-control:focus,
.form-select:focus {
  box-shadow: var(--crm-focus) !important;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(123, 180, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(135deg, var(--crm-blue), var(--crm-blue-2));
  box-shadow:
    0 10px 28px rgba(50, 129, 248, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transform: translateX(-115%);
  transition: transform 0.5s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  border-color: rgba(123, 180, 255, 0.48);
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-primary:hover::before,
.btn-primary:focus::before {
  transform: translateX(115%);
}

.crm-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.crm-btn-icon i {
  font-size: 0.92em;
  line-height: 1;
}

.btn-secondary,
.btn-outline-secondary {
  color: var(--crm-soft);
  border-color: var(--crm-line);
  background: rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  color: #fff;
  border-color: var(--crm-line-strong);
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline-primary,
.btn-info {
  color: #dbeafe;
  border-color: rgba(50, 129, 248, 0.35);
  background: rgba(50, 129, 248, 0.1);
}

.btn-outline-primary:hover,
.btn-info:hover {
  color: #fff;
  border-color: rgba(50, 129, 248, 0.58);
  background: rgba(50, 129, 248, 0.2);
}

.btn-danger,
.btn-outline-danger {
  color: #fff;
  border-color: rgba(255, 95, 118, 0.45);
  background: rgba(255, 95, 118, 0.16);
}

.btn-danger:hover,
.btn-outline-danger:hover {
  color: #fff;
  background: rgba(255, 95, 118, 0.28);
}

.btn-warning {
  color: #251807;
  border-color: transparent;
  background: var(--crm-amber);
}

.btn-outline-warning {
  color: #ffe2a3;
  border-color: rgba(246, 189, 61, 0.34);
  background: rgba(246, 189, 61, 0.1);
}

.btn-outline-warning:hover {
  color: #fff2c8;
  border-color: rgba(246, 189, 61, 0.52);
  background: rgba(246, 189, 61, 0.17);
}

.btn-sm {
  min-height: 34px;
  padding: 0.42rem 0.72rem;
  font-size: 0.82rem;
}

.form-label {
  color: var(--crm-soft);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.form-control,
.form-select,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="month"] {
  min-height: 44px;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-md);
  background-color: rgba(255, 255, 255, 0.055) !important;
  color: #fff !important;
  transition: 0.18s ease;
}

.form-control::placeholder,
textarea::placeholder,
input::placeholder {
  color: #637792;
}

.form-control:hover,
.form-select:hover,
select:hover,
textarea:hover,
input:hover {
  border-color: var(--crm-line-strong);
}

.form-control:focus,
.form-select:focus,
select:focus,
textarea:focus,
input:focus {
  border-color: rgba(50, 129, 248, 0.58);
  background-color: rgba(255, 255, 255, 0.075) !important;
  color: #fff !important;
  outline: none;
}

.form-select option,
select option {
  color: #111827;
}

.table-responsive {
  border-radius: var(--crm-radius-md);
}

.table {
  color: var(--crm-soft);
  margin-bottom: 0;
  border-color: var(--crm-line);
}

.table > :not(caption) > * > * {
  border-color: var(--crm-line);
  background: transparent;
  color: inherit;
  padding: 13px 14px;
}

.table thead th {
  color: #dce9fb;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  color: var(--crm-soft);
  background: rgba(255, 255, 255, 0.025);
}

.table tbody tr:hover > * {
  background: rgba(50, 129, 248, 0.08);
  color: #fff;
}

.crm-table-card {
  width: 100%;
}

.crm-table-card .card-header {
  min-height: 76px;
}

.crm-table-card .card-header h1,
.crm-table-card .card-header h2,
.crm-table-card .card-header h3,
.crm-table-card .card-header h4,
.crm-table-card .card-header h5,
.crm-table-card .card-header h6 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.18rem, 1.4vw, 1.42rem);
  line-height: 1.2;
  font-weight: 650;
}

.crm-data-table {
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--crm-radius-lg);
  background: #0a101c;
}

.crm-data-table > :not(caption) > * > * {
  border-color: rgba(148, 163, 184, 0.12) !important;
}

.crm-data-table thead th {
  background: rgba(255, 255, 255, 0.055) !important;
  color: #dce9fb !important;
}

.crm-data-table tbody tr > * {
  background: rgba(255, 255, 255, 0.018) !important;
  color: var(--crm-soft) !important;
}

.crm-data-table tbody tr:nth-child(odd) > * {
  background: rgba(50, 129, 248, 0.055) !important;
}

.crm-data-table tbody tr:hover > * {
  background: rgba(50, 129, 248, 0.12) !important;
  color: #fff !important;
}

.crm-empty-row {
  color: var(--crm-muted) !important;
  padding: 30px 14px !important;
}

.crm-table-link {
  color: #9ec5ff;
  text-decoration: none;
}

.crm-table-link:hover {
  color: #fff;
}

.crm-table-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--crm-radius-md);
  color: #dbeafe;
  border: 1px solid rgba(50, 129, 248, 0.28);
  background: rgba(50, 129, 248, 0.12);
}

.crm-action-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: var(--crm-line) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: var(--crm-soft) !important;
}

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

.crm-action-button.btn-outline-primary {
  border-color: rgba(50, 129, 248, 0.36) !important;
  background: rgba(50, 129, 248, 0.1) !important;
  color: #9ec5ff !important;
}

.crm-action-button.btn-outline-primary:hover {
  border-color: rgba(50, 129, 248, 0.48) !important;
  background: rgba(50, 129, 248, 0.16) !important;
  color: #dbeafe !important;
}

.crm-action-button.btn-outline-warning {
  border-color: rgba(246, 189, 61, 0.38) !important;
  background: rgba(246, 189, 61, 0.12) !important;
  color: #ffd36d !important;
}

.crm-action-button.btn-outline-warning:hover {
  border-color: rgba(246, 189, 61, 0.5) !important;
  background: rgba(246, 189, 61, 0.18) !important;
  color: #ffe2a3 !important;
}

.crm-action-button.btn-outline-danger,
.crm-action-button.btn-danger {
  border-color: rgba(255, 95, 118, 0.36) !important;
  background: rgba(255, 95, 118, 0.1) !important;
  color: #ff9aaa !important;
}

.crm-action-button.btn-outline-danger:hover,
.crm-action-button.btn-danger:hover {
  border-color: rgba(255, 95, 118, 0.5) !important;
  background: rgba(255, 95, 118, 0.17) !important;
  color: #ffd9df !important;
}

.crm-action-button.btn-outline-secondary {
  border-color: rgba(148, 163, 184, 0.26) !important;
  background: rgba(148, 163, 184, 0.075) !important;
  color: #b8c4d8 !important;
}

.crm-action-button.btn-outline-secondary:hover {
  border-color: rgba(148, 163, 184, 0.38) !important;
  background: rgba(148, 163, 184, 0.13) !important;
  color: #fff !important;
}

.crm-users-page > .row {
  margin-bottom: 34px !important;
}

.crm-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.crm-user-card .card-body {
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 24px;
}

.crm-user-card::before {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--crm-blue), var(--crm-cyan), transparent);
}

.crm-user-avatar {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid rgba(50, 129, 248, 0.34);
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.26), transparent 26%),
    linear-gradient(135deg, var(--crm-blue), #23d3ee);
  box-shadow:
    0 14px 34px rgba(50, 129, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.crm-user-main h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 760;
}

.crm-user-main p,
.crm-user-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--crm-muted);
  font-size: 0.92rem;
}

.crm-user-main p span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-user-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.crm-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}

.badge {
  border-radius: 999px;
  padding: 0.46rem 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.badge.bg-success {
  color: #c5ffed !important;
  border: 1px solid rgba(31, 230, 168, 0.38);
  background: rgba(31, 230, 168, 0.12) !important;
}

.badge.bg-warning {
  color: #ffe8b0 !important;
  border: 1px solid rgba(246, 189, 61, 0.38);
  background: rgba(246, 189, 61, 0.12) !important;
}

.badge.bg-danger {
  color: #ffd9df !important;
  border: 1px solid rgba(255, 95, 118, 0.38);
  background: rgba(255, 95, 118, 0.12) !important;
}

.progress {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  background: linear-gradient(90deg, var(--crm-blue), var(--crm-cyan));
}

.nav-tabs {
  gap: 8px;
  border-bottom: 1px solid var(--crm-line);
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: var(--crm-radius-md) var(--crm-radius-md) 0 0;
  color: var(--crm-muted);
  font-weight: 800;
}

.nav-tabs .nav-link:hover {
  border-color: var(--crm-line);
  color: #fff;
}

.nav-tabs .nav-link.active {
  color: #fff;
  border-color: var(--crm-line);
  background: rgba(50, 129, 248, 0.13);
}

.modal-backdrop.show {
  opacity: 0.76;
}

.modal-content {
  position: relative;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-lg);
  background: #0b1220;
  color: var(--crm-text);
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}

.crm-modal .modal-content::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--crm-blue), var(--crm-cyan), transparent);
  opacity: 0.9;
}

.modal-header,
.modal-footer {
  border-color: var(--crm-line);
  background: rgba(255, 255, 255, 0.025);
}

.modal-title {
  color: #fff;
  font-weight: 900;
}

.crm-modal .modal-header {
  min-height: 72px;
}

.crm-modal .modal-title {
  font-size: 1.35rem;
  font-weight: 760;
}

.crm-modal .modal-body {
  padding: 26px;
}

.crm-modal .modal-footer {
  gap: 12px;
  padding: 18px 26px 24px;
}

.input-group-text {
  border-color: var(--crm-line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--crm-muted) !important;
}

.input-group > .form-control {
  border-left: 0;
}

.btn-close {
  filter: invert(1) grayscale(1);
  opacity: 0.76;
}

.pagination {
  gap: 8px;
  flex-wrap: wrap;
}

.page-link {
  border-color: var(--crm-line);
  border-radius: var(--crm-radius-sm) !important;
  background: rgba(255, 255, 255, 0.045);
  color: var(--crm-soft);
  font-weight: 800;
}

.page-link:hover,
.page-item.active .page-link {
  border-color: rgba(50, 129, 248, 0.45);
  background: rgba(50, 129, 248, 0.16);
  color: #fff;
}

.custom-alert {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  max-width: min(420px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-md);
  padding: 13px 14px;
  color: #fff;
  background: #0b1220;
  box-shadow: var(--crm-shadow);
}

.custom-alert.success {
  border-color: rgba(31, 230, 168, 0.38);
}

.custom-alert.error {
  border-color: rgba(255, 95, 118, 0.42);
}

.custom-alert.hidden {
  display: none;
}

.custom-alert.visible {
  display: flex;
}

.alert-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.swal2-popup {
  border: 1px solid var(--crm-line) !important;
  border-radius: var(--crm-radius-lg) !important;
  background: #0b1220 !important;
  color: var(--crm-text) !important;
  box-shadow: var(--crm-shadow) !important;
}

.swal2-title {
  color: #fff !important;
}

.swal2-html-container {
  color: var(--crm-muted) !important;
}

.swal2-actions {
  gap: 10px;
}

.swal2-styled {
  border-radius: var(--crm-radius-md) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.swal2-confirm,
.crm-swal-confirm {
  border: 1px solid rgba(123, 180, 255, 0.28) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(135deg, var(--crm-blue), var(--crm-blue-2)) !important;
  color: #fff !important;
}

.crm-swal-danger {
  border: 1px solid rgba(255, 95, 118, 0.42) !important;
  background: rgba(255, 95, 118, 0.18) !important;
  color: #fff !important;
}

.swal2-cancel,
.crm-swal-cancel {
  border: 1px solid var(--crm-line) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--crm-soft) !important;
}

.apexcharts-tooltip,
.apexcharts-menu {
  color: #111827;
}

/* Dashboard */
.crm-dashboard {
  color: var(--crm-text);
}

.crm-filter-bar {
  width: 100%;
  max-width: 100%;
  flex-wrap: wrap;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-lg);
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.crm-filter-bar-table {
  flex-wrap: nowrap;
}

.crm-filter-bar-stacked {
  display: block;
}

.crm-filter-main,
.crm-filter-advanced {
  width: 100%;
  max-width: 100%;
}

.crm-filter-main {
  flex-wrap: nowrap;
}

.crm-filter-advanced {
  flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 14px;
}

.crm-filter-field {
  min-width: 190px;
  flex: 0 1 240px;
}

.crm-filter-field-compact {
  min-width: 132px;
  flex-basis: 150px;
}

.crm-filter-search {
  min-width: 260px;
  flex: 1 1 320px;
}

.crm-filter-actions {
  flex: 0 0 auto;
}

.crm-btn-icon-only {
  width: 44px;
  min-width: 44px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.crm-detail-panel {
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-lg);
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018)),
    #0b1220;
}

.crm-lead-detail-body {
  padding: 28px !important;
}

.crm-lead-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(50, 129, 248, 0.22);
  border-radius: var(--crm-radius-lg);
  padding: 22px;
  background:
    radial-gradient(circle at 90% 20%, rgba(50, 129, 248, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    #0b1220;
}

.crm-lead-avatar {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(50, 129, 248, 0.38);
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(135deg, var(--crm-blue), var(--crm-cyan));
  box-shadow: 0 18px 38px rgba(50, 129, 248, 0.2);
  font-size: 1.05rem;
  font-weight: 850;
}

.crm-lead-detail-heading {
  min-width: 0;
}

.crm-lead-detail-heading .crm-kicker {
  margin-bottom: 6px;
}

.crm-lead-detail-heading h4 {
  margin: 0;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 760;
}

.crm-lead-detail-heading p {
  margin: 7px 0 0;
  color: var(--crm-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.crm-detail-summary > div,
.crm-detail-item {
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-md);
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.crm-detail-summary span,
.crm-detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--crm-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.crm-detail-summary strong,
.crm-detail-item strong {
  display: block;
  min-width: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 720;
  overflow-wrap: anywhere;
}

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

.crm-detail-section h5 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 760;
}

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

.crm-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.crm-detail-header h4 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 760;
}

.crm-detail-panel h5 {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 760;
  margin: 20px 0 12px;
}

.crm-detail-panel hr {
  border-color: var(--crm-line);
  opacity: 1;
}

.crm-detail-grid {
  color: var(--crm-soft);
  font-size: 0.94rem;
}

.crm-detail-grid strong {
  color: #fff;
  font-weight: 760;
}

.crm-soft-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(50, 129, 248, 0.34);
  border-radius: 999px;
  padding: 8px 11px;
  color: #dbeafe;
  background: rgba(50, 129, 248, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
}

.crm-status-badge,
.crm-row-badge,
.crm-country-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1;
}

.crm-status-badge {
  min-height: 32px;
  padding: 9px 12px;
  font-size: 0.76rem;
  font-weight: 830;
  letter-spacing: 0.01em;
}

.crm-status-new {
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  background: rgba(148, 163, 184, 0.14) !important;
  color: #e5edf8 !important;
}

.crm-status-cold,
.crm-status-standby {
  border: 1px solid rgba(156, 163, 175, 0.28) !important;
  background: rgba(75, 85, 99, 0.22) !important;
  color: #cbd5e1 !important;
}

.crm-status-contact,
.crm-status-progress,
.crm-status-interested {
  border: 1px solid rgba(245, 191, 66, 0.38) !important;
  background: rgba(245, 191, 66, 0.16) !important;
  color: #fde68a !important;
}

.crm-status-demo {
  border: 1px solid rgba(56, 189, 248, 0.36) !important;
  background: rgba(56, 189, 248, 0.16) !important;
  color: #bae6fd !important;
}

.crm-status-quote,
.crm-status-negotiation {
  border: 1px solid rgba(50, 129, 248, 0.42) !important;
  background: rgba(50, 129, 248, 0.18) !important;
  color: #dbeafe !important;
}

.crm-status-closed {
  border: 1px solid rgba(139, 92, 246, 0.38) !important;
  background: rgba(139, 92, 246, 0.16) !important;
  color: #ddd6fe !important;
}

.crm-status-won {
  border: 1px solid rgba(31, 230, 168, 0.38) !important;
  background: rgba(31, 230, 168, 0.16) !important;
  color: #bbf7d0 !important;
}

.crm-status-lost {
  border: 1px solid rgba(255, 95, 118, 0.42) !important;
  background: rgba(255, 95, 118, 0.16) !important;
  color: #fecdd3 !important;
}

.crm-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.crm-row-badge {
  min-height: 28px;
  padding: 7px 10px;
  font-size: 0.73rem;
  font-weight: 800;
}

.crm-row-badge-info {
  border: 1px solid rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.13);
  color: #bae6fd;
}

.crm-row-badge-warning {
  border: 1px solid rgba(245, 191, 66, 0.36);
  background: rgba(245, 191, 66, 0.14);
  color: #fde68a;
}

.crm-row-badge-success {
  border: 1px solid rgba(31, 230, 168, 0.36);
  background: rgba(31, 230, 168, 0.14);
  color: #bbf7d0;
}

.crm-row-badge-muted {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.crm-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid rgba(50, 129, 248, 0.28);
  border-radius: 999px;
  background: rgba(50, 129, 248, 0.1);
  color: #dbeafe;
  font-size: 0.72rem;
  font-weight: 820;
}

.crm-country-pill {
  min-height: 32px;
  padding: 7px 10px 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: var(--crm-soft);
  font-size: 0.82rem;
  font-weight: 760;
}

.crm-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.95rem;
  line-height: 1;
}

.crm-form-section {
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius-lg);
  padding: 18px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    #0b1220;
}

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

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

.crm-form-section-header h6 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 760;
}

.crm-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--crm-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.crm-segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--crm-muted);
  background: transparent;
  font-weight: 700;
}

.crm-segmented-control button.active {
  color: #fff;
  background: rgba(50, 129, 248, 0.2);
  box-shadow: inset 0 0 0 1px rgba(50, 129, 248, 0.36);
}

.crm-opportunities-page .tickets-table {
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.crm-opportunities-page .tickets-table .text-muted.small {
  font-size: 0.78rem;
}

.crm-opportunities-page .tickets-table td {
  white-space: normal;
  vertical-align: middle;
}

.crm-opportunities-page .tickets-table tbody tr > * {
  border-top: 1px solid rgba(50, 129, 248, 0.12) !important;
  border-bottom: 1px solid rgba(50, 129, 248, 0.12) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    #0b1220 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.crm-opportunities-page .tickets-table tbody tr > *:first-child {
  border-left: 1px solid rgba(50, 129, 248, 0.12) !important;
  border-radius: 16px 0 0 16px;
}

.crm-opportunities-page .tickets-table tbody tr > *:last-child {
  border-right: 1px solid rgba(50, 129, 248, 0.12) !important;
  border-radius: 0 16px 16px 0;
}

.crm-opportunities-page .tickets-table tbody tr:hover > * {
  border-color: rgba(50, 129, 248, 0.32) !important;
  background:
    radial-gradient(circle at 6% 50%, rgba(50, 129, 248, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    #0d1628 !important;
}

.crm-opportunities-page .tickets-table th {
  white-space: nowrap;
}

.crm-opportunities-page .crm-filter-search {
  flex: 1 1 300px;
  min-width: 250px;
}

.crm-opportunities-page .crm-filter-main .crm-filter-field:not(.crm-filter-search) {
  flex: 0 1 210px;
  min-width: 180px;
}

.crm-opportunities-page .crm-filter-actions {
  white-space: nowrap;
}

.crm-opportunities-page .badge.bg-secondary,
.crm-ticket-detail-page .badge.bg-secondary {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.16) !important;
  color: #e5edf8;
}

.crm-opportunities-page .badge.bg-warning,
.crm-ticket-detail-page .badge.bg-warning {
  border: 1px solid rgba(245, 191, 66, 0.34);
  background: rgba(245, 191, 66, 0.18) !important;
  color: #fde9a7 !important;
}

.crm-opportunities-page .badge.bg-info,
.crm-ticket-detail-page .badge.bg-info {
  border: 1px solid rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.16) !important;
  color: #cffafe;
}

.crm-opportunities-page .badge.bg-success,
.crm-ticket-detail-page .badge.bg-success {
  border: 1px solid rgba(31, 230, 168, 0.34);
  background: rgba(31, 230, 168, 0.16) !important;
  color: #bbf7d0;
}

.crm-opportunities-page .badge.bg-danger,
.crm-ticket-detail-page .badge.bg-danger {
  border: 1px solid rgba(255, 95, 118, 0.36);
  background: rgba(255, 95, 118, 0.16) !important;
  color: #fecdd3;
}

.crm-ticket-detail-page .crm-ticket-title {
  min-width: 0;
}

.crm-ticket-detail-page .crm-ticket-shell {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.crm-ticket-detail-page .content-wrapper,
.crm-ticket-detail-page .main-content,
.crm-ticket-detail-page .body-content {
  max-width: none !important;
}

.crm-ticket-detail-page .body-content {
  padding-left: clamp(18px, 2.2vw, 36px) !important;
  padding-right: clamp(18px, 2.2vw, 36px) !important;
}

.crm-ticket-detail-page .crm-ticket-title h2 {
  margin: 0;
  color: #fff;
  font-size: 1.24rem;
  line-height: 1.2;
  font-weight: 760;
}

.crm-ticket-detail-page .crm-ticket-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.crm-ticket-detail-page .card.shadow-sm,
.crm-ticket-detail-page .timeline-card {
  border: 1px solid var(--crm-line) !important;
  border-radius: var(--crm-radius-lg) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    #0b1220 !important;
  box-shadow: none !important;
}

.crm-ticket-detail-page .row.g-3 > .col-md-6 {
  width: 50%;
}

.crm-ticket-detail-page .card.shadow-sm > .card-body {
  padding: 22px !important;
}

.crm-ticket-detail-page .card.shadow-sm h6,
.crm-ticket-detail-page .timeline-card h6 {
  color: #fff;
  font-size: 1rem;
  font-weight: 760;
}

.crm-ticket-detail-page .ticket-info-row {
  display: grid !important;
  grid-template-columns: minmax(120px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px 12px !important;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    rgba(8, 13, 24, 0.72);
}

.crm-ticket-detail-page .ticket-info-row .text-muted {
  color: var(--crm-muted) !important;
  font-size: 0.82rem;
  font-weight: 760;
}

.crm-ticket-detail-page .ticket-info-row .fw-semibold {
  color: #fff;
  overflow-wrap: anywhere;
}

.crm-ticket-detail-page .crm-ticket-field-control {
  min-width: 0;
  width: 100%;
}

.crm-ticket-detail-page .crm-ticket-field-control .form-select {
  width: 100%;
}

.crm-ticket-detail-page .crm-ticket-metrics,
.crm-ticket-detail-page .crm-followup-form,
.crm-ticket-detail-page .crm-assignment-panel {
  border: 1px solid rgba(50, 129, 248, 0.18);
  border-radius: 16px;
  padding: 16px;
  background:
    radial-gradient(circle at 92% 16%, rgba(50, 129, 248, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    #0a1221;
}

.crm-ticket-detail-page .crm-ticket-metrics .small {
  row-gap: 10px;
}

.crm-ticket-detail-page .crm-ticket-timeline-line {
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(31, 230, 168, 0.75), rgba(50, 129, 248, 0.2));
  box-shadow: 0 0 18px rgba(31, 230, 168, 0.18);
}

.crm-ticket-detail-page .crm-ticket-event {
  margin-left: 2px;
  padding: 14px 14px 14px 18px !important;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.026);
}

.crm-ticket-detail-page .crm-ticket-event hr {
  display: none;
}

.crm-ticket-detail-page .crm-followup-form .row {
  row-gap: 12px;
}

.crm-ticket-detail-page .crm-followup-form .btn-primary,
.crm-ticket-detail-page .crm-assignment-panel .btn-outline-primary {
  border-color: rgba(50, 129, 248, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(135deg, var(--crm-blue), var(--crm-blue-2));
  color: #fff;
  font-weight: 600;
}

.crm-ticket-detail-page .crm-assignment-user-row {
  gap: 14px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.026);
}

.crm-ticket-detail-page .crm-assignment-user-row:last-child {
  margin-bottom: 0;
}

.crm-ticket-detail-page .crm-timeline-item {
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    #0a1221;
}

.crm-ticket-detail-page .ticket-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.crm-ticket-detail-page .ticket-highlight {
  border: 1px solid rgba(50, 129, 248, 0.22);
  border-radius: 14px;
  padding: 12px;
  background: rgba(50, 129, 248, 0.08);
}

.crm-ticket-detail-page .ticket-highlight span {
  display: block;
  margin-bottom: 5px;
  color: var(--crm-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-ticket-detail-page .ticket-highlight strong {
  color: #fff;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.crm-ticket-detail-page .bg-white,
.crm-ticket-detail-page .list-group-item,
.crm-ticket-detail-page .border.rounded {
  border-color: var(--crm-line) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: var(--crm-soft) !important;
}

.crm-ticket-detail-page .form-control,
.crm-ticket-detail-page .form-select,
.crm-ticket-detail-page .form-control.bg-white,
.crm-ticket-detail-page .form-select.bg-white {
  border-color: rgba(148, 163, 184, 0.2) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: #fff !important;
}

.crm-ticket-detail-page textarea.form-control {
  min-height: 120px;
}

.crm-ticket-detail-page .nav-tabs {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.crm-ticket-detail-page .nav-tabs .nav-link,
.crm-ticket-detail-page .nav-pills .nav-link {
  color: var(--crm-muted);
}

.crm-ticket-detail-page .nav-tabs .nav-link.active,
.crm-ticket-detail-page .nav-pills .nav-link.active {
  border-color: rgba(50, 129, 248, 0.34);
  background: rgba(50, 129, 248, 0.16);
  color: #fff;
}

.crm-ticket-detail-page .nav-tabs .nav-link {
  border-radius: 14px 14px 0 0;
  padding: 12px 18px;
  font-weight: 760;
}

.crm-ticket-detail-page .nav-pills {
  gap: 8px;
}

.crm-ticket-detail-page .nav-pills .nav-item {
  margin-left: 0 !important;
}

.crm-ticket-detail-page .nav-pills .nav-link {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.026);
  font-weight: 720;
}

.crm-opportunities-page .ticket-row-deleted {
  opacity: 0.72;
}

.crm-opportunities-page .ticket-row-deleted td {
  background: rgba(255, 95, 118, 0.055) !important;
}

.crm-stat-card {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 18%, var(--stat-glow, rgba(50, 129, 248, 0.18)), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018)),
    #0b1220;
}

.crm-stat-card::before {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--stat-color, var(--crm-blue)), transparent);
}

.crm-stat-card::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--stat-color, var(--crm-blue));
  box-shadow: 0 0 18px var(--stat-color, var(--crm-blue));
}

.crm-stat-card .card-body {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.crm-stat-blue {
  --stat-color: var(--crm-blue);
  --stat-glow: rgba(50, 129, 248, 0.22);
}

.crm-stat-purple {
  --stat-color: var(--crm-purple);
  --stat-glow: rgba(139, 92, 246, 0.22);
}

.crm-stat-green {
  --stat-color: var(--crm-green);
  --stat-glow: rgba(31, 230, 168, 0.18);
}

.crm-stat-value {
  color: #fff;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  font-weight: 760;
}

.crm-stat-target {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 720;
}

.crm-chart-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.014)),
    #0a101c;
}

.crm-chart-card::before {
  opacity: 0.45;
}

.crm-chart-card .card-header {
  background: transparent;
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

.crm-chart-card .card-body {
  min-height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-chart-card canvas {
  max-height: 290px;
  width: 100% !important;
}

@media (max-width: 1199.98px) {
  :root {
    --crm-sidebar-w: 260px;
  }
}

@media (max-width: 991.98px) {
  .crm-login {
    grid-template-columns: 1fr;
    max-width: 680px;
  }

  .crm-login-panel {
    min-height: auto;
    gap: 54px;
  }

  .crm-sidebar {
    transform: translateX(-104%);
    transition: transform 0.2s ease;
  }

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

  .content-wrapper {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .overlay.active {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
  }
}

@media (max-width: 767.98px) {
  .crm-login {
    padding: 16px;
  }

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

  .crm-login-copy h1 {
    font-size: 2rem;
  }

  .crm-topbar {
    padding: 0 14px;
  }

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

  .profile-text span {
    display: none;
  }

  .body-content {
    padding: 16px;
  }

  .card-body {
    padding: 15px;
  }

  .table > :not(caption) > * > * {
    padding: 11px 12px;
  }

  .crm-table-card .card-header {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .crm-filter-bar-table {
    flex-wrap: wrap;
  }

  .crm-filter-main,
  .crm-filter-advanced {
    flex-wrap: wrap;
  }

  .crm-filter-field,
  .crm-filter-search,
  .crm-filter-actions {
    width: 100%;
    flex: 1 1 100%;
  }

  .crm-filter-actions {
    justify-content: flex-end;
  }

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

  .crm-detail-summary,
  .crm-detail-grid-cards {
    grid-template-columns: 1fr;
  }

  .crm-form-section-header,
  .crm-filter-actions {
    align-items: stretch !important;
    flex-direction: column;
  }

  .crm-segmented-control,
  .crm-filter-actions .btn {
    width: 100%;
  }

  .crm-ticket-detail-page .ticket-highlight-grid,
  .crm-ticket-detail-page .ticket-info-row {
    grid-template-columns: 1fr;
  }

  .crm-ticket-detail-page .row.g-3 > .col-md-6 {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .profile-text {
    display: none;
  }

  .crm-user-trigger {
    padding: 6px !important;
  }
}

/* Login final overrides: keep this after legacy/theme compatibility rules. */
body.crm-login-body .crm-login {
  grid-template-columns: minmax(380px, 500px) minmax(420px, 560px) !important;
  max-width: 1180px !important;
  gap: clamp(36px, 5vw, 84px) !important;
}

body.crm-login-body .crm-login-panel {
  width: 100%;
  min-height: 470px !important;
  padding: 40px !important;
  overflow: hidden;
}

body.crm-login-body .crm-login-copy h1 {
  max-width: 390px !important;
  font-size: 38px !important;
  line-height: 1.12 !important;
  font-weight: 650 !important;
  margin-bottom: 18px !important;
}

body.crm-login-body .crm-login-copy p {
  max-width: 390px !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
}

body.crm-login-body .crm-login-metrics {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body.crm-login-body .crm-login-metrics div {
  min-width: 0;
  padding: 14px 12px !important;
}

body.crm-login-body .crm-login-metrics strong {
  font-size: 18px !important;
  white-space: nowrap;
}

body.crm-login-body .crm-login-metrics span {
  font-size: 12px !important;
  line-height: 1.35;
}

body.crm-login-body .crm-login-card {
  padding: 38px !important;
}

body.crm-login-body .crm-login-card .btn-primary {
  font-weight: 500 !important;
}

body.crm-login-body .crm-login-card .form-control {
  background: #0e1728 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #fff !important;
}

body.crm-login-body .crm-login-card .form-control::placeholder {
  color: #657894 !important;
}

body.crm-admin-body .crm-stat-card,
body.crm-admin-body .crm-chart-card,
body.crm-admin-body .crm-dashboard > .card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    #0a101c !important;
  color: var(--crm-text) !important;
}

body.crm-admin-body .crm-stat-blue {
  background:
    radial-gradient(circle at 86% 20%, rgba(50, 129, 248, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    #0a101c !important;
}

body.crm-admin-body .crm-stat-purple {
  background:
    radial-gradient(circle at 86% 20%, rgba(139, 92, 246, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    #0a101c !important;
}

body.crm-admin-body .crm-stat-green {
  background:
    radial-gradient(circle at 88% 18%, rgba(31, 230, 168, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    #0a101c !important;
}

body.crm-admin-body .crm-chart-card .card-header,
body.crm-admin-body .crm-dashboard > .card .card-header {
  background: rgba(255, 255, 255, 0.02) !important;
  color: #fff !important;
}

body.crm-admin-body .crm-icon-button {
  color: #fff !important;
}

body.crm-admin-body .crm-icon-button i {
  display: block !important;
  color: currentColor !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

body.crm-admin-body .sidebar-toggle {
  display: none !important;
}

@media (max-width: 991.98px) {
  body.crm-admin-body .sidebar-toggle {
    display: flex !important;
  }

  body.crm-login-body .crm-login {
    grid-template-columns: minmax(0, 680px) !important;
  }

  body.crm-login-body .crm-login-copy h1 {
    max-width: 520px !important;
    font-size: 34px !important;
  }
}

@media (max-width: 575.98px) {
  body.crm-login-body .crm-login-panel,
  body.crm-login-body .crm-login-card {
    padding: 24px !important;
  }

  body.crm-login-body .crm-login-copy h1 {
    font-size: 28px !important;
  }

  body.crm-login-body .crm-login-metrics {
    grid-template-columns: 1fr !important;
  }
}
