:root {
    --ink: #10251f;
    --muted: #64736e;
    --green: #0c5c47;
    --green-dark: #073e31;
    --green-soft: #e6f2ed;
    --gold: #dca832;
    --cream: #f7f4ec;
    --paper: #fffdf8;
    --line: #dce4df;
    --white: #fff;
    --shadow: 0 24px 60px rgba(16, 54, 43, .12);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; line-height: 1.55; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.site-header, .admin-header { width: min(1200px, calc(100% - 48px)); height: 88px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand img { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--green-soft); }
.brand span { display: grid; line-height: 1.2; }
.brand strong { color: var(--green-dark); font-size: 1rem; letter-spacing: -.01em; }
.brand small { color: var(--muted); margin-top: 4px; font-size: .72rem; }
.button { min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; font-size: .88rem; cursor: pointer; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--green); color: var(--white); box-shadow: 0 10px 26px rgba(12, 92, 71, .2); }
.button-primary:hover { background: var(--green-dark); }
.button-ghost { background: transparent; color: var(--green-dark); border-color: #bfd1ca; }
.button-light { background: var(--white); color: var(--green-dark); }

.section-shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.hero { min-height: 590px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 90px; padding-block: 65px 100px; position: relative; }
.hero::before { content: ""; position: absolute; width: 430px; height: 430px; right: -12%; top: 20px; background: radial-gradient(circle, rgba(220,168,50,.16), transparent 65%); pointer-events: none; }
.eyebrow { margin: 0 0 14px; color: var(--green); font-size: .72rem; line-height: 1.2; text-transform: uppercase; letter-spacing: .19em; font-weight: 850; }
.hero h1 { max-width: 720px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(3.1rem, 6vw, 5.5rem); line-height: .98; letter-spacing: -.05em; color: #102a23; }
.hero h1 em { color: var(--green); font-weight: inherit; }
.hero-intro { max-width: 600px; margin: 28px 0 0; color: var(--muted); font-size: 1.05rem; }
.hero-actions { margin-top: 32px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.updated { display: inline-flex; gap: 9px; align-items: center; color: var(--muted); font-size: .78rem; }
.updated i, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3cb878; box-shadow: 0 0 0 5px rgba(60,184,120,.13); }
.hero-card { min-height: 350px; padding: 48px; border-radius: 34px; background: linear-gradient(145deg, #0e664f, #073e31 72%); color: white; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-card::after { content: "✦"; position: absolute; right: -20px; bottom: -55px; color: rgba(255,255,255,.08); font-size: 12rem; }
.card-kicker { color: rgba(255,255,255,.68); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 800; }
.hero-card > strong { margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 5vw, 4.5rem); font-weight: 500; line-height: 1.1; letter-spacing: -.05em; }
.secondary-total { margin-top: 7px; color: #f4d98e; font-weight: 700; }
.card-divider { height: 1px; margin: 35px 0 24px; background: rgba(255,255,255,.18); }
.mini-stats { display: flex; gap: 30px; color: rgba(255,255,255,.7); font-size: .74rem; }
.mini-stats span { display: grid; }
.mini-stats b { color: white; font-size: 1.2rem; }

.stats-strip { min-height: 142px; padding-inline: max(24px, calc((100% - 1120px) / 2)); display: grid; grid-template-columns: repeat(3, 1fr); background: var(--cream); border-block: 1px solid #ece6d8; }
.stats-strip > div { display: flex; align-items: center; gap: 18px; padding: 28px 55px; border-right: 1px solid #ded9cd; }
.stats-strip > div:first-child { padding-left: 0; }
.stats-strip > div:last-child { border: 0; }
.stat-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--green); background: var(--white); border: 1px solid #dfded7; font-family: Georgia, serif; font-weight: bold; }
.stats-strip p { display: grid; margin: 0; }
.stats-strip strong { font-family: Georgia, serif; font-size: 1.55rem; letter-spacing: -.03em; }
.stats-strip small { color: var(--muted); font-size: .75rem; }

.story, .results { padding-block: 110px; }
.section-heading { margin-bottom: 44px; display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: 80px; }
.section-heading h2, .admin-callout h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 4vw, 3.6rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; }
.section-heading > p { margin: 0; color: var(--muted); font-size: .92rem; }
.carousel { height: min(62vw, 590px); min-height: 420px; position: relative; overflow: hidden; border-radius: 30px; background: var(--green-dark); box-shadow: var(--shadow); }
.carousel-track, .carousel-slide { position: absolute; inset: 0; }
.carousel-slide { margin: 0; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s ease; }
.carousel-slide.is-active { opacity: 1; visibility: visible; }
.carousel-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(5,36,28,.72)); }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide figcaption { position: absolute; left: 32px; bottom: 26px; z-index: 1; display: flex; align-items: center; gap: 12px; color: white; font-weight: 700; font-size: .85rem; }
.carousel-slide figcaption span { color: #f4d98e; font-family: Georgia, serif; font-size: 1.25rem; }
.carousel-arrow { position: absolute; z-index: 3; top: 50%; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: rgba(4,44,33,.45); color: white; cursor: pointer; backdrop-filter: blur(8px); }
.carousel-arrow:hover { background: var(--white); color: var(--green-dark); }
.carousel-arrow.previous { left: 24px; }
.carousel-arrow.next { right: 24px; }
.carousel-dots { position: absolute; z-index: 3; right: 30px; bottom: 30px; display: flex; gap: 8px; }
.carousel-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 10px; background: rgba(255,255,255,.5); cursor: pointer; transition: width .2s ease, background .2s ease; }
.carousel-dots button.is-active { width: 26px; background: white; }

.results { border-top: 1px solid #e9edea; }
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.year-card { min-height: 230px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: white; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(14, 61, 48, .04); }
.year-card.best-year { color: white; border-color: var(--green); background: linear-gradient(145deg, #0f684f, #094735); box-shadow: 0 20px 44px rgba(12,92,71,.18); }
.year-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.year-label { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; }
.best-badge { padding: 6px 10px; border-radius: 99px; background: rgba(244,217,142,.18); color: #f5df9f; text-transform: uppercase; letter-spacing: .08em; font-size: .58rem; font-weight: 850; }
.year-card > strong { margin-top: 25px; font-family: Georgia, serif; font-size: 2rem; letter-spacing: -.04em; }
.mru-line { color: var(--muted); font-size: .76rem; }
.best-year .mru-line, .best-year small { color: rgba(255,255,255,.67); }
.progress { height: 6px; margin: auto 0 14px; overflow: hidden; border-radius: 8px; background: var(--green-soft); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.best-year .progress { background: rgba(255,255,255,.15); }
.year-card small { color: var(--muted); }
.currency-note { margin: 28px 0 0; padding: 15px 18px; display: flex; gap: 12px; align-items: center; border-radius: 14px; background: var(--cream); color: var(--muted); font-size: .76rem; }
.currency-note span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #c7cec9; border-radius: 50%; color: var(--green); font-family: Georgia, serif; font-weight: bold; }

.admin-callout { margin-bottom: 110px; padding: 60px 66px; border-radius: 30px; background: var(--green-dark); color: white; display: flex; align-items: center; justify-content: space-between; gap: 60px; position: relative; overflow: hidden; }
.admin-callout::after { content: ""; position: absolute; width: 240px; height: 240px; right: 20%; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.admin-callout > div { max-width: 650px; position: relative; z-index: 1; }
.admin-callout .eyebrow { color: #e9c86f; }
.admin-callout h2 { font-size: 2.7rem; }
.admin-callout p:last-child { margin-bottom: 0; color: rgba(255,255,255,.65); }
.admin-callout .button { position: relative; z-index: 1; flex: 0 0 auto; }
footer { min-height: 90px; padding-inline: max(24px, calc((100% - 1120px) / 2)); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .72rem; }

.alert { padding: 14px 17px; border-radius: 12px; font-size: .85rem; }
.alert-error { color: #852d2d; border: 1px solid #e8b8b8; background: #fff1f1; }
.alert-success { color: #176347; border: 1px solid #a9d8c5; background: #ecf8f3; }

/* Connexion */
.login-page { min-height: 100vh; background: radial-gradient(circle at 10% 10%, rgba(220,168,50,.14), transparent 35%), var(--cream); }
.login-shell { width: min(480px, calc(100% - 36px)); min-height: 100vh; margin: auto; padding: 50px 0; display: flex; flex-direction: column; justify-content: center; }
.back-link { align-self: flex-start; margin-bottom: 18px; color: var(--muted); font-size: .82rem; }
.login-card { padding: 45px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 18px; }
.login-brand img { border-radius: 50%; box-shadow: 0 0 0 5px var(--green-soft); }
.login-brand .eyebrow { margin-bottom: 5px; }
.login-brand h1 { margin: 0; font-family: Georgia, serif; font-weight: 500; font-size: 2.2rem; letter-spacing: -.04em; }
.login-intro { margin: 28px 0; color: var(--muted); font-size: .9rem; }
.login-form { display: grid; }
.login-form label { margin: 15px 0 7px; color: var(--ink); font-size: .76rem; font-weight: 750; }
.login-form input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid #cbd6d1; border-radius: 11px; outline: none; background: #fbfcfb; }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(12,92,71,.1); }
.login-form .button { margin-top: 24px; }
.security-note { margin: 20px 0 0; text-align: center; color: #8c9792; font-size: .7rem; }

/* Administration */
.admin-page { background: #f4f6f4; }
.admin-header { width: 100%; height: 78px; padding-inline: max(24px, calc((100% - 1280px) / 2)); border-bottom: 1px solid var(--line); background: white; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-user > span:nth-child(2) { display: grid; line-height: 1.2; }
.admin-user b { font-size: .78rem; }
.admin-user small { color: var(--muted); font-size: .68rem; }
.admin-user form { margin-left: 8px; }
.admin-user button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--green); cursor: pointer; }
.admin-main { width: min(1280px, calc(100% - 48px)); margin: auto; padding: 52px 0 80px; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.admin-title h1 { margin: 0; font-family: Georgia, serif; font-size: 2.8rem; font-weight: 500; letter-spacing: -.04em; }
.admin-title p:last-child { margin: 6px 0 0; color: var(--muted); }
.admin-actions { display: flex; gap: 10px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.admin-stats article { padding: 23px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.admin-stats article > span { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--green-soft); color: var(--green); font-family: Georgia, serif; font-weight: bold; }
.admin-stats p { display: grid; margin: 0; }
.admin-stats small { color: var(--muted); font-size: .7rem; }
.admin-stats strong { font-family: Georgia, serif; font-size: 1.35rem; }
.admin-panel { margin-top: 20px; border: 1px solid var(--line); border-radius: 19px; background: white; overflow: hidden; }
.admin-flash { margin: 20px 0 0; }
.import-form { padding: 22px 24px 16px; display: flex; align-items: center; gap: 16px; }
.file-picker { min-height: 72px; padding: 13px 16px; display: flex; align-items: center; gap: 14px; flex: 1; border: 1px dashed #a9bbb4; border-radius: 14px; background: #f8fbf9; cursor: pointer; }
.file-picker:hover { border-color: var(--green); background: #f1f8f5; }
.file-picker input { max-width: 240px; margin-left: auto; font-size: .72rem; }
.file-picker > span:nth-child(2) { display: grid; }
.file-picker small { color: var(--muted); font-size: .68rem; }
.file-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: white; background: var(--green); font-size: .72rem; font-weight: 900; }
.import-warning { margin: 0; padding: 0 24px 20px; color: var(--muted); font-size: .7rem; }
.panel-heading { min-height: 90px; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.panel-heading > span { padding: 6px 11px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: .68rem; font-weight: 800; }
.annual-chips { padding: 22px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.annual-chip { padding: 17px; display: grid; border: 1px solid var(--line); border-radius: 14px; }
.annual-chip > span { color: var(--green); font-size: .72rem; font-weight: 850; }
.annual-chip strong { margin-top: 5px; font-family: Georgia, serif; font-size: 1.15rem; }
.annual-chip small { color: var(--muted); font-size: .65rem; }
.annual-chip.best { border-color: var(--green); background: var(--green); color: white; }
.annual-chip.best > span, .annual-chip.best small { color: rgba(255,255,255,.74); }
.table-tools { padding: 16px 22px; display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.search-box { width: min(480px, 100%); height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border: 1px solid #ced9d4; border-radius: 11px; background: white; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: .82rem; }
.select-box { height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border: 1px solid #ced9d4; border-radius: 11px; background: white; color: var(--muted); font-size: .72rem; }
.select-box select { border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 750; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { padding: 13px 18px; text-align: left; color: var(--muted); background: #f7f9f8; text-transform: uppercase; letter-spacing: .08em; font-size: .59rem; }
td { padding: 14px 18px; border-top: 1px solid #edf0ee; vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
td strong { font-size: .8rem; }
td small { display: block; color: #89948f; font-size: .62rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-eur { color: var(--green); font-weight: 800; }
.year-pill { padding: 4px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: .68rem; }
.empty-state { padding: 50px; text-align: center; color: var(--muted); }
.source-card { margin-top: 20px; padding: 20px 24px; display: flex; align-items: center; gap: 16px; border: 1px solid #bcdccf; border-radius: 16px; background: #edf8f3; }
.source-card > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; }
.source-card div { min-width: 0; }
.source-card p { margin: 2px 0; color: var(--muted); font-size: .75rem; }
.source-card small { display: block; max-width: 1050px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #789087; font-size: .64rem; }

@media (max-width: 980px) {
    .hero { grid-template-columns: 1fr; gap: 45px; padding-top: 45px; }
    .hero-card { min-height: 280px; }
    .stats-strip > div { padding-inline: 24px; }
    .section-heading { grid-template-columns: 1fr; gap: 15px; }
    .year-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-callout { align-items: flex-start; flex-direction: column; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .annual-chips { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
    .site-header, .section-shell, .admin-main { width: min(100% - 28px, 1120px); }
    .site-header .brand small, .site-header .button span { display: none; }
    .site-header .button { width: 46px; padding: 0; font-size: 0; }
    .site-header .button::after { content: "Admin"; font-size: .69rem; }
    .hero { min-height: 0; padding-block: 45px 70px; }
    .hero h1 { font-size: clamp(2.8rem, 14vw, 4.4rem); }
    .hero-card { padding: 32px; border-radius: 25px; }
    .stats-strip { grid-template-columns: 1fr; padding: 10px 24px; }
    .stats-strip > div, .stats-strip > div:first-child { padding: 20px 0; border-right: 0; border-bottom: 1px solid #ded9cd; }
    .stats-strip > div:last-child { border-bottom: 0; }
    .story, .results { padding-block: 75px; }
    .carousel { min-height: 430px; border-radius: 21px; }
    .carousel-arrow { top: auto; bottom: 20px; }
    .carousel-dots { display: none; }
    .year-grid { grid-template-columns: 1fr; }
    .admin-callout { margin-bottom: 65px; padding: 38px 28px; }
    .admin-callout h2 { font-size: 2.1rem; }
    footer { gap: 20px; flex-direction: column; align-items: flex-start; justify-content: center; }
    .login-card { padding: 30px 24px; }
    .admin-header { padding-inline: 14px; }
    .admin-header .brand small, .admin-user > span:nth-child(2) { display: none; }
    .admin-main { padding-top: 30px; }
    .admin-title { align-items: flex-start; flex-direction: column; }
    .admin-actions { width: 100%; }
    .admin-actions .button { flex: 1; padding-inline: 10px; }
    .admin-stats { grid-template-columns: 1fr; }
    .annual-chips { grid-template-columns: repeat(2, 1fr); }
    .table-tools { flex-direction: column; }
    .import-form { align-items: stretch; flex-direction: column; }
    .file-picker { align-items: flex-start; flex-wrap: wrap; }
    .file-picker input { width: 100%; max-width: none; margin-left: 56px; }
    .select-box { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
