/* =====================
   BASE
===================== */
html, body {
    height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* =====================
   CONTAINER GLOBAL
===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    box-sizing: border-box;
}

/* =====================
   HEADER
===================== */
.site-header {
    width: 100%;
    background: #ffcb05;
    position: relative;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.site-title a {
    font-weight: bold;
    text-decoration: none;
    color: #000;
    font-size: 20px;
}

/* NAV DESKTOP */
.main-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    background: none;
    padding: 0;
    border-radius: 0;
    display: inline;
}

.nav-lock {
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
}

.nav-lock:hover { opacity: 1; }

/* BURGER */
.burger-toggle { display: none; }

.burger-label {
    display: none;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

.mobile-right {
    display: none;
    align-items: center;
    gap: 14px;
}

/* MOBILE NAV */
.mobile-nav {
    display: none;
    flex-direction: column;
    align-items: center;
    background: #ffcb05;
    padding: 16px 0;
    width: 100%;
}

.mobile-nav a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    padding: 10px 20px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.mobile-nav a:hover {
    background: rgba(0,0,0,0.06);
}

/* Burger actif → menu visible */
.burger-toggle:checked ~ .mobile-nav {
    display: flex;
}

/* =====================
   ADMIN BANNER
===================== */
.admin-banner {
    width: 100%;
    background: #1a1a2e;
    color: #ffcb05;
    text-align: center;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: bold;
    box-sizing: border-box;
}

.admin-banner a {
    color: #ffcb05;
    text-decoration: underline;
}

.admin-banner a:hover { color: #fff; }

/* =====================
   FOOTER
===================== */
.site-footer {
    width: 100%;
    background: #1a1a2e;
    color: #ccc;
    margin-top: auto;
    box-sizing: border-box;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 30px;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: space-between;
}

.footer-brand {
    flex: 0 0 auto;
    min-width: 180px;
    text-align: right;
    order: 3;
}

.footer-logo {
    font-size: 20px;
    font-weight: bold;
    color: #ffcb05;
    margin-bottom: 10px;
}

.footer-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin: 0 0 14px;
}

.footer-instagram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
    margin-top: 12px;
    opacity: 0.7;
}

.footer-instagram:hover {
    opacity: 1;
}

.footer-nav {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-nav strong {
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.footer-nav a {
    color: #999;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-nav a:hover { color: #ffcb05; }

.footer-bottom {
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid #2d2d4e;
    font-size: 12px;
    color: #666;
}

/* =====================
   TABLE
===================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

th { background: #ffcb05; }

table tbody tr:hover { background: #fffbea; }

/* =====================
   IMAGES
===================== */
img {
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

/* =====================
   CHECK / ÉTATS
===================== */
.check { font-size: 18px; font-weight: bold; }
.owned     { color: #2ecc71; }
.not-owned { color: #bbb; }

/* =====================
   CARD IMAGE + BADGES
===================== */
.card-image-wrapper {
    position: relative;
    display: inline-block;
}

.card-badge {
    position: absolute;
    bottom: 3px;
    font-weight: bold;
    font-size: 9px;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    white-space: nowrap;
}

.card-image-wrapper .card-badge:nth-of-type(1) { left: 2px; }
.card-image-wrapper .card-badge:nth-of-type(2) { left: 22px; }
.card-image-wrapper .card-badge:nth-of-type(3) { left: 44px; }
.card-image-wrapper .card-badge:nth-of-type(4) { left: 66px; }

.card-badge.badge-H   { background: rgba(37,99,235,0.75);   color: #fff; }
.card-badge.badge-R   { background: rgba(220,38,38,0.75);   color: #fff; }
.card-badge.badge-S   { background: rgba(22,163,74,0.75);   color: #fff; }
.card-badge.badge-AR  { background: rgba(124,58,237,0.75);  color: #fff; }
.card-badge.badge-ALT { background: rgba(234,88,12,0.75);   color: #fff; }
.card-badge.badge-FA  { background: rgba(15,118,110,0.75);  color: #fff; }
.card-badge.badge-G   { background: rgba(161,130,0,0.9);    color: #fff; }

/* =====================
   CARD DETAIL
===================== */
.card-detail {
    display: flex;
    gap: 20px;
    background: #fff;
    padding: 20px;
    box-sizing: border-box;
}

.card-detail img { width: 300px; flex-shrink: 0; }
.card-detail > div { flex: 1; }

/* =====================
   FILTRES COLLECTION
===================== */
.filters-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filters-row select,
.filters-row input[type="text"] {
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    height: 37px;
    box-sizing: border-box;
}

.filters-row button,
.filters-row .btn-reset {
    padding: 0 16px;
    height: 37px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}

.filters-row button[type="submit"] { background: #ffcb05; }
.filters-row button[type="submit"]:hover { background: #f2c200; }

.btn-reset {
    background: #eee;
    color: #000;
    font-weight: bold;
    cursor: pointer;
}

.btn-reset:hover { background: #ddd; }

/* =====================
   COMPTEUR
===================== */
.result-count {
    font-size: 13px;
    color: #777;
    margin: 6px 0 12px;
}

/* =====================
   PAGINATION
===================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.pagination a {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    border-radius: 4px;
}

.pagination a.active {
    background: #ffcb05;
    border-color: #000;
}

/* =====================
   TRI ACTIF
===================== */
.sort-link { text-decoration: none; color: #000; }
.sort-link.sort-active { text-decoration: underline; font-weight: bold; }

/* =====================
   BTN CTA
===================== */
.btn-cta {
    display: inline-block;
    background: #ffcb05;
    color: #000;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none;
}

.btn-cta:hover { background: #f2c200; }

.btn-cta-outline {
    background: transparent;
    border: 2px solid #000;
    margin-left: 10px;
}

.btn-cta-outline:hover { background: rgba(0,0,0,0.08); }

.btn-link {
    display: inline-block;
    margin-top: 10px;
    color: #000;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid #ffcb05;
    padding-bottom: 2px;
}

.btn-link:hover { border-color: #000; }

/* =====================
   POPUP — DESIGN MODERNISÉ
===================== */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

.popup-overlay.active { display: flex; }

.popup-box {
    background: #fff;
    border-radius: 18px;
    max-width: 720px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    animation: popupIn 0.2s ease;
}

@keyframes popupIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 20px;
    cursor: pointer;
    background: #f0f0f0;
    border: none;
    color: #555;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.popup-close:hover { background: #e0e0e0; color: #000; }

/* Header du popup avec image en fond */
.popup-header {
    display: flex;
    gap: 0;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4e 100%);
    padding: 24px 20px;
    align-items: center;
    gap: 20px;
}

.popup-header img {
    width: 120px;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.popup-header-info {
    flex: 1;
}

.popup-header-info h2 {
    color: #fff;
    margin: 0 0 8px;
    font-size: 20px;
}

.popup-badges-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.popup-badge-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.popup-series-line {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* Corps du popup */
.popup-body {
    padding: 20px 24px;
}

.popup-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin-bottom: 16px;
}

.popup-info-item {
    font-size: 13px;
}

.popup-info-item strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.popup-info-item span {
    color: #000;
    font-weight: 500;
}

.popup-info-item a {
    color: #000;
    font-weight: bold;
}

.popup-admin-section {
    background: #fffbea;
    border: 1px solid #ffcb05;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
}

.popup-admin-section h4 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
}

.popup-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.popup-pv-positive { color: #16a34a; font-weight: bold; }
.popup-pv-negative { color: #dc2626; font-weight: bold; }

/* Footer popup */
.popup-footer {
    padding: 14px 24px 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eee;
}

.popup-nav-btn {
    padding: 8px 16px;
    background: #ffcb05;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-nav-btn:hover { background: #f2c200; }

.popup-nav-btn:disabled {
    background: #eee;
    color: #aaa;
    cursor: default;
}

.popup-share-btn {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.popup-share-btn:hover { background: #e0e0e0; color: #000; }

.popup-market-btn {
    padding: 8px 16px;
    background: #ffcb05;
    color: #000;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
}

.popup-market-btn:hover { background: #f2c200; }

/* =====================
   NAVIGATION CARTE
===================== */
.card-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 10px;
}

.card-nav-btn,
.card-nav-back {
    padding: 10px 20px;
    background: #ffcb05;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: inline-block;
}

.card-nav-btn:hover,
.card-nav-back:hover { background: #f2c200; }

.card-nav-btn.disabled {
    background: #eee;
    color: #aaa;
    cursor: default;
    pointer-events: none;
}

/* =====================
   ADMIN STATS
===================== */
.admin-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.stat-card {
    flex: 1;
    min-width: 160px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.stat-label {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value { font-size: 22px; font-weight: bold; color: #000; }
.stat-positive .stat-value { color: #2ecc71; }
.stat-negative .stat-value { color: #e74c3c; }

/* =====================
   PAGE MAJ COTES / GESTION
===================== */
.gestion-scroll {
    overflow-x: auto;
    margin-bottom: 16px;
}

.gestion-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
    min-width: 900px;
}

.gestion-table th,
.gestion-table td {
    border: 1px solid #ddd;
    padding: 7px 8px;
    vertical-align: middle;
}

.gestion-table th {
    background: #ffcb05;
    font-size: 12px;
    white-space: nowrap;
}

.gestion-input {
    width: 90px;
    padding: 5px 7px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}

.gestion-input-sm { width: 60px; }
.gestion-input:focus { border-color: #ffcb05; outline: none; }
.row-owned { background: #f0fff4; }

.btn-delete {
    background: #fee2e2;
    border: none;
    border-radius: 5px;
    color: #dc2626;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 13px;
}

.btn-delete:hover { background: #fca5a5; }

/* =====================
   AJOUTER UNE CARTE
===================== */
.add-card-panel {
    background: #fff;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.add-card-panel summary {
    padding: 14px 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    background: #ffcb05;
    list-style: none;
}

.add-card-panel summary::-webkit-details-marker { display: none; }
.add-card-panel[open] summary { border-bottom: 1px solid #eee; }

.add-card-form { padding: 20px; }

.add-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.add-field { display: flex; flex-direction: column; gap: 4px; }
.add-field-full { grid-column: 1 / -1; }

.add-field label {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.add-field input,
.add-field select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.add-field input:focus { border-color: #ffcb05; outline: none; }

/* =====================
   COTES ACTIONS
===================== */
.cotes-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 20px;
}

.cotes-table th,
.cotes-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.cotes-table th { background: #ffcb05; font-size: 13px; }

.cote-input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
    box-sizing: border-box;
}

.cote-input:focus { border-color: #ffcb05; outline: none; }

.cote-market-link {
    color: #000;
    font-weight: bold;
    text-decoration: none;
    background: #fff9d6;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.cote-market-link:hover { background: #ffcb05; }

.cotes-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-bottom: 30px;
}

.btn-save {
    padding: 12px 24px;
    background: #ffcb05;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.btn-save:hover { background: #f2c200; }

.btn-back-admin {
    color: #777;
    text-decoration: none;
    font-size: 13px;
}

.btn-back-admin:hover { color: #000; }

/* Alertes */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: bold;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error   { background: #f8d7da; color: #721c24; }

/* =====================
   HERO INDEX
===================== */
.hero-section {
    background: linear-gradient(135deg, #ffcb05 0%, #f5a800 100%);
    padding: 80px 20px;
    text-align: center;
}

.hero-content { max-width: 700px; margin: 0 auto; }

.hero-badge {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 16px;
}

.hero-section h1 {
    font-size: clamp(32px, 6vw, 56px);
    margin: 0 0 16px;
    color: #000;
}

.hero-subtitle {
    font-size: 16px;
    color: #333;
    margin-bottom: 28px;
    line-height: 1.6;
}

.hero-small { padding: 50px 20px; }
.hero-small h1 { font-size: clamp(24px, 4vw, 40px); }

/* =====================
   HOME STATS
===================== */
.home-stats {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.home-stat {
    flex: 1;
    min-width: 160px;
    text-align: center;
    padding: 20px 16px;
    border-right: 1px solid #eee;
}

.home-stat:last-child { border-right: none; }

.home-stat-value {
    font-size: 26px;
    font-weight: bold;
    color: #000;
}

.home-stat-label {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-stat-progress {
    flex: 2;
    min-width: 260px;
    text-align: left;
    padding: 20px 24px;
}

/* =====================
   PROGRESS BAR
===================== */
.progress-bar-outer {
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
    height: 22px;
    margin: 8px 0;
}

.progress-bar-inner {
    background: #ffcb05;
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
    min-width: 4px;
}

/* =====================
   HOME ABOUT
===================== */
.home-about {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
    display: flex;
    gap: 50px;
    align-items: flex-start;
    box-sizing: border-box;
}

.home-about-text { flex: 1; }
.home-about-text h2 { margin-top: 0; }
.home-about-text p { line-height: 1.7; color: #333; }

.home-cards-preview { flex: 1; }
.home-cards-preview h2 { margin-top: 0; }

.preview-links { display: flex; flex-direction: column; gap: 12px; }

.preview-link {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    text-decoration: none;
    color: #000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.preview-link:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }

.preview-icon { font-size: 24px; flex-shrink: 0; }

.preview-link strong { display: block; margin-bottom: 2px; }

.preview-link p { margin: 0; font-size: 12px; color: #777; }

/* =====================
   COLLECTION INTRO
===================== */
.collection-intro {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    border-left: 4px solid #ffcb05;
}

.collection-intro h1 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #000;
}

.collection-intro p { margin: 0; }

/* =====================
   À PROPOS
===================== */
.about-intro {
    max-width: 800px;
    margin: 30px auto;
    font-size: 16px;
    line-height: 1.75;
    color: #444;
    text-align: center;
}

.about-section {
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

.about-section h2 { font-size: 22px; margin-bottom: 20px; }

.about-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.about-card {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.about-card-icon { font-size: 26px; margin-bottom: 8px; }
.about-card strong { display: block; margin-bottom: 6px; font-size: 15px; }
.about-card p { font-size: 13px; color: #666; line-height: 1.6; margin: 0; }

.about-features { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

.about-feature {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.about-feature-icon { font-size: 24px; flex-shrink: 0; }
.about-feature strong { display: block; margin-bottom: 4px; }
.about-feature p { margin: 0; font-size: 13px; color: #666; }

.about-vision {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    line-height: 1.75;
    color: #333;
}

/* =====================
   CONTACT
===================== */
.contact-layout {
    display: flex;
    gap: 40px;
    margin: 36px 0;
    align-items: flex-start;
}

.contact-reasons { flex: 1; }
.contact-reasons h2 { margin-top: 0; }

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-list li {
    display: flex;
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    align-items: flex-start;
}

.contact-list li span { font-size: 22px; flex-shrink: 0; }
.contact-list li strong { display: block; margin-bottom: 4px; }
.contact-list li p { margin: 0; font-size: 13px; color: #666; }

.contact-instagram {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
}

.instagram-card {
    background: #fff;
    border-radius: 14px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.instagram-icon { font-size: 40px; margin-bottom: 12px; }
.instagram-card h2 { margin: 0 0 12px; font-size: 20px; }
.instagram-card p { font-size: 14px; color: #555; line-height: 1.6; margin-bottom: 20px; }
.instagram-note { margin-top: 16px !important; font-size: 12px !important; color: #999 !important; }

.contact-disclaimer {
    background: #fff8e1;
    border-left: 4px solid #ffcb05;
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    margin-bottom: 40px;
    font-size: 14px;
    color: #444;
    line-height: 1.7;
}

.contact-disclaimer h2 { margin-top: 0; font-size: 16px; }

/* =====================
   GUIDE PAGE
===================== */
.guide-page { max-width: 900px; }

.guide-toc {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 36px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.guide-toc ol { margin: 10px 0 0; padding-left: 20px; }
.guide-toc a { color: #000; text-decoration: none; font-weight: bold; }
.guide-toc a:hover { text-decoration: underline; }

.guide-section {
    margin-bottom: 48px;
    padding-bottom: 36px;
    border-bottom: 1px solid #eee;
}

.guide-section h2 { font-size: 22px; margin-bottom: 14px; color: #000; }
.guide-section h3 { font-size: 16px; margin: 20px 0 8px; }
.guide-section p, .guide-section li { line-height: 1.75; color: #333; }

.guide-tip {
    background: #fffbea;
    border-left: 4px solid #ffcb05;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
    font-size: 14px;
    color: #444;
}

.guide-versions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.guide-version-card {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 13px;
}

.guide-version-card p { font-size: 12px; color: #777; margin: 8px 0 0; }

.gvc-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    margin: 0 auto 10px;
}

.guide-grades {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.grade-item {
    flex: 1;
    min-width: 80px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.grade-item span {
    display: block;
    font-size: 11px;
    font-weight: normal;
    margin-top: 4px;
    opacity: 0.8;
}

.grade-10  { background: #ffd700; color: #000; }
.grade-9-5 { background: #ffdc00; color: #000; }
.grade-9   { background: #ffcb05; color: #000; }
.grade-8   { background: #eee;    color: #555; }

.guide-erreurs { padding-left: 0; list-style: none; }

.guide-erreurs li {
    background: #fff;
    border-left: 4px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
}

.guide-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.guide-link-card {
    flex: 1;
    min-width: 160px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    text-decoration: none;
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.guide-link-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    background: #fffbea;
}

.guide-link-card strong { display: block; margin-bottom: 4px; }
.guide-link-card span { font-size: 12px; color: #777; }

/* Loose vs gradée */
.loose-vs-grade {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.lvg-card {
    flex: 1;
    min-width: 260px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.lvg-header {
    padding: 14px 18px;
    font-weight: bold;
    font-size: 15px;
    color: #fff;
}

.lvg-loose .lvg-header  { background: #64748b; }
.lvg-grade .lvg-header  { background: #1a1a2e; }

.lvg-body {
    background: #fff;
    padding: 16px 18px;
    font-size: 13px;
    line-height: 1.65;
}

.lvg-body h4 { margin: 12px 0 6px; font-size: 13px; }
.lvg-body ul { margin: 0; padding-left: 18px; }
.lvg-body li { margin-bottom: 4px; color: #444; }

.lvg-conclusion {
    background: #fffbea;
    border: 1px solid #ffcb05;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.lvg-conclusion strong { display: block; margin-bottom: 8px; font-size: 15px; }

/* Protections */
.protection-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.protection-card {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.protection-icon { font-size: 28px; margin-bottom: 8px; }
.protection-card strong { display: block; margin-bottom: 6px; font-size: 14px; }
.protection-card p { font-size: 12px; color: #666; margin: 0; line-height: 1.5; }

/* Sociétés de gradation */
.grading-companies {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.grading-company {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.grading-company-badge {
    font-weight: bold;
    font-size: 13px;
    background: #1a1a2e;
    color: #ffcb05;
    padding: 6px 12px;
    border-radius: 6px;
    flex-shrink: 0;
    min-width: 60px;
    text-align: center;
}

.grading-company div p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #555;
    line-height: 1.55;
}

.grading-company div strong { font-size: 15px; }

/* Plateformes achats */
.plateformes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.plateforme-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: #000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: box-shadow 0.2s;
}

.plateforme-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    background: #fffbea;
}

.plateforme-card strong { font-size: 14px; }
.plateforme-card span { font-size: 12px; color: #777; }

/* =====================
   BADGE LEGEND À PROPOS
===================== */
.badge-legend {
    display: flex;
    gap: 16px;
    margin: 10px 0;
    align-items: center;
    flex-wrap: wrap;
}

.badge-legend > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-legend .card-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    min-width: 22px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
}

.badge-label { font-size: 13px; }

/* =====================
   HOME HERO
===================== */
.home-hero { padding-top: clamp(40px, 10vh, 180px); }

/* =====================
   RESPONSIVE — HEADER MOBILE
===================== */
@media (max-width: 768px) {

    .main-nav { display: none; }

    .mobile-right {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .burger-label { display: block; }

    .header-inner {
        justify-content: space-between;
        align-items: center;
    }
}

/* =====================
   RESPONSIVE — FILTRES MOBILE
===================== */
@media (max-width: 768px) {

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row select,
    .filters-row input[type="text"],
    .filters-row button,
    .btn-reset {
        width: 100%;
        box-sizing: border-box;
    }
}

/* =====================
   RESPONSIVE — TABLE MOBILE
===================== */
@media (max-width: 768px) {

    table { table-layout: fixed; }

    th, td { font-size: 12px; padding: 6px; }

    th:nth-child(1), td:nth-child(1) { width: 36px; }
    th:nth-child(2), td:nth-child(2) { width: 40px; }
    th:nth-child(3), td:nth-child(3) { width: 56px; }

    th:nth-child(5), td:nth-child(5),
    th:nth-child(6), td:nth-child(6),
    th:nth-child(7), td:nth-child(7) { display: none; }
}

/* =====================
   RESPONSIVE — CARD DETAIL MOBILE
===================== */
@media (max-width: 768px) {

    .card-detail {
        flex-direction: column;
        align-items: center;
    }

    .card-detail img { width: 100%; max-width: 300px; }
    .card-detail > div { width: 100%; }
}

/* =====================
   RESPONSIVE — POPUP MOBILE (DRAWER iOS-SAFE)
===================== */
@media (max-width: 600px) {

    .popup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    /* Le popup prend toute la hauteur sauf 60px pour le safe-area iOS */
    .popup-box {
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-width: 100%;
        /* Hauteur fixe : viewport moins la barre de statut iOS */
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Pad en bas pour le safe-area iPhone */
        padding-bottom: env(safe-area-inset-bottom, 16px);
        box-sizing: border-box;
    }

    /* Poignée visuelle */
    .popup-box::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(0,0,0,0.15);
        border-radius: 2px;
        margin: 10px auto 0;
    }

    .popup-header {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 14px 16px 10px;
        gap: 14px;
    }

    .popup-header img {
        width: 75px;
        flex-shrink: 0;
    }

    .popup-header-info h2 { font-size: 15px; }

    .popup-body { padding: 10px 16px; }

    .popup-info-grid { grid-template-columns: 1fr 1fr; }
    .popup-admin-grid { grid-template-columns: 1fr; }

    .popup-footer {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px 20px;
    }

    .popup-nav-btn,
    .popup-share-btn,
    .popup-market-btn {
        flex: 1;
        text-align: center;
        min-width: 75px;
        font-size: 12px;
        padding: 8px 8px;
    }

    /* Bouton fermer toujours visible */
    .popup-close {
        position: sticky;
        top: 10px;
        float: right;
        margin: 10px 12px 0 0;
        width: 28px;
        height: 28px;
        font-size: 16px;
        z-index: 10;
    }
}

/* =====================
   RESPONSIVE — HERO + ABOUT
===================== */
@media (max-width: 768px) {

    .hero-section { padding: 50px 20px; }

    .btn-cta-outline {
        margin-left: 0;
        margin-top: 10px;
        display: block;
        width: fit-content;
        margin: 10px auto 0;
    }

    .home-stats { flex-direction: column; }

    .home-stat {
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .home-stat-progress { min-width: auto; }

    .home-about {
        flex-direction: column;
        gap: 30px;
        padding: 30px 20px;
    }

    .about-grid { flex-direction: column; }

    .contact-layout { flex-direction: column; }
    .contact-instagram { flex: none; width: 100%; }
    .instagram-card { position: static; }

    .footer-inner { flex-direction: column; gap: 24px; }

    .guide-versions { flex-direction: column; }
    .guide-links { flex-direction: column; }
    .loose-vs-grade { flex-direction: column; }
    .protection-grid { flex-direction: column; }
    .plateformes-grid { grid-template-columns: 1fr 1fr; }
}

/* =====================
   RESPONSIVE — ADMIN
===================== */
@media (max-width: 768px) {

    .admin-stats { flex-direction: column; }

    .card-nav {
        flex-direction: column;
        text-align: center;
    }

    .card-nav-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .add-card-grid {
        grid-template-columns: 1fr;
    }

    .grading-company {
        flex-direction: column;
        gap: 8px;
    }
}

/* =====================
   FIL D'ARIANE (BREADCRUMB)
===================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #777;
    margin: 12px 0 4px;
}

.breadcrumb a {
    color: #777;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #000;
    text-decoration: underline;
}

.breadcrumb span {
    color: #bbb;
}

/* =====================
   PAGE STATISTIQUES PUBLIQUES
===================== */
.stats-kpi {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.kpi-card {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kpi-value {
    font-size: 32px;
    font-weight: bold;
    color: #000;
    line-height: 1;
    margin-bottom: 8px;
}

.kpi-label {
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-section {
    margin-bottom: 48px;
}

.stats-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

/* Badges grid */
.stats-badges-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.stats-badge-card {
    flex: 1;
    min-width: 100px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.stats-badge-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: #fff;
    margin: 0 auto 10px;
}

.stats-badge-label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
}

.stats-badge-count {
    font-size: 22px;
    font-weight: bold;
    color: #000;
    line-height: 1;
}

.stats-badge-pct {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Barres */
.stats-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-bar-label {
    width: 50px;
    font-size: 12px;
    color: #555;
    text-align: right;
    flex-shrink: 0;
}

.stats-bar-label-long {
    width: 220px;
    text-align: left;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-rank {
    display: inline-block;
    background: #ffcb05;
    color: #000;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 11px;
    margin-right: 6px;
    flex-shrink: 0;
}

.stats-bar-track {
    flex: 1;
    background: #eee;
    border-radius: 999px;
    height: 18px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    background: #1a1a2e;
    border-radius: 999px;
    transition: width 0.8s ease;
}

.stats-bar-value {
    width: 30px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-align: left;
    flex-shrink: 0;
}

/* =====================
   RESPONSIVE STATS
===================== */
@media (max-width: 768px) {
    .stats-kpi { flex-direction: column; }
    .stats-badges-grid { flex-direction: column; }
    .stats-bar-label-long { width: 120px; }
}

/* =====================
   INDICATEUR RARETÉ LIGNES
===================== */
tr.row-gold  { background: rgba(161,130,0,0.06) !important; }
tr.row-fa    { background: rgba(15,118,110,0.05) !important; }
tr.row-alt   { background: rgba(234,88,12,0.05) !important; }
tr.row-ar    { background: rgba(124,58,237,0.05) !important; }

tr.row-gold:hover  { background: rgba(161,130,0,0.12) !important; }
tr.row-fa:hover    { background: rgba(15,118,110,0.10) !important; }
tr.row-alt:hover   { background: rgba(234,88,12,0.10) !important; }
tr.row-ar:hover    { background: rgba(124,58,237,0.10) !important; }

/* =====================
   TOGGLE COLLECTION ADMIN
===================== */
.btn-toggle {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-on {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.toggle-on:hover { background: #c3e6cb; }

.toggle-off {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.toggle-off:hover { background: #f5c6cb; }

@media (max-width: 768px) {
    .footer-brand { text-align: left; flex: 0 0 100%; order: 3; }
}

/* =====================
   POPUP ITEM SECTION
===================== */
.popup-item-inner {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #eee;
}

.popup-item-inner .popup-info-item strong {
    color: #333;
}

/* =====================
   PAGE TÉLÉCHARGEMENT
===================== */
.download-layout {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    align-items: flex-start;
}

.download-info {
    flex: 1;
}

.download-info h2 { margin-top: 0; }
.download-info h3 { margin-top: 24px; }

.download-features {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-features li {
    font-size: 14px;
    color: #333;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.download-cta-wrap {
    flex: 0 0 280px;
    position: sticky;
    top: 20px;
}

.download-cta-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.download-cta-card h2 { margin: 0 0 6px; font-size: 18px; }

@media (max-width: 768px) {
    .download-layout {
        flex-direction: column;
    }

    .download-cta-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
}

/* =====================
   PAGE CARTE (card.php) — identique au popup
===================== */
.card-page-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 12px;
}
