/* crm-demo.css — PragCRM Ultra-Premium Aesthetics & Micro-Animations */

.crm-page {
  background-color: var(--void, #030306);
  color: var(--text, #e8e4f4);
  font-family: var(--font-body, system-ui, sans-serif);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

.crm-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px;
  box-sizing: border-box;
}

/* Header & Version Badge */
.crm-hero {
  margin-bottom: 32px;
}

.crm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.crm-kicker-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
}

.crm-home-link {
  color: var(--cyan, #00e8d8);
  text-decoration: none;
  font-weight: 600;
}

.crm-home-link:hover {
  text-decoration: underline;
}

.crm-kicker-sep {
  color: var(--muted, rgba(218, 214, 236, 0.4));
}

.crm-kicker {
  color: var(--muted, rgba(218, 214, 236, 0.82));
}

.crm-version-badge {
  background: rgba(0, 232, 216, 0.15);
  border: 1px solid rgba(0, 232, 216, 0.3);
  color: var(--cyan, #00e8d8);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.crm-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crm-audio-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: #fff;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.crm-audio-btn:hover {
  background: rgba(0, 232, 216, 0.15);
  border-color: var(--cyan, #00e8d8);
}

.crm-title {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, sans-serif);
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 12px 0;
  background: linear-gradient(135deg, #ffffff 0%, #00e8d8 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.crm-sub {
  font-size: 16px;
  color: var(--muted, rgba(218, 214, 236, 0.85));
  max-width: 820px;
  margin: 0 0 28px 0;
  line-height: 1.6;
}

/* Metric Cards Grid */
.crm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.crm-metric-card {
  background: rgba(12, 12, 22, 0.65);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.crm-metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 232, 216, 0.4);
  box-shadow: 0 10px 30px rgba(0, 232, 216, 0.1);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-body {
  flex: 1;
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted, rgba(218, 214, 236, 0.6));
}

.metric-value {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 2px 0;
}

.metric-sub {
  font-size: 11px;
  font-weight: 600;
}

.text-green { color: #34D399; }
.text-cyan { color: #00E8D8; }
.text-purple { color: #C084FC; }

/* Nav Tabs */
.crm-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 32px;
  padding-bottom: 1px;
  overflow-x: auto;
}

.crm-tab-btn {
  background: none;
  border: none;
  color: var(--muted, rgba(218, 214, 236, 0.6));
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.crm-tab-btn:hover {
  color: #fff;
}

.crm-tab-btn.active {
  color: var(--cyan, #00e8d8);
  border-bottom-color: var(--cyan, #00e8d8);
}

.crm-tab-content {
  display: none;
}

.crm-tab-content.active {
  display: block;
}

/* Section Header */
.crm-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.crm-section-header h2 {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, sans-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.crm-desc {
  font-size: 14px;
  color: var(--muted, rgba(218, 214, 236, 0.7));
  margin: 0;
}

/* AI Copilot Styling */
.crm-copilot-wrap {
  background: rgba(10, 10, 18, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 232, 216, 0.2);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.crm-copilot-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: var(--muted, #dad6ec);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-chip-btn:hover {
  background: rgba(0, 232, 216, 0.15);
  border-color: var(--cyan, #00e8d8);
  color: #fff;
}

.crm-copilot-messages {
  height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-chat-msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
}

.msg-ai {
  align-self: flex-start;
  background: rgba(0, 102, 255, 0.12);
  border: 1px solid rgba(0, 102, 255, 0.3);
  color: #E0E7FF;
  border-top-left-radius: 4px;
}

.msg-user {
  align-self: flex-end;
  background: rgba(0, 232, 216, 0.15);
  border: 1px solid rgba(0, 232, 216, 0.4);
  color: #fff;
  border-top-right-radius: 4px;
}

.msg-author {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.8;
}

.crm-copilot-input-bar {
  display: flex;
  gap: 12px;
}

.crm-copilot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  color: #fff;
  font-size: 14px;
}

.crm-copilot-input:focus {
  outline: none;
  border-color: var(--cyan, #00e8d8);
  box-shadow: 0 0 0 2px rgba(0, 232, 216, 0.2);
}

/* Code Snippet Blocks */
.crm-code-block {
  background: rgba(3, 3, 6, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #A5B4FC;
  line-height: 1.5;
}

/* 3D Container & WebGL Canvas */
.crm-3d-container {
  position: relative;
  width: 100%;
  height: 520px;
  background: rgba(10, 10, 18, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
}

.crm-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crm-3d-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.crm-3d-legend {
  background: rgba(3, 3, 6, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-contact { background: #00E8D8; }
.dot-account { background: #3B82F6; }
.dot-deal { background: #10B981; }
.dot-entitlement { background: #8B5CF6; }

.crm-3d-node-info {
  background: rgba(3, 3, 6, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 232, 216, 0.3);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  color: #fff;
  pointer-events: auto;
  max-width: 340px;
}

/* Health Radar Canvas Wrap */
.crm-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
}

/* Tables */
.crm-table-wrap {
  background: rgba(10, 10, 18, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.crm-table th {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, rgba(218, 214, 236, 0.6));
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-table td {
  padding: 16px 18px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.crm-table tr:last-child td {
  border-bottom: none;
}

.crm-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Pipeline Board */
.crm-pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: start;
}

.crm-pipeline-col {
  background: rgba(10, 10, 18, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  min-height: 400px;
}

.crm-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-col-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-col-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.crm-deal-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.crm-deal-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan, #00e8d8);
}

.crm-deal-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.crm-deal-val {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: #34D399;
  font-weight: 700;
}

/* Grids & Cards */
.crm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.crm-card {
  background: rgba(10, 10, 18, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
}

.crm-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.crm-select {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 16px;
}

.crm-tier-box {
  background: rgba(0, 102, 255, 0.1);
  border: 1px solid rgba(0, 102, 255, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.crm-tier-label {
  font-size: 12px;
  color: #93C5FD;
  text-transform: uppercase;
  font-weight: 700;
}

.crm-tier-val {
  font-size: 24px;
  font-weight: 800;
  color: #60A5FA;
  margin-top: 4px;
}

/* Buttons */
.prag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prag-btn-primary {
  background: var(--cyan, #0066FF);
  color: #fff;
  border: none;
}

.prag-btn-primary:hover {
  filter: brightness(1.15);
}

.prag-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.prag-btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.prag-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Timeline */
.crm-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crm-timeline-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: rgba(10, 10, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  align-items: center;
}

.crm-timeline-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 232, 216, 0.15);
  color: var(--cyan, #00e8d8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Pills & Badges */
.crm-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.crm-pill-pro {
  background: rgba(139, 92, 246, 0.2);
  color: #C084FC;
}

.crm-pill-free {
  background: rgba(156, 163, 175, 0.2);
  color: #D1D5DB;
}

.crm-pill-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.crm-pill-risk-low {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.crm-pill-risk-med {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
}

.crm-pill-risk-high {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

/* Recommendations List */
.crm-recs-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #F3F4F6;
}

.crm-recs-list li {
  margin-bottom: 6px;
}

/* Drawer Modal */
.crm-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  z-index: 99999;
  transition: opacity 0.2s ease;
}

.crm-drawer-backdrop.hidden {
  display: none;
}

.crm-drawer-content {
  width: 440px;
  height: 100%;
  background: rgba(12, 12, 22, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding: 32px;
  box-sizing: border-box;
  overflow-y: auto;
}

.crm-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.crm-drawer-close {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 20px;
  cursor: pointer;
}

.crm-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 13px;
  color: var(--muted, rgba(218, 214, 236, 0.6));
}

.crm-footer a {
  color: var(--cyan, #00e8d8);
  text-decoration: none;
}

/* ==========================================================================
   PRAGCRM MOBILE RESPONSIVE ENGINE (ZERO HORIZONTAL OVERFLOW, TOUCH ERGONOMICS)
   ========================================================================== */
@media (max-width: 900px) {
  .crm-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

@media (max-width: 768px) {
  .crm-page {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .crm-wrap {
    padding: 16px 14px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .crm-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
  }

  .crm-kicker-group {
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 12px !important;
    max-width: 100% !important;
  }

  .crm-toolbar-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .crm-audio-btn {
    min-height: 44px !important;
    padding: 8px 14px !important;
  }

  .crm-hero {
    margin-bottom: 24px !important;
  }

  .crm-title {
    font-size: clamp(1.85rem, 7.5vw, 2.5rem) !important;
    line-height: 1.15 !important;
    word-break: break-word !important;
  }

  .crm-sub {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-bottom: 20px !important;
  }

  .crm-metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }

  .crm-metric-card {
    padding: 14px 16px !important;
  }

  .crm-nav-tabs {
    gap: 4px !important;
    margin-bottom: 20px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
  }

  .crm-tab-btn {
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  .crm-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .crm-section-header h2 {
    font-size: 19px !important;
  }

  .crm-3d-container {
    height: 340px !important;
    border-radius: 16px !important;
  }

  .crm-3d-overlay {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
  }

  .crm-3d-legend {
    padding: 6px 10px !important;
    font-size: 11px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .crm-3d-node-info {
    max-width: calc(100% - 20px) !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
  }

  .crm-copilot-wrap {
    padding: 16px !important;
    border-radius: 16px !important;
    gap: 14px !important;
  }

  .crm-copilot-chips {
    gap: 6px !important;
  }

  .crm-chip-btn {
    min-height: 44px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .crm-copilot-messages {
    height: 300px !important;
    padding: 12px !important;
  }

  .crm-chat-msg {
    max-width: 95% !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  .crm-copilot-input-bar {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .crm-copilot-input-bar button {
    width: 100% !important;
    min-height: 44px !important;
  }

  .crm-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 12px !important;
  }

  .crm-table {
    min-width: 580px !important;
    width: 100% !important;
  }

  .crm-table th,
  .crm-table td {
    padding: 10px 12px !important;
    font-size: 12px !important;
  }

  .crm-drawer-content {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 20px 16px !important;
  }

  .crm-drawer-close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

