:root {
    --bg-page: #f8f7f4;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --text-main: #191b1d;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --primary: #f3b200;
    --primary-hover: #e0a300;
    --primary-light: #fff8e6;
    --dark: #121316;
    --dark-surface: #1e2024;
    --border-color: #e5e4de;
    --border-light: #f0eee8;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --font-heading: 'Bebas Neue', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* NAVBAR */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-logo {
    height: 42px;
    width: auto;
}

.nav-title-group {
    display: flex;
    flex-direction: column;
}

.nav-app-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    letter-spacing: 1.5px;
    line-height: 1;
    color: #111;
}

.nav-app-tagline {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: #111;
    background: #f0eee8;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f3ef;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.user-type-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: #111;
    color: #fff;
}

.user-type-tag.sso {
    background: #f3b200;
    color: #111;
}

.btn-logout {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid #d1cfc7;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* MAIN CONTAINER */
.main-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* HERO / STATS HEADER */
.hero-header {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #ffffff;
    padding: 24px 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.hero-text h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    letter-spacing: 1px;
    margin-bottom: 4px;
    color: #111;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stats-grid {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-card {
    background: #fbfaf7;
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 105px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #111;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* FILTER & SEARCH BAR */
.controls-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.controls-row-top {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.search-box {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fcfbfa;
    font-size: 0.95rem;
    color: #111;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #111;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 500;
    color: #111;
    cursor: pointer;
    font-family: inherit;
}

.filter-select:focus {
    outline: none;
    border-color: #111;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    background: #f8f7f4;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    user-select: none;
}

.checkbox-label input {
    cursor: pointer;
    accent-color: #111;
}

.view-toggles {
    margin-left: auto;
    display: flex;
    align-items: center;
    background: #f0eee8;
    padding: 3px;
    border-radius: var(--radius-md);
}

.view-btn {
    border: none;
    background: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.view-btn.active {
    background: #ffffff;
    color: #111;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* TYPE BADGES */
.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.type-video { background: #e0f2fe; color: #0369a1; }
.type-plv { background: #e0f7fa; color: #00838f; }
.type-shooting { background: #ccfbf1; color: #0f766e; }
.type-operation { background: #dcfce7; color: #15803d; }
.type-article-de-presse { background: #fee2e2; color: #b91c1c; }
.type-packaging { background: #fef3c7; color: #b45309; }
.type-calicot-travaux { background: #fef9c3; color: #a16207; }
.type-reseaux-sociaux { background: #ffedd5; color: #c2410c; }
.type-signaletique { background: #cffafe; color: #0e7490; }
.type-site-internet { background: #fef08a; color: #854d0e; }
.type-annonce-presse { background: #fce7f3; color: #be185d; }
.type-publicite-video { background: #bbf7d0; color: #166534; }
.type-communication-interne { background: #fef08a; color: #713f12; }
.type-identite-visuel { background: #fbcfe8; color: #9d174d; }
.type-newsletter { background: #fed7aa; color: #9a3412; }
.type-habillage { background: #f3e8ff; color: #6b21a8; }
.type-default { background: #f3f4f6; color: #4b5563; }

/* MEDIA GRID */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.media-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.media-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #d1cfc7;
}

.media-thumbnail-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f1efe9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-card:hover .media-thumbnail-img {
    transform: scale(1.03);
}

.media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
}

.media-card-top-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.media-year-badge {
    background: rgba(17, 17, 17, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.drive-available-badge {
    background: #2563eb;
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.media-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.media-op-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #f3b200;
    color: #b45309;
    margin-bottom: 6px;
    display: inline-block;
}

.media-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.3;
}

.media-comment {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
}

.media-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-drive-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-drive-sm:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.btn-view-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #f4f3ef;
    border: 1px solid var(--border-color);
    color: #374151;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-view-sm:hover {
    background: #e5e4de;
}

/* LIST VIEW */
.media-list {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.list-table th {
    background: #faf9f6;
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: #4b5563;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.list-table tr:hover {
    background: #fcfbfa;
}

.list-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1efe9;
}

/* MODAL / LIGHTBOX */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    position: relative;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: #000;
}

.modal-content-split {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-visual-col {
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 350px;
}

.modal-visual-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-info-col {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.2;
}

.modal-op-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f3b200;
    color: #b45309;
    margin-bottom: 16px;
}

.modal-meta-grid {
    background: #fbfaf7;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.85rem;
}

.meta-item-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.meta-item-value {
    font-weight: 600;
    color: #111;
}

.modal-comment-box {
    margin-bottom: 24px;
    padding: 14px 18px;
    background: #fffdf7;
    border-left: 4px solid #f3b200;
    border-radius: 4px;
    font-size: 0.92rem;
    color: #2e3338;
    line-height: 1.5;
    white-space: pre-line;
}

.modal-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-gdrive-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #111;
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-gdrive-primary:hover {
    background: #2b2b2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    color: #fff;
}

.btn-ext-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f4f3ef;
    border: 1px solid var(--border-color);
    color: #111;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.btn-ext-link:hover {
    background: #e5e4de;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 14px;
    margin-bottom: 6px;
}

.empty-state-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}
