/* ============================================================
   Fencing Track & Stock — Styles principaux
   Palette : navy #1a2744  |  gold #c8a227  |  white #f8f9fa
   ============================================================ */

:root {
  --fts-navy:  #1a2744;
  --fts-navy2: #243460;
  --fts-gold:  #c8a227;
  --fts-gold2: #e6bc3a;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.fts-navbar {
  background: var(--fts-navy) !important;
  border-bottom: 3px solid var(--fts-gold);
}
.fts-navbar .navbar-brand { color: var(--fts-gold) !important; font-size: 1.1rem; }
.fts-navbar .nav-link { color: rgba(255,255,255,.8) !important; transition: color .2s; }
.fts-navbar .nav-link:hover,
.fts-navbar .nav-link.active { color: var(--fts-gold) !important; }
.fts-navbar .nav-link.active { font-weight: 600; }

/* ── Login ──────────────────────────────────────────────────── */
.fts-login-body  { background: var(--fts-navy); }
.fts-login-card  { width: 100%; max-width: 420px; border-radius: 1rem; }
.text-navy       { color: var(--fts-navy) !important; }

/* ── Stat cards ─────────────────────────────────────────────── */
.fts-stat-card   { border-radius: .75rem; transition: transform .15s; }
.fts-stat-card:hover { transform: translateY(-2px); }
.fts-stat-icon   { width: 48px; height: 48px; border-radius: .6rem;
                   display: flex; align-items: center; justify-content: center; }

/* ── Export icons ───────────────────────────────────────────── */
.fts-export-icon { width: 72px; height: 72px; border-radius: 1rem;
                   display: flex; align-items: center; justify-content: center; }

/* ── Modal header ───────────────────────────────────────────── */
.fts-modal-header { background: var(--fts-navy); color: #fff; }
.fts-modal-header .modal-title { color: var(--fts-gold); font-weight: 700; }

/* ── Alertes stock bas ──────────────────────────────────────── */
.fts-alerte-row  { background-color: #fff3f3 !important; }
.fts-alerte-row:hover { background-color: #ffe6e6 !important; }

/* ── Tables ─────────────────────────────────────────────────── */
.table th { font-size: .82rem; letter-spacing: .02em; text-transform: uppercase; }
.table td { font-size: .9rem; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination .page-link { color: var(--fts-navy); }
.pagination .page-item.active .page-link {
  background: var(--fts-navy); border-color: var(--fts-navy);
}

/* ── Autocomplete dropdown ──────────────────────────────────── */
.fts-ac-wrap { position: relative; }
.fts-autocomplete {
  position: absolute;
  z-index: 1055;
  left: 0; right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}
.fts-autocomplete .list-group-item {
  cursor: pointer;
  padding: .4rem .75rem;
  font-size: .88rem;
}
.fts-autocomplete .list-group-item:hover { background: #e9ecef; }

/* ── Badge stock ────────────────────────────────────────────── */
.badge-dispo { font-size: .8rem; min-width: 60px; display: inline-block; text-align: center; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container .toast { min-width: 260px; }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 576px) {
  main { padding-left: .75rem !important; padding-right: .75rem !important; }
  .fts-stat-icon { width: 36px; height: 36px; }
  .fts-stat-card h3 { font-size: 1.4rem; }
}

/* ── PWA standalone ─────────────────────────────────────────── */
@media (display-mode: standalone) {
  .fts-navbar { padding-top: env(safe-area-inset-top); }
}

/* ── Bottom navigation (mobile < 768px) ─────────────────────── */
.fts-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--fts-navy);
  border-top: 2px solid var(--fts-gold);
  z-index: 1030;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 767px) {
  .fts-bottom-nav { display: flex; }
  main { padding-bottom: 4.5rem !important; }
  #toast-container { bottom: 4.5rem !important; }
}
.fts-bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .62rem;
  gap: 1px;
  padding: 6px 4px;
  border: none;
  background: none;
  transition: color .15s;
  cursor: pointer;
}
.fts-bn-item i { font-size: 1.3rem; line-height: 1; }
.fts-bn-item.active,
.fts-bn-item:hover { color: var(--fts-gold); }
.fts-bn-action { color: var(--fts-gold) !important; }
.fts-bn-action i { font-size: 1.6rem; }

/* ── Table → cartes sur mobile ──────────────────────────────── */
@media (max-width: 767px) {
  .table-mobile-cards { display: block; }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tbody { display: block; }
  .table-mobile-cards tbody tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    margin-bottom: .75rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
  }
  .table-mobile-cards tbody tr td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border: none !important;
    border-bottom: 1px solid #f3f3f3 !important;
    padding: .45rem .75rem;
    font-size: .88rem;
  }
  .table-mobile-cards tbody tr td:last-child { border-bottom: none !important; }
  .table-mobile-cards tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .72rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-right: .5rem;
    flex-shrink: 0;
    min-width: 75px;
  }
  .table-mobile-cards tbody tr td:first-child {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid var(--fts-gold) !important;
  }
  .table-mobile-cards tbody tr td:first-child::before { display: none; }
  /* Ligne "aucun résultat" qui a un colspan → ne pas l'afficher en mode carte */
  .table-mobile-cards tbody tr td[colspan] {
    display: flex !important;
    justify-content: center;
  }
  .table-mobile-cards tbody tr td[colspan]::before { display: none; }
  .fts-alerte-row td:first-child { background: #fff3f3 !important; }
}

/* ── Bottom sheet modal ──────────────────────────────────────── */
@media (max-width: 767px) {
  .modal-bottom .modal-dialog {
    margin: 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 100%;
  }
  .modal-bottom .modal-content {
    border-radius: 1rem 1rem 0 0;
  }
}
