:root {
    --gcg-black: #000000;
    --gcg-yellow: #ffcb0e;
    --gcg-grey: #a1a1a1;
    --gcg-dark: #3a3a3a;
    --bg: #050505;
    --panel: rgba(18, 18, 18, 0.94);
    --panel-2: rgba(28, 28, 28, 0.94);
    --text: #f5f5f5;
    --muted: #bdbdbd;
    --border: rgba(255, 255, 255, 0.13);
    --border-strong: rgba(255, 203, 14, 0.55);
    --danger: #ff5b5b;
    --success: #43d37d;
    --warning: #ffcb0e;
    --radius: 8px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
    --font-body: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-title: Florenia, Poppins, system-ui, sans-serif;
    font-family: var(--font-body);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 8%, rgba(255, 203, 14, 0.15), transparent 24rem),
        radial-gradient(circle at 90% 0%, rgba(161, 161, 161, 0.10), transparent 26rem),
        linear-gradient(145deg, #000000, #111111 56%, #050505);
    color: var(--text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent 72%);
}

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

.auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card,
.edit-card,
.hero-panel,
.empty-state,
.admin-shortcut,
.table-card,
.stat-card,
.callout {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(450px, 100%);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.auth-card::before,
.hero-panel::before,
.app-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 203, 14, 0.85), rgba(161, 161, 161, 0.12), rgba(255, 203, 14, 0.18));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.auth-card.wide { width: min(600px, 100%); }

.brand-lockup { margin-bottom: 22px; }

.brand-logo {
    display: block;
    width: min(260px, 78vw);
    max-width: 100%;
    height: auto;
}

.auth-logo {
    width: min(280px, 80vw) !important;
    height: auto !important;
    max-height: 112px;
    object-fit: contain;
}

.brand-mark {
    display: block;
    width: 42px !important;
    height: 42px !important;
    object-fit: contain;
}

.topbar-logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-title {
    color: var(--gcg-yellow);
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.86rem;
    white-space: nowrap;
}

.topbar-brand {
    width: 138px !important;
    height: auto !important;
    max-height: 42px !important;
    object-fit: contain;
}

.topbar img {
    max-height: 42px !important;
}

h1, h2, p { margin-top: 0; }

h1 {
    font-family: var(--font-title);
    font-size: clamp(2.05rem, 5vw, 3.45rem);
    line-height: 1.02;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

h2 { font-size: 1.25rem; margin-bottom: 8px; }

.muted, .muted small { color: var(--muted); }

.form-stack,
.edit-card {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #eaeaea;
    font-weight: 800;
}

input,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080808;
    color: var(--text);
    padding: 13px 14px;
    font: inherit;
}

input:focus,
select:focus {
    outline: 2px solid rgba(255, 203, 14, 0.55);
    border-color: var(--gcg-yellow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 11px 18px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
    background: linear-gradient(135deg, #ffcb0e, #f6b800);
    color: #090909;
    box-shadow: 0 10px 28px rgba(255, 203, 14, 0.16);
}

.btn.secondary {
    background: rgba(255, 203, 14, 0.05);
    color: var(--gcg-yellow);
    border-color: var(--gcg-yellow);
}

.alert {
    border-radius: var(--radius);
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.07);
    margin: 12px 0;
}

.alert.danger { border-color: rgba(255, 91, 91, 0.7); color: #ffd2d2; }
.alert.success { border-color: rgba(67, 211, 125, 0.7); color: #ccffe0; }
.alert.warning { border-color: rgba(255, 203, 14, 0.7); color: #fff0b5; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    max-height: 80px;
    overflow: hidden;
    padding: 12px clamp(16px, 4vw, 48px);
    background: rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 203, 14, 0.18);
}

.topbar-user,
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-weight: 800;
}

.topbar-user a,
.topbar-nav a,
.text-link {
    color: var(--gcg-yellow);
    font-weight: 900;
}

.username-chip {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--gcg-grey);
    padding: 4px 8px;
    font-size: 0.85rem;
    font-weight: 900;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 60px;
    position: relative;
    z-index: 1;
}

.page-shell.narrow { width: min(860px, calc(100% - 32px)); }

.hero-panel {
    position: relative;
    padding: clamp(22px, 5vw, 44px);
    margin-bottom: 24px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 203, 14, 0.14), rgba(255, 255, 255, 0.025)),
        var(--panel);
}
.hero-panel.compact h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }

.eyebrow {
    color: var(--gcg-yellow);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    margin-bottom: 10px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.app-card {
    position: relative;
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel);
    overflow: hidden;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 203, 14, 0.72);
    background: var(--panel-2);
}

.app-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: #080808;
    border: 1px solid rgba(255, 203, 14, 0.58);
    font-size: 1.45rem;
}

.app-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.app-card p { color: var(--muted); margin-bottom: 0; line-height: 1.45; }

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 203, 14, 0.55);
    color: var(--gcg-yellow);
    padding: 4px 9px;
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.pill.ok { border-color: rgba(67, 211, 125, 0.6); color: var(--success); }
.pill.muted-pill { border-color: rgba(255, 255, 255, 0.25); color: var(--muted); }

.empty-state,
.admin-shortcut,
.edit-card,
.table-card,
.callout {
    padding: 24px;
    margin-top: 20px;
}

.callout {
    border-color: rgba(255, 203, 14, 0.28);
    background: rgba(255, 203, 14, 0.055);
    color: #fff4c2;
    box-shadow: none;
}

.admin-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.section-head h1 { margin-bottom: 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-card { padding: 22px; }
.stat-card strong { display: block; color: var(--gcg-yellow); font-size: 1.8rem; }
.stat-card span { color: var(--muted); font-weight: 800; }

.admin-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--gcg-yellow); font-size: 0.83rem; text-transform: uppercase; letter-spacing: 0.08em; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }

.access-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.access-box legend { color: var(--gcg-yellow); font-weight: 900; padding: 0 8px; }

.check-row {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.check-row:last-child { border-bottom: 0; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; }
.check-row small { display: block; color: var(--muted); margin-top: 3px; font-weight: 500; }

.app-admin-list { display: grid; gap: 16px; margin-top: 16px; }
.mini-app-form { margin-top: 0; }

@media (max-width: 720px) {
    .topbar { align-items: center; max-height: none; overflow: visible; }
    .topbar-brand { width: 112px !important; }
    .brand-mark { width: 38px !important; height: 38px !important; }
    .topbar-title { display: none; }
    .topbar-user, .topbar-nav { justify-content: flex-end; font-size: 0.9rem; }
    .app-card { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .admin-shortcut { align-items: flex-start; }
}

/* V6 — logo complet GCG + nouvelles */
.topbar-logo-wrap {
    flex: 0 1 auto;
    max-width: min(330px, 42vw);
}

.topbar-brand-full {
    display: block;
    width: min(300px, 42vw) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 52px !important;
    object-fit: contain;
}

.auth-card .brand-lockup {
    display: flex;
    justify-content: center;
    margin-bottom: 26px;
}

.auth-logo {
    width: min(360px, 86vw) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 96px !important;
    object-fit: contain;
}

textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #080808;
    color: var(--text);
    padding: 13px 14px;
    font: inherit;
    resize: vertical;
    min-height: 120px;
}

textarea:focus {
    outline: 2px solid rgba(255, 203, 14, 0.55);
    border-color: var(--gcg-yellow);
}

input[type="file"] {
    padding: 10px;
}

.news-panel {
    position: relative;
    margin: 0 0 24px;
    padding: clamp(18px, 4vw, 26px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 203, 14, 0.22);
    background:
        linear-gradient(145deg, rgba(255, 203, 14, 0.08), rgba(255, 255, 255, 0.025)),
        var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.news-panel::before,
.news-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 203, 14, 0.62), rgba(161, 161, 161, 0.08), rgba(255, 203, 14, 0.18));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.compact-head {
    margin-bottom: 14px;
}

.compact-head h2 {
    margin-bottom: 0;
}

.no-news {
    border: 1px dashed rgba(255, 203, 14, 0.35);
    border-radius: var(--radius);
    padding: 18px;
    color: var(--muted);
    font-weight: 800;
    background: rgba(0, 0, 0, 0.24);
}

.news-carousel {
    position: relative;
}

.news-track {
    position: relative;
}

.news-slide {
    position: relative;
    display: none;
    grid-template-columns: minmax(180px, 34%) 1fr;
    gap: 20px;
    align-items: stretch;
    min-height: 230px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(8, 8, 8, 0.72);
    overflow: hidden;
}

.news-slide.is-active {
    display: grid;
}

.news-photo {
    min-height: 190px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 203, 14, 0.3);
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 203, 14, 0.16), transparent 14rem),
        #060606;
    overflow: hidden;
}

.news-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-photo.placeholder {
    display: grid;
    place-items: center;
}

.news-photo.placeholder span {
    font-size: clamp(3rem, 9vw, 5.5rem);
    filter: drop-shadow(0 12px 28px rgba(255, 203, 14, 0.12));
}

.news-content {
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 4px 4px 4px 0;
}

.news-content h3 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    line-height: 1.1;
}

.news-content p {
    margin: 0;
    color: #e8e8e8;
    line-height: 1.65;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gcg-yellow);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.news-emoji {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: #080808;
    border: 1px solid rgba(255, 203, 14, 0.55);
    font-size: 1.05rem;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.carousel-btn,
.carousel-dot {
    border: 1px solid rgba(255, 203, 14, 0.62);
    background: rgba(0, 0, 0, 0.42);
    color: var(--gcg-yellow);
    cursor: pointer;
}

.carousel-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    font-size: 1.8rem;
    line-height: 1;
}

.carousel-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.carousel-dot {
    width: 30px;
    height: 10px;
    border-radius: 999px;
    padding: 0;
}

.carousel-dot.is-active {
    background: var(--gcg-yellow);
}

.news-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.news-admin-preview {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 203, 14, 0.28);
    margin-bottom: 16px;
}

.inline-actions {
    margin-top: 16px;
}

.danger-btn {
    background: rgba(255, 91, 91, 0.08);
    color: #ffd2d2;
    border-color: rgba(255, 91, 91, 0.6);
}

@media (max-width: 820px) {
    .topbar-logo-wrap {
        max-width: 48vw;
    }

    .topbar-brand-full {
        width: min(210px, 48vw) !important;
        max-height: 46px !important;
    }

    .news-slide,
    .news-slide.is-active {
        grid-template-columns: 1fr;
    }

    .news-photo {
        min-height: 180px;
    }

    .news-content {
        padding: 0;
    }
}

@media (max-width: 520px) {
    .topbar {
        gap: 10px;
    }

    .topbar-logo-wrap {
        max-width: 54vw;
    }

    .topbar-brand-full {
        width: min(190px, 54vw) !important;
        max-height: 40px !important;
    }

    .topbar-user,
    .topbar-nav {
        gap: 8px;
    }

    .username-chip {
        display: none;
    }

    .auth-logo {
        max-height: 78px !important;
    }
}
