/* CSS */

@media print {
    html, body {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove container’s outer margins/padding for print */
    .container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Tighten the title spacing */
    .print-title {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Hide navbars/headers if base.html has them */
    .navbar,
    header,
    .d-print-none {
        display: none !important;
    }
}


/* From styles.css: project-specific styles (no Bootstrap core) */
/* Override Bootstrap default font to Calibri Book (with fallbacks) */
:root {
    --bs-body-font-family: "Calibri Light", "Calibri", Arial;
}

/* django-prose-editor theme outside the Django admin */
:root {
    --prose-editor-background: #ffffff;
    --prose-editor-foreground: #212529;
    --prose-editor-border-color: #ced4da;
    --prose-editor-active-color: #66247f; /* matches .btn-csm-primary */
    --prose-editor-disabled-color: #6c757d;
}

.prose-editor .ProseMirror {
    min-height: 150px;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
}

.prose-editor .ProseMirror p {
    margin-bottom: 0.35rem;
}

.prose-editor .ProseMirror p:last-child {
    margin-bottom: 0;
}

/* Override Bootstrap badge font-weight */
.badge {
    --bs-badge-font-weight: 300;
}

html,
body {
    height: 100%;
    font-family: var(--bs-body-font-family), sans-serif;
}

.form-control::placeholder {
    opacity: 0.5; /* Makes placeholder 50% opacity */
}

/* Override Bootstrap disabled button styles for more transparency */
.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    opacity: 0.35;
}

.feature {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 3rem;
    font-size: 1.5rem;
}

.bg-featured-blog {
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 15rem;
}

#schedule-modal .modal-footer {
    border-top: none;
}

/* Readers by classroom: shared styles (moved from template) */
.barcode svg {
    height: var(--barcode-screen-height-px, 28px);
    vertical-align: middle;
}

/* Page-break element: hidden on screen */
.page-break {
    display: none;
}

/* Calendar responsive tweaks */
.table.calendar {
    table-layout: fixed;
}

.table.calendar td {
    vertical-align: top;
    padding: .25rem;
}

.table.calendar .alert {
    border-width: 1px;
}

.table.calendar .day-number.badge {
    padding: .35rem .45rem;
}

/* Smaller cells when there is no schedule */
.table.calendar td.no-schedule {
    padding: .25rem;
}

.table.calendar td.no-schedule .empty-day-placeholder {
    height: .25rem;
    line-height: 0;
}

@media (max-width: 576.98px) {
    .table.calendar thead th {
        font-size: .8rem;
        padding: .25rem;
    }

    .table.calendar td {
        padding: .25rem;
    }

    .table.calendar .alert {
        padding: .25rem .35rem;
        margin: .25rem 0;
        font-size: .8rem;
    }

    .table.calendar .small {
        font-size: .75rem;
    }

    .table.calendar .badge {
        font-size: .65rem;
    }
}

@media print {
    @page {
        size: A4 portrait;
        /* margin can be defined by the printer dialog */
    }

    body * {
        visibility: hidden;
    }

    .print-area, .print-area * {
        visibility: visible;
    }

    .print-area {
        position: static;
        /* Reduce overall print font size */
        font-size: 9pt;
        line-height: 1.3;
    }

    .classroom-page {
        /* page breaks handled by explicit .page-break elements */
        border: none;
        margin: 0;
        padding: 0;
    }

    .classroom-title {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 6px;
        border-bottom: 1px solid #333;
        padding-bottom: 4px;
    }

    .classroom-title h3 {
        font-size: 12pt;
        margin: 0;
    }

    /* One-line rows smaller spacing for print */
    .classroom-page .row {
        font-size: 9pt;
        padding: 2px 0 !important;
        margin-left: 0;
        margin-right: 0;
    }

    .classroom-page .row.mb-2 {
        margin-bottom: 2px !important;
    }

    .classroom-page .row.p-2 {
        padding: 2px 0 !important;
    }

    .classroom-page .row > [class^="col-"],
    .classroom-page .row > [class*=" col-"] {
        padding-left: 6px;
        padding-right: 6px;
    }

    .border-bottom {
        border-bottom: 1px dashed #ccc !important;
    }

    .barcode svg {
        height: calc(var(--barcode-print-height-mm, 10) * 1mm);
    }

    /* Explicit page-break element for printing */
    .page-break {
        display: block;
        break-before: page;
        page-break-before: always; /* legacy */
    }
}


/* =========================================
   AP-College custom color theme
   Colors provided by user:
   - Text: #282358
   - Titles: #e61d72
   - Menu background: #a3145b
   - Accent 1: #66247f
   - Accent 2: #ea5a0b
   All styling centralized in this stylesheet.
   ========================================= */

/* Base: white background, primary text color */
html, body {
    background-color: #ffffff;
    color: #282358; /* primary text */
}

/* Headings use the title color */
h1, h2, h3, h4, h5, h6 {
    font-family: Calibri, Arial, sans-serif;
    color: #e61d72;
    /*white-space: pre-wrap;*/
}

/* Line-break preserving utility (event titles) — defines the class used in
   templates/event/detail.html (S7, compliance audit 2026-11-05). */
.pre-wrap {
    white-space: pre-wrap;
}

/* Global links: default to accent 1; hover/focus to accent 2 */
a {
    color: #66247f;
    text-decoration-color: rgba(102, 36, 127, 0.35);
}

a:hover, a:focus {
    color: #ea5a0b;
    text-decoration-color: rgba(234, 90, 11, 0.5);
}

/* Navbar styling */
nav.navbar {
    background-color: #ffffff !important; /* white navbar background as requested */
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 2px solid transparent;
    transition: border-bottom 0.3s ease;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Logo container with fixed height to prevent layout shift */
nav.navbar .navbar-brand {
    position: relative;
    min-height: 80px;
    display: flex;
    align-items: center;
}

/* Logo container - reserve space to prevent layout shift */
nav.navbar .navbar-brand .logo-normal,
nav.navbar .navbar-brand .logo-thin {
    transition: opacity 0.2s ease;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
}

/* Thin logo: position absolute and fade in/out */
nav.navbar .logo-thin {
    position: absolute !important;
    left: 0.5rem;
    opacity: 0;
    pointer-events: none;
    display: block !important; /* Override d-none */
}

/* Normal state: normal logos visible */
nav.navbar .logo-normal {
    opacity: 1;
}

/* Thin navbar state */
nav.navbar.navbar-thin {
    border-bottom: 1px solid #a3145b;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Divider under the navbar when a page blanks the budget banner (R106):
   the banner itself otherwise separates the navbar from the content. */
nav.navbar:not(:has(+ .budget-banner-csm)) {
    border-bottom: 1px solid var(--csm-secondary);
}

nav.navbar.navbar-thin .navbar-brand {
    min-height: 32px !important;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

nav.navbar.navbar-thin .logo-normal {
    opacity: 0 !important;
    pointer-events: none;
    position: absolute !important;
}

nav.navbar.navbar-thin .logo-thin {
    opacity: 1 !important;
    pointer-events: auto;
}

nav.navbar.navbar-thin .navbar-nav .nav-link {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

nav.navbar.navbar-thin .navbar-toggler {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

nav.navbar .navbar-brand,
nav.navbar .nav-link,
nav.navbar .dropdown-item.dropdown-toggle {
    color: #282358 !important; /* dark text on white navbar */
}

nav.navbar .nav-link:hover,
nav.navbar .nav-link:focus,
nav.navbar .navbar-brand:hover,
nav.navbar .navbar-brand:focus {
    color: #ea5a0b !important; /* accent hover */
}

/* Dropdown menu: keep white background for readability */
nav.navbar .dropdown-menu {
    background-color: #ffffff;
    border-color: #f0d6e1;
}

nav.navbar .dropdown-item {
    color: #282358;
}

nav.navbar .dropdown-item:hover, nav.navbar .dropdown-item:focus {
    color: #a3145b;
    background-color: #fbeaf1; /* subtle tint */
}

/* Navbar toggler visible on colored background */
nav.navbar .navbar-toggler {
    border-color: rgba(40, 35, 88, .55);
}

nav.navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(40,35,88, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Footer styling to match theme */
footer {
    background-color: #a3145b !important;
}

footer, footer .text-white, footer .link-light, footer a, footer .small {
    color: #ffffff !important;
}

footer a:hover, footer a:focus {
    color: #ea5a0b !important;
}

footer .separator, footer .text-white {
    opacity: 0.9;
}

.bg-csm-primary {
    background-color: #66247f !important;
}

.bg-csm-secondary {
    background-color: #a3145b !important;
}

.bg-csm-orange {
    background-color: #ff923c !important;
}

.text-csm-primary {
    color: #66247f !important;
}

.badge.bg-csm-primary {
    background-color: #66247f !important;
}

.badge.bg-csm-secondary {
    background-color: #a3145b !important;
}

/* ----------------------------------------------------------------------
   Project console components (R205 staff page + R94 owner page).
   Public content = green accent (reaches the public page), privé = brand
   purple (committee only). S2: every tint is colour-mixed from the
   --csm-* / --bs-* variables — no hardcoded brand hex.
   ---------------------------------------------------------------------- */

/* Zone labels (R205): styled pills, icons from bootstrap-icons. */
.badge-csm-public,
.badge-csm-prive {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
}

.badge-csm-public {
    color: var(--csm-ok);
    background-color: color-mix(in srgb, var(--csm-ok) 10%, white);
    border: 1px solid color-mix(in srgb, var(--csm-ok) 30%, white);
}

.badge-csm-prive {
    color: var(--csm-primary);
    background-color: color-mix(in srgb, var(--csm-primary) 8%, white);
    border: 1px solid color-mix(in srgb, var(--csm-primary) 25%, white);
}

/* Public/private zone containers grouping the staff management cards
   (R205): white shell, coloured rail + tinted head bar (no full-fill
   pink/green boxes). */
.zone-csm-public,
.zone-csm-prive {
    border-radius: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--bs-body-color, #212529) 12%, white);
    background-color: var(--bs-body-bg, #fff);
    overflow: hidden;
}

.zone-csm-public {
    border-left: 4px solid var(--csm-ok);
}

.zone-csm-prive {
    border-left: 4px solid var(--csm-primary);
}

.zone-csm-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
}

.zone-csm-head--public {
    background-color: color-mix(in srgb, var(--csm-ok) 8%, white);
    border-bottom: 1px solid color-mix(in srgb, var(--csm-ok) 22%, white);
}

.zone-csm-head--prive {
    background-color: color-mix(in srgb, var(--csm-primary) 6%, white);
    border-bottom: 1px solid color-mix(in srgb, var(--csm-primary) 18%, white);
}

.zone-csm-body {
    padding: 1rem;
    background-color: color-mix(in srgb, var(--bs-body-color, #212529) 2%, white);
}

.zone-csm-body > .card {
    scroll-margin-top: 1rem;
}

.zone-csm-body > .card:last-child {
    margin-bottom: 0 !important;
}

/* « Discussion » jump chip in the private zone head (R205). */
.anchor-csm {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid color-mix(in srgb, var(--csm-primary) 30%, white);
    color: var(--csm-primary);
    text-decoration: none;
}

.anchor-csm:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 8%, white);
    color: var(--csm-primary);
}

/* Identity card: overline + title + status/publication pills + meta
   (both consoles), with an optional private demandeur/contact band. */
.idcard-csm {
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid color-mix(in srgb, var(--bs-body-color, #212529) 12%, white);
    border-left: 4px solid var(--csm-primary);
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--bs-black, #000) 6%, transparent);
}

.idcard-csm-overline {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
}

.idcard-csm-title {
    margin: 0.15rem 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.idcard-csm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.85rem;
}

.idcard-csm-meta i,
.idcard-csm-band i,
.tile-csm-sub {
    vertical-align: -0.1em;
}

.idcard-csm-band {
    margin-top: 0.75rem;
    border-radius: 0.55rem;
    padding: 0.6rem 0.8rem;
}

.idcard-csm-band--prive {
    background-color: color-mix(in srgb, var(--csm-primary) 5%, white);
    border: 1px solid color-mix(in srgb, var(--csm-primary) 20%, white);
}

.idcard-csm-band-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--csm-primary);
    margin-bottom: 0.35rem;
}

.idcard-csm-band-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.9rem;
    font-size: 0.9rem;
    padding: 0.1rem 0;
}

.idcard-csm-band-row--sub {
    font-size: 0.85rem;
}

.idcard-csm-band-sub {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.85rem;
}

.idcard-csm-band a {
    color: var(--csm-primary);
    text-decoration: none;
}

.idcard-csm-band a:hover {
    text-decoration: underline;
}

/* Status / publication pills. */
.pill-csm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.22rem 0.7rem;
}

.pill-csm-status {
    background-color: var(--csm-primary);
    color: var(--bs-white, #fff);
}

.pill-csm-publie {
    background-color: color-mix(in srgb, var(--csm-ok) 10%, white);
    color: var(--csm-ok);
    border: 1px solid color-mix(in srgb, var(--csm-ok) 30%, white);
}

.pill-csm-non-publie {
    background-color: color-mix(in srgb, var(--csm-amber) 10%, white);
    color: var(--csm-amber);
    border: 1px solid color-mix(in srgb, var(--csm-amber) 30%, white);
}

/* Summary tiles: the state of the request at a glance. */
.tile-csm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

@media (min-width: 768px) {
    .tile-csm-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tile-csm {
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid color-mix(in srgb, var(--bs-body-color, #212529) 12%, white);
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
}

.tile-csm-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
}

.tile-csm-value {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 1rem;
    min-width: 0;
}

.tile-csm-value .avatar-csm {
    flex-shrink: 0;
}

.tile-csm-sub {
    font-size: 0.72rem;
    color: var(--bs-secondary-color, #6c757d);
}

.tile-csm-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.tile-csm-dot--ok {
    background-color: var(--csm-ok);
}

.tile-csm-dot--review {
    background-color: var(--csm-orange);
}

.tile-csm-dot--idle {
    background-color: var(--bs-secondary-color, #6c757d);
}

.tile-csm-dot--bad {
    background-color: var(--bs-danger, #dc3545);
}

/* Initials avatar (identity bands, tiles, thread). */
.avatar-csm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--csm-primary) 12%, white);
    color: var(--csm-primary);
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Light card header (consoles): replaces the solid magenta band on the
   management cards; .card-header-csm stays for the other project pages. */
.card-header-csm-light {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bs-body-bg, #fff);
    padding: 0.65rem 1rem;
    margin-bottom: 0;
    border-bottom: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(33, 37, 41, 0.175));
    border-radius: var(--bs-card-inner-border-radius, calc(0.375rem - 1px)) var(--bs-card-inner-border-radius, calc(0.375rem - 1px)) 0 0;
}

.card-header-csm-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

/* Per-card visibility chips (R93 visibility stated on the card). */
.chip-csm {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.16rem 0.55rem;
}

.chip-csm-public {
    color: var(--csm-ok);
    border: 1px solid color-mix(in srgb, var(--csm-ok) 30%, white);
    background-color: color-mix(in srgb, var(--csm-ok) 6%, white);
}

.chip-csm-prive {
    color: var(--csm-primary);
    border: 1px solid color-mix(in srgb, var(--csm-primary) 25%, white);
    background-color: color-mix(in srgb, var(--csm-primary) 5%, white);
}

/* One-shot « Je vais gérer cette demande » CTA (R207). */
.btn-csm-cta-review {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    background-color: var(--csm-orange);
    color: color-mix(in srgb, var(--csm-orange) 25%, black);
    border: 0;
    border-radius: 0.375rem;
    padding: 0.55rem 1rem;
    font-weight: 700;
}

.btn-csm-cta-review:hover {
    background-color: color-mix(in srgb, var(--csm-orange) 88%, black);
    color: color-mix(in srgb, var(--csm-orange) 25%, black);
}

.btn-csm-cta-review:focus-visible {
    outline: 2px solid var(--csm-primary);
    outline-offset: 2px;
}

/* Compact « État du projet » card bits (R205). */
.resp-csm {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
}

.resp-csm-muted {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.82rem;
}

.resp-csm-caption {
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0.35rem 0 0;
    text-align: center;
}

.fgrid-csm {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 0.8rem;
}

@media (min-width: 560px) {
    .fgrid-csm {
        grid-template-columns: 1fr 1fr;
    }
}

/* Internal discussion thread (R206 display). */
.msg-csm {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.msg-csm .avatar-csm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.msg-csm-main {
    min-width: 0;
}

.msg-csm-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0.05rem 0 0.2rem;
}

.msg-csm-bubble {
    background-color: color-mix(in srgb, var(--csm-primary) 5%, white);
    border: 1px solid color-mix(in srgb, var(--csm-primary) 12%, white);
    border-radius: 0.15rem 0.7rem 0.7rem 0.7rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.composer-csm .btn {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Card header (primary): replaces "card-header bg-csm-secondary text-white py-3" */
.card-header-csm {
    background-color: var(--csm-secondary) !important;
    color: #fff !important;
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(33, 37, 41, 0.175));
    border-radius: var(--bs-card-inner-border-radius, calc(0.375rem - 1px)) var(--bs-card-inner-border-radius, calc(0.375rem - 1px)) 0 0;
}

/* "Restricted Access" top strip on list cards the public cannot see
   (R246): event/campaign is_public=False, ended campaigns, project
   published=False. Overlaid INSIDE the card (absolute + z-index) so the
   card height is unchanged — Bootstrap's .card is already
   position: relative. pointer-events: none keeps card content under the
   strip clickable. Bootstrap warning palette through the BS 5.3 colour
   variables (S2). Label fixed English by owner decision — never
   translated (T17 exception). */
.banner-csm-restricted {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
    background-color: var(--bs-warning, #ffc107);
    color: var(--bs-dark, #212529);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
}

.alert-csm-secondary {
    color: #41464b;
    background-color: #e2e3e5;
    border-color: #d3d6d8;
}

.alert-csm-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-csm-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-csm-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.btn-csm-primary {
    color: #fff;
    background-color: #66247f;
    border-color: #66247f;
}

.btn-csm-primary:hover, .btn-csm-primary:focus {
    color: #fff;
    background-color: #56206b;
    border-color: #56206b;
}

.btn-csm-secondary {
    color: #fff;
    background-color: #a3145b;
    border-color: #a3145b;
}

.btn-csm-secondary:hover, .btn-csm-secondary:focus {
    color: #fff;
    background-color: #93104d;
    border-color: #93104d;
}

/* Brand outline button (builder-room-dayview-v1 mockup): the secondary
   action of a filled-primary pair (the builder 💾 « Enregistrer la
   sélection » beside the ⚙ « Générer les créneaux »). S2: palette through
   the --csm-* variables, no hardcoded brand hex. */
.btn-csm-outline {
    color: var(--csm-primary);
    background-color: #fff;
    border-color: var(--csm-primary);
}

.btn-csm-outline:hover, .btn-csm-outline:focus {
    color: #fff;
    background-color: var(--csm-primary);
    border-color: var(--csm-primary);
}

/* Teacher-meeting agenda builder components (brief 2026-11-10): numbered
   step badges (1–7), room chips, clickable slot-cell toggles. */
.step-number-csm {
    background-color: var(--csm-secondary);
}

.room-chip-csm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 1.9rem;
    padding: 0.125rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    background-color: var(--bs-secondary-bg-subtle);
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    line-height: 1.5;
}

.room-chip-csm-input {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0 0.25rem;
    width: 9ch;
}

.room-chip-csm-input:focus {
    outline: 1px solid var(--csm-primary);
    border-radius: 0.25rem;
}

/* Compact width for the step-3 add-room input (brief 2026-11-11): fixed
   width instead of the old flex-grow stretch, so the label + input + button
   read as one compact row; max-width: 100% lets the input fill the line when
   the flex row wraps on phones. */
.room-add-input-csm {
    width: 12rem;
    max-width: 100%;
}

/* Step-2 duration block (partner copy 2026-11-14: the label became a
   two-sentence guide). The flex item sizes to the label's content, so cap
   the wrapper — the guide wraps to readable lines instead of stretching
   the row; width: 100% + the card-body flex-column keep it full width on
   phones. */
.meeting-duration-csm {
    width: 100%;
    max-width: 24rem;
}

/* Compact duration box (partner 2026-11-14): sits on the INPUT-GROUP, not
   the input — Bootstrap's .input-group > .form-control width rule
   outranks a lone class on the number field. max-width: 100% keeps it
   inside the card on phones. */
.meeting-duration-input-csm {
    width: 8rem;
    max-width: 100%;
}

/* ==========================================================================
   Day-view agenda pages (day-view plan 2026-11-12; mockup
   bookings-dayview-v5 — the partner-approved look). Outlook-style absolute
   calendar columns: dayview_layout() (services) INLINES top/height/left/width
   from the minute values (the sanctioned S9 computed-values exception), so
   the .dayview-* geometry classes below carry ONLY the look — never a
   position or size. Brand colours via --csm-* variables, muted greys via the
   --bs-* variables already used by .room-chip-csm; the exact values pinned by
   the mockup (#d8cfe0/#b3a7bd locked row, #f3eff5/#ece6ef/#9a8fa1 hatch
   band, rgba(255,255,255,.22)/.42 trash button) are the partner-approved
   exceptions.
   ========================================================================== */

/* Gutter wrapper: height inlined from day.layout.height_px; the 58 px left
   margin is the tick-label gutter (labels hang at left: -58 px below). */
.dayview-csm {
    position: relative;
    margin-left: 58px;
    margin-right: 4px;
    border-top: 1px solid var(--bs-border-color);
}

/* Half-hour tick line — template inlines top:. */
.dayview-tick-csm {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px solid var(--bs-border-color);
}

/* Tick label "HH:MM", right-aligned in the left gutter, vertically centred
   on its tick (top inlined by the template). */
.dayview-tick-label-csm {
    position: absolute;
    left: -58px;
    width: 50px;
    text-align: right;
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    transform: translateY(-0.55em);
}

/* Hatched free-gap band ("Pause" / builder tampon) — top/height inlined. */
.dayview-band-csm {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: repeating-linear-gradient(135deg, #f3eff5, #f3eff5 6px, #ece6ef 6px, #ece6ef 12px);
    color: #9a8fa1;
    font-size: 0.72rem;
}

/* Absolutely positioned block base. left: 0/right: 0 stretch a full-width
   (lanes == 1) block; when the service inlines left/width for parallel
   lanes, the inline values win and the over-constrained right is ignored.
   text-align: left also resets the button/label variants (.btn / <label>). */
.dayview-slot-csm {
    position: absolute;
    left: 0;
    right: 0;
    display: block;
    overflow: hidden;
    padding: 5px 10px 5px 9px;
    border: 1px solid var(--csm-primary);
    border-radius: 7px;
    font-size: 0.82rem;
    line-height: 1.3;
    text-align: left;
}

/* Free block: primary outline, 10 % brand tint on hover; clickable as
   button or pick-mode label. */
.dayview-slot-csm--free {
    border: 1.5px solid var(--csm-primary);
    background-color: #fff;
    color: var(--csm-primary);
    cursor: pointer;
}

/* hover/active/focus re-pin colour and border too: the free block may be a
   Bootstrap .btn, whose .btn:hover/:active/:focus (0,2,0) would otherwise
   paint black text and border over the single-class state rules. */
.dayview-slot-csm--free:hover,
.dayview-slot-csm--free:focus,
.dayview-slot-csm--free:active {
    background-color: color-mix(in srgb, var(--csm-primary) 10%, transparent);
    border-color: var(--csm-primary);
    color: var(--csm-primary);
}

/* Keyboard focus inside the pick-mode label (hidden radio). */
.dayview-slot-csm--free:has(input:focus-visible) {
    outline: 2px solid var(--csm-primary);
}

/* Live click feedback (controller ruling 2026-11-12): the parent pick radio
   and the builder pick checkbox are visually-hidden, so the fill follows the
   CHECKED state itself (:has) — a cell paints the moment it is clicked,
   before the page is re-rendered. The --mine / --picked rules below stay
   as the server-rendered fallback for the initial state. */
.dayview-slot-csm--free:has(input:checked) {
    background-color: var(--csm-primary);
    color: var(--bs-white);
}

.dayview-slot-csm--free:has(input:checked):hover {
    background-color: var(--csm-primary);
}

/* Selected-slot validate CTA (partner ask 2026-11-14, R217): the inline
   « Valider mon choix » of a pick cell stays hidden until THAT cell's
   radio is checked — the same :has live idiom as the fill above, so the
   parent sees the confirm button exactly where they clicked. An invisible
   button cannot be clicked: the required-radios guard keeps its full
   meaning. Button look (partner polish 2026-11-14): a WHITE plate with
   brand ink and border riding the solid brand cell — the inverse of
   .btn-csm-outline, plus rounded corners and a Bootstrap shadow-sm drop
   (markup) — so it reads unmistakably as the action to press; hover/
   focus invert it to the brand fill (white border keeps it legible on
   the purple cell). S2: palette through the --csm- and --bs- variables. */
.dayview-slot-csm--free .dayview-validate-csm {
    display: none;
}

.dayview-slot-csm--free:has(input:checked) .dayview-validate-csm {
    display: block;
    position: absolute;
    right: 5px;
    bottom: 4px;
    padding: 0.1rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.5;
    background-color: var(--bs-white);
    color: var(--csm-primary);
    border: 1px solid var(--csm-primary);
    border-radius: 0.375rem;
}

.dayview-slot-csm--free:has(input:checked) .dayview-validate-csm:hover,
.dayview-slot-csm--free:has(input:checked) .dayview-validate-csm:focus {
    background-color: var(--csm-primary);
    color: var(--bs-white);
    border-color: var(--bs-white);
}

/* Booked block (manager view): solid secondary fill, name is the hero. */
.dayview-slot-csm--taken {
    border: 1px solid var(--csm-secondary);
    background-color: var(--csm-secondary);
    color: var(--bs-white);
}

/* "Complet" block (parent view, privacy R217 — never a name): the muted
   grey trio of .room-chip-csm (styles.css above). */
.dayview-slot-csm--complet {
    background-color: var(--bs-secondary-bg-subtle);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
}

/* Blocked block (manager R229 stamp, mockup bookings-block-add-v6
   .slot.blocked): hatched grey, label "Bloqué". The mockup-approved hex
   values (#f3eff5/#ece6ef hatch, #b3a7bd border, #7d7186 text) are the
   partner-approved S2 exceptions of this block — the same pinned-neutral
   treatment as --locked (#d8cfe0/#b3a7bd) and .dayview-band-csm (same
   hatch), which are documented as exceptions in the block header above. */
.dayview-slot-csm--blocked {
    border: 1.5px solid #b3a7bd;
    background: repeating-linear-gradient(135deg, #f3eff5, #f3eff5 6px, #ece6ef 6px, #ece6ef 12px);
    color: #7d7186;
}

/* Hidden block (manager R244 stamp, design 2026-11-19 C18): dimmed so the
   bookings agenda stays readable while the eye marker + buttons carry the
   state. The manager page is the ONLY renderer — parents never receive
   hidden rows (and the parent-gated own "mine" hero stays undimmed).
   Opacity only: the block keeps its state colours (free/blocked/taken). */
.dayview-slot-csm--hidden {
    opacity: 0.55;
}

/* Own block (parent), JS-marked pick selection and builder checked cell:
   solid primary, white text.
   Declared after --free so a --picked block keeps the solid fill. */
.dayview-slot-csm--mine,
.dayview-slot-csm--picked {
    border: 1px solid var(--csm-primary);
    background-color: var(--csm-primary);
    color: var(--bs-white);
}

.dayview-slot-csm--mine:hover,
.dayview-slot-csm--mine:focus,
.dayview-slot-csm--mine:active,
.dayview-slot-csm--picked:hover,
.dayview-slot-csm--picked:focus,
.dayview-slot-csm--picked:active {
    background-color: var(--csm-primary);
    border-color: var(--csm-primary);
    color: var(--bs-white);
}

/* Live un-check feedback (builder bug 2026-11-13): the builder keep_
   checkbox is visually-hidden and server-rendered CHECKED, so --picked
   above is the selected look; the mirror of --free:has(input:checked)
   repaints an UN-checked cell white with a dashed border (same white as
   --free/--locked in this block) — the click-off is visible before save,
   when the slot is deleted. The base rule (0,2,1) already
   out-specifies the --picked hover group (each selector 0,2,0); the
   hover/focus/active twins re-pin the colours under the pointer. */
.dayview-slot-csm--picked:has(input:not(:checked)) {
    background-color: #fff;
    border: 1.5px dashed var(--csm-primary);
    color: var(--csm-primary);
}

.dayview-slot-csm--picked:has(input:not(:checked)):hover,
.dayview-slot-csm--picked:has(input:not(:checked)):focus,
.dayview-slot-csm--picked:has(input:not(:checked)):active {
    background-color: #fff;
    border-color: var(--csm-primary);
    color: var(--csm-primary);
}

/* Booked-out row (parent already holds a booking): faded, unclickable —
   mockup-pinned border/text values. */
.dayview-slot-csm--locked {
    border: 1px solid #d8cfe0;
    background-color: #fff;
    color: #b3a7bd;
    cursor: not-allowed;
}

/* Block content lines: occupant/child name hero + small time·room meta
   (mockup .slot .nm / .slot .t). The name is the lead line — the partner
   asked for a little more presence on 2026-11-17 (0.9rem → 1.0rem); the
   two-line height need (≈49 px) is pinned by DAYVIEW_COMPACT_BELOW_PX. */
.dayview-name-csm {
    display: block;
    font-weight: 700;
    font-size: 1.0rem;
}

.dayview-meta-csm {
    display: block;
    font-size: 0.72rem;
    opacity: 0.85;
    margin-top: 1px;
}

/* Translucent trash button on a booked/own block (mockup .slot .cancel):
   24 px, radius 6 px, white 22 % fill, 42 % on hover. Sized for both the
   inline bi-trash SVG (stroke inherits the white text colour) and a
   bootstrap-icons <i> glyph. */
.dayview-cancel-csm {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.22);
    color: var(--bs-white);
    font-size: 0.8125rem;
    cursor: pointer;
}

.dayview-cancel-csm:hover {
    background-color: rgba(255, 255, 255, 0.42);
}

.dayview-cancel-csm svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Padlock buttons on the bookings agenda (R229, mockup v6 .slot .lock):
   same 24 px / radius 6 px / 13 px svg seat as .dayview-cancel-csm, tinted
   with the brand instead of white (S2: colour-mixed from --csm-primary, no
   hardcoded hex). The FREE-block padlock ("Bloquer") is a SIBLING of the
   block button (interactive content may not nest in a <button>): it is
   positioned against the gutter, its top inlined from the slot geometry
   like the block's own top (S9 computed-value exception) and the 6 px
   inset added by margin-top. The "Libérer" padlock sits INSIDE the blocked
   block (--release): positioned against the block itself at exactly the
   trash button's seat, so the margin-top is reset. */
.dayview-lock-csm {
    position: absolute;
    top: 6px;
    right: 6px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background-color: color-mix(in srgb, var(--csm-primary) 14%, transparent);
    color: var(--csm-primary);
    cursor: pointer;
}

.dayview-lock-csm--release {
    margin-top: 0;
}

.dayview-lock-csm:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 28%, transparent);
}

/* Padlock = state ON (R229 blocked). The "Libérer" padlock is the marker
   of a blocked slot, so it is filled solid brand with the glyph in white
   instead of the 14 % tint the action padlocks wear — on the hatched grey
   --blocked fill the tint was too faint to read. Its hover deepens the
   solid chip (same direction as .btn-csm-primary) instead of lifting back
   to the action-icon look, which would hide the state. */
.dayview-lock-csm--release {
    background-color: var(--csm-primary);
    color: var(--bs-white);
}

.dayview-lock-csm--release:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 82%, var(--bs-black));
}

.dayview-lock-csm svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Eye buttons on the bookings agenda (R244, design 2026-11-19 C18):
   mirrors .dayview-lock-csm (same 24 px / radius 6 px / 13 px svg seat,
   same brand tint) — « Masquer » (open eye) on every unbooked visible
   block, « Afficher » (closed eye) on every hidden one. The eye is
   ALWAYS a sibling of its block (never inside a <button>), positioned
   against the gutter with its top inlined from the slot geometry (S9
   computed-value exception) and right: 34 px so padlock + eye sit side
   by side (6 + 24 + 4). No --release modifier: the eye never lives
   inside a block. */
.dayview-eye-csm {
    position: absolute;
    top: 6px;
    right: 34px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background-color: color-mix(in srgb, var(--csm-primary) 14%, transparent);
    color: var(--csm-primary);
    cursor: pointer;
}

.dayview-eye-csm:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 28%, transparent);
}

/* Eye = state ON (R244 hidden). The closed « Afficher » eye is the marker
   of a hidden slot, so on a --hidden block it is filled solid brand with
   the glyph in white — same state treatment as the "Libérer" padlock.
   Two adjacent chains mirror the DOM: block → eye on the blocked/hero/
   inert branches, block → padlock → eye on the free branch (+ not ~ —
   a general sibling would also restyle LATER blocks' eyes). The open
   « Masquer » eye on a visible block keeps the 14 % action tint: the
   solid chip means "this slot is hidden", never "click to hide". */
.dayview-slot-csm--hidden + .dayview-eye-csm,
.dayview-slot-csm--hidden + .dayview-lock-csm + .dayview-eye-csm {
    background-color: var(--csm-primary);
    color: var(--bs-white);
}

.dayview-slot-csm--hidden + .dayview-eye-csm:hover,
.dayview-slot-csm--hidden + .dayview-lock-csm + .dayview-eye-csm:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 82%, var(--bs-black));
}

.dayview-eye-csm svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Builder free cell (step 4, spec decision 6): the .dayview-slot-csm
   --picked wrapper holds the checkbox label and the room select as SIBLINGS
   — a <select> inside a <label> would toggle the checkbox on every click.
   The label fills the wrapper (padding repeats the .dayview-slot-csm text
   offset so the time label stays exactly where it was). */
.dayview-cell-toggle-csm {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 5px 10px 5px 9px;
    cursor: pointer;
}

/* Room-control cluster pinned to the block's right edge, vertically centred
   (mockup .slot .roomctl): 🏫 + borderless select, current-room text follows
   the block colour (inherit — white on the solid --picked fill). Declared
   AFTER the toggle label so it paints above it. */
.dayview-room-ctl-csm {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.74rem;
}

/* Borderless select (mockup .slot select.room). The dropdown options keep
   the readable body palette instead of the inherited white-on-transparent. */
.dayview-room-csm {
    border: 0;
    background-color: transparent;
    color: inherit;
    font-size: 0.74rem;
    padding: 0 2px;
    cursor: pointer;
    max-width: 150px;
}

.dayview-room-csm option {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Short slots (partner bug 2026-11-17: a 10-minute slot clipped to a 20 px
   strip, then halved again the same day). The grid runs at
   DAYVIEW_PX_PER_MIN = 3.0 px/min with a DAYVIEW_MIN_BLOCK_PX = 30 px floor
   (partner ask 2026-11-18: 20 px read too thin; the scale went back up
   from 2.0 so the floor and the 10-minute pitch meet at 30 px). A
   10-minute slot renders AT the floor: 30 px tall on a 30 px pitch —
   back-to-back short slots touch and never slide under each other.
   dayview_layout flags a
   block compact when its NATURAL height falls under DAYVIEW_COMPACT_BELOW_PX
   (52 px: the two content lines need ≈49 px, so the full two-line style
   starts at 19 minutes); the templates add --compact on the builder,
   bookings and parent pages alike. The compact variant renders ONE tight
   line — the meta row retires, padding and fonts shrink, and the action
   seats fit the floored block (trash/padlock 18 px, compact validate CTA,
   tight room select). */
.dayview-slot-csm--compact {
    padding: 1px 8px 1px 7px;
    font-size: 0.72rem;
    line-height: 1.25;
}

.dayview-slot-csm--compact .dayview-name-csm {
    font-size: 0.8rem;
}

.dayview-slot-csm--compact .dayview-meta-csm {
    display: none;
}

/* Trash + in-block padlock seats inside the floored block (they must stay
   inside the floor height, hence 18 px). */
.dayview-slot-csm--compact .dayview-cancel-csm,
.dayview-slot-csm--compact .dayview-lock-csm {
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

/* Sibling « Bloquer » padlock (single_form grid): its top is inlined
   (S9 computed value, which wins over this rule), so margin-top does the
   1 px seat. */
.dayview-slot-csm--compact + .dayview-lock-csm {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    margin-top: 1px;
}

.dayview-slot-csm--compact .dayview-cancel-csm svg,
.dayview-slot-csm--compact .dayview-lock-csm svg,
.dayview-slot-csm--compact + .dayview-lock-csm svg,
.dayview-slot-csm--compact + .dayview-eye-csm svg,
.dayview-slot-csm--compact + .dayview-lock-csm + .dayview-eye-csm svg {
    width: 10px;
    height: 10px;
}

/* Sibling « Masquer/Afficher » eye (R244): same floored-block seat as the
   padlock. Two adjacent chains: the eye sits directly after the block on
   the blocked/hero branches, after the padlock on the free branch (+ not
   ~ — a general sibling would also shrink the eyes of LATER blocks). */
.dayview-slot-csm--compact + .dayview-eye-csm,
.dayview-slot-csm--compact + .dayview-lock-csm + .dayview-eye-csm {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    margin-top: 1px;
}

.dayview-slot-csm--compact .dayview-validate-csm {
    bottom: 1px;
    right: 4px;
    padding: 0 0.3rem;
    font-size: 0.58rem;
}

/* Builder step-4 cell: the toggle label repeats the block's own compact
   text offset (same pairing as the base rules above) and the 🏫 room
   select is sized for the single line. */
.dayview-slot-csm--compact .dayview-cell-toggle-csm {
    padding: 1px 8px 1px 7px;
}

.dayview-slot-csm--compact .dayview-room-ctl-csm {
    right: 6px;
    font-size: 0.66rem;
}

.dayview-slot-csm--compact .dayview-room-csm {
    font-size: 0.66rem;
}

/* Class roster: one row per child, stacked with a small gap (mockup #roster
   + .chip). Rows are <button> elements — the rules fully reset the UA
   button look (font, border, alignment). */
.roster-list-csm {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.roster-row-csm {
    display: block;
    width: 100%;
    padding: 0.38rem 0.7rem;
    border: 1.5px solid var(--csm-primary);
    border-radius: 0.5rem;
    background-color: #fff;
    color: var(--csm-primary);
    font-family: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.roster-row-csm:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 10%, transparent);
}

/* Picked child (JS marks the clicked row): solid primary, like the agenda
   selected cell. */
.roster-row-csm--selected,
.roster-row-csm--selected:hover {
    background-color: var(--csm-primary);
    color: var(--bs-white);
}

/* Already-booked child (mockup .chip.taken): solid secondary, inert. */
.roster-row-csm--taken,
.roster-row-csm--taken:hover {
    border-color: var(--csm-secondary);
    background-color: var(--csm-secondary);
    color: var(--bs-white);
    cursor: default;
}

/* « Communication aux parents » (spec 2026-11-16, R238): one card row =
   info block beside the confirmed submit button (used twice — S4 single
   source), and the per-child targeted-send envelope riding the roster
   rows (hidden form + HTML5 form= idiom). */
.comms-row-csm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comms-row-csm + .comms-row-csm {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

.roster-row-wrap-csm {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.roster-row-wrap-csm > .roster-row-csm {
    flex: 1 1 auto;
    min-width: 0;
}

.roster-envelope-csm {
    flex: 0 0 auto;
    border: 0;
    background: none;
    padding: 0.1rem 0.35rem;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--csm-primary);
    cursor: pointer;
    border-radius: 0.35rem;
}

.roster-envelope-csm:hover {
    background-color: color-mix(in srgb, var(--csm-primary) 10%, transparent);
}

/* Two-column row (template pairs these with Bootstrap col-12 col-lg-8 /
   col-lg-4 for the mockup's 2fr/1fr split). min-width: 0 lets long names
   shrink instead of overflowing the flex row. */
.bookings-col-csm {
    min-width: 0;
}

.roster-col-csm {
    min-width: 0;
}

/* Small screens: the roster moves ABOVE the agenda (mockup v5 ruling —
   pick a child first, then scroll to the calendar). */
@media (max-width: 991.98px) {
    .roster-col-csm {
        order: -1;
    }
}

/* "Selected child" bar above the agenda (mockup .pickbar): the picked name
   is bold primary; in hint mode (nobody picked yet) it turns danger red. */
.pickbar-csm {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.pickbar-csm b {
    font-weight: 700;
    color: var(--csm-primary);
}

.pickbar-csm.hint b {
    color: var(--bs-danger-text-emphasis);
}

/* JS-hides the no-JS fallback <select> (#unbooked-child-select) once the
   roster script takes over. Element + class selector (0,1,1) outranks
   Bootstrap's single-class .form-select, so no !important is needed. */
select.select-hidden-csm {
    display: none;
}

/* Step-1 day selectors (brief 2026-11-11): the same pill recipe as
   .room-chip-csm; the checked fill follows the visually-hidden checkbox
   live through :has. */
.day-chip-csm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 1.9rem;
    padding: 0.125rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    background-color: var(--bs-secondary-bg-subtle);
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

.day-chip-csm:has(input:checked) {
    background-color: var(--csm-primary);
    color: var(--bs-white);
    border-color: var(--csm-primary);
}

.day-chip-csm:has(input:checked):hover {
    background-color: var(--csm-primary);
}

.day-chip-csm:has(input:focus-visible) {
    outline: 2px solid var(--csm-primary);
}

/* Compact width for the step-1 add-date input so label + input + button
   stay on ONE non-wrapping flex line at 360 px (min-width: 0 lets the
   input shrink with the row on phones). */
.day-add-input-csm {
    width: 7.5rem;
    flex: 0 1 auto;
    min-width: 0;
}

/* Espace parent home (brief 2026-11-11, R228): solid purple classroom chip
   on the child cards and the purple kid prefix on the meeting cards. */
.class-chip-csm {
    display: inline-block;
    padding: 0.125rem 0.75rem;
    border-radius: 0.375rem;
    background-color: var(--csm-primary);
    color: var(--bs-white);
    font-weight: 700;
}

.kid-prefix-csm {
    color: var(--csm-primary);
}

/* Espace parent empty states (brief 2026-11-11, R228): the approved
   dashed card border. Bootstrap has no dashed-border utility, so the
   partial carries this class; base.html loads styles.css AFTER
   Bootstrap core, so the single-property declaration overrides the
   .card border shorthand at equal specificity (no !important needed). */
.empty-card-csm {
    border-style: dashed;
}

/* Navbar enhancements per user request */
/* Bigger menu text for top-level navbar links */
nav.navbar .navbar-nav .nav-link {
    font-size: 1.2rem; /* ~18px for better readability */
}

/* Navbar link color override: set menu links to #a3145b */
nav.navbar .navbar-nav .nav-link,
nav.navbar .navbar-nav .nav-link.active,
nav.navbar .navbar-nav .show > .nav-link {
    color: #a3145b !important;
}


/* Increase contrast for navbar link hover/focus states */
.navbar-thin .navbar-nav .nav-link:hover,
.navbar-thin .navbar-nav .nav-link:focus {
    color: #ea5a0b !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

nav.navbar .navbar-nav .nav-link:hover,
nav.navbar .navbar-nav .nav-link:focus {
    color: #282358 !important; /* darker than base #a3145b for clear contrast */
    text-decoration: underline;
    text-decoration-thickness: 1px; /* thinner underline on hover/focus */
    text-underline-offset: 2px;
}

/* Keyboard accessibility: clear focus indicator */
nav.navbar .navbar-nav .nav-link:focus-visible {
    outline: 2px solid #282358;
    outline-offset: 2px;
    text-decoration: none; /* outline replaces underline for focus-visible */
}

/* center image */
.center-img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

/* maximum width images */
.image-max-width-600 {
    max-width: 600px; /* adjust width here */
    width: 100%;
    height: auto;
}

.image-max-width-300 {
    max-width: 300px; /* adjust width here */
    width: 100%;
    height: auto;
}

.image-max-height-150 {
    max-height: 150px;
    height: 100%;
    width: auto;
}

.card-image-link {
    transition: filter 0.3s ease;
    cursor: pointer;
}

.card-image-link:hover {
    filter: brightness(0.5);
}

/*.btn-apcsm-orange {*/
/*    --bs-btn-color: #282358;*/
/*    --bs-btn-bg: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-border-color: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-hover-color: #fff;*/
/*    --bs-btn-hover-bg: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-hover-border-color: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-focus-shadow-rgb: 60, 153, 110;*/
/*    --bs-btn-active-color: #fff;*/
/*    --bs-btn-active-bg: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-active-border-color: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);*/
/*    --bs-btn-disabled-color: #fff;*/
/*    --bs-btn-disabled-bg: rgba(234, 90, 11, 0.5);*/
/*    --bs-btn-disabled-border-color: rgba(234, 90, 11, 0.5);*/
/*}*/



/* APCM custom button variants: duplicate Bootstrap btn-*-primary/secondary with APCM colors */
/* Usage: <button class="btn btn-apcsm-pink-primary"> etc. */
 :root {
    --csm-primary: #66247f; /* brand primary (matches .btn-csm-primary / .bg-csm-primary) */
    --csm-secondary: #a3145b; /* brand secondary (matches .bg-csm-secondary) */
    --csm-orange: #ff923c; /* brand accent (matches .bg-csm-orange) */
    --csm-ok: #15803d; /* semantic "live/visible" green (project consoles) */
    --csm-amber: #b45309; /* semantic "pending" amber (project consoles) */
    --apcsm-pink-primary: #e61d72;
    --apcsm-pink-primary-hover: #c91a64; /* slightly darker */
    --apcsm-pink-primary-active: #b01756; /* darker */
    --apcsm-pink-primary-rgb: 230, 29, 114;

    --apcsm-orange-primary: #ea5a0b;
    --apcsm-orange-primary-hover: #c94c09;
    --apcsm-orange-primary-active: #b44308;
    --apcsm-orange-primary-rgb: 234, 90, 11;

    --apcsm-blue-primary: #282358;
}

/* Solid primary */
.btn-apcsm-pink-primary {
    color: #fff;
    background-color: var(--apcsm-pink-primary);
    border-color: var(--apcsm-pink-primary);
}
.btn-apcsm-pink-primary:hover {
    color: #fff;
    background-color: var(--apcsm-pink-primary-hover);
    border-color: var(--apcsm-pink-primary-hover);
}
.btn-apcsm-pink-primary:focus, .btn-apcsm-pink-primary.focus {
    color: #fff;
    background-color: var(--apcsm-pink-primary-hover);
    border-color: var(--apcsm-pink-primary-hover);
    box-shadow: 0 0 0 .25rem rgba(var(--apcsm-pink-primary-rgb), .5);
}
.btn-apcsm-pink-primary:active, .btn-apcsm-pink-primary.active, .show > .btn-apcsm-pink-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--apcsm-pink-primary-active);
    border-color: var(--apcsm-pink-primary-active);
}
.btn-apcsm-pink-primary:disabled, .btn-apcsm-pink-primary.disabled {
    color: #fff;
    background-color: var(--apcsm-pink-primary);
    border-color: var(--apcsm-pink-primary);
    opacity: .65;
}

/* Solid secondary */
.btn-apcsm-orange-primary {
    color: #fff;
    background-color: var(--apcsm-orange-primary);
    border-color: var(--apcsm-orange-primary);
}
.btn-apcsm-orange-primary:hover {
    color: #fff;
    background-color: var(--apcsm-orange-primary-hover);
    border-color: var(--apcsm-orange-primary-hover);
}
.btn-apcsm-orange-primary:focus, .btn-apcsm-orange-primary.focus {
    color: #fff;
    background-color: var(--apcsm-orange-primary-hover);
    border-color: var(--apcsm-orange-primary-hover);
    box-shadow: 0 0 0 .25rem rgba(var(--apcsm-orange-primary-rgb), .5);
}
.btn-apcsm-orange-primary:active, .btn-apcsm-orange-primary.active, .show > .btn-apcsm-orange-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--apcsm-orange-primary-active);
    border-color: var(--apcsm-orange-primary-active);
}
.btn-apcsm-orange-primary:disabled, .btn-apcsm-orange-primary.disabled {
    color: #fff;
    background-color: var(--apcsm-orange-primary);
    border-color: var(--apcsm-orange-primary);
    opacity: .65;
}

/* Outline secondary */
.btn-apcsm-orange-outline-primary {
    color: var(--apcsm-orange-primary);
    border-color: var(--apcsm-orange-primary);
}
.btn-apcsm-orange-outline-primary:hover {
    color: #fff;
    background-color: var(--apcsm-orange-primary);
    border-color: var(--apcsm-orange-primary);
}
.btn-apcsm-orange-outline-primary:focus, .btn-apcsm-orange-outline-primary.focus {
    box-shadow: 0 0 0 .25rem rgba(var(--apcsm-orange-primary-rgb), .5);
}
.btn-apcsm-orange-outline-primary:active, .btn-apcsm-orange-outline-primary.active, .show > .btn-apcsm-orange-outline-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--apcsm-orange-primary-active);
    border-color: var(--apcsm-orange-primary-active);
}
.btn-apcsm-orange-outline-primary:disabled, .btn-apcsm-orange-outline-primary.disabled {
    color: var(--apcsm-orange-primary);
    background-color: transparent;
    opacity: .15;
}


.txt-blue-primary {
    color: var(--apcsm-blue-primary);
}


.txt-orange-primary {
    color: var(--apcsm-orange-primary);
}

.txt-pink-primary {
    color: var(--apcsm-pink-primary);
}

.nav-csm-pills .nav-link {
    border: 1px solid #dee2e6;
    margin-right: 0.25rem;
    color: #66247f;
}

.nav-csm-pills .nav-link:hover {
    background-color: #f8f9fa;
    color: #56206b;
}

.nav-csm-pills .nav-link.active {
    background-color: #a3145b !important;
    border-color: #a3145b !important;
    color: #fff !important;
}

.dropdown-item.active, .dropdown-item:active {
    background-color: #a3145b !important;
    color: #fff !important;
}

.display-7 {
    font-weight: 200;
    line-height: 1.0;
    font-size: calc(1.175rem + 1.25vw);
}

@media (min-width: 1200px) {
    .display-7 {
        font-size: 2rem;
    }
}

.display-8 {
    font-weight: 150;
    line-height: 0.8;
    font-size: calc(1rem + 1.05vw);
}

@media (min-width: 1200px) {
    .display-8 {
        font-size: 1.5rem;
    }
}

/* Event specific styles */
.event-cover-container {
    height: auto;
    width: 100%;
    background-color: #fff;
}

@media (min-width: 992px) {
    .event-cover-container {
        height: 500px;
        max-height: 500px;
    }
}

.event-cover-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

@media (min-width: 992px) {
    .event-cover-img {
        height: 100%;
        width: 100%;
        max-height: 500px;
    }
}

.event-placeholder-img {
    opacity: 0.6;
}

.event-sticky-sidebar {
    top: 1rem;
    z-index: 1020;
}

.event-card-img-container {
    /*height: 400px;*/
    overflow: hidden;
    background-color: #ffffff;
}

.table-col-width-50 {
    width: 50px;
}

/* Volunteer management: keep column widths identical across the three group
   tables (bénévoles / responsables / administrateurs) on large screens. */
.table-csm-volunteers {
    table-layout: fixed;
}

.table-csm-volunteers .col-csm-name {
    width: 25%;
}

.table-csm-volunteers .col-csm-phone {
    width: 15%;
}

.table-csm-volunteers .col-csm-email {
    width: 30%;
}

.table-csm-volunteers .col-csm-children {
    width: 30%;
}

/* Track separator styles */
.track-separator {
    margin: 1.5rem 0;
}

.track-separator--vertical {
    text-align: center;
    font-size: 1.5rem;
    color: #6c757d;
    opacity: 0.6;
}

.track-separator--horizontal {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1.5rem 0;
}

.track-separator--spacing {
    height: 1.5rem;
    background: transparent;
}

.track-separator--custom {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    padding: 0.5rem 0;
}

/* Ensure inputs in a 2-col row align vertically even when labels differ in length */
.row-crispy-equal > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.row-crispy-equal > [class*="col-"] > .mb-3 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row-crispy-equal > [class*="col-"] > .mb-3 > :is(input, select, textarea) {
    margin-top: auto;
}

/* Library calendar: equal day columns */
.calendar-col {
    width: 14.2857%;
}

/* Library calendar: mobile "add schedule" button toggle */
#calendarWrapper .mobile-add-btn {
    display: none !important;
}

#calendarWrapper.show-add-buttons .mobile-add-btn {
    display: inline-block !important;
}

/* Smallest screens: show + badge for Add button */
@media (max-width: 576.98px) {
    #calendarWrapper .mobile-add-btn {
        border: none; /* keep it compact */
        padding: .125rem; /* minimal padding around the badge */
    }

    #calendarWrapper .mobile-add-btn .plus-badge {
        background-color: var(--apcsm-orange-primary, #ea5a0b);
        color: #fff;
        border-radius: 9999px;
        width: 1.5rem;
        height: 1.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        line-height: 1;
        padding: 0;
    }
}

/* Project app: clickable radio/label cursor (replaces inline style="cursor:pointer;") */
.cursor-pointer {
    cursor: pointer;
}

/* Project app: scrollable rules card body (replaces inline max-height/overflow) */
.scrollable-card-body {
    max-height: 300px;
    overflow-y: auto;
}

/* Delegate app: dinner booking quantity stepper (replaces dinner_book.html <style> block, S4/S9) */
.qty-stepper {
    max-width: 9rem;
}

.qty-stepper .qty-input {
    -moz-appearance: textfield;
    appearance: textfield;
    text-align: center;
}

.qty-stepper .qty-input::-webkit-outer-spin-button,
.qty-stepper .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Delegate app: school map fit inside the ratio box (replaces inline styles, S9) */
.map-fit-image {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

/* Delegate app: reduce products column width in dinner bookings table */
/* Delegate dinner detail: bookings table column sizing */
.dinner-bookings-col-name { width: 19%; }
.dinner-bookings-col-students { width: 17%; }
.dinner-bookings-col-participants { width: 4rem; }
.dinner-bookings-col-products { width: 24%; max-width: 360px; }
.dinner-bookings-col-amount { width: 6.5rem; }
.dinner-bookings-col-communication { width: 9.5rem; }
.dinner-bookings-col-payment { width: 12rem; }

/* Pages app: budget contribution QR code image (replaces inline style, S9) */
.qr-image {
    width: min(100%, 200px);
    aspect-ratio: 1 / 1;
}

/* Component: form submit-row container (S4, audit 2026-11-05 low row 108)
   — replaces the divergent bootstrap clusters (d-grid gap-2 d-sm-flex ×N,
   d-flex justify-content-center gap-3, mt-4 d-flex align-items-center
   gap-3, form-group mt-4). Base: full-width stacked buttons on mobile,
   inline row from sm up. --center-sm/--end-sm align the sm row;
   --row-center/--row-inline stay inline at all widths (gap-3 spacing). */
.form-actions {
    display: grid;
    gap: .5rem;
}
@media (min-width: 576px) {
    .form-actions {
        display: flex;
    }
    .form-actions--center-sm {
        justify-content: center;
    }
    .form-actions--end-sm {
        justify-content: flex-end;
    }
}
.form-actions--row-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.form-actions--row-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toast stack (improvements ledger row 48, S9): z-index of the
   site-wide message toast container (partials/messages.html). */
.toast-container {
    z-index: 1080;
}

/* Staging banner (S9, audit 2026-11-05 low row 109): static decoration;
   the settings-driven background/color stays inline (dynamic exception). */
.staging-banner-csm {
    padding: 18px 12px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Bank-transfer QR code image (S9, audit 2026-11-05 low row 110):
   twin of the finance page seed, frozen until the campaign ends. */
.payment-qr-image {
    max-width: 250px;
}

/* Shared contact block (R140): inline split-phone prefix select */
.select-csm-phone-prefix {
    flex: 0 0 auto;
    width: auto;
    max-width: 50%;
    min-width: 5rem;
}

/* GDPR consent widget (R110/R142): muted accordion + privacy link aligned
   with the checkbox label */
.accordion-csm-muted {
    --bs-accordion-bg: var(--bs-tertiary-bg);
    --bs-accordion-active-bg: transparent;
    --bs-accordion-active-color: var(--bs-body-color);
    --bs-accordion-btn-focus-border-color: var(--bs-secondary-bg);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem var(--bs-secondary-bg);
}

.gdpr-privacy-link {
    /* .form-check-label starts at 1.5rem (form-check padding-left) */
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
