/* Restaurant Pilot — démo (données fictives). Tout est limité à .rp / .rp-* */
.rp-hero { padding-top: calc(68px + clamp(26px, 4vw, 46px)); padding-bottom: clamp(22px, 3vw, 36px); }
.rp-hero h1 { font-size: clamp(1.9rem, 3.7vw, 2.8rem); max-width: none; margin: 1rem 0 1rem; }
.rp-hero .lead { font-size: 1.05rem; }
.rp-hero .btn { margin-top: 1.2rem; }
.rp-sec { padding-top: 0; padding-bottom: clamp(56px, 8vw, 100px); }
.rp {
    --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444;
    position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: 18px;
    background: #0b0d12; box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .8); font-size: 15px; line-height: 1.45;
}
.rp-bar { display: flex; align-items: center; gap: 8px; padding: 11px 16px; background: #090a0e; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.rp-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.rp-bar span { margin-left: 8px; }
.rp-bar em { margin-left: auto; font-style: normal; font-size: .74rem; color: var(--dim); }
.rp-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 560px; }

.rp-side { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: #0d1017; border-right: 1px solid var(--line); }
.rp-side button { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font: inherit; text-align: left; background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.rp-side button:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.rp-side button.on { background: rgba(34, 184, 230, .12); color: #5cd4f5; }
.rp-side svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp-mention { margin-top: auto; padding: 14px 10px 0; font-size: .72rem; color: var(--dim); }

.rp-main { padding: 24px 26px 30px; min-width: 0; }
.rp-main [hidden] { display: none; }
.rp-head { margin-bottom: 20px; }
.rp-head h2 { font-size: 1.45rem; letter-spacing: -.01em; }
.rp-head p { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.rp-head-btn { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rp-sub { font-size: 1rem; margin: 26px 0 12px; }

/* Indicateurs */
.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rp-kpi { background: #11141b; border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; display: grid; gap: 3px; }
.rp-kpi span { color: var(--muted); font-size: .8rem; }
.rp-kpi strong { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rp-kpi small { color: var(--dim); font-size: .74rem; }
.rp-kpi.good strong { color: #4ade80; }

/* Alerte d'écart */
.rp-alert { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: center; margin-top: 14px; padding: 18px 20px; border-radius: 14px; background: rgba(245, 158, 11, .09); border: 1px solid rgba(245, 158, 11, .4); }
.rp-alert h3 { font-size: 1.2rem; color: #fbbf24; margin-bottom: 4px; }
.rp-alert p { color: #d9dbe3; font-size: .92rem; }
.rp-gap { display: grid; gap: 12px; }
.rp-gap > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: .78rem; color: var(--muted); }
.rp-gap i { grid-column: 1 / -1; grid-row: 2; display: block; height: 10px; border-radius: 99px; background: #f59e0b; }
.rp-gap i.th { background: #4b7bec; }
.rp-gap b { color: var(--text); font-variant-numeric: tabular-nums; }

/* À surveiller */
.rp-watch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rp-card { display: grid; gap: 4px; text-align: left; padding: 15px 16px; border-radius: 14px; background: #11141b; border: 1px solid var(--line); border-left: 3px solid var(--c); color: var(--text); font: inherit; cursor: pointer; transition: transform .15s, background .15s; }
.rp-card:hover { transform: translateY(-2px); background: #151a23; }
.rp-card.bad { --c: var(--bad); } .rp-card.warn { --c: var(--warn); }
.rp-card span { color: var(--muted); font-size: .82rem; }
.rp-card strong { font-size: 1.02rem; }
.rp-card em { font-style: normal; color: #5cd4f5; font-size: .78rem; margin-top: 4px; }

/* Tableaux */
.rp-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #11141b; }
.rp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rp-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .76rem; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rp-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rp-table tr:last-child td { border-bottom: 0; }
.rp-table tbody tr[data-pizza] { cursor: pointer; transition: background .15s; }
.rp-table tbody tr[data-pizza]:hover { background: rgba(255, 255, 255, .03); }
.rp-table tbody tr.sel { background: rgba(34, 184, 230, .1); box-shadow: inset 3px 0 0 #22b8e6; }
.rp-table td:first-child { font-weight: 560; }
.rp-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.rp-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rp-pill.ok { --c: #4ade80; } .rp-pill.warn { --c: #fbbf24; } .rp-pill.bad { --c: #f87171; }
.rp-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.rp-legend li { display: flex; align-items: center; gap: 7px; }
.rp-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rp-legend i.ok { --c: var(--ok); } .rp-legend i.warn { --c: var(--warn); } .rp-legend i.bad { --c: var(--bad); }
.rp-hint { margin-top: 10px; font-size: .8rem; color: var(--dim); }

/* Recette + simulateur */
.rp-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rp-detail { background: #11141b; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.rp-detail h3 { font-size: 1.1rem; margin-bottom: 10px; }
.rp-detail h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.rp-ing { display: grid; gap: 0; }
.rp-ing li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rp-ing li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.rp-nums div { background: #0b0d12; border-radius: 10px; padding: 9px 12px; }
.rp-nums span { display: block; color: var(--muted); font-size: .74rem; }
.rp-nums b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.rp-sim { margin-top: 16px; padding: 14px; border-radius: 12px; background: rgba(124, 92, 255, .1); border: 1px solid rgba(124, 92, 255, .35); }
.rp-sim label { display: block; font-weight: 560; margin-bottom: 10px; }
.rp-sim input[type=range] { width: 100%; accent-color: #7c5cff; }
.rp-sim-out { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-top: 10px; }
.rp-sim-out strong { font-size: 1.35rem; color: #4ade80; font-variant-numeric: tabular-nums; }
.rp-sim-out span { color: var(--muted); font-size: .85rem; }

/* Fournisseurs */
.rp-btn { padding: 10px 16px; border-radius: 10px; background: #ededf0; color: #0a0a0c; border: 0; font: inherit; font-weight: 600; cursor: pointer; transition: transform .15s; }
.rp-btn:hover { transform: translateY(-1px); }
.rp-prods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rp-prod { background: #11141b; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.rp-prod h3 { font-size: 1.05rem; }
.rp-sup { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: #0b0d12; border: 1px solid transparent; }
.rp-sup.best { border-color: rgba(74, 222, 128, .5); }
.rp-sup b { font-variant-numeric: tabular-nums; }
.rp-sup small { grid-column: 1 / -1; color: var(--muted); font-size: .76rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp-best { font-size: .84rem; color: #d9dbe3; }
.rp-best b { color: #4ade80; }
.rp-saving { margin-top: 14px; padding: 15px 18px; border-radius: 14px; background: rgba(34, 197, 94, .09); border: 1px solid rgba(34, 197, 94, .35); }
.rp-saving strong { color: #4ade80; }

/* Stocks */
.rp-gapcard { margin-top: 14px; padding: 18px 20px; border-radius: 14px; background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .35); display: grid; gap: 4px; }
.rp-gapcard span { color: var(--muted); font-size: .85rem; }
.rp-gapcard strong { font-size: 2rem; color: #f87171; letter-spacing: -.02em; }
.rp-gapcard p { color: #d9dbe3; font-size: .9rem; max-width: 60ch; }

/* Import de facture (simulation) */
.rp-modal { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: rgba(5, 6, 9, .72); backdrop-filter: blur(3px); }
.rp-modal[hidden] { display: none; }
.rp-modal-box { width: min(440px, 100%); padding: 24px; border-radius: 16px; background: #12151d; border: 1px solid var(--line-2); text-align: center; }
.rp-modal-box h3 { font-size: 1.15rem; margin-bottom: 10px; }
.rp-spin { width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: #22b8e6; animation: rpspin .8s linear infinite; }
@keyframes rpspin { to { transform: rotate(360deg); } }
.rp-progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.rp-progress i { display: block; height: 100%; width: 0; background: var(--grad); animation: rpprog 1.8s ease-out forwards; }
@keyframes rpprog { to { width: 100%; } }
.rp-res-sum { color: var(--muted); margin-bottom: 14px; }
.rp-res-sum b { color: var(--text); }
.rp-res-list { display: grid; gap: 8px; margin-bottom: 18px; text-align: left; }
.rp-res-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #0b0d12; }
.rp-res-list em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .88rem; }
.rp-foot { margin-top: 14px; text-align: center; font-size: .82rem; color: var(--dim); }

@media (max-width: 980px) {
    .rp-alert, .rp-split { grid-template-columns: 1fr; }
    .rp-kpis { grid-template-columns: repeat(2, 1fr); }
    .rp-watch, .rp-prods { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .rp-body { grid-template-columns: 1fr; }
    .rp-side { flex-direction: row; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
    .rp-side button { flex: none; padding: 9px 12px; }
    .rp-mention { display: none; }
    .rp-main { padding: 18px 16px 24px; }
    .rp-bar em { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rp * { animation-duration: .01s !important; transition: none !important; } }
