/* ====================================================================
   CHARTE GRAPHIQUE UNIFIÉE & ARCHITECTURE RESPONSIVE
   Projet : Nilhane - Boutique de Sacs Féminins
   ==================================================================== */

:root {
  /* Nilhane - Thème Féminin, Maroquinerie & Élégance */
  --nilhane-white: #ffffff;
  --nilhane-light: #faf7f5; /* Blanc cassé doux */
  --nilhane-black: #1a1515; /* Ébène profond / Chocolat sombre */
  --nilhane-gray: #e8e2de; /* Gris chaud très clair */
  --nilhane-muted: #736b66; /* Taupe / Gris doux */
  --nilhane-primary: #c58c73; /* Terracotta Chic / Cuir Rosé */
  --nilhane-primary-hover: #a86e56; /* Nuance plus soutenue pour les au survol */
  --nilhane-accent: #e8b4b8; /* Rose poudré doux */
  --nilhane-danger: #d9534f;
  --nilhane-success: #2e7d32;
}

/* ====================================================================
   RÉINITIALISATION & TYPOGRAPHIE GLOBAUTIQUE
   ==================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background-color: var(--nilhane-light);
  color: var(--nilhane-black);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Utilitaires de texte génériques */
.btn-primary,
.bg-primary {
  background: var(--nilhane-primary) !important;
}
.text-primary {
  color: var(--nilhane-primary) !important;
}
.text-nilhane-primary {
  color: var(--nilhane-primary) !important;
}
.text-nilhane-black {
  color: var(--nilhane-black) !important;
}
.text-nilhane-muted {
  color: var(--nilhane-muted) !important;
}
.bg-nilhane-light {
  background-color: var(--nilhane-light) !important;
}
.tracking-wide {
  letter-spacing: 0.05em;
}

.text-secondary {
  color: var(--nilhane-black);
}

.text-danger {
  color: var(--nilhane-danger);
}

/* ====================================================================
   STRUCTURE DU LAYOUT FLEXIBLE (WRAPPER, SIDEBAR, CONTENT)
   ==================================================================== */
.wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
  min-height: 100vh;
  position: relative;
}

#sidebar {
  min-width: 260px;
  max-width: 260px;
  background: var(--nilhane-black);
  color: var(--nilhane-white);
  transition: all 0.3s ease;
  z-index: 999;
}

#sidebar .sidebar-header {
  padding: 20px;
  background: #120e0e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar ul.components {
  padding: 20px 0;
  list-style: none;
  margin: 0;
}

#sidebar ul li a {
  padding: 12px 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  color: #c2b7b0;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

#sidebar ul li a i {
  margin-right: 12px;
  font-size: 1.2rem;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a {
  color: var(--nilhane-white);
  background: rgba(
    197,
    140,
    115,
    0.15
  ); /* Hover subtil couleur terre cuite/rosée */
  border-left: 4px solid var(--nilhane-primary);
}

#content {
  width: 100%;
  padding: 30px;
  transition: all 0.3s;
  min-width: 0;
}

/* ==============================================================================
   COMPOSANTS REUTILISABLES ET CARTES (CARDS)
   ============================================================================== */
.card-nilhane {
  background-color: var(--nilhane-white) !important;
  border: 1px solid var(--nilhane-gray) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

/* Stylisation du Logo de connexion */
.login-logo {
  max-width: 140px;
  height: auto;
}

/* ====================================================================
   COMPOSANTS DE CARTES HAUT DE GAMME (KPI & NILHANE)
   ==================================================================== */
.kpi-card {
  border: none;
  border-radius: 16px;
  background: var(--nilhane-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px 0 rgba(197, 140, 115, 0.12); /* Lueur douce et raffinée */
}

.icon-shape {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

/* ====================================================================
   BOUTONS ET COMPOSANTS TACTILES (TOUCH-TARGET MINIMUM 48PX)
   ==================================================================== */
.btn-primary {
  background: var(--nilhane-primary) !important;
  color: var(--nilhane-white) !important;
  border-color: var(--nilhane-primary) !important;
}

.btn-secondary {
  background: var(--nilhane-black) !important;
  color: var(--nilhane-white) !important;
  border-color: var(--nilhane-black) !important;
}

.btn-outline-primary {
  color: var(--nilhane-primary);
  border-color: var(--nilhane-primary);
  background-color: transparent;
}

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

.btn-nilhane {
  background-color: var(--nilhane-primary) !important;
  color: var(--nilhane-white) !important;
  border: 1px solid var(--nilhane-primary) !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  min-height: 48px;
  transition: all 0.2s ease-in-out !important;
}

.btn-nilhane:hover,
.btn-nilhane:focus {
  background-color: var(--nilhane-primary-hover) !important;
  border-color: var(--nilhane-primary-hover) !important;
  color: var(--nilhane-white) !important;
  box-shadow: 0 4px 12px rgba(197, 140, 115, 0.3) !important;
}

.touch-target {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ====================================================================
   FORMULAIRES OPTIMISÉS POUR APPAREILS MOBILES
   ==================================================================== */
.form-control-nilhane {
  background-color: var(--nilhane-white) !important;
  border: 1px solid var(--nilhane-gray) !important;
  color: var(--nilhane-black) !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  font-size: 16px !important;
  min-height: 48px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
}

.form-control-nilhane::placeholder {
  color: #a0958e !important;
}

.form-control-nilhane:focus {
  border-color: var(--nilhane-primary) !important;
  box-shadow: 0 0 0 3px rgba(197, 140, 115, 0.2) !important;
}

/* Éléments annexes du groupe d'input */
.input-group-text {
  background-color: var(--nilhane-light) !important;
  border: 1px solid var(--nilhane-gray) !important;
  color: var(--nilhane-black) !important;
  min-height: 48px;
}

/* Alertes d'erreurs et de succès standardisées */
.alert-danger {
  background-color: #f8d7da !important;
  border: 1px solid #f5c2c7 !important;
  color: #842029 !important;
}

.alert-success {
  background-color: #d1e7dd !important;
  border: 1px solid #badbcc !important;
  color: #0f5132 !important;
}

/* ====================================================================
   LOGIQUE DE SCROLL HORIZONTAL DISPOSITIFS TACTILES (TABLES & CONTENUS)
   ==================================================================== */
.table-responsive-custom {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--nilhane-gray);
  background: var(--nilhane-white);
  margin-bottom: 1.5rem;
}

/* Stylisation premium de la scrollbar horizontale */
.table-responsive-custom::-webkit-scrollbar {
  height: 8px;
}

.table-responsive-custom::-webkit-scrollbar-track {
  background: var(--nilhane-light);
  border-radius: 10px;
}

.table-responsive-custom::-webkit-scrollbar-thumb {
  background-color: var(--nilhane-primary);
  border-radius: 10px;
}

/* Structures internes des tableaux défilants */
.custom-table th {
  background-color: var(--nilhane-light);
  color: var(--nilhane-black);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 16px;
  white-space: nowrap;
}

.custom-table td {
  padding: 16px;
  vertical-align: middle;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ==============================================================================
   PROFIL DE SELECTION DE BOUTIQUE (POUR L'ADMINISTRATEUR)
   ============================================================================== */
.shop-profile-link {
  text-decoration: none !important;
  display: block;
}

.shop-profile-card {
  background-color: var(--nilhane-white);
  border: 1px solid var(--nilhane-gray);
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.shop-profile-card:hover {
  transform: translateY(-5px);
  border-color: var(--nilhane-primary);
  box-shadow: 0 10px 20px rgba(197, 140, 115, 0.18);
}

/* Logo de boutique en format profil rond parfait */
.shop-logo-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--nilhane-primary);
  object-fit: cover;
  margin: 0 auto 15px auto;
  background-color: var(--nilhane-white);
  padding: 2px;
  display: block;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.shop-title-text {
  color: var(--nilhane-black);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.shop-profile-card:hover .shop-title-text {
  color: var(--nilhane-primary-hover);
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================================================
   MEDIA QUERIES - RESPONSIVE GLOBAL MASQUAGE SIDEBAR
   ==================================================================== */
@media (max-width: 768px) {
  .wrapper {
    flex-direction: column;
  }

  #sidebar {
    min-width: 100%;
    max-width: 100%;
    min-height: auto;
    display: none;
  }

  #sidebar.show {
    display: block !important;
  }

  #content {
    padding: 15px;
  }

  .kpi-card {
    margin-bottom: 10px;
  }
}

/* ==============================================================================
   PRO-FIX : RESPONSIVE GLOBAL & BARRES DE DÉFILEMENT HORIZONTALES (MOBILE/TABLET)
   ============================================================================== */

.main-content-wrapper {
  overflow: auto;
  padding-bottom: 15px;
}

@media (max-width: 991.98px) {
  .row-scroll-mobile {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    gap: 12px;
  }
  .row-scroll-mobile > [class*="col-"] {
    flex: 0 0 auto !important;
    width: 190px !important;
  }
}

/* Stylisation universelle des barres de défilement aux couleurs de Nilhane */
.main-content-wrapper::-webkit-scrollbar,
.row-scroll-mobile::-webkit-scrollbar,
div::-webkit-scrollbar {
  height: 10px !important;
  display: block !important;
}

.main-content-wrapper::-webkit-scrollbar-track,
.row-scroll-mobile::-webkit-scrollbar-track,
div::-webkit-scrollbar-track {
  background: var(--nilhane-light) !important;
  border-radius: 8px;
}

.main-content-wrapper::-webkit-scrollbar-thumb,
.row-scroll-mobile::-webkit-scrollbar-thumb,
div::-webkit-scrollbar-thumb {
  background-color: var(--nilhane-primary) !important;
  border-radius: 8px;
  border: 2px solid var(--nilhane-light);
}

.main-content-wrapper::-webkit-scrollbar-thumb:hover,
.row-scroll-mobile::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover {
  background-color: var(--nilhane-primary-hover) !important;
}
