/* La Ruche des Décideurs — réservation des salles */
:root {
    --bg: #F6F5F1;
    --surface: #FFFFFF;
    --ink: #17191C;
    --ink-2: #3A3D42;
    --muted: #5E636B;
    --line: #E4E1DA;
    --line-strong: #DAD6CC;
    --line-soft: #ECE9E2;
    --honey: #F2B632;
    --honey-soft: #FFF8E6;
    --honey-hover: #FFF1CC;
    --busy: #E9E6DF;
    --link: #8A5B00;
    --link-hover: #5C3D00;
    --today: #FFFAEC;
    --taken: #F0EEE9;
    --taken-text: #767A81;
    --danger: #B42318;
    --ok-bg: #E7F5EC;
    --ok-text: #1E6B3A;
    --err-bg: #FDECEA;
    --display: 'Space Grotesk', Inter, system-ui, sans-serif;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2 { margin: 0; }
h2 { font-family: var(--display); font-size: 18px; font-weight: 600; margin-bottom: 12px; }
p { margin: 0; }
.display { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -0.01em; line-height: 1.15; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.muted { color: var(--muted); font-weight: 400; }
.ink { color: var(--ink); }
.fine { font-size: 12px; color: var(--muted); }
.planning-wide .fine { font-size: 13px; margin-top: 14px; }
.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; }

/* En-tête */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; min-height: 60px; display: flex; align-items: center; gap: 28px; }
.brand-link { color: var(--ink); text-decoration: none; }
.brand-link:hover { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-main { display: flex; gap: 22px; flex-grow: 1; align-self: stretch; }
.navlink { display: flex; align-items: center; color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 0 2px; border-bottom: 2px solid transparent; min-height: 44px; }
.navlink:hover { color: var(--ink); }
.navlink[aria-current="page"] { color: var(--ink); border-bottom-color: var(--honey); font-weight: 600; }
.account { display: flex; align-items: center; gap: 6px; }
.account-link { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.account-link:hover { color: var(--ink); text-decoration: underline; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
button.quiet { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 0 8px; min-height: 44px; }
button.quiet:hover { color: var(--ink); text-decoration: underline; }
form.inline { display: inline; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; color: var(--ink); }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 48px; z-index: 10; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(23, 25, 28, .12); padding: 6px; display: flex; flex-direction: column; }
.menu-panel a, .menu-panel button.quiet { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; border-radius: 8px; font-size: 14px; width: 100%; text-align: left; }
.menu-panel a[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--honey); }
.menu-panel a:hover, .menu-panel button.quiet:hover { background: var(--bg); }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; }
main.centered { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }

/* Cartes, champs, boutons */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 16px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.card > .display, .card > .brand { margin-bottom: 14px; }
.card > .muted { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
label, .label { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.help { margin-top: 6px; font-size: 12px; color: var(--muted); }
legend + .help { margin: 0 0 10px; font-size: 13px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; background: #FFFFFF; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--honey); outline-offset: 0; border-color: var(--honey); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; font: inherit; font-weight: 500; border-radius: 8px; cursor: pointer; text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.primary { background: var(--ink); color: #FFFFFF; font-weight: 600; border-color: var(--ink); }
.primary:hover { background: #2B2E33; color: #FFFFFF; }
.secondary { background: #FFFFFF; color: var(--ink); border-color: var(--line-strong); }
.secondary:hover { background: var(--bg); color: var(--ink); }
.block { width: 100%; min-height: 48px; font-size: 15px; border-radius: 10px; }
button.danger { background: #FFFFFF; color: var(--danger); border-color: #E7C2BE; padding: 0 14px; }
button.danger:hover { background: var(--err-bg); }
button.text-link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font-weight: 400; }
.icon-button { width: 44px; height: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); background: #FFFFFF; border-radius: 8px; color: var(--ink); flex: none; }
.icon-button:hover { background: var(--bg); color: var(--ink); }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
form.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.stack > .alert, .card .alert { margin-bottom: 0; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }
.alert.error { background: var(--err-bg); color: var(--danger); }
.card .alert + p { margin-top: 14px; }

/* En-tête de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.book-button { margin-left: 8px; }

/* Planning, grand écran */
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.swatch.free { background: #FFFFFF; border: 1px solid var(--line-strong); }
.swatch.busy { background: var(--busy); }
.swatch.mine { background: var(--honey); }
.grid-frame { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.week-grid { width: 100%; min-width: 940px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.week-grid .corner { width: 56px; border-bottom: 1px solid var(--line); }
.day-head { text-align: left; font-weight: 400; padding: 12px 8px 0; border-left: 1px solid var(--line-strong); white-space: nowrap; }
.day-head .dow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-head .num { font-family: var(--display); font-size: 20px; font-weight: 600; margin-left: 4px; }
.badge { font-size: 11px; font-weight: 600; background: var(--ink); color: #FFFFFF; border-radius: 10px; padding: 2px 7px; margin-left: 4px; vertical-align: 3px; }
.room-head { text-align: left; font-size: 11px; font-weight: 400; color: var(--muted); padding: 8px 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-head.first { border-left: 1px solid var(--line-strong); }
.room-head:not(.first) { padding-left: 6px; }
.day-head.today, .room-head.today { background: var(--today); }
.week-grid .hour { height: 44px; padding: 4px 10px 0 0; text-align: right; vertical-align: top; font-size: 12px; font-weight: 400; color: var(--muted); border-top: 1px solid var(--line-soft); }
.week-grid tbody tr:first-child .hour, .week-grid tbody tr:first-child .cell { border-top-color: transparent; }
.cell { height: 44px; padding: 0; border-top: 1px solid var(--line-soft); border-left: 1px solid #F1EEE8; vertical-align: top; line-height: 1.25; overflow: hidden; }
.cell.first { border-left: 1px solid var(--line-strong); }
.cell.today { background: var(--today); }
.cell.free a { display: block; height: 43px; }
.cell.free a:hover, .cell.free a:focus-visible { background: var(--honey-hover); }
.cell.free a:focus-visible { outline-offset: -2px; }
.cell.past { background: repeating-linear-gradient(135deg, transparent 0 5px, #F3F1EC 5px 6px); }
.cell.busy { background: var(--busy); color: #2B2E33; padding: 4px 6px; }
.cell.mine { background: var(--honey); color: var(--ink); padding: 4px 6px; }
.cell.cont { border-top-color: transparent; }
.slot-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.slot-sub { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Planning, téléphone */
.planning-narrow { display: none; }
.day-picker { display: flex; gap: 6px; margin-bottom: 12px; }
.day-pill { flex: 1 1 0; height: 58px; border: 1px solid var(--line); border-radius: 10px; background: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); text-decoration: none; }
.day-pill .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.day-pill .num { font-family: var(--display); font-size: 17px; font-weight: 600; }
.day-pill.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.day-pill:hover { color: var(--ink); border-color: var(--line-strong); }
.day-pill.on:hover { color: #FFFFFF; }
.room-switch { display: flex; background: var(--line-soft); border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.switch { flex: 1 1 0; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.switch.on { background: #FFFFFF; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(23, 25, 28, .12); }
.slot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.slot-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border-radius: 10px; }
.slot-row.free { background: #FFFFFF; border: 1px dashed var(--line-strong); }
.slot-row.busy { background: var(--busy); }
.slot-row.mine { background: var(--honey); }
.slot-row.past { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.slot-hour { width: 44px; flex: none; font-size: 13px; color: var(--ink-2); }
.slot-text { flex: 1 1 auto; min-width: 0; }
.slot-row.busy .slot-text, .slot-row.mine .slot-text { font-weight: 600; }
.slot-row a { font-size: 13px; font-weight: 600; text-decoration: none; padding: 0 4px; min-height: 44px; display: flex; align-items: center; }

/* Formulaire de réservation */
.dialog { max-width: 560px; margin: 0 auto; padding: 28px; box-shadow: 0 12px 32px rgba(23, 25, 28, .08); }
.book-form { gap: 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-head .display { font-size: 24px; }
.day-nav { display: flex; align-items: center; gap: 2px; }
.day-nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -12px -8px; font-size: 18px; text-decoration: none; border-radius: 6px; }
.day-nav a:hover { background: var(--bg); }
.segments { display: flex; }
.segment { flex: 1 1 0; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); background: #FFFFFF; font-weight: 500; color: var(--ink); text-decoration: none; padding: 0 8px; text-align: center; }
.segment:first-child { border-radius: 8px 0 0 8px; }
.segment:last-child { border-radius: 0 8px 8px 0; }
.segment + .segment { border-left: 0; }
.segment:hover { color: var(--ink); background: var(--bg); }
.segment.on { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.hours { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hour-choice { position: relative; margin: 0; font-weight: 400; }
.hour-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; min-height: 0; }
.hour-choice > span { display: flex; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--line-strong); background: #FFFFFF; border-radius: 8px; font-size: 13px; color: var(--ink); }
.hour-choice:hover > span { border-color: var(--honey); }
.hour-choice input:checked + span { background: var(--honey); border-color: var(--honey); font-weight: 600; }
.hour-choice input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.hour-choice.taken > span { background: var(--taken); color: var(--taken-text); border-color: var(--line-soft); text-decoration: line-through; }
.hour-choice.taken input { cursor: not-allowed; }
.summary { margin-top: 10px; font-size: 13px; font-weight: 600; }
.info { display: flex; gap: 10px; align-items: flex-start; background: var(--honey-soft); border-radius: 8px; padding: 12px; }
.info svg { flex: none; margin-top: 1px; }
.info p { font-size: 13px; color: var(--ink-2); }

/* Connexion */
.login { width: 100%; max-width: 432px; padding: 32px; display: flex; flex-direction: column; gap: 22px; margin: 0; }
.login .brand { margin: 0; }
.login .brand-name { font-size: 16px; }
.login .display { font-size: 26px; margin-bottom: 6px; }
.login input { min-height: 48px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
.login .code-input { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: .5em; text-align: center; min-height: 56px; padding-left: calc(14px + .5em); }
.login-links { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.login-links a, .login-links button { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; }

/* Listes : mes réservations, administration */
.bookings, .plain { list-style: none; padding: 0; margin: 0; }
.bookings li, .plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.bookings li:last-child, .plain li:last-child { border-bottom: 0; }
.booking-when { font-family: var(--display); font-weight: 600; font-size: 15px; }
.booking-meta { color: var(--ink-2); margin-top: 2px; }
.booking-main .muted { margin-top: 2px; font-size: 13px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.admin-grid .card { margin-bottom: 0; }
.admin-grid + .card { margin-top: 16px; }

@media (max-width: 860px) {
    .nav-main, .account { display: none; }
    .menu { display: block; margin-left: auto; }
    .top-inner { padding: 8px 16px; min-height: 60px; }
}

@media (max-width: 719px) {
    main { padding: 16px 16px 32px; }
    .top .brand-sub { display: none; }
    .planning-wide, .wide-only, .book-button { display: none; }
    .planning-narrow { display: block; }
    .page-head { align-items: center; margin-bottom: 12px; }
    .page-head .eyebrow { display: none; }
    .display { font-size: 22px; }
    .toolbar .button.secondary { padding: 0 12px; }
    .card { padding: 18px; }
    .dialog { padding: 20px; }
    .hours { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bookings li { flex-direction: column; align-items: flex-start; }
    form.row { flex-wrap: wrap; }
}
