@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

.ticket-modal-header .ticket-company-logo {
    font-size: 2.2rem;
    color: #ffc213;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ticket-modal-header .ticket-company-name {
    font-size: 1.18rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.2rem;
    letter-spacing: 0.01em;
    text-align: center;
}
.ticket-modal-status-badge {
    display: inline-block;
    padding: 0.18em 0.95em;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
    background: #eafbe7;
    color: #04802c;
    letter-spacing: 0.01em;
}
.ticket-modal-status-badge.annulé {
    background: #ffeaea;
    color: #f05454;
}
.ticket-modal-status-badge.en_attente {
    background: #fffbe7;
    color: #ffc213;
}
.ticket-modal-status-badge.expiré,
.ticket-modal-status-badge.expirer {
    background: #f0f0f0;
    color: #7a7a7a;
}
/* --- MODAL TICKET HORIZONTAL --- */
.ticket-modal-panel.ticket-horizontal {
    display: flex;
    flex-direction: row;
    max-width: 900px;
    min-width: 340px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(15, 15, 17, 0.18), 0 0 0 1.5px #ffc21333;
    overflow: hidden;
    position: relative;
}
.ticket-modal-header.ticket-horizontal-header {
    flex: 0 0 220px;
    background: linear-gradient(135deg, #ffc213 0%, #ffe48a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.2rem 1.2rem 1.2rem 1.2rem;
    position: relative;
    min-height: 100%;
}
.ticket-modal-avatar.ticket-horizontal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    font-size: 2.5rem;
    color: #ffc213;
    box-shadow: 0 2px 12px #ffc21333;
}
.ticket-modal-title.ticket-horizontal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f1f24;
    margin-bottom: 0.2rem;
    text-align: center;
}
.ticket-modal-sub.ticket-horizontal-sub {
    color: #6b6b72;
    font-size: 1.01rem;
    margin-bottom: 0.5rem;
    text-align: center;
}
.ticket-modal-status.ticket-horizontal-status {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #04802c;
    text-align: center;
}
.ticket-modal-body.ticket-horizontal-body {
    flex: 1 1 0%;
    padding: 2.2rem 2.2rem 1.2rem 2.2rem;
    background: repeating-linear-gradient(90deg, #f7f7fb 0 8px, #fff 8px 16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ticket-info-list.ticket-horizontal-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ticket-info-list.ticket-horizontal-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px dashed #e6e8ef;
    font-size: 1.01rem;
}
.ticket-info-list.ticket-horizontal-list li:last-child { border-bottom: none; }
.ticket-info-label.ticket-horizontal-label {
    color: #9aa0a6;
    font-weight: 500;
    font-size: 0.98rem;
}
.ticket-info-value.ticket-horizontal-value {
    color: #1f1f24;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: right;
    margin-left: 1.2rem;
}
.ticket-modal-close.ticket-horizontal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc213;
    font-size: 1.2rem;
    border: none;
    box-shadow: 0 2px 8px #ffc21322;
    cursor: pointer;
    z-index: 2;
    transition: background 0.18s;
}
.ticket-modal-close.ticket-horizontal-close:hover { background: #ffe48a; }
@media (max-width: 800px) {
    .ticket-modal-panel.ticket-horizontal { flex-direction: column; max-width: 98vw; }
    .ticket-modal-header.ticket-horizontal-header { flex-direction: row; min-height: unset; padding: 1.2rem; }
    .ticket-modal-body.ticket-horizontal-body { padding: 1.2rem; }
}
/* --- MODAL TICKET MODERNE --- */
.ticket-modal-panel {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(15, 15, 17, 0.18), 0 0 0 1.5px #ffc21333;
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    position: relative;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
}
.ticket-modal-header {
    background: linear-gradient(135deg, #ffc213 0%, #ffe48a 100%);
    padding: 2.2rem 1.5rem 1.2rem 1.5rem;
    text-align: center;
    position: relative;
}
.ticket-modal-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.7rem auto;
    font-size: 2.1rem;
    color: #ffc213;
    box-shadow: 0 2px 12px #ffc21333;
}
.ticket-modal-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1f1f24;
    margin-bottom: 0.2rem;
}
.ticket-modal-sub {
    color: #6b6b72;
    font-size: 1.02rem;
    margin-bottom: 0.5rem;
}
.ticket-modal-status {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #04802c;
}
.ticket-modal-body {
    padding: 1.5rem 1.5rem 1.2rem 1.5rem;
    background: repeating-linear-gradient(90deg, #f7f7fb 0 8px, #fff 8px 16px);
}

/* --- Modal form: deux colonnes (uniquement pour le modal 'Modifier le billet') --- */
#ticket-edit-modal .modal-panel-body form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    align-items: start;
}
#ticket-edit-modal .modal-panel-body .form-group {
    margin-bottom: 0;
}
/* utilitaire pour forcer un champ à pleine largeur dans la grille */
#ticket-edit-modal .modal-panel-body .form-group.full-width {
    grid-column: 1 / -1;
}
#ticket-edit-modal .modal-panel-body .form-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted-color, #9aa0a6);
    font-weight: 500;
}
#ticket-edit-modal .modal-panel-body .form-control,
#ticket-edit-modal .modal-panel-body .form-control-custom {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    #ticket-edit-modal .modal-panel-body form { grid-template-columns: 1fr; }
}
.ticket-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ticket-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px dashed #e6e8ef;
    font-size: 1.01rem;
}
.ticket-info-list li:last-child { border-bottom: none; }
.ticket-info-label {
    color: #9aa0a6;
    font-weight: 500;
    font-size: 0.98rem;
}
.ticket-info-value {
    color: #1f1f24;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: right;
}
.ticket-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc213;
    font-size: 1.2rem;
    border: none;
    box-shadow: 0 2px 8px #ffc21322;
    cursor: pointer;
    z-index: 2;
    transition: background 0.18s;
}
.ticket-modal-close:hover { background: #ffe48a; }
:root {
    --primary-color: #282828;
    --secondary-color: #ffc213;
    --muted-color: #9aa0a6;
    --surface-color: #ffffff;
    --surface-alt: #f7f7fb;
    --border-color: rgba(0, 0, 0, 0.08);
    --card-border-color: #e8eaf0;
    --success: #04802c;
    --warning: #ffc213;
    --danger: #f05454;

    /* ------------------------------------------------------------------
       Button color variables & unified button rules
       Ensures buttons with the same semantic role (primary, danger, ghost,
       outline, export, icon) share consistent colors across all pages.
       ------------------------------------------------------------------ */
    :root {
        --btn-primary-bg: #ffc213;
        --btn-primary-color: #1f1f24;
        --btn-primary-hover: #e6ae00;

        --btn-danger-bg: #dc3545;
        --btn-danger-hover: #c82333;

        --btn-outline-bg: var(--surface-color, #fff);
        --btn-outline-border: var(--border-color, rgba(0,0,0,0.08));

        --btn-ghost-bg: transparent;
        --btn-ghost-border: rgba(0,0,0,0.12);

        --btn-export-bg: rgba(4, 128, 44, 0.08);
        --btn-export-color: #04802c;

        --btn-icon-hover-bg: var(--surface-alt, #f5f5f5);
    }

    /* Primary actions */
    .btn-primary,
    .btn-primary-custom {
        background: var(--btn-primary-bg) !important;
        color: var(--btn-primary-color) !important;
        border: none !important;
    }
    .btn-primary:hover,
    .btn-primary-custom:hover {
        background: var(--btn-primary-hover) !important;
    }

    /* Danger / destructive actions */
    .btn-danger {
        background: var(--btn-danger-bg) !important;
        color: #fff !important;
        border: none !important;
    }
    .btn-danger:hover { background: var(--btn-danger-hover) !important; }

    /* Outline buttons (secondary/neutral) */
    .btn-outline {
        background: var(--btn-outline-bg) !important;
        border: 1px solid var(--btn-outline-border) !important;
        color: var(--text-color, #1f1f24) !important;
    }
    .btn-outline:hover { background: var(--surface-alt, #f5f5f5) !important; }

    /* Ghost buttons (minimal) */
    .btn-ghost {
        background: var(--btn-ghost-bg) !important;
        border: 1px solid var(--btn-ghost-border) !important;
        color: var(--text-color, #1f1f24) !important;
    }
    .btn-ghost:hover { background: rgba(0,0,0,0.04) !important; }

    /* Export / success-styled small action */
    .btn-export {
        background: #dcefe2 !important;
        color: #04802c !important;
        border: 1px solid #04802c !important;
    }
    .btn-export:hover { background: #04802c !important; color: #fff !important; }

    /* Icon buttons hover */
    .btn-icon:hover { background: var(--btn-icon-hover-bg) !important; color: var(--primary-color) !important; }

    /* Ensure modal action bars reuse the same primary color */
    .modal-form-actions .btn-primary { background: var(--btn-primary-bg) !important; color: var(--btn-primary-color) !important; }

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #ffffff 0%, #f0f2f6 55%, #e6e8ef 100%);
    color: #1f1f24;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* Utility helpers */
.d-none { display: none !important; }

/* Fade-in animation for page content */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

#content-area > * {
    animation: fadeInUp 0.35s ease both;
}

.sidebar {
    width: 260px;
    background: #01290e;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    padding: 2rem 1.5rem;
    z-index: 1100;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar .logo-area {
    padding: 0.5rem 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
}

.sidebar .logo-area h3 {
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar .logo-area img.sidebar-logo {
    width: 160px;
    height: auto;
    display: block;
    margin-left: 0px;
}

.sidebar .logo-area .logo-tagline {
    margin-left: -10px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,194,19,0.7);
}

.sidebar .logo-area span {
    color: var(--secondary-color);
}

.sidebar .logo-area p {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar nav {
    margin-top: 2rem;
}

/* Notification badge inside sidebar nav links */
.sidebar .nav-link {
    position: relative;
}

.sidebar .nav-link .badge-dot {
    position: static;
    margin-left: auto;
    transform: none;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    background: var(--secondary-color);
    color: #111117;
    border: none;
}

.sidebar .nav-link i {
    color: inherit;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.65);
    padding: 0.75rem 1rem;
    margin-bottom: 0.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
}

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

.sidebar .nav-link.active {
    background: rgba(255,194,19,0.15);
    color: #ffc213;
    font-weight: 600;
}

/* Divider between nav groups */
.sidebar .nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.75rem 0;
}

/* Logout link style */
.sidebar .nav-link-logout {
    color: rgba(255,255,255,0.45);
}
.sidebar .nav-link-logout:hover {
    background: rgba(240,84,84,0.15);
    color: #f05454;
}

.sidebar-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    transition: padding 0.3s ease;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-footer .user-info i {
    font-size: 0.55rem;
    flex-shrink: 0;
}

/* Collapsed sidebar: center icon, hide text */
body.sidebar-collapsed .sidebar-footer {
    left: 0;
    right: 0;
    padding: 0.75rem 0;
    display: flex;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-footer .user-info {
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .sidebar-footer .user-info span {
    display: none;
}

.main-content {
    margin-left: 260px;
    padding: 2rem 3rem;
    padding-top: calc(64px + 2rem);
    min-height: 100vh;
    transition: margin-left 0.3s ease, filter 0.28s ease, opacity 0.28s ease;
}

/* allow smooth blur transition when panels open */
.sidebar,
.navbar-custom {
    transition: width 0.3s ease, transform 0.3s ease, filter 0.28s ease, opacity 0.28s ease;
}

/* Collapsed sidebar variant */
body.sidebar-collapsed .sidebar {
    width: 88px;
    padding: 2rem 0.75rem;
}

body.sidebar-collapsed .sidebar .logo-area img.sidebar-logo {
    width: 40px;
    margin: 0 auto;
}

body.sidebar-collapsed .sidebar .logo-area {
    text-align: center;
}

body.sidebar-collapsed .main-content {
    margin-left: 88px;
}

/* Tweak nav-link content when collapsed (hide text labels) */
body.sidebar-collapsed .nav-link > span,
body.sidebar-collapsed .nav-link .nav-text {
    display: none;
}


.navbar-custom {
    background: rgba(223, 243, 229, 0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    min-height: 64px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 12px;
    left: calc(260px + 12px);
    right: 12px;
    z-index: 1500;
    margin: 0;
    transition: left 0.3s ease;
}

body.sidebar-collapsed .navbar-custom {
    left: calc(88px + 12px);
}

@media (max-width: 1024px) {
    .navbar-custom { margin-bottom: 10px; }
}

.navbar-shell {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.navbar-block {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.info-block {
    flex: 1;
    justify-content: center;
}

/* Navbar search styling */
.navbar-search {
    width: min(640px, 48%);
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    background: var(--surface-alt);
    border: 1px solid rgba(0,0,0,0.04);
}

.navbar-search i { color: var(--muted-color); }

.navbar-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: inherit;
}

.navbar-search .kbd {
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--muted-color);
}

@media (max-width: 900px) {
    .navbar-search { width: 100%; }
}

.user-block {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* Ensure the navbar settings icon is visible and matches other icon pills */
#nav-parametres.icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-alt);
    color: #1f1f24;
    border: 2px solid #04802c;
    box-shadow: 0 8px 20px rgba(15,15,17,0.04);
}

@media (prefers-contrast: high) {
    #nav-parametres.icon-pill { box-shadow: none; border-color: rgba(0,0,0,0.08); }
}

.brand-copy .label,
.theme-pill .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-color);
    display: block;
}

.icon-pill {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #04802c;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(15, 15, 17, 0.10);
    color: #1f1f24;
}

.theme-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-alt);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    box-shadow: 0 10px 30px rgba(15, 15, 17, 0.08);
}


.nav-notification-btn {
    position: relative;
    background: var(--surface-alt);
}

.badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--secondary-color);
    color: #0f0f11;
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.nav-icon-btn {
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
}

.logout-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    background: #0f0f11;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(15, 15, 17, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 15, 17, 0.2);
}

@media (max-width: 992px) {
    .navbar-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .info-block {
        justify-content: flex-start;
    }

    .nav-notification-btn {
        order: -1;
    }
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--surface-alt);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
}

.user-dropdown .user-chip .avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0;
    border: none;
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
}

.user-dropdown .user-chip {
    cursor: pointer;
    background: transparent;
    border: 2px solid #04802c;
    box-shadow: 0 6px 18px rgba(15,15,17,0.06);
    padding: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.user-dropdown .user-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15,15,17,0.12);
}

.user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 280px;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(15,15,17,0.14);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 0.85rem;
    display: none;
    z-index: 1600;
}

.user-menu.open { display: block; }

.user-menu-header {
    padding: 0.35rem 0.35rem 0.75rem 0.35rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    margin-bottom: 0.6rem;
}

.user-menu-header strong { display:block; }
.user-menu-header small { color: var(--muted-color); display:block; }

.user-menu-list { list-style: none; margin: 0; padding: 0; }
.user-menu-list li { margin: 0.35rem 0; }
.user-menu-list a { display:flex; gap:0.75rem; align-items:center; color: #1f1f24; padding: 0.5rem; border-radius: 8px; text-decoration: none; }
.user-menu-list a i { width: 20px; text-align:center; color: var(--muted-color); }
.user-menu-list a:hover { background: var(--surface-alt); }

.user-menu-footer { display:flex; justify-content: flex-end; padding-top: 0.5rem; }

/* Small adjustments so the theme toggle sits compactly */
.theme-pill { padding: 0; background: transparent; }
.theme-pill .theme-toggle { min-width: 40px; height: 40px; padding: 0.4rem; }

/* Sidebar footer controls: compact, aligned and harmonised */
.sidebar-footer .sidebar-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.sidebar-footer .theme-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    padding: 0;
}

.sidebar-footer .theme-pill .label {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--muted-color);
    letter-spacing: 0.06em;
}

.sidebar-footer .theme-toggle {
    background: var(--surface-alt);
    color: #1f1f24;
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer .icon-pill.nav-notification-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    color: #1f1f24;
    box-shadow: 0 10px 30px rgba(15,15,17,0.06);
}

.sidebar-footer .badge-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    font-size: 0.68rem;
    border: 2px solid var(--surface-alt);
}

.sidebar-footer .user-chip {
    background: transparent;
    padding: 0.1rem 0.25rem;
    gap: 0.45rem;
    align-items: center;
}

/* Smaller avatar for compact sidebar footer */
#user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Improve contrast on theme toggle and notification icon */
.sidebar-footer .theme-toggle i,
.sidebar-footer .icon-pill.nav-notification-btn i {
    color: #1f1f24;
    opacity: 0.95;
}

.sidebar-footer .theme-toggle {
    color: var(--secondary-color);
    box-shadow: 0 8px 22px rgba(255,210,0,0.06);
}

/* make sure small viewports keep controls readable */
@media (max-width: 768px) {
    .sidebar-footer {
        left: 1rem;
        right: 1rem;
    }

    .sidebar-footer .sidebar-controls {
        gap: 0.4rem;
    }
}

.user-chip small {
    display: block;
    color: var(--muted-color);
}

.theme-toggle {
    border: none;
    background: #0f0f11;
    color: var(--secondary-color);
    border-radius: 30px;
    padding: 0.5rem 1rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    color: var(--muted-color);
    margin-bottom: 0.5rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--muted-color);
    max-width: 560px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    border-radius: 14px;
    border: none;
    padding: 0.6rem 1.35rem;
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-outline {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: #1f1f24;
}

.btn-outline:hover {
    background: var(--surface-alt);
    border-color: rgba(0,0,0,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* legacy helper: keep old class working but map to primary variables */
.btn-secondary-custom {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-secondary-custom:hover {
    background: var(--btn-primary-hover);
    box-shadow: 0 4px 12px rgba(255,210,0,0.25);
    transform: translateY(-1px);
}

.btn-primary-custom {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-color);
    border-radius: 8px;
}

.btn-primary-custom:hover {
    background: var(--btn-primary-hover);
    box-shadow: 0 4px 14px rgba(255, 194, 19, 0.3);
    transform: translateY(-1px);
}

.btn i {
    font-size: 0.85em;
}

.btn-icon {
    border: none;
    background: transparent;
    color: var(--muted-color);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 0.9rem;
    margin: 0 1px;
}

.btn-icon:hover {
    background: var(--surface-alt);
    color: var(--primary-color);
    transform: scale(1.08);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Ensure action icons in tables sit on the same line */
.table-modern tbody tr td:last-child { white-space: nowrap; vertical-align: middle; }
.table-modern tbody tr td:last-child .btn-icon { display: inline-flex; vertical-align: middle; margin: 0 6px; }

/* Smooth filter transitions for invoices table */
.table-modern tbody {
    transition: opacity 220ms ease, transform 220ms ease;
}
.table-modern tbody.is-hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

/* Ensure form fields inside invoice items are readable */
#invoice-items-table .form-control-custom {
    color: #12202b;
    background: #fff;
    padding: 8px 10px;
    border-radius: 10px;
    min-width: 56px;
}

#invoice-items-table .item-desc { min-width: 220px; }
#invoice-items-table .item-qty { width: 76px; }
#invoice-items-table .item-unit { width: 110px; }
#invoice-items-table .item-rate { width: 120px; }
#invoice-items-table .item-amount { width: 120px; text-align: right; }

/* Make select option text visible across browsers */
#invoice-items-table select.form-control-custom option { color: #12202b; }



/* Task dates shown under task title (read-only) */
.task-dates {
    display: flex;
    flex-wrap: nowrap; /* keep dates on one line */
    align-items: center;
    gap: 18px;
    padding-left: 0px; /* align with title after checkbox (set to 0) */
}
.task-dates > div { display: inline-flex; align-items: center; gap:8px; white-space:nowrap; color: var(--muted-color); }
.task-dates i.fas { width: 18px; text-align: center; color: var(--muted-color); }
.task-dates .task-start, .task-dates .task-due { color: var(--muted-color); }

/* Inline task adder form styling inside modal */
#project-task-adder .form-control-sm { height: 36px; }
#project-task-adder .btn { height:36px; }

/* Improved task adder appearance */
.task-adder-row .form-control-sm {
    border-radius: 8px;
    padding: 8px 10px;
    height:36px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
}
.task-adder-row .form-control-sm::placeholder { color: #9aa0a6; }
.task-adder-row { gap:10px; }
.task-adder-row input#project-task-title { flex: 1 1 auto; min-width:160px; }
.task-adder-row input#project-task-start { width:110px; }
.task-adder-row input#project-task-duration { width:80px; }

/* Buttons style to match screenshot: dark Add, light Cancel */
.btn-task-save {
    background: var(--btn-primary-bg); color: var(--btn-primary-color); border-radius:20px; padding:6px 12px; border:none; box-shadow:none;
}
.btn-task-save:hover { background: var(--btn-primary-hover); }
.btn-task-cancel {
    background: var(--btn-outline-bg); color: var(--text-color, #222); border-radius:8px; padding:6px 10px; border:1px solid rgba(0,0,0,0.06);
}
.btn-task-cancel:hover { background:#eef2f4; }

/* small calendar icon space for date input (visual only) */
.task-adder-row input#project-task-start { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239aa0a6"><path d="M7 10h5v5H7z"/><path d="M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM5 8v-1h14v1H5z"/></svg>');
    background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
    padding-right: 34px;
}

/* Actions row for task adder (buttons below) */
.task-adder-actions { width: 100%; gap: 8px; }
.task-adder-actions .btn { min-width: 80px; }

/* Tasks panel styles inside modal */
.tasks-panel-header h5 { font-size:1.1rem; }
.tasks-panel-search .form-control-sm { width:100%; }
.task-item { padding:14px 8px; border-bottom:1px solid rgba(0,0,0,0.04); }
.task-item .task-title { font-weight:600; margin-left:6px; }
.task-item .xsmall { font-size:0.8rem; color:var(--muted-color); }
.task-item .status-badge { margin-left:6px; padding:4px 8px; border-radius:8px; font-size:0.75rem; }
.task-item.task-done .task-title { text-decoration:line-through; color:var(--muted-color); }
.tasks-panel .small.text-primary { cursor:pointer; }

.metric-card,
.mini-stat,
.stat-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 20px rgba(15, 15, 17, 0.06);
    border: 1px solid var(--card-border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover,
.mini-stat:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(15, 15, 17, 0.10);
}

/* Unified stat card inner layout */
.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(4,128,44,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #04802c;
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-card .stat-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.stat-card .stat-label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-card .stat-value {
    margin: 0 0 0.25rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: #1f1f24;
    line-height: 1.2;
}
.stat-card .stat-sub {
    font-size: 0.78rem;
    color: var(--muted-color);
}

/* RH modal: two-column personal info layout */
.rh-modal-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 22px;
    align-items: start;
}
.rh-modal-left {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.rh-modal-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
}
.rh-modal-info { flex: 1; }
.rh-name { margin: 0 0 6px 0; font-size: 1.15rem; font-weight: 700; }
.rh-role { color: var(--muted-color); margin-bottom: 8px; }
.rh-modal-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px 18px;
    margin-top: 8px;
}
.rh-field strong { display: block; color: #6b6b72; font-weight: 600; margin-bottom: 6px; font-size: 0.88rem; }
.rh-field div { color: #333; font-size: 0.95rem; }
.rh-modal-address { margin-top: 12px; }
.rh-modal-tasks { margin-top: 12px; }
.rh-payment-section { background: var(--surface-color); border-radius: 12px; padding: 12px; border: 1px solid rgba(0,0,0,0.04); }

@media (max-width: 960px) {
    .rh-modal-grid { grid-template-columns: 1fr; }
    .rh-payment-section { order: 99; }
}

.mini-stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--secondary-color);
    color: #fff ;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #111117;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.metric-card h3,
.mini-stat h3 {
    margin: 0.35rem 0;
    font-size: 1.8rem;
}

/* Simple calendar styles */
.card { border: 1px solid var(--card-border-color) !important; }
.calendar-container .card { border-radius: 14px; }
.calendar-grid { display: block; }
.calendar-grid .weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap:8px; margin-bottom:8px; }
.calendar-grid .weekday { text-align:center; color:var(--muted-color); font-weight:700; }
.calendar-grid .days { display: grid; grid-template-columns: repeat(7,1fr); gap:10px; }
.calendar-grid .day { min-height:96px; background:var(--surface-color); border-radius:10px; padding:8px; border:1px solid rgba(0,0,0,0.03); cursor:pointer; position:relative; }
.calendar-grid .day.empty { background:transparent; border:none; cursor:default; }
.calendar-grid .day .day-number { position:absolute; top:8px; left:8px; font-weight:600; color:var(--muted-color); }
.calendar-grid .event-dot { display:block; margin-top:22px; padding:6px 8px; background:rgba(120,150,255,0.12); border-left:4px solid #6b8cff; border-radius:8px; font-size:0.88rem; color:#24325c; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }

/* Calendar icons: inherit color so they match surrounding context (sidebar, headers) */
.fa-calendar-alt, .fa-calendar, .fa-calendar-day, .fa-calendar-check {
    color: inherit !important;
}


/* Centered confirmation modal (replaces native confirm) */
.modal-shell.confirm-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: none;
}
.modal-shell.confirm-modal .modal-card {
    width: 400px;
    max-width: calc(100% - 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(4,128,44,0.08);
    transform: translateY(12px) scale(0.95);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: auto;
    overflow: hidden;
}
.modal-shell.confirm-modal .modal-header {
    background: #ecfef2; /* fond demandé */
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
}

/* Dernière règle : forcer l'en-tête du modal de confirmation en #ecfef2 */
.modal-shell.confirm-modal .modal-header {
    background: #ecfef2 !important;
    color: #000 !important;
}
.modal-shell.confirm-modal .modal-header .modal-title,
.modal-shell.confirm-modal .modal-header .btn-close,
.modal-shell.confirm-modal .modal-header * {
    color: #000 !important;
    fill: #000 !important;
    stroke: #000 !important;
}
.modal-shell.confirm-modal .modal-header .btn-close { filter: none !important; opacity: 0.95 !important; }
.modal-shell.confirm-modal .modal-header .modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000; /* titre en noir */
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-shell.confirm-modal .modal-header .btn-close {
    filter: none;
    color: #000;
    color: #000 !important;
    fill: #000 !important;
    stroke: #000 !important;
.modal-shell.confirm-modal .modal-header .btn-close:hover { opacity: 1; }
.modal-shell.confirm-modal .modal-header .btn-close { -webkit-filter: none !important; filter: none !important; opacity: 0.95 !important; }
    padding: 24px 24px 16px;
    text-align: center;
}
.modal-shell.confirm-modal .confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(4,128,44,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.4rem;
    color: #04802c;
}
.modal-shell.confirm-modal .confirm-icon.danger {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}
.modal-shell.confirm-modal .confirm-message {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}
.modal-shell.confirm-modal .modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    border-top: none;
}
.modal-shell.confirm-modal .modal-footer .btn {
    min-width: 120px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-cancel {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #555;
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-cancel:hover {
    background: #eaeaea;
    border-color: #ccc;
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-ok {
    background: #04802c;
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(4,128,44,0.3);
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-ok:hover {
    background: #036d25;
    box-shadow: 0 6px 16px rgba(4,128,44,0.4);
    transform: translateY(-1px);
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-ok.danger {
    background: #dc3545;
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-ok.danger:hover {
    background: #c82333;
    box-shadow: 0 6px 16px rgba(220,53,69,0.4);
}
.modal-shell.confirm-modal.open { pointer-events: auto; }
.modal-shell.confirm-modal.open .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* page blur overlay (shared) */
.page-blur-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,20,8,0.5);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 99990;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.page-blur-overlay.visible { opacity: 1; pointer-events: auto; }

/* Harmonise l'apparence de l'en-tête pour les modals RH */
#rh-edit-modal .modal-panel-header,
#rh-edit-modal .modal-header,
#rh-create-modal .modal-panel-header,
#rh-expense-modal .modal-panel-header,
#rh-payment-modal .modal-panel-header {
    background: #ecfef2; /* nouveau fond demandé */
    color: #0b3f2e; /* texte adapté pour contraste */
}

#rh-edit-modal .modal-panel-header .modal-close,
#rh-edit-modal .modal-header .btn-close,
#rh-create-modal .modal-panel-header .modal-close,
#rh-expense-modal .modal-panel-header .modal-close,
#rh-payment-modal .modal-panel-header .modal-close {
    color: #0b3f2e;
}

#rh-edit-modal .modal-header h3 {
    color: #000 !important;
}

/* Clients two-column visual separation and equal heights */
.clients-two-col { gap: 1.25rem; }
/* ensure the row behaves as a flex container regardless of other rules */
.row.clients-two-col { display: flex; flex-wrap: wrap; align-items: stretch; }
.row.clients-two-col > .col-6 { flex: 0 0 calc(50% - 0.625rem); max-width: calc(50% - 0.625rem); display: flex; }
.row.clients-two-col > .col-6 .card.dashboard-card { flex: 1 1 auto; display:flex; flex-direction:column; }
.row.clients-two-col > .col-6 .card.dashboard-card .card-body { flex: 1 1 auto; }

@media (min-width: 768px) {
    .clients-two-col .col-md-6:first-child { padding-right: 18px; }
    .clients-two-col .col-md-6:last-child { padding-left: 18px; border-left: 1px solid rgba(0,0,0,0.04); }
}

/* Force two columns side-by-side on most viewports; fallback to stacked on very small screens */
.clients-two-col .col-6 { flex: 0 0 50%; max-width: 50%; }
@media (max-width: 420px) {
    .clients-two-col .col-6 { flex: 0 0 100%; max-width: 100%; }
    .clients-two-col .col-6 + .col-6 { margin-top: 12px; }
    .clients-two-col .col-6 .card.dashboard-card { border-left: none; padding-left: 0; }
}

/* Activity list item spacing and divider */
.activity-list .activity-step { display:flex; justify-content:space-between; align-items:center; padding: 18px 6px; border-bottom: 1px solid rgba(0,0,0,0.04); }
.activity-list .activity-step p { margin:0; font-weight:500; }
.activity-list .activity-step small { display:block; color:var(--muted-color); margin-top:6px; font-weight:400; }

/* Slightly increase card padding for balanced whitespace */
.card.dashboard-card .card-body { padding: 1.25rem; }

/* Segmentation rows: increase vertical spacing and add subtle dividers */
.segment-row {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.segment-row .d-flex { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.segment-row:last-child { border-bottom: none; padding-bottom: 8px; }

/* Progress bar styling for clearer visual separation */
.progress-custom {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.04);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

/* Top destinations: add inner padding for each item to create spacing */
.top-destination-item {
    padding: 10px 12px;
    border-radius: 8px;
}
/* Top Users card: inner padding and item spacing */
.top-users-card .card-body {
    padding: 16px;
}
.top-users-card .top-user-item {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface-alt);
}
.progress-custom .progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--secondary-color), #e6be00);
    box-shadow: none;
}

@media (max-width: 767px) {
    .segment-row { padding: 10px 0; }
}

.metric-card small {
    color: var(--muted-color);
}

.mini-stat small {
    color: #fff;
}
.mini-stat p.label {
    color: #fff;
}

/* Top-right panel (replacement for centered modal) */
.top-right-panel {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 640px;
    max-width: calc(100% - 2.5rem);
    max-height: calc(100vh - 2.5rem);
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15,15,17,0.18);
    border: 1px solid rgba(0,0,0,0.06);
    z-index: 1200;
    overflow: auto;
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    transition: transform 220ms ease, opacity 220ms ease;
}

.top-right-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Centered variant: place panel at the center of the viewport */
.top-right-panel.centered {
    left: 50%;
    top: 50%;
    right: auto;
    transform: translate(-50%,-52%) scale(0.98);
}
.top-right-panel.centered.open {
    transform: translate(-50%,-50%) scale(1);
    opacity: 1;
}

/* Keep internal modal content styles compatible */
.top-right-panel .modal-header,
.top-right-panel .modal-body,
.top-right-panel .modal-footer {
    padding: 1rem 1.25rem;
}

/* Fullscreen blur overlay behind the panel */
.page-blur-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.30);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 1100;
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

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

/* Small screens: make panel full-width and anchored at top */
@media (max-width: 576px) {
    .top-right-panel {
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        top: 0.75rem;
        max-height: calc(100vh - 1.5rem);
    }
}

.mini-stat .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-color);
}

.mini-stat-header {
    margin-bottom: 1.25rem;
}

.mini-stat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--surface-alt);
    font-size: 0.8rem;
    color: #1f1f24;
}

.stats-grid {
    display: grid;
    /* Four statistic cards per row on most viewports (default)
       Dashboard overrides to two columns via .dashboard-page */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background-color: transparent;
}

@media (max-width: 576px) {
    .stats-grid {
        /* Stack to a single column on very small screens */
        grid-template-columns: 1fr;
    }
}

/* Dashboard-specific override: two stat cards per row */
.dashboard-page .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Specific modal submit button: dark green background for 'Créer la compagnie' */
#company-modal-submit {
    background: #0b5d2b !important; /* dark green */
    border-color: #0b5d2b !important;
    color: #ffffff !important;
}
#company-modal-submit:hover {
    background: #094c23 !important;
    border-color: #094c23 !important;
}

/* Notifications page layout tweaks */
.notifications-layout { align-items: flex-start; }
.notifications-layout .col-xl-7, .notifications-layout .col-xl-5 {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.notifications-layout .col-xl-7 > .card.dashboard-card {
    /* let main feed expand to fill available vertical space */
    flex: 1 1 auto;
}
.notifications-layout .col-xl-5 > .card.dashboard-card {
    /* keep right column cards compact and stacked at top */
    flex: 0 0 auto;
}
.notification-feed { display:flex; flex-direction:column; gap:12px; }
.notification-feed .notification-item { padding: 14px; border-radius: 12px; }



/* Variante pour forcer 4 blocs sur une seule ligne */
.stats-grid--single-row {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    flex-wrap: nowrap;
    background-color: transparent;
}

/* Ensure children share available space but keep a readable minimum width */
.stats-grid--single-row > .mini-stat {
    flex: 1 1 0;
    min-width: 200px;
    background-color: transparent;
}

@media (max-width: 1200px) {
    .stats-grid--single-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    .stats-grid--single-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.stats-vertical {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .stats-vertical {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .stats-vertical {
        grid-template-columns: 1fr;
    }
}

.stats-vertical .stat-card {
    width: 100%;
}

.dashboard-card {
    background: var(--surface-color);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(15, 15, 17, 0.08);
    border: 1px solid var(--card-border-color);
    margin-bottom: 2rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 70px rgba(15, 15, 17, 0.12);
}

section.card.dashboard-card + section.card.dashboard-card,
section.row + section.card.dashboard-card,
section.card.dashboard-card + section.row {
    margin-top: 0.5rem;
}

section.row.g-4 {
    margin-bottom: 0.5rem;
}

.stacked-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.stacked-card .card-body {
    flex: 1;
}

.dashboard-card .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-card .card-header.flex-column {
    align-items: stretch;
}

/* Bloc filtres dans les card-headers */
.filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-card .card-header h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.15rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.dashboard-card .card-header h5 i {
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.dashboard-card .card-header span {
    font-size: 0.82rem;
    color: var(--muted-color);
    font-weight: 400;
}

.dashboard-card .card-body {
    padding: 1.75rem;
}

/* Projects grid and cards (three-up card layout) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.project-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: 0 18px 40px rgba(15,15,17,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(15,15,17,0.08); }

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.project-ref { color: var(--muted-color); font-size: 0.82rem; }
.status-col { text-align: right; }

.project-card-body { flex: 1 1 auto; }
.project-title { font-size: 1.25rem; margin: 0 0 0.45rem 0; font-weight: 700; color: #111117; }
.project-description { color: var(--muted-color); font-size: 0.95rem; margin-bottom: 0.85rem; }
.project-meta { display: flex; gap: 1.1rem; align-items: center; color: var(--muted-color); font-size: 0.92rem; }
.project-meta .project-client { color: #2b6cb0; font-weight: 600; }

.project-card-footer { display:flex; align-items:center; justify-content:space-between; gap: 0.75rem; margin-top: 1rem; }
.action-group { display:flex; gap:0.6rem; }

/* Progress bar inside card */
.project-progress { margin-top: 0.6rem; display:flex; align-items:center; gap:0.75rem; }
.project-progress .progress-label { color: var(--muted-color); font-size: 0.9rem; }
.project-progress .progress-track { flex:1; height:10px; background: rgba(0,0,0,0.06); border-radius:999px; overflow:hidden; }
.project-progress .progress-fill { height:100%; background: linear-gradient(90deg, #2b8aef, #6bc1ff); border-radius:inherit; }
.project-progress .progress-value { min-width:40px; text-align:right; font-weight:700; color:#111117; }

/* Avatars stack */
.avatar-stack { display:flex; align-items:center; gap:0; }
.avatar-stack .avatar { width:36px; height:36px; border-radius:50%; border:2px solid #fff; box-shadow:0 6px 18px rgba(15,15,17,0.08); margin-left:-10px; background-size:cover; background-position:center; }
.avatar-stack .avatar:first-child { margin-left:0; }
.avatar-stack .more { width:36px; height:36px; border-radius:50%; background: #eef3ff; display:flex; align-items:center; justify-content:center; color:#2b6cb0; font-weight:700; margin-left:-10px; border:2px solid #fff; }

/* Responsive: collapse to 2/1 columns */
@media (max-width: 1100px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .project-grid { grid-template-columns: 1fr; }
}

.chip,
.chip-outline {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.85rem;
    background: transparent;
    color: var(--muted-color);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.chip.active,
.chip:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #111117;
    box-shadow: 0 2px 8px rgba(255,210,0,0.2);
}

.chip-outline {
    border-color: currentColor;
}

/* Utility classes for inline style extraction */
.filter-select-md {
    max-width: 180px;
    border-radius: 14px;
}

.filter-select-sm {
    max-width: 160px;
    border-radius: 14px;
}

.progress-mini {
    width: 60px;
}

.btn-icon.btn-danger { color: var(--danger); }
.btn-icon.btn-danger:hover { background: rgba(240,84,84,0.10); }

.chip-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.filters .chip-group,
.card-header .chip-group {
    margin-bottom: 0;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 14px;
    background: #fff;
    min-width: 220px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-field:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(255,210,0,0.12);
}

.search-field input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.88rem;
    color: var(--text-color, #1f1f24);
    width: 100%;
}

.search-field input::placeholder {
    color: var(--muted-color);
}

.search-field i {
    color: var(--muted-color);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-field.large {
    min-width: 320px;
}

/* Masquer le champ de recherche quand il se trouve dans la navbar */
.navbar-custom .search-field,
.navbar-shell .search-field {
    display: none !important;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Company / generic custom table */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-color);
    padding: 0.85rem 1.25rem;
    border-bottom: 2px solid rgba(0,0,0,0.06);
    text-align: left;
    white-space: nowrap;
    background: var(--surface-alt, #f8f9fa);
}

.table-custom tbody tr {
    transition: background 0.12s;
}

.table-custom tbody tr:hover {
    background: rgba(4, 128, 44, 0.04);
}

.table-custom tbody td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table-modern .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 1px;
    padding: 0.18rem 0.36rem;
    border-radius: 7px;
    font-size: 0.72rem;
    border: 1px solid rgba(0,0,0,0.08);
    background: var(--surface-alt, #f5f5f5);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.12s;
}
.table-modern .btn-icon:hover {
    background: #04802c;
    color: #fff;
    border-color: #04802c;
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

.table-custom tbody td .btn {
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid rgba(0,0,0,0.08);
    background: var(--surface-alt, #f5f5f5);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.12s;
}

.table-custom tbody td .btn:hover {
    background: #04802c;
    color: #fff;
    border-color: #04802c;
}

/* Table logo cell */
.table-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(4,128,44,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0.9rem;
    color: #04802c;
}
.table-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge status */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-active {
    background: rgba(4, 128, 44, 0.1);
    color: #04802c;
}

.badge-inactive {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Transactions: reduce status pill corner radius to 8px */
#card-transactions .badge-status {
    border-radius: 8px !important;
}

/* Export button */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 8px !important;
    border: 1px solid #04802c;
    background: #dcefe2;
    color: #04802c;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-export:hover {
    background: #04802c;
    color: #fff;
}

/* Also apply same visual style to other export buttons that use different classes */
button[id^="export"],
.btn.btn-outline[id^="export"] {
    background: #dcefe2 !important;
    border: 1px solid #04802c !important;
    color: #04802c !important;
    border-radius: 8px !important;
}

button[id^="export"]:hover,
.btn.btn-outline[id^="export"]:hover {
    background: #04802c !important;
    color: #fff !important;
}

/* Global style for 'Supprimer' (delete) buttons across the app */
button[class*="delete"],
[class*="delete"].btn,
button[id*="delete"],
button[title*="Supprimer"],
button[id*="remove"],
button[title*="Remove"] {
    background: #fcedee !important;
    border: 1px solid #fde0e2 !important;
    color: #1f1f24 !important;
}

/* Ensure small/delete variants also use the same radius */
button[class*="delete"],
button[id*="delete"],
button[id*="remove"] {
    border-radius: 8px !important;
}

/* Make the trash icons inside delete buttons red */
button[class*="delete"] i,
[class*="delete"] i,
button[id*="delete"] i,
button[title*="Supprimer"] i,
button[id*="remove"] i,
.btn-danger i.fas.fa-trash,
.btn-icon i.fas.fa-trash {
    color: #dc3545 !important;
}

/* Hover/active subtle variants for delete buttons */
button[class*="delete"]:hover,
button[id*="delete"]:hover,
button[title*="Supprimer"]:hover,
button[id*="remove"]:hover {
    background: #fde8ea !important;
}

/* Specific override for RH delete modal (higher specificity) */
#rh-delete-modal .btn-danger,
#rh-delete-confirm,
.modal-shell #rh-delete-confirm {
    background: #fcedee !important;
    border: 1px solid #fde0e2 !important;
    color: #1f1f24 !important;
    border-radius: 8px !important;
}

#rh-delete-modal .btn-danger i,
#rh-delete-confirm i {
    color: #dc3545 !important;
}

#rh-delete-modal .btn-danger:hover,
#rh-delete-confirm:hover {
    background: #fde8ea !important;
}

/* Specific styling for delete buttons inside the RH staff list */
#rh-staff-card .btn-danger,
#rh-staff-card .btn-icon.btn-danger,
#rh-staff-body .btn-danger,
#rh-staff-body .btn-icon.btn-danger {
    background: #fcedee !important;
    border: 1px solid #fde0e2 !important;
    color: #1f1f24 !important;
    border-radius: 8px !important;
}

#rh-staff-card .btn-danger i.fas.fa-trash,
#rh-staff-body .btn-danger i.fas.fa-trash,
#rh-staff-card .btn-icon i.fas.fa-trash,
#rh-staff-body .btn-icon i.fas.fa-trash {
    color: #dc3545 !important;
}

#rh-staff-card .btn-danger:hover,
#rh-staff-body .btn-danger:hover,
#rh-staff-card .btn-icon.btn-danger:hover,
#rh-staff-body .btn-icon.btn-danger:hover {
    background: #fde8ea !important;
}

/* Card section container */
.card-custom {
    background: var(--surface-color, #fff);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* Card section header */
.card-header-custom {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8faf9 0%, #eef7f1 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.card-header-custom h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.card-header-custom h3 i {
    color: #04802c;
}

/* Search box inside headers */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--muted-color);
    font-size: 0.85rem;
}

.search-box input {
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--surface-color, #fff);
    min-width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Forcer le fond jaune sur les boutons listés par l'utilisateur */

#quick-add-company,
#new-company-btn,
#new-client-btn,
#quick-new-message,
#new-message-btn,
#new-employee-btn,
#add-admin-btn,
#quick-open-reports {
    background: #ffc213 !important;
    color: #1f1f24 !important;
    border: none !important;
    border-radius: 8px !important;
}

#quick-add-company:hover,
#new-company-btn:hover,
#new-client-btn:hover,
#quick-new-message:hover,
#new-message-btn:hover,
#new-employee-btn:hover,
#add-admin-btn:hover,
#quick-open-reports:hover {
    background: #e6ae00 !important;
}

/* Mettre le background en noir pour Diffuser une information, Dépense, Paiement */
#broadcast-info-btn,
#new-expense-btn,
#new-payment-btn {
    background: #0f0f11 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

/* Hover / focus: slightly lighter */
#broadcast-info-btn:hover,
#new-expense-btn:hover,
#new-payment-btn:hover,
#broadcast-info-btn:focus,
#new-expense-btn:focus,
#new-payment-btn:focus,
#broadcast-info-btn:focus-visible,
#new-expense-btn:focus-visible,
#new-payment-btn:focus-visible {
    background: #1a1a1c !important;
    outline: none !important;
}

/* Active / pressed: a bit lighter still */
#broadcast-info-btn:active,
#new-expense-btn:active,
#new-payment-btn:active {
    background: #242426 !important;
}

/* Ensure small/sm variants also pick up the yellow when present */
.btn-sm#quick-add-company,
.btn-sm#new-client-btn,
.btn-sm#quick-new-message,
.btn-sm#new-employee-btn,
.btn-sm#add-admin-btn,
.btn-sm#quick-open-reports {
    padding: 0.35rem 0.7rem;
}

.search-box input:focus {
    outline: none;
    border-color: #04802c;
    box-shadow: 0 0 0 3px rgba(4, 128, 44, 0.1);
}

/* Filter select dropdowns */
.filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--surface-color, #fff);
    color: var(--text-color, #333);
    min-width: 160px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}
.filter-select:focus {
    outline: none;
    border-color: #04802c;
    box-shadow: 0 0 0 3px rgba(4, 128, 44, 0.1);
}

/* Reset filters button */
.btn-filter-reset {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--surface-color, #fff);
    color: var(--muted-color, #888);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-filter-reset:hover {
    background: #04802c;
    color: #fff;
    border-color: #04802c;
}

/* Company detail modal — modern profile card */
.detail-cover {
    background: linear-gradient(135deg, #04802c 0%, #022d10 100%);
    padding: 32px 24px 28px;
    text-align: center;
    position: relative;
}
.detail-cover-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.detail-cover-close:hover { background: rgba(255,255,255,0.3); }
.detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 14px;
    border: 3px solid rgba(255,255,255,0.3);
    overflow: hidden;
}
.detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-cover-name {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}
.detail-cover-sub {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}
.detail-cover .badge-status {
    font-size: 0.75rem;
}

/* Stats bar */
.detail-stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 18px 24px;
    background: var(--surface-color, #fff);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.detail-stat {
    text-align: center;
}
.detail-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #04802c;
}
.detail-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-color, #888);
    margin-top: 2px;
}

/* Detail body & sections */
.detail-body {
    max-height: 55vh;
    overflow-y: auto;
    background: var(--surface-color, #fff);
}
.detail-section {
    padding: 16px 24px 8px;
}
.detail-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #04802c;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(4,128,44,0.12);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* Icon styles for detail modals: muted / discreet appearance */
.detail-body .info-label i,
.detail-body .info-grid .info-label i,
.rh-content .info-label i {
    color: var(--muted-color, #9aa0a6);
    opacity: 0.85;
    font-size: 14px;
    width: 18px;
    text-align: center;
    margin-right: 8px;
}

.detail-body .info-value a {
    color: inherit;
    text-decoration: none;
}

/* Spacing for detail content block inside modals */
.detail-body .detail-body-content {
    margin: 12px 0 16px;
    padding: 12px 16px;
    border-radius: 6px;
    background: transparent;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
    font-size: 0.85rem;
    color: var(--muted-color, #888);
    font-weight: 500;
}
.detail-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color, #1f1f24);
    text-align: right;
}

.table-modern thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--muted-color);
    padding-bottom: 0.75rem;
}

.table-modern tbody tr {
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.table-modern tbody td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table-sub {
    color: var(--muted-color);
    font-size: 0.85rem;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.8rem;
    font-weight: 600;
    color: inherit;
}

.status-badge {
    border-radius: 8px;
    padding: 0.2rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-success { background: rgba(88, 198, 144, 0.15); color: var(--success); }
.status-warning { background: rgba(246, 166, 9, 0.15); color: var(--warning); }
.status-danger { background: rgba(240, 84, 84, 0.15); color: var(--danger); }
.status-info { background: rgba(255,210,0,0.12); color: var(--secondary-color); }
.status-secondary { background: rgba(31, 31, 36, 0.1); color: #1f1f24; }

.progress-custom {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
}

.progress-custom .progress-bar {
    background: linear-gradient(90deg, var(--secondary-color), #e6b200);
    border-radius: inherit;
}

/* Historique des paiements */
.payment-summary-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.85rem 1.25rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.payment-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.payment-stat strong {
    color: var(--text-color);
}

.payment-stat i {
    font-size: 0.95rem;
}

.drawer {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 17, 0.80);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-end;
    z-index: 2000;
}
.drawer.open {
    opacity: 1;
    pointer-events: auto;
}
.drawer-content {
    width: min(420px, 100%);
    background: var(--surface-color);
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-shell {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 7, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 2100;
}

.modal-shell.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-panel {
    width: min(900px, 96%);
    max-height: 90vh;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 35px 90px rgba(5, 5, 7, 0.25);
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Right side panel variant (slides in from right and blurs page) */
.modal-shell.side-right {
    align-items: stretch;
    justify-content: flex-end;
    background: rgba(5,5,7,0.60);
}

.modal-shell.side-right .modal-panel {
    width: min(640px, 92%);
    height: 100vh;
    border-radius: 8px 0 0 8px;
    margin: 0;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(.2,.9,.2,1);
    box-shadow: -30px 0 80px rgba(5,5,7,0.35);
    display: flex;
    flex-direction: column;
}

.modal-shell.side-right.open .modal-panel {
    transform: translateX(0);
}

/* Modal panel header & body */
.modal-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: #ecfef2;
    flex-shrink: 0;
}

.modal-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #073115;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-alt, #f5f5f5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.1);
}

.modal-panel-body {
    padding: 1.5rem 2rem 5.5rem 2rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    display: block;
}

/* ------------------------------------------------------------------
   Modal-specific button rules
   - Primary actions inside modals (Enregistrer/Créer/Confirmer) => dark green background + white text
   - Cancel/ghost/outline inside modals => light grey background + dark text
   These rules are intentionally specific to modal containers to avoid
   changing non-modal buttons elsewhere.
   ------------------------------------------------------------------ */
.modal-shell .btn-primary,
.modal-panel .btn-primary,
.modal-form-actions .btn-primary,
    /* Modal-specific: primary actions are dark green with white text; cancel actions are grey */
    .modal-shell .btn-primary,
    .modal-panel .btn-primary,
    .modal-form-actions .btn-primary,
    .modal-panel-footer .btn-primary,
    .modal-shell .modal-footer .btn-primary {
        background: #07461c !important;
        color: #ffffff !important;
        border-color: #07461c !important;
    }

    .modal-shell .btn-primary:hover,
    .modal-panel .btn-primary:hover,
    .modal-form-actions .btn-primary:hover {
        background: #095e25 !important;
    }

    .modal-shell .btn-ghost,
    .modal-shell .btn-outline,
    .modal-panel .btn-ghost,
    .modal-panel .btn-outline,
    .modal-form-actions .btn-ghost,
    .modal-panel-footer .btn-ghost {
        background: #eceff1 !important;
        border: 1px solid rgba(0,0,0,0.06) !important;
        color: #222 !important;
    }

    .modal-shell .btn-ghost:hover,
    .modal-shell .btn-outline:hover {
        background: #e6eaed !important;
    }

.modal-shell.confirm-modal .modal-footer .btn-confirm-ok:hover {
    background: #095e25 !important;
}
.modal-shell.confirm-modal .modal-footer .btn-confirm-cancel {
    background: #f4f6f8 !important;
    color: #222 !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
}

/* Form layout inside modals */
.form-section-title {
    font-weight: 600;
    font-size: 0.92rem;
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
}

.form-hint {
    font-size: 0.82rem;
    color: var(--muted-color);
    margin: -0.5rem 0 1rem 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 580px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

/* User detail modal styling */
.user-detail-list {
    margin: 0;
}
.user-detail-list dt {
    float: left;
    clear: left;
    width: 110px;
    color: #374151;
    font-weight: 600;
}
.user-detail-list dd {
    margin: 0 0 8px 120px;
    color: #111827;
}
.ticket-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.ticket-history-table th,
.ticket-history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}
.ticket-history-table th { color: #6b7280; font-weight:600; font-size:0.9rem; }
.ticket-history-empty { color: #6b7280; padding: 8px 0; }

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}

.form-group label .required {
    color: #e53e3e;
}

/* Automatically styled asterisk for required fields when inserted by JS */
.form-group label .required-auto {
    color: #e53e3e;
    margin-left: 0.25rem;
    font-weight: 600;
}

/* Field error message shown under inputs */
.field-error {
    color: #d9534f;
    font-size: 0.82rem;
    margin-top: 0.35rem;
}

/* Invalid input outline */
.input-invalid {
    border-color: #d9534f !important;
    box-shadow: 0 0 0 3px rgba(217,83,79,0.06) !important;
}

.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-control-custom {
    padding-right: 2.75rem;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-color);
    padding: 4px;
}

.modal-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: var(--surface-color, #fff);
    flex-shrink: 0;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin-top: 0;
    z-index: 2;
}

.modal-form-actions .btn-primary {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-color) !important;
}

.modal-form-actions .btn-primary:hover {
    background: var(--btn-primary-hover) !important;
    color: var(--btn-primary-color) !important;
}

/* Modal-specific danger (Supprimer) button: harmonise with primary modal buttons */
.modal-shell .btn-danger,
.modal-panel .btn-danger,
.modal-form-actions .btn-danger,
.modal-shell .btn-icon.btn-danger {
    background: var(--btn-danger-bg, #dc3545) !important;
    color: #ffffff !important;
    border: none !important;
}
.modal-shell .btn-danger:hover,
.modal-panel .btn-danger:hover,
.modal-form-actions .btn-danger:hover,
.modal-shell .btn-icon.btn-danger:hover {
    background: var(--btn-danger-hover, #c82333) !important;
}

/* Ensure small icon-only danger buttons in modals have visible background and padding */
.modal-shell .btn-icon.btn-danger {
    padding: 8px 10px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Make the icon inside the company delete confirmation button white only */
#company-delete-confirm i {
    color: #ffffff !important;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    transition: background 0.15s;
}

.btn-ghost:hover {
    background: rgba(0,0,0,0.04);
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--surface-alt, #f5f5f5);
    border-radius: 8px;
    padding: 3px;
}

.view-toggle-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.view-toggle-btn.active {
    background: #04802c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(4, 128, 44, 0.25);
}

.view-toggle-btn:not(.active):hover {
    background: rgba(0,0,0,0.06);
}

/* Company cards grid */
.company-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem;
}

.company-card {
     background: linear-gradient(180deg, rgba(225, 251, 235, 0.9), rgba(245,255,246,0.94));
    border: none;
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0px 4px 4px #e9f6ed;
}

.company-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.company-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.company-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-alt, #f0f0f0);
    display: flex;
    border: solid 1px #036d25;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--muted-color);
    font-size: 1.2rem;
}

.company-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-card-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.company-card-meta {
    font-size: 0.82rem;
    color: var(--muted-color);
    margin: 0 0 0.75rem 0;
}

.company-card-info {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--muted-color);
    margin-bottom: 0.75rem;
}

.company-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #dceee2;
    font-size: 0.78rem;
    color: var(--muted-color);
}

.company-card-footer .btn {
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--surface-alt, #f0f0f0);
    color: var(--text-color, #1f1f24);
    cursor: pointer;
    transition: all 0.15s;
}

.company-card-footer .btn:hover {
    background: #04802c;
    color: #fff;
    border-color: #04802c;
}

/* Logo upload area */
.logo-upload-area {
    cursor: pointer;
}

.logo-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed rgba(0,0,0,0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--muted-color);
    font-size: 0.85rem;
    transition: border-color 0.15s, background 0.15s;
}

.logo-preview:hover {
    border-color: #04802c;
    background: rgba(4, 128, 44, 0.04);
}

.logo-preview i {
    font-size: 1.5rem;
}

.logo-preview.has-image {
    border-style: solid;
    border-color: #04802c;
    padding: 8px;
}

.logo-preview.has-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Input with icon prefix */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #25d366;
    font-size: 1.1rem;
}

.input-icon-wrap .has-icon {
    padding-left: 2.5rem;
}

/* Checkbox pill group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s;
    -webkit-user-select: none;
    user-select: none;
}

.checkbox-pill input {
    display: none;
}

.checkbox-pill:hover {
    border-color: #04802c;
    background: rgba(4, 128, 44, 0.04);
}

.checkbox-pill:has(input:checked) {
    background: #04802c;
    border-color: #04802c;
    color: #fff;
}

/* When a panel is open, softly blur the main content (left side) behind it */
body.panel-open .main-content,
body.panel-open .sidebar,
body.panel-open .navbar-custom {
    filter: blur(3px) saturate(0.98);
    pointer-events: none;
}

/* Ensure panels remain sharp (not blurred) when body has panel-open */
body.panel-open .panel-side-right,
body.panel-open .panel-side-right *,
body.panel-open .modal-shell.side-right,
body.panel-open .modal-shell.side-right .modal-panel,
body.panel-open .panel-top-right,
body.panel-open .panel-top-right *,
body.panel-open .top-right-panel,
body.panel-open .top-right-panel * {
    -webkit-filter: none !important;
    filter: none !important;
    pointer-events: auto !important;
}
body.panel-open .panel-overlay,
body.panel-open .panel-side-right,
body.panel-open .panel-side-right * {
    filter: none !important;
    pointer-events: auto !important;
}

/* Ensure the overlay and the side panel remain interactive even when
   their ancestor (.main-content) is set to pointer-events: none. This
   allows the panel UI to receive clicks while the rest of the page is
   blocked. */
body.panel-open .main-content .panel-overlay,
body.panel-open .main-content .panel-side-right {
    pointer-events: auto;
}

/* When a panel is open we block clicks on the rest of the page; do not
   whitelist interactive controls here so the overlay fully intercepts clicks. */

/* Allow the panel itself to remain interactive */
body.panel-open .modal-shell.side-right,
body.panel-open .modal-shell.side-right .modal-panel {
    pointer-events: auto;
}

/* Compact top-right panel (specific to factures page) */
.panel-top-right {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: min(900px, 92%);
    max-height: calc(100vh - 2.5rem);
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(5,5,7,0.18);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: auto;
    transform: translateY(-10px) scale(.995);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 2200;
}

.panel-top-right.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Top-right compact panels should also keep footer visible */
.panel-top-right {
    display: flex;
    flex-direction: column;
}
.panel-top-right .modal-body {
    flex: 1 1 auto;
    overflow: auto;
}
.panel-top-right .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface-color);
    z-index: 5;
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* Scoped blur when only factures panel is open */
body.panel-open-ticket .main-content,
body.panel-open-ticket .sidebar,
body.panel-open-ticket .navbar-custom {
    filter: blur(3px) saturate(0.98);
    pointer-events: none;
}

body.panel-open-ticket .panel-top-right {
    pointer-events: auto;
}

/* Ensure factures panel stays sharp */
body.panel-open-ticket .panel-top-right,
body.panel-open-ticket .panel-top-right *,
body.panel-open-ticket .top-right-panel,
body.panel-open-ticket .top-right-panel * {
    -webkit-filter: none !important;
    filter: none !important;
    pointer-events: auto !important;
}

.modal-header {
    padding: 1.5rem 1.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Dark modal headers (match panel headers) */
.modal-header,
.top-right-panel .modal-header {
    background: #0f0f11;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 14px 18px;
}

.modal-header h5,
.top-right-panel .modal-header h5 {
    color: #fff;
    margin: 0;
}

.modal-header .btn-close,
.top-right-panel .modal-header .btn-close {
    color: #fff;
    background: transparent;
    border: none;
    padding: 8px;
}

.modal-body {
    padding: 0 1.75rem 1.25rem;
    color: var(--muted-color);
}

.modal-shell.side-right .modal-panel .modal-body {
    flex: 1 1 auto;
    overflow: auto;
}

.modal-body .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.modal-body .detail-row:last-child {
    border-bottom: none;
}

.modal-footer {
    padding: 1.25rem 1.75rem 1.75rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-footer .btn {
    border-radius: 14px;
}

/* Keep modal footer visible at bottom of tall side panels */
.modal-shell.side-right .modal-panel .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface-color);
    z-index: 5;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.kanban {
    display: grid;
    /* Force a single column layout (one column, blocks stacked line-by-line) */
    grid-template-columns: 1fr;
    gap: 1rem;
}

.kanban-column {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Roadmap list view/grid styles */
#roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#roadmap-list.view-grid {
    display: grid;
    gap: 0.75rem;
    /* Responsive: 1 column on mobile, 2 on tablets, 3 on desktop */
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    #roadmap-list.view-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    #roadmap-list.view-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.roadmap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface-alt);
    border-radius: 12px;
}
.roadmap-left .roadmap-title { font-weight:700; }
.roadmap-sub { color:var(--muted-color); font-size:0.9rem }
.roadmap-right { display:flex; align-items:center; gap:0.5rem }

/* Project card styles to match design */
.project-card {
    background: var(--surface-alt);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 6px 18px rgba(15,15,17,0.04);
    position: relative;
}
/* ------------------------------------------------------------------
   Harmonisation globale : forcer le border-radius des blocs à 8px
   This section sets a single variable and applies it to common
   block-like components (cards, panels, buttons, inputs, etc.).
   Avoids touching perfectly-round elements (50% / 999px) which
   intentionally remain circular/pill-shaped.
   ------------------------------------------------------------------ */
:root {
    --global-border-radius: 8px;
}

/* Apply the unified radius to common block components */
.dashboard-card,
.card,
.card-custom,
.metric-card,
.stat-card,
.project-card,
.company-card,
.ticket-modal-panel,
.modal-panel,
.modal-shell .modal-card,
.top-right-panel,
.user-menu,
.navbar-custom,
.navbar-search,
.search-field,
.filter-select,
.btn,
.btn-icon,
.card-header-custom,
.company-card-logo,
.logo-preview,
.logo-preview.has-image img,
.kanban-column,
.notification-feed .notification-item,
.notification-item,
.stat-card .stat-icon,
.table-modern .btn-icon,
.badge-status,
.badge-pill,
.badge-dot,
.progress-custom,
.task-adder-row .form-control-sm,
.modal-shell.confirm-modal .modal-card {
    border-radius: var(--global-border-radius) !important;
}

/* Keep clearly circular elements intact by excluding 50% / pill shapes. */
.avatar-stack .avatar,
.ticket-modal-avatar,
.detail-avatar,
.user-dropdown .user-chip,
.icon-pill,
.badge-dot,
.badge-pill[style*="999px"] 

.project-card .project-title { margin: 0; font-size: 1.1rem }
.project-card .project-meta { display:flex; justify-content:flex-start; gap:1.25rem; color:var(--muted-color); }
.project-card .progress-custom { background: rgba(0,0,0,0.04); height:8px; border-radius:8px; overflow:hidden }
.project-card .progress-bar { height:8px; background:var(--primary-color); border-radius:8px }
.avatar-stack { display:flex; align-items:center }
.avatar { width:34px; height:34px; border-radius:50%; background-size:cover; background-position:center; margin-right:-8px; border:2px solid white }
.avatar + .avatar { margin-left: -10px }
.avatar-stack .more { width:34px; height:34px; border-radius:50%; background:#e9f0ff; display:flex; align-items:center; justify-content:center; font-weight:600; margin-left:6px }
.task-count { color:var(--muted-color); font-weight:600 }

/* action button top-right */
.project-action {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(15,15,17,0.12);
    cursor: pointer;
}
.project-action i { transform: translateX(1px); }

/* progress bar color per status */
.progress-bar.status-success { background: #28c76f; }
.progress-bar.status-warning { background: #ffb020; }
.progress-bar.status-danger { background: #ff6b6b; }

/* Space between status badge and client info */
.project-card .project-status { display:block; margin-bottom:0.75rem; }

.project-card .client-budget { display:block; }

/* Modal styles for project detail */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity:0; visibility:hidden; transition:opacity .18s ease, visibility .18s ease; z-index:900; }
.modal-overlay.active { opacity:1; visibility:visible; }
.modal-center { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%) scale(.98); opacity:0; visibility:hidden; transition:all .18s ease; z-index:1000; }
.modal-center.open { opacity:1; visibility:visible; transform:translate(-50%,-50%) scale(1); }
.modal-card { background:white; border-radius:10px; width:min(660px, 96%); max-width:660px; box-shadow:0 24px 60px rgba(15,15,17,0.12); overflow:hidden; border: none; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom: none; }
.modal-body { padding:18px 20px; max-height:60vh; overflow:auto; }
.modal-footer { padding:12px 20px; border-top: none; display:flex; justify-content:flex-end; gap:8px; }
.modal-card .status-badge { margin:0; }
.modal-open { overflow:hidden; }

/* Rich modal layout */
.modal-rich .modal-cover { height:180px; background-size:cover; background-position:center; position:relative; padding:20px; color:#fff; }
.modal-rich .modal-cover-title { margin:0; font-size:1.6rem; font-weight:700; }
.modal-rich .modal-cover .btn-close { position:absolute; right:16px; top:12px; }
.modal-rich .modal-cover .btn { position:absolute; left:16px; top:12px; }
.modal-title-large { margin:0 0 6px 0; font-size:1.4rem; font-weight:700; color: var(--text-color); }

/* Modal client & budget icons */
.modal-main .client-budget .client-line i,
.modal-main .client-budget .budget-line i {
    color: var(--muted-color);
    width: 18px;
    text-align: center;
}

/* Assignee block in modal side */
.assignee-block { padding:10px 0; }
.assignee-block .assignee-info { display:flex; flex-direction:column; }
.assignee-block .assignee-avatar { box-shadow: 0 8px 20px rgba(15,15,17,0.06); }
.modal-grid { display:grid; grid-template-columns: 1fr 220px; gap:18px; }
.modal-main { padding:18px; }
.modal-side { padding:18px; border-left: none; background:var(--surface); }
.modal-side .side-block { margin-bottom:12px; }
.modal-side .side-actions { display:flex; flex-direction:column; gap:8px; }
.modal-side .btn { text-align:left; }

@media (max-width: 900px) {
    .modal-grid { grid-template-columns: 1fr 200px; }
}

@media (max-width: 700px) {
    .modal-grid { grid-template-columns: 1fr; }
    .modal-side { border-left:none; border-top:1px solid var(--border-color); }
}

/* Description editor styles in modal */
#project-desc-textarea { width:100%; padding:10px; border-radius:8px; border:1px solid var(--border-color); font-size:0.95rem; }
#project-desc-editor .btn { min-width:90px; }

/* task done style */
.task-done { opacity:0.7; }
.task-done span { text-decoration: line-through; }

/* files list styling */
#project-modal-files a { color: var(--primary-color); text-decoration: none; }

/* file row and menu */
.file-row { display:flex; align-items:center; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--border-color); }
.file-left .file-name { font-weight:600; }
.file-left .file-meta { font-size:0.85rem; color:var(--muted-color); margin-top:4px; }
.file-right { position:relative; display:flex; align-items:center; gap:8px; }
.btn-ghost { background:transparent; border:none; font-size:18px; line-height:1; cursor:pointer; }
.file-menu { position:absolute; right:0; top:28px; min-width:140px; background:#fff; border:1px solid var(--border-color); border-radius:8px; padding:6px; display:none; box-shadow:0 10px 30px rgba(0,0,0,0.08); z-index:1200; }
.file-menu.open { display:block; }
.file-menu button { display:block; width:100%; text-align:left; padding:8px 10px; border:none; background:transparent; cursor:pointer; }
.file-menu button.text-danger { color:#c03535; }

/* task label styles */
.task-label { padding:4px 8px; border-radius:12px; font-size:0.75rem; font-weight:600; }
.label-success { background:#e6ffef; color:#0a8a3a; }
.label-danger { background:#ffecec; color:#c03535; }
.label-warning { background:#fff4e5; color:#b36b00; }
.label-info { background:#eef6ff; color:#2b6cb0; }
.label-muted { background:#f3f4f6; color:#6b7280; }
.task-row { display:flex; justify-content:space-between; align-items:center; }
.task-dates { margin-left:28px; }

/* small date input style */
.project-task-start, .project-task-due { border:1px solid var(--border-color); border-radius:6px; padding:4px; font-size:0.875rem; }

/* Responsive modal behavior */
@media (max-width: 900px) {
    .modal-card { width: min(660px, 94%); }
}

/* Mobile: slide-up full-width bottom sheet */
@media (max-width: 700px) {
    .modal-overlay { background: rgba(0,0,0,0.7); }
    .modal-center { left: 0; top: auto; bottom: 0; transform: translateY(100%); width: 100%; }
    .modal-center.open { transform: translateY(0); }
    .modal-card { width: 100%; height: 92vh; border-radius: 12px 12px 0 0; box-shadow: 0 -12px 30px rgba(15,15,17,0.12); }
    .modal-body { max-height: calc(92vh - 140px); }
}
.progress-bar.status-secondary { background: var(--primary-color); }

/* Stronger rule to ensure modal width increases on large screens */
.modal-center.open .modal-card {
    width: min(660px, 90vw) !important;
    max-width: 660px !important;
}

/* .project-grid: grid layout by default, list-view class switches to single-column list */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:1rem }
.project-grid.list-view { display: block }
.project-grid.list-view .project-card { margin-bottom: 1rem }

.kanban-card {
    background: var(--surface-alt);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 10px 25px rgba(15, 15, 17, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: default;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 15, 17, 0.10);
}

.timeline-list,
.attention-list,
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item,
.alert-pill,
.activity-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--surface-alt);
    align-items: flex-start;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.notification-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 15, 17, 0.08);
}

.notification-item.is-read {
    opacity: 0.7;
}

.notification-item .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #0f0f11;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.notification-item p {
    margin-bottom: 0.25rem;
    color: #1f1f24;
}

.notification-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.timeline-dot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border-color);
}

.timeline-dot strong {
    display: block;
}

.automation-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.automation-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.automation-item:last-child {
    border-bottom: none;
}

.due-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.due-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.due-item:last-child {
    border-bottom: none;
}

.due-item strong {
    display: block;
}

.spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.spotlight-card {
    background: var(--surface-alt);
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Roadmap list (vertical timeline-like list with percent and action) */
.roadmap-card .card-body, .roadmap-card .card-header { padding-left: 1.25rem; padding-right: 1.25rem; }
.roadmap-list { display: flex; flex-direction: column; gap: 1rem; }
.roadmap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-alt);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(0,0,0,0.03);
}
.roadmap-left { display:flex; flex-direction:column; gap:0.25rem; }
.roadmap-title { font-weight:700; color:#111117; }
.roadmap-sub { color:var(--muted-color); font-size:0.92rem; }
.roadmap-right { display:flex; align-items:center; gap:1rem; }
.roadmap-percent { font-weight:700; color:#111117; }
.btn-sm { padding: 0.35rem 0.7rem; font-size:0.82rem; border-radius:10px; }

@media (max-width: 900px) {
    .roadmap-item { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .roadmap-right { justify-content: flex-end; }
}

/* Profile page styles */
.profile-card {
    padding: 1.25rem;
    border-radius: 14px;
}
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.profile-left { display:flex; align-items:center; gap:1rem; }
.profile-avatar {
    width:72px; height:72px; border-radius:50%; background:#0f0f11; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1.05rem; box-shadow:0 10px 24px rgba(15,15,17,0.08);
}
.profile-meta h4 { margin:0; font-size:1.15rem; }
.profile-meta p { margin:4px 0 0 0; color:var(--muted-color); font-size:0.92rem; }
.profile-meta .meta-sep { margin:0 8px; color:var(--muted-color); }

/* Profile page helpers (moved from inline styles in profile.html) */
.profile-top-row{display:flex;gap:2rem;align-items:flex-start;flex-wrap:wrap}
.profile-left{flex:0 0 220px}
.profile-right{flex:1;min-width:280px}
.avatar-box{width:96px;height:96px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:700}
.profile-name-block{margin-top:12px}
.profile-name-block h4{margin:0}

/* Avatar edit button shown in edit mode */
.profile-avatar { position: relative; }
.avatar-edit-btn {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.85);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    cursor: pointer;
    z-index: 4;
}
.avatar-edit-btn i { font-size: 14px; }
.profile-actions { display:flex; align-items:center; gap:0.6rem; }
.profile-actions .socials { display:flex; gap:0.5rem; }
.profile-actions .icon-pill { width:40px; height:40px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--surface-alt); color:var(--muted-color); border:1px solid rgba(0,0,0,0.04); }
.profile-actions .edit-profile-trigger { border-radius:999px; }

.profile-info { margin-top:1.1rem; display:flex; flex-direction:column; gap:0.9rem; }
.profile-info .info-row { display:flex; gap:1.25rem; }
.profile-info .info-row > div { flex:1; background:transparent; padding:0.5rem 0; }
.profile-info .info-row.full > div { grid-column: 1 / -1; }
.profile-info strong { display:block; color:var(--muted-color); font-weight:600; margin-bottom:0.35rem; }

/* Modal and profile form helper classes moved from profile.html inline styles */
.ticket-modal-panel{max-width:420px;min-width:340px}
.ticket-horizontal-header{flex:0 0 220px;display:flex;align-items:center;justify-content:center}
.ticket-horizontal-avatar{margin-bottom:0.7rem}
.ticket-horizontal-title{font-size:1.25rem;font-weight:700;color:#1f1f24;margin-bottom:0.2rem;text-align:center}
.ticket-horizontal-body{padding:2.2rem 2.2rem 1.2rem 2.2rem}
.modal-panel-footer--profile{display:flex;justify-content:flex-end;gap:0.7rem;padding:1.1rem 1.5rem 1.1rem 1.5rem;background:#f7f7fb;border-top:1px solid #eee}

/* Custom prompt modal (moved from inline JS-injected style) */
.custom-prompt-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;z-index:2200}
.custom-prompt-modal{background:#fff;border-radius:12px;padding:18px 20px;max-width:720px;width:90%;box-shadow:0 18px 50px rgba(0,0,0,0.3);font-family:inherit}
.custom-prompt-title{font-weight:600;margin-bottom:8px}
.custom-prompt-input{width:100%;padding:10px 12px;border:1px solid rgba(0,0,0,0.09);border-radius:8px;margin-bottom:12px;font-size:0.95rem}
.custom-prompt-actions{display:flex;gap:8px;justify-content:flex-end}
.custom-prompt-btn{padding:8px 14px;border-radius:999px;border:none;cursor:pointer}
.custom-prompt-btn.primary{background:#0f0f11;color:#fff}
.custom-prompt-btn.ghost{background:transparent;border:1px solid rgba(0,0,0,0.08)}
.custom-prompt-header{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.custom-prompt-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center}

/* Payslip list small tweaks */
.payslip-list .payslip-item { display:flex; justify-content:space-between; align-items:center; padding:0.85rem; border-radius:10px; background:var(--surface-alt); border:1px solid rgba(0,0,0,0.03); margin-bottom:0.6rem; }

@media (max-width: 992px) {
    .profile-header { flex-direction:column; align-items:flex-start; }
    .profile-actions { align-self:stretch; justify-content:space-between; width:100%; }
}

/* Block edit/save controls placement */
.card-header .card-actions { display:flex; gap:0.5rem; align-items:center; }

/* Info grid used by personal/address forms */
.info-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap:1rem; }
.info-item small { color:var(--muted-color); display:block; margin-bottom:0.4rem; }
.info-item div { font-weight:600; }
.info-item.full { grid-column: 1 / -1; }

/* Make inputs visually aligned with static style when disabled */
.profile-block-form .form-control[disabled] { background: transparent; border: none; padding-left: 0; color: #111117; font-weight:600; padding: 0; font-size: 1rem; text-align: left; }
.profile-block-form .form-control { border-radius:8px; }

/* Ensure header card-actions float right */
.card-header { display:flex; justify-content:space-between; align-items:center; }

/* Harmonise le fond des en-têtes de section pour qu'ils correspondent aux autres */
:not(.dark-theme) .card-header,
:not(.dark-theme) .dashboard-card .card-header,
:not(.dark-theme) .card-header-top,
:not(.dark-theme) .card-header-custom {
    background: linear-gradient(135deg, #f8faf9 0%, #eef7f1 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

@media (max-width: 900px) {
    .info-grid { grid-template-columns: 1fr; }
}

/* Project list (detailed rows) */
.project-list-card .card-body { padding: 1rem 1.25rem; }
.project-list-header,
.project-list-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.8fr 1.4fr 0.8fr 0.4fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0.5rem;
}
.project-list-header { font-size: 0.78rem; text-transform: uppercase; color: var(--muted-color); border-bottom: 1px solid rgba(0,0,0,0.04); }
.project-list-row { background: transparent; border-bottom: 1px solid rgba(0,0,0,0.04); padding-top: 1rem; padding-bottom: 1rem; }
.project-list-row:last-child { border-bottom: none; }
.project-list-row .name a { color: #2b6cb0; font-weight:600; text-decoration:none; }
.project-list-row .assignees { display:flex; }
.project-list-row .start, .project-list-row .due, .project-list-row .tasks { color:var(--muted-color); }
.project-list-row .actions { text-align:center; color:var(--muted-color); }

.progress-mini { height: 8px; background: rgba(0,0,0,0.06); border-radius: 999px; overflow:hidden; width:100%; position:relative; }
.progress-mini .progress-fill { height:100%; background: linear-gradient(90deg,#2ecc71,#27ae60); border-radius:inherit; }
.progress-numbers { font-size:0.82rem; color:var(--muted-color); margin-left:0.6rem; display:inline-block; }

.project-list-footer { display:flex; justify-content:space-between; padding-top:1rem; color:var(--muted-color); }

@media (max-width: 900px) {
    .project-list-header, .project-list-row { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
    .project-list-row .progress-numbers { display:block; margin-left:0; margin-top:0.4rem; }
}

.spotlight-card h4 {
    font-size: 1.4rem;
    margin: 0.35rem 0;
}

.playbook-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Projects grid: show cards (3 per row on wide screens) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.25rem;
}

.project-card {
    background: var(--surface-alt);
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.03);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    box-shadow: 0 12px 36px rgba(15,15,17,0.06);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-ref {
    font-size: 0.82rem;
    color: var(--muted-color);
}

.project-title {
    margin: 0 0 0.45rem 0;
    font-size: 1.05rem;
    color: var(--primary-color);
}

.project-description {
    color: var(--muted-color);
    margin: 0 0 0.75rem 0;
    font-size: 0.92rem;
}

.project-meta {
    margin-top: auto;
}

.project-client {
    color: var(--muted-color);
    font-size: 0.88rem;
}

.project-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.project-card .action-group .btn {
    padding: 0.45rem 0.85rem;
}

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

/* Ensure grid items stretch and don't collapse to full width */
.project-grid {
    width: 100%;
}
.project-grid > .project-card {
    align-self: stretch;
}

.project-card:hover {
    transform: translateY(-6px);
    transition: transform 220ms ease, box-shadow 220ms ease;
    box-shadow: 0 20px 50px rgba(15,15,17,0.08);
}

/* Mini project cards used in the Feuille de route sidebar */
.project-tiles {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mini-project-card {
    background: var(--surface-alt);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.03);
    padding: 0.85rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 20px rgba(15,15,17,0.04);
}

.mini-project-card-body {
    flex: 1 1 auto;
}

.mini-project-title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--primary-color);
}

.mini-project-due {
    display: block;
    color: var(--muted-color);
    font-size: 0.86rem;
}

.mini-project-desc {
    margin: 0.45rem 0 0 0;
    color: var(--muted-color);
    font-size: 0.88rem;
}

.mini-project-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.mini-project-progress {
    font-weight: 600;
    color: var(--primary-color);
}

.mini-project-actions .btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}

/* Profile page styles */
.profile-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

/* Unified personal profile card should be left-aligned for readability */
.profile-block[data-block="personal"] .profile-card { text-align: left; }

/* Reduce vertical spacing between stacked profile blocks */
.profile-block {
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}
.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #e6be00);
    color: #111117;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.profile-card h4 { margin-bottom: 0.25rem; }
.profile-info { margin-top: 1rem; display: grid; gap: 0.6rem; }
.profile-info div { color: var(--muted-color); font-size: 0.95rem; }

.payslip-list { display:flex; flex-direction:column; gap:0.5rem; }
.payslip-item { display:flex; justify-content:space-between; align-items:center; padding:0.65rem; border-radius:10px; background:var(--surface-alt); border:1px solid rgba(0,0,0,0.03);} 
.payslip-actions .btn-sm, .payslip-actions .btn { padding:0.35rem 0.6rem; }

/* Profile form adjustments */
#profile-form .form-control { background: var(--surface-color); }

@media (max-width: 768px) {
    .profile-avatar { width:72px; height:72px; }
}

/* Summary block (left column) - keep avatar and meta left-aligned and vertically centered */
.profile-block[data-block="summary"] .profile-card {
    text-align: left;
    padding: 1.25rem;
}
.profile-block[data-block="summary"] .profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.profile-block[data-block="summary"] .profile-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.profile-block[data-block="summary"] .profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin-bottom: 0;
    flex: 0 0 72px;
}
.profile-block[data-block="summary"] .profile-meta h4 {
    margin: 0;
    font-size: 1.05rem;
}
.profile-block[data-block="summary"] .profile-actions {
    margin-left: auto;
}

/* ensure socials don't wrap and remain compact */
.profile-block[data-block="summary"] .profile-actions .socials { display:flex; gap:0.5rem; align-items:center; }

.playbook-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.playbook-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.playbook-item p {
    margin: 0.25rem 0 0;
    color: var(--muted-color);
}

.alert-pill {
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.alert-danger { background: rgba(240, 84, 84, 0.08); }
.alert-warning { background: rgba(246, 166, 9, 0.08); }
.alert-info { background: rgba(92, 163, 255, 0.08); }

.recommendations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    background: var(--surface-alt);
}

.recommendation.danger { border-left: 4px solid var(--danger); }
.recommendation.success { border-left: 4px solid var(--success); }
.recommendation.warning { border-left: 4px solid var(--warning); }

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0.5rem 0;
}

.toggle input {
    display: none;
}

.toggle .slider {
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
}

.toggle .slider::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
}

.toggle input:checked + .slider {
    background: var(--secondary-color);
}

.toggle input:checked + .slider::after {
    transform: translateX(22px);
}

.notification-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
}

.login-body .notification-container {
    top: auto;
    bottom: 2rem;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 2rem));
}

.login-body .notification {
    width: 100%;
}

/* Make table headers left-aligned so they line up with column content */
.table-modern thead th,
.table.table-modern thead th,
.table thead th {
    text-align: left;
    font-weight: 600;
}

/* Ensure header padding matches cells for visual alignment */
.table-modern thead th,
.table-modern tbody td {
    padding-left: 1.25rem;
}

/* Horizontal separators between table rows */
.table-modern tbody tr td {
    border-bottom: 1px solid var(--table-row-border, #e9ecef);
}

/* Remove bottom border for the last visible row to avoid double border at table end */
.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* If using spaced rows (border-spacing), ensure the separator sits visually between rows */
.table-modern {
    border-collapse: separate;
}

.notification {
    background: rgba(15, 15, 17, 0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    font-size: 0.85rem;
    border: none;
}

.form-control-custom,
.form-select {
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.75rem 1rem;
    box-shadow: none; /* reduce default input shadows */
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.empty-state {
    padding: 4rem;
    text-align: center;
    color: var(--muted-color);
}

.login-body {
    min-height: 100vh;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Disable decorative animated pseudo-elements on login page */
.login-body::before,
.login-body::after {
    display: none !important;
    animation: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    content: none !important;
}

@keyframes pulseGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes auroraFlow {
    0% { transform: translate(-12%, -8%) rotate(0deg) scale(1); }
    50% { transform: translate(8%, 6%) rotate(180deg) scale(1.1); }
    100% { transform: translate(-12%, -8%) rotate(360deg) scale(1); }
}

.login-wrapper {
    position: relative;
    z-index: 5;
    width: min(520px, 100%);
    display: block;
}

.login-card {
    background: #212121;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 2.75rem;
    box-shadow: 0 15px 70px rgba(211, 192, 115, 0.55);
}

/* Two-column login layout */
.login-grid {
    display: flex;
    gap: 2rem;
    width: min(1100px, 100%);
    align-items: stretch;
}

.login-hero {
    flex: 1 1 50%;
    background: none;
    border-radius: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: left;
    max-width: 480px;
}

.hero-title { font-size: 1.6rem; margin-bottom: 0.25rem; color: #fff; }
.hero-sub { color: rgba(255,255,255,0.85); margin-bottom: 1.25rem; }

/* Panther as full-section background */
.panther-wrap { position: absolute; inset: 0; z-index: 1; }
.panther-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; transform-origin: center; animation: none !important; filter: none; transform: none; }
.hero-content { position: relative; z-index: 2; display: none; }

@keyframes panther-walk {
    0% { transform: translateX(-10%) translateY(0) rotate(0deg); }
    25% { transform: translateX(6%) translateY(-6px) rotate(-0.6deg); }
    50% { transform: translateX(28%) translateY(-8px) rotate(-1deg); }
    75% { transform: translateX(6%) translateY(-6px) rotate(-0.6deg); }
    100% { transform: translateX(-10%) translateY(0) rotate(0deg); }
}

/* Ensure login card sits nicely on the right */
.login-wrapper { flex: 0 0 420px; display: flex; align-items: center; }
.login-card { width: 100%; }

@media (max-width: 900px) {
    .login-grid { flex-direction: column-reverse; gap: 1rem; }
    .login-hero { width: 100%; padding: 1.25rem; border-radius: 18px; }
    .login-wrapper { width: 100%; }
    .panther-wrap { position: relative; inset: auto; height: 220px; }
    .panther-img { position: relative; inset: auto; width: 100%; height: 100%; object-fit: contain; object-position: left center; max-width: none; filter: none; transform: none; }
    .hero-content { z-index: 3; }
}

.login-card .logo h2 {
    color: #fff;
    letter-spacing: 3px;
}

.login-card .logo span {
    color: var(--secondary-color);
}

.input-icon-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8c8c95;
    pointer-events: none;
}

.input-icon-group.focused i {
    color: var(--secondary-color);
}

.input-icon-group .form-control-custom {
    padding-left: 2.75rem;
    background: #0f0f13;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-icon-group .form-control-custom:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(255, 210, 0, 0.15);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.login-options .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

.login-options .form-check-input:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.demo-credentials {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    margin-top: 1.25rem;
}

.demo-credentials code {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    color: var(--secondary-color);
}

.quick-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.quick-links a:hover {
    color: var(--secondary-color);
}

.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: rgba(0, 0, 0, 0.8);
    animation: spin 0.8s linear infinite;
}

.btn-loading .btn-text { opacity: 0.7; }
.btn-loading .btn-loader { display: inline-block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

#content-area {
    transition: opacity 0.3s ease;
}

#content-area.loading {
    opacity: 0.4;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .page-header {
        flex-direction: column;
    }

    .dashboard-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }


/* Login page specific styles */
body.login-body {
    background: #000000;
}

.login-grid {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2rem;
}

.login-hero { display: none; }

.login-wrapper { width: 100%; max-width: 420px; }

.login-card {
    background: #04802c;
    color: #ffffff;
    padding: 2.25rem;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6);
    width: 100%;
}

.login-card .login-logo { max-width: 160px; filter: none !important; }
.login-card .form-control-custom { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: #fff; }
.login-card .input-icon-group { display:flex; align-items:center; gap:0.75rem; margin-bottom:1rem; }
.login-card .input-icon-group i { color: rgba(255,255,255,0.9); }
.login-card .login-options p { color: rgba(255,255,255,0.8); }
.login-card .footer small { color: rgba(255,255,255,0.7); }

@media (min-width: 1000px) {
    .login-hero { display:block; width:480px; }
}
    .filters {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .header-actions,
    .search-field.large {
        width: 100%;
    }

    .navbar-custom {
        flex-wrap: wrap;
    }

    .search-field {
        min-width: 0;
        width: 100%;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

.panel-side-right {
    /* Lateral panel width reduced to 640px; right offset adjusted accordingly */
    position: fixed;
    top: 0;
    right: -680px;
    width: 640px;
    max-width: 96%;
    height: 100vh;
    background: var(--surface-color);
    box-shadow: -18px 0 60px rgba(15,15,17,0.12);
    z-index: 12050;
    transition: right 0.28s cubic-bezier(.2,.9,.2,1), box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.panel-side-right {
    position: fixed;
    top: 0;
    right: -680px;
    width: 640px;
    max-width: 96%;
    height: 100vh;
    background: var(--surface-color);
    box-shadow: none; /* avoid visible shadow when panel is off-screen */
    z-index: 12050;
    transition: right 0.28s cubic-bezier(.2,.9,.2,1), box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.panel-side-right.open {
    right: 0;
    box-shadow: -18px 0 60px rgba(15,15,17,0.12);
}

/* Ensure panel content flows vertically and footer stays visible */
.panel-side-right .panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-side-right .panel-body {
    flex: 1 1 auto;
    overflow: auto;
}

.panel-side-right .panel-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface-color);
    z-index: 5;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: #0f0f11; /* black header */
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
}

.panel-header .panel-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 0.88rem;
    color: #ffffff; /* force subtitle white */
    font-weight: 500;
}

.panel-header .btn-close {
    font-size: 1.05rem;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    opacity: 0.95;
    color: #fff;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.12s ease;
}

.panel-header .btn-close:hover {
    background: rgba(255,255,255,0.06);
    opacity: 1;
    transform: translateY(-1px);
}

.panel-body {
    flex: 1;
    padding: 20px 22px;
    overflow-y: auto;
}

.panel-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0,0,0,0.04);
    background: transparent;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Overlay */
.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.38);
    z-index: 12040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease-in-out, visibility 0.22s ease-in-out;
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Dim the page slightly when any panel is open (matches panel-open variants)
   Using attribute selector ensures pages that add panel-open-... also match. */
body[class*="panel-open"] #panel-overlay.active,
body[class*="panel-open"] .panel-overlay.active,
body[class*="panel-open"] .page-blur-overlay.visible {
    background: rgba(0,0,0,0.28) !important;
}

/* Darken side-panel backdrop for better contrast when any panel is open */
body[class*="panel-open"] .modal-shell.side-right {
    background: rgba(0,0,0,0.45) !important;
}

/* Lighter overlay for the Factures page to reduce darkness */
body.panel-open-ticket #panel-overlay.active,
body.panel-open-ticket .panel-overlay.active,
body.panel-open-ticket .page-blur-overlay.visible {
    background: rgba(0,0,0,0.06) !important;
}

body.panel-open-ticket .modal-shell.side-right {
    background: rgba(0,0,0,0.06) !important;
}

/* Also remove any heavy box-shadow applied to the main content edge when overlay present */
body.panel-open .main-content,
body.panel-open-ticket .main-content {
    box-shadow: none !important;
}

/* Ensure overlays/veils are hidden when no panel is open to avoid accidental veils */
body:not([class*="panel-open"]) .panel-overlay,
body:not([class*="panel-open"]) #panel-overlay,
body:not([class*="panel-open"]) .page-blur-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    background: transparent !important;
    pointer-events: none !important;
}

/* Remove any residual dark modal backdrop when panels are closed */
body:not([class*="panel-open"]) .modal-shell.side-right {
    background: transparent !important;
}

/* Defensive: remove large box-shadows that could darken edges when no panel open */
body:not([class*="panel-open"]) .panel-side-right,
body:not([class*="panel-open"]) .modal-shell.side-right .modal-panel {
    box-shadow: none !important;
}

/* Steps inside side panels */
.panel-step { display: none; }
.panel-step[data-step="1"] { display: block; }

/* Project steps numbering */
.project-step-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.step-badge {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    color: var(--muted-color);
    font-weight: 700;
}

/* add vertical spacing between step rows and ensure input grows */
.project-step-row {
    margin-bottom: 0.6rem;
}
.project-step-row .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* Améliorations des formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    display: block;
}

.form-control-custom {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 14px;
    width: 100%;
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control-custom:focus {
    border-color: var(--secondary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(255,210,0,0.25);
}

select.form-control-custom {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

textarea.form-control-custom {
    min-height: 80px;
    resize: vertical;
}

/* (Boutons harmonisés définis plus haut) */

/* Responsive */
@media (max-width: 576px) {
    .panel-side-right {
        width: 100%;
        right: -100%;
    }
}

/* Improved panel form layout and input polish */
.panel-side-right .panel-body {
    padding: 28px 26px 110px; /* bottom padding to avoid footer overlap */
}

.panel-side-right .form-group {
    margin-bottom: 1.25rem;
}

.panel-side-right .form-label {
    font-size: 0.92rem;
    color: #2f3f4a;
    margin-bottom: 0.45rem;
}

.panel-side-right .form-control-custom,
.panel-side-right .form-select {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.96rem;
    line-height: 1.3;
    border: 1px solid rgba(15,15,20,0.06);
    background: #fff;
    color: #12202b;
    box-shadow: 0 1px 4px rgba(18, 24, 28, 0.01); /* even subtler shadow */
}

/* Further reduce shadows site-wide for inputs and apply yellow border on hover/focus */
.form-control-custom:hover,
.form-select:hover,
select.form-control-custom:hover,
.form-control-custom:focus,
.form-control-custom:focus-visible,
.form-select:focus,
select.form-control-custom:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.form-control-custom:focus,
.form-control-custom:focus-visible,
.form-select:focus,
select.form-control-custom:focus {
    box-shadow: 0 6px 18px rgba(255,210,0,0.06); /* subtle yellow glow on focus */
}

/* Keep hover shadow extremely subtle or none */
.form-control-custom:hover,
.form-select:hover,
select.form-control-custom:hover {
    box-shadow: 0 1px 3px rgba(18,24,28,0.008);
}

.panel-side-right textarea.form-control-custom {
    min-height: 110px;
}

.panel-side-right .input-inline {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.panel-side-right .input-inline .form-control-custom {
    flex: 1 1 auto;
}

/* Date input with small calendar icon aligned */
.panel-side-right input[type="date"],
.panel-side-right input[type="text"].has-calendar {
    padding-right: 40px;
}

.panel-side-right .calendar-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7a86;
    font-size: 1rem;
}

/* Make footer buttons more prominent and separated */
.panel-side-right .panel-footer {
    padding: 16px 22px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.99));
    border-top: 1px solid rgba(10,10,12,0.04);
}

.panel-side-right .panel-footer .btn {
    min-width: 110px;
}

/* Slightly increase size of select arrow for readability */
.panel-side-right select.form-control-custom {
    background-position: right 1.1rem center;
    background-size: 1.05em;
}

/* Improve spacing for multi-column fields inside panels */
.panel-side-right .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

@media (max-width: 640px) {
    .panel-side-right .form-row { grid-template-columns: 1fr; }
}

/* Slight visual lift for labels and inputs inside the panel */
.panel-side-right .form-label small {
    display: block;
    color: var(--muted-color);
    font-weight: 500;
    margin-top: 4px;
}

/* Reduce stray large shadows on small viewports */
@media (max-width: 576px) {
    .panel-side-right { box-shadow: none; }
}

/* Ensure every text/icon inside panel/modal headers is white for contrast */
.panel-header,
.panel-header *,
.modal-header,
.modal-header *,
.top-right-panel .modal-header,
.top-right-panel .modal-header * {
    color: #ffffff !important;
}

.panel-header svg,
.panel-header path,
.panel-header use,
.modal-header svg,
.modal-header path,
.modal-header use,
.top-right-panel .modal-header svg,
.top-right-panel .modal-header path {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* Make the 'Annuler' / cancel buttons in panel footers use a gray background */
.panel-side-right .panel-footer .btn-outline,
.modal-shell.side-right .modal-panel .modal-footer .btn-outline,
.panel-top-right .modal-footer .btn-outline,
.top-right-panel .modal-footer .btn-outline {
    background: #eef0f2; /* light gray */
    color: #0f0f11;
    border-color: rgba(0,0,0,0.06);
    box-shadow: none;
}

.panel-side-right .panel-footer .btn-outline:hover,
.modal-shell.side-right .modal-panel .modal-footer .btn-outline:hover,
.panel-top-right .modal-footer .btn-outline:hover,
.top-right-panel .modal-footer .btn-outline:hover {
    background: #e6e8ea;
}

/* Bouton 'Enregistrer' du modal d'ajout/modification admin */
#admin-modal-save,
.modal-panel #admin-modal-save {
    background: #07461c !important;
    border-color: #07461c !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* RH modal detail layout helpers */
.rh-content { padding: 6px 8px 18px; }
.rh-modal-grid { display:flex; gap:24px; align-items:flex-start; flex-wrap:wrap; }
.rh-modal-left { flex:1 1 420px; display:flex; gap:16px; align-items:flex-start; }
.rh-modal-avatar { width:72px; height:72px; border-radius:50%; background:#111; color:#fff; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; }
.rh-modal-info h4 { margin:0 0 6px; font-size:20px; }
.rh-role { color:var(--muted-color); margin-bottom:10px; }
.rh-modal-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px 20px; color:#666; }
.rh-field strong { display:block; color:#444; margin-bottom:6px; }
.rh-modal-address { margin-top:12px; color:#666; }
.rh-modal-tasks { margin-top:12px; }
.rh-modal-tasks .badge-pill { margin-right:8px; margin-bottom:8px; }
.rh-payment-section { flex:0 0 420px; min-width:280px; }
.rh-payment-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.rh-payment-table { max-height:55vh; overflow:auto; }
.rh-payment-table table { width:100%; border-collapse:collapse; }
.rh-payment-table thead th { text-align:left; padding:8px 6px; border-bottom:1px solid rgba(0,0,0,0.06); }
.rh-payment-table tbody td { padding:10px 6px; border-bottom:1px solid rgba(0,0,0,0.03); }
.rh-payment-table .muted { color:var(--muted-color); font-size:13px; }
/* Ensure payments table uses full width of its column inside the modal */
.rh-payment-section { min-width: 0; flex: 1 1 420px; }
.rh-payment-table { width: 100% !important; overflow: auto; }
.rh-payment-table table { width: 100% !important; table-layout: fixed; }
.rh-payment-table th, .rh-payment-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width:900px) {
    .rh-modal-grid { flex-direction:column; }
    .rh-payment-section, .rh-modal-left { flex:1 1 100%; }
    .rh-modal-fields { grid-template-columns:1fr; }
}

/* Ensure filters in card headers keep controls on one line when possible */
.card-header .filters.d-flex {
    display: flex !important;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap; /* keep selects and export button on same line */
}
.card-header .filters .filter-select-md { min-width: 220px; max-width: 36vw; }
.card-header .filters .filter-select-sm { min-width: 160px; max-width: 28vw; }
.card-header .filters button { height: 44px; padding: 8px 12px; }

@media (max-width: 900px) {
    .card-header .filters.d-flex { flex-wrap: wrap; }
    .card-header .filters .filter-select-md,
    .card-header .filters .filter-select-sm,
    .card-header .filters button { max-width: 100%; flex: 1 1 100%; }
}

/* Transactions card header layout */
.card-header { display: flex; flex-direction: column; gap: 8px; }
.card-header-top { width: 100%; }
.card-header-bottom { width: 100%; }
.card-header-title h5 { margin: 0; }
.card-header .btn-group .btn { margin-left: 6px; }

@media (max-width: 720px) {
    .card-header-top { flex-direction: column; align-items: flex-start; gap:8px; }
    .card-header-bottom { justify-content: flex-start; }
}

/* Active tab style: highlight with platform yellow */
.card-header .btn-group .btn.active {
    background: var(--secondary-color);
    color: #111;
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 6px 18px rgba(13,11,8,0.06);
}
.card-header .btn-group .btn.active:hover {
    background: var(--secondary-color);
}

/* Transactions: override active tab to use success (green) */
#card-transactions .card-header .btn-group .btn.active {
    background: var(--success) !important;
    color: #fff !important;
    border-color: rgba(0,0,0,0.06) !important;
    box-shadow: 0 6px 18px rgba(4,128,44,0.12) !important;
}
#card-transactions .card-header .btn-group .btn.active:hover {
    background: var(--success) !important;
}

/* Ensure card headers that opt-in with .d-flex remain horizontal
   This overrides the column layout used for some header variants. */
.card-header.d-flex {
    flex-direction: row;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
}

/* Ensure payment filters (month, status, export) sit on one row */
#transactions-pay-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}
#transactions-pay-filters .filter-select-md,
#transactions-pay-filters .filter-select-sm {
    min-width: 180px;
    max-width: 34vw;
}
#transactions-pay-filters select {
    width: auto;
}
#transactions-pay-filters button { height: 44px; }

@media (max-width: 900px) {
    #transactions-pay-filters { flex-wrap: wrap; }
    #transactions-pay-filters .filter-select-md,
    #transactions-pay-filters .filter-select-sm,
    #transactions-pay-filters button { flex: 1 1 100%; max-width: 100%; }
}

/* Expenses filters: align select + export on one row like payments */
#transactions-exp-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}
#transactions-exp-filters .filter-select-md { min-width: 180px; max-width: 34vw; }
#transactions-exp-filters button { height: 44px; }
@media (max-width: 900px) {
    #transactions-exp-filters { flex-wrap: wrap; }
    #transactions-exp-filters .filter-select-md,
    #transactions-exp-filters button { flex: 1 1 100%; max-width: 100%; }
}

/* inline field error messages for forms */
.field-error {
    color: var(--danger);
    font-size: 0.86rem;
    margin-top: 6px;
}

/* Revenue card styling */
.stat-card.revenue-card {
    background: linear-gradient(90deg, #fff8ed, #fff4e6);
    border: 1px solid rgba(255,176,32,0.12);
    position: relative;
    overflow: hidden;
    transition: transform .24s ease, box-shadow .24s ease;
    box-shadow: 0 6px 18px rgba(255,176,32,0.06);
}
.stat-card.revenue-card::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -50%;
    width: 220%;
    height: 160%;
    background: linear-gradient(120deg, rgba(255,200,64,0.08) 0%, rgba(255,142,0,0.06) 30%, rgba(255,200,64,0.02) 60%, rgba(255,142,0,0.04) 100%);
    transform: rotate(8deg) translateX(-100%);
    animation: revenue-slide 8s linear infinite;
    pointer-events: none;
}
.stat-card.revenue-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(255,176,32,0.12); }
.stat-card.revenue-card .stat-icon {
    background: linear-gradient(135deg,#FFB020,#FF7A00);
    color: #fff;
}
.stat-card.revenue-card .stat-value {
    color: #B45309;
}

@keyframes revenue-slide {
    0% { transform: rotate(8deg) translateX(-100%); }
    50% { transform: rotate(8deg) translateX(-10%); }
    100% { transform: rotate(8deg) translateX(100%); }
}

/* loading spinner on button icon */
.btn.loading { opacity: 0.9; pointer-events: none; }
.btn.loading .fa-sync { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }

/* Mini avatar for recent users list */
.mini-avatar {
    width:36px; height:36px; border-radius:50%; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; background:#f3f4f6; flex: 0 0 36px;
}
.mini-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.mini-avatar .initials { font-weight:700; color:#374151; }
.list-compact li { list-style:none; }

/* Recent users card styling to match tickets card */
.recent-users-list { display:block; }
.recent-users-list .recent-user-item { border-bottom: 1px solid rgba(15,23,42,0.04); padding:10px 0; }
.recent-users-list .recent-user-item:last-child { border-bottom: none; }
.recent-users-list .recent-user-date { color: var(--muted-color); font-size:0.9rem; }

/* Status badges for tickets */
.status-badge { display:inline-block; padding:6px 10px; border-radius:999px; font-weight:600; font-size:0.9rem; }
.status-unknown { background: rgba(99,102,241,0.06); color:#374151; }
.status-confirme { background: rgba(34,197,94,0.08); color:#166534; }
.status-en-attente { background: rgba(250,204,21,0.08); color:#a16207; }
.status-annule { background: rgba(239,68,68,0.06); color:#b91c1c; }
.status-confirmed { background: rgba(34,197,94,0.08); color:#166534; }
.status-pending { background: rgba(250,204,21,0.08); color:#a16207; }

/* Dashboard hero revenue card */
.dash-hero-card {
    background: linear-gradient(135deg, #01290e 0%, #054d1c 100%);
    border-radius: 16px;
    padding: 1.75rem 1.75rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 28px rgba(1,41,14,0.45);
    overflow: hidden;
    position: relative;
}
.dash-hero-inner { flex: 1; }
.dash-hero-label { margin: 0 0 0.4rem; font-size: 0.85rem; color: rgba(255,255,255,0.8); font-weight: 500; }
.dash-hero-value { margin: 0 0 0.4rem; font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.dash-hero-sub   { margin: 0; font-size: 0.82rem; color: rgba(255,255,255,0.75); }
.dash-hero-icon  { font-size: 3.5rem; color: rgba(255,255,255,0.12); flex-shrink: 0; margin-left: 1rem; }

/* Big gain card */
.big-gain-card {
    background: linear-gradient(90deg, #daf9e4, #b3ebc5);
    border: 1px solid rgba(255,159,67,0.12);
    box-shadow: 0 10px 30px rgba(255,159,67,0.06);
    padding: 18px;
    margin-bottom: 12px;
}
.big-gain-card .eyebrow { font-size:0.9rem; color:var(--muted-color); margin-bottom:6px; }
.big-gain-card h2 { font-size:2.1rem; color:#055e22; margin-bottom:6px; }
.big-gain-card .text-muted { color:rgba(15,23,42,0.6); }

/* Neural network background canvas for big gain card */
.big-gain-card .neural-bg-canvas,
#big-gain-neural-canvas,
.neural-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.18;
    filter: blur(6px) saturate(120%);
    mix-blend-mode: screen;
}