/* =====================================================================
   Louici — interface du magasin
   Charte : lagon (action), bleu nuit (texte), corail (signal), fond gris
   froid, surfaces blanches. Une police : Plus Jakarta Sans.
   Ordinateur : barre latérale. Téléphone : barre d'onglets en bas.
   ===================================================================== */

@font-face {
    font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url(../fonts/jakarta-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
    font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url(../fonts/jakarta-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0;
}

:root {
    --ink: #0B2235;  --ink-2: #334A5E;  --muted: #66778A;
    --bg: #F3F5F7;   --surface: #FFFFFF; --subtle: #EEF2F5;
    --line: #E1E7EC; --line-2: #CAD4DC;
    --brand: #0F9488; --brand-600: #0C7A70; --brand-700: #0A635B; --brand-50: #E6F5F3; --brand-ring: rgba(15,148,136,.22);
    --coral: #F0614A; --coral-50: #FFF0EC;
    --amber: #B7791F; --amber-50: #FFF6E5;
    --red: #C0392B;   --red-50: #FDEDEB;
    --blue: #2563EB;  --blue-50: #EAF1FE;
    --violet: #7C3AED; --violet-50: #F2ECFE;

    --r-sm: 8px; --r: 12px; --r-lg: 18px;
    --shadow: 0 1px 2px rgba(11,34,53,.05), 0 10px 30px -20px rgba(11,34,53,.35);
    --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
    -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; line-height: 1.45;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ----- Coquille de l'application ----- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--ink); color: #D7E2EA; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; }
.brand img { width: 30px; height: 30px; }
.brand span b { color: #5EEAD4; font-weight: 800; }
.store { font-size: .78rem; color: #8FA6B8; padding: 0 10px 12px; text-transform: uppercase; letter-spacing: .08em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
    color: #C6D3DD; font-weight: 600; font-size: .93rem; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(94,234,212,.12); color: #fff; }
.nav a.on .ico { color: #5EEAD4; }
.nav .count { margin-left: auto; background: var(--coral); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; font-weight: 800; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px; }
.side-foot { margin-top: auto; font-size: .75rem; color: #6F8699; padding: 10px; }

.main { min-width: 0; }
.top {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    padding: 14px 28px; background: rgba(243,245,247,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 1.3rem; }
.top .spacer { flex: 1; }
.page { padding: 24px 28px 64px; max-width: 1280px; }

/* Téléphone : la barre latérale devient une barre d'onglets en bas. */
.tabbar { display: none; }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { display: none; }
    .top { padding: 12px 16px; }
    .page { padding: 16px 16px 96px; }
    .tabbar {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
        background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; }
    .tabbar a.on { color: var(--brand-700); }
    .tabbar .ico { width: 22px; height: 22px; }
    .hide-phone { display: none !important; }
}

/* ----- Boutons ----- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
    border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
    background: var(--surface); color: var(--ink); border-color: var(--line-2); text-decoration: none !important;
    transition: background .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--subtle); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--subtle); }
.btn.danger { color: var(--red); border-color: #F2C7C1; }
.btn.danger:hover { background: var(--red-50); }
.btn.go { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ----- Cartes, grilles ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h2 { flex: 1; }
.card-b { padding: 18px 20px; }
.card-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ----- Chiffres du jour ----- */
.stat { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.stat .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-weight: 600; font-size: .85rem; }
.stat.alert { border-color: #F7C9C0; background: var(--coral-50); }
.stat.alert .v { color: var(--coral); }

/* ----- Étiquettes de statut ----- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--subtle); color: var(--ink-2); white-space: nowrap; }
.badge.request { background: var(--coral-50); color: #B23A25; }
.badge.quote { background: var(--violet-50); color: var(--violet); }
.badge.confirmed { background: var(--blue-50); color: var(--blue); }
.badge.out { background: var(--brand-50); color: var(--brand-700); }
.badge.returned { background: var(--subtle); color: var(--muted); }
.badge.cancelled, .badge.declined, .badge.expired { background: var(--red-50); color: var(--red); }
.badge.late { background: var(--red); color: #fff; }
.badge.paid { background: var(--brand-50); color: var(--brand-700); }

/* ----- Listes ----- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .when { width: 64px; font-weight: 800; font-size: 1.05rem; }
.li .who { flex: 1; min-width: 0; }
.li .who b { display: block; }
.li .who span { color: var(--muted); font-size: .86rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.li { color: inherit; text-decoration: none; }
a.li:hover { background: var(--subtle); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

/* ----- Tableaux ----- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--subtle); border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--subtle); }
.scroll-x { overflow-x: auto; }

/* ----- Formulaires ----- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: .84rem; color: var(--ink-2); }
.hint { font-size: .8rem; color: var(--muted); }
.input, .select, textarea.input {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2);
    border-radius: 10px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input.sm, .select.sm { padding: 6px 9px; font-size: .88rem; }
.input.num { text-align: right; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.error { background: var(--red-50); color: #8E2A1E; border: 1px solid #F2C7C1; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.notice { background: var(--brand-50); color: var(--brand-700); border: 1px solid #BFE6E0; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.warn { background: var(--amber-50); color: #7A4E0E; border: 1px solid #F1D8A8; border-radius: 10px; padding: 10px 14px; font-weight: 600; }

/* Choix sous forme de pastilles (durées, heures, activités) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-2);
    background: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; transition: all .12s;
}
.choice span:hover { border-color: var(--brand); }
.choice input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.choice input:disabled + span { opacity: .4; cursor: not-allowed; }

/* Grandes cartes à choisir (modèles d'activité, formules) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; }
.tile .t { display: block; height: 100%; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; transition: all .12s; }
.tile .t b { display: block; margin-bottom: 4px; }
.tile .t small { color: var(--muted); }
.tile:hover .t { border-color: var(--brand); }
.tile input:checked + .t { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); background: var(--brand-50); }

/* Quantités (−  2  +) */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; font-size: 1.1rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.qty button:hover { background: var(--subtle); }
.qty input { width: 42px; border: 0; text-align: center; font: inherit; font-weight: 800; }

/* Étapes de la nouvelle réservation */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); padding: 6px 12px; border-radius: 999px; background: var(--subtle); }
.steps span.on { background: var(--ink); color: #fff; }
.steps span.done { background: var(--brand-50); color: var(--brand-700); }

/* Récapitulatif collant */
.summary { position: sticky; top: 84px; }
.sumline { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.sumline.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.15rem; }

/* Planning */
.plan { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; }
.plan th, .plan td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: center; }
.plan th:first-child, .plan td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); min-width: 210px; padding-left: 16px; }
.plan th { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.plan th.today { color: var(--brand-700); }
.plan .cell { display: inline-block; min-width: 46px; padding: 4px 6px; border-radius: 8px; font-weight: 800; }
.plan .free { background: var(--brand-50); color: var(--brand-700); }
.plan .some { background: var(--amber-50); color: var(--amber); }
.plan .full { background: var(--red-50); color: var(--red); }
.plan .closed { color: var(--line-2); }

/* Messages furtifs */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; animation: toast 3.5s forwards; }
@keyframes toast { 0%,85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); visibility: hidden; } }
@media (max-width: 900px) { .toast { bottom: 84px; left: 16px; right: 16px; } }

.htmx-request.btn { opacity: .6; }
@media print { .side, .top, .tabbar { display: none !important; } .shell { display: block; } }

/* ----- Assistant de démarrage ----- */
.setup { max-width: 920px; margin: 0 auto; padding: 40px 20px 80px; }
.setup-head { text-align: center; margin-bottom: 28px; }
.setup-head img { margin-bottom: 14px; }
.setup-head h1 { font-size: 2rem; margin-bottom: 6px; }

/* ----- Nouvelle réservation ----- */
.nb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .nb-grid { grid-template-columns: 1fr; } .summary { position: static; } }

/* ----- Grille de tarifs ----- */
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.rate { display: flex; flex-direction: column; gap: 4px; }
.rate span { font-size: .78rem; font-weight: 700; color: var(--muted); }

/* ----- Interrupteur ----- */
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch i { display: block; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background .15s; position: relative; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px var(--brand-ring); }

/* ----- Graphiques simples ----- */
.bar { height: 8px; border-radius: 999px; background: var(--subtle); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #14B8A6); border-radius: inherit; }
.cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 180px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.col i { width: 100%; max-width: 38px; min-height: 2px; border-radius: 8px 8px 3px 3px; background: var(--brand); }
