/* Avenix CRM — tableau de bord et modules analytiques */

.dashboard-welcome {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 150px;
  padding: 24px 26px;
  margin-bottom: 16px;
  overflow: hidden;
  color: #fff;
  border-radius: var(--radius-lg);
  background: var(--navy);
box-shadow: 0 20px 50px -30px rgba(15, 23, 42, 0.55);
}

.dashboard-welcome::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background: rgba(255, 255, 255, 0.05);
}

.welcome-copy {
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.welcome-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93c5fd;
}

.welcome-kicker span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
}

.welcome-copy h2 {
  font-size: clamp(20px, 2.3vw, 29px);
  line-height: 1.17;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.welcome-copy h2 span {
  color: #93c5fd;
}

.welcome-copy p {
  max-width: 470px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: #94a3b8;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
}

.welcome-actions .btn-primary {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 8px 20px -10px rgba(255, 255, 255, 0.4);
}

.welcome-actions .btn-primary:hover {
  background: #eff6ff;
}

.welcome-actions .btn-secondary {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
}

.welcome-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.welcome-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  padding: 14px 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(10px);
}

.welcome-stat {
  padding: 0 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.11);
}

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

.welcome-stat strong {
  display: block;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.welcome-stat small {
  display: block;
  margin-top: 5px;
  font-size: 8px;
  color: #94a3b8;
}

.welcome-stat em {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 5px;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 600;
  color: #4ade80;
}

.welcome-stat em svg {
  width: 8px;
  height: 8px;
}

.chart-box {
  position: relative;
  height: 252px;
}

.chart-box-sm {
  height: 195px;
}

.chart-box-lg {
  height: 310px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 0;
}

.chart-head h2 {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.chart-head p {
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
}

.chart-head .segmented {
  flex: 0 0 auto;
}

.chart-body {
  padding: 10px 13px 14px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  color: var(--muted);
}

.chart-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--legend-color);
}

.chart-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 18px;
  margin-top: 9px;
}

.chart-metric strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.chart-metric span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 600;
  color: var(--success);
}

.chart-metric span svg {
  width: 10px;
  height: 10px;
}

.chart-metric small {
  font-size: 9px;
  color: var(--muted);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
}

.source-row {
  display: grid;
  grid-template-columns: 90px 1fr 34px;
  align-items: center;
  gap: 9px;
}

.source-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--text-soft);
}

.source-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--source-color);
}

.source-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.source-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--source-color);
}

.source-value {
  font-size: 9.5px;
  font-weight: 600;
  text-align: right;
  color: var(--text-soft);
}

.stage-performance {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 15px 18px 18px;
}

.stage-performance-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-performance-copy {
  width: 118px;
  flex: 0 0 118px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--text-soft);
}

.stage-performance-copy span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stage-color);
}

.stage-performance-track {
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.stage-performance-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--stage-color);
}

.stage-performance-value {
  width: 90px;
  flex: 0 0 90px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-size: 9px;
  color: var(--muted);
}

.stage-performance-value strong {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.team-performance {
  display: flex;
  flex-direction: column;
}

.team-performance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
}

.team-performance-row:last-child {
  border-bottom: 0;
}

.team-performance-copy {
  flex: 1;
  min-width: 0;
}

.team-performance-copy strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.team-performance-copy small {
  font-size: 8.5px;
  color: var(--muted);
}

.team-performance-bar {
  width: 100px;
  flex: 0 0 100px;
}

.team-performance-bar .progress {
  height: 4px;
}

.team-performance-value {
  width: 65px;
  flex: 0 0 65px;
  font-size: 9.5px;
  font-weight: 600;
  text-align: right;
  color: var(--text-soft);
}

.team-performance-value small {
  display: block;
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
}

.recent-lead-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
}

.recent-lead-row:last-child {
  border-bottom: 0;
}

.recent-lead-copy {
  flex: 1;
  min-width: 0;
}

.recent-lead-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-lead-copy small {
  display: block;
  overflow: hidden;
  font-size: 8.5px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-lead-time {
  font-size: 8px;
  color: var(--muted-2);
}

.notification-panel-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px;
}

.notification-panel-item {
  display: flex;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
}

.notification-panel-item .notification-icon {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

.notification-panel-item strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.notification-panel-item p {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.4;
  color: var(--muted);
}

.notification-panel-item time {
  display: block;
  margin-top: 3px;
  font-size: 7.5px;
  color: var(--muted-2);
}

.upcoming-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
}

.upcoming-task:last-child {
  border-bottom: 0;
}

.upcoming-task-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  color: var(--task-color, var(--primary));
  border-radius: 7px;
  background: var(--task-bg, var(--primary-soft));
}

.upcoming-task-icon svg {
  width: 13px;
  height: 13px;
}

.upcoming-task div {
  flex: 1;
  min-width: 0;
}

.upcoming-task strong {
  display: block;
  font-size: 9.5px;
  font-weight: 550;
}

.upcoming-task small {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  color: var(--muted);
}

.upcoming-task time {
  flex: 0 0 auto;
  font-size: 8px;
  color: var(--muted-2);
}

/* Dashboard responsive-ish grids handled in responsive.css */

/* Reports */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.report-chart {
  height: 265px;
}

.report-chart-sm {
  height: 220px;
}

.report-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.funnel-bar {
  height: 27px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 8.5px;
  font-weight: 550;
  white-space: nowrap;
  border-radius: 5px;
  background: var(--funnel-color, var(--primary));
}

.funnel-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  color: var(--muted);
}

.funnel-meta strong {
  color: var(--text-soft);
  font-weight: 600;
}

/* Calendar day cells custom height */
.calendar-small .calendar-day {
  min-height: 95px;
}

/* Page-specific panels */
.callout-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.callout-card.dark {
  color: #fff;
  border-color: transparent;
  background: var(--navy);
}

.callout-card.dark h3 {
  color: #fff;
}

.callout-card.dark p {
  color: #94a3b8;
}

.callout-card h3 {
  font-size: 12px;
  font-weight: 650;
}

.callout-card p {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}

/* Misc dashboard blocks */
.mini-trend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.mini-trend i {
  width: 3px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--primary) 28%, var(--surface));
}

.mini-trend i:nth-child(3n) {
  background: var(--primary);
}

.metric-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--muted);
}

.metric-inline strong {
  color: var(--text-soft);
  font-weight: 600;
}

.hero-avatar-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-avatar-tile strong {
  font-size: 8px;
  color: #fff;
}

.hero-avatar-tile small {
  display: block;
  font-size: 7px;
  color: #94a3b8;
}

/* Detail pages / contact card */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.info-list {
  display: flex;
  flex-direction: column;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

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

.info-row > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  color: var(--muted);
}

.info-row div {
  min-width: 0;
}

.info-row small {
  display: block;
  font-size: 8.5px;
  color: var(--muted);
}

.info-row strong {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.company-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.company-hero h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.company-hero p {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.company-hero-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.company-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--muted);
}

.company-hero-meta svg {
  width: 11px;
  height: 11px;
}

.contact-card-profile {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.contact-card-profile .avatar {
  margin: 0 auto 10px;
}

.contact-card-profile h2 {
  font-size: 15px;
  font-weight: 650;
}

.contact-card-profile p {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.contact-card-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.contact-card-actions .btn {
  flex: 1;
}

/* KPI top band */
.analytics-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-card {
  position: relative;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.analytics-card small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}

.analytics-card strong {
  display: block;
  margin-top: 5px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.analytics-card .chart-box {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 82px;
  height: 35px;
  opacity: 0.8;
}

.analytics-card .stat-trend {
  margin-top: 8px;
}

/* Conversion form */
.form-success {
  display: none;
  padding: 34px 22px;
  text-align: center;
}

.form-success.show {
  display: block;
}

.form-success .success-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: var(--success);
  border-radius: 50%;
  background: var(--success-soft);
}

.form-success .success-icon svg {
  width: 24px;
  height: 24px;
}

.form-success h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.form-success p {
  max-width: 430px;
  margin: 6px auto 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
