/* ==========================================================================
   M365 Console — style.css
   Système de design : indigo profond + accent teal, typo Sora / Inter / Mono
   ========================================================================== */

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

:root {
  /* Couleurs */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #10162f;
  --ink-soft: #5a6178;
  --ink-faint: #8b91a7;
  --primary: #2540c9;
  --primary-dark: #1b2e99;
  --primary-soft: #eaedfb;
  --accent: #17b8a6;
  --accent-soft: #e3f8f5;
  --border: #e3e6f0;
  --success: #17b8a6;
  --warning: #d9822b;
  --danger: #d64545;

  /* Couleurs de service (badges du dashboard) */
  --svc-audit: #2540c9;
  --svc-conseil: #17b8a6;
  --svc-expertise: #8449d6;
  --svc-finance: #d9822b;
  --svc-support: #2c9cd6;
  --svc-default: #5a6178;

  /* Typo */
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Ombres / rayons */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 22, 47, 0.05);
  --shadow-md: 0 6px 20px rgba(16, 22, 47, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 22, 47, 0.12);
  --transition: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

a {
  color: inherit;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.navbar-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
}

.navbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

.nav-link.disabled {
  color: var(--ink-faint);
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   En-tête de page (page-header générique)
   ========================================================================== */

.page-header {
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
  background: var(--surface);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  color: var(--ink);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 560px;
}

/* ==========================================================================
   Accueil — Hero simple
   ========================================================================== */

.hero {
  padding: 56px 0 40px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 540px;
}

/* ==========================================================================
   Features — grille de fonctionnalités
   ========================================================================== */

.features {
  padding: 8px 0 60px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card.is-active {
  border-color: var(--primary);
}

.feature-card.is-active:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.feature-card.is-soon {
  opacity: 0.65;
}

.feature-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.soon {
  background: #f1f2f6;
  color: var(--ink-faint);
}

.feature-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.feature-description {
  font-size: 13.5px;
  color: var(--ink-soft);
  flex-grow: 1;
}

.feature-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--primary);
}

.feature-card.is-soon .feature-btn {
  color: var(--ink-faint);
}

.feature-btn svg {
  width: 14px;
  height: 14px;
  transition: var(--transition);
}

.feature-card.is-active:hover .feature-btn svg {
  transform: translateX(3px);
}

/* ==========================================================================
   Contenu générique
   ========================================================================== */

.content {
  padding: 32px 0 60px;
  flex: 1;
}

/* ==========================================================================
   Barre de contrôles (recherche / filtre / stats)
   ========================================================================== */

.controls-section {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrapper {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-wrapper svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--surface);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-select {
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.stats-summary {
  display: flex;
  gap: 10px;
}

.stat-badge {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 8px 13px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.stat-badge strong {
  font-weight: 700;
}

/* ==========================================================================
   États : chargement / erreur / vide
   ========================================================================== */

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

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

.error-message {
  background: #fdecec;
  border: 1px solid #f3b8b8;
  color: var(--danger);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--ink-soft);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--ink-faint);
  margin: 0 auto 14px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13.5px;
}

/* ==========================================================================
   Tableau
   ========================================================================== */

.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.mailbox-table thead {
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
}

.mailbox-table th {
  padding: 13px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mailbox-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.mailbox-table tbody tr:last-child {
  border-bottom: none;
}

.mailbox-table tbody tr:hover {
  background: #fafbfd;
}

.mailbox-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--ink);
}

.col-email {
  width: 38%;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.col-name {
  width: 32%;
  font-weight: 500;
}

.col-service {
  width: 18%;
}

.col-actions {
  width: 12%;
  text-align: center;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.service-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.svc-audit     { background: #eaedfb; color: var(--svc-audit); }
.svc-conseil   { background: #e3f8f5; color: var(--svc-conseil); }
.svc-expertise { background: #f2e9fb; color: var(--svc-expertise); }
.svc-finance   { background: #fbeeda; color: var(--svc-finance); }
.svc-autre     { background: #f1f2f6; color: var(--svc-default); }

.action-btn {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

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

.action-btn.copied {
  color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .navbar-menu {
    gap: 2px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  .hero-title {
    font-size: 26px;
  }

  .page-title {
    font-size: 24px;
  }

  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-summary {
    flex-direction: column;
  }

  .col-email {
    display: none;
  }

  .col-name {
    width: 50%;
  }

  .col-service {
    width: 35%;
  }

  .col-actions {
    width: 15%;
  }
}

@media (max-width: 480px) {
  .navbar-title {
    display: none;
  }
}
