:root {
    --site-sidebar: #1f2d3d;
    --site-primary: #2f6fed;
    color-scheme: light;
}

body {
    background-color: #f4f6f8;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--site-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0 0.5rem 1.5rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav .nav-link {
    color: #c9d3dd;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link i {
    width: 22px;
    display: inline-block;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--site-primary);
    color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    font-size: 0.85rem;
}

.sidebar-footer .btn-logout {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-footer .btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    min-width: 0; /* évite que le contenu (tableaux larges) ne pousse le layout */
}

/* --- Barre mobile (visible seulement sous le breakpoint lg, 992px) --- */
.mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--site-sidebar);
    color: #fff;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.mobile-topbar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.mobile-topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.sidebar-overlay {
    display: none;
}

/* --- En dessous de 992px : le menu devient un panneau hors-écran --- */
@media (max-width: 991.98px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 82vw;
        max-width: 300px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1060;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 1055;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-overlay.sidebar-overlay-visible {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-locked {
        overflow: hidden;
    }

    .main-content {
        padding: 1.25rem;
    }
}

.status-card {
    border-left: 6px solid #ccc;
}

.status-ok {
    border-left-color: #2ecc71;
}

.status-alert {
    border-left-color: #e74c3c;
    background-color: #fdf3f2;
}

.status-unknown {
    border-left-color: #f39c12;
}

.big-button {
    font-size: 1.1rem;
    padding: 0.9rem 1.25rem;
}

.status-card-compact .card-title {
    font-size: 0.9rem;
}

.btn-xs {
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* --- Cases de sélection "design" pour l'export (Réglages > Export) --- */
.export-section-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.export-section-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 2px solid #e2e5e9;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    background-color: #fff;
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .export-section-card {
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .export-section-card i.export-section-icon {
        font-size: 1rem;
    }
}

/* --- Planning --- */
.planning-employee-col {
    min-width: 110px;
}

.planning-day-col {
    min-width: 110px;
}

.planning-shift-block {
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .planning-employee-col {
        min-width: 150px;
    }

    .planning-day-col {
        min-width: 130px;
    }
}

.export-section-card:hover {
    border-color: var(--site-primary);
}

.export-section-card i.export-section-icon {
    font-size: 1.3rem;
    color: #9aa1a9;
    transition: color 0.15s ease;
}

.export-section-card .export-section-check {
    margin-left: auto;
    font-size: 1.1rem;
    display: flex;
}

.export-section-check .icon-checked {
    display: none;
    color: var(--site-primary);
}

.export-section-check .icon-unchecked {
    color: #d7dbe0;
}

.export-section-input:checked + .export-section-card .export-section-check .icon-checked {
    display: inline;
}

.export-section-input:checked + .export-section-card .export-section-check .icon-unchecked {
    display: none;
}

.export-section-input:checked + .export-section-card {
    border-color: var(--site-primary);
    background-color: color-mix(in srgb, var(--site-primary) 8%, white);
}

.export-section-input:checked + .export-section-card i.export-section-icon {
    color: var(--site-primary);
}

.export-section-input:focus-visible + .export-section-card {
    outline: 2px solid var(--site-primary);
    outline-offset: 2px;
}

/* --- Couleur principale appliquée sur les éléments Bootstrap utilisés dans l'app --- */
.btn-primary {
    background-color: var(--site-primary) !important;
    border-color: var(--site-primary) !important;
}

.btn-outline-primary {
    color: var(--site-primary) !important;
    border-color: var(--site-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--site-primary) !important;
    color: #fff !important;
}

.text-primary {
    color: var(--site-primary) !important;
}

.bg-primary {
    background-color: var(--site-primary) !important;
}

.border-primary {
    border-color: var(--site-primary) !important;
}

a {
    color: var(--site-primary);
}

.page-item.active .page-link {
    background-color: var(--site-primary) !important;
    border-color: var(--site-primary) !important;
}

.nav-tabs .nav-link.active {
    border-bottom-color: var(--site-primary) !important;
    color: var(--site-primary) !important;
}

/* --- Mémo d'équipe (tableau de bord) --- */
.note-color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.note-color-swatch:has(input:checked) {
    border-color: #495057;
}

.notes-board {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.note-card {
    width: 220px;
    min-height: 140px;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: rotate(-1deg);
    transition: transform 0.15s ease;
}

.note-card:nth-child(even) {
    transform: rotate(1deg);
}

.note-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.note-message {
    color: #33302b;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.75rem;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c6459;
}

/* --- Icône ronde dans les modals de confirmation de suppression --- */
.delete-modal-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background-color: #f8d7da;
    color: #b02a37;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.modal-content {
    border-radius: 14px;
    border: none;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
}
