html {
    overflow-x: clip;
}

/*  Hero  */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 0 0 2rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    color: #333;
}

.hero p {
    color: #555;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/*  Search box  */
.search-box {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
    margin: 2rem auto;
    max-width: 95%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

/* Input / select / button */
.search-box input,
.search-box select {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    min-width: 0;
}

.search-box input[type="text"]  { flex: 1 1 180px; }
.search-box select              { flex: 1 1 160px; }
.search-box input[type="date"]  { flex: 1 1 140px; }

.search-box button {
    flex: 1 1 120px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.search-box button:hover { background: #0056b3; }

/*  Pensions  */
.pension-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.2s;
}

.pension-card:hover {
    transform: scale(1.02);
}

.pension-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.pension-card-content {
    padding: 1rem;
}

input, select, textarea {
  border-radius: 8px !important;
}

label {
  font-weight: 500;
  color: #333;
}

/* Labels plus visibles et espacés */
form label.form-label {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    font-size: 0.95rem;
    color: #333;
}

/* Champs form-control avec effet moderne */
form .form-control {
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    box-shadow: none;
    width: 100%; /* Toujours full-width */
}

/* Espacement vertical entre champs */
.row.gy-3 > .col-12,
.row.gy-3 > .col-md-6 {
    margin-bottom: 0; /* Gestion via gap de row */
}

/* Checkbox label */
.form-check-label {
    margin-left: 5px;
    color: #555;
}

/* Classe Bootstrap Card */
.card.bg-light {
    background-color: #f8f9fa !important;
}

/* Boutons */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    font-size: 1rem;
    border-radius: 8px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Ligne de séparation */
hr.my-4 {
    border-top: 1px solid #dee2e6;
    opacity: 0.5;
}

/* Forcer l’apparence checkbox */
input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 18px;
    height: 18px;
}

/* Ajuster les photos */
/* Carrousel principal */
.carousel-photo-wrapper {
    width: 100%;
    height: 650px; /* Hauteur fixe pour stabilité */
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
}

.carousel-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit le cadre proprement */
}

/* Miniatures */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.thumbnail {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: 0.2s ease;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active {
    border-color: #0d6efd; 
}

/*  DASHBOARD GESTIONNAIRE  */

:root {
    --color-bg: #f4f6fb;
    --color-card: #ffffff;
    --color-primary: #2563eb;
    --color-primary-light: #eff6ff;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --color-info: #0891b2;
    --color-text: #1e293b;
    --color-muted: #64748b;
    --color-border: #e2e8f0;
    --dash-radius: 14px;
    --dash-shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
    --dash-shadow-hover: 0 4px 12px rgba(0,0,0,.1), 0 8px 32px rgba(0,0,0,.08);
}

.dash-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
    color: white;
    padding: 2rem 2.5rem;
    border-radius: 0 0 var(--dash-radius) var(--dash-radius);
    margin-bottom: 2rem;
    position: relative;
    overflow: visible;
    z-index: 100;
}

.dash-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 240px; height: 240px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.dash-header::after {
    content: '';
    position: absolute;
    bottom: -80px; left: 30%;
    width: 320px; height: 180px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
}

.dash-header::before,
.dash-header::after {
    z-index: 0;
}

.dash-header h1      { font-size: 1.6rem; font-weight: 700; margin-bottom: .25rem; }
.dash-header .subtitle { opacity: .75; font-size: .9rem; }
.dash-header-btn {
    background: rgba(255,255,255,.2);
    color: white;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 8px;
    padding: .3rem .9rem;
    font-size: .85rem;
    text-decoration: none;
    transition: background .2s;
}
.dash-header-btn:hover { background: rgba(255,255,255,.3); color: white; }

.dash-header .dropdown-menu {
    z-index: 1060 !important;
}

.dash-header-btn--danger {
    background: rgba(220, 38, 38, .85);
    border-color: rgba(220, 38, 38, .6);
    border: 1px;
}
.dash-header-btn--danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.stat-card {
    background: var(--color-card);
    border-radius: var(--dash-radius);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--dash-shadow);
    border: 1px solid var(--color-border);
    transition: box-shadow .2s, transform .2s;
    height: 100%;
    position: relative;
}
.stat-card:hover { box-shadow: var(--dash-shadow-hover); transform: translateY(-2px); }
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: .75rem;
}
.stat-card .stat-value     { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--color-text); }
.stat-card .stat-value--sm { font-size: 1.5rem; }
.stat-card .stat-label     { font-size: .8rem; color: var(--color-muted); margin-top: .25rem; }
.stat-card--urgent             { border-color: #fecaca; background: #fff5f5; }
.stat-card--urgent .stat-value { color: var(--color-danger); }
.stat-urgent-label             { color: var(--color-danger); font-weight: 700; }

.icon-bg-blue    { background: #eff6ff; }
.icon-bg-green   { background: #f0fdf4; }
.icon-bg-yellow  { background: #fffbeb; }
.icon-bg-purple  { background: #fdf4ff; }
.icon-bg-orange  { background: #fff7ed; }
.icon-bg-emerald { background: #ecfdf5; }
.icon-bg-sky     { background: #f0f9ff; }

.occupation-bar {
    height: 8px; background: #e2e8f0;
    border-radius: 99px; overflow: hidden; margin-top: .5rem;
}
.occupation-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    width: var(--fill, 0%);
    transition: width .6s ease;
}

.dash-section {
    background: var(--color-card);
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow);
    border: 1px solid var(--color-border);
    overflow: hidden; margin-bottom: 1.5rem;
}
.dash-section-header {
    padding: .9rem 1.4rem;
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
    background: #fafbfc;
}
.dash-section-header h5 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--color-text); }
.dash-section-body      { padding: 1rem 1.4rem; }
.dash-section-link      { font-size: .8rem; color: var(--color-primary); text-decoration: none; }
.dash-section-link:hover { text-decoration: underline; }

.shortcut-card {
    background: var(--color-card);
    border-radius: var(--dash-radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--dash-shadow);
    padding: 1.4rem;
    text-decoration: none !important;
    color: var(--color-text) !important;
    display: flex; flex-direction: column;
    align-items: flex-start; gap: .5rem;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    height: 100%;
}
.shortcut-card:hover {
    box-shadow: var(--dash-shadow-hover);
    transform: translateY(-3px);
    border-color: var(--color-primary);
}
.shortcut-card .sc-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.shortcut-card .sc-title { font-weight: 700; font-size: .95rem; }
.shortcut-card .sc-desc  { font-size: .78rem; color: var(--color-muted); }

.alert-pill {
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 10px; padding: .7rem 1rem;
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: .6rem; font-size: .875rem;
}
.alert-pill--warning { background: #fffbeb; border-color: #fde68a; }

.flash-bar {
    border-radius: var(--dash-radius); padding: .8rem 1.2rem;
    margin-bottom: 1rem; font-size: .875rem;
    display: flex; align-items: center; gap: .6rem;
}
.flash-bar--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.flash-bar--danger  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.flash-bar--warning { background: #fffbeb; border: 1px solid #fde68a; color: #d97706; }

.dash-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.dash-table th {
    padding: .6rem .9rem; font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--color-muted); border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.dash-table td { padding: .75rem .9rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td      { background: #f8fafc; }
.dash-table .text-xs         { font-size: .75rem; color: var(--color-muted); }
.dash-table .nowrap           { white-space: nowrap; }

.btn-action {
    padding: .3rem .8rem; border-radius: 8px;
    font-size: .8rem; font-weight: 600; border: none;
    cursor: pointer; transition: opacity .15s;
    text-decoration: none; display: inline-block;
}
.btn-action:hover     { opacity: .85; }
.btn-action--neutral  { background: #f1f5f9; color: #475569; }
.btn-action--primary  { background: #2563eb; color: white; }
.btn-action--info     { background: #88dcf1; color: white; }
.btn-action--danger   { background: #dc2626; color: white; }
.btn-action--success  { background: #16a34a; color: white; }

.pension-chip {
    background: var(--color-primary-light); border: 1px solid #bfdbfe;
    border-radius: 10px; padding: .6rem .9rem; font-size: .85rem;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .5rem;
}
.pension-chip:last-child { margin-bottom: 0; }
.pension-chip--green     { background: #f0fdf4; border-color: #bbf7d0; }
.pension-chip .chip-title { font-weight: 600; font-size: .85rem; }
.pension-chip .chip-sub   { font-size: .75rem; color: var(--color-muted); }
.pension-chip .chip-link  { font-size: .78rem; color: var(--color-primary); text-decoration: none; }

/* Donut occupation: taille contenue dans la stat-card */
#occupationChart {
    max-height: 100px;
    max-width: 100px;
    margin: 0 auto;
    display: block;
}

/* STATUTS SÉJOURS  */
/* Utilisé dans : mes_sejours propriétaire, mes_sejours gestionnaire, dashboard */

.badge-sejour-statut {
    display: inline-block;
    padding: .3em .85em;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-statut-en-attente  { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.badge-statut-pre-validee { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.badge-statut-confirmee   { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.badge-statut-en-cours    { background: #dcfce7; color: #15803d; border-color: #86efac; }
.badge-statut-terminee    { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.badge-statut-refusee     { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.badge-statut-annulee     { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; }

/* Bordures gauches colorées */
.sejour-card-inner         { border-left: 4px solid #94a3b8 !important; }
.border-statut-en-attente  { border-left-color: #ca8a04  !important; }
.border-statut-pre-validee { border-left-color: #0369a1  !important; }
.border-statut-confirmee   { border-left-color: #1d4ed8  !important; }
.border-statut-en-cours    { border-left-color: #16a34a  !important; }
.border-statut-terminee    { border-left-color: #94a3b8  !important; }
.border-statut-refusee     { border-left-color: #dc2626  !important; }
.border-statut-annulee     { border-left-color: #6b7280  !important; }

/* Carte de selection */
.pension-card {
    border-color: #dee2e6 !important;
    background: #fff;
}
.pension-card:hover {
    border-color: #0077b6 !important;
    background: #f0f9ff;
}
.pension-card.selected {
    border-color: #0077b6 !important;
    background: #e0f2fe;
}
.pension-card.selected .pension-check {
    opacity: 1 !important;
}
.pension-card.selected .pension-icon {
    background: #0077b6;
    color: #fff;
}
/* Raccourcis rapides */
.raccourci-card {
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}
.raccourci-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1) !important;
}

/* Création séjour employé */
.etape-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    background: #e9ecef;
    color: #6c757d;
    white-space: nowrap;
}

.etape-pill.active {
    background: #0077b6;
    color: #fff;
}

.etape-pill.done {
    background: #d1fae5;
    color: #15803d;
}

.separateur {
    color: #adb5bd;
    font-size: .8rem;
}

.mode-paiement-card {
    border-color: #dee2e6 !important;
    border-radius: 10px;
    transition: all .2s;
    cursor: pointer;
}

.mode-paiement-card:hover,
.mode-paiement-card.selected {
    border-color: #0077b6 !important;
    background: #e0f2fe;
}

.btn-animal {
    background: #fff;
    border-color: #dee2e6;
    transition: all .2s;
    cursor: pointer;
    width: 100%;
}

.btn-animal:hover {
    border-color: #0077b6 !important;
    background: #f0f9ff;
}

.text-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-bar .form-select,
.row.align-items-center > div .form-select {
    height: 38px;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.input-group:focus-within {
    border-radius: 8px;
    outline: 2px solid #0077b6;
    outline-offset: 0;
}
.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    outline: none !important;
    box-shadow: none !important;
}

/* Photos pensions : hauteur uniforme partout */
.card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

/* Résultats de recherche : photo liste */
.col-md-3 img {
    height: 100%;
    min-height: 160px;
    object-fit: cover;
    width: 100%;
}

/* Cards tâches planning */
.tache-card {
    border-left-width: 3px !important;
    border-left-style: solid !important;
    cursor: pointer;
}

.tache-card .card-body {
    padding: .5rem;
}

.badge-xs  { font-size: .6rem; }
.badge-sm  { font-size: .65rem; }
.text-xxs  { font-size: .68rem; }
.text-xs   { font-size: .72rem; }

/*   HEADER MOBILE  */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1029;
    background-color: #0077b6;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .mobile-logo img { width: 36px; height: 36px; }

.mobile-header .mobile-greeting {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-left: 0.75rem;
}

.mobile-header .mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-header .mobile-icon-btn {
    position: relative;
    color: white;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.3rem;
}

.mobile-header .mobile-icon-btn .badge-dot {
    position: absolute;
    top: 0; right: 0;
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #0077b6;
}

.mobile-header .mobile-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
    cursor: pointer;
}

/* bottom nav déjà stylée via Bootstrap, juste quelques ajouts */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    text-decoration: none;
    padding: 0.4rem 0.5rem;
    color: #6c757d;
    flex: 1;
}
.bottom-nav-item.active { color: #0077b6; }
.bottom-nav-item i { font-size: 1.2rem; margin-bottom: 2px; }

/* Espace pour la bottom navbar mobile */
@media (max-width: 991px) {
    body {
        padding-bottom: 70px;
    }
    nav.fixed-bottom .d-flex {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* Champs côte-à-côte sur mobile / tablette */
@media (min-width: 768px) {
    .row > .col-md-6 {
        margin-bottom: 0rem; /* espace vertical */
    }
    .row > .col-12 {
        margin-bottom: 0.2rem; /* champs full width plus espacés */
    }
}

/* Sur mobile : tous les champs full width sauf le bouton */
@media (max-width: 575px) {
    .search-box {
        padding: 1rem;
        gap: 0.5rem;
    }
    .search-box input[type="text"] { flex: 1 1 100%; }
    .search-box select             { flex: 1 1 100%; }
    .search-box input[type="date"] { flex: 1 1 calc(50% - 0.25rem); }
    .search-box button             { flex: 1 1 100%; }
}

@media (max-width: 575px) {
    section { margin-top: 1rem !important; margin-bottom: 1rem !important; }
    .my-5  { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
    .py-5  { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
}

/* Forcer la bottom navbar en bas de l'écran */
@media (max-width: 991px) {
    nav.fixed-bottom {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        margin-left: calc(-1 * ((100vw - 100%) / 2));
        z-index: 1031 !important;
        box-sizing: border-box;
    }
}

@media (max-width: 991px) {
    .bottom-nav-item {
        font-size: 9px;
        padding: 0.4rem 0.3rem;
    }
    .bottom-nav-item i {
        font-size: 1.1rem;
    }
}

footer {
    position: relative;
    z-index: 0;
}

/* Empêcher la navbar de clipper les dropdowns */
.navbar,
.navbar .container,
.navbar .container-fluid {
    overflow: visible !important;
}

/* Messagerie */ 
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}

@media (max-width: 991px) {
    .chat-wrapper {
        height: calc(100vh - 160px);
        border-radius: 0 !important;
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: #f0f2f5;
}

.bubble-row {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    width: 100%;
}

.bubble-row--right { flex-direction: row-reverse; }

.bubble {
    width: 85%;
    padding: .6rem .9rem;
    border-radius: 18px;
    font-size: .9rem;
    line-height: 1.5;
    word-break: break-word;
    width: fit-content;
}

.bubble--left {
    background: #fff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.bubble--right {
    background: #0077b6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble-meta {
    font-size: .65rem;
    color: #94a3b8;
    margin-top: .25rem;
    text-align: right;
}

.bubble--left .bubble-meta { text-align: left; }

.bubble-sender {
    font-size: .7rem;
    font-weight: 600;
    margin-bottom: .2rem;
    color: #0077b6;
}

.bubble--right .bubble-sender { color: rgba(255,255,255,.8); }

.bubble-row > div {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.bubble-row--right > div {
    align-items: flex-end;
}

.bubble-row--left > div {
    align-items: flex-start;
}

.chat-input {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: .75rem 1rem;
}

.avatar-bubble {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}

/* Messagerie desktop */
.conversation-item.active {
    background: #eff6ff !important;
    border-left: 3px solid #0077b6;
}

#conversation-panel {
    overflow: hidden;
}

#conversation-panel .chat-messages {
    height: auto;
    flex: 1;
    overflow-y: auto;
}

#conversation-panel .chat-wrapper,
#conversation-panel > .d-flex.flex-column {
    height: 100%;
}