/* ====================================
   LA REFABRIQUE - CSS MODERNE
   ==================================== */

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef4 100%);
    color: #2B2D42;
    margin: 0;
    padding: 0;
}

/* Header moderne avec gradient */
.navbar-inverse {
    background: linear-gradient(135deg, #003844 0%, #003844 100%) !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-bottom: 0 !important;
    min-height: 50px !important;        /* Hauteur minimale (défaut Bootstrap = 50px) */
    padding: 0.2rem 0 !important;       /* Espace intérieur HAUT/BAS */
}

.navbar-inverse .container {
    padding-top: 5px !important;     /* Espace au-dessus du contenu */
    padding-bottom: 5px !important;  /* Espace en-dessous du contenu */
}

.navbar-header {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.navbar-brand {
    color: white !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    padding: 10px 15px !important;      /* Réduit l'espace autour du logo */
}

.navbar-inverse .navbar-nav > li > a {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.25rem;
    padding: 10px 15px !important;      /* Réduit l'espace autour des liens */
}

.navbar-inverse .navbar-nav > li > a:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateY(-2px);
}

/* Hero section moderne */
.hero-section {
    background: linear-gradient(135deg, #0A9396 0%, #94D2BD 100%);
    border-radius: 20px;
    padding: 1rem 3rem;
    color: white;
    margin-top: 10rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(10, 147, 150, 0.4);
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 2rem;
    opacity: 0.9;
    margin: 0;
}

/* Cards stats modernes */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #0A9396, #94D2BD);
}

.stat-card.vente::before {
    background: linear-gradient(180deg, #EE9B00, #CA6702);
}

.stat-icon {
    width: auto;
    min-width: 140px;
    height: 65px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: 0.5px;
    padding: 0 1.2rem;
    text-align: center;
    text-transform: uppercase;
}

.stat-card.collecte .stat-icon {
    background: linear-gradient(135deg, #94D2BD 0%, #0A9396 100%);
}

.stat-card.vente .stat-icon {
    background: linear-gradient(135deg, #EE9B00 0%, #CA6702 100%);
}

.stat-label {
    font-size: 1rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: #2B2D42;
    margin-bottom: 0.75rem;
}

.stat-change {
    font-size: 1rem;
    color: #0A9396;
    font-weight: 500;
}

/* Badges modernes */
.badge-modern {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 1rem;
}

.badge-modern.success {
    background: #d4edda;
    color: #155724;
}

.badge-modern.warning {
    background: #fff3cd;
    color: #856404;
}

/* Section graphiques */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.chart-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2B2D42;
    font-weight: 600;
}

/* Boutons modernes */
.btn-refabrique {
    background: linear-gradient(135deg, #0A9396 0%, #005F73 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(10, 147, 150, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-refabrique:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 147, 150, 0.4);
    color: white;
    text-decoration: none;
}

/* Filtre boutique moderne */
.filter-section {
    background: white;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border: 2px solid #0A9396;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.filter-section label {
    font-weight: 600;
    color: #2B2D42;
    margin: 0;
    font-size: 2rem;
}

.filter-section select {
    flex: 1;
    max-width: 400px;
    border-radius: 8px;
    border: 3px solid #e8eef4;
    padding: 0.2rem 1.5rem;
    font-size: 2rem;
    transition: all 0.3s ease;
}

/* Top 3 catégories */
.top-category {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 5px solid #0A9396;
    transition: all 0.3s ease;
}

.top-category:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.top-category.rank-1 { border-left-color: #FFD700; }
.top-category.rank-2 { border-left-color: #C0C0C0; }
.top-category.rank-3 { border-left-color: #CD7F32; }

.category-rank {
    font-size: 2.5rem;
    font-weight: 800;
    color: #e9ecef;
    margin-right: 1.5rem;
    min-width: 50px;
}

.top-category.rank-1 .category-rank { color: #FFD700; }
.top-category.rank-2 .category-rank { color: #C0C0C0; }
.top-category.rank-3 .category-rank { color: #CD7F32; }

.category-info {
    flex: 1;
}

.category-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2B2D42;
    margin-bottom: 0.5rem;
}

.category-quantity {
    font-size: 2rem;
    font-weight: 700;
    color: #0A9396;
}

.category-quantity .unit {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}


/* ====================================
   CAISSE / POINTS DE VENTE - MODERNE
   ==================================== */

/* Header caisse */
.caisse-header {
    background: linear-gradient(135deg, #005F73 0%, #003844 100%);
    color: white;
    padding: 1.5rem 2rem;
    margin: -15px -15px 2rem -15px;
    margin-top: 7rem;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.caisse-header h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
}

.caisse-actions {
    display: flex;
    gap: 1rem;
}

.caisse-actions .btn {
    font-size: 2rem;              /* AJOUTÉ */
    padding: 0.8rem 1.5rem;         /* AJOUTÉ */
}

/* Layout 3 colonnes */
.caisse-layout {
    display: grid !important;
    grid-template-columns: 550px 280px 1fr !important;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

/* Panneau catégories (gauche) - VRAIS CARRÉS */
.categories-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.categories-panel h3 {
    font-size: 2rem;
    color: #2B2D42;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* GRILLE DE CATÉGORIES - VRAIMENT CARRÉS */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* Container de chaque catégorie */
.category-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 50%;                     /* FORCE le carré parfait */
}

.category-wrapper .btn-group {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.category-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;                       /* Réduit pour tenir */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    word-wrap: break-word;
    line-height: 1.2;
}

.category-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.category-btn:active {
    transform: scale(0.95);
}

/* DROPDOWN EN GRILLE DE BOUTONS CARRÉS */
.category-wrapper .dropdown-menu {
    position: fixed !important;
    width: 400px !important;                    /* 350px → 400px */
    padding: 0.75rem;                           /* 1rem → 0.75rem */
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    border: 2px solid #0A9396;
    z-index: 1000;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);      /* 3 → 2 colonnes */
    gap: 0.5rem;                                /* 0.5rem → 0.4rem */
}

/* Items en mode bouton carré */
.category-wrapper .dropdown-menu > li {
    aspect-ratio: 1;
    width: 100%;
    position: relative;
}

/* Lien comme bouton carré */
.category-wrapper .dropdown-menu > li > a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;                           /* 0.8rem → 0.5rem */
    border-radius: 10px;
    font-size: 0.85rem;                        /* 0.95rem → 0.85rem */
    font-weight: 600;
    color: white !important;
    background: linear-gradient(135deg, #0A9396 0%, #005F73 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    word-wrap: break-word;
    line-height: 1.2;
}

.category-wrapper .dropdown-menu > li > a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-decoration: none;
}

.category-wrapper .dropdown-menu > li > a:active {
    transform: scale(0.95);
}

/* Premier item (sans précision) en plus foncé */
.category-wrapper .dropdown-menu > li:first-child > a {
    background: linear-gradient(135deg, #005F73 0%, #003844 100%);
    font-weight: 700;
}

/* Divider caché car on est en grille */
.category-wrapper .dropdown-menu > li.divider {
    display: none;
}

/* Caret plus petit */
.category-btn .caret {
    margin-left: 0.3rem;
}

/* Panneau saisie (centre) */
.saisie-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.saisie-panel h3 {
    font-size: 2rem;
    color: #2B2D42;
    margin-bottom: 1rem;
    font-weight: 600;
}

.form-group-caisse {
    margin-bottom: 1.2rem;
}

.form-group-caisse label {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.form-group-caisse input {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.5rem;
    border: 2px solid #e8eef4;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-group-caisse input:focus {
    border-color: #0A9396;
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 147, 150, 0.1);
}

/* Pavé numérique moderne */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.numpad-btn {
    padding: 1.4rem;                /* 1.2rem → 1.4rem */
    font-size: 2rem;              /* 1.5rem → 1.8rem */
    font-weight: 700;
    border: 2px solid #e8eef4;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2B2D42;
}

.numpad-btn:hover {
    background: #0A9396;
    color: white;
    border-color: #0A9396;
    transform: scale(1.05);
}

.numpad-btn:active {
    transform: scale(0.95);
}

.btn-add-item {
    width: 100%;
    padding: 1.2rem;                /* 1rem → 1.2rem */
    font-size: 2rem;              /* 1.1rem → 1.2rem */
    font-weight: 600;
    background: linear-gradient(135deg, #0A9396 0%, #005F73 100%);
    color: white;
    border: none;
    border-radius: 10px;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(10, 147, 150, 0.3);
}

/* Ticket (droite) */
.ticket-panel {
    background:  linear-gradient(135deg, #0A9396 0%, #003844 100%) !important;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e8eef4;
    margin-bottom: 1rem;
}

.ticket-header h3 {
    font-size: 2rem;              /* 1.2rem → 1.4rem */
    color: black;
    font-weight: 600;
}

.ticket-total {
    font-size: 2.2rem;              /* 1.8rem → 2.2rem */
    font-weight: 700;
    color: black;
}

.ticket-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.ticket-item {
    padding: 1rem;
    border-bottom: 1px solid black;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-item:hover {
    background: #fafbfc;
}

.ticket-item-name {
    font-weight: 600;
    font-size: 2rem;              /* AJOUTÉ */
    color: black;
}

.ticket-item-details {
    font-size: 2rem;                /* 0.9rem → 1rem */
    color: black;
}

.ticket-item-price {
    font-size: 2rem;              /* 1.2rem → 1.3rem */
    font-weight: 700;
    color: black;
}

/* Moyens de paiement */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.payment-btn {
    padding: 2rem 0.5rem;         /* 1rem → 1.1rem */
    border: 2px solid #e8eef4;
    border-radius: 8px;
    background: white;
    font-weight: 600;
    font-size: 1.5rem;             /* AJOUTÉ */
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-btn.active {
    background: #0A9396;
    color: white;
    border-color: #0A9396;
}

.payment-btn:hover {
    border-color: #0A9396;
}

/* Bouton encaisser */
.btn-encaisser {
    width: 100%;
    padding: 1.6rem;                /* 1.5rem → 1.6rem */
    font-size: 2rem;              /* 1.3rem → 1.4rem */
    font-weight: 700;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-encaisser:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* Autres boutons dans ticket */
.ticket-panel .btn {
    font-size: 2rem;             /* AJOUTÉ */
    padding: 0.8rem 1rem;           /* AJOUTÉ */
}

/* SOUS-MENU PERSONNALISÉ */
.custom-submenu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    background: white;
    padding: 0.75rem;
    border-radius: 14px;
    border: 2px solid #0A9396;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    z-index: 3000;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.custom-submenu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 2999;
}

.submenu-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    word-wrap: break-word;
    line-height: 1.1;
}

.submenu-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.submenu-item:active {
    transform: scale(0.95);
}

/* ====================================
   COLLECTE - MODERNISATION SIMPLE
   ==================================== */

/* Panneaux blancs arrondis */
.container .panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: none !important;
}

/* Headers des panneaux en bleu-vert */
.container .panel-heading {
    background: linear-gradient(135deg, #0A9396 0%, #005F73 100%) !important;
    color: white !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.5rem !important;
    border: none !important;
}

.container .panel-title {
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: white !important;
}

/* Panel bon d'apport avec fond coloré */
.container .panel:has(#cart) {
    background: linear-gradient(135deg, #0A9396 0%, #003844 100%) !important;
}

.container .panel:has(#cart) .panel-heading {
    background: transparent !important;
}

.container .panel:has(#cart) .panel-body {
    padding: 1.5rem !important;
}

.container .panel:has(#cart) .list-group-item {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: white !important;
    font-size: 1.1rem !important;
}

/* Labels et inputs */
.container label {
    font-weight: 600 !important;
    color: #2B2D42 !important;
    font-size: 1.1rem !important;
}

.container select.form-control,
.container input.form-control {
    padding: 0.8rem !important;
    font-size: 1.1rem !important;
    border: 2px solid #e8eef4 !important;
    border-radius: 8px !important;
}

/* Boutons des catégories */
.container .btn-group .btn {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease !important;
    color: white !important;
    padding: 1rem !important;
}

.container .btn-group .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
}

/* Bouton principal vert */
.container .btn-success {
    width: 100%;
    padding: 1.2rem !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3) !important;
}

.container .btn-success:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4) !important;
}

/* Bouton info bleu */
.container .btn-info {
    font-size: 1.1rem !important;
    padding: 0.8rem 1.2rem !important;
    border-radius: 8px !important;
}

/* Numpad */
#numpad input {
    font-size: 1.3rem !important;
    padding: 0.8rem !important;
}

#numpad .btn-group-vertical .btn {
    font-size: 1.5rem !important;
    padding: 1rem !important;
    border-radius: 8px !important;
}

#numpad .btn-primary {
    padding: 1rem !important;
    font-size: 1.2rem !important;
    background: linear-gradient(135deg, #0A9396 0%, #005F73 100%) !important;
    border: none !important;
    border-radius: 10px !important;
}

/* Fix datePicker visibility in headers */
.bilan-header input,
.rapport-header input,
[style*="background"] input[type="text"],
[style*="background"] input[type="date"] {
    color: #333 !important;
}
