/* ======================================================================= */
/* DESIGN SYSTEM CHANV OFFICIAL (HEADER UNIFORMITY) — Studio Chanv         */
/* ======================================================================= */
:root {
    --chanv-blanc: #FFFFFF;
    --chanv-beige: #DDCBA4;
    --chanv-fibre: #F1EADA;
    --chanv-terre: #282828;
    --chanv-dore: #C9A96E;
    --shadow-soft: 0 4px 20px rgba(40, 40, 40, 0.05);
    --shadow-bold: 0 12px 40px rgba(40, 40, 40, 0.1);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--chanv-blanc);
    background-image: radial-gradient(var(--chanv-fibre) 1px, transparent 1px);
    background-size: 40px 40px;
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: var(--chanv-terre);
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; }

/* --- LOGIN GATE --- */
#login-overlay, #blocked-overlay {
    position: fixed;
    inset: 0;
    background: var(--chanv-fibre);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-card {
    background: white;
    padding: 50px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-bold);
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: loginSlideUp 0.5s ease;
}

@keyframes loginSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.main-logo-login {
    height: 50px;
    margin-bottom: 25px;
}

.login-card h2 {
    font-family: 'Outfit', sans-serif;
    margin: 0 0 10px;
    color: var(--chanv-terre);
}

.login-card p {
    color: #777;
    margin-bottom: 25px;
    font-size: 14px;
}

.btn-login-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    background: var(--chanv-beige);
    color: var(--chanv-terre);
    font-weight: 700;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login-google:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201,169,110,0.3);
}

.login-error-text {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 15px;
}

/* --- HEADER --- */
.main-header {
    background: var(--chanv-terre);
    color: var(--chanv-blanc);
    padding: 40px 20px 90px;
    position: relative;
    overflow: hidden;
}

.main-header::after {
    content: "";
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--chanv-blanc);
    transform: skewY(-2deg);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

.header-titles h1 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.header-titles p {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 4px;
    opacity: 0.7;
}

.logo-wrapper {
    text-decoration: none;
    display: flex;
    align-items: center;
    background: var(--chanv-fibre);
    padding: 12px 18px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    flex-shrink: 0;
}

.logo-wrapper:hover {
    filter: brightness(0.97);
    box-shadow: var(--shadow-bold);
}

.main-logo {
    height: 40px;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

/* --- HEADER USER SECTION --- */
.header-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-details {
    text-align: right;
}

.header-user-section .user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.header-user-section .user-role {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(229, 62, 62, 0.25);
    color: #fff;
}

/* --- TABS --- */
.nav-tab {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 16px;
    font-weight: 700;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    font-size: 14px;
}

.nav-tab:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.nav-tab.active {
    background-color: var(--chanv-beige) !important;
    color: var(--chanv-terre) !important;
}

.tab-content {
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- AVATAR-BURGER BUTTON --- */
.avatar-burger-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.avatar-burger-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--transition);
}
.avatar-burger-btn:hover .avatar-burger-inner {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.avatar-burger-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    transition: var(--transition);
}
.avatar-burger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 16px;
}
.avatar-burger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    transition: var(--transition);
}
.avatar-burger-icon span:nth-child(2) { width: 70%; }
.avatar-burger-btn:hover .avatar-burger-icon span { background: white; }
.avatar-burger-btn:hover .avatar-burger-icon span:nth-child(2) { width: 100%; }

/* ======================================================================= */
/* GALLERY TOOLBAR                                                         */
/* ======================================================================= */

/* ======================================================================= */
/* HERO SEARCH BAR                                                         */
/* ======================================================================= */

.search-hero {
    margin-bottom: 20px;
}

.search-hero .search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 16px;
    padding: 0 20px;
    border: 1.5px solid var(--chanv-fibre);
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.search-hero .search-wrapper:focus-within {
    border-color: var(--chanv-beige);
    box-shadow: 0 0 0 3px rgba(221, 203, 164, 0.25), 0 4px 20px rgba(201, 169, 110, 0.12);
}

.search-hero .search-icon {
    font-size: 18px;
    opacity: 0.35;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-hero .search-input {
    border: none;
    background: transparent;
    padding: 16px 0;
    font-size: 15px;
    font-family: inherit;
    color: var(--chanv-terre);
    outline: none !important;
    box-shadow: none !important;
    flex: 1;
    width: 100%;
    -webkit-appearance: none;
}

.search-hero .search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Kill browser autofill blue/yellow tint */
.search-hero .search-input:-webkit-autofill,
.search-hero .search-input:-webkit-autofill:hover,
.search-hero .search-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    -webkit-text-fill-color: var(--chanv-terre) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.search-hero .search-input::placeholder {
    color: rgba(40,40,40,0.3);
}

/* Search bar row layout */
.search-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.search-bar-row .search-wrapper {
    flex: 1;
    max-width: 700px;
}

/* Clear / Reset search button (✕) */
.search-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: rgba(40, 40, 40, 0.3);
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    font-family: inherit;
}

.search-clear-btn:hover {
    color: var(--chanv-terre);
    background: rgba(40, 40, 40, 0.06);
}

/* ─── Premium Asset Placeholder (no thumbnail) ─── */
.asset-placeholder-premium {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #f8f4ec 0%, #fef9f0 50%, #f0e8d8 100%);
    position: relative;
    overflow: hidden;
}

.asset-placeholder-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(221,203,164,0.15) 0%, transparent 60%);
    animation: placeholderGlow 6s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes placeholderGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.2); }
}

.asset-placeholder-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #DDCBA4, #b8976a, #282828);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
}

.asset-placeholder-format {
    font-size: 11px;
    font-weight: 600;
    color: rgba(40, 40, 40, 0.35);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* AI Toggle (ON/OFF switch inside search bar) */
.ai-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px 4px 6px;
    border-radius: 20px;
    transition: var(--transition);
    user-select: none;
    flex-shrink: 0;
    border-left: 1px solid var(--chanv-fibre, #e8e0d4);
    margin-left: 4px;
}

.ai-toggle input[type="checkbox"] {
    display: none;
}

.ai-toggle-slider {
    width: 30px;
    height: 16px;
    background: rgba(139, 115, 85, 0.18);
    border-radius: 8px;
    position: relative;
    transition: background 0.3s ease;
}

.ai-toggle-slider::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.ai-toggle input:checked + .ai-toggle-slider {
    background: var(--chanv-dore, #c9a96e);
}

.ai-toggle input:checked + .ai-toggle-slider::after {
    transform: translateX(14px);
}

.ai-toggle-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(139, 115, 85, 0.35);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.ai-toggle input:checked ~ .ai-toggle-label {
    color: var(--chanv-dore, #c9a96e);
}

/* Search Go Button — premium beige */
.search-go-btn {
    padding: 14px 28px;
    background: var(--chanv-beige, #DDCBA4);
    color: var(--chanv-terre, #282828);
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.search-go-btn:hover {
    background: var(--chanv-dore, #c9a96e);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35);
}

/* Upload button — far right, prominent */
.upload-quick-btn {
    background: var(--chanv-terre, #282828);
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 14px 28px;
    border-radius: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: white;
    flex-shrink: 0;
    margin-left: auto;
}

.upload-btn-label {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.upload-quick-btn:hover {
    background: var(--chanv-dore, #c9a96e);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35);
}

.upload-quick-btn:hover .upload-btn-label {
    color: white;
}

/* ======================================================================= */
/* SECONDARY TOOLBAR (compact, below category explorer)                    */
/* ======================================================================= */

.gallery-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--chanv-fibre);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Active filter chips */
.active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--chanv-terre);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: slideUp 0.2s ease;
}

.filter-chip-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.filter-chip-close:hover {
    color: white;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    color: var(--chanv-terre);
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--chanv-beige);
}

.toolbar-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: var(--chanv-fibre);
    border-color: var(--chanv-beige);
}

.toolbar-btn.active {
    background: var(--chanv-beige);
    border-color: var(--chanv-beige);
}

.view-toggle {
    display: flex;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.view-btn.active {
    background: var(--chanv-beige);
    color: var(--chanv-terre);
}

.view-btn:hover:not(.active) {
    background: var(--chanv-fibre);
}

/* ======================================================================= */
/* AI SEARCH RESULT INFO                                                   */
/* ======================================================================= */

.ai-search-result-info {
    margin-bottom: 12px;
    padding: 8px 4px;
    animation: slideUp 0.3s ease;
}

.ai-search-result-info .ai-result-count {
    font-size: 13px;
    color: rgba(40, 40, 40, 0.45);
    font-weight: 500;
}

.ai-load-more-btn {
    display: block;
    margin: 24px auto;
    padding: 14px 36px;
    background: var(--chanv-beige, #DDCBA4);
    color: var(--chanv-terre, #282828);
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.ai-load-more-btn:hover {
    background: var(--chanv-dore, #c9a96e);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35);
}

/* ======================================================================= */
/* GALLERY GRID                                                            */
/* ======================================================================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    min-height: 200px;
}

.gallery-grid.list-view {
    grid-template-columns: 1fr;
}

/* ─── Gallery Loading: Skeleton Shimmer Grid ─── */
.gallery-loading {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 0;
    width: 100%;
}

.gallery-loading--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(40,40,40,0.4);
    gap: 12px;
}

.skeleton-card {
    background: white;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    border: 1px solid rgba(225, 216, 198, 0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #f0ebe4 0%, #e8e0d5 100%);
    position: relative;
    overflow: hidden;
}

.skeleton-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(221, 203, 164, 0.25) 30%,
        rgba(221, 203, 164, 0.45) 50%,
        rgba(221, 203, 164, 0.25) 70%,
        transparent 100%
    );
    animation: skeletonShimmer 1.8s ease-in-out infinite;
    transform: translateX(-100%);
}

.skeleton-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f0ebe4 0%, #e8e0d5 100%);
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(221, 203, 164, 0.3) 50%,
        transparent 100%
    );
    animation: skeletonShimmer 1.8s ease-in-out infinite;
    transform: translateX(-100%);
}

.skeleton-line--short { width: 60%; }
.skeleton-line--medium { width: 80%; }

/* Staggered animation for each card */
.skeleton-card:nth-child(1) .skeleton-thumb::after,
.skeleton-card:nth-child(1) .skeleton-line::after { animation-delay: 0s; }
.skeleton-card:nth-child(2) .skeleton-thumb::after,
.skeleton-card:nth-child(2) .skeleton-line::after { animation-delay: 0.1s; }
.skeleton-card:nth-child(3) .skeleton-thumb::after,
.skeleton-card:nth-child(3) .skeleton-line::after { animation-delay: 0.2s; }
.skeleton-card:nth-child(4) .skeleton-thumb::after,
.skeleton-card:nth-child(4) .skeleton-line::after { animation-delay: 0.3s; }
.skeleton-card:nth-child(5) .skeleton-thumb::after,
.skeleton-card:nth-child(5) .skeleton-line::after { animation-delay: 0.4s; }
.skeleton-card:nth-child(6) .skeleton-thumb::after,
.skeleton-card:nth-child(6) .skeleton-line::after { animation-delay: 0.5s; }
.skeleton-card:nth-child(7) .skeleton-thumb::after,
.skeleton-card:nth-child(7) .skeleton-line::after { animation-delay: 0.6s; }
.skeleton-card:nth-child(8) .skeleton-thumb::after,
.skeleton-card:nth-child(8) .skeleton-line::after { animation-delay: 0.7s; }

@keyframes skeletonShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Keep basic spinner for scroll-loading and modals */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--chanv-fibre);
    border-top-color: var(--chanv-beige);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: rgba(40,40,40,0.4);
}

.gallery-empty p {
    font-size: 16px;
    margin: 8px 0;
}

/* ─── Asset Card ─── */
.asset-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    cursor: pointer;
    transition: var(--transition);
    animation: slideUp 0.3s ease backwards;
    position: relative;
}

.asset-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-bold);
    border-color: var(--chanv-beige);
}

.asset-card-thumb {
    position: relative;
    height: 180px;
    background: var(--chanv-fibre);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.asset-card:hover .asset-card-thumb img {
    transform: scale(1.05);
}

.asset-card-thumb .video-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.asset-card-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.asset-card:hover .asset-card-fav {
    opacity: 1;
}

.asset-card-fav.active {
    opacity: 1;
    background: var(--chanv-beige);
}

.asset-card-body {
    padding: 14px 16px;
}

.asset-card-name {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 6px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(40,40,40,0.5);
    margin-bottom: 8px;
}

.asset-card-meta .format-badge {
    background: var(--chanv-fibre);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    color: var(--chanv-terre);
}

.asset-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.asset-card-tags .tag {
    background: var(--chanv-fibre);
    color: rgba(40,40,40,0.6);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
}

.asset-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
}

.official-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
    letter-spacing: 0.3px;
}

.download-count {
    font-size: 12px;
    color: rgba(40,40,40,0.4);
    display: flex;
    align-items: center;
    gap: 4px;
}

.asset-card-hidden {
    opacity: 0.5;
    border-style: dashed;
}

/* ─── List View ─── */
.gallery-grid.list-view .asset-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
}

.gallery-grid.list-view .asset-card-thumb {
    height: 70px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.gallery-grid.list-view .asset-card-body {
    padding: 10px 16px;
}

.gallery-grid.list-view .asset-card-footer {
    padding: 10px 16px;
    flex-direction: column;
    gap: 4px;
}

/* ======================================================================= */
/* PAGINATION                                                              */
/* ======================================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 0;
}

.page-btn {
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    color: var(--chanv-terre);
}

.page-btn:hover:not(:disabled) {
    background: var(--chanv-fibre);
    border-color: var(--chanv-beige);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-number {
    width: 38px;
    height: 38px;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-number:hover {
    background: var(--chanv-fibre);
}

.page-number.active {
    background: var(--chanv-beige);
    border-color: var(--chanv-beige);
    color: var(--chanv-terre);
}

/* ======================================================================= */
/* LIGHTBOX                                                                */
/* ======================================================================= */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-content {
    display: flex;
    max-width: 90vw;
    max-height: 90vh;
    gap: 24px;
    align-items: flex-start;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shift lightbox left when AI Studio panel is open */
.lightbox-overlay.ai-panel-open .lightbox-content {
    transform: translateX(-220px);
}

.lightbox-media {
    flex: 1;
    max-width: 70vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.lightbox-media video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
}

.lightbox-info {
    width: 320px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    max-height: 80vh;
    overflow-y: auto;
}

.lightbox-info h3 {
    font-size: 18px;
    margin: 0 0 16px;
    line-height: 1.3;
}

.lightbox-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
}

.lightbox-info .info-label {
    color: rgba(255,255,255,0.5);
}

.lightbox-info .info-value {
    font-weight: 600;
}

.lightbox-info .info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.lightbox-info .info-tag {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.lightbox-info .info-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.lightbox-info .info-actions button {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.lightbox-info .info-actions button:hover {
    background: rgba(255,255,255,0.15);
}

.lightbox-info .info-actions .btn-download {
    background: var(--chanv-beige);
    color: var(--chanv-terre);
    border: none;
}

.lightbox-info .info-actions .btn-download:hover {
    background: var(--chanv-dore);
}

.lightbox-ai-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin: 0 0 16px;
    line-height: 1.5;
}

.lightbox-people {
    margin: 0 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.lightbox-people-label {
    font-size: 14px;
}

.lightbox-people-pill {
    padding: 3px 10px;
    background: rgba(79,172,254,0.2);
    color: #4facfe;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.lightbox-people-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin: 0 0 12px;
    line-height: 1.4;
    font-style: italic;
}

.lightbox-colors {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.lightbox-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-color-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.4);
}

.lightbox-edit-form {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.lightbox-edit-form label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    display: block;
    margin-bottom: 4px;
}

.lightbox-edit-form input,
.lightbox-edit-form select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    box-sizing: border-box;
}

.lightbox-edit-form .edit-save {
    flex: 1;
    padding: 8px;
    background: var(--chanv-dore);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.lightbox-edit-form .edit-cancel {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* ======================================================================= */
/* SECTIONS                                                                */
/* ======================================================================= */

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
}

.section-subtitle {
    font-size: 14px;
    color: rgba(40,40,40,0.5);
    margin: 0;
}

.section-header .btn-primary {
    flex-shrink: 0;
    margin-top: 12px;
}

/* ======================================================================= */
/* ASSET COUNTER                                                           */
/* ======================================================================= */

.asset-counter {
    font-size: 12px;
    font-weight: 700;
    color: rgba(40,40,40,0.35);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ======================================================================= */
/* HIDDEN BUTTON (Eye)                                                     */
/* ======================================================================= */

.toolbar-btn--hidden {
    width: auto;
    padding: 0 10px;
    gap: 4px;
    font-size: 12px;
}

.toolbar-btn--hidden .hidden-label {
    font-size: 11px;
    font-weight: 600;
}

.toolbar-btn--hidden.active {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.3);
    color: #b45309;
}

/* ======================================================================= */
/* SCROLL LOADING                                                          */
/* ======================================================================= */

.scroll-loading {
    text-align: center;
    padding: 24px;
}

.scroll-loading .spinner {
    margin: 0 auto 8px;
}

.scroll-loading p {
    font-size: 13px;
    color: rgba(40,40,40,0.4);
}

/* ======================================================================= */
/* PROJECTS (ex-Collections)                                               */
/* ======================================================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.project-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    cursor: pointer;
    transition: var(--transition);
    animation: slideUp 0.3s ease backwards;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-bold);
    border-color: var(--chanv-beige);
}

.project-card-cover {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--chanv-fibre), var(--chanv-beige));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-cover-name {
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 800;
    letter-spacing: -0.5px;
    text-align: center;
    padding: 0 20px;
    line-height: 1.2;
    background: linear-gradient(135deg, #DDCBA4 0%, #b8976a 25%, #282828 55%, #DDCBA4 80%, #b8976a 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: projectNameShift 8s ease-in-out infinite alternate;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-cover-name--lg {
    font-size: clamp(28px, 5vw, 44px);
    white-space: normal;
    word-break: break-word;
}

@keyframes projectNameShift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.project-card-body {
    padding: 18px 20px;
}

.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project-card h3 {
    font-size: 17px;
    margin: 0;
    font-weight: 700;
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.project-status-badge.en-cours { background: rgba(34,197,94,0.1); color: #16a34a; }
.project-status-badge.en-pause { background: rgba(245,158,11,0.1); color: #b45309; }
.project-status-badge.termine { background: rgba(107,114,128,0.1); color: #6b7280; }
.project-status-badge.brouillon { background: rgba(147,197,253,0.1); color: #3b82f6; }

.project-card-desc {
    font-size: 13px;
    color: rgba(40,40,40,0.5);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.project-card-meta span {
    font-size: 12px;
    color: rgba(40,40,40,0.4);
}

.project-card-platforms {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

.platform-pill {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    background: var(--chanv-fibre);
    color: rgba(40,40,40,0.6);
}

.project-card-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.project-card-thumbs img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--chanv-fibre);
}

/* ── Project Detail View ── */
.project-detail-header {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    overflow: hidden;
    margin-bottom: 24px;
}

.project-detail-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--chanv-fibre), var(--chanv-beige));
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-detail-info {
    padding: 24px 28px;
}

.project-detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.project-detail-info h2 {
    font-size: 24px;
    margin: 0;
}

.project-detail-brief {
    font-size: 14px;
    color: rgba(40,40,40,0.6);
    line-height: 1.6;
    margin: 0 0 16px;
}

.project-detail-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.project-detail-meta .meta-item {
    font-size: 13px;
    color: rgba(40,40,40,0.5);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ── AI Agent Button (prominent) ── */
.btn-ai-agent {
    background: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc);
    background-size: 200% 200%;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35), 0 0 0 0 rgba(168, 85, 247, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: aiAgentGradient 3s ease infinite, aiAgentPulse 2.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-ai-agent::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-ai-agent:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45), 0 0 20px rgba(168, 85, 247, 0.3);
}

.btn-ai-agent:hover::before {
    opacity: 1;
}

.btn-ai-agent:active {
    transform: translateY(0) scale(0.98);
}

@keyframes aiAgentGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes aiAgentPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35), 0 0 0 0 rgba(168, 85, 247, 0.4); }
    50% { box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35), 0 0 0 6px rgba(168, 85, 247, 0); }
}

/* ── AI Agent overlay badge on project asset cards ── */
.project-asset-ai-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    z-index: 5;
    background: linear-gradient(135deg, rgba(124,58,237,0.9), rgba(168,85,247,0.9));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
}

.asset-card:hover .project-asset-ai-badge {
    opacity: 1;
}

.role-notice {
    background: rgba(201,169,110,0.08);
    color: rgba(40,40,40,0.5);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    margin-top: 16px;
}

.project-detail-assets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.project-detail-assets-header h3 {
    font-size: 18px;
    margin: 0;
}

.btn-back-projects {
    position: sticky;
    top: 0;
    z-index: 10;
    display: block;
    width: fit-content;
    padding: 10px 18px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 1px solid var(--chanv-fibre);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.btn-back-projects:hover { background: var(--chanv-fibre); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

@media (max-width: 600px) {
    .projects-grid { grid-template-columns: 1fr; }
    .project-card-cover { height: 100px; }
    .project-detail-cover { height: 140px; }
}

/* ======================================================================= */
/* BRAND GUIDE — Multi-marque                                              */
/* ======================================================================= */

.brand-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.brand-tab-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 32px 24px 28px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.brand-tab-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent 70%);
    z-index: 1;
}

.brand-tab-card:hover::before {
    opacity: 1;
}

.brand-tab-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.brand-tab-card.active {
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-3px);
    box-shadow: 0 16px 50px rgba(0,0,0,0.25);
}

.brand-tab-card .brand-logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 3px;
    margin: 0;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.brand-tab-card .brand-logo-img {
    position: relative;
    z-index: 2;
    max-height: 60px;
    max-width: 80%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
    transition: all 0.4s ease;
}

.brand-tab-card:hover .brand-logo-img {
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
    transform: scale(1.05);
}

.brand-tab-card .brand-active-indicator {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 12px rgba(255,255,255,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.brand-tab-card.active .brand-active-indicator {
    opacity: 1;
}

.brand-tab-card .brand-decorative {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    opacity: 0.08;
    z-index: 0;
    transition: all 0.4s ease;
}

.brand-tab-card:hover .brand-decorative {
    opacity: 0.14;
    transform: scale(1.2);
}

/* Brand active content */
.brand-active-content {
    animation: fadeIn 0.2s ease-in-out;
}

/* ─── Brand Book Reference ─── */
.brand-book-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    padding: 24px 28px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-book-icon {
    width: 64px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.brand-book-info {
    flex: 1;
}

.brand-book-info h4 {
    font-size: 16px;
    margin: 0 0 4px;
    font-family: 'Outfit', sans-serif;
}

.brand-book-info p {
    font-size: 13px;
    color: rgba(40,40,40,0.5);
    margin: 0;
}

.brand-book-btn {
    padding: 10px 20px;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    background: white;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    color: var(--chanv-terre);
}

.brand-book-btn:hover {
    background: var(--chanv-fibre);
    border-color: var(--chanv-beige);
}

.brand-book-empty {
    opacity: 0.4;
    font-style: italic;
    font-size: 13px;
}

/* ─── Brand Section ─── */
.brand-section {
    margin-bottom: 36px;
}

.brand-section h3 {
    font-size: 20px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--chanv-fibre);
}

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

.color-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    cursor: pointer;
    transition: var(--transition);
}

.color-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-bold);
}

.color-swatch {
    height: 80px;
    transition: var(--transition);
}

.color-card:hover .color-swatch {
    height: 90px;
}

.color-card-body {
    padding: 12px 16px;
}

.color-card-body .color-name {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 4px;
}

.color-card-body .color-hex {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: rgba(40,40,40,0.5);
    margin: 0 0 2px;
}

.color-card-body .color-usage {
    font-size: 12px;
    color: rgba(40,40,40,0.4);
    margin: 0;
}

.color-copied-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--chanv-terre);
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10001;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-bold);
}

.typo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.typo-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    padding: 28px;
}

.typo-card h4 {
    margin: 0 0 4px;
    font-size: 16px;
}

.typo-card .typo-usage {
    font-size: 12px;
    color: rgba(40,40,40,0.5);
    margin: 0 0 20px;
}

.typo-preview {
    line-height: 1.5;
}

.typo-preview .weight-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--chanv-fibre);
}

.typo-preview .weight-label {
    font-size: 12px;
    color: rgba(40,40,40,0.4);
    width: 60px;
}

.typo-preview .weight-sample {
    font-size: 18px;
    flex: 1;
}

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

.rule-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rule-do, .rule-dont {
    font-size: 13px;
    line-height: 1.5;
}

.rule-do::before {
    content: '✅ ';
    font-size: 14px;
}

.rule-dont::before {
    content: '❌ ';
    font-size: 14px;
}

/* ======================================================================= */
/* UPLOAD — PREMIUM                                                        */
/* ======================================================================= */

.upload-dropzone {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(250,247,240,0.95));
    border: 2px dashed var(--chanv-beige);
    border-radius: var(--radius-lg);
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.upload-dropzone::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--chanv-dore), var(--chanv-beige), transparent, var(--chanv-dore));
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.upload-dropzone:hover::before,
.upload-dropzone.drag-over::before {
    opacity: 1;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.upload-dropzone.drag-over {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.upload-dropzone-inner {
    padding: 48px 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.upload-dropzone-icon {
    color: var(--chanv-dore);
    margin-bottom: 16px;
    transition: transform 0.3s;
}

.upload-dropzone:hover .upload-dropzone-icon,
.upload-dropzone.drag-over .upload-dropzone-icon {
    transform: translateY(-8px);
}

.upload-dropzone.drag-over .upload-dropzone-icon {
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(-8px); }
    50% { transform: translateY(-16px); }
}

.upload-dropzone-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--chanv-terre);
    margin: 0 0 6px;
}

.upload-dropzone-subtitle {
    font-size: 13px;
    color: rgba(40,40,40,0.4);
    margin: 0 0 24px;
}

.upload-dropzone-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-upload-files,
.btn-upload-folder {
    padding: 10px 24px;
    border-radius: 12px;
    border: 1.5px solid var(--chanv-beige);
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-upload-files:hover { background: var(--chanv-fibre); border-color: var(--chanv-dore); }
.btn-upload-folder:hover { background: var(--chanv-fibre); border-color: var(--chanv-dore); }

/* ── Toolbar ── */
.upload-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    margin-top: 16px;
}

.upload-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--chanv-terre);
}

.btn-clear-queue {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(220,38,38,0.2);
    background: rgba(220,38,38,0.05);
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-queue:hover { background: rgba(220,38,38,0.1); }

/* ── Global Progress ── */
.upload-global-progress {
    margin-top: 16px;
    padding: 14px 18px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
}

.upload-global-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-global-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--chanv-fibre);
    border-radius: 3px;
    overflow: hidden;
}

.upload-global-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--chanv-beige), var(--chanv-dore));
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.upload-global-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Queue Items ── */
.upload-queue {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.upload-item {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeSlideUp 0.25s ease both;
    transition: all 0.2s;
}

.upload-item:hover { transform: translateX(3px); }

.upload-item--success { border-left: 3px solid #16a34a; }
.upload-item--error { border-left: 3px solid #dc2626; background: rgba(220,38,38,0.02); }
.upload-item--duplicate { border-left: 3px solid #FF8C00; background: rgba(255,140,0,0.04); opacity: 0.7; }
.upload-item--uploading { border-left: 3px solid var(--chanv-dore); }
.upload-item-dup { font-size: 16px; color: #FF8C00; }

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Thumbnail */
.upload-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--chanv-fibre);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-item-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.upload-thumb-emoji {
    font-size: 22px;
}

/* Info */
.upload-item-info {
    flex: 1;
    min-width: 0;
}

.upload-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--chanv-terre);
    border: none;
    background: transparent;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 4px;
    width: 100%;
    transition: background 0.2s;
}

.upload-item-name:hover:not(:disabled) { background: var(--chanv-fibre); }
.upload-item-name:focus { background: var(--chanv-fibre); outline: 1px solid var(--chanv-beige); }
.upload-item-name:disabled { color: var(--chanv-terre); }

.upload-item-meta {
    font-size: 11px;
    color: rgba(40,40,40,0.4);
    margin-top: 2px;
}

/* Progress */
.upload-item-progress {
    width: 100%;
    height: 3px;
    background: var(--chanv-fibre);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.upload-item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--chanv-beige), var(--chanv-dore));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* AI Sort result */
.upload-item-sort {
    font-size: 11px;
    color: rgba(40,40,40,0.6);
    margin-top: 4px;
}

.sort-tag {
    display: inline-block;
    padding: 1px 8px;
    background: rgba(79,172,254,0.1);
    color: #4facfe;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
}

.sort-tag.brand {
    background: rgba(var(--chanv-dore-rgb, 180,155,80), 0.12);
    color: var(--chanv-dore);
}

/* Error */
.upload-item-error {
    font-size: 11px;
    color: #dc2626;
    margin-top: 3px;
}

/* Actions */
.upload-item-actions {
    flex-shrink: 0;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(220,38,38,0.06);
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-item-remove:hover { background: rgba(220,38,38,0.15); transform: scale(1.1); }

.upload-item-check { color: #16a34a; font-size: 18px; font-weight: 700; }
.upload-item-fail { color: #dc2626; font-size: 18px; font-weight: 700; }

.upload-item-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--chanv-fibre);
    border-top-color: var(--chanv-dore);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Submit Button ── */
.btn-upload-submit {
    width: 100%;
    margin-top: 18px;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--chanv-terre), #1a1a1a);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.btn-upload-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.btn-upload-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-upload-submit-icon {
    font-size: 20px;
}

.btn-upload-submit-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
}

/* ── Summary ── */
.upload-summary {
    margin-top: 18px;
    padding: 20px 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
}

.upload-summary-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.upload-summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.upload-summary-icon.success {
    background: rgba(22,163,74,0.1);
    color: #16a34a;
}

.upload-summary-icon.partial {
    background: rgba(245,158,11,0.1);
}

.upload-summary h3 {
    font-size: 16px;
    margin: 0;
}

.upload-summary-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-summary-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--chanv-fibre);
    border-radius: 8px;
    font-size: 13px;
}

.upload-summary-path { font-weight: 600; }
.upload-summary-count { color: rgba(40,40,40,0.5); font-size: 12px; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .upload-dropzone-inner { padding: 32px 16px; }
    .upload-dropzone-title { font-size: 16px; }
    .upload-dropzone-buttons { flex-direction: column; }
    .btn-upload-files, .btn-upload-folder { width: 100%; justify-content: center; }
    .upload-item { padding: 10px 12px; gap: 10px; }
    .upload-item-thumb { width: 40px; height: 40px; }
}

/* ======================================================================= */
/* ADMIN                                                                   */
/* ======================================================================= */

/* Admin Sub-tabs */
.admin-subtabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--chanv-fibre);
    border-radius: 14px;
    overflow-x: auto;
}

.admin-subtab {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    color: rgba(40,40,40,0.5);
    white-space: nowrap;
}

.admin-subtab:hover {
    color: var(--chanv-terre);
    background: rgba(255,255,255,0.5);
}

.admin-subtab.active {
    background: white;
    color: var(--chanv-terre);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-subtab-content {
    animation: adminTabIn 0.25s ease;
}

@keyframes adminTabIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .admin-subtabs {
        gap: 4px;
        padding: 3px;
    }
    .admin-subtab {
        padding: 8px 14px;
        font-size: 12px;
    }
}

.admin-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--chanv-fibre);
    padding: 24px;
    margin-bottom: 18px;
}

.admin-card h3 {
    font-size: 18px;
    margin: 0 0 16px;
}

.admin-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--chanv-fibre);
    font-size: 14px;
}

.admin-stat-row .stat-label {
    color: rgba(40,40,40,0.5);
}

.admin-stat-row .stat-value {
    font-weight: 700;
}

/* ======================================================================= */
/* BUTTONS                                                                 */
/* ======================================================================= */

.btn-primary {
    padding: 10px 20px;
    background: var(--chanv-beige);
    color: var(--chanv-terre);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--chanv-dore);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

/* ======================================================================= */
/* RESPONSIVE                                                              */
/* ======================================================================= */

@media (max-width: 768px) {
    .main-header {
        padding: 24px 12px 70px;
    }

    .header-container {
        gap: 12px;
    }

    .header-titles h1 {
        font-size: 16px;
    }

    .header-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .nav-tab {
        font-size: 12px;
        padding: 6px 12px;
        white-space: nowrap;
    }

    .user-details {
        display: none;
    }

    .gallery-toolbar {
        padding: 10px 12px;
    }

    .toolbar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .asset-card-thumb {
        height: 120px;
    }

    .lightbox-content {
        flex-direction: column;
        max-height: 100vh;
        padding: 10px;
    }

    .lightbox-media {
        max-width: 100vw;
        max-height: 50vh;
    }

    .lightbox-info {
        width: 100%;
        max-height: 40vh;
    }

    .lightbox-nav {
        display: none;
    }

    .ai-search-inner {
        flex-wrap: wrap;
    }

    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .typo-grid, .rules-grid {
        grid-template-columns: 1fr;
    }

    .brand-tabs {
        grid-template-columns: 1fr;
    }

    .brand-tab-card {
        min-height: 120px;
    }

    .brand-book-section {
        flex-direction: column;
        text-align: center;
    }

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

    .collections-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================================================= */
/* BRAND GUIDE EDITING                                                     */
/* ======================================================================= */

.btn-edit-section {
    padding: 6px 14px;
    background: var(--chanv-fibre);
    border: 1px solid var(--chanv-beige);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--chanv-terre);
    white-space: nowrap;
}

.btn-edit-section:hover {
    background: var(--chanv-beige);
    transform: translateY(-1px);
}

.btn-add-item {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 14px;
    background: white;
    border: 2px dashed var(--chanv-beige);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: rgba(40,40,40,0.5);
    text-align: center;
}

.btn-add-item:hover {
    background: var(--chanv-fibre);
    border-color: var(--chanv-dore);
    color: var(--chanv-terre);
}

.color-edit-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    justify-content: flex-end;
}

.color-edit-actions button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--chanv-fibre);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.color-edit-actions button:hover {
    background: var(--chanv-fibre);
    border-color: var(--chanv-beige);
    transform: scale(1.1);
}

/* ─── Edit Modal ─── */
.edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.edit-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 28px 24px;
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.edit-modal h3 {
    font-size: 20px;
    margin: 0 0 20px;
    font-family: 'Outfit', sans-serif;
}

.edit-field {
    margin-bottom: 16px;
}

.edit-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(40,40,40,0.7);
    margin-bottom: 6px;
}

.edit-field input[type="text"],
.edit-field input[type="url"],
.edit-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
}

.edit-field input:focus,
.edit-field textarea:focus {
    outline: none;
    border-color: var(--chanv-beige);
    box-shadow: 0 0 0 3px rgba(221,203,164,0.2);
}

.edit-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--chanv-fibre);
}

.btn-cancel {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--chanv-terre);
}

.btn-cancel:hover {
    background: var(--chanv-fibre);
}

/* ======================================================================= */
/* BRAND PILLS (Quick brand filter)                                        */
/* ======================================================================= */

.brand-pills {
    display: flex;
    gap: 10px;
    padding: 16px 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.brand-pills-inline {
    display: flex;
    gap: 6px;
    align-items: center;
}

.brand-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1.5px solid var(--chanv-fibre);
    border-radius: 50px;
    background: white;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--chanv-terre);
    position: relative;
    overflow: hidden;
}

.brand-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pill-bg, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.brand-pill:hover {
    border-color: var(--pill-accent, var(--chanv-beige));
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.brand-pill.active {
    background: var(--pill-bg, var(--chanv-terre));
    color: white !important;
    border-color: var(--pill-bg, var(--chanv-terre));
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 1;
}

.brand-pill.active::before {
    display: none;
}

.brand-pill .pill-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: brightness(0) saturate(100%);
    transition: filter 0.3s ease;
}

.brand-pill.active .pill-logo {
    filter: brightness(0) invert(1);
}

.brand-pill > * {
    position: relative;
    z-index: 1;
}

/* ======================================================================= */
/* CATEGORY EXPLORER                                                       */
/* ======================================================================= */

.category-explorer {
    margin: 20px 0 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(248,244,236,0.6) 0%, rgba(255,255,255,0.4) 100%);
    border-radius: 20px;
    border: 1px solid rgba(221,203,164,0.15);
}

.category-explorer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 0 0 16px;
    user-select: none;
}

.category-explorer-header h3 {
    font-size: 18px;
    margin: 0;
    font-weight: 800;
    color: var(--chanv-terre);
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.category-toggle-icon {
    font-size: 18px;
    color: rgba(40,40,40,0.3);
    transition: transform 0.3s ease;
}

.category-explorer.collapsed .category-toggle-icon {
    transform: rotate(-90deg);
}

.category-explorer.collapsed .category-cards {
    display: none;
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 4px 0 4px;
}

/* Staggered entrance — converge from both sides */
.cat-card {
    animation: catSlideFromLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.cat-card:nth-child(even) {
    animation-name: catSlideFromRight;
}

@keyframes catSlideFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-60px) scale(0.8);
        filter: blur(3px);
    }
    60% {
        opacity: 1;
        transform: translateX(4px) scale(1.03);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes catSlideFromRight {
    0% {
        opacity: 0;
        transform: translateX(60px) scale(0.8);
        filter: blur(3px);
    }
    60% {
        opacity: 1;
        transform: translateX(-4px) scale(1.03);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

.cat-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    white-space: nowrap;
}

.cat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.cat-card:hover::before {
    opacity: 1;
}

.cat-card:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 0 0 2px rgba(255,255,255,0.3);
}

.cat-card.active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22), inset 0 0 0 2px rgba(255,255,255,0.6);
}

.cat-card-icon {
    font-size: 18px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.cat-card:hover .cat-card-icon {
    transform: scale(1.15) rotate(-5deg);
}

.cat-card-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    line-height: 1;
}

.cat-card-count {
    font-size: 10px;
    opacity: 0.65;
    position: relative;
    z-index: 2;
    font-weight: 600;
    margin-left: -2px;
}

.cat-card-deco {
    display: none; /* Hidden in chip mode */
}

/* Category card gradients — matches scanner categories exactly */
.cat-card[data-cat="logos"] { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.cat-card[data-cat="equipe"] { background: linear-gradient(135deg, #4facfe, #00f2fe); color: white; }
.cat-card[data-cat="photos"] { background: linear-gradient(135deg, #f093fb, #f5576c); color: white; }
.cat-card[data-cat="design"] { background: linear-gradient(135deg, #a8edea, #fed6e3); color: #333; }
.cat-card[data-cat="social-media"] { background: linear-gradient(135deg, #a18cd1, #fbc2eb); color: #333; }
.cat-card[data-cat="packaging"] { background: linear-gradient(135deg, #ffecd2, #fcb69f); color: #333; }
.cat-card[data-cat="evenements"] { background: linear-gradient(135deg, #fa709a, #fee140); color: white; }
.cat-card[data-cat="videos"] { background: linear-gradient(135deg, #f6d365, #fda085); color: #333; }
.cat-card[data-cat="brand-guide"] { background: linear-gradient(135deg, #282828, #3a3530); color: #DDCBA4; }
.cat-card[data-cat="mockups"] { background: linear-gradient(135deg, #0c3483, #a2b6df); color: white; }
.cat-card[data-cat="templates"] { background: linear-gradient(135deg, #e0c3fc, #8ec5fc); color: #333; }
.cat-card[data-cat="icons"] { background: linear-gradient(135deg, #89f7fe, #66a6ff); color: white; }
.cat-card[data-cat="fonts"] { background: linear-gradient(135deg, #2d2d2d, #4a3728); color: #f0d9a0; }
.cat-card[data-cat="catalogues"] { background: linear-gradient(135deg, #d299c2, #fef9d7); color: #333; }
.cat-card[data-cat="presentations"] { background: linear-gradient(135deg, #c1dfc4, #deecdd); color: #333; }
.cat-card[data-cat="assets"] { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); color: #333; }
.cat-card[data-cat="non-classe"] { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #333; }

@media (max-width: 768px) {
    .category-cards {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    .cat-card {
        min-height: 80px;
        padding: 14px 10px 10px;
    }
    .cat-card-icon { font-size: 22px; }
    .cat-card-name { font-size: 11px; }
    .brand-pills { gap: 6px; }
    .brand-pill { padding: 6px 12px; font-size: 12px; }
}

/* ======================================================================= */
/* AI TYPE BADGE (on thumbnails)                                           */
/* ======================================================================= */

.ai-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 3;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

/* ======================================================================= */
/* QUICK DOWNLOAD BUTTON (hover on card)                                   */
/* ======================================================================= */

.asset-card-dl {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--chanv-terre);
    color: var(--chanv-beige);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.asset-card:hover .asset-card-dl {
    opacity: 1;
    transform: translateY(0);
}

.asset-card-dl:hover {
    background: var(--chanv-dore);
    color: white;
    transform: scale(1.1) !important;
}

/* ======================================================================= */
/* BRAND BADGES                                                            */
/* ======================================================================= */

.brand-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.brand-badge.brand-chanv { background: #DDCBA4; color: #282828; }
.brand-badge.brand-bleuh { background: #00264B; color: #3B82F6; }
.brand-badge.brand-maison-d-herbes { background: #D7A050; color: white; }
.brand-badge.brand-groupe-chanv { background: #282828; color: #DDCBA4; }
.brand-badge.brand-crocx { background: #E53935; color: white; }
.brand-badge.brand-kombuchanv { background: #66BB6A; color: white; }

/* Default brand */
.brand-badge:not([class*="brand-chanv"]):not([class*="brand-bleuh"]):not([class*="brand-maison"]):not([class*="brand-groupe"]):not([class*="brand-crocx"]):not([class*="brand-kombu"]) {
    background: var(--chanv-fibre);
    color: var(--chanv-terre);
}

/* ======================================================================= */
/* MODALS (Create/Add Collection)                                          */
/* ======================================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--chanv-fibre);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: rgba(40,40,40,0.4);
    transition: color 0.2s;
}

.modal-close:hover { color: var(--chanv-terre); }

.modal-body {
    padding: 20px 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--chanv-fibre);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: rgba(40,40,40,0.5);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--chanv-terre);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--chanv-beige);
}

/* ======================================================================= */
/* COLLECTION CARDS (enhanced)                                             */
/* ======================================================================= */

.collection-card {
    background: white;
    border-radius: var(--radius-md);
    border: 2px solid var(--chanv-fibre);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    animation: slideUp 0.3s ease backwards;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-bold);
    border-color: var(--chanv-beige);
}

.collection-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    height: 120px;
    background: var(--chanv-fibre);
    overflow: hidden;
}

.collection-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collection-empty-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(40,40,40,0.15);
}

.collection-card h3 {
    margin: 12px 14px 4px;
    font-size: 14px;
}

.collection-desc {
    margin: 0 14px;
    font-size: 12px;
    color: rgba(40,40,40,0.5);
    line-height: 1.3;
}

.collection-meta {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px 14px;
    font-size: 11px;
    color: rgba(40,40,40,0.4);
}

/* ======================================================================= */
/* COLLECTION LIST (add-to-collection modal)                               */
/* ======================================================================= */

.collection-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.collection-list-item:hover {
    background: var(--chanv-fibre);
}

.col-item-name {
    font-weight: 600;
    font-size: 14px;
}

.col-item-count {
    font-size: 12px;
    color: rgba(40,40,40,0.4);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STUDIO WELCOME — Premium Intro Page
   ═══════════════════════════════════════════════════════════════════════════ */

.studio-welcome {
    padding: 0 0 60px;
    animation: welcomeFadeIn 0.8s ease-out;
}

.studio-welcome.hidden {
    display: none;
}

/* Hero Section */
.welcome-hero {
    position: relative;
    padding: 50px 20px 40px;
    text-align: center;
    overflow: hidden;
    border-radius: 24px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f8f4ec 0%, #fef9f0 50%, #f0e8d8 100%);
}

.welcome-glow {
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(221,203,164,0.4) 0%, rgba(221,203,164,0.1) 40%, transparent 70%);
    animation: glowPulse 4s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes glowPulse {
    0% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    100% { transform: translateX(-50%) scale(1.3); opacity: 1; }
}

.welcome-content {
    position: relative;
    z-index: 1;
}

.welcome-title {
    margin: 0 0 20px;
    line-height: 1.15;
}

.welcome-title-line {
    display: block;
    font-size: 18px;
    font-weight: 500;
    color: rgba(40,40,40,0.5);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    animation: slideDown 0.6s ease-out 0.2s both;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-title-brand {
    display: block;
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 800;
    background: linear-gradient(135deg, #DDCBA4 0%, #b8976a 30%, #282828 60%, #DDCBA4 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% center; }
    100% { background-position: 100% center; }
}

.welcome-subtitle {
    max-width: 580px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(40,40,40,0.6);
    animation: fadeIn 0.8s ease-out 0.5s both;
}

/* Guided Steps (1-2-3) */
.welcome-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

.welcome-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
    border-radius: 20px;
    background: white;
    border: 1px solid rgba(221,203,164,0.15);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.welcome-step::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(221,203,164,0.05), rgba(221,203,164,0.15));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.welcome-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.07), 0 4px 12px rgba(221,203,164,0.15);
    border-color: rgba(221,203,164,0.4);
}

.welcome-step:hover::before {
    opacity: 1;
}

.welcome-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chanv-beige), var(--chanv-dore));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.welcome-step-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.welcome-step-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: #282828;
    margin: 0 0 4px;
}

.welcome-step-content p {
    font-size: 12.5px;
    color: rgba(40,40,40,0.5);
    margin: 0;
    line-height: 1.5;
}

.welcome-step-arrow {
    font-size: 18px;
    color: var(--chanv-dore);
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    opacity: 0.5;
}

/* Search Suggestions */
.welcome-suggestions {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeIn 0.8s ease-out 0.5s both;
}

.welcome-suggestions-label {
    font-size: 13px;
    color: rgba(40,40,40,0.45);
    font-weight: 500;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.welcome-suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.suggestion-chip {
    padding: 10px 20px;
    border-radius: 100px;
    border: 1.5px solid var(--chanv-fibre, #e8e0d4);
    background: white;
    color: var(--chanv-terre);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-chip:hover {
    background: var(--chanv-beige);
    border-color: var(--chanv-beige);
    color: var(--chanv-terre);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221,203,164,0.3);
}

/* Brand Showcase Cards */
.welcome-brands {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px 0;
    animation: fadeIn 1s ease-out 0.7s both;
}

.welcome-brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-radius: 16px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(221,203,164,0.2);
    transition: all 0.3s ease;
}

.welcome-brand-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(221,203,164,0.2);
    border-color: rgba(221,203,164,0.4);
}

.welcome-brand-logo {
    height: 24px;
    width: auto;
    opacity: 0.6;
}

.welcome-brand-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(40,40,40,0.5);
    letter-spacing: 0.3px;
}

/* Gallery hidden when welcome is shown */
.gallery-toolbar.hidden,
.gallery-grid.hidden,
.scroll-loading.hidden,
#scroll-sentinel.hidden {
    display: none !important;
}

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

/* Responsive */
@media (max-width: 768px) {
    .welcome-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .welcome-action-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .welcome-brands {
        gap: 24px;
    }
    .welcome-brand-logo {
        height: 22px;
    }
}

@media (max-width: 480px) {
    .welcome-action-cards {
        grid-template-columns: 1fr;
    }
    .welcome-hero {
        padding: 32px 16px 28px;
    }
}

/* ======================================================================= */
/* BULK SELECTION MODE                                                      */
/* ======================================================================= */

/* Toggle button active state */
#btn-bulk-select.active {
    background: var(--chanv-terre);
    color: var(--chanv-beige);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Checkbox overlay on cards in selection mode */
.gallery-grid.selection-mode .asset-card {
    cursor: pointer;
}

.gallery-grid.selection-mode .asset-card::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
    z-index: 10;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-grid.selection-mode .asset-card.selected::after {
    content: '✓';
    background: var(--chanv-terre);
    border-color: var(--chanv-terre);
    color: white;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.1);
    box-shadow: 0 2px 12px rgba(45,40,35,0.4);
}

.gallery-grid.selection-mode .asset-card.selected {
    outline: 3px solid var(--chanv-terre);
    outline-offset: -3px;
    transform: scale(0.97);
}

.gallery-grid.selection-mode .asset-card.selected .asset-card-thumb {
    filter: brightness(0.92);
}

/* Floating Action Bar */
.bulk-action-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(45, 40, 35, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
    transition: bottom 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90vw;
}

.bulk-action-bar.visible {
    bottom: 28px;
}

.bulk-count {
    color: var(--chanv-beige);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.bulk-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.bulk-btn--download {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.bulk-btn--download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bulk-btn--project {
    background: linear-gradient(135deg, var(--chanv-terre), #5a4f44);
    color: var(--chanv-beige);
}

.bulk-btn--project:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 40, 35, 0.4);
}

.bulk-btn--clear {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.15);
}

.bulk-btn--clear:hover {
    background: rgba(255,255,255,0.18);
    color: white;
}

/* Project Picker Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content.project-picker {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 420px;
    max-width: 90vw;
    max-height: 70vh;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--chanv-fibre);
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--chanv-terre);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chanv-terre);
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.06);
}

.project-picker-list {
    padding: 12px;
    overflow-y: auto;
    max-height: 50vh;
}

.project-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.project-picker-item:hover {
    background: rgba(248, 244, 236, 0.8);
    border-color: var(--chanv-fibre);
}

.project-picker-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chanv-beige);
    border-radius: 8px;
    flex-shrink: 0;
}

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

.project-picker-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--chanv-terre);
}

.project-picker-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.project-picker-empty {
    text-align: center;
    padding: 32px 16px;
    color: #999;
    font-size: 14px;
}

@media (max-width: 768px) {
    .bulk-action-bar {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
        left: 16px;
        right: 16px;
        transform: none;
        border-radius: 16px;
    }
    .bulk-action-bar.visible {
        bottom: 16px;
    }
}

/* ═══════════════════════════════════════════════
   DUPLICATES VIEWER
   ═══════════════════════════════════════════════ */

.duplicates-panel {
    padding: 0 0 40px;
}

.duplicates-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--chanv-fibre);
    box-shadow: var(--shadow-soft);
}

.duplicates-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--chanv-terre);
    margin: 0;
}

.duplicates-stats {
    display: flex;
    gap: 10px;
    flex: 1;
}

.dup-stat {
    background: var(--chanv-fibre);
    color: var(--chanv-terre);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.dup-stat--warn {
    background: #fff3e0;
    color: #e65100;
}

/* ── Group card ── */
.dup-group {
    background: white;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    animation: slideUp 0.3s ease backwards;
}

.dup-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--chanv-fibre);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dup-group-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--chanv-terre);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dup-group-badge {
    background: #e53935;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.dup-group-size {
    font-size: 12px;
    color: rgba(40,40,40,0.5);
    font-weight: 500;
}

.dup-hide-all-btn {
    margin-left: auto;
    padding: 6px 14px;
    border: 1px solid #ef9a9a;
    background: #fff5f5;
    color: #c62828;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dup-hide-all-btn:hover:not(:disabled) {
    background: #c62828;
    color: white;
    border-color: #c62828;
    transform: translateY(-1px);
}

.dup-hide-all-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ── Assets row ── */
.dup-group-assets {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.dup-asset-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    padding: 14px;
    border-right: 1px solid var(--chanv-fibre);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s ease;
    position: relative;
}

.dup-asset-card:last-child {
    border-right: none;
}

.dup-asset-original {
    background: rgba(76, 175, 80, 0.04);
}

/* ── Thumbnail ── */
.dup-asset-thumb {
    width: 100%;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f6f2;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dup-asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dup-asset-placeholder {
    font-size: 32px;
    opacity: 0.4;
}

.dup-original-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ── Info ── */
.dup-asset-info {
    flex: 1;
}

.dup-asset-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--chanv-terre);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.dup-asset-meta {
    font-size: 11px;
    color: rgba(40,40,40,0.45);
    margin-top: 2px;
}

/* ── Hide button ── */
.dup-hide-btn {
    width: 100%;
    padding: 7px 0;
    border: 1px solid #ef9a9a;
    background: #fff5f5;
    color: #c62828;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dup-hide-btn:hover {
    background: #c62828;
    color: white;
    border-color: #c62828;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .duplicates-header {
        padding: 14px 16px;
    }
    .dup-asset-card {
        flex: 0 0 160px;
        padding: 10px;
    }
    .dup-asset-thumb {
        height: 80px;
    }
}

/* ======================================================================= */
/* DASHBOARD                                                                */
/* ======================================================================= */

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(221, 203, 164, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(40, 40, 40, 0.1);
}

.kpi-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--chanv-terre);
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(40, 40, 40, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}
.kpi-trend:empty { display: none; }
.kpi-trend--up {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}
.kpi-trend--down {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}
.kpi-trend--stable {
    color: rgba(40, 40, 40, 0.4);
    background: rgba(40, 40, 40, 0.05);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(221, 203, 164, 0.15);
}

.chart-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--chanv-terre);
    margin: 0 0 16px 0;
}

.chart-container {
    min-height: 120px;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    animation: slideUp 0.3s ease backwards;
}

.chart-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--chanv-terre);
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-wrap {
    flex: 1;
    height: 20px;
    background: rgba(241, 234, 218, 0.4);
    border-radius: 10px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.chart-bar-count {
    font-size: 12px;
    font-weight: 700;
    color: rgba(40, 40, 40, 0.5);
    min-width: 32px;
    text-align: right;
}

@keyframes growUp {
    from { height: 0 !important; }
}

@media (max-width: 768px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    .dashboard-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Presentation Mode ─── */
.presentation-mode {
    background: var(--chanv-creme) !important;
    padding: 40px !important;
    overflow-y: auto !important;
    font-size: 1.25em;
}
.presentation-mode .brand-section {
    max-width: 1000px;
    margin: 0 auto 40px;
    padding: 32px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-bold);
}
.presentation-mode .color-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.presentation-mode .typo-grid {
    grid-template-columns: 1fr;
}
.presentation-mode .brand-book-section {
    max-width: 1000px;
    margin: 0 auto 40px;
}
.presentation-mode h3 {
    font-size: 1.4em;
}
.presentation-mode .brand-tabs {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* RESTRICTED PROJECT SCREEN                                              */
/* ═══════════════════════════════════════════════════════════════════════ */

.project-restricted {
    position: relative;
    min-height: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--chanv-terre);
}

.project-restricted-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.3);
    transform: scale(1.1);
}

.project-restricted-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    text-align: center;
    gap: 16px;
    min-height: 420px;
}

.project-restricted-icon {
    font-size: 56px;
    animation: restrictedPulse 2s ease-in-out infinite;
}

@keyframes restrictedPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.project-restricted-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin: 0;
}

.project-restricted-msg {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    max-width: 400px;
    line-height: 1.6;
    margin: 0;
}

.project-restricted-creator {
    font-size: 12px;
    color: rgba(221, 203, 164, 0.5);
    margin: 0;
}

.project-restricted-btn {
    background: linear-gradient(135deg, var(--chanv-dore), #b88e50);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(201, 169, 110, 0.3);
    margin-top: 8px;
}

.project-restricted-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(201, 169, 110, 0.5);
}

.project-restricted-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.project-restricted-btn--sent {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    cursor: default;
}

.project-restricted-pending {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 14px 28px;
    border-radius: 14px;
    color: var(--chanv-beige);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(221, 203, 164, 0.2);
}

.project-restricted-back {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.project-restricted-back:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* JOIN REQUESTS SECTION                                                   */
/* ═══════════════════════════════════════════════════════════════════════ */

.join-requests-section {
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.06), rgba(201, 169, 110, 0.02));
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.join-requests-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--chanv-dore);
    margin-bottom: 12px;
}

.join-request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--chanv-fibre);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.join-request-card:last-child {
    margin-bottom: 0;
}

.join-request-card:hover {
    border-color: var(--chanv-dore);
    box-shadow: 0 2px 12px rgba(201, 169, 110, 0.1);
}

.join-request-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.join-request-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--chanv-terre);
}

.join-request-time {
    font-size: 11px;
    color: #999;
}

.join-request-actions {
    display: flex;
    gap: 8px;
}

.join-request-approve,
.join-request-reject {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.join-request-approve {
    background: #e8f5e9;
    color: #2e7d32;
}

.join-request-approve:hover {
    background: #c8e6c9;
}

.join-request-reject {
    background: #ffebee;
    color: #c62828;
}

.join-request-reject:hover {
    background: #ffcdd2;
}

.join-request-approve:disabled,
.join-request-reject:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .join-request-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .join-request-actions {
        align-self: stretch;
    }
    .join-request-approve,
    .join-request-reject {
        flex: 1;
        text-align: center;
    }
    .project-restricted-content {
        padding: 40px 20px;
    }
    .project-restricted-title {
        font-size: 22px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* CONSOLIDATED RESPONSIVE — 768px (tablet / small desktop)               */
/* ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── P1.1 Header — Match other apps (Planificateur pattern) ── */
    .main-header {
        padding: 20px 16px 50px;
    }
    .main-header::after {
        height: 60px;
        bottom: -30px;
    }
    .header-container {
        flex-direction: column;
        text-align: center;
        position: relative;
    }
    .header-nav {
        display: none;
    }
    .header-user-section {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0;
    }
    .header-user-section .user-details {
        display: none !important;
    }
    .header-titles p {
        font-size: 10px;
    }
    .avatar-burger-inner {
        padding: 3px 10px 3px 3px;
    }
    .avatar-burger-photo {
        width: 30px;
        height: 30px;
    }
    .avatar-burger-icon {
        width: 14px;
        gap: 3px;
    }

    /* ── P1.2 Toolbar — Full-width stack ── */
    .gallery-toolbar {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
    .toolbar-left {
        width: 100%;
    }
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    .filter-select {
        font-size: 11px;
        padding: 6px 8px;
        flex: 1;
    }
    .toolbar-btn {
        width: 30px;
        height: 30px;
    }

    /* ── P1.3 Modals — Full-width, proper scrolling ── */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 14px;
    }
    .modal-body {
        max-height: 60vh;
    }
    .modal-header {
        padding: 14px 16px;
    }
    .modal-header h3 {
        font-size: 16px;
    }
    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .modal-footer button {
        flex: 1;
        min-width: 0;
    }

    /* ── P1.4 Project detail — Compact layout ── */
    .project-detail-info {
        padding: 16px;
    }
    .project-detail-info h2 {
        font-size: 20px;
    }
    .project-detail-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .project-detail-meta {
        gap: 8px;
    }
    .project-detail-meta .meta-item {
        font-size: 12px;
    }
    .project-detail-actions {
        flex-direction: column;
    }
    .project-detail-actions button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .project-detail-assets-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .project-detail-cover {
        height: 150px;
    }
    .project-card-cover {
        height: 120px;
    }

    /* ── P1.5 Lightbox — Compact info panel ── */
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .lightbox-content {
        gap: 0;
        padding: 6px;
    }
    .lightbox-media {
        max-height: 45vh;
        max-width: 100vw;
    }
    .lightbox-info {
        width: 100%;
        max-height: 42vh;
        padding: 16px;
        border-radius: 12px 12px 0 0;
    }
    .lightbox-info h3 {
        font-size: 16px;
    }
    .lightbox-info .info-row {
        flex-direction: column;
        gap: 2px;
    }
    .lightbox-info .info-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .lightbox-info .info-actions button {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* ── P2.6 Search hero — Tighter spacing ── */
    .search-hero {
        margin-bottom: 12px;
    }
    .search-hero .search-wrapper {
        padding: 0 12px;
    }
    .search-hero .search-input {
        font-size: 14px;
        padding: 10px 8px;
    }
    .ai-btn-label,
    .upload-btn-label {
        display: none;
    }
    .ai-search-btn,
    .upload-quick-btn {
        padding: 8px 10px;
        font-size: 14px;
    }
    .ai-search-panel {
        border-radius: 12px;
    }
    .ai-search-inner {
        flex-direction: column;
        gap: 8px;
    }
    .ai-search-field {
        width: 100%;
    }

    /* ── P2.7 Color grid — Adapt columns ── */
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    /* ── P2.8 Edit modals (Brand Guide) ── */
    .edit-modal {
        width: 95%;
        padding: 20px 16px;
        max-height: 90vh;
    }
    .edit-modal h3 {
        font-size: 18px;
        margin-bottom: 14px;
    }
    .edit-field input,
    .edit-field textarea {
        font-size: 14px;
    }

    /* ── P2.9 Project cards grid ── */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* ── P2.10 List view ── */
    .gallery-grid.list-view .asset-card {
        grid-template-columns: 70px 1fr;
    }
    .gallery-grid.list-view .asset-card-thumb {
        height: 55px;
    }
    .gallery-grid.list-view .asset-card-footer {
        display: none;
    }

    /* ── P3.12 Login card ── */
    .login-card {
        padding: 32px 20px;
        margin: 0 16px;
    }

    /* ── Container padding ── */
    .container,
    main.container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* ── Category explorer header ── */
    .category-explorer-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .brand-pills-inline {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .brand-pills-inline::-webkit-scrollbar {
        display: none;
    }
    .brand-pill {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* ── Category cards — Horizontal scrollable pills ── */
    .category-cards {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 4px 0 8px;
        scroll-snap-type: x mandatory;
    }
    .category-cards::-webkit-scrollbar {
        display: none;
    }
    .cat-card {
        flex: 0 0 auto;
        min-width: 100px;
        max-width: 130px;
        white-space: normal;
        flex-direction: column;
        text-align: center;
        padding: 10px 8px;
        gap: 4px;
        min-height: 65px;
        border-radius: 14px;
        scroll-snap-align: start;
    }
    .cat-card-icon {
        font-size: 18px;
    }
    .cat-card-name {
        font-size: 10px;
        line-height: 1.2;
    }
    .cat-card-count {
        font-size: 9px;
        margin-left: 0;
    }

    /* ── Bulk action bar — ensure hidden by default ── */
    .bulk-action-bar {
        bottom: -250px;
    }

    /* ── Pagination ── */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    /* ── Welcome section ── */
    .welcome-hero {
        padding: 28px 16px 24px;
    }
    .welcome-hero h2 {
        font-size: 22px;
    }

    /* ── Asset card adjustments ── */
    .asset-card-body h4 {
        font-size: 13px;
    }
    .asset-card-footer {
        padding: 8px 12px;
    }
    .asset-card-footer span {
        font-size: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* CONSOLIDATED RESPONSIVE — 480px (mobile phone)                         */
/* ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {

    /* ── Header — Even more compact ── */
    .main-header {
        padding: 16px 12px 42px;
    }
    .header-titles h1 {
        font-size: 15px;
    }

    /* ── Gallery — Single column on very small ── */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .asset-card-thumb {
        height: 100px;
    }

    /* ── Projects — Full width ── */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-card-cover {
        height: 100px;
    }
    .project-detail-cover {
        height: 120px;
    }
    .project-detail-info {
        padding: 12px;
    }
    .project-detail-info h2 {
        font-size: 18px;
    }

    /* ── Brand Guide — Compact ── */
    .brand-tabs {
        gap: 10px;
    }
    .brand-tab-card {
        min-height: 90px;
        padding: 20px 16px;
    }
    .brand-tab-card .brand-logo-text {
        font-size: 20px;
    }

    /* ── Category grid — horizontal scroll (already set at 768) ── */

    /* ── Modals — Full screen feel ── */
    .modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 14px 14px 0 0;
        margin-top: auto;
    }
    .edit-modal {
        width: 100%;
        border-radius: 14px 14px 0 0;
        max-height: 95vh;
    }

    /* ── Lightbox — Full screen ── */
    .lightbox-content {
        max-width: 100vw;
        max-height: 100vh;
        padding: 4px;
    }
    .lightbox-media {
        max-height: 40vh;
    }
    .lightbox-info {
        max-height: 48vh;
        padding: 12px;
        font-size: 13px;
    }
    .lightbox-info .info-actions button {
        font-size: 10px;
        padding: 5px 8px;
    }

    /* ── Search ── */
    .search-hero .search-wrapper {
        border-radius: 12px;
    }
    .search-hero .search-input {
        font-size: 13px;
    }

    /* ── Color grid — 2 columns ── */
    .color-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Download/share buttons ── */
    .project-detail-info button {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* ── Toolbar compactification ── */
    .filter-select {
        font-size: 10px;
        padding: 5px 6px;
    }

    /* ── Login ── */
    .login-card {
        padding: 28px 16px;
    }
    .login-card h2 {
        font-size: 20px;
    }
    .main-logo-login {
        height: 60px;
        margin-bottom: 20px;
    }

    /* ── Dashboard ── */
    .dashboard-kpis {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .kpi-card {
        padding: 16px;
    }

    /* ── Pagination — Ultra compact ── */
    .pagination .page-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ══════════════════════════════════════════════
   AI SEARCH — Summary Bubble + Reason Labels
   ══════════════════════════════════════════════ */
/* ══════════════════════════════════════════════
   AI SEARCH — Loading Animation
   ══════════════════════════════════════════════ */

.ai-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 24px;
    animation: aiFadeIn 0.4s ease-out;
}

.ai-search-loading-orb {
    position: relative;
    width: 120px;
    height: 120px;
}

.ai-search-loading-orb::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #8b7355, #c9a96e, #f5e6d3, #8b7355
    );
    animation: aiOrbSpin 2s linear infinite;
    filter: blur(1px);
}

.ai-search-loading-orb::after {
    content: '🔍';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--bg-primary, #faf8f5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: aiOrbPulse 1.5s ease-in-out infinite;
}

@keyframes aiOrbSpin {
    to { transform: rotate(360deg); }
}

@keyframes aiOrbPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-search-loading-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #2c2c2c);
    letter-spacing: -0.02em;
}

.ai-search-loading-message {
    font-size: 15px;
    color: rgba(40, 40, 40, 0.6);
    font-weight: 500;
    min-height: 24px;
    transition: opacity 0.3s ease;
    text-align: center;
}

.ai-search-progress-bar {
    width: 280px;
    height: 6px;
    background: rgba(139, 115, 85, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.ai-search-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b7355, #c9a96e);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.ai-search-loading-emojis {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.ai-search-loading-emojis span {
    font-size: 24px;
    animation: aiEmojiFloat 2s ease-in-out infinite;
    opacity: 0.7;
}

.ai-search-loading-emojis span:nth-child(1) { animation-delay: 0s; }
.ai-search-loading-emojis span:nth-child(2) { animation-delay: 0.3s; }
.ai-search-loading-emojis span:nth-child(3) { animation-delay: 0.6s; }
.ai-search-loading-emojis span:nth-child(4) { animation-delay: 0.9s; }
.ai-search-loading-emojis span:nth-child(5) { animation-delay: 1.2s; }

@keyframes aiEmojiFloat {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-10px); opacity: 1; }
}

@keyframes aiFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-summary-bubble {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 115, 85, 0.15);
    border-radius: 16px;
    margin-bottom: 12px;
    animation: aiFadeIn 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

@keyframes aiFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-summary-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1.4;
}

.ai-summary-text {
    font-size: 14px;
    line-height: 1.6;
    color: #2c2c2c;
    font-weight: 500;
}

.ai-result-count {
    font-size: 12px;
    color: rgba(40, 40, 40, 0.5);
    padding: 4px 0;
}

/* Per-card AI reason micro-label */
.ai-reason-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.0));
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: aiFadeIn 0.5s ease-out 0.2s both;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .ai-summary-bubble {
        background: rgba(40, 40, 40, 0.75);
        border-color: rgba(139, 115, 85, 0.25);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .ai-summary-text {
        color: #e0dcd6;
    }

    .ai-result-count {
        color: rgba(224, 220, 214, 0.5);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ai-summary-bubble {
        padding: 12px 14px;
        gap: 8px;
        border-radius: 12px;
    }

    .ai-summary-icon {
        font-size: 20px;
    }

    .ai-summary-text {
        font-size: 13px;
    }

    .ai-reason-label {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* ══════════════════════════════════════════════
   AI STUDIO — Slide-in Panel
   ══════════════════════════════════════════════ */

.ai-studio-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(139, 115, 85, 0.15);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-studio-panel.open {
    transform: translateX(0);
}

.ai-studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.ai-studio-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-studio-title-icon {
    font-size: 22px;
}

.ai-studio-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #2c2c2c;
}

.ai-studio-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s;
}

.ai-studio-close-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

/* Source image */
.ai-studio-source {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(139, 115, 85, 0.05);
    border-bottom: 1px solid rgba(139, 115, 85, 0.08);
}

.ai-studio-source-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(139, 115, 85, 0.15);
}

.ai-studio-source-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c2c2c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-studio-project-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c2c2c;
}

.ai-studio-project-desc {
    font-size: 12px;
    color: rgba(40, 40, 40, 0.5);
    margin-top: 2px;
}

/* Messages area */
.ai-studio-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-msg {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 90%;
    animation: aiFadeIn 0.3s ease-out;
    word-wrap: break-word;
}

.ai-msg-user {
    align-self: flex-end;
    background: var(--chanv-earth, #8B7355);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg-assistant {
    align-self: flex-start;
    background: rgba(139, 115, 85, 0.08);
    color: #2c2c2c;
    border-bottom-left-radius: 4px;
}

.ai-msg-image {
    max-width: 95%;
    padding: 8px;
}

.ai-result-img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Action buttons */
.ai-result-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ai-action-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-action-save {
    background: #27ae60;
    color: #fff;
}

.ai-action-save:hover {
    background: #219a52;
}

.ai-action-retry {
    background: var(--chanv-earth, #8B7355);
    color: #fff;
}

.ai-action-retry:hover {
    opacity: 0.85;
}

.ai-action-cancel {
    background: rgba(0, 0, 0, 0.06);
    color: #666;
}

.ai-action-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Input bar */
.ai-studio-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(139, 115, 85, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.ai-studio-input-bar textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color 0.15s;
    resize: none;
    overflow-y: auto;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
}

.ai-studio-input-bar textarea:focus {
    border-color: var(--chanv-earth, #8B7355);
}

.ai-studio-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--chanv-earth, #8B7355);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ai-studio-send-btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* Project picker */
.ai-project-picker {
    max-width: 100% !important;
}

.ai-project-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    margin: 4px 0;
    border: 1px solid rgba(139, 115, 85, 0.15);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-project-btn:hover {
    background: rgba(139, 115, 85, 0.06);
    border-color: var(--chanv-earth, #8B7355);
}

.ai-project-skip {
    color: #999;
    border-style: dashed;
}

/* Project mode thumbnails */
.ai-studio-project-thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.ai-studio-project-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-studio-project-thumb:hover {
    border-color: var(--chanv-earth, #8B7355);
    transform: scale(1.08);
}

/* ═══ Selectable Reference Thumbnails ═══ */
.ai-thumb-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.ai-thumb-wrapper.selected .ai-studio-project-thumb {
    border-color: #DDCBA4;
    box-shadow: 0 0 8px rgba(221, 203, 164, 0.4);
}

.ai-thumb-check {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #DDCBA4;
    color: #282828;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.ai-thumb-wrapper.selected .ai-thumb-check {
    display: block;
    animation: aiThumbPop 0.2s ease;
}

@keyframes aiThumbPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes aiThumbShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.ai-thumb-shake {
    animation: aiThumbShake 0.3s ease;
}

.ai-ref-label {
    font-size: 11px;
    color: #999;
    padding: 6px 0 2px;
}

.ai-ref-label strong {
    color: #bbb;
}

.ai-ref-counter-bar {
    font-size: 11px;
    color: #888;
    padding: 2px 0 6px;
}

.ai-ref-counter-bar strong {
    color: #DDCBA4;
}

.ai-thumbs-selectable {
    max-height: 120px;
    overflow-y: auto;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .ai-studio-panel {
        background: rgba(30, 30, 30, 0.95);
        border-left-color: rgba(139, 115, 85, 0.2);
    }

    .ai-studio-title h3 { color: #e0dcd6; }
    .ai-studio-source { background: rgba(255, 255, 255, 0.03); }
    .ai-studio-source-label { color: #e0dcd6; }
    .ai-studio-project-label { color: #e0dcd6; }

    .ai-msg-assistant {
        background: rgba(255, 255, 255, 0.06);
        color: #e0dcd6;
    }

    .ai-studio-input-bar {
        background: rgba(30, 30, 30, 0.8);
    }

    .ai-studio-input-bar textarea {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(139, 115, 85, 0.2);
        color: #e0dcd6;
    }

    .ai-action-cancel {
        background: rgba(255, 255, 255, 0.08);
        color: #aaa;
    }

    .ai-project-btn {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(139, 115, 85, 0.15);
        color: #e0dcd6;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ai-studio-panel {
        width: 100vw;
    }

    .ai-studio-source-img {
        width: 44px;
        height: 44px;
    }
}

/* ══════════════════════════════════════════════
   Video Mode — Toggle, Controls, Progress, Player
   ══════════════════════════════════════════════ */

/* Mode Toggle (Image / Vidéo) */
.ai-studio-mode-toggle {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    margin-bottom: 10px;
}

.ai-mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #666;
    transition: all 0.2s;
}

.ai-mode-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.ai-mode-btn.active {
    background: var(--chanv-earth, #8B7355);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

/* Video Controls (ratio + duration) */
.ai-video-controls {
    padding: 10px 14px;
    background: rgba(139, 115, 85, 0.06);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(139, 115, 85, 0.15);
}

.ai-vc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ai-vc-row:last-child {
    margin-bottom: 0;
}

.ai-vc-row label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    min-width: 80px;
}

.ai-vc-row select {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 12px;
    background: #fff;
}

.ai-vc-row input[type="range"] {
    flex: 1;
    accent-color: var(--chanv-earth, #8B7355);
}

/* Video Progress Bar */
.ai-video-progress {
    padding: 14px !important;
}

.ai-vp-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    animation: aiPulse 1.5s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-vp-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.ai-vp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--chanv-earth, #8B7355), #c9a96e);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.ai-vp-time {
    font-size: 11px;
    color: #888;
}

.ai-vp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Inline Cancel Button (image + video) */
.ai-cancel-inline {
    padding: 4px 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.04);
    color: #888;
    transition: all 0.15s;
}

.ai-cancel-inline:hover {
    background: rgba(220, 53, 69, 0.08);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* Image loading bubble */
.ai-loading-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.ai-loading-bubble span {
    animation: aiPulse 1.5s ease-in-out infinite;
}

/* Video Result Player */
.ai-result-video {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .ai-studio-mode-toggle {
        background: rgba(255, 255, 255, 0.05);
    }

    .ai-mode-btn {
        color: #aaa;
    }

    .ai-mode-btn:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .ai-video-controls {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(139, 115, 85, 0.2);
    }

    .ai-vc-row label {
        color: #bbb;
    }

    .ai-vc-row select {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e0dcd6;
    }

    .ai-vp-bar {
        background: rgba(255, 255, 255, 0.08);
    }

    .ai-optimize-btn {
        background: rgba(221, 203, 164, 0.15);
        border-color: rgba(221, 203, 164, 0.3);
    }

    .ai-msg-optimized {
        background: rgba(221, 203, 164, 0.08) !important;
        border-color: rgba(221, 203, 164, 0.2) !important;
    }

    .ai-suggestion-chip {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ccc;
    }

    .ai-suggestion-chip:hover {
        background: rgba(221, 203, 164, 0.12);
        border-color: rgba(221, 203, 164, 0.3);
        color: #DDCBA4;
    }

    .ai-cost-note {
        background: rgba(255, 209, 0, 0.06);
        border-color: rgba(255, 209, 0, 0.15);
        color: #bbb;
    }
}

/* ═══ Optimize Button ═══ */
.ai-optimize-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(221, 203, 164, 0.4);
    background: rgba(221, 203, 164, 0.1);
    color: #DDCBA4;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-optimize-btn:hover {
    background: rgba(221, 203, 164, 0.25);
    border-color: #DDCBA4;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(221, 203, 164, 0.2);
}

/* ═══ Optimized Prompt Message ═══ */
.ai-msg-optimized {
    background: rgba(221, 203, 164, 0.06) !important;
    border: 1px solid rgba(221, 203, 164, 0.15) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
}

.ai-opt-badge {
    font-size: 11px;
    font-weight: 700;
    color: #DDCBA4;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ai-opt-brand {
    font-weight: 500;
    opacity: 0.7;
    text-transform: none;
}

.ai-opt-text {
    font-size: 13px;
    line-height: 1.55;
    color: #e0dcd6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-opt-hint {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    font-style: italic;
}

/* ═══ Video Suggestions ═══ */
.ai-video-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.ai-suggestion-chip {
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.03);
    color: #666;
    transition: all 0.15s;
    white-space: nowrap;
}

.ai-suggestion-chip:hover {
    background: rgba(221, 203, 164, 0.15);
    border-color: rgba(221, 203, 164, 0.4);
    color: #b89e6e;
    transform: translateY(-1px);
}

/* ═══ Cost Note ═══ */
.ai-cost-note {
    font-size: 11px;
    color: #999;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 209, 0, 0.04);
    border: 1px solid rgba(255, 209, 0, 0.1);
    line-height: 1.4;
}

.ai-cost-note strong {
    color: #DDCBA4;
}

/* ======================================================================= */
/* DRIVE TREE VIEW                                                         */
/* ======================================================================= */

.tree-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    font-size: 14px;
    color: rgba(40,40,40,0.5);
}

.tree-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--chanv-fibre);
    border-top: 3px solid var(--chanv-terre);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tree-error {
    padding: 16px;
    background: rgba(229,57,53,0.08);
    border-radius: 8px;
    color: #c62828;
    font-size: 13px;
    font-weight: 600;
}

.tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tree-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    flex-wrap: wrap;
}

.tree-folder-count {
    font-weight: 700;
    color: var(--chanv-terre);
}

.tree-root-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--chanv-terre);
    background: var(--chanv-fibre);
    padding: 4px 12px;
    border-radius: 8px;
}

.tree-cache-info {
    color: rgba(40,40,40,0.4);
    font-size: 11px;
}

.tree-blocked-count {
    background: rgba(229,57,53,0.1);
    color: #c62828;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.tree-actions {
    display: flex;
    gap: 8px;
}

.btn-tree-action {
    padding: 8px 16px;
    background: var(--chanv-fibre);
    border: 1px solid var(--chanv-beige);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--chanv-terre);
}

.btn-tree-action:hover {
    background: var(--chanv-beige);
    transform: translateY(-1px);
}

.btn-tree-save {
    padding: 8px 20px;
    background: var(--chanv-terre);
    color: var(--chanv-beige);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    opacity: 0.5;
}

.btn-tree-save:not(:disabled) {
    opacity: 1;
}

.btn-tree-save.modified {
    animation: pulseSave 1.5s ease infinite;
}

@keyframes pulseSave {
    0%, 100% { box-shadow: 0 0 0 0 rgba(40,40,40,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(40,40,40,0); }
}

.btn-tree-save:hover:not(:disabled) {
    background: var(--chanv-dore);
    color: white;
    transform: translateY(-1px);
}

.tree-legend {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: rgba(40,40,40,0.5);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--chanv-fibre);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-on {
    background: #4caf50;
}

.legend-off {
    background: #e53935;
}

.tree-body {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--chanv-fibre);
    border-radius: 12px;
    background: white;
}

.tree-node {
    border-bottom: 1px solid rgba(221,203,164,0.1);
}

.tree-node:last-child {
    border-bottom: none;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 0;
    cursor: pointer;
    transition: background 0.15s ease;
    min-height: 36px;
}

.tree-row:hover {
    background: rgba(248,244,236,0.6);
}

.tree-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: rgba(40,40,40,0.4);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    user-select: none;
}

.tree-toggle.open {
    color: var(--chanv-terre);
}

.tree-toggle.no-children {
    visibility: hidden;
}

.tree-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.tree-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--chanv-terre);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-child-count {
    font-size: 10px;
    color: rgba(40,40,40,0.3);
    flex-shrink: 0;
}

.tree-lock {
    font-size: 14px;
    flex-shrink: 0;
}

/* Switch toggle */
.tree-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    margin-left: auto;
}

.tree-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tree-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e53935;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.tree-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.tree-switch input:checked + .tree-slider {
    background: #4caf50;
}

.tree-switch input:checked + .tree-slider::before {
    transform: translateX(16px);
}

.tree-switch input:disabled + .tree-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Blocked state */
.tree-node.blocked > .tree-row .tree-name {
    color: rgba(40,40,40,0.35);
    text-decoration: line-through;
}

.tree-node.blocked > .tree-row .tree-icon {
    opacity: 0.4;
}

.tree-node.protected > .tree-row {
    background: rgba(229,57,53,0.04);
}

/* Source root nodes (top-level labeled folders) */
.tree-node.source-root {
    border-top: 2px solid var(--chanv-beige);
    margin-top: 4px;
}

.tree-node.source-root:first-child {
    border-top: none;
    margin-top: 0;
}

.tree-node.source-root > .tree-row {
    background: var(--chanv-fibre);
    min-height: 42px;
    padding: 8px 12px 8px 0;
}

.tree-node.source-root > .tree-row .tree-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.tree-node.source-root > .tree-row .tree-icon {
    font-size: 18px;
}

/* Children collapse */
.tree-children {
    overflow: hidden;
    max-height: 10000px;
    transition: max-height 0.3s ease;
}

.tree-children.collapsed {
    max-height: 0;
}

@media (max-width: 768px) {
    .tree-header { flex-direction: column; align-items: stretch; }
    .tree-actions { justify-content: flex-end; }
    .tree-body { max-height: 400px; }
    .tree-name { font-size: 12px; }
}

/* ═══════════════════════════════════════════
   Face Recognition UI
   ═══════════════════════════════════════════ */
.face-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.face-profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s;
}
.face-profile-card:hover { border-color: var(--accent); }

.face-profile-header { margin-bottom: 12px; }
.face-profile-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.face-profile-role {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.face-ref-thumbs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.face-ref-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.face-profile-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.face-profile-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.face-create-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.face-create-form h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
}
.btn-outline:hover { border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGING SYSTEM — Tabs, Messages, Reply Box, Uploads
   ═══════════════════════════════════════════════════════════════════════ */

.msg-tab-bar {
    display: flex;
    gap: 2px;
    background: var(--chanv-fibre);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 12px;
}

.msg-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: rgba(40,40,40,0.5);
    transition: all 0.2s;
    font-family: inherit;
}

.msg-tab:hover {
    color: rgba(40,40,40,0.7);
    background: rgba(255,255,255,0.5);
}

.msg-tab-active {
    background: white;
    color: var(--chanv-terre);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.msg-panel { display: block; }

.studio-msg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    margin-bottom: 12px;
    padding: 4px 2px;
}

.studio-msg-bubble {
    background: white;
    border: 1px solid var(--chanv-fibre);
    border-radius: 14px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}
.studio-msg-bubble:hover { border-color: var(--chanv-beige); }

.studio-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.studio-msg-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chanv-terre), var(--chanv-dore));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
}

.studio-msg-name { font-weight: 700; font-size: 13px; color: var(--chanv-terre); }
.studio-msg-date { font-size: 11px; color: rgba(40,40,40,0.35); margin-left: auto; }

.studio-msg-delete {
    border: none; background: transparent; cursor: pointer;
    font-size: 14px; padding: 2px 4px; border-radius: 6px;
    opacity: 0; transition: opacity 0.2s, background 0.2s;
}
.studio-msg-bubble:hover .studio-msg-delete { opacity: 0.5; }
.studio-msg-delete:hover { opacity: 1 !important; background: rgba(229,57,53,0.08); }

.studio-msg-content { font-size: 14px; line-height: 1.55; color: #333; word-break: break-word; }

.mention-highlight {
    color: var(--chanv-dore); font-weight: 700;
    background: rgba(201,169,110,0.1); padding: 1px 4px; border-radius: 4px;
}

.studio-msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.studio-msg-att-img {
    width: 80px; height: 80px; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--chanv-fibre);
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.studio-msg-att-img:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

.studio-reply-box {
    background: white; border: 1px solid var(--chanv-fibre);
    border-radius: 14px; padding: 14px; transition: border-color 0.2s;
}
.studio-reply-box:focus-within {
    border-color: var(--chanv-dore); box-shadow: 0 0 0 3px rgba(201,169,110,0.08);
}

.studio-reply-textarea {
    width: 100%; min-height: 60px;
    border: 1px solid var(--chanv-fibre); border-radius: 10px;
    padding: 10px 14px; font-size: 13px; font-family: inherit;
    resize: vertical; box-sizing: border-box; transition: border-color 0.2s;
}
.studio-reply-textarea:focus { outline: none; border-color: var(--chanv-dore); }
.studio-reply-textarea.drag-over {
    border-color: #1565c0; border-style: dashed;
    background: rgba(21,101,192,0.03); box-shadow: 0 0 0 3px rgba(21,101,192,0.08);
}

.studio-upload-preview {
    display: none; flex-wrap: wrap; gap: 8px;
    margin-top: 8px; padding: 8px;
    background: rgba(0,0,0,0.02); border-radius: 10px;
}

.upload-preview-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.upload-preview-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--chanv-fibre); }
.upload-preview-remove {
    position: absolute; top: -4px; right: -4px; width: 20px; height: 20px;
    border-radius: 50%; background: #e53935; color: white; border: none;
    font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.upload-preview-remove:hover { transform: scale(1.15); }
.upload-preview-name { font-size: 10px; color: rgba(40,40,40,0.4); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.upload-preview-loading { padding: 8px 16px; background: rgba(201,169,110,0.08); border-radius: 8px; font-size: 12px; color: rgba(40,40,40,0.5); animation: aiPulse 1.5s ease-in-out infinite; }

.studio-attach-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.studio-attach-btn {
    border: 1px solid var(--chanv-fibre); background: white;
    cursor: pointer; padding: 6px 12px; border-radius: 8px;
    font-size: 12px; font-weight: 600; display: inline-flex;
    align-items: center; gap: 4px; transition: all 0.15s;
    font-family: inherit; color: var(--chanv-terre);
}
.studio-attach-btn:hover { background: var(--chanv-fibre); border-color: var(--chanv-beige); }

.studio-send-btn {
    margin-left: auto;
    background: linear-gradient(135deg, var(--chanv-terre), var(--chanv-dore));
    color: white; border: none; padding: 8px 20px; border-radius: 10px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.2s; font-family: inherit;
}
.studio-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,115,85,0.3); }
.studio-send-btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

.studio-asset-picker {
    display: none; flex-wrap: wrap; gap: 6px; margin-top: 10px;
    max-height: 200px; overflow-y: auto; padding: 8px;
    background: rgba(0,0,0,0.02); border-radius: 8px;
}

.studio-asset-picker-item {
    display: flex; align-items: center; gap: 6px; padding: 4px 8px;
    background: white; border: 1px solid var(--chanv-fibre);
    border-radius: 8px; cursor: pointer; font-size: 12px; transition: all 0.15s;
}
.studio-asset-picker-item:hover { border-color: var(--chanv-dore); background: rgba(201,169,110,0.04); }

.studio-mention-dropdown {
    display: none; position: absolute; z-index: 9999;
    background: white; border: 1px solid var(--chanv-fibre);
    border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    max-height: 220px; overflow-y: auto; min-width: 240px; padding: 4px;
}

@media (prefers-color-scheme: dark) {
    .msg-tab-bar { background: rgba(255,255,255,0.04); }
    .msg-tab { color: rgba(255,255,255,0.4); }
    .msg-tab:hover { color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); }
    .msg-tab-active { background: rgba(255,255,255,0.08); color: #e0dcd6; }
    .studio-msg-bubble { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
    .studio-msg-bubble:hover { border-color: rgba(255,255,255,0.12); }
    .studio-msg-name { color: #e0dcd6; }
    .studio-msg-content { color: #ccc; }
    .studio-reply-box { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
    .studio-reply-textarea { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); color: #e0dcd6; }
    .studio-attach-btn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); color: #ccc; }
    .studio-mention-dropdown { background: #1e1e1e; border-color: rgba(255,255,255,0.1); color: #e0dcd6; }
    .studio-asset-picker { background: rgba(255,255,255,0.03); }
    .studio-asset-picker-item { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); color: #ccc; }
    .upload-preview-item img { border-color: rgba(255,255,255,0.08); }
}




/* ═══════════════════════════════════════════════════════════════
   GANDALF EMBED — nav interne en pastilles (#gandalf-embed-nav)
   Le chrome (.main-header) est masqué par /gandalf/embed-client.js
   quand l'app est cadrée dans le shell — « masqué ≠ perdu » :
   la navigation par onglets est reconstruite ici (sticky #F4EFE3,
   actif #A8863F). Ajustements d'espacement propres à l'embed.
   ═══════════════════════════════════════════════════════════════ */
#gandalf-embed-nav { display: none; }
html.gandalf-embed #gandalf-embed-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px 4px;
    position: sticky;
    top: 0;
    z-index: 60;
    background: #F4EFE3;
}
html.gandalf-embed .gen-tab {
    background: #fff;
    border: 1px solid rgba(40, 34, 24, .10);
    border-radius: 999px;
    padding: 8px 15px;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(40, 38, 34, .66);
    cursor: pointer;
    transition: all .15s ease;
}
html.gandalf-embed .gen-tab:hover {
    border-color: rgba(168, 134, 63, .45);
    color: rgba(40, 38, 34, .9);
}
html.gandalf-embed .gen-tab.on {
    background: #A8863F;
    border-color: #A8863F;
    color: #fff;
}
html.gandalf-embed .container { padding-top: 12px; }

/* ═══════════════════════════════════════════════════════════════
   MODE SOMBRE GANDALF — html.gandalf-dark posé par /gandalf/embed-client.js
   (thème relayé par le hub). Append-only : palette
   #201d19 / #2b2823 / rgba(255,255,255,.92) / rgba(221,203,164,.14) / #DDCBA4.
   ═══════════════════════════════════════════════════════════════ */
html.gandalf-dark {
    --chanv-blanc: #201d19;
    --chanv-fibre: #2b2823;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-bold: 0 12px 40px rgba(0, 0, 0, 0.5);
}
html.gandalf-dark body {
    background-color: #201d19;
    background-image: radial-gradient(rgba(221, 203, 164, 0.07) 1px, transparent 1px);
    color: rgba(255, 255, 255, 0.92);
}

/* --- Chrome / header / nav --- */
html.gandalf-dark .main-header { background: #2b2823; color: rgba(255, 255, 255, 0.92); border-color: rgba(221, 203, 164, .14); }
html.gandalf-dark .header-titles h1 { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .header-titles p { color: rgba(255, 255, 255, 0.55); }
html.gandalf-dark .logo-wrapper { background: #F1EADA; border-radius: 10px; }
html.gandalf-dark .nav-tab { color: rgba(255, 255, 255, 0.66); }
html.gandalf-dark .nav-tab:hover { background: rgba(221, 203, 164, 0.14); color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .nav-tab.active { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .user-name { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .user-role { color: rgba(255, 255, 255, 0.55); }

/* --- Nav embed pastilles --- */
html.gandalf-dark.gandalf-embed #gandalf-embed-nav { background: #201d19; }
html.gandalf-dark.gandalf-embed .gen-tab {
    background: #2b2823;
    border-color: rgba(221, 203, 164, .14);
    color: rgba(255, 255, 255, .66);
}
html.gandalf-dark.gandalf-embed .gen-tab:hover {
    border-color: rgba(221, 203, 164, .4);
    color: rgba(255, 255, 255, .92);
}
html.gandalf-dark.gandalf-embed .gen-tab.on { background: #DDCBA4; border-color: #DDCBA4; color: #201d19; }

/* --- Login / blocked --- */
html.gandalf-dark #login-overlay,
html.gandalf-dark #blocked-overlay { background: #201d19; }
html.gandalf-dark .login-card { background: #2b2823; color: rgba(255, 255, 255, 0.92); border-color: rgba(221, 203, 164, .14); }
html.gandalf-dark .login-card h2 { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .login-card p { color: rgba(255, 255, 255, 0.65); }

/* --- Surfaces / cartes --- */
html.gandalf-dark .search-hero,
html.gandalf-dark .category-explorer,
html.gandalf-dark .gallery-toolbar,
html.gandalf-dark .admin-card,
html.gandalf-dark .kpi-card,
html.gandalf-dark .chart-card,
html.gandalf-dark .asset-card,
html.gandalf-dark .cat-card,
html.gandalf-dark .collection-card,
html.gandalf-dark .project-card,
html.gandalf-dark .brand-tab-card,
html.gandalf-dark .face-profile-card,
html.gandalf-dark .face-create-form,
html.gandalf-dark .modal-content,
html.gandalf-dark .edit-modal,
html.gandalf-dark .dup-group,
html.gandalf-dark .duplicates-panel,
html.gandalf-dark .upload-dropzone,
html.gandalf-dark .upload-toolbar,
html.gandalf-dark .upload-queue,
html.gandalf-dark .studio-welcome,
html.gandalf-dark .welcome-step,
html.gandalf-dark .welcome-brand-card {
    background: #2b2823;
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(221, 203, 164, .14);
}
html.gandalf-dark .admin-card h3,
html.gandalf-dark .chart-card h3,
html.gandalf-dark .section-header h2,
html.gandalf-dark .welcome-step h3,
html.gandalf-dark .modal-header h3 { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .section-subtitle,
html.gandalf-dark .kpi-label,
html.gandalf-dark .welcome-step p,
html.gandalf-dark .welcome-subtitle { color: rgba(255, 255, 255, 0.6); }
html.gandalf-dark .kpi-value { color: #DDCBA4; }
html.gandalf-dark .admin-card p { color: rgba(255, 255, 255, 0.6) !important; }

/* --- Inputs / selects --- */
html.gandalf-dark .search-input,
html.gandalf-dark .filter-select,
html.gandalf-dark .admin-input,
html.gandalf-dark .form-input,
html.gandalf-dark .form-group input,
html.gandalf-dark .form-group textarea,
html.gandalf-dark .form-group select,
html.gandalf-dark #ai-studio-prompt,
html.gandalf-dark input[type="date"].filter-select {
    background: #201d19;
    border-color: rgba(221, 203, 164, .14);
    color: rgba(255, 255, 255, 0.92);
}
html.gandalf-dark .search-input::placeholder,
html.gandalf-dark #ai-studio-prompt::placeholder { color: rgba(255, 255, 255, 0.4); }
html.gandalf-dark .search-input:focus,
html.gandalf-dark .filter-select:focus { border-color: #DDCBA4; }
html.gandalf-dark .search-wrapper { background: #201d19; border-color: rgba(221, 203, 164, .14); }

/* --- Boutons / pastilles / sous-onglets --- */
html.gandalf-dark .toolbar-btn,
html.gandalf-dark .view-btn,
html.gandalf-dark .btn-outline,
html.gandalf-dark .q-subtab,
html.gandalf-dark .search-period-btn,
html.gandalf-dark .admin-subtab {
    background: #2b2823;
    border-color: rgba(221, 203, 164, .14);
    color: rgba(255, 255, 255, 0.66);
}
html.gandalf-dark .toolbar-btn:hover,
html.gandalf-dark .view-btn:hover,
html.gandalf-dark .admin-subtab:hover { background: rgba(221, 203, 164, 0.14); color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .view-btn.active,
html.gandalf-dark .q-subtab.active,
html.gandalf-dark .search-period-btn.active,
html.gandalf-dark .admin-subtab.active { background: #DDCBA4; color: #201d19; border-color: #DDCBA4; }
html.gandalf-dark .btn-primary { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .brand-pill { border-color: rgba(221, 203, 164, .14); }
html.gandalf-dark .brand-pill.active { background: #DDCBA4; color: #201d19; }
html.gandalf-dark .suggestion-chip {
    background: #2b2823;
    border-color: rgba(221, 203, 164, .14);
    color: rgba(255, 255, 255, 0.75);
}
html.gandalf-dark .suggestion-chip:hover { border-color: #DDCBA4; color: #DDCBA4; }

/* --- Asset cards / galerie --- */
html.gandalf-dark .asset-card-name { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .asset-card-meta { color: rgba(255, 255, 255, 0.5); }
html.gandalf-dark .asset-counter { color: rgba(255, 255, 255, 0.6); }
html.gandalf-dark .skeleton-card { background: #2b2823; }
html.gandalf-dark .skeleton-thumb,
html.gandalf-dark .skeleton-line { background: rgba(221, 203, 164, 0.14); }
html.gandalf-dark .gallery-empty { color: rgba(255, 255, 255, 0.6); }

/* --- AI Studio panel --- */
html.gandalf-dark .ai-studio-panel { background: #2b2823; border-color: rgba(221, 203, 164, .14); }
html.gandalf-dark .ai-studio-header { background: #201d19; color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .ai-msg-assistant { background: #201d19; color: rgba(255, 255, 255, 0.92); }

/* --- Divers --- */
html.gandalf-dark .bulk-action-bar { background: #2b2823; border-color: rgba(221, 203, 164, .14); }
html.gandalf-dark .page-btn { background: #2b2823; color: rgba(255, 255, 255, 0.75); border-color: rgba(221, 203, 164, .14); }
html.gandalf-dark .page-btn:hover:not(:disabled) { border-color: #DDCBA4; }
html.gandalf-dark .category-explorer-header h3 { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .welcome-title { color: rgba(255, 255, 255, 0.92); }
html.gandalf-dark .welcome-title-brand { color: #DDCBA4; }

/* Fenêtres redimensionnées (desktop) : les pastilles d'embed passent à la
   ligne — scrollbar masquée + molette = derniers onglets inaccessibles. */
@media (hover: hover) and (pointer: fine) {
    html.gandalf-embed #gandalf-embed-nav,
    #gandalf-embed-nav { flex-wrap: wrap; overflow-x: visible; }
}
