/* ============================
   PALETTE CRÈME PASTEL
============================ */
:root {
    --fond: #faf7f2;
    --clair: #f2e9df;
    --moyen: #e8d9c5;
    --fonce: #22170c; /* ⬅️ Modifié : texte principal très foncé */
    --accent: #c7b299;
    --bordure: #d6c9b8;
}

/* ===========================
   MESSAGES & ALERTES
=========================== */
.login-warning {
    background: #fff4d6;
    border-left: 4px solid #e6b800;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #6a5500;
    font-size: 14px;
    text-align: center;
}

.message {
    font-weight: bold;
}

.message.error { color: #b30000; }
.message.success { color: #009900; }

/* ===========================
   STRUCTURE GLOBALE
=========================== */
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--fonce); /* S'assure que tout le texte hérite de la couleur foncée */
    background-color: #fdf2d9;
    background-image: url('/images/vignoble_design.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

header {
    background: #fdf2d9;
    padding: 0;
    border-bottom: 1px solid var(--bordure);
    margin: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

header h1 {
    display: none;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 6px 0;
    background: #fdf2d9;
}

nav a {
    display: inline-block;
    background: #ffd88a;
    padding: 8px 14px;
    margin: 4px;
    border-radius: 6px;
    border: 1px solid var(--bordure);
    text-decoration: none;
    color: var(--fonce);
    font-weight: bold;
    transition: 0.2s;
    position: relative;
}

nav a:hover {
    background: var(--accent);
    color: #fff;
}

/* --- Header & Recherche --- */
.header-logo-side img {
    height: 60px;
    width: auto;
    opacity: 0.95;
}

.header-title-center {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--fonce);
    font-family: "Arial", serif;
    text-align: center;
    line-height: 1;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 0;
    margin-bottom: 0;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-search input {
    padding: 8px 14px;
    height: 28px;
    border-radius: 20px;
    border: 1px solid #ccc;
    width: 240px;
    font-size: 18px;
}

.header-search button,
.scan-btn {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 24px;
    margin: 0;
}

.header-search button {
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.8);
    line-height: 28px;
}

.scan-btn {
    padding: 2px 12px;
    background: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

.scan-btn:hover {
    background: var(--accent);
    transform: scale(0.95);
}

/* --- Connexion & Dropdown --- */
.user-link,
.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #4a3f35;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: #ffd88a;
    border: 1px solid var(--bordure);
    transition: 0.2s;
    cursor: pointer;
}

.user-link:hover,
.user-btn:hover {
    background: #e8dcc4;
}

.user-icon,
.user-ico {
    font-size: 18px;
    line-height: 1;
}

.user-dropdown {
    position: relative;
    margin-left: 12px;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 42px;
    right: 0;
    background: #f3e8d2;
    border: 1px solid var(--bordure);
    border-radius: 6px;
    min-width: 150px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 999;
}

.user-dropdown-menu a {
    display: block;
    padding: 10px 12px;
    color: #4a3f35;
    text-decoration: none;
}

.user-dropdown-menu a:hover {
    background: #e8dcc4;
}

.user-arrow {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.user-dropdown.open .user-arrow {
    transform: rotate(180deg);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn { cursor: pointer; }

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 999;
}

.dropdown-content a {
    color: #333;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.badge-alert {
    display: inline-block;
    background: #d60000;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.msg-badge-header {
    position: absolute;
    top: -2px;
    right: 0;
    background: #d60000;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
    line-height: 1;
    z-index: 999;
}

/* ===========================
   ZONE CENTRALE & CONTAINER
=========================== */
main {
    position: relative;
    z-index: 1;
    width: 100vw;
    margin: 35px 0 0 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 35px 0;
    backdrop-filter: blur(2px);
}

.container {
    text-align: center;
    width: 90%;
    max-width: 1600px;
    margin: auto;
    background: rgba(255, 255, 255, 0.7);
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 0 12px rgba(0,0,0,0.06);
}

footer {
    background-color: #fdf2d9;
    text-align: center;
    padding: 20px;
    color: #4a3f35;
    font-size: 14px;
    width: 100%;
    border-top: 1px solid #e0d7c8;
}

/* ============================
   TITRES
============================ */
.section-title {
    text-align: center;
    margin: 40px 0 25px;
    position: relative;
    padding: 6px 0;
    background: #fdf2d9;
    font-size: 28px;
    font-weight: bold;
    color: var(--fonce);
}

.sub-title {
    display: inline-block;
    background: #fdf2d9;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: #5a4a2a;
    border-left: 6px solid #d4a017;
}

.prod-title {
    font-size: 19px;
    font-weight: 600;
    margin: 10px 0 8px 50px;
    color: #6a5a3a;
    opacity: 0.9;
    padding-left: 8px;
    border-left: 3px solid #e8d9c5;
}

/* ============================
   GRILLES & CARTES
============================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
    justify-items: start;
}

.caps-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.caps-grid .card {
    flex: 0 0 160px;
    max-width: 160px;
}

.catalog-card,
.card {
    position: relative;
    background: rgba(255,255,255,0.85);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    transition: 0.2s;
    box-sizing: border-box;
}

.catalog-card {
    width: 100%;
    max-width: 220px;
    min-height: 260px;
}

.catalog-card:hover,
.card:hover {
    transform: scale(1.03);
}

.catalog-card * {
    position: relative;
    z-index: 10;
}

.card img {
    width: 100%;
    max-width: 120px;
    border-radius: 8px;
    margin-bottom: 6px;
}

.catalog-card .prod { font-weight: bold; color: var(--fonce); }
.card .serie, .catalog-card .serie { 
    font-size: 13px; 
    color: #333; /* ⬅️ Couleur plus sombre */
}

.card .desc, .catalog-card .desc { 
    font-size: 12px; 
    color: #444; /* ⬅️ Remplacé opacity par une vraie couleur sombre */
    margin-top: 4px; 
}
.card .cote, .catalog-card .cote { font-weight: bold; margin-top: 6px; }

.capsule-meta {
    background: #fdf2d9;
    padding: 10px 14px;
    border-radius: 5px;
    margin-top: 20px;
    color: #5a4634;
    border-left: 5px solid #d4a017;
    font-size: 14px;
    font-weight: 400;
}

.capsule-meta p strong { font-weight: 500; }

.prod-line {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 20px 0;
}

.prod-block {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
}

.prod-header {
    background: #fdf2d9;
    border-left: 6px solid #d4a017;
    padding: 10px 16px;
    border-radius: 8px;
    color: #5a4a2a;
    font-size: 18px;
    font-weight: 700;
    flex: 0 0 auto;
}

.prod-block .grid {
    flex: 1 1 500px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

/* --- Identification & Résultats --- */
.identification-zone {
    background: url('/images/theme/vignes.jpg') center/cover fixed;
    padding: 40px 0;
    margin-top: 35px;
}

.result-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.result-card {
    background: rgba(255,255,255,0.85);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0,0,0,0.12);
    transition: 0.2s;
    cursor: pointer;
    position: relative;
}

.result-card:hover { transform: scale(1.03); }

.result-card img {
    width: 100%;
    max-width: 130px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.result-card .prod { font-weight: bold; color: #5a4a2a; }
.result-card .serie { font-size: 13px; opacity: 0.8; }
.result-card .desc { font-size: 12px; opacity: 0.7; margin-top: 4px; }

.result-score {
    background: #fdf2d9;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: #5a4a2a;
    display: inline-block;
    margin: 10px 0;
}

.btn-add-collection {
    display: inline-block;
    background: #ffd88a;
    color: #5a4a2a;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 24px;
    text-decoration: none;
    margin-top: 4px;
}

.btn-add-collection:hover {
    background: #3e8e41;
    color: #fff;
}

.caps-count {
    position: absolute;
    top: 6px;
    left: 6px;
    font-style: italic;
    font-size: 14px;
    color: #444;
    background: rgba(255,255,255,0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================
   FILTRES & BOUTONS
============================ */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.filters-row .filters { margin: 0; }

.btn-reset {
    padding: 8px 14px;
    background: #d6c8b8;
    border-radius: 6px;
    text-decoration: none;
    color: #4a3f2a;
    font-weight: bold;
    font-size: 18px;
}

.btn-add {
    padding: 8px 40px;
    background: #ffd88a;
    border-radius: 6px;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    font-size: 18px;
    margin-left: 20px;
}

.filters select {
    height: 30px;
    padding: 4px 8px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #000;
    background: #fff;
    max-width: 180px;
}

.btn-add-small {
    padding: 10px 18px;
    border-radius: 6px;
    background: #e8d9c5;
    color: #000;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-add-small:hover {
    background: var(--accent);
    color: var(--fonce) !important;
}

/* ============================
   MODE TABLEAU
============================ */
.view-switch a {
    padding: 6px 12px;
    background: #eee;
    border-radius: 6px;
    margin-left: 6px;
    text-decoration: none;
    color: #333;
}

.view-switch a.active {
    background: #fdf2d9;
    border: 2px solid #704a2f;
    font-weight: bold;
}

.table-affichage {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
}

.table-affichage th,
.table-affichage td {
    padding: 1px 6px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    line-height: 1.1;
    vertical-align: middle;
    color: var(--fonce); /* ⬅️ Assure la lisibilité dans le tableau */
}

.table-affichage thead th {
    background: #f3e4c7;
    color: #4a3f35;
    border-bottom: 2px solid #704a2f;
    font-weight: bold;
    padding: 6px 8px;
}

.table-affichage thead th a {
    color: #4a3f35;
    text-decoration: none;
    font-weight: bold;
}

.table-affichage thead th a:hover { color: #2e261f; }
.table-affichage tr { height: 42px; }

.table-affichage img.mini-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin: 0;
    padding: 0;
    display: block;
}

/* ============================
   ICÔNES ET ACTIONS
============================ */
.icon-btn {
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin: 0 4px;
    color: var(--fonce);
    text-decoration: none;
    transition: 0.2s;
}

.icon-btn:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.15);
}

.actions { margin-top: 6px; }

.presence {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 22px;
    z-index: 5;
    pointer-events: none;
}

/* ============================
   FORUM ET PAGINATION
============================ */
.forum-actions {
    text-align: right;
    margin-bottom: 20px;
}

.forum-actions .btn-primary {
    background: #e8d9c5;
    color: var(--fonce);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--fonce);
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s;
}

.forum-actions .btn-primary:hover {
    background: var(--accent);
    color: #fff;
}

.forum-card {
    padding: 13px;
    background: rgba(255,255,255,0.85);
    border-radius: 10px;
    border: 1px solid var(--moyen);
    margin-bottom: 10px;
}

.forum-meta {
    font-size: 12px;
    color: #444;
    margin-top: 3px;
}

.btn-delete {
    background: #b30000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    margin-left: 10px;
    border: 1px solid #800000;
}

.btn-delete:hover { background: #800000; }

.pagination {
    text-align: center;
    margin-top: 25px;
}

.pagination a {
    margin: 0 10px;
    padding: 8px 14px;
    background: #ffd88a;
    color: #000;
    border-radius: 6px;
    text-decoration: none;
}

.pagination span {
    margin: 0 10px;
    font-weight: bold;
}

.pagination .page-number {
    padding: 6px 12px;
    margin: 0 4px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: 0.2s;
}

.pagination .page-number.active {
    background: #fdf2d9;
    color: #000;
    font-weight: bold;
    border: 2px solid #704a2f;
}

.page-btn {
    background: #fdf2d9 !important;
    color: #000 !important;
    padding: 6px 12px;
    border-radius: 6px;
    z-index: 30;
}

.avatar-profil {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #d8c9a7;
    margin-bottom: 15px;
}

/* ============================
   BOUTONS ET COMMENTAIRES
============================ */
button {
    margin-top: 20px;
    padding: 10px 18px;
    background: #ffd88a;
    color: var(--fonce);
    border: 1px solid var(--fonce);
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: var(--accent);
    color: #fff;
}

.comment-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    cursor: pointer;
    z-index: 10;
}

.comment-badge:hover {
    opacity: 1;
    transform: scale(1.15);
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.9),
                 0 0 12px rgba(255, 215, 0, 0.7);
}

.comment-icon {
    width: 20px;
    height: 20px;
    fill: #d4a017;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.7));
    transition: 0.2s ease;
}

.comment-badge:hover .comment-icon {
    transform: scale(1.12);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.9));
}

/* ============================
   PRISE DE PHOTO ET MODALES
============================ */
.capture-frame {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 20px auto;
}

.guide-text {
    text-align: center;
    margin-top: 10px;
    font-size: 15px;
    color: #555;
    font-weight: 500;
}

.capture-wrapper {
    width: 100%;
    max-width: 350px;
    height: 350px;
    margin: 0 auto 20px auto;
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
}

#cameraPreview {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#importPreview {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
}

.capture-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.circle-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 98%;
    height: 98%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 215, 0, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    pointer-events: none;
    z-index: 10;
}

.modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content,
.modal-box {
    background: #fffaf0;
    padding: 25px;
    border-radius: 8px;
    width: 350px;
    max-width: 90%;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    animation: fadeIn 0.2s ease-out;
    text-align: center;
}

.modal-buttons,
.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.modal-buttons button {
    padding: 8px 15px;
    border: none;
    background: #444;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.modal-buttons button:hover { background: #000; }

.modal-input {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #c8b88a;
    border-radius: 5px;
    font-size: 16px;
}

.btn-cancel { background: #ccc !important; }

.row-flex {
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes fadeIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================
   FILIGRANE & AFFICHAGE GRAND
============================ */
.capsule-wrapper {
    position: relative;
    display: inline-block;
}

.capsule-wrapper.watermark::after {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20%;
    height: 20%;
    background: url('/assets/logo_capsule_passion.png') no-repeat center;
    background-size: contain;
    opacity: 0.35;
    pointer-events: none;
}

#imgModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

#imgModalContent {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
}

.imgModalBox {
    background: rgba(0,0,0,0.85);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0,0,0,0.4);
}

.img-modal-close {
    position: fixed;
    top: 20px;
    right: 25px;
    font-size: 45px;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
}

.btn-descriptif-card {
    padding: 1px 2px;
    font-size: 20px;
    border-radius: 6px;
    border: 1px solid #b89b5b;
    background: #ffd88a;
    color: #4a3f35;
    cursor: pointer;
    transition: 0.2s;
}

.btn-descriptif-card:hover { background: #e5d2ae; }

.modal-card {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-card-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.modal-card-close {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 999999;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px;
    border-radius: 4px;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    user-select: none;
    z-index: 99999;
}

#prev-img { left: 10px; }
#next-img { right: 10px; }

/* ============================
   LIENS & MANIFESTATIONS
============================ */
.page-liens {
    max-width: 1100px;
    margin: 160px auto 40px;
    padding: 0 20px;
}

.form-container-lien,
.liens-container {
    background: rgba(255,255,255,0.85);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.form-container-lien {
    max-width: 700px;
    margin: 0 auto;
}

.form-lien {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-lien input[type="text"],
.form-lien input[type="url"],
.form-lien input[type="file"],
.form-lien textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--moyen);
    border-radius: 8px;
    font-size: 16px;
}

.form-lien textarea {
    min-height: 120px;
    resize: vertical;
}

.success-msg {
    color: green;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.actions-liens {
    text-align: center;
    margin-bottom: 30px;
}

.grid-liens {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.card-lien {
    background: #fff;
    border: 1px solid var(--moyen);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: 0.25s;
}

.card-lien:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-lien img {
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
    border-radius: 8px;
}

.btn-primary {
    background: #ffd88a;
    color: #000;
    padding: 12px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary:hover { background: #e5d2ae; }

.btn-small {
    font-size: 20px;
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    background: #ffd88a;
    color: #000;
    border-radius: 6px;
    text-decoration: none;
}

/* ============================
   DASHBOARD & STATS
============================ */
.dashboard-stats-card {
    background: #fff7e3;
    border: 2px solid #e6d7b8;
    border-radius: 14px;
    padding: 20px;
    max-width: 500px;
    margin: 25px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.dash-stats-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #5a4a3a;
}

.dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.dash-stat {
    background: #fff;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.dash-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.dash-value {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.dash-label {
    font-size: 13px;
    color: #666;
}

/* ============================
   INVENTAIRE GLOBAL
============================ */
.inventaire-box {
    background: #faf5e6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid #d4a017;
}

.inventaire-box h3 {
    margin: 0 0 10px 0;
    color: #5a4a2a;
    font-size: 22px;
    font-weight: 700;
}

.inv-content,
.inv-sub-content {
    display: none;
    margin-left: 10px;
    padding: 5px 0;
}

.inv-header.open + .inv-content,
.inv-header.open + .inv-sub-content {
    display: block;
}

.inv-item > .inv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e8d9b8;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 6px;
}

.inv-sub-item > .inv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f3e9d4;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    margin-left: 15px;
    margin-bottom: 4px;
}

.inv-prod {
    margin-left: 55px;
    padding: 4px 0;
    font-size: 15px;
    color: #444;
}

.inv-arrow {
    margin-right: 8px;
    font-weight: bold;
    color: #5a4a2a;
    font-size: 16px;
}

.inv-count {
    color: #777;
    font-size: 14px;
    margin-left: 8px;
}

/* ============================
   RESPONSIVE (MOBILE)
============================ */
@media (max-width: 768px) {
    .container, 
    main, 
    .content,
    .box-section,
    .stats-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .table-responsive,
    div:has(> table) {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 15px !important;
    }

    table {
        width: 100% !important;
        max-width: none !important;
        border-collapse: collapse !important;
    }

    table th, 
    table td {
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }
}
@media (max-width: 768px) {

    /* Réduction globale de la taille du tableau */
    .table-affichage {
        font-size: 11px !important; /* Texte plus petit pour gagner de la place */
    }

    /* Réduction des espacements internes dans les cases */
    .table-affichage th, 
    .table-affichage td {
        padding: 4px 5px !important;
        line-height: 1.2 !important;
    }

    /* Réduction de la taille des images de capsules */
    .table-affichage img {
        max-width: 35px !important; /* Taille réduite des vignettes */
        max-height: 35px !important;
        height: auto !important;
    }

    /* Ajustement des boutons + et - */
    .btn-add-collection {
        font-size: 11px !important;
        padding: 2px 5px !important;
    }

    /* Permet aux descriptions de se couper proprement au lieu de forcer une largeur énorme */
    .table-affichage td {
        max-width: 120px;
        white-space: normal !important; /* Autorise le texte à passer à la ligne */
        word-wrap: break-word;
    }
}


   /* Identifier capsule action*/
        .cream-card {
            background-color: #fdfbf7;
            border: 1px solid #e2d9c8;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(199, 168, 90, 0.08);
        }
        
        .adjustment-box {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 40px;
            padding: 25px;
            margin: 20px auto 30px auto;
            max-width: 850px;
        }

        .controls-panel {
            display: flex;
            flex-direction: column;
            gap: 15px;
            width: 360px;
            text-align: left;
        }

        .control-group label {
            font-weight: bold;
            font-size: 14px;
            color: #4a3e2e;
            display: flex;
            justify-content: space-between;
        }

        .range-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .range-wrapper input[type=range] {
            flex-grow: 1;
            accent-color: #c7a85a;
            cursor: pointer;
        }

        .step-btn {
            background: #f0eae1;
            border: 1px solid #c7a85a;
            color: #4a3e2e;
            border-radius: 4px;
            width: 28px;
            height: 28px;
            font-weight: bold;
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .step-btn:hover {
            background: #c7a85a;
            color: #fff;
        }

        .btn-theme {
            background: linear-gradient(135deg, #d4b565 0%, #b89443 100%);
            color: #ffffff;
            border: none;
            padding: 10px 18px;
            border-radius: 6px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            transition: all 0.2s ease;
        }

        .btn-theme:hover {
            background: linear-gradient(135deg, #c7a85a 0%, #a68334 100%);
            transform: translateY(-1px);
        }

        .btn-secondary-theme {
            background: #f0eae1;
            color: #5a4b38;
            border: 1px solid #d4c5b0;
            padding: 8px 14px;
            border-radius: 6px;
            font-weight: bold;
            cursor: pointer;
        }

        .btn-secondary-theme:hover {
            background: #e4dacb;
        }

        .grid-capsules {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .capsule-card-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 15px;
            text-align: center;
            transition: transform 0.2s;
        }

        .capsule-card-item:hover {
            transform: translateY(-3px);
        }

        .capsule-card-item img {
            width: 130px;
            height: 130px;
            object-fit: cover;
            border-radius: 50%;
            border: 2px solid #c7a85a;
            margin-bottom: 10px;
        }
