/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Outfit', 'Space Grotesk', sans-serif;
    font-size: 14px;
    background: #f0f2f5;
    color: #2d3748;
    margin: 0; padding: 0;
}

a { color: #4A90D9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
#app-wrapper { display: flex; min-height: 100vh; }

#main-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
    width: 220px;
    min-width: 220px;
    background: #1a2640;
    color: #c8d3e8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-avatar {
    font-size: 36px;
    color: #4A90D9;
    line-height: 1;
    flex-shrink: 0;
}
.sidebar-profile-info strong {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.sidebar-profile-info span {
    font-size: 11px;
    color: #8a9bbf;
}

.sidebar-search {
    padding: 10px 12px;
}
.sidebar-search .form-control {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    color: #c8d3e8;
    font-size: 13px;
    height: 32px;
    border-radius: 6px;
}
.sidebar-search .form-control::placeholder { color: #6b7fa3; }
.sidebar-search .form-control:focus {
    background: rgba(255,255,255,.12);
    border-color: #4A90D9;
    outline: none;
    box-shadow: none;
    color: #fff;
}

.sidebar-menu {
    list-style: none;
    padding: 6px 0;
    margin: 0;
    flex: 1;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #8a9bbf;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.sidebar-menu li a .fa {
    width: 18px;
    text-align: center;
    font-size: 15px;
}
.sidebar-menu li a:hover {
    background: rgba(74,144,217,.12);
    color: #c8d3e8;
    border-left-color: #4A90D9;
}
.sidebar-menu li.active a {
    background: rgba(74,144,217,.18);
    color: #fff;
    border-left-color: #4A90D9;
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #8a9bbf;
    font-size: 13px;
    text-decoration: none;
}
.sidebar-logout:hover { color: #e57373; text-decoration: none; }

/* ── Main Content ────────────────────────────────────────────────────────── */
#main-content {
    margin-left: 220px;
    flex: 1;
    padding: 24px 28px;
    min-height: 100vh;
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-header-bar h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a2640;
    margin: 0;
    border: none;
    padding: 0;
}

.breadcrumb-nav {
    font-size: 12px;
    color: #8a9bbf;
    margin-bottom: 4px;
}
.breadcrumb-nav a { color: #4A90D9; }
.breadcrumb-sep { margin: 0 6px; color: #bbb; font-size: 10px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card-panel {
    background: #fff;
    border-radius: 10px;
    padding: 20px 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 20px;
}
.card-info {
    background: #f0f7ff;
    border: 1px solid #c8ddf8;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a2640;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px;
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.stat-icon { font-size: 28px; opacity: .75; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: #8a9bbf; margin-top: 2px; }

.stat-blue  .stat-icon { color: #4A90D9; }
.stat-green .stat-icon { color: #27ae60; }
.stat-purple.stat-icon { color: #8e44ad; }
.stat-orange .stat-icon { color: #e67e22; }

a.stat-card-link { display: flex; text-decoration: none; color: inherit; cursor: pointer; transition: transform .13s, box-shadow .13s; }
a.stat-card-link:hover { text-decoration: none; color: inherit; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* ── Dashboard quick links ───────────────────────────────────────────────── */
.quick-links { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7f9fc;
    border-radius: 7px;
    font-size: 13px;
    color: #2d3748;
    text-decoration: none;
    transition: background .15s;
}
.quick-link .fa { color: #4A90D9; width: 16px; }
.quick-link:hover { background: #e8f0fb; text-decoration: none; color: #1a2640; }

.next-rdv { padding: 10px 0; }
.next-rdv-time { font-size: 13px; color: #4A90D9; margin-bottom: 4px; }
.next-rdv-patient { font-size: 15px; }
.next-rdv-motif { font-size: 12px; margin-top: 2px; }

/* ── Agenda ──────────────────────────────────────────────────────────────── */
.agenda-layout {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    overflow: hidden;
}

.agenda-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eef0f5;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
}
.agenda-toolbar-left,
.agenda-toolbar-right { display: flex; align-items: center; gap: 6px; }
.agenda-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a2640;
    white-space: nowrap;
}

#fullcalendar { flex: 1; padding: 0 4px; }

/* Override FC styles */
.fc { font-family: 'Outfit', sans-serif !important; font-size: 13px; }
.fc .fc-col-header-cell-cushion { font-weight: 600; color: #2d3748; font-size: 12px; text-transform: uppercase; }
.fc .fc-timegrid-slot-label { font-size: 11px; color: #9aa5be; }
.fc .fc-scrollgrid { border: none !important; }
.fc .fc-scrollgrid td, .fc .fc-scrollgrid th { border-color: #f0f2f5 !important; }
.fc-lbl-s { display: none; }
.fc-event { border-radius: 5px !important; border: none !important; font-size: 12px !important; }
.fc-event-inner { padding: 3px 5px; line-height: 1.3; }
.fc-ev-time { font-size: 10px; opacity: .85; }
.fc-ev-title { font-weight: 600; }
.fc-ev-motif { font-size: 10px; opacity: .8; }
.fc-absence { color: #555 !important; }

/* Day view on mobile: all event info on one line */
@media (max-width: 768px) {
    .fc-timeGridDay-view .fc-event-inner {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: 5px;
        white-space: nowrap;
        overflow: hidden;
        padding: 2px 5px;
    }
    .fc-timeGridDay-view .fc-ev-time  { flex-shrink: 0; font-size: 11px; }
    .fc-timeGridDay-view .fc-ev-title { flex-shrink: 0; font-size: 11px; font-weight: 600; }
    .fc-timeGridDay-view .fc-ev-motif { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
    .fc-timeGridDay-view .fc-ev-time::after  { content: ' ·'; opacity: .5; margin-left: 2px; }
    .fc-timeGridDay-view .fc-ev-title::after { content: ' ·'; opacity: .5; margin-left: 2px; }
}
.fc .fc-button { display: none !important; }
.fc .fc-highlight { background: rgba(74,144,217,.1) !important; }
.fc .fc-now-indicator-line { border-color: #e53e3e !important; }
.fc .fc-non-business { background: rgba(0,0,0,.025) !important; }
.fc .fc-daygrid-event { border-radius: 4px !important; }

.agenda-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #eef0f5;
    background: #fafbfd;
    font-size: 13px;
    color: #2d3748;
}
.agenda-stats { display: flex; align-items: center; gap: 6px; }
.agenda-stats strong { color: #4A90D9; }
.agenda-bottom-actions { display: flex; gap: 6px; }

/* ── Patients toolbar ────────────────────────────────────────────────────── */
.patients-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.search-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 340px;
}
.search-wrap .search-icon {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    color: #8a9bbf;
    pointer-events: none;
    font-size: 13px;
}
.search-wrap .form-control { padding-left: 32px; }

.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
    background: #f0f2f5;
    border: 1px solid #dce0e8;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #5a6a85;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.filter-tab:hover { background: #e0e6f0; }
.filter-tab.active { background: #4A90D9; border-color: #4A90D9; color: #fff; }
.tab-count {
    display: inline-block;
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 11px;
    margin-left: 3px;
}
.filter-tab:not(.active) .tab-count { background: rgba(0,0,0,.08); }

/* ── Patient name cell ───────────────────────────────────────────────────── */
.patient-name-cell { display: flex; align-items: center; gap: 10px; }
.patient-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #e8f0fb;
    color: #4A90D9;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.badge-online {
    display: inline-block;
    background: #e0f5ee;
    color: #1b7f52;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
}
.status-badge {
    display: inline-block;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 500;
}
.status-actif   { background: #e0f5ee; color: #1b7f52; }
.status-inactif { background: #f0f2f5; color: #8a9bbf; }

/* ── Patients table (desktop only) ──────────────────────────────────────── */
.patients-table-wrap { padding: 0; overflow: hidden; }
.patients-table { margin: 0; }
.patients-table th:first-child,
.patients-table td:first-child { padding-left: 20px; }
.patients-table th:last-child,
.patients-table td:last-child  { padding-right: 20px; }
#patients-cards { display: none; }

/* ── Patient cards (mobile) ──────────────────────────────────────────────── */
.patient-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 10px;
    overflow: hidden;
}
.patient-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
}
.patient-card-name { flex: 1; min-width: 0; }
.patient-card-name strong { font-size: 14px; display: block; }
.patient-card-actions { display: flex; gap: 5px; flex-shrink: 0; }
.patient-card-body {
    padding: 0 14px 12px 58px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.patient-card-info { font-size: 13px; color: #5a6a85; }
.patient-card-info .fa { width: 16px; text-align: center; color: #8a9bbf; margin-right: 4px; }
.patient-card-info a { color: #4A90D9; }

/* ── Table toolbar ───────────────────────────────────────────────────────── */
.table-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table th {
    font-size: 11px;
    font-weight: 700;
    color: #8a9bbf;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-top: none !important;
    border-bottom: 2px solid #eef0f5 !important;
    padding: 8px 12px;
    white-space: nowrap;
}
.table td {
    vertical-align: middle !important;
    padding: 10px 12px;
    border-color: #f0f2f5 !important;
}
.table-hover tbody tr:hover { background: #f7f9fc; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-blue   { background: #4A90D9; color: #fff; padding: 3px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green  { background: #27ae60; color: #fff; padding: 3px 8px; border-radius: 20px; font-size: 12px; }
.badge-gray   { background: #bdc3c7; color: #fff; padding: 3px 8px; border-radius: 20px; font-size: 12px; }
.badge-dark   { background: #556; color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 12px; }

/* ── Motif badge ─────────────────────────────────────────────────────────── */
.motif-badge {
    display: inline-block;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Online dot ──────────────────────────────────────────────────────────── */
.dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
}

/* ── Create links ────────────────────────────────────────────────────────── */
.create-links { display: flex; flex-wrap: wrap; gap: 14px; }
.create-links .link-blue { font-size: 13px; }
.link-blue { color: #4A90D9; }
.link-blue:hover { text-decoration: underline; }

/* ── Rich editor ─────────────────────────────────────────────────────────── */
.editor-toolbar {
    background: #f7f9fc;
    border: 1px solid #dce0e8;
    border-bottom: none;
    padding: 5px 8px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.editor-toolbar .btn { padding: 2px 7px; font-size: 13px; }
.editor-sep { width: 1px; height: 18px; background: #dce0e8; margin: 0 4px; }

.rich-editor {
    border: 1px solid #dce0e8;
    border-radius: 0 0 6px 6px;
    padding: 10px 12px;
    min-height: 100px;
    background: #fff;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
}
.rich-editor:focus { border-color: #4A90D9; }

/* ── Filter groups (communiquer email) ───────────────────────────────────── */
.filter-group {
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}
.filter-group:last-of-type { border-bottom: none; }
.filter-checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.filter-checkbox input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; margin: 0; }
.filter-sub { padding: 8px 24px; }

.recipient-count {
    margin: 14px 0;
    padding: 10px 14px;
    background: #f0f7ff;
    border-radius: 7px;
    border: 1px solid #c8ddf8;
    font-size: 13px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}
.recipient-count .fa { color: #4A90D9; }

.var-list { padding-left: 18px; font-size: 13px; }
.var-list li { margin-bottom: 4px; }
.var-list code { background: #e8f0fb; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ── Config rows ─────────────────────────────────────────────────────────── */
.config-section { margin-bottom: 6px; }
.config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
    gap: 16px;
}
.config-row:last-child { border-bottom: none; }
.config-label { flex: 1; }
.config-label label { font-weight: 500; margin: 0 0 2px; display: block; }
.config-control { flex-shrink: 0; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px; height: 24px;
    cursor: pointer;
    margin: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccd3de;
    border-radius: 24px;
    transition: .2s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: #4A90D9; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ── Réglages tiles ──────────────────────────────────────────────────────── */
.reglage-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 16px;
    transition: box-shadow .2s, transform .15s;
    border: 2px solid transparent;
}
.reglage-tile .fa { font-size: 32px; color: #4A90D9; }
.reglage-tile strong { font-size: 14px; font-weight: 600; }
.reglage-tile span { font-size: 12px; color: #8a9bbf; }
.reglage-tile:hover { box-shadow: 0 4px 16px rgba(74,144,217,.18); border-color: #4A90D9; transform: translateY(-2px); text-decoration: none; color: #1a2640; }

/* ── Bootstrap overrides ─────────────────────────────────────────────────── */
.btn-primary {
    background-color: #4A90D9 !important;
    border-color: #4A90D9 !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #3579c4 !important;
    border-color: #3579c4 !important;
}
.btn { border-radius: 7px !important; font-family: inherit; }
.btn-xs { border-radius: 5px !important; }
.form-control {
    border-radius: 7px !important;
    border-color: #dce0e8;
    font-family: inherit;
    font-size: 14px;
}
.form-control:focus { border-color: #4A90D9; box-shadow: 0 0 0 2px rgba(74,144,217,.18); }
.modal-content { border-radius: 12px; border: none; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal-header { border-bottom: 1px solid #eef0f5; padding: 16px 20px; }
.modal-header .modal-title { font-size: 16px; font-weight: 600; color: #1a2640; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid #eef0f5; padding: 14px 20px; }
.alert { border-radius: 8px; }
.input-group-btn .btn { border-radius: 0 7px 7px 0 !important; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d3e8; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #8a9bbf; }

/* ── Mobile top bar ──────────────────────────────────────────────────────── */
#mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 54px;
    background: #1a2640;
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#mobile-logo {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
    text-decoration: none;
    position: absolute;
    left: 50%; transform: translateX(-50%);
}
#mobile-rdv-btn {
    font-size: 18px;
    color: #8a9bbf;
    padding: 6px;
    text-decoration: none;
}
#mobile-rdv-btn:hover { color: #fff; }

/* ── Hamburger button ────────────────────────────────────────────────────── */
#hamburger {
    background: none;
    border: none;
    padding: 8px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 36px;
}
#hamburger span {
    display: block;
    height: 2px;
    background: #c8d3e8;
    border-radius: 2px;
    transition: transform .25s, opacity .2s, width .2s;
    transform-origin: center;
}
#hamburger span:nth-child(1) { width: 22px; }
#hamburger span:nth-child(2) { width: 16px; }
#hamburger span:nth-child(3) { width: 22px; }

/* Animated X when open */
#hamburger.active span:nth-child(1) { width: 22px; transform: translateY(7px) rotate(45deg); }
#hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#hamburger.active span:nth-child(3) { width: 22px; transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar overlay ─────────────────────────────────────────────────────── */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 149;
    opacity: 0;
    transition: opacity .25s;
}
#sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    /* Hide less-critical table columns */
    .col-email, .col-ddn { display: none; }
}

@media (max-width: 768px) {
    /* Show mobile top bar */
    #mobile-topbar { display: flex; }

    /* Sidebar becomes a slide-over panel */
    #sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100%;
        width: 260px;
        min-width: 260px;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform .27s cubic-bezier(.4,0,.2,1);
        padding-top: 0;
    }
    #sidebar.open { transform: translateX(0); }

    /* Push content below top bar */
    #main-content {
        margin-left: 0;
        padding: 70px 16px 24px;
    }

    /* Patients: switch to card layout */
    .patients-table-wrap { display: none !important; }
    #patients-cards { display: block; }

    /* Full-width search on mobile */
    .search-wrap { max-width: 100%; flex: 1 1 100%; }
    .patients-toolbar { flex-direction: column; align-items: stretch; }
    .filter-tabs { justify-content: center; }

    /* Agenda toolbar stacks */
    .agenda-toolbar { flex-direction: column; align-items: flex-start; }
    /* Compact view-switcher buttons */
    .fc-lbl-l { display: none; }
    .fc-lbl-s { display: inline; }
    .fc-view-btn { padding: 3px 7px !important; font-size: 11px !important; }
    .page-header-bar { flex-direction: column; align-items: flex-start; }

    /* Modals full-width on small screens */
    .modal-dialog { margin: 10px; width: auto; }

    /* Prevent body scroll when sidebar open */
    body.sidebar-open { overflow: hidden; }

    /* motifs_rdv: hide non-essential columns, allow action buttons to wrap */
    #motifs-table th:nth-child(2),
    #motifs-table td:nth-child(2),
    #motifs-table th:nth-child(3),
    #motifs-table td:nth-child(3),
    #motifs-table th:nth-child(4),
    #motifs-table td:nth-child(4) { display: none; }
    #motifs-table td:last-child { white-space: normal; text-align: right; }
    #motifs-table td:last-child .btn { margin-bottom: 3px; }
}
