/* Study Visa CRM — Modern UI Enhancements */

:root {
  --crm-gradient: linear-gradient(135deg, #696cff 0%, #8592ff 50%, #a8b4ff 100%);
  --crm-gradient-success: linear-gradient(135deg, #71dd37 0%, #8ee653 100%);
  --crm-gradient-warning: linear-gradient(135deg, #ffab00 0%, #ffc947 100%);
  --crm-gradient-info: linear-gradient(135deg, #03c3ec 0%, #5fd4f4 100%);
  --crm-shadow: 0 2px 12px rgba(67, 89, 113, 0.08);
  --crm-shadow-hover: 0 8px 24px rgba(67, 89, 113, 0.12);
}

/* Welcome banner */
.crm-welcome-banner {
  background: var(--crm-gradient);
  border-radius: 0.75rem;
  color: #fff;
  padding: 1.75rem 2rem;
  position: relative;
  overflow: hidden;
}
.crm-welcome-banner::after {
  content: '';
  position: absolute;
  right: -2rem;
  top: -2rem;
  width: 12rem;
  height: 12rem;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.crm-welcome-banner h4 { color: #fff; font-weight: 600; }
.crm-welcome-banner p { color: rgba(255,255,255,0.85); margin-bottom: 0; }

/* Modern stat cards */
.crm-stat-card {
  border: none;
  box-shadow: var(--crm-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.crm-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--crm-shadow-hover);
}
.crm-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.crm-stat-card .stat-value {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
}
.crm-stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
}
.crm-stat-card .stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Journey stepper */
.crm-journey-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
}
.crm-journey-step {
  flex: 1;
  min-width: 100px;
  text-align: center;
  position: relative;
}
.crm-journey-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 60%;
  width: 80%;
  height: 3px;
  background: var(--bs-border-color);
  z-index: 0;
}
.crm-journey-step.completed:not(:last-child)::after {
  background: var(--bs-primary);
}
.crm-journey-step .step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bs-body-bg);
  border: 2px solid var(--bs-border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  position: relative;
  z-index: 1;
  margin-bottom: 0.5rem;
}
.crm-journey-step.active .step-dot {
  border-color: var(--bs-primary);
  background: rgba(105, 108, 255, 0.12);
  color: var(--bs-primary);
}
.crm-journey-step.completed .step-dot {
  border-color: var(--bs-primary);
  background: var(--bs-primary);
  color: #fff;
}
.crm-journey-step .step-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--bs-secondary-color);
  display: block;
}
.crm-journey-step .step-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--bs-heading-color);
}

/* Kanban pipeline */
.crm-kanban {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  min-height: 420px;
}
.crm-kanban-col {
  flex: 0 0 280px;
  background: rgba(67, 89, 113, 0.04);
  border-radius: 0.75rem;
  padding: 1rem;
}
.crm-kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid transparent;
}
.crm-kanban-col-header h6 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.crm-kanban-col-header .count {
  background: var(--bs-body-bg);
  border-radius: 20px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.crm-kanban-card {
  background: var(--bs-body-bg);
  border-radius: 0.5rem;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--crm-shadow);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  border-left: 3px solid transparent;
}
.crm-kanban-card:hover {
  box-shadow: var(--crm-shadow-hover);
}
.crm-kanban-card.priority-high { border-left-color: #ff3e1d; }
.crm-kanban-card.priority-medium { border-left-color: #ffab00; }
.crm-kanban-card.priority-low { border-left-color: #8592a3; }

/* Filter bar */
.crm-filter-bar {
  background: var(--bs-body-bg);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  box-shadow: var(--crm-shadow);
  margin-bottom: 1.25rem;
}
.crm-filter-chips .btn {
  border-radius: 20px;
  font-size: 0.8125rem;
  padding: 0.25rem 0.875rem;
}

/* Quick actions */
.crm-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--bs-body-bg);
  box-shadow: var(--crm-shadow);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.crm-quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--crm-shadow-hover);
  border-color: rgba(105, 108, 255, 0.3);
  color: var(--bs-primary);
}
.crm-quick-action i {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.crm-quick-action span {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

/* Staff performance bars */
.crm-staff-bar .progress {
  height: 6px;
  border-radius: 3px;
}

/* Visa checklist */
.crm-visa-step {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}
.crm-visa-step:last-child { border-bottom: none; }
.crm-visa-step .step-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.crm-visa-step.done .step-check {
  background: rgba(113, 221, 55, 0.16);
  color: #71dd37;
}
.crm-visa-step.current .step-check {
  background: rgba(105, 108, 255, 0.16);
  color: #696cff;
  box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.2);
}
.crm-visa-step.pending .step-check {
  background: rgba(133, 146, 163, 0.12);
  color: #8592a3;
}

/* Communication timeline */
.crm-comm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 560px;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--crm-shadow);
}
.crm-comm-sidebar {
  background: rgba(67, 89, 113, 0.04);
  border-right: 1px solid var(--bs-border-color);
}
.crm-comm-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bs-border-color);
  transition: background 0.15s;
}
.crm-comm-contact:hover, .crm-comm-contact.active {
  background: var(--bs-body-bg);
}
.crm-comm-main {
  display: flex;
  flex-direction: column;
  background: var(--bs-body-bg);
}
.crm-comm-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}
.crm-msg {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.crm-msg.inbound {
  background: rgba(67, 89, 113, 0.06);
  border-bottom-left-radius: 0.25rem;
}
.crm-msg.outbound {
  background: rgba(105, 108, 255, 0.12);
  margin-left: auto;
  border-bottom-right-radius: 0.25rem;
}

/* Automation cards */
.crm-automation-card {
  border: 1px dashed var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
}
.crm-automation-card.enabled {
  border-style: solid;
  border-color: rgba(105, 108, 255, 0.4);
  background: rgba(105, 108, 255, 0.04);
}

/* Settings nav pills */
.crm-settings-nav .nav-link {
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.625rem 1rem;
  color: var(--bs-body-color);
}
.crm-settings-nav .nav-link.active {
  background: rgba(105, 108, 255, 0.12);
  color: var(--bs-primary);
}

/* Alert cards on dashboard */
.crm-alert-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}
.crm-alert-item:last-child { border-bottom: none; }
.crm-alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Page view toggle */
.crm-view-toggle .btn-check:checked + .btn {
  background: var(--bs-primary);
  color: #fff;
  border-color: var(--bs-primary);
}

@media (max-width: 991.98px) {
  .crm-comm-layout { grid-template-columns: 1fr; }
  .crm-comm-sidebar { max-height: 200px; overflow-y: auto; }
  .crm-kanban-col { flex: 0 0 260px; }
}

/* Theme-aware SVG brand mark (currentColor / text-primary — no raster image) */
.app-brand .app-brand-logo.demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-brand-logo.demo svg,
.app-brand-logo-mark svg {
  width: 22px;
  height: 38px;
  display: block;
}
.layout-menu .app-brand {
  position: relative;
  justify-content: flex-start;
  align-items: center;
  min-block-size: 64px;
  height: 64px;
  margin-top: 12px;
  padding-block: 0;
  padding-inline: 1.25rem;
  overflow: visible;
}
.layout-menu .app-brand .app-brand-link {
  position: relative;
  z-index: 1;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  max-width: calc(100% - 2.5rem);
  margin: 0;
  padding-inline: 0;
}
.layout-menu .app-brand .app-brand-text {
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}
/* Keep Sneat edge placement for the collapse arrow */
.layout-menu .app-brand .layout-menu-toggle {
  inset-block-start: 50%;
  margin-block-start: -1.125rem;
  z-index: 4;
}
.layout-menu-collapsed .app-brand {
  min-block-size: 64px;
  padding-inline: 0.35rem;
  justify-content: center;
}
.layout-menu-collapsed .app-brand .app-brand-link {
  justify-content: center;
  max-width: 100%;
}
.authentication-wrapper .app-brand.auth-cover-brand {
  align-items: center;
}
.authentication-wrapper .app-brand-logo.demo svg {
  width: 22px;
  height: 38px;
}
