/* --- PALETTE EVOSER --- */
:root {
    /* Couleurs extraites du logo */
    --evo-teal-light: #4db7a8; /* Partie claire du dégradé */
    --evo-teal-dark: #008c95;  /* Partie foncée du dégradé vert */
    --evo-blue: #1a4a7c;       /* Couleur du texte "EVOSER" */
    --evo-blue-dark: #0f3057;

    --bg-soft: #f4f6f9;        /* Arrière-plan très doux */
    --shadow-color: rgba(15, 48, 87, 0.12); /* Ombre teintée de bleu */
}

/* --- GLOBAL & TYPOGRAPHY --- */
body {
    background-color: var(--bg-soft);
    font-family: 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--evo-blue-dark);
    /* Désactiver le zoom sur mobile lors du focus sur un input */
    touch-action: manipulation;
}

.ls-1 { letter-spacing: 1px; }
.ls-2 { letter-spacing: 2px; }
.fw-bold { font-weight: 700 !important; }
.bg-soft { background-color: var(--bg-soft) !important; }

/* --- ANIMATIONS & TRANSITIONS --- */
/* Animation d'entrée de page fluide */
.page-transition {
    animation: slideUpFadeIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Effet de survol (Boutons, Cartes) */
.hover-up { transition: all 0.2s ease; }
.hover-up:active { transform: scale(0.97) !important; }

/* --- COMPONENTS --- */

/* Header Dégradé */
.evo-header {
    background: linear-gradient(135deg, var(--evo-blue) 0%, var(--evo-teal-dark) 100%);
    backdrop-filter: blur(10px); /* Effet verre si supporté */
}

/* Loading Overlay Styler */
#loadingOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 48, 87, 0.9); /* Fond bleu foncé semi-transparent */
    z-index: 10000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.3s;
}
#loadingOverlay.d-none { pointer-events: none; opacity: 0; display: flex !important; }

/* Cards Modernes */
.evo-card {
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 30px -10px var(--shadow-color);
    border: none;
}
.shadow-evo { box-shadow: 0 15px 35px -10px var(--shadow-color) !important; }

/* Login Specific */
.login-card { max-width: 420px; padding: 3rem 2rem; margin-top: 2rem; }

/* Inputs Modernes */
.evo-input {
    border: 2px solid transparent;
    background-color: var(--bg-soft);
    border-radius: 15px;
    padding: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s;
}
.evo-input:focus {
    background-color: white;
    border-color: var(--evo-teal-light);
    box-shadow: 0 5px 15px -5px var(--shadow-color);
}
/* Enlever les bordures moches des input groups */
.input-group-text, .form-control { border-color: transparent; }
.form-control:focus { box-shadow: none; }

/* --- BUTTONS --- */
/* Bouton Dégradé Principal */
.btn-evo-gradient {
    background: linear-gradient(135deg, var(--evo-teal-light) 0%, var(--evo-blue) 100%);
    border: none; color: white;
}
.btn-evo-gradient:hover { background: linear-gradient(135deg, var(--evo-teal-dark) 0%, var(--evo-blue-dark) 100%); color: white;}

/* Boutons "Glass" du header */
.btn-evo-glass { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(5px); }
.btn-evo-glass-danger { background: rgba(220, 53, 69, 0.2); border: 1px solid rgba(220, 53, 69, 0.4); }

/* Boutons Teal */
.btn-evo-teal { background-color: var(--evo-teal-dark); color: white; }
.btn-outline-evo-teal { color: var(--evo-teal-dark); border-color: var(--evo-teal-dark); border-width: 2px; }
.text-evo-teal { color: var(--evo-teal-dark) !important; }
.text-evo-blue { color: var(--evo-blue) !important; }


/* --- PRODUCT LIST & MODALS --- */
.product-card-item {
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.product-card-item:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -10px var(--shadow-color); }

.modal-content { border-radius: 25px; overflow: hidden; }
.list-group-item { border: none; border-bottom: 1px solid var(--bg-soft); padding: 1rem 1.5rem; }
.list-group-item:hover { background-color: var(--bg-soft); }

/* --- CUSTOM TOAST COLORS --- */
.bg-toast-success { background: linear-gradient(135deg, #28a745, #218838); }
.bg-toast-error { background: linear-gradient(135deg, #dc3545, #c82333); }

/* Ajustements Mobile */
@media (max-width: 576px) {
    .main-container { padding-top: 20px; }
    .evo-card { border-radius: 20px; }
    .login-card { margin-top: 1rem; padding: 2rem 1.5rem;}
    h2 { font-size: 1.8rem; }
    /* Le header prend moins de place sur mobile */
    #mainHeader { padding: 0.7rem !important; }
    /* Cacher le nom de l'entreprise si trop long sur petit écran */
    #companyName { display: none; }
}

/* --- NEW PRODUCT CARD DESIGN --- */

.product-card-item {
    background: white;
    border: none;
    border-radius: 24px; /* Super rounded */
    padding: 1.25rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04); /* Very soft shadow */
    overflow: hidden;
}

/* Hover Effect */
.product-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(15, 48, 87, 0.1);
}

/* Decorative Left Border (Optional, adds color pop) */
.product-card-item::before {
    content: '';
    position: absolute;
    left: 0; top: 15%; bottom: 15%;
    width: 4px;
    background: var(--evo-teal-light);
    border-radius: 0 4px 4px 0;
    opacity: 0.5;
}

/* Typography */
.card-title-text {
    font-size: 1.05rem;
    color: var(--evo-blue-dark);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.card-ref-text {
    font-size: 0.85rem;
    color: #8c98a4;
    font-weight: 500;
}

.card-barcode-badge {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    background-color: #eef2f7;
    color: var(--evo-blue);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

/* --- BUTTONS & CONTROLS --- */

/* Delete Icon (Top Right) */
.btn-delete-absolute {
    position: absolute;
    top: 10px; right: 10px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: #ff6b6b;
    background: transparent;
    border: none;
    transition: background 0.2s;
}
.btn-delete-absolute:active { background: #fff0f0; transform: scale(0.9); }

/* Quantity Stepper (The Pill) */
.qty-stepper {
    display: flex;
    align-items: center;
    background-color: var(--bg-soft);
    border-radius: 50px; /* Pill shape */
    padding: 4px;
    width: fit-content;
    margin-top: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

/* Stepper Buttons (- / +) */
.btn-step {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-step:active { transform: scale(0.9); }

.btn-step.minus { color: var(--evo-blue); }
.btn-step.plus {
    background: var(--evo-teal-dark);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 140, 149, 0.3);
}

/* Quantity Text */
.qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--evo-blue-dark);
}

.pending-card {
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 10px 15px;
        min-width: 140px;
        flex: 1;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .pending-card h6 {
        font-size: 1rem;
        color: #0f172a;
        margin-bottom: 5px;
        font-weight: 700;
    }
    .pending-card .badge {
        font-size: 0.8rem;
        align-self: flex-start;
    }

    #scanInput{
      position: fixed;
      opacity: 0;
      top: -100px;
      left: -100px;
      height: 1px;
      width: 1px;
      z-index: -1;
      pointer-events: none;
    }