/* /assets/app.css */
/* =========================================================
   G’WINE — Charte "Grand Cru" (Bordeaux & Or)
   Compatible avec les anciennes pages (Account) et les nouvelles.
========================================================= */

:root {
    /* --- COULEURS --- */
    --wine:       #802a3a;   
    --wine-dark:  #5e1826;
    --gold:       #c5a065;
    --gold-light: #fdf6e3;
    
    --bg-body:    #f8f9fa;   /* Fond gris clair */
    --bg-card:    #ffffff;   /* Blanc pur */
    --text-main:  #2c3e50;
    --text-muted: #6c757d;
    --border:     #e9ecef;

    --radius:     16px;
    --shadow:     0 4px 20px rgba(0,0,0,0.06);
}

/* --- BASE --- */
html, body { font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); padding-bottom: 80px; }
a { text-decoration: none; transition: 0.2s; color: inherit; }
img { max-width: 100%; height: auto; }
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 30px 15px; }

/* --- 1. NAVIGATION (Bordeaux Opaque) --- */
.nav-glass {
    background-color: var(--wine) !important;
    box-shadow: 0 4px 15px rgba(128, 42, 58, 0.3);
    padding: 10px 0;
    position: sticky; top: 0; z-index: 1030;
    border: none;
}
.brand-logo { height: 42px; width: auto; background: white; border-radius: 8px; padding: 2px; }

/* Liens Menu */
.nav-glass .nav-link { color: rgba(255,255,255,0.85) !important; font-weight: 600; padding: 8px 16px !important; border-radius: 50px; }
.nav-glass .nav-link:hover { color: #fff !important; background: rgba(255,255,255,0.15); transform: translateY(-1px); }
.nav-glass .nav-link.active { color: #fff !important; background: rgba(255,255,255,0.25); font-weight: 700; }

/* Hamburger Mobile */
.navbar-toggler { border: 1px solid rgba(255,255,255,0.3); padding: 4px 8px; }
.navbar-toggler-icon { filter: invert(1); }

/* --- 2. BOUTONS (Nouveaux & Anciens compatibles) --- */
/* Btn Bordeaux */
.btn-wine, .btn-neo.primary {
    background: var(--wine) !important; color: white !important; border: none;
    border-radius: 50px; padding: 10px 24px; font-weight: 600;
    box-shadow: 0 4px 10px rgba(128, 42, 58, 0.2);
}
.btn-wine:hover, .btn-neo.primary:hover { background: var(--wine-dark) !important; transform: translateY(-2px); }

/* Btn Or (Conseil/IA) */
.btn-gold, .btn-neo.green {
    background: linear-gradient(135deg, var(--gold) 0%, #b08d55 100%) !important;
    color: white !important; border: none;
    border-radius: 50px; padding: 10px 24px; font-weight: 700;
    box-shadow: 0 4px 10px rgba(197, 160, 101, 0.3);
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-gold:hover, .btn-neo.green:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* Btn standard "Neo" (pour account.php) */
.btn-neo {
    background: white; border: 1px solid #ddd; color: #333;
    padding: 8px 16px; border-radius: 12px; font-weight: 600;
}
.btn-neo:hover { background: #f8f9fa; }

/* --- 3. CARTES & CONTENEURS (Adaptation "Glass" en "Solid White") --- */
/* On force l'ancienne classe .glass à devenir une carte blanche propre */
.glass, .card, .kpi-card, .mini-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 24px;
    box-shadow: var(--shadow) !important;
    color: var(--text-main) !important;
    position: relative; overflow: hidden;
}
.kpi-card:hover, .card:hover { transform: translateY(-3px); border-color: var(--wine) !important; }

/* Hero (Bannières) */
.hero {
    background: linear-gradient(135deg, var(--wine) 0%, #5e1826 100%) !important;
    color: white !important;
    border-radius: var(--radius); padding: 30px; margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.hero-title, .hero-sub { color: white !important; }
.hero::before { display: none; } /* On retire les effets flous bizarres */

/* --- 4. ÉLÉMENTS INTERNES --- */
/* KPI */
.kpi-value { font-size: 2.2rem; font-weight: 800; color: var(--wine); line-height: 1; margin-bottom: 5px; }
.kpi-label { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; }
.kpi-icon  { position: absolute; top: 20px; right: 20px; font-size: 2.5rem; color: var(--wine); opacity: 0.05; }

/* Titres */
.dash-title, .section-title { font-size: 1.1rem; font-weight: 800; color: var(--wine) !important; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }

/* Inputs (Formulaires) */
.form-control, .input-dark {
    background: #fff !important; border: 1px solid #ced4da !important; color: #333 !important;
    border-radius: 12px; padding: 12px;
}
.form-control::placeholder { color: #aaa !important; }

/* Badges & Chips */
.chip, .status-pill {
    background: #f1f3f5 !important; color: #555 !important; border: 1px solid #ddd !important;
    padding: 5px 12px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; display: inline-block;
}

/* --- 5. MOBILE BOTTOM NAV --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 10px 0 25px; z-index: 2000;
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; color: #adb5bd; font-size: 0.7rem; font-weight: 600; flex: 1; }
.bottom-nav a.active { color: var(--wine); }
.bottom-nav a.scan div {
    background: var(--wine); width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-top: -20px;
    box-shadow: 0 4px 10px rgba(128, 42, 58, 0.4); color: white;
}
@media (min-width: 992px) { .bottom-nav { display: none; } body { padding-bottom: 0; } }

/* =========================================================
   iOS Safe Area — fond bordeaux + contenu décalé (menu inclus)
   À coller tout en bas
========================================================= */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Peint TOUJOURS la zone notch/Dynamic Island en bordeaux */
body::before{
  content:"";
  position: fixed;
  left: 0; right: 0;
  top: 0;
  height: var(--safe-top);
  background: var(--wine);
  z-index: 9999;
  pointer-events: none;
}

/* Décale le header sticky ET le “menu header” (Bootstrap offcanvas) */
.nav-glass{
  top: 0 !important;
  padding-top: calc(10px + var(--safe-top)) !important; /* 10px = ton padding actuel */
}

/* Si ton menu est un Offcanvas Bootstrap, on décale son header aussi */
.offcanvas-header{
  padding-top: calc(1rem + var(--safe-top)) !important;
}

/* Si tu as une barre top custom “Menu”, elle doit être sous la safe area */
.page-wrap{
  padding-top: calc(30px + var(--safe-top));
}

/* Bottom safe-area (home indicator) */
.bottom-nav{
  padding-bottom: calc(25px + var(--safe-bottom));
}
html, body{
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* --- Admin fiche utilisateur : tableau stock (scroll vertical = page, pas de max-height qui rogne) --- */
.admin-user-stock-panel {
  overflow: visible;
}
.admin-user-stock-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}
.admin-user-stock-table-wrap .table {
  margin-bottom: 0;
}
.admin-user-stock-table-wrap img {
  max-width: none;
}

/* Cartes monitoring cliquables */
a.dash-kpi-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
a.dash-kpi-link:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px);
}

/* Quantity stepper (mobile + desktop) */
.gw-qty-stepper {
  display: inline-flex !important;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid #ced4da;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  width: 100%;
  flex-wrap: nowrap;
}

.gw-qty-stepper.gw-qty-stepper-sm {
  border-radius: 10px;
}

.gw-qty-stepper .gw-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f8f9fb;
  color: #495057;
  font-weight: 800;
  min-width: 44px;
  padding: 0.45rem 0.6rem;
  line-height: 1;
  flex: 0 0 auto;
}

.gw-qty-stepper.gw-qty-stepper-sm .gw-qty-btn {
  min-width: 36px;
  padding: 0.28rem 0.45rem;
}

.gw-qty-stepper .gw-qty-btn:hover {
  background: #eef1f5;
}

.gw-qty-stepper .gw-qty-btn:active {
  background: #e4e9f0;
}

.gw-qty-stepper .gw-qty-input {
  display: block;
  border: 0 !important;
  border-left: 1px solid #e9ecef !important;
  border-right: 1px solid #e9ecef !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center;
  font-weight: 700;
  min-height: 44px;
  flex: 1 1 auto;
  min-width: 0;
}

.gw-qty-stepper.gw-qty-stepper-sm .gw-qty-input {
  min-height: 34px;
  font-size: 0.88rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.gw-qty-stepper .gw-qty-input::-webkit-outer-spin-button,
.gw-qty-stepper .gw-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gw-qty-stepper .gw-qty-input[type=number] {
  -moz-appearance: textfield;
}