/* ═══════════════════════════════════════════════════════════════
   OpusWebcam V2.0 - Module Inventaire
   Fichier: inventory.css
   Description: Styles spécifiques pour la gestion d'inventaire
   Style: Glassmorphism (fonds semi-transparents + texte clair)
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   HEADER & CONTRÔLES
   ─────────────────────────────────────────────────────────────── */
.inventory-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
}

#tab-inventory .inventory-header h4,
.inventory-header h4 {
    color: #fff !important;
    font-weight: 700 !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 1.4rem !important;
}

#tab-inventory .inventory-controls,
.inventory-header .inventory-controls {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
}

/* View Selector - Style inspiré du Pokédex */
#tab-inventory .view-selector,
.inventory-header .view-selector {
    display: flex !important;
    gap: 8px !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

#tab-inventory .view-selector button,
.inventory-header .view-selector button {
    background: var(--gray-700, #374151) !important;
    border: 2px solid var(--gray-600, #4b5563) !important;
    color: var(--gray-300, #d1d5db) !important;
    padding: 8px 16px !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#tab-inventory .view-selector button:hover,
.inventory-header .view-selector button:hover {
    border-color: var(--primary, #667eea) !important;
    color: var(--primary, #667eea) !important;
    transform: translateY(-1px) !important;
}

#tab-inventory .view-selector button.active,
.inventory-header .view-selector button.active {
    background: #374151 !important;
    border: 2px solid #667eea !important;
    padding: 8px 16px !important;
    color: #667eea !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

/* Search Input - Spécifique pour override */
#tab-inventory #inventorySearchInput,
.inventory-header #inventorySearchInput,
#tab-inventory .inventory-controls input[type="search"],
.inventory-header .inventory-controls input[type="search"] {
    flex: 1 !important;
    min-width: 150px !important;
    max-width: 350px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
}

#tab-inventory #inventorySearchInput::placeholder,
.inventory-header #inventorySearchInput::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

#tab-inventory #inventorySearchInput:focus,
.inventory-header #inventorySearchInput:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    outline: none !important;
}

/* Controls buttons - Plus spécifique pour override modern-overlay.css */
#tab-inventory .inventory-controls .btn,
.inventory-header .inventory-controls .btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

#tab-inventory .inventory-controls .btn:hover,
.inventory-header .inventory-controls .btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
}

#tab-inventory .inventory-controls .btn-outline-primary,
.inventory-header .inventory-controls .btn-outline-primary {
    background: transparent !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
    color: #a8b8ff !important;
}

#tab-inventory .inventory-controls .btn-outline-primary:hover,
.inventory-header .inventory-controls .btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

#tab-inventory .inventory-controls .btn-outline-secondary,
.inventory-header .inventory-controls .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

#tab-inventory .inventory-controls .btn-outline-secondary:hover,
.inventory-header .inventory-controls .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
}

#tab-inventory .inventory-controls .btn-group,
.inventory-header .inventory-controls .btn-group {
    margin-left: auto !important;
    display: flex !important;
    gap: 8px !important;
}

#tab-inventory .inventory-controls .btn-group .btn,
.inventory-header .inventory-controls .btn-group .btn {
    background: var(--gray-700, #374151) !important;
    border: 2px solid var(--gray-600, #4b5563) !important;
    color: var(--gray-300, #d1d5db) !important;
    padding: 8px 16px !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

#tab-inventory .inventory-controls .btn-group .btn:hover,
.inventory-header .inventory-controls .btn-group .btn:hover,
#tab-inventory .inventory-controls .btn-group .btn.btn-outline-primary:hover,
#tab-inventory .inventory-controls .btn-group .btn.btn-outline-secondary:hover,
.inventory-header .inventory-controls .btn-group .btn.btn-outline-primary:hover,
.inventory-header .inventory-controls .btn-group .btn.btn-outline-secondary:hover {
    background: #374151 !important;
    border-color: #667eea !important;
    color: #667eea !important;
    transform: translateY(-1px) !important;
}

#tab-inventory .inventory-controls .dropdown-menu,
.inventory-header .inventory-controls .dropdown-menu {
    background: rgba(30, 30, 40, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

#tab-inventory .inventory-controls .dropdown-item,
.inventory-header .inventory-controls .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    background: transparent !important;
    border-radius: 8px !important;
    padding: 10px 16px !important;
    transition: all 0.2s !important;
}

#tab-inventory .inventory-controls .dropdown-item:hover,
#tab-inventory .inventory-controls .dropdown-item:focus,
.inventory-header .inventory-controls .dropdown-item:hover {
    background: rgba(102, 126, 234, 0.25) !important;
    color: #fff !important;
}

/* ───────────────────────────────────────────────────────────────
   GRILLE DE CARTES
   ─────────────────────────────────────────────────────────────── */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
    max-height: 900px;
    overflow-y: auto;
    align-content: start;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar */
.inventory-grid::-webkit-scrollbar {
    width: 8px;
}

.inventory-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.inventory-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.inventory-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

@container (max-width: 600px) {
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
}

/* ───────────────────────────────────────────────────────────────
   CARTES GALERIE - NOUVEAU DESIGN
   ─────────────────────────────────────────────────────────────── */
#tab-inventory .inventory-card,
.inventory-grid .inventory-card {
    position: relative !important;
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
}

#tab-inventory .inventory-card:hover,
.inventory-grid .inventory-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(102, 126, 234, 0.3) !important;
}

#tab-inventory .inventory-card.stock-zero,
.inventory-grid .inventory-card.stock-zero {
    opacity: 0.4 !important;
    filter: grayscale(70%) !important;
}

/* Image wrapper avec overlay */
#tab-inventory .card-image-wrapper,
.inventory-grid .card-image-wrapper {
    position: relative !important;
    aspect-ratio: 5/7 !important;
    overflow: hidden !important;
    background: rgba(0, 0, 0, 0.2) !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
}

#tab-inventory .card-image-wrapper img,
.inventory-grid .card-image-wrapper img {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease !important;
    border-radius: 0 !important;
}

#tab-inventory .inventory-card:hover .card-image-wrapper img,
.inventory-grid .inventory-card:hover .card-image-wrapper img {
    transform: scale(1.05) !important;
}

/* Overlay sur l'image */
#tab-inventory .card-overlay,
.inventory-grid .card-overlay {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 8px !important;
    pointer-events: none !important;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.5) 100%
    ) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

#tab-inventory .inventory-card:hover .card-overlay,
.inventory-grid .inventory-card:hover .card-overlay {
    opacity: 1 !important;
}

.overlay-top, .overlay-bottom {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
}

.overlay-bottom {
    align-items: flex-end !important;
}

/* Badges sur l'image */
.gallery-qty-badge {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.gallery-sale-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Badge À vendre toujours visible */
.gallery-sale-badge-fixed {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    z-index: 5 !important;
}

.gallery-value {
    background: rgba(16, 185, 129, 0.9) !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Panel d'info sous l'image */
#tab-inventory .card-info-panel,
.inventory-grid .card-info-panel {
    padding: 10px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    flex: 1 !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

.card-info-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.card-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 6px !important;
}

#tab-inventory .inventory-card .card-name,
.inventory-grid .inventory-card .card-name {
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex: 1 !important;
    margin: 0 !important;
}

.gallery-card-num {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

#tab-inventory .inventory-card .card-series,
.inventory-grid .inventory-card .card-series {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.72rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Footer avec badges */
.card-info-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: auto !important;
}

.card-badges-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px !important;
}

.card-langs {
    display: flex !important;
    gap: 3px !important;
}

.gallery-lang-badge {
    font-size: 0.7rem !important;
    background: rgba(255, 255, 255, 0.08) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
}

.gallery-cond-badge {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.gallery-stored-badge {
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    text-align: center !important;
}

.gallery-stored-badge.all {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.gallery-stored-badge.partial {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* ───────────────────────────────────────────────────────────────
   VUE TABLEAU
   ─────────────────────────────────────────────────────────────── */
.inventory-table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.inventory-table,
.inventory-table-container .table,
#inventoryCon .table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03) !important;
    --bs-table-hover-bg: rgba(102, 126, 234, 0.1) !important;
    --bs-table-color: rgba(255, 255, 255, 0.85) !important;
}

.inventory-table th,
.inventory-table-container .table th,
#inventoryCon .table th {
    background: rgba(102, 126, 234, 0.15) !important;
    border-bottom: 2px solid rgba(102, 126, 234, 0.4) !important;
    border-top: none !important;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9) !important;
    text-align: left;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inventory-table td,
.inventory-table-container .table td,
#inventoryCon .table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-top: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
    background: transparent !important;
}

.inventory-table tbody tr,
.inventory-table-container .table tbody tr,
#inventoryCon .table tbody tr {
    background: transparent !important;
}

.inventory-table tbody tr:nth-of-type(odd),
.inventory-table-container .table-striped tbody tr:nth-of-type(odd),
#inventoryCon .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02) !important;
}

.inventory-table tbody tr:nth-of-type(even),
.inventory-table-container .table-striped tbody tr:nth-of-type(even),
#inventoryCon .table-striped tbody tr:nth-of-type(even) {
    background: transparent !important;
}

/* Table cell content */
.inventory-table .card-name-cell strong,
.inventory-table .card-name,
#inventoryCon .table .card-name-cell strong {
    color: #fff !important;
    font-weight: 700;
}

.inventory-table .card-name-cell small,
.inventory-table .card-name-cell .text-muted,
.inventory-table .card-series,
#inventoryCon .table .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.inventory-row,
#inventoryCon .table tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.inventory-row:hover,
#inventoryCon .table tbody tr:hover,
.inventory-table-container .table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.table-card-image {
    width: 60px;
    height: 84px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Stock Badge */
.stock-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--success);
    color: white;
    border-radius: var(--border-radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.stock-badge.stock-zero {
    background: var(--danger);
}

/* Condition Badges */
.condition-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.condition-M { background: #d4edda; color: #155724; }
.condition-NM { background: #d1ecf1; color: #0c5460; }
.condition-EX { background: #cce5ff; color: #004085; }
.condition-LP { background: #fff3cd; color: #856404; }
.condition-MP { background: #f8d7da; color: #721c24; }
.condition-HP { background: #f5c6cb; color: #721c24; }
.condition-DMG { background: #d1d1d1; color: #383838; }

/* Rarity Badges */
.rarity-badge {
    display: inline-block !important;
    padding: 2px 8px !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.rarity-common { background: #e9ecef !important; color: #495057 !important; }
.rarity-uncommon { background: #d1f2eb !important; color: #0c6b58 !important; }
.rarity-rare { background: #ffeaa7 !important; color: #6c5a0d !important; }
.rarity-holo { background: linear-gradient(135deg, #e17055, #fab1a0) !important; color: white !important; }
.rarity-ultra { background: linear-gradient(135deg, #a29bfe, #6c5ce7) !important; color: white !important; }
.rarity-secret {
    background: linear-gradient(135deg, #fd79a8, #a29bfe) !important;
    color: white !important;
    font-weight: 700 !important;
}

/* ───────────────────────────────────────────────────────────────
   LISTE D'OBJETS
   ─────────────────────────────────────────────────────────────── */
.inventory-objects-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
}

.inventory-object {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.inventory-object:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary, #667eea);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.object-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.object-info {
    flex: 1;
}

.object-name {
    font-weight: 600;
    color: #fff;
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.object-details {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xs);
}

.object-set {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.object-type {
    background: var(--primary, #667eea);
    color: white;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.sealed-badge {
    background: linear-gradient(135deg, var(--success), #20c997);
    color: white;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.object-location {
    color: #a8b8ff;
    font-size: 0.875rem;
    font-style: italic;
}

.object-quantity {
    display: flex;
    align-items: center;
}

.quantity-display {
    font-size: 2rem;
    font-weight: 700;
    color: #a8b8ff;
    min-width: 60px;
    text-align: center;
}

/* ───────────────────────────────────────────────────────────────
   MODAL DÉTAIL
   ─────────────────────────────────────────────────────────────── */
.inventory-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-xl);
    width: 95%;
    max-width: 1050px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalAppear 0.3s ease-out;
}

/* Modal inventaire - largeur adaptée pour les 2 colonnes */
.inventory-detail-modal .modal-content {
    max-width: 780px !important;
    width: 95% !important;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-base);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-xl);
    padding: var(--space-xl);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* Modal inventaire - grille optimisée */
.inventory-detail-modal .modal-body {
    grid-template-columns: 280px minmax(0, 400px) !important;
    gap: var(--space-md) !important;
    padding: var(--space-md) !important;
    justify-content: center;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
}

.modal-image {
    text-align: center;
    max-width: 280px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image img {
    width: 100%;
    max-width: 260px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-width: 0; /* Permet le shrink pour éviter overflow */
    overflow: hidden;
}

.detail-section {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-md);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 0; /* Permet le shrink pour éviter overflow */
    overflow: hidden;
}

.detail-section h5 {
    margin: 0 0 var(--space-sm) 0;
    color: #a8b8ff;
    font-size: 1rem;
}

.form-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    min-width: 0; /* Permet le shrink */
}

.form-row label {
    min-width: 90px;
    max-width: 90px;
    flex-shrink: 0;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.form-row .form-control {
    flex: 1;
    min-width: 0; /* Permet le shrink */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 10px;
}

.form-row .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* Textarea ne doit pas dépasser */
.form-row textarea.form-control {
    max-width: 100%;
    resize: vertical;
    box-sizing: border-box;
}

/* Stock Info (lecture seule) - sur une ligne */
.stock-info-row {
    margin-bottom: 8px !important;
}

.stock-info {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.stock-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 5px;
    padding: 3px 7px;
}

.stock-info-label {
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.stock-info-value {
    font-weight: 600;
    color: #a8b8ff;
    min-width: 16px;
    text-align: center;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

/* ───────────────────────────────────────────────────────────────
   INFORMATIONS SOUS LA PHOTO
   ─────────────────────────────────────────────────────────────── */
.card-info-summary {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    color: #fff;
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: var(--space-sm);
}

.rarity-value {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    display: inline-block;
}

/* Rarity value colors based on data-rarity attribute */
.rarity-value[data-rarity="common"] {
    background: #e9ecef;
    color: #495057;
}

.rarity-value[data-rarity="uncommon"] {
    background: #d1f2eb;
    color: #0c6b58;
}

.rarity-value[data-rarity="rare"] {
    background: #ffeaa7;
    color: #6c5a0d;
}

.rarity-value[data-rarity="holo"],
.rarity-value[data-rarity="holorare"] {
    background: linear-gradient(135deg, #e17055, #fab1a0);
    color: white;
}

.rarity-value[data-rarity="ultra"],
.rarity-value[data-rarity="ultrarare"] {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white;
}

.rarity-value[data-rarity="secret"],
.rarity-value[data-rarity="secretrare"] {
    background: linear-gradient(135deg, #fd79a8, #a29bfe);
    color: white;
    font-weight: 700;
}

/* ───────────────────────────────────────────────────────────────
   SECTION ACHAT (colonne gauche) - Style detail-section
   ─────────────────────────────────────────────────────────────── */
.purchase-section-left {
    margin-top: var(--space-sm);
    width: 100%;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Override h5 pour section Achat - couleur violette comme les autres */
.purchase-section-left h5 {
    color: #a8b8ff !important;
}

.purchase-section-left h5::before {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

/* Input group pour prix */
.purchase-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.purchase-input-group .form-control {
    flex: 1;
    max-width: 100px;
}

/* Profit row */
.purchase-section-left .profit-value {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
}

.purchase-section-left .profit-value.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.purchase-section-left .profit-value.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Style pour input date dans la section achat */
.purchase-section-left input[type="date"].form-control {
    max-width: 140px;
    color-scheme: dark;
}

.purchase-section-left input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* ───────────────────────────────────────────────────────────────
   PRIX MARCHÉ
   ─────────────────────────────────────────────────────────────── */
.market-price-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 2px solid var(--primary, #667eea);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-md);
}

.price-trends {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.trend-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.trend-value {
    font-weight: 700;
    color: #fff;
}

.price-meta {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: var(--space-md);
    font-size: 0.875rem;
}

.collection-value {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    text-align: center;
    font-size: 1.125rem;
    color: #fff;
}

/* ───────────────────────────────────────────────────────────────
   STATS SUMMARY
   ─────────────────────────────────────────────────────────────── */
.stats-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card-v2 {
    flex: 1;
    min-width: 140px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card-v2:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stat-card-v2 .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card-v2 .stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ───────────────────────────────────────────────────────────────
   FILTRES INVENTAIRE
   ─────────────────────────────────────────────────────────────── */
.inventory-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    padding: 8px 0;
    background: transparent;
    border: none;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
}

.filter-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 2px;
}

.filter-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.4);
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.filter-select option {
    background: #1e1e2e;
    color: #fff;
    padding: 8px;
}

.filter-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 14px;
    color: #f87171;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Style select quand filtre actif */
.filter-select.active {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.15);
}

/* Bouton ordre de tri */
.sort-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.sort-order-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #fff;
}

.sort-order-btn.asc {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #667eea;
}

/* Champ recherche dans la barre de filtres */
.inventory-filters .filter-search {
    flex: 1;
    min-width: 150px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.85rem;
    margin-left: auto;
}

.inventory-filters .filter-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.inventory-filters .filter-search:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* ───────────────────────────────────────────────────────────────
   SÉPARATEURS DE SÉRIES
   ─────────────────────────────────────────────────────────────── */
.series-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 16px 0;
    padding: 0 4px;
}

.series-separator:first-child {
    margin-top: 0;
}

.series-separator-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 4px 0;
}

.series-separator-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(102, 126, 234, 0.5) 0%,
        rgba(102, 126, 234, 0.1) 100%);
}

/* ───────────────────────────────────────────────────────────────
   EMPTY STATE
   ─────────────────────────────────────────────────────────────── */
#inventoryCon .empty-state {
    text-align: center;
    padding: 80px 40px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#inventoryCon .empty-state h4 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

#inventoryCon .empty-state p {
    color: rgba(255, 255, 255, 0.5);
    max-width: 400px;
    margin: 0 auto 24px;
    font-size: 1rem;
}

#inventoryCon .empty-state .btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#inventoryCon .empty-state .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ───────────────────────────────────────────────────────────────
   VALUES MODULE - Cartes de valeurs manuelles
   ─────────────────────────────────────────────────────────────── */

.price-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2px 0;
}

.price-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.price-value {
    font-weight: 600;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   VALUES MODULE V4.0 - Multi-Category Collection Value
   ═══════════════════════════════════════════════════════════════ */

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-total {
    color: #10b981;
    font-weight: 700;
    font-size: 1rem;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* ───────────────────────────────────────────────────────────────
   MODALE HISTORIQUE DES PRIX
   ─────────────────────────────────────────────────────────────── */
#priceHistoryModal .modal-dialog {
    width: 420px !important;
    max-width: 95vw !important;
    margin: 1.75rem auto;
}

#priceHistoryModal .modal-content {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 100%;
}

#priceHistoryModal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
}

#priceHistoryModal .modal-body {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#priceHistoryModal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
}

/* Table simplifiee */
#priceHistoryModal .table {
    margin-bottom: 0;
    font-size: 0.8rem;
    width: 100%;
    table-layout: fixed;
}

#priceHistoryModal .table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 4px;
}

#priceHistoryModal .table td {
    vertical-align: middle;
    padding: 6px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#priceHistoryModal .table th:first-child,
#priceHistoryModal .table td:first-child {
    width: 45%;
}

#priceHistoryModal .table th:nth-child(2),
#priceHistoryModal .table td:nth-child(2) {
    width: 25%;
}

#priceHistoryModal .table th:last-child,
#priceHistoryModal .table td:last-child {
    width: 30%;
}

#priceHistoryModal .table .badge {
    font-size: 0.65rem;
    padding: 3px 6px;
}

/* ───────────────────────────────────────────────────────────────
   LOCATION DROPDOWN - Sélecteur d'emplacement intelligent
   ─────────────────────────────────────────────────────────────── */
.location-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(30, 35, 45, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    margin-bottom: 4px;
}

.location-group {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.location-group:last-child {
    border-bottom: none;
}

.location-group-header {
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
}

.location-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-option:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #fff;
}

.location-option:active {
    background: rgba(102, 126, 234, 0.35);
}

.location-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.location-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* Scrollbar du dropdown */
.location-dropdown::-webkit-scrollbar {
    width: 6px;
}

.location-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.location-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.location-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL DE SELECTION DES COPIES
   ═══════════════════════════════════════════════════════════════ */

.copies-modal-content {
    max-width: 600px;
}

.copies-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.copies-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.copies-list::-webkit-scrollbar {
    width: 5px;
}

.copies-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.copies-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

.copy-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.copy-number {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    min-width: 32px;
    flex-shrink: 0;
}

.copy-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.copy-location {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
}

.copy-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.copy-meta .condition-badge,
.copy-meta .language-badge,
.copy-meta .edition-badge {
    font-size: 0.75rem;
    padding: 2px 6px;
}

.copy-notes {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.language-badge {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.edition-badge {
    background: rgba(155, 89, 182, 0.3);
    color: #9b59b6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.copy-edit-btn {
    flex-shrink: 0;
}

.btn-add-copy {
    padding: 10px 25px;
}

/* Badge pour les cartes multi-exemplaires */
.stock-multi {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   MULTI-COPY SUMMARY DANS MODAL PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */

.multi-copy-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0 15px 0;
}

.multi-copy-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 15px;
}

.multi-copy-summary .summary-row:last-child {
    border-bottom: none;
}

.multi-copy-summary .summary-row label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 100px;
}

.multi-copy-summary .summary-row > div {
    flex: 1;
    text-align: right;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.multi-copy-summary .locations-summary {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
}

.multi-copy-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.multi-copy-actions .btn-add-copy-from-detail {
    flex: 1;
}

.btn-manage-copies {
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Total value styling */
.collection-value {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(39, 174, 96, 0.15) 100%);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-value strong {
    color: rgba(255, 255, 255, 0.8);
}

.collection-value .total-value {
    color: #2ecc71;
    font-weight: 700;
    font-size: 1.1em;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL DE GESTION DES COPIES - STYLES COMPLETS
   Classes dédiées pour éviter les conflits avec les autres modals
   ═══════════════════════════════════════════════════════════════ */

#copiesManagementModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1100 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

#copiesManagementModal .copies-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 1 !important;
}

#copiesManagementModal .copies-modal-content {
    position: relative !important;
    z-index: 2 !important;
    background: #1a1a24 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    width: 400px !important;
    max-width: 90vw !important;
    max-height: 75vh !important;
    overflow: hidden !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    flex-direction: column !important;
}

#copiesManagementModal .copies-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    flex-shrink: 0 !important;
    border-radius: 12px 12px 0 0 !important;
}

#copiesManagementModal .copies-modal-header h4 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #fff !important;
}

#copiesManagementModal .copies-modal-header .modal-close-btn {
    background: none !important;
    border: none !important;
    color: #fff !important;
    font-size: 1.4rem !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    opacity: 0.8 !important;
}

#copiesManagementModal .copies-modal-body {
    padding: 16px !important;
    overflow-y: auto !important;
    flex: 1 !important;
}

#copiesManagementModal .copies-modal-footer {
    padding: 10px 16px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(0, 0, 0, 0.2) !important;
    flex-shrink: 0 !important;
    border-radius: 0 0 12px 12px !important;
}

/* Card header */
#copiesManagementModal .copies-card-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border: 1px solid rgba(102, 126, 234, 0.15) !important;
    border-radius: 8px !important;
    margin-bottom: 14px !important;
}

#copiesManagementModal .copies-card-thumb {
    width: 45px !important;
    height: 63px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
}

#copiesManagementModal .copies-card-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
}

#copiesManagementModal .copies-card-name {
    color: #fff !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

#copiesManagementModal .copies-card-meta {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.75rem !important;
}

/* List header */
#copiesManagementModal .copies-list-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#copiesManagementModal .copies-list-header > span {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.8rem !important;
}

#copiesManagementModal .copies-list-header .btn-add-copy {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
}

/* Copies list */
#copiesManagementModal .copies-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    max-height: 250px !important;
    overflow-y: auto !important;
}

/* Individual copy item */
#copiesManagementModal .copy-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

#copiesManagementModal .copy-item:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.2) !important;
}

#copiesManagementModal .copy-number {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #667eea !important;
    width: 24px !important;
    flex-shrink: 0 !important;
}

#copiesManagementModal .copy-details {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    min-width: 0 !important;
}

#copiesManagementModal .copy-meta {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
}

#copiesManagementModal .copy-meta .condition-badge,
#copiesManagementModal .copy-meta .language-badge,
#copiesManagementModal .copy-meta .edition-badge {
    font-size: 0.65rem !important;
    padding: 1px 4px !important;
}

#copiesManagementModal .copy-location {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

#copiesManagementModal .copy-location .text-muted {
    color: rgba(255, 255, 255, 0.4) !important;
    font-style: italic !important;
}

#copiesManagementModal .copy-notes {
    font-size: 0.7rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic !important;
}

#copiesManagementModal .copy-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

#copiesManagementModal .copy-actions .btn {
    padding: 4px 6px !important;
    font-size: 0.7rem !important;
    border-radius: 4px !important;
    min-width: auto !important;
}

#copiesManagementModal .copy-actions .btn-outline-primary {
    background: rgba(52, 152, 219, 0.1) !important;
    border: 1px solid rgba(52, 152, 219, 0.25) !important;
    color: #3498db !important;
}

#copiesManagementModal .copy-actions .btn-outline-danger {
    background: rgba(231, 76, 60, 0.1) !important;
    border: 1px solid rgba(231, 76, 60, 0.25) !important;
    color: #e74c3c !important;
}

/* Legacy copy-actions outside modal */
.copy-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.copy-actions .btn {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 5px;
}

.copy-actions .btn-outline-primary {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.copy-actions .btn-outline-primary:hover {
    background: rgba(52, 152, 219, 0.3);
}

.copy-actions .btn-outline-danger {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.copy-actions .btn-outline-danger:hover {
    background: rgba(231, 76, 60, 0.3);
}
/* ───────────────────────────────────────────────────────────────
   SECTION ACHAT & PLUS-VALUE
   ─────────────────────────────────────────────────────────────── */

/* Section Achat dans le modal */
.detail-section h5:has(+ .form-row:has(#modalPurchasePrice)),
.detail-section h5:contains("💵") {
    color: #f0c14b;
}

/* Champ prix d'achat */
#modalPurchasePrice {
    font-weight: 600;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 0 6px 6px 0;
}

/* Ligne plus-value dans la section Achat */
.purchase-profit {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.profit-value {
    font-weight: 700;
    font-size: 1.1em;
}

/* Affichage plus-value dans la section prix marché */
.purchase-profit-display {
    margin-top: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.purchase-profit-display.profit-positive {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(40, 167, 69, 0.1));
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.purchase-profit-display.profit-negative {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(220, 53, 69, 0.1));
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.profit-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.profit-amount {
    font-size: 1.15em;
}

/* Couleurs plus-value */
.profit-positive,
.profit-positive .profit-amount {
    color: #28a745;
}

.profit-negative,
.profit-negative .profit-amount {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 576px) {
    .purchase-profit-display {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* Style pour le prix d'achat dans la liste des copies */
.purchase-info {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(155, 89, 182, 0.1));
    border: 1px solid rgba(155, 89, 182, 0.4);
    color: #bb8fce;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   VUE GROUPÉE - Cartes multi-exemplaires avec expand/collapse
   ═══════════════════════════════════════════════════════════════ */

.inv-grouped-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    max-height: 900px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar */
.inv-grouped-container::-webkit-scrollbar {
    width: 8px;
}

.inv-grouped-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.inv-grouped-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.inv-grouped-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Card groupée (ligne principale) */
.inv-grouped-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.inv-grouped-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
}

.inv-grouped-card.expanded {
    background: rgba(102, 126, 234, 0.08);
    border-color: rgba(102, 126, 234, 0.4);
}

/* Header de la carte groupée */
.inv-grouped-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    min-height: 70px;
}

.inv-grouped-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Infos de la carte */
.inv-grouped-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inv-grouped-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Métadonnées (langues, conditions) */
.inv-grouped-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.inv-grouped-langs {
    display: flex;
    gap: 2px;
}

.inv-grouped-lang {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    object-fit: cover;
}

/* Quantité */
.inv-grouped-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Valeur totale */
.inv-grouped-value {
    color: #10b981;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

/* Badges (à vendre) */
.inv-grouped-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Bouton expand */
.inv-grouped-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.inv-grouped-chevron {
    font-size: 1rem;
    transition: transform 0.2s ease;
    color: rgba(255, 255, 255, 0.5);
}

.inv-grouped-card.expanded .inv-grouped-chevron {
    transform: rotate(180deg);
}

/* Section des copies (masquée par défaut) */
.inv-grouped-copies {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px 12px 16px;
    margin-left: 62px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.inv-grouped-copies.show {
    display: flex;
}

/* Ligne individuelle de copie */
.inv-grouped-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inv-grouped-copy:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.25);
}

/* Numéro de copie */
.inv-grouped-copy-num {
    font-weight: 700;
    color: #667eea;
    font-size: 0.85rem;
    min-width: 24px;
    flex-shrink: 0;
}

/* Langue de la copie */
.inv-grouped-copy-lang {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Condition de la copie */
.inv-grouped-copy-cond {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Prix de la copie */
.inv-grouped-copy-price {
    color: #10b981;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 60px;
    text-align: right;
}

/* Emplacement de la copie */
.inv-grouped-copy-loc {
    flex: 1;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges de la copie */
.inv-grouped-copy-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.inv-grouped-forsale {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Actions sur la copie */
.inv-grouped-copy-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.inv-grouped-copy:hover .inv-grouped-copy-actions {
    opacity: 1;
}

.inv-grouped-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inv-grouped-copy-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    color: #fff;
}

.inv-grouped-copy-btn.sale-btn {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.inv-grouped-copy-btn.sale-btn:hover {
    background: rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .inv-grouped-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .inv-grouped-info {
        width: calc(100% - 70px);
    }

    .inv-grouped-qty,
    .inv-grouped-value,
    .inv-grouped-badges {
        margin-left: 62px;
    }

    .inv-grouped-copies {
        margin-left: 0;
    }

    .inv-grouped-copy {
        flex-wrap: wrap;
    }

    .inv-grouped-copy-loc {
        width: 100%;
        margin-top: 4px;
    }

    .inv-grouped-copy-actions {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION À VENDRE - Modal détail carte
   ═══════════════════════════════════════════════════════════════ */

.forsale-section {
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    padding-top: 15px;
    margin-top: 10px;
}

.forsale-section h5 {
    color: #f59e0b !important;
}

/* Toggle switch style - Style unifié avec gamification */
.forsale-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forsale-switch {
    position: relative !important;
    display: inline-block !important;
    width: 52px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.forsale-switch input,
.forsale-switch input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    display: none !important;
}

.forsale-slider {
    position: absolute !important;
    cursor: pointer !important;
    top: 0 !important;
    left: 0 !important;
    width: 52px !important;
    height: 28px !important;
    background-color: #4a4a5a !important;
    border-radius: 28px !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
}

.forsale-slider::before {
    position: absolute !important;
    content: "" !important;
    height: 22px !important;
    width: 22px !important;
    left: 3px !important;
    top: 3px !important;
    background-color: #999 !important;
    border-radius: 50% !important;
    transition: transform 0.3s ease, background-color 0.3s ease !important;
}

/* Masquer tout ::after potentiel */
.forsale-switch::after,
.forsale-slider::after {
    display: none !important;
    content: none !important;
}

.forsale-switch input:checked + .forsale-slider {
    background-color: #22c55e !important;
}

.forsale-switch input:checked + .forsale-slider::before {
    transform: translateX(24px) !important;
    background-color: #fff !important;
}

.forsale-status {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    transition: color 0.3s;
}

.forsale-status.active {
    color: #f59e0b;
    font-weight: 600;
}

/* Détails vente (cachés par défaut si non en vente) */
.forsale-details {
    transition: opacity 0.3s, max-height 0.3s;
}

.forsale-details.hidden {
    opacity: 0.4;
    pointer-events: none;
}

