﻿/* =========================
   FOODHEALTH THEME (GLOBAL)
   REPERE FH-THEME-V1
   ========================= */

:root {
    --fh-bg: #f6f8fc;
    --fh-card: #ffffff;
    --fh-border: rgba(15, 23, 42, .08);
    --fh-shadow-soft: 0 6px 18px rgba(2, 6, 23, .07);
    --fh-text: #0f172a;
    --fh-muted: rgba(15,23,42,.65);
    --fh-primary: #2563eb;
    --fh-success: #16a34a;
    --fh-warning: #f59e0b;
    --fh-danger: #dc2626;
    --fh-info: #0ea5e9;
}

/* Fond global */
body {
    background: var(--fh-bg);
}

/* “Page” avec couleurs sur les côtés (effet premium) */
.fh-page {
    position: relative;
    padding: 18px 0 24px 0;
}

    .fh-page:before,
    .fh-page:after {
        content: "";
        position: fixed;
        top: 0;
        width: 260px;
        height: 100vh;
        z-index: -1;
        pointer-events: none;
        opacity: .9;
    }

    .fh-page:before {
        left: 0;
        background: radial-gradient(500px 350px at 30% 15%, rgba(37,99,235,.18), transparent 60%), radial-gradient(520px 380px at 40% 65%, rgba(14,165,233,.14), transparent 62%);
    }

    .fh-page:after {
        right: 0;
        background: radial-gradient(520px 380px at 65% 20%, rgba(22,163,74,.14), transparent 60%), radial-gradient(560px 420px at 70% 70%, rgba(245,158,11,.12), transparent 62%);
    }

/* Hero */
.fh-hero {
    background: radial-gradient(1200px 400px at 10% 0%, rgba(37,99,235,.18), transparent 60%), radial-gradient(900px 350px at 70% 10%, rgba(14,165,233,.16), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.70));
    border: 1px solid var(--fh-border);
    border-radius: 16px;
    box-shadow: var(--fh-shadow-soft);
    padding: 18px;
}

/* Cards */
.fh-card {
    background: var(--fh-card);
    border: 1px solid var(--fh-border);
    border-radius: 14px;
    box-shadow: var(--fh-shadow-soft);
}

    .fh-card.pad {
        padding: 14px;
    }

/* Titres */
.fh-title {
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--fh-text);
    margin: 0;
}

.fh-sub {
    color: var(--fh-muted);
    font-size: .92rem;
    margin-top: 4px;
}

/* Badges doux (comme dashboard) */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--fh-border);
    background: rgba(37, 99, 235, .06);
    color: rgba(37,99,235,.95);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

    .badge-soft.gray {
        background: rgba(15, 23, 42, .04);
        color: rgba(15,23,42,.72);
    }

    .badge-soft.green {
        background: rgba(22, 163, 74, .07);
        color: rgba(22, 163, 74, .95);
    }

    .badge-soft.amber {
        background: rgba(245, 158, 11, .08);
        color: rgba(245, 158, 11, .95);
    }

    .badge-soft.red {
        background: rgba(220, 38, 38, .08);
        color: rgba(220, 38, 38, .95);
    }

/* Gauge cards */
.gauge-card {
    border-radius: 14px;
    border: 1px solid var(--fh-border);
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.98));
    box-shadow: var(--fh-shadow-soft);
    padding: 12px;
}

.gauge-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.gauge-title {
    font-weight: 900;
    color: var(--fh-text);
    margin: 0;
    line-height: 1.15;
}

.gauge-meta {
    color: var(--fh-muted);
    font-size: .86rem;
    margin-top: 2px;
}

.objective-box {
    text-align: right;
    min-width: 130px;
}

.objective-label {
    color: var(--fh-muted);
    font-size: .78rem;
    margin: 0;
    line-height: 1.1;
}

.objective-value {
    font-weight: 900;
    color: var(--fh-text);
    font-size: .98rem;
    margin: 0;
    line-height: 1.1;
}

/* Speedometer (identique dashboard) */
.speedo {
    --val: 0; /* 0..100 */
    width: 140px;
    margin: 2px auto 0 auto;
    position: relative;
    height: 78px;
}

    .speedo .clip {
        position: relative;
        width: 140px;
        height: 70px;
        overflow: hidden;
        margin: 0 auto;
    }

    .speedo .arc-svg {
        width: 140px;
        height: 70px;
        display: block;
    }

    .speedo .arc-track {
        fill: none;
        stroke: rgba(15,23,42,.10);
        stroke-width: 10;
        stroke-linecap: round;
    }

    .speedo .arc-scale {
        fill: none;
        stroke: url(#fhGaugeGradient);
        stroke-width: 10;
        stroke-linecap: round;
    }

    .speedo .needle {
        position: absolute;
        left: 50%;
        bottom: 8px;
        width: 2px;
        height: 48px;
        background: rgba(15,23,42,.85);
        transform-origin: bottom center;
        transform: translateX(-50%) rotate(calc(-90deg + (var(--val) * 1.8deg)));
        border-radius: 2px;
    }

    .speedo .pin {
        position: absolute;
        left: 50%;
        bottom: 6px;
        width: 10px;
        height: 10px;
        transform: translateX(-50%);
        background: rgba(15,23,42,.92);
        border-radius: 50%;
        box-shadow: 0 2px 10px rgba(0,0,0,.12);
    }

    .speedo .value {
        position: absolute;
        left: 50%;
        bottom: 0px;
        transform: translateX(-50%);
        font-weight: 900;
        color: var(--fh-text);
        font-size: .95rem;
        background: rgba(255,255,255,.9);
        padding: 2px 8px;
        border-radius: 999px;
        border: 1px solid var(--fh-border);
    }

.metric-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-size: .82rem;
    color: var(--fh-muted);
    font-weight: 800;
}

    .metric-foot strong {
        color: var(--fh-text);
        font-weight: 900;
    }

/* =========================================================
   FH TOPBAR PRO
   ========================================================= */

.fh-topbar {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.18);
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.fh-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem .95rem;
    border-radius: 14px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #fff !important;
    text-decoration: none;
}

    .fh-brand:hover {
        color: #fff !important;
        background: rgba(255,255,255,.18);
    }

.fh-nav-list {
    gap: .45rem;
    flex-wrap: wrap;
}

    .fh-nav-list .nav-item {
        margin: 0;
    }

.fh-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .55rem .90rem !important;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
    color: #fff !important;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    transition: all .15s ease;
}

    .fh-nav-link:hover,
    .fh-nav-link:focus {
        background: #fff;
        color: #0d6efd !important;
        border-color: #fff;
        box-shadow: 0 6px 16px rgba(0,0,0,.12);
    }

.fh-session-panel {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: nowrap;
    padding: .45rem .55rem;
    border-radius: 14px;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 8px 18px rgba(0,0,0,.10);
    max-width: fit-content;
}


.fh-admin-btn {
    border-radius: 10px;
    font-weight: 600;
    padding-left: .75rem;
    padding-right: .75rem;
}

.fh-establishment-form {
    margin: 0;
}

.fh-establishment-select {
    min-width: 190px;
    max-width: 190px;
    border-radius: 10px;
    border: 1px solid rgba(13,110,253,.22);
    font-weight: 600;
    font-size: .92rem;
}

.fh-user-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 38px;
    padding: .45rem .70rem;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,.08);
    color: #6c757d;
    font-size: .90rem;
    white-space: nowrap;
}

    .fh-user-chip strong {
        color: #0d6efd;
        font-weight: 800;
    }

.fh-logout-btn,
.fh-login-btn {
    border-radius: 10px;
    font-weight: 700;
    min-height: 38px;
    padding-left: .85rem;
    padding-right: .85rem;
}

@media (max-width: 1199.98px) {
    .fh-topbar .navbar-collapse {
        padding-top: .9rem;
    }

    .fh-nav-list {
        margin-top: .25rem;
        margin-bottom: .75rem;
    }

    .fh-nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .fh-session-panel {
        width: 100%;
    }

    .fh-establishment-form,
    .fh-establishment-select {
        width: 100%;
        min-width: 0;
    }

    .fh-user-chip {
        width: 100%;
    }

    .fh-admin-btn,
    .fh-logout-btn,
    .fh-login-btn {
        padding: .38rem .70rem;
        font-size: .90rem;
        min-height: 36px;
        white-space: nowrap;
    }

    .fh-user-chip {
        display: inline-flex;
        align-items: center;
        gap: .30rem;
        min-height: 36px;
        padding: .35rem .60rem;
        border-radius: 10px;
        background: #f8f9fa;
        border: 1px solid rgba(0,0,0,.08);
        color: #6c757d;
        font-size: .88rem;
        white-space: nowrap;
    }

    .fh-nav-link {
        min-height: 38px;
        padding: .48rem .78rem !important;
        font-size: .95rem;
    }

}
