/* ============================================================
   STYLES GÉNÉRAUX - TransiGo.app
   ============================================================ */

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f1f5f9;
  color: #0f172a;
  line-height: 1.5;
}

/* --- HEADER & NAVIGATION DESKTOP --- */
header {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.logo-go { color: #0284c7; }

.logo-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

nav {
  display: flex;
  gap: 1.2rem;
}

nav a {
  text-decoration: none;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}

nav a:hover, nav a.active {
  background: #f0f9ff;
  color: #0284c7;
}

main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.hero p {
  color: #64748b;
  font-size: 1.05rem;
}

.card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn {
  display: inline-block;
  background: #0284c7;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover { background: #0369a1; }

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

.doc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-green { background: #dcfce7; color: #15803d; }


/* ============================================================
   SOLUTION MOBILE : MENU EN GRILLE FIXE (PLUS BESOIN DE SLIDER)
   ============================================================ */

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.5rem;
    gap: 0.6rem;
  }

  /* AFFICHAGE DES ONGLETS SUR 2 OU 3 LIGNES VISIBLES DIRECTEMENT */
  nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 0.3rem !important;
    background: #f8fafc;
    padding: 0.4rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    overflow: visible !important;
  }

  nav::after {
    display: none !important; /* On retire la flèche de défilement */
  }

  nav a {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.78rem !important;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    flex: 1 1 auto; /* S'étire intelligemment pour remplir l'écran */
  }

  nav a.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
  }
}

@media (max-width: 600px) {
  main {
    padding: 0.5rem;
    margin: 0.5rem auto;
  }

  .card {
    padding: 0.8rem;
  }

  .hero h1 { font-size: 1.3rem !important; }
  .hero p { font-size: 0.85rem !important; }

  .doc-grid, .cotation-grid, .route-info-box, .opti-grid, .signatures-grid {
    grid-template-columns: 1fr !important;
  }

  .btn-delete-row {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.75rem !important;
    background: transparent !important;
    color: #ef4444 !important;
    border: 1px solid #fca5a5 !important;
  }

  .goods-table input, .colis-table input {
    font-size: 0.8rem !important;
    padding: 0.3rem !important;
  }
}