/* AI-Native CRM — glassmorphism dark decorators */

@layer decorators {

/* ── Global backdrop: cool gradient with subtle noise ── */
.glass-backdrop {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(96, 165, 250, 0.18), transparent 70%),
    radial-gradient(ellipse 70% 50% at 90% 30%, rgba(167, 139, 250, 0.14), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(34, 211, 238, 0.08), transparent 70%),
    linear-gradient(180deg, #0b0f1a 0%, #0a0e18 100%);
}

/* ── Frosted glass panel ── */
.glass-panel {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--d-radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-card {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--d-radius);
  transition: transform 200ms var(--d-easing), border-color 200ms var(--d-easing), box-shadow 200ms var(--d-easing);
}

.glass-card:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(167, 139, 250, 0.15);
}

/* ── Sidebar ── */
.crm-sidebar {
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-sidebar [data-active="true"] {
  background: rgba(167, 139, 250, 0.14);
  color: var(--d-accent);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.2);
}

.crm-sidebar [data-active="true"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--d-accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--d-accent-glow);
}

/* ── Glass header ── */
.glass-header {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Fade up entrance ── */
.glass-fade-up {
  animation: glass-fade-up 0.5s var(--d-easing) both;
}

@keyframes glass-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Glass overlay ── */
.glass-overlay {
  background: rgba(11, 15, 26, 0.7);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

/* ── Accent button ── */
.crm-button-accent {
  background: linear-gradient(135deg, var(--d-accent), var(--d-primary));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--d-radius);
  padding: var(--d-interactive-py) var(--d-interactive-px);
  font-weight: 500;
  cursor: pointer;
  transition: transform 150ms var(--d-easing), box-shadow 150ms var(--d-easing), filter 150ms var(--d-easing);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.25);
}

.crm-button-accent:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}

.crm-button-accent:focus-visible {
  outline: 2px solid var(--d-accent);
  outline-offset: 2px;
}

/* ── Avatar ── */
.crm-avatar {
  border-radius: var(--d-radius-full);
  background: linear-gradient(135deg, var(--d-primary), var(--d-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── AI enrichment badge ── */
.crm-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: var(--d-radius-full);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(96, 165, 250, 0.18));
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--d-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-ai-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--d-accent);
  box-shadow: 0 0 6px var(--d-accent-glow);
  animation: crm-pulse 2s ease-in-out infinite;
}

@keyframes crm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ── Status badge ── */
.crm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--d-radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--d-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.crm-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.crm-status-badge[data-status="won"],
.crm-status-badge[data-status="active"],
.crm-status-badge[data-status="completed"] {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: var(--d-success);
}

.crm-status-badge[data-status="negotiation"],
.crm-status-badge[data-status="pending"] {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--d-warning);
}

.crm-status-badge[data-status="qualified"],
.crm-status-badge[data-status="proposal"],
.crm-status-badge[data-status="scheduled"] {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
  color: var(--d-info);
}

.crm-status-badge[data-status="lost"],
.crm-status-badge[data-status="cold"],
.crm-status-badge[data-status="cancelled"] {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--d-error);
}

.crm-status-badge[data-status="lead"],
.crm-status-badge[data-status="new"] {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
  color: var(--d-accent);
}

/* ── Pipeline kanban ── */
.crm-pipeline-column {
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--d-radius);
  padding: 0.75rem;
  min-width: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crm-pipeline-column[data-drag-over="true"] {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.05);
}

.crm-pipeline-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--d-radius-sm);
  padding: 0.75rem;
  cursor: grab;
  transition: border-color 150ms var(--d-easing), box-shadow 150ms var(--d-easing), transform 150ms var(--d-easing);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.crm-pipeline-card:hover {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(167, 139, 250, 0.15);
  transform: translateY(-1px);
}

.crm-pipeline-card:active {
  cursor: grabbing;
}

.crm-pipeline-card[data-dragging="true"] {
  opacity: 0.5;
}

/* ── Probability gauge ── */
.crm-prob-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--d-radius-full);
  overflow: hidden;
}

.crm-prob-fill {
  height: 100%;
  border-radius: var(--d-radius-full);
  background: linear-gradient(90deg, var(--d-primary), var(--d-accent));
  transition: width 600ms var(--d-easing);
}

/* ── Graph node ── */
.crm-graph-node {
  cursor: grab;
  transition: filter 150ms ease;
}

.crm-graph-node:hover {
  filter: drop-shadow(0 0 8px var(--d-accent-glow));
}

.crm-graph-node:active {
  cursor: grabbing;
}

/* ── Ghost text (AI suggestions) ── */
.crm-ghost-text {
  color: rgba(167, 139, 250, 0.5);
  font-style: italic;
  pointer-events: none;
}

/* ── Gradient text ── */
.crm-gradient-text {
  background: linear-gradient(135deg, var(--d-accent), var(--d-primary), var(--d-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── Sparkline ── */
.crm-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.crm-sparkline-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--d-accent), rgba(167, 139, 250, 0.3));
  border-radius: 1px;
  min-width: 3px;
}

/* ── Table row ── */
.crm-table-row-selected {
  background: rgba(167, 139, 250, 0.08) !important;
}

/* ── Chart bar ── */
.crm-chart-bar {
  background: linear-gradient(180deg, var(--d-accent), rgba(96, 165, 250, 0.4));
  border-radius: var(--d-radius-sm) var(--d-radius-sm) 0 0;
  transition: height 500ms var(--d-easing), opacity 150ms ease;
  min-width: 8px;
}

.crm-chart-bar:hover {
  opacity: 0.85;
}

/* ── Inline control ── */
.crm-inline-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--d-radius-sm);
  padding: 0.125rem 0.375rem;
  font: inherit;
  color: inherit;
  width: 100%;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.crm-inline-input:hover {
  border-color: var(--d-border);
}

.crm-inline-input:focus {
  border-color: var(--d-accent);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Glass control override ── */
.glass-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: var(--d-text);
  padding: var(--d-control-py) 0.75rem;
  border-radius: var(--d-radius);
  width: 100%;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.glass-control:focus {
  border-color: var(--d-accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.glass-control::placeholder { color: var(--d-text-muted); }

} /* end @layer decorators */
