@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Design System - Couleurs Slate (neutre) */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Design System - Couleur principale Ausha */
  --ausha-primary: #751CBF;
  --ausha-light: #F4EDFA;
  --ausha-50: #faf8ff;
  --ausha-100: #f4edfa;
  --ausha-200: #e7d1f5;
  --ausha-500: #9d50e0;
  --ausha-600: #751cbf;
  --ausha-700: #5d1598;
  --ausha-800: #4a1275;

  /* Design System - Couleur principale Indigo (backup) */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;

  /* Design System - Couleurs sémantiques */
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;

  /* Variables applicatives */
  --bg-page: var(--slate-50);
  --bg-card: #ffffff;
  --border-color: var(--slate-200);
  --border-input: var(--slate-300);
  --text-primary: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-500);
  --text-dim: var(--slate-400);

  /* Couleurs de marque */
  --color-primary: var(--ausha-primary);
  --color-primary-hover: var(--ausha-700);
  --color-success: var(--emerald-600);
  --color-warning: var(--amber-500);
  --color-danger: var(--red-500);

  /* Segments - couleurs cohérentes */
  --color-ss-fr: var(--indigo-600);
  --color-ss-inter: var(--violet-600);
  --color-sales-fr: var(--amber-500);
  --color-sales-inter: var(--red-500);

  /* Composants MRR */
  --color-new-business: var(--emerald-500);
  --color-expansion: var(--indigo-500);
  --color-contraction: var(--amber-500);
  --color-churn: var(--red-500);
  --color-reactivation: var(--violet-600);

  /* Ombres modernes */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Border radius */
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
}


body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 400;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER - Design System Moderne
   ============================================ */

.header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-icon {
  width: 7rem;
  height: 3rem;
  background-image: url('https://www.ausha.co/wp-content/themes/uptime-child/style/img/logo-ausha-colored.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.header-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--slate-100);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.control-group:hover {
  background: var(--slate-200);
}

.control-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.control-group select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.control-group select:focus {
  outline: none;
}

/* ============================================
   BOUTONS - Design System
   ============================================ */

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: colors 0.2s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--slate-200);
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover {
  background: var(--emerald-600);
}

.btn-warning {
  background: var(--color-warning);
  color: white;
}

.btn-warning:hover {
  background: var(--amber-600);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: var(--red-600);
}

/* ============================================
   TABS - Navigation Segmentée
   ============================================ */

.tabs {
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  position: sticky;
  top: 4rem;
  z-index: 9;
}

.tabs-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  background: var(--slate-100);
  padding: 0.25rem;
  border-radius: var(--radius-xl);
  gap: 0;
}

.tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--slate-600);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.tab:hover {
  color: var(--slate-900);
}

.tab.active {
  background: white;
  color: var(--slate-900);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  gap: 2rem;
}

.main-content.with-sidebar {
  grid-template-columns: 20rem 1fr;
}

.content-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ============================================
   PANNEAU ASSUMPTIONS - Card Standard
   ============================================ */

.assumptions-toggle {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.assumptions-toggle .btn {
  background: transparent;
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.assumptions-toggle .btn:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--slate-700);
}

.assumptions-panel {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 9rem;
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
}

.assumptions-panel h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.assumptions-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.assumptions-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.assumptions-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-grid {
  display: grid;
  gap: 1rem;
}

/* ============================================
   INPUT FIELDS - Design System
   ============================================ */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 0.25rem;
}

.input-group input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  background: white;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  ring: 2px solid var(--indigo-500);
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Input with suffix (for percentages) */
.input-with-suffix {
  display: flex;
  align-items: center;
  position: relative;
}

.input-with-suffix input {
  width: 100%;
  padding-right: 2rem;
  border-radius: var(--radius-lg);
}

.input-suffix {
  position: absolute;
  right: 0.75rem;
  color: var(--slate-500);
  font-weight: 500;
  font-size: 0.875rem;
  pointer-events: none;
}

/* Historical hints for inputs */
.input-group.has-history {
  position: relative;
}

.history-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: linear-gradient(135deg, var(--slate-50) 0%, var(--indigo-50) 100%);
  border: 1px solid var(--indigo-100);
  border-radius: var(--radius-md);
  font-size: 0.7rem;
  color: var(--slate-600);
  cursor: help;
  transition: all 0.2s ease;
}

.history-hint:hover {
  background: linear-gradient(135deg, var(--indigo-50) 0%, var(--indigo-100) 100%);
  border-color: var(--indigo-200);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.history-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.history-values {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--indigo-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   KPI CARDS - Cards Standards
   ============================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--indigo-200);
}

.kpi-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1;
}

.kpi-subtitle {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-top: 0.5rem;
}

.kpi-trend {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.kpi-trend.positive {
  color: var(--emerald-600);
}

.kpi-trend.negative {
  color: var(--red-600);
}

/* ============================================
   SEGMENT CARDS
   ============================================ */

/* ============================================
   SEGMENT CARDS
   ============================================ */

.segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.segment-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.2s ease;
}

.segment-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--indigo-200);
}

.segment-card h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.75rem;
}

.segment-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--slate-900);
}

.segment-card .sub {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-top: 0.5rem;
}

/* ============================================
   CONTENEURS GRAPHIQUES
   ============================================ */

.chart-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.chart-container h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--slate-800);
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
}

/* ============================================
   LEGEND
   ============================================ */

/* ============================================
   LÉGENDE COMPOSANTS
   ============================================ */

.components-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--slate-700);
  font-weight: 500;
}

.legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.25rem;
}

/* ============================================
   DATA TABLES
   ============================================ */

/* ============================================
   TABLEAUX DE DONNÉES
   ============================================ */

.data-table-container {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--slate-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--slate-700);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.875rem;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--slate-600);
  font-size: 0.875rem;
  white-space: nowrap;
}

.data-table tr:hover {
  background: var(--slate-50);
}

.positive {
  color: var(--emerald-600);
  font-weight: 600;
}

.negative {
  color: var(--red-600);
  font-weight: 600;
}

/* ============================================
   FILE INPUT (hidden)
   ============================================ */

.file-input {
  display: none;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

/* ============================================
   TOASTS - Notifications
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 24rem;
}

.toast.success {
  border-left: 4px solid var(--emerald-500);
}

.toast.error {
  border-left: 4px solid var(--red-500);
}

.toast.info {
  border-left: 4px solid var(--indigo-500);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   GROWTH TABLES
   ============================================ */

.growth-tables {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0;
}

.growth-section {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.growth-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.growth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.growth-table th {
  background: var(--slate-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--slate-700);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.growth-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--slate-600);
  font-size: 0.875rem;
}

.growth-table .positive {
  color: var(--color-success);
  font-weight: 600;
}

.growth-table .negative {
  color: var(--color-danger);
  font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .main-content.with-sidebar {
    grid-template-columns: 1fr;
  }

  .assumptions-panel {
    position: relative;
    top: 0;
    max-height: none;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  .tabs {
    padding: 0.75rem;
  }

  .tabs-content {
    padding: 0.25rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    padding: 1rem;
  }
}


/* ============================================
   MODALS - Design System
   ============================================ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.modal-content {
  background: white;
  margin: 2% auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.modal-header {
  background: linear-gradient(to right, var(--indigo-600), var(--indigo-700));
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  margin: 0.25rem 0 0 0;
}

.close {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close:hover {
  color: white;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 8rem);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--slate-50);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.generator-section {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.generator-section h4 {
  margin: 0 0 0.5rem 0;
  color: var(--slate-800);
  font-size: 1.125rem;
  font-weight: 600;
}

.section-description {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.historical-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
}

.historical-status.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #10b981;
}

.historical-status.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #ef4444;
}

.generator-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 1rem;
  align-items: end;
}

.monthly-config h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}

.month-input {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.month-input label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.month-input input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  background: white;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.month-input input:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .generator-controls {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .monthly-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  .modal-footer {
    flex-direction: column;
  }
}

.custom-signups-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Historical Data Display */
.historical-data-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.data-overview-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.data-overview-card:hover {
  border-color: var(--indigo-200);
  box-shadow: var(--shadow-md);
}

.data-overview-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.data-overview-card h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.data-badge {
  background: var(--indigo-100);
  color: var(--indigo-700);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.data-stats {
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.stat-value {
  font-weight: 600;
  color: var(--slate-900);
}

.stat-value.positive {
  color: var(--emerald-600);
}

.stat-value.negative {
  color: var(--red-600);
}

.actions-row {
  text-align: center;
  margin-top: 2rem;
}

/* Segment Detail Modal */
.segment-detail-modal {
  position: fixed;
  top: 5%;
  left: 5%;
  right: 5%;
  bottom: 5%;
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 12px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.segment-detail-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.segment-detail-modal .modal-header h3 {
  color: var(--text-primary);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.segment-detail-modal .modal-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.data-table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.data-table td {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.data-table tr:hover {
  background: rgba(139, 92, 246, 0.05);
}

.data-table .positive {
  color: var(--color-success);
}

.data-table .negative {
  color: var(--color-danger);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-backdrop);
  z-index: 1000;
}

@media (max-width: 768px) {
  .segment-detail-modal {
    top: 2%;
    left: 2%;
    right: 2%;
    bottom: 2%;
  }

  .historical-data-overview {
    grid-template-columns: 1fr;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Growth Table Enhancements */
/* ============================================
   BADGES PÉRIODE
   ============================================ */

.period-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.period-badge.historical {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.period-badge.forecast {
  background: var(--indigo-100);
  color: var(--indigo-700);
}

.historical-row {
  background: rgba(16, 185, 129, 0.03);
}

.forecast-row {
  background: rgba(99, 102, 241, 0.03);
}

.historical-row:hover {
  background: rgba(16, 185, 129, 0.08);
}

.forecast-row:hover {
  background: rgba(99, 102, 241, 0.08);
}

.growth-tables {
  margin-top: 2rem;
}

.growth-section {
  margin-bottom: 2rem;
}

.growth-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.growth-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.growth-table th {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  font-size: 0.875rem;
}

.growth-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* Workflow Steps */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.workflow-step:hover {
  border-color: var(--indigo-200);
  box-shadow: var(--shadow-md);
}

.step-number {
  background: var(--indigo-600);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  color: var(--slate-900);
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.step-content p {
  color: var(--slate-600);
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .workflow-step {
    padding: 1rem;
  }

  .step-number {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
  }

  .step-content h4 {
    font-size: 0.9rem;
  }

  .step-content p {
    font-size: 0.8rem;
  }
}

/* ============================================
   AUTHENTICATION STYLES
   ============================================ */

/* Login Screen */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--ausha-50) 0%, var(--slate-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
}

.login-logo-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--ausha-primary) 0%, var(--ausha-500) 100%);
  border-radius: 20px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(117, 28, 191, 0.3);
  position: relative;
}

.login-logo-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: white;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.login-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0 0 0.5rem 0;
}

.login-logo p {
  font-size: 0.95rem;
  color: var(--slate-500);
  margin: 0;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--slate-900);
  margin: 0 0 0.75rem 0;
}

.login-card > p {
  font-size: 0.9rem;
  color: var(--slate-500);
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  text-align: left;
  line-height: 1.4;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: white;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--slate-400);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-google:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-google .google-icon {
  flex-shrink: 0;
}

.login-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--slate-200);
  border-top-color: var(--ausha-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--slate-100);
}

.login-footer p {
  font-size: 0.8rem;
  color: var(--slate-400);
  margin: 0;
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.5rem 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  margin-left: 0.5rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ausha-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar span {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
  line-height: 1.2;
}

.user-email {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Hide user details on small screens */
@media (max-width: 768px) {
  .user-details {
    display: none;
  }

  .user-info {
    padding: 0.25rem;
    background: transparent;
  }
}

/* ============================================
   CHARTMOGUL SYNC STYLES
   ============================================ */

.action-card.highlight {
  border: 2px solid var(--ausha-primary);
  background: linear-gradient(135deg, var(--ausha-50) 0%, white 100%);
}

.action-card.highlight .card-icon {
  background: var(--ausha-primary);
  color: white;
}

.sync-status {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}

.sync-status.syncing {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.sync-status.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sync-status.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* ============================================
   HISTORICAL DATA TOGGLE STYLES
   ============================================ */

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--slate-600);
  font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--slate-300);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--ausha-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Historical Row Styling */
.historical-row {
  background-color: var(--slate-50);
}

.historical-row td {
  color: var(--slate-600);
}

.badge-historical {
  display: inline-block;
  background: var(--ausha-100);
  color: var(--ausha-600);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-left: 0.375rem;
  vertical-align: middle;
}

/* ============================================
   DETAILED GROWTH TABLE STYLES
   ============================================ */

.growth-table-wrapper {
  overflow-x: auto;
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
}

.growth-table.detailed {
  min-width: 900px;
  font-size: 0.85rem;
}

.growth-table.detailed th {
  padding: 0.5rem 0.625rem;
  white-space: nowrap;
}

.growth-table.detailed td {
  padding: 0.5rem 0.625rem;
  vertical-align: middle;
}

.growth-table.detailed thead tr:first-child th {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.growth-table.detailed thead tr:last-child th {
  border-top: none;
  padding-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--slate-500);
  font-weight: 500;
}

/* Delta Badge */
.delta-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.delta-badge.positive {
  background: #dcfce7;
  color: #15803d;
}

.delta-badge.negative {
  background: #fee2e2;
  color: #dc2626;
}

/* Period Badge */
.period-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.375rem;
  vertical-align: middle;
}

.period-badge.historical {
  background: var(--ausha-100);
  color: var(--ausha-600);
}

.period-badge.forecast {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Forecast row styling */
.forecast-row {
  background-color: #fafafa;
}

/* Responsive adjustments for growth tables */
@media (max-width: 1200px) {
  .growth-table.detailed {
    font-size: 0.8rem;
  }

  .growth-table.detailed th,
  .growth-table.detailed td {
    padding: 0.375rem 0.5rem;
  }

  .delta-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
  }
}

/* ============================================
   VERSION MANAGEMENT STYLES
   ============================================ */

.versions-panel {
  background: var(--slate-50);
  border-radius: 12px;
  padding: 1.5rem;
}

.save-version-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.version-name-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.version-name-input:focus {
  outline: none;
  border-color: var(--ausha-primary);
  box-shadow: 0 0 0 3px rgba(67, 70, 241, 0.1);
}

.version-name-input::placeholder {
  color: var(--slate-400);
}

.versions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.no-versions {
  text-align: center;
  color: var(--slate-500);
  padding: 2rem;
  font-style: italic;
}

.version-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.version-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-color: var(--slate-300);
}

.version-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.version-name {
  font-weight: 600;
  color: var(--slate-800);
  font-size: 0.9375rem;
}

.version-date {
  font-size: 0.8125rem;
  color: var(--slate-500);
}

.version-actions {
  display: flex;
  gap: 0.5rem;
}

.section-header .badge {
  background: var(--slate-200);
  color: var(--slate-600);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .save-version-form {
    flex-direction: column;
  }

  .version-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .version-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   HINT TEXT STYLES
   ============================================ */

.hint {
  font-size: 0.8125rem;
  color: var(--slate-500);
  margin-top: 0.5rem;
  font-style: italic;
}
