/* ===========================================================================
   Gourmet Box - feuille de style
   Couleurs reprises de duck-food.be (css/stylesheet.min.css)
   =========================================================================== */

:root {
    --duck-red:         #db061f;
    --duck-red-dark:    #bd1524;
    --duck-red-soft:    #fdeaec;
    --duck-olive:       #b3b96b;
    --duck-olive-light: #c8cc98;
    --duck-olive-dark:  #2b3618;
    --duck-ink:         #212121;
    --duck-cream:       #fefcf3;
    --duck-success:     #1f9a34;
    --duck-warning:     #c77700;

    --grey-50:  #f7f7f7;
    --grey-100: #f5f5f5;
    --grey-200: #e5e5e5;
    --grey-300: #ddd;
    --grey-400: #ccc;
    --grey-600: #9d9d9d;
    --grey-700: #6b6b6b;

    --radius:    11px;
    --radius-sm: 6px;
    --shadow:    0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, .10);
    --font: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--duck-ink);
    background: var(--duck-cream);
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }

a { color: var(--duck-red); text-decoration: none; }
a:hover { color: var(--duck-red-dark); text-decoration: underline; }

/* --- Structure ---------------------------------------------------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.site-header {
    background: #fff;
    border-bottom: 3px solid var(--duck-red);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 66px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 96px; height: auto; display: block; }
.brand:hover { text-decoration: none; }
.brand-text {
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--duck-ink);
    border-left: 2px solid var(--grey-300);
    padding-left: 12px;
}

.main-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.main-nav a {
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    color: var(--duck-ink);
    font-weight: 600;
    font-size: .9rem;
}
.main-nav a:hover { background: var(--grey-100); text-decoration: none; }
.main-nav a.is-active { background: var(--duck-red); color: #fff; }

.user-box {
    display: flex; align-items: center; gap: 10px;
    font-size: .82rem; color: var(--grey-700);
    padding-left: 14px; border-left: 1px solid var(--grey-300);
}
.lang-switch { display: flex; gap: 2px; }
.lang-switch a {
    padding: 3px 7px; border-radius: 4px; font-size: .75rem;
    font-weight: 700; text-transform: uppercase; color: var(--grey-600);
}
.lang-switch a.is-active { background: var(--duck-ink); color: #fff; }

main { padding: 28px 0 60px; }

.site-footer {
    border-top: 1px solid var(--grey-200);
    padding: 22px 0;
    font-size: .8rem;
    color: var(--grey-600);
    text-align: center;
}

/* --- Cartes ------------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-title {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.card-title h2, .card-title h3 { margin: 0; }

/* --- Grille de statistiques --------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat {
    background: #fff;
    border: 1px solid var(--grey-200);
    border-left: 4px solid var(--duck-red);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.stat.olive   { border-left-color: var(--duck-olive); }
.stat.ink     { border-left-color: var(--duck-ink); }
.stat.success { border-left-color: var(--duck-success); }
.stat-label {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--grey-600); font-weight: 700; margin-bottom: 4px;
}
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-sub   { font-size: .78rem; color: var(--grey-600); margin-top: 2px; }

/* --- Bandeaux ----------------------------------------------------------- */
.banner {
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex; gap: 12px; align-items: flex-start;
}
.banner-icon { font-size: 1.3rem; line-height: 1.2; }
.banner-body { flex: 1; }
.banner strong { display: block; }
.banner-info    { background: #eef4fb; border-color: #cfe0f2; color: #14446e; }
.banner-success { background: #eaf7ec; border-color: #bfe4c6; color: #14572a; }
.banner-warning { background: #fff6e5; border-color: #f2dfb5; color: #7a4d00; }
.banner-error   { background: var(--duck-red-soft); border-color: #f5c2c8; color: #8c0413; }

.banner-soldout {
    background: var(--duck-ink);
    color: #fff;
    border: none;
    text-align: center;
    display: block;
    padding: 30px 20px;
}
.banner-soldout .soldout-title {
    font-size: 2.4rem; font-weight: 800; letter-spacing: .08em;
    color: var(--duck-red); margin-bottom: 6px;
}

/* --- Jauge de stock ----------------------------------------------------- */
.gauge {
    height: 12px; border-radius: 999px; background: var(--grey-200);
    overflow: hidden; margin: 10px 0 6px;
}
.gauge-fill { height: 100%; background: var(--duck-olive); border-radius: 999px; }
.gauge-fill.warn   { background: var(--duck-warning); }
.gauge-fill.danger { background: var(--duck-red); }
.gauge-legend { display: flex; justify-content: space-between; font-size: .78rem; color: var(--grey-700); }

/* --- Formulaires -------------------------------------------------------- */
.form-row { margin-bottom: 17px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 18px;
}
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .88rem; }
.label-hint { font-weight: 400; color: var(--grey-600); font-size: .82rem; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .95rem;
    background: #fff;
    color: var(--duck-ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--duck-red);
    box-shadow: 0 0 0 3px rgba(219, 6, 31, .12);
}
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--duck-red); }
.field-error { color: var(--duck-red); font-size: .82rem; margin-top: 4px; font-weight: 600; }
.form-help { font-size: .82rem; color: var(--grey-700); margin-top: 4px; }
fieldset { border: none; margin: 0; padding: 0; }
legend { font-weight: 600; font-size: .88rem; margin-bottom: 6px; padding: 0; }

/* Choix de date de livraison */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.radio-card {
    display: flex; align-items: center; gap: 10px;
    border: 2px solid var(--grey-300); border-radius: var(--radius);
    padding: 13px 15px; cursor: pointer; background: #fff;
    font-weight: 600; transition: border-color .12s, background .12s;
}
.radio-card:hover { border-color: var(--duck-olive); }
.radio-card input { margin: 0; accent-color: var(--duck-red); width: auto; }
.radio-card:has(input:checked) { border-color: var(--duck-red); background: var(--duck-red-soft); }
.radio-card-sub { display: block; font-weight: 400; font-size: .8rem; color: var(--grey-700); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; accent-color: var(--duck-red); }
.checkbox-row label { margin: 0; font-weight: 400; }

/* --- Boutons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit; font-size: .92rem; font-weight: 700;
    cursor: pointer; text-decoration: none;
    background: var(--duck-red); color: #fff;
    transition: background .12s;
}
.btn:hover { background: var(--duck-red-dark); color: #fff; text-decoration: none; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--duck-ink); border-color: var(--grey-300); }
.btn-ghost:hover { background: var(--grey-100); color: var(--duck-ink); }
.btn-dark { background: var(--duck-ink); }
.btn-dark:hover { background: #000; }
.btn-olive { background: var(--duck-olive-dark); }
.btn-olive:hover { background: #1c2410; }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --- Tableaux ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data th, table.data td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--grey-200);
    vertical-align: middle;
}
table.data th {
    background: var(--grey-50); font-weight: 700; font-size: .76rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--grey-700);
    white-space: nowrap;
}
table.data tbody tr:hover { background: var(--duck-cream); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; background: var(--grey-50); border-top: 2px solid var(--grey-300); }
.nowrap { white-space: nowrap; }

/* --- Badges ------------------------------------------------------------- */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    white-space: nowrap;
}
.badge-pending   { background: #fff2d9; color: #7a4d00; }
.badge-delivered { background: #e3f5e7; color: #14572a; }
.badge-cancelled { background: var(--grey-200); color: var(--grey-700); }
.badge-fr { background: #e9edf7; color: #2c3e70; }
.badge-nl { background: #f0f4e4; color: #4a5820; }

/* --- Messages flash ----------------------------------------------------- */
.flash-zone { margin-bottom: 18px; }

/* --- Barre de filtres --------------------------------------------------- */
.filters {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; align-items: end;
}
.filters .filter-actions { display: flex; gap: 8px; }

/* --- Graphique en barres CSS -------------------------------------------- */
.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.bar {
    width: 100%; background: var(--duck-olive); border-radius: 3px 3px 0 0;
    min-height: 2px; position: relative;
}
.bar:hover { background: var(--duck-red); }
.bar-label {
    font-size: .62rem; color: var(--grey-600); margin-top: 5px;
    writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap;
}

/* --- Page de connexion -------------------------------------------------- */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 30px 20px; background: var(--duck-cream);
}
.auth-card {
    width: 100%; max-width: 420px; background: #fff;
    border: 1px solid var(--grey-200); border-radius: var(--radius);
    padding: 34px 30px; box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo img { width: 130px; height: auto; }
.auth-sub { text-align: center; color: var(--grey-600); font-size: .88rem; margin-bottom: 26px; }

/* --- Utilitaires -------------------------------------------------------- */
.muted     { color: var(--grey-600); }
.small     { font-size: .82rem; }
.strong    { font-weight: 700; }
.text-right{ text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mt-2 { margin-top: 20px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* --- Responsive : les magasins encodent souvent sur tablette ------------- */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    body { font-size: 14px; }
    .site-header .wrap { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
    .main-nav { width: 100%; margin-left: 0; order: 3; }
    .main-nav a { flex: 1; text-align: center; }
    .user-box { border-left: none; padding-left: 0; margin-left: auto; }
    .brand-text { display: none; }
    .card { padding: 16px; }
    .stat-value { font-size: 1.5rem; }
    h1 { font-size: 1.4rem; }
}

@media print {
    .site-header, .site-footer, .btn, .filters, .no-print { display: none !important; }
    body { background: #fff; }
    .card { border: none; box-shadow: none; padding: 0; }
}
