/* Responsive breakpoints: mobile < 640px, tablet 640-1024px, desktop > 1024px */
/* RF-008.2: Contrast ratio ≥ 4.5:1 for text (WCAG 2.1 AA) */
:root {
    --breakpoint-mobile: 640px;
    --breakpoint-tablet: 1024px;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    /* Aligné sur la liste Helpdesk tickets : marge verticale dans la zone article */
    --app-page-pad-top: 1.25rem;
    --app-page-pad-bottom: 2rem;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    max-width: 100%;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Main content offset when using fixed optitask-sidebar (spec 008) */
.main-content {
    flex: 1;
    margin-left: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.main-content > article {
    flex: 1 1 auto;
    align-self: stretch;
    min-width: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Chat : transmettre la hauteur utile à la colonne (évite height:100vh dans <article> → débordement bas) */
.main-content > article.content:has(.chat-page) {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Helpdesk fiche ticket : empêche tout rétrécissement / effet « carte centrée » */
.main-content > article .ticket-show-page,
.main-content > article .ticket-show-shell {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    /* Barre latérale fixe : padding (pas margin) pour que <main> reste largeur 100 % du .page
       sans erreur de calcul (évite contenu étroit + scroll horizontal). */
    .main-content {
        margin-left: 0;
        padding-left: var(--sidebar-width, 250px);
        max-width: none;
        box-sizing: border-box;
        transition: padding-left 200ms ease;
    }
    .page-sidebar-collapsed .main-content {
        padding-left: var(--sidebar-width-collapsed, 64px);
    }
}

main {
    flex: 1;
}

/* Hamburger: visible only on mobile (spec 008 T-008-39) */
.btn-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 6px;
}
.btn-hamburger:hover {
    background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 767px) {
    .btn-hamburger {
        display: inline-flex;
    }
}

@media (min-width: 768px) {
    .btn-hamburger {
        display: none !important;
    }
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
}

.nav-item {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.top-row .app-brand-title {
    margin-right: auto;
    margin-left: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #1e293b;
    font-weight: 800;
    font-size: 1.25rem;
}

.top-row .app-header-logo {
    max-height: 2.25rem;
    width: auto;
    object-fit: contain;
    display: block;
}

.top-row .app-brand-text-with-logo {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
}

.optitask-sidebar-logo {
    max-height: 28px;
    max-width: 160px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}

.top-row ::deep a, .top-row ::deep .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
    text-decoration: underline;
}

.top-row .btn-change-user {
    margin-left: auto;
    color: #3b82f6;
    font-size: 0.9rem;
}

/* Breadcrumb — spec 008 */
.optitask-breadcrumb { padding: 0.5rem 1rem; background: #fafafa; border-bottom: 1px solid #e5e7eb; font-size: 0.875rem; }
.optitask-breadcrumb-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.optitask-breadcrumb-item { display: inline-flex; }
.optitask-breadcrumb-sep { color: #9ca3af; user-select: none; }
.optitask-breadcrumb-link { color: #6b7280; text-decoration: none; }
.optitask-breadcrumb-link:hover { color: #111; text-decoration: underline; }
.optitask-breadcrumb-text { color: var(--text-primary); font-weight: 600; }
.optitask-breadcrumb-item.current .optitask-breadcrumb-text { color: #1f2937; }

/* Workspace Switcher */
.workspace-switcher {
    margin-right: 1rem;
}

.workspace-dropdown {
    position: relative;
}

.workspace-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
}

.workspace-trigger:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.workspace-icon {
    font-size: 1rem;
}

.workspace-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-chevron {
    font-size: 0.65rem;
    opacity: 0.7;
}

.workspace-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0.25rem;
}

.workspace-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.workspace-item:hover {
    background: #f3f4f6;
}

.workspace-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 500;
}

.workspace-item.workspace-create {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    color: #3b82f6;
}

.workspace-item.workspace-settings {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Workspace Create & Detail Pages */
.workspace-create-page,
/* Settings Permissions (T074) */
.settings-permissions-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.permissions-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.permissions-matrix-container {
    overflow-x: auto;
}
.permissions-matrix {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.permissions-matrix th,
.permissions-matrix td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.permissions-matrix th {
    background: #f9fafb;
    font-weight: 600;
}
.permissions-matrix td.perm-name {
    font-weight: 500;
}
.permissions-matrix td:not(.perm-name) {
    text-align: center;
}

.workspace-detail-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.workspace-create-subtitle,
.workspace-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #e5e7eb;
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.workspace-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.workspace-tabs .tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.workspace-tabs .tab:hover {
    color: var(--text-primary);
}

.workspace-tabs .tab.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    font-weight: 500;
}

.workspace-settings h2,
.workspace-members h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.workspace-members .btn-primary {
    margin-bottom: 1rem;
}

.members-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.member-name {
    font-weight: 500;
}

.member-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.no-members {
    color: var(--text-secondary);
    font-style: italic;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.modal-content .form-input,
.modal-content textarea.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-confirm {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

.modal-confirm p {
    margin: 0 0 1rem 0;
}

.modal-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.top-row ::deep a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    /* Colonne unique : la barre latérale est .optitask-sidebar en position fixed.
       flex-direction: row + largeur de la sidebar + margin-left sur main provoquait un double décalage
       (zone étroite au centre, vide à droite, double scrollbar). */
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth ::deep a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Chargement");
}

/* User Selection Page */
.user-selection-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

@media (max-width: 639px) {
    .user-selection-page {
        padding: 1rem;
    }
}

.user-selection-subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.user-selection-actions {
    margin-bottom: 1.5rem;
}

.user-selection-actions .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.user-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.user-card-info {
    text-align: center;
}

.user-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.user-card-name {
    font-weight: 600;
    font-size: 1rem;
}

.user-card-role {
    color: #6b7280;
    font-size: 0.875rem;
}

@media (max-width: 639px) {
    .user-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .user-card {
        flex-direction: row;
        justify-content: flex-start;
        padding: 1rem;
        gap: 1rem;
    }

    .user-card-avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .user-card-info {
        text-align: left;
        min-width: 0;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .user-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Clients Page */
.clients-page,
.contracts-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.clients-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.clients-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.clients-subtitle,
.contracts-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

.contracts-filters,
.clients-filters,
.users-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.contracts-filters .filter-select,
.contracts-filters .filter-input,
.clients-filters .filter-select,
.clients-filters .filter-input,
.users-filters .filter-select,
.users-filters .filter-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.contracts-filters .filter-search,
.clients-filters .filter-search,
.users-filters .filter-search {
    min-width: 180px;
}

.users-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.users-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.users-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.users-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.users-table th,
.users-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.users-table th {
    background: #f9fafb;
    font-weight: 600;
}

.users-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
}

.users-empty-state p {
    margin: 0 0 1rem 0;
}

.users-empty {
    padding: 2rem;
    color: #6b7280;
    text-align: center;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.user-detail-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-detail-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    font-weight: 600;
}

.user-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-detail-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-detail-row span {
    font-size: 1rem;
}

.user-detail-color-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.contracts-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.contracts-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.contracts-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
}

.contracts-empty-state p {
    margin: 0 0 1rem 0;
}

.clients-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
}

.clients-empty-state p {
    margin: 0 0 1rem 0;
}

.clients-actions,
.contracts-actions {
    margin-bottom: 1.5rem;
}

.clients-table-container,
.contracts-table-container {
    overflow-x: auto;
}

.clients-table,
.contracts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.clients-table th,
.clients-table td,
.contracts-table th,
.contracts-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.clients-table th,
.contracts-table th {
    background: #f9fafb;
    font-weight: 600;
}

.clients-empty,
.contracts-empty {
    padding: 2rem;
    color: #6b7280;
    text-align: center;
}

.status-draft { background-color: #d1d5db !important; }
.status-published { background-color: #22c55e !important; color: white !important; }
.status-archived { background-color: #6b7280 !important; color: white !important; }
.status-active { background-color: #22c55e !important; color: white !important; }
.status-expired { background-color: #ef4444 !important; color: white !important; }
.status-active { background-color: #22c55e !important; color: white !important; }
.status-expired { background-color: #ef4444 !important; color: white !important; }

.upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.upload-existing {
    margin-bottom: 1rem;
}

.text-danger {
    color: #dc2626;
}

/* Leave Requests Page */
.leave-requests-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.leave-requests-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

.leave-requests-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.leave-requests-actions {
    margin-bottom: 1rem;
}

.leave-requests-table-container {
    overflow-x: auto;
}

.leave-requests-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.leave-requests-table th,
.leave-requests-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.leave-requests-table th {
    background: #f9fafb;
    font-weight: 600;
}

.leave-requests-empty {
    padding: 2rem;
    color: #6b7280;
    text-align: center;
}

.leave-calendar {
    padding: 1rem 0;
}

.leave-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.leave-calendar-item {
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
}

.leave-calendar-user {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.leave-request-detail-page,
.leave-request-edit-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.leave-request-meta {
    color: #666;
    margin-bottom: 1rem;
}

.leave-request-info {
    margin: 1.5rem 0;
}

.leave-request-dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1.5rem;
}

.leave-request-dl dt {
    font-weight: 600;
    color: #374151;
}

.leave-request-dl dd {
    margin: 0;
}

.leave-request-detail-actions {
    margin-top: 1.5rem;
}

.leave-request-form .form-section {
    margin-bottom: 1.5rem;
}

.leave-request-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.leave-request-form .form-group {
    flex: 1;
    min-width: 150px;
}

.leave-request-form .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.leave-calendar-dates {
    font-size: 0.9rem;
    color: #166534;
}

.leave-calendar-empty {
    padding: 2rem;
    color: #6b7280;
    text-align: center;
}

.status-pending { background-color: #fef3c7 !important; color: #92400e !important; }
.status-approved { background-color: #22c55e !important; color: white !important; }
.status-rejected { background-color: #ef4444 !important; color: white !important; }
.status-draft { background-color: #e5e7eb !important; color: #374151 !important; }
.status-submitted { background-color: #dbeafe !important; color: #1d4ed8 !important; }
.status-underreview { background-color: #fef3c7 !important; color: #92400e !important; }
.status-reimbursed { background-color: #22c55e !important; color: white !important; }
.status-cancelled { background-color: #9ca3af !important; color: white !important; }

/* Expenses Page */
.expenses-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.expenses-subtitle { color: #666; margin-bottom: 1.5rem; }
.expenses-actions { margin-bottom: 1rem; }
.expenses-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}
.expenses-filters .filter-select, .expenses-filters .filter-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.expenses-filters .filter-search { min-width: 180px; }
.expenses-table-container { overflow-x: auto; }
.expenses-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.expenses-table th, .expenses-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.expenses-table th { background: #f9fafb; font-weight: 600; }
.expenses-empty { padding: 2rem; color: #6b7280; text-align: center; }
.expenses-pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    justify-content: center;
}
/* Formulaires : conteneur pleine largeur, bloc formulaire lisible */
.expense-form-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.expense-form-page .expense-form {
    max-width: 52rem;
}
.expense-form .form-section { margin-bottom: 2rem; }
.expense-form .form-section h3 { margin-bottom: 1rem; }
.expense-form .form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.expense-form .form-group { flex: 1; min-width: 150px; }
.expense-form .form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.expense-form .form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

/* Interventions (007) */
.interventions-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.interventions-subtitle { color: #666; margin-bottom: 1.5rem; }
.interventions-actions { margin-bottom: 1rem; }
.interventions-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.interventions-filters .filter-select, .interventions-filters .filter-input { padding: 0.4rem 0.6rem; border: 1px solid #d1d5db; border-radius: 6px; }
.interventions-filters .filter-search { min-width: 180px; }
.interventions-table-container { overflow-x: auto; }
.interventions-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.interventions-table th, .interventions-table td { padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.interventions-table th { background: #f9fafb; font-weight: 600; }
.interventions-empty { padding: 2rem; color: #6b7280; text-align: center; }
.interventions-pagination { display: flex; gap: 1rem; align-items: center; padding: 1rem; justify-content: center; }
.intervention-form-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.intervention-form-page .intervention-form {
    max-width: 52rem;
}
.intervention-form .form-section { margin-bottom: 2rem; }
.intervention-form .form-section h3 { margin-bottom: 1rem; }
.intervention-form .form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.intervention-form .form-group { flex: 1; min-width: 150px; }
.intervention-form .form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.intervention-form .form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.intervention-form .checklist-row .flex-grow { flex: 1; }
.intervention-form .material-row .form-control { max-width: 120px; }
.intervention-detail-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.intervention-detail-sections .detail-section { margin-bottom: 1.5rem; padding: 1rem; background: #f9fafb; border-radius: 8px; }
.intervention-detail-sections .detail-section h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.detail-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.intervention-detail-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.intervention-detail-table th, .intervention-detail-table td { padding: 0.4rem 0.75rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.intervention-detail-table th { background: #f3f4f6; font-size: 0.875rem; }
.checklist-detail { list-style: none; padding: 0; margin: 0; }
.checklist-detail li.checked { color: #059669; }
.signature-capture { margin: 0.5rem 0; }
.signature-capture canvas { display: block; background: #fff; }
.signature-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.signature-section .signature-form .form-group { margin-bottom: 1rem; }
.signature-section .form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: white; padding: 1.5rem; border-radius: 8px; width: 100%; max-width: min(420px, 94vw); box-sizing: border-box; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.modal-content h3 { margin: 0 0 0.75rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.875rem; }
.text-muted { color: #6b7280; font-size: 0.875rem; }

.expense-line-editor {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f9fafb;
}
.expense-line-fields { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.expense-line-fields .field { min-width: 120px; }
.expense-line-fields .field label { display: block; font-size: 0.85rem; margin-bottom: 0.2rem; }
.expense-line-fields input, .expense-line-fields select { width: 100%; padding: 0.4rem; }
.expense-line-totals { font-size: 0.9rem; color: #6b7280; margin-top: 0.5rem; }
.expense-total { font-weight: 600; margin: 1rem 0; }
.expense-file-upload { margin: 1rem 0; }
.attachment-list { list-style: none; padding: 0; }
.attachment-list li { margin: 0.25rem 0; }
.expense-detail-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.expense-meta { color: #6b7280; margin-bottom: 1rem; }
.expense-description { margin-bottom: 1rem; }
.expense-history { list-style: none; padding: 0; margin: 0 0 1.5rem; color: #6b7280; font-size: 0.9rem; }
.expense-history li { margin: 0.25rem 0; }
.expense-history .review-comment { font-style: italic; margin-left: 1rem; }
.expense-detail-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.expenses-reports-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.reports-tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.reports-tabs .tab { padding: 0.5rem 1rem; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.reports-tabs .tab:hover { background: #f9fafb; }
.reports-tabs .tab.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.reports-actions { margin-bottom: 1rem; }
.reports-summary { margin-bottom: 1rem; font-size: 1.1rem; }
.text-muted { color: #6b7280; }
.mb-2 { margin-bottom: 0.5rem; }

/* Projects Page */
.projects-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.projects-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.projects-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

@media (max-width: 639px) {
    .projects-page {
        padding: 1rem 0;
    }
}

.projects-subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.project-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.project-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.project-card-stats {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.project-card-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.project-card-progress-bar {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s;
}

.project-card-percent {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3b82f6;
}

@media (max-width: 639px) {
    .project-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .project-card {
        padding: 1rem;
    }

    .project-card-title {
        font-size: 1.1rem;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .project-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Projects tabs & table */
.projects-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.projects-tabs .tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.projects-tabs .tab:hover {
    color: var(--text-primary);
}

.projects-tabs .tab.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    font-weight: 500;
}

.projects-table-container {
    overflow-x: auto;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
}

.projects-table th,
.projects-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.projects-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.project-link {
    font-weight: 500;
    color: #1d4ed8;
    text-decoration: none;
}

.project-link:hover {
    text-decoration: underline;
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #fff;
}

.text-muted {
    color: var(--text-secondary);
}

.btn-link-small {
    font-size: 0.875rem;
    color: #3b82f6;
    text-decoration: none;
}

.btn-link-small:hover {
    text-decoration: underline;
}

/* Projects Kanban */
.projects-kanban {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    min-height: 400px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.projects-kanban .kanban-column {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    scroll-snap-align: start;
}

.projects-kanban .kanban-column-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-top: 3px solid #6b7280;
    border-radius: 2px;
}

.projects-kanban .kanban-column-header-muted {
    border-top-color: #9ca3af;
}

.projects-kanban .kanban-column-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.projects-kanban .kanban-column-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.projects-kanban .kanban-column-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 200px;
}

.projects-kanban .kanban-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.projects-kanban .kanban-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.projects-kanban .kanban-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.projects-kanban .kanban-card-progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.projects-kanban .kanban-card-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.projects-kanban .kanban-card-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.projects-kanban .kanban-empty {
    width: 100%;
    min-height: auto;
}

.projects-kanban .kanban-empty .project-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Project detail */
.project-detail-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.project-detail-header h1 {
    margin-top: 0;
}

.project-detail-desc {
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem 0;
}

.project-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.project-detail-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.project-detail-tabs .tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.project-detail-tabs .tab.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    font-weight: 500;
}

.project-detail-content {
    padding: 1rem 0;
}

/* Task Lists (T066) */
.task-lists-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}
.task-lists-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.task-lists-toolbar input {
    flex: 1;
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.task-lists {
    list-style: none;
    padding: 0;
    margin: 0;
}
.task-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.task-list-item:last-child {
    border-bottom: none;
}
.task-list-name {
    flex: 1;
}
.task-list-actions {
    display: flex;
    gap: 0.25rem;
}
.task-list-actions .btn-link-small {
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
}
.task-lists-empty {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0.5rem 0;
}

/* Board Page (shell : voir groupe .board-page avec .app-page) */
.board-page-title {
    margin: 0.5rem 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

@media (max-width: 639px) {
    .board-page {
        padding: 1rem 0;
    }

    .board-page-title {
        font-size: 1.25rem;
    }
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #3b82f6;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.btn-back {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    min-height: 400px;
}

@media (max-width: 639px) {
    .kanban-board {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 1rem;
        min-height: 70vh;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 0.5rem;
    }

    .kanban-board .kanban-column {
        min-width: 280px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Kanban Board (tâches) - colonnes */
.kanban-board .kanban-column {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 1rem;
    min-height: 300px;
}

.kanban-board .kanban-column-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid #6b7280;
}

.kanban-board .kanban-column-add-task {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background: #e5e7eb;
    border: 1px dashed #9ca3af;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4b5563;
}

.kanban-board .kanban-column-add-task:hover {
    background: #d1d5db;
    color: #374151;
}

.kanban-board .kanban-column-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-board .kanban-column-dropzone {
    min-height: 200px;
}

.kanban-board .kanban-column-empty {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Spinner - RF-011 */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: 120px;
}

.loading-spinner::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* Task Card */
.task-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.task-card:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.task-card-assigned {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.task-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.task-card-description {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

.task-card-assignee {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.task-card-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
}

.task-card-assignee-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card-unassigned {
    font-style: italic;
}

.task-card-comments {
    font-size: 0.75rem;
}

@media (max-width: 639px) {
    .task-card {
        padding: 0.6rem 0.75rem;
    }

    .task-card-title {
        font-size: 0.9rem;
    }

    .task-card-description {
        font-size: 0.75rem;
    }

    .task-card-assignee-name {
        max-width: 60px;
    }
}

/* Blazor.DragDrop - Kanban (T113: animations 60 FPS) */
.plk-dd-inprogess > * {
    pointer-events: none;
}

.plk-dd-dropzone {
    min-height: 80px;
}

.plk-dd-spacing {
    height: 10px;
}

.plk-dd-spacing-dragged-over {
    padding: 15px;
}

.plk-dd-dragged-over {
    background-color: rgba(59, 130, 246, 0.15);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.plk-dd-dragged-over > div {
    background-color: rgba(59, 130, 246, 0.08);
}

.plk-dd-in-transit {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.plk-dd-in-transit > div {
    opacity: 1;
}

/* T112: indicateur visuel colonne au survol */
.kanban-column-drag-over {
    background-color: rgba(59, 130, 246, 0.12) !important;
    border: 2px dashed #3b82f6 !important;
}

/* Toast notifications (T114) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    padding: 1rem 2.5rem 1rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

.toast-success {
    background-color: #10b981;
    color: white;
}

.toast-dismiss {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
}

/* CommentItem & CommentList (US-004) */
.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.comment-item-content {
    flex: 1;
    min-width: 0;
}

.comment-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.comment-item-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-item-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.comment-item-text {
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.comment-list {
    margin-top: 1rem;
}

.comment-list-empty {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9rem;
}

.comment-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-link-small {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.btn-link-small:hover {
    color: #374151;
}

.btn-link-small.btn-primary {
    color: #3b82f6;
}

.btn-link-small.btn-primary:hover {
    color: #2563eb;
}

.btn-link-small.btn-danger {
    color: #ef4444;
}

.btn-link-small.btn-danger:hover {
    color: #dc2626;
}

.btn-primary {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

a.btn-outline-primary,
.btn-outline-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
    background: transparent;
    color: #2563eb;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

a.btn-outline-primary:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-outline-primary.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}

.edit-role-advanced-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-warning {
    padding: 0.5rem 1rem;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-warning:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-item-edit {
    margin-top: 0.5rem;
}

.comment-item-edit-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

.comment-delete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-delete-modal {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
}

.comment-delete-modal p {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.comment-delete-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* TaskDetailModal */
.task-detail-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.task-detail-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

@media (max-width: 639px) {
    .task-detail-modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    .task-detail-modal {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
    }
}

.task-detail-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-detail-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.task-detail-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.task-detail-modal-description {
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

/* Sous-tâches (T070) */
.task-detail-subtasks {
    margin: 0.5rem 0;
}
.subtasks-progress {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.subtasks-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
}
.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}
.subtask-item input[type="checkbox"] {
    cursor: pointer;
}
.subtask-done {
    text-decoration: line-through;
    color: var(--text-secondary);
}
.subtasks-add {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.subtasks-add input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* @mentions autocomplete (T071) */
.mention-autocomplete {
    position: relative;
}
.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.25rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}
.mention-option {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.mention-option:hover {
    background: #f3f4f6;
}
.mention-empty {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.task-detail-modal-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.task-detail-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-close {
    padding: 0.5rem 1rem;
    background: #e5e7eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-close:hover {
    background: #d1d5db;
}

.task-detail-comment-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: #6b7280;
}

.task-detail-modal-fields {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.task-detail-field {
    flex: 1;
}

.task-detail-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.task-detail-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.task-detail-title-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-detail-title-input {
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.task-detail-description-field {
    margin-bottom: 1rem;
}

.task-detail-description-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.task-detail-description-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
}

.task-detail-char-counter {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.task-detail-title-readonly {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.task-detail-description-readonly {
    margin: 0;
    color: #4b5563;
    white-space: pre-wrap;
}

.subtask-check-readonly {
    display: inline-block;
    width: 1.25rem;
    color: #6b7280;
}

.task-detail-comment-add {
    margin-bottom: 1rem;
}

.task-detail-comment-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

.task-detail-comment-add-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* NotificationBell */
.notification-bell {
    position: relative;
    margin-right: 1rem;
}

.notification-bell .btn-notification {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
    position: relative;
}

.notification-bell .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.notification-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
}

.notification-item.unread {
    background: #f0f9ff;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.notification-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.notification-date {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.notification-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Auth pages */
.auth-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.auth-card h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links a + a {
    margin-left: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: auto;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.validation-errors {
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.logout-form {
    display: inline;
    margin-left: 1rem;
}

.btn-logout {
    background: none;
    border: none;
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-logout:hover {
    color: #374151;
}

.user-name {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dashboard-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
    text-align: center;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Todos page (Phase 11) */
.todos-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.todos-page h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}
.todos-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}
.todos-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.todos-actions input {
    flex: 1;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}
.todos-list-container {
    width: 100%;
    max-width: none;
}
.todos-dropzone {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.todo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: grab;
}
.todo-item:active {
    cursor: grabbing;
}
.todo-item.todo-completed .todo-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}
.todo-item input[type="checkbox"] {
    cursor: pointer;
    flex-shrink: 0;
}
.todo-title {
    flex: 1;
    font-size: 0.95rem;
}
.todo-reminder {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.todos-empty {
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Notes page (Phase 11) */
.notes-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.notes-page h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}
.notes-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}
.notes-actions {
    margin-bottom: 1.5rem;
}
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.note-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.note-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.note-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}
.note-card-preview {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.note-card-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.notes-empty {
    color: var(--text-secondary);
    margin-top: 1rem;
}
.note-content-editor {
    width: 100%;
    min-height: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
/* Trix WYSIWYG overrides in modal */
.note-modal trix-editor {
    min-height: 200px;
}

/* Chat page (Phase 12) — hauteur = espace disponible sous en-tête, pas 100vh */
.chat-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.chat-sidebar {
    width: 280px;
    min-width: 0;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    background: #f9fafb;
}
.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.chat-sidebar-header h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}
.chat-sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.btn-small {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}
.chat-channel-list {
    flex: 1;
    overflow-y: auto;
}
.chat-channel-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.15s;
}
.chat-channel-item:hover {
    background: #f3f4f6;
}
.chat-channel-item.active {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}
.chat-channel-name {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
}
.chat-channel-preview {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-empty {
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.chat-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.chat-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.chat-message {
    max-width: 70%;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    align-self: flex-start;
}
.chat-message.own {
    align-self: flex-end;
    background: #eff6ff;
}
.chat-message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.chat-message-body {
    margin: 0.25rem 0 0 0;
    font-size: 0.95rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.chat-message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: block;
}
.chat-attachment {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #3b82f6;
}
.chat-input-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    align-items: center;
}
.chat-file-input {
    display: none;
}
.btn-icon {
    padding: 0.5rem 0.75rem;
    background: #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}
.btn-icon:hover {
    background: #d1d5db;
}
.chat-input {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}
.chat-direct-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.chat-direct-item {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border: none;
    background: #f9fafb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}
.chat-direct-item:hover {
    background: #f3f4f6;
}
.create-group-members {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.create-group-member-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

@media (max-width: 767px) {
    .chat-layout {
        flex-direction: column;
    }
    .chat-sidebar {
        width: 100%;
        max-height: min(42vh, 300px);
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .chat-channel-list {
        max-height: min(36vh, 260px);
    }
    .chat-main {
        min-height: 0;
        flex: 1 1 auto;
    }
}

/* Activity log */
.activity-log-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.activity-log-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
.activity-log-item:last-child {
    border-bottom: none;
}
.activity-log-user {
    font-weight: 600;
    color: #374151;
}
.activity-log-action {
    color: #6b7280;
}
.activity-log-entity {
    color: #9ca3af;
}
.activity-log-time {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-left: auto;
}
.activity-log-empty {
    color: #9ca3af;
    font-style: italic;
    margin: 0.5rem 0;
}

/* Time entry */
.time-entry-add {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.time-entry-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.time-entry-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
.time-entry-note {
    color: #6b7280;
    font-style: italic;
}

/* Calendar */
.calendar-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.calendar-toolbar h2 {
    margin: 0;
    font-size: 1.25rem;
    min-width: 180px;
    text-transform: capitalize;
}
.calendar-toolbar .btn-secondary.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6b7280;
}
.calendar-weekday {
    text-align: center;
    padding: 0.35rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.calendar-day {
    min-height: 90px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.35rem;
    background: #fff;
}
.calendar-day.other-month {
    background: #f9fafb;
    color: #9ca3af;
}
.calendar-day-num {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}
.calendar-task {
    font-size: 0.75rem;
    padding: 0.2rem 0.35rem;
    margin-bottom: 0.2rem;
    border-radius: 3px;
    background: #f3f4f6;
}
.calendar-task-link {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}
.calendar-task-link:hover {
    text-decoration: underline;
}
.calendar-task-project {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
}
.calendar-week-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}
.calendar-week-day {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    min-height: 200px;
}
.calendar-week-day-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    text-transform: capitalize;
}

/* Planning */
.planning-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}
.planning-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.planning-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.planning-nav {
    display: flex;
    gap: 0.25rem;
}
.planning-period-title {
    margin: 0;
    font-size: 1.25rem;
    min-width: 200px;
    text-transform: capitalize;
}
.planning-view-toggle {
    display: flex;
    gap: 0.25rem;
}
.planning-view-toggle .btn-secondary.active,
.planning-nav .btn-secondary.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.planning-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.planning-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.planning-filter select {
    width: auto;
    min-width: 180px;
}
.planning-week-grid {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
}
.planning-grid-header {
    display: grid;
    grid-template-columns: 180px repeat(7, 1fr);
    gap: 2px;
    background: #f3f4f6;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
}
.planning-grid-row {
    display: grid;
    grid-template-columns: 180px repeat(7, 1fr);
    gap: 2px;
    padding: 0.35rem 0.5rem;
    border-top: 1px solid #e5e7eb;
    align-items: center;
}
.planning-cell {
    min-height: 2.5rem;
    padding: 0.25rem 0.5rem;
}
.planning-cell-agent {
    font-weight: 500;
}
.planning-cell-day {
    text-align: center;
    text-transform: capitalize;
}
.planning-cell-shift {
    text-align: center;
}
.shift-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.shift-badge-compact {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    margin: 0.1rem 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
    padding: 0.28rem 0.45rem;
    line-height: 1.2;
}
.shift-badge-title {
    display: block;
    font-weight: 600;
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shift-badge-subtitle {
    display: block;
    font-size: 0.68rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shift-add-btn {
    margin-left: 0.25rem;
    font-weight: 700;
    line-height: 1;
}
.shift-empty {
    color: #9ca3af;
}
.shift-cell-clickable {
    cursor: pointer;
}
.shift-cell-clickable:hover {
    background-color: #f3f4f6;
}
.conflict-indicator, .leave-overlay-indicator {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}
.conflict-badge {
    font-size: 0.75rem;
    color: #b91c1c;
}
.planning-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}
.planning-month-grid {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.planning-month-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #f3f4f6;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
}
.planning-month-weekday {
    text-align: center;
}
.planning-month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 2px;
}
.planning-month-day {
    min-height: 100px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.35rem;
    background: #fff;
}
.planning-month-day.other-month {
    background: #f9fafb;
    color: #9ca3af;
}
.planning-month-day-num {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}
.planning-month-entry {
    font-size: 0.75rem;
    padding: 0.2rem 0.35rem;
    margin-bottom: 0.2rem;
    border-radius: 3px;
    background: #f3f4f6;
}
.planning-me-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.planning-me-day {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}
.planning-me-day-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}
.planning-me-entries {
    list-style: none;
    margin: 0;
    padding: 0;
}
.planning-me-entry {
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.9rem;
}
.planning-me-empty {
    margin: 0;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Gantt chart */
.gantt-container {
    padding: 0.5rem 0;
}
.gantt-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.gantt-toolbar h3 {
    margin: 0;
    font-size: 1rem;
    min-width: 180px;
    text-align: center;
}
.gantt-chart {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
}
.gantt-header {
    display: grid;
    grid-template-columns: 200px 1fr;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.8rem;
}
.gantt-header-task {
    padding: 0.5rem 0.75rem;
    border-right: 1px solid #e5e7eb;
}
.gantt-header-timeline {
    display: flex;
    min-width: 800px;
}
.gantt-header-day {
    flex: 1;
    min-width: 40px;
    padding: 0.5rem 0.25rem;
    text-align: center;
    border-right: 1px solid #e5e7eb;
}
.gantt-body {
    min-width: 800px;
}
.gantt-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid #eee;
    min-height: 36px;
}
.gantt-row:hover {
    background: #f9fafb;
}
.gantt-task-title {
    padding: 0.5rem 0.75rem;
    border-right: 1px solid #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-task-link {
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
}
.gantt-task-link:hover {
    text-decoration: underline;
}
.gantt-timeline {
    position: relative;
    min-height: 36px;
}
.gantt-bar-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 24px;
}
.gantt-bar {
    position: absolute;
    top: 4px;
    height: 20px;
    border-radius: 4px;
    min-width: 4px;
}
.gantt-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

/* Import modal */
.import-modal {
    max-width: 480px;
}
.import-help {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}
.import-file-input {
    margin-bottom: 1rem;
}
.import-result {
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 6px;
    margin-top: 1rem;
}
.import-result.has-errors {
    background: #fef2f2;
}
.import-errors {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: #991b1b;
}
.btn-import {
    margin-left: auto;
}

/* Task recurring config */
.task-detail-recurring {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}
.task-detail-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}
.task-detail-recurring-info {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
}
.task-detail-create-recurring {
    margin-top: 0.5rem;
}
/* Helpdesk — Page Équipes (/helpdesk/teams) */
.helpdesk-teams-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.helpdesk-teams-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.helpdesk-teams-page .page-header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.helpdesk-teams-page .empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.helpdesk-teams-page .empty-state p {
    margin: 0 0 1rem 0;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.team-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.team-icon-name {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.team-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.team-icon-name > div {
    min-width: 0;
}

.team-icon-name h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.team-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.team-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}

.team-badges .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-auto {
    background: #dbeafe;
    color: #1d4ed8;
}

.team-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.team-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.team-stats i {
    opacity: 0.85;
}

.team-members-preview {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.member-avatar.lead-avatar {
    border: 2px solid #f59e0b;
}

.member-avatar.member-more {
    background: #9ca3af;
    font-size: 0.65rem;
}

.team-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.team-actions .btn-link,
.team-actions .btn-link-secondary {
    font-size: 0.9rem;
    text-decoration: none;
}

.team-actions .btn-link {
    color: #3b82f6;
}

.team-actions .btn-link:hover {
    text-decoration: underline;
}

.team-actions .btn-link-secondary {
    color: var(--text-secondary);
}

.team-actions .btn-link-secondary:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.team-actions .btn-danger-link {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
}

.team-actions .btn-danger-link:hover:not(:disabled) {
    text-decoration: underline;
}

.team-actions .btn-danger-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.helpdesk-teams-page .modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.helpdesk-teams-page .modal-box h3 {
    margin: 0 0 1rem 0;
}

.helpdesk-teams-page .modal-box .warning-text {
    color: #b45309;
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem 0;
}

.helpdesk-teams-page .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 639px) {
    .helpdesk-teams-page {
        padding: 1rem 0;
    }
    .teams-grid {
        grid-template-columns: 1fr;
    }
}

/* Helpdesk — Page Dashboard Équipe (/helpdesk/teams/{id}) */
.team-show-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.team-show-page .team-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.team-show-page .team-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.team-show-page .team-title-block {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.team-show-page .team-icon-lg {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.team-show-page .team-title-block h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.team-show-page .team-title-block .text-muted {
    margin: 0;
    font-size: 0.95rem;
}

.team-show-page .team-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.team-show-page .team-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.team-show-page .stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.team-show-page .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1d4ed8;
}

.team-show-page .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.team-show-page .team-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.team-show-page .team-section h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.15rem;
}

.team-show-page .section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-show-page .section-header h2 {
    margin: 0;
}

.team-show-page .empty-state-small {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem 0;
}

.team-show-page .members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* TeamMemberCard (composant sur la page Show) */
.team-member-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.team-member-card.member-unavailable {
    opacity: 0.85;
}

.member-avatar-block {
    position: relative;
    flex-shrink: 0;
}

.member-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.member-avatar-lg.lead-avatar {
    border: 2px solid #f59e0b;
}

.unavailable-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-info .member-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.member-info .member-email {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.member-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.role-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.role-lead {
    background: #dbeafe;
    color: #1d4ed8;
}

.role-agent {
    background: #f3f4f6;
    color: #4b5563;
}

.availability-badge {
    font-size: 0.75rem;
    color: #6b7280;
}

.availability-badge.available {
    color: #16a34a;
}

.member-ticket-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.member-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.member-actions .btn-icon {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    background: #e5e7eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.member-actions .btn-icon:hover {
    background: #d1d5db;
}

.member-actions .btn-icon.btn-warning {
    background: #fef3c7;
    color: #92400e;
}

.member-actions .btn-icon.btn-success {
    background: #d1fae5;
    color: #059669;
}

.member-actions .btn-icon.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.member-actions .btn-icon.btn-danger:hover {
    background: #fecaca;
}

.team-show-page .modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.team-show-page .modal-box h3 {
    margin: 0 0 1rem 0;
}

.team-show-page .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 639px) {
    .team-show-page {
        padding: 1rem 0;
    }
    .team-show-page .team-header {
        flex-direction: column;
    }
    .team-show-page .team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .team-show-page .members-grid {
        grid-template-columns: 1fr;
    }
}

/* Shell pleine largeur : liste tickets + pages migrées */
.app-page,
.tickets-list-page,
.expenses-approvals-page,
.coming-soon-page,
.admin-page,
.settings-general-page,
.swaps-page,
.sec-page,
.smtp-page,
.form-page,
.helpdesk-reports-shell,
.board-page,
.helpdesk-dashboard,
.admin-roles-page,
.admin-permissions-page,
.admin-menus-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--app-page-pad-top) 0 var(--app-page-pad-bottom);
    box-sizing: border-box;
}

.admin-roles-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.admin-roles-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-roles-lead {
    color: var(--text-secondary);
    margin: 0 0 1.25rem 0;
    font-size: 0.95rem;
}

.admin-roles-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.admin-roles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-roles-table th,
.admin-roles-table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.admin-roles-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.8rem;
}

.admin-roles-table tbody tr:hover td {
    background: #fafafa;
}

.admin-roles-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-roles-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.admin-roles-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

/* Admin — Matrice permissions */
.admin-permissions-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-permissions-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.admin-unsaved-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.admin-permissions-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-permissions-toolbar .filter-select,
.admin-permissions-toolbar .filter-input {
    padding: 0.45rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
}

.admin-permissions-toolbar .filter-select {
    min-width: 12rem;
    max-width: 100%;
}

.admin-permissions-toolbar .filter-input {
    min-width: min(100%, 14rem);
    max-width: 20rem;
}

.admin-permissions-matrix-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.admin-permissions-page .admin-permissions-matrix-wrap .permissions-matrix {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}

.admin-permissions-matrix-wrap .permissions-matrix th,
.admin-permissions-matrix-wrap .permissions-matrix td {
    border-bottom: 1px solid #f3f4f6;
}

.admin-permissions-module-row td {
    background: #f3f4f6 !important;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-align: left;
}

/* Première colonne : libellé permission à gauche ; colonnes rôles centrées */
.admin-permissions-matrix-wrap .permissions-matrix thead th:first-child,
.admin-permissions-matrix-wrap .permissions-matrix tbody tr:not(.admin-permissions-module-row) td:first-child {
    text-align: left;
}

.admin-permissions-matrix-wrap .permissions-matrix thead th:not(:first-child),
.admin-permissions-matrix-wrap .permissions-matrix tbody tr:not(.admin-permissions-module-row) td:not(:first-child) {
    text-align: center;
}

.admin-permissions-role-col.is-system {
    background: #f9fafb;
}

.admin-permissions-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.admin-permissions-role-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.admin-permissions-role-actions .btn-link-small {
    padding: 0;
}

/* Admin — Menus par rôle */
.admin-menus-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-menus-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.admin-menus-field {
    margin-bottom: 1.25rem;
    max-width: 24rem;
}

.admin-menus-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.admin-menus-field .filter-select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}

.admin-menus-hint {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.admin-menus-tree {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.admin-menu-tree-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}

.admin-menu-tree-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    cursor: pointer;
}

.admin-menu-tree-row label {
    margin: 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1f2937;
}

.tickets-list-page .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tickets-list-page .page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.ticket-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.ticket-filters .filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.ticket-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticket-filters .filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ticket-filters .filter-group.form-check label {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}

.ticket-filters .form-control-sm {
    min-width: 120px;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
}

.ticket-filters .btn-link-secondary {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.4rem 0;
}

.ticket-filters .btn-link-secondary:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.bulk-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.bulk-actions-bar .form-control-sm {
    width: auto;
    min-width: 180px;
    padding: 0.35rem 0.6rem;
}

.bulk-actions-bar .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.tickets-list-page .empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.tickets-list-page .empty-state p {
    margin: 0 0 0.75rem 0;
}

.tickets-table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table th,
.tickets-table td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.tickets-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tickets-table tbody tr:hover {
    background: #f9fafb;
}

.tickets-table tbody tr.row-selected {
    background: #eff6ff;
}

.tickets-table tbody tr.row-overdue {
    background: #fef2f2;
}

.tickets-table .ticket-number-link {
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
}

.tickets-table .ticket-number-link:hover {
    text-decoration: underline;
}

.tickets-table .ticket-subject-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.tickets-table .ticket-subject-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.tag-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.ticket-tag-mini {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 4px;
}

.ticket-status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.ticket-priority-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #f9fafb;
}

.agent-avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-page {
    padding: 0.4rem 0.75rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
}

.btn-page:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 639px) {
    /* Shell : < 641px les paddings desktop (top-row, article) ne s’appliquent pas — évite contenu collé aux bords */
    .main-content > article.content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .main-content > .top-row {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .app-page,
    .tickets-list-page,
    .helpdesk-dashboard,
    .admin-roles-page,
    .admin-permissions-page,
    .admin-menus-page {
        padding: 1rem 0;
    }
    .chat-page {
        padding: 1rem 0;
    }
    .ticket-filters .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .ticket-filters .form-control-sm {
        min-width: 0;
    }

    .bulk-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .bulk-actions-bar .form-control-sm {
        min-width: 0;
        width: 100%;
        max-width: none;
    }
}

/* Feuilles de temps (010-timesheets) */
.timesheets-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.timesheets-week-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.timesheets-week-label {
    font-weight: 600;
    min-width: 14rem;
    text-align: center;
}
.timesheets-user-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.timesheets-user-filter label {
    font-size: 0.85rem;
    color: #6b7280;
}
.timesheets-summary {
    margin-bottom: 0.75rem;
}

/* Impression — masquer navigation et barre supérieure (Phase 8 organigramme, Phase 9 planning, spec 008) */
@media print {
    .sidebar,
    .optitask-sidebar,
    .optitask-sidebar-overlay,
    .top-row,
    .btn-logout,
    .workspace-switcher,
    .no-print {
        display: none !important;
    }
    .page {
        flex-direction: column !important;
    }
    main, article {
        padding: 0 !important;
    }
    .planning-page {
        padding: 0.5rem !important;
    }
    .planning-week-grid,
    .planning-month-grid {
        break-inside: avoid;
    }
}
