body {
    background: #f3f5f8;
    color: #1e293b;
}

.app-header {
    background: #0f2744;
    box-shadow: 0 1px 0 rgba(15, 39, 68, 0.12);
}

.app-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.35rem 1rem;
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-width: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.5rem;
    margin: 0.35rem 0;
    padding: 0.25rem 0.15rem;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: #fff;
    outline: none;
}

.theme-toggle-track {
    position: relative;
    width: 2.35rem;
    height: 1.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.theme-toggle-thumb {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.16s ease;
}

.theme-toggle.is-on .theme-toggle-track {
    background: #0284c7;
}

.theme-toggle.is-on .theme-toggle-thumb {
    transform: translateX(1.05rem);
}

.auth-user {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.65rem;
    margin: 0.35rem 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.auth-user-out {
    color: #7dd3fc;
    text-decoration: none;
}

.auth-user-out:hover,
.auth-user-out:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.app-nav a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.app-nav a:hover {
    color: #fff;
}

.app-nav a.is-active {
    color: #fff;
    border-bottom-color: #7dd3fc;
}

.app-page {
    padding: 1.5rem 0 2.75rem;
}

.app-title {
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #0f2744;
    margin: 0 0 0.35rem;
}

.app-lead {
    color: #64748b;
    margin-bottom: 1.25rem;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
}

.settings-tabs a {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #d5dde7;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.settings-tabs a:hover {
    border-color: #0f2744;
    color: #0f2744;
}

.settings-tabs a.is-active {
    background: #0f2744;
    border-color: #0f2744;
    color: #fff;
}

.app-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.05);
}

.app-card-body {
    padding: 1.15rem 1.25rem;
}

.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.settings-list {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.settings-row {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f6;
}

.settings-row:last-child {
    border-bottom: 0;
}

.settings-row:hover {
    background: #f8fafc;
}

.settings-row .form-check {
    min-height: 0;
    padding-left: 1.7rem;
    margin: 0;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.money-tag,
.status-tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85em;
    vertical-align: middle;
}

.money-tag {
    background-color: #7dd3fc;
    color: #0c4a6e;
}

.money-tag.pos {
    background-color: #d1fae5;
    color: #065f46;
}

.money-tag.neg {
    background-color: #fee2e2;
    color: #991b1b;
}

.money-tag.used {
    background-color: #e2e8f0;
    color: #475569;
}

.status-tag.ok {
    background-color: #d1fae5;
    color: #065f46;
}

.status-tag.over {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-tag.na {
    background-color: #e2e8f0;
    color: #475569;
}

.po-link {
    color: #0369a1;
    font-weight: 600;
    text-decoration: none;
}

.po-link:hover {
    text-decoration: underline;
}

.watch-col {
    width: 3rem;
    text-align: center;
    vertical-align: middle;
}

.watch-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 999px;
    line-height: 1;
}

.watch-star:hover,
.watch-star:focus-visible {
    color: #0369a1;
    background: #e0f2fe;
    border-color: #7dd3fc;
    outline: none;
}

.watch-star svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.watch-star.is-on {
    color: #fff;
    background: #0284c7;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.watch-star.is-on svg circle {
    fill: currentColor;
}

.watch-star.is-on:hover,
.watch-star.is-on:focus-visible {
    color: #fff;
    background: #0369a1;
    border-color: #0369a1;
}

.watch-star:disabled {
    opacity: 0.55;
    cursor: wait;
}

table.dataTable tbody tr.is-watched {
    background-color: #e8f4fc !important;
}

table.dataTable tbody tr.is-watched td:first-child {
    box-shadow: inset 4px 0 0 #0284c7;
}

.w-100.py-2,
.w-100.py-3 {
    max-width: 100%;
    overflow-x: hidden;
}

.w-100.py-3 {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.05);
}

/* Contenir le contenu dans la largeur de l’écran (cartes, tableaux, formulaires). */
html {
    overflow-x: clip;
}

body {
    max-width: 100%;
}

.app-card,
.app-card-body,
.table-shell {
    min-width: 0;
    max-width: 100%;
}

.app-page {
    min-width: 0;
}

/* Pleine largeur : Bootstrap .container plafonne à 1320px, trop étroit sur 4K. */
.container {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 768px) {
    .container {
        padding-left: 2.25rem;
        padding-right: 2.25rem;
    }
}

@media (min-width: 1200px) {
    .container {
        padding-left: 2.75rem;
        padding-right: 2.75rem;
    }
}

.app-card-body,
.app-lead {
    overflow-wrap: anywhere;
}

.row > * {
    min-width: 0;
}

.form-control,
.form-select {
    min-width: 0;
    max-width: 100%;
}

input[type="date"].form-control {
    width: 100%;
}

.settings-row .btn {
    margin-bottom: 0.25rem;
}

.table-shell {
    overflow-x: hidden;
}

div.dt-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

div.dt-container div.dt-layout-row {
    flex-wrap: wrap;
    max-width: 100%;
}

div.dt-container div.dt-layout-cell {
    min-width: 0;
    max-width: 100%;
}

div.dt-container div.dt-layout-full {
    overflow-x: hidden;
    max-width: 100%;
}

div.dt-container .dt-paging {
    max-width: 100%;
    overflow-x: hidden;
}

div.dt-paging nav {
    flex-wrap: wrap;
}

table.dataTable,
table.dataTable.table,
table.dataTable.no-footer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0;
    table-layout: fixed;
}

table.dataTable thead th,
table.dataTable tbody td {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
    vertical-align: middle;
}

table.dataTable .wrap-text,
table.dataTable .follow-note-col {
    white-space: normal;
    overflow-wrap: break-word;
    min-width: 0;
}

table.dataTable .watch-col,
table.dataTable .follow-check-col {
    width: 2.8rem;
    white-space: nowrap;
}

table.dataTable .col-date { width: 7rem; }
table.dataTable .col-hours { width: 4.6rem; }
table.dataTable .col-taskid { width: 7.2rem; }
table.dataTable .col-status { width: 8.6rem; }
table.dataTable .col-rank { width: 4.2rem; }
table.dataTable .col-drag {
    width: 2.6rem;
    text-align: center;
}

.task-rank-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    color: #475569;
    background: #e2e8f0;
    cursor: grab;
    user-select: none;
}

.task-rank-handle:hover,
.task-rank-handle:focus-visible {
    color: #0f2744;
    background: #cbd5e1;
    outline: none;
}

.task-rank-handle:active {
    cursor: grabbing;
}

.task-rank-grip {
    display: block;
    fill: currentColor;
}

.task-rank-num {
    font-weight: 650;
}

table.dataTable tbody tr.is-rank-dragging {
    opacity: 0.55;
}

table.dataTable tbody tr.is-rank-over {
    box-shadow: inset 0 2px 0 #0284c7;
}
table.dataTable .col-detail { width: 5.2rem; }
table.dataTable .col-money { width: 6.6rem; }
table.dataTable .col-kind { width: 6.4rem; }

table.dataTable th.text-nowrap,
table.dataTable td.text-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 899.98px) {
    table.dataTable,
    table.dataTable.table,
    table.dataTable.no-footer {
        table-layout: auto;
        width: 100% !important;
    }

    table.dataTable thead {
        display: none;
    }

    table.dataTable,
    table.dataTable tbody {
        display: block;
        width: 100% !important;
    }

    table.dataTable tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        column-gap: 0.5rem;
        row-gap: 0.28rem;
        width: 100%;
        padding: 0.65rem 0.1rem;
        border-bottom: 1px solid #e2e8f0;
        background-color: transparent;
    }

    table.dataTable tbody tr:nth-child(even),
    table.dataTable tbody tr.even {
        background-color: #f8fafc;
    }

    table.dataTable tbody tr.is-watched,
    table.dataTable tbody tr.is-followed {
        background-color: #f0f9ff;
    }

    table.dataTable tbody td {
        display: block;
        width: auto !important;
        max-width: none !important;
        padding: 0.05rem 0 !important;
        border: 0 !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        flex: 0 1 auto;
    }

    table.dataTable tbody tr::after {
        content: "";
        flex: 1 0 100%;
        order: 3;
        height: 0;
        pointer-events: none;
    }

    table.dataTable tbody td.watch-col,
    table.dataTable tbody td.follow-check-col,
    table.dataTable tbody td.col-drag {
        flex: 0 0 2.2rem;
        width: 2.2rem !important;
        white-space: nowrap !important;
        order: 1;
    }

    table.dataTable tbody td.col-title {
        flex: 1 1 0;
        min-width: 0;
        font-weight: 600;
        order: 2;
    }

    table.dataTable tbody td.watch-col + td.col-title,
    table.dataTable tbody td.follow-check-col + td.col-title {
        flex: 0 1 auto;
        max-width: 38%;
    }

    table.dataTable tbody td:not(.watch-col):not(.follow-check-col):not(.col-drag):not(.col-title) {
        order: 4;
    }

    table.dataTable tbody td.col-status,
    table.dataTable tbody td.col-rank,
    table.dataTable tbody td.col-date,
    table.dataTable tbody td.col-taskid,
    table.dataTable tbody td.col-hours,
    table.dataTable tbody td.col-money,
    table.dataTable tbody td.col-kind,
    table.dataTable tbody td.col-person,
    table.dataTable tbody td.text-nowrap {
        flex: 0 1 auto;
        white-space: nowrap !important;
        overflow: visible !important;
    }

    table.dataTable tbody td.follow-note-col {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
    }

    table.dataTable tbody td.follow-note-col.is-empty-note {
        display: none;
    }

    table.dataTable tbody td.col-desc {
        flex: 1 1 14rem;
        min-width: 10rem;
        color: #475569;
    }

    table.dataTable tbody td.col-detail {
        flex: 0 0 auto;
        margin-left: 0;
    }

    table.dataTable tbody td.col-date[data-label]::before,
    table.dataTable tbody td.col-hours[data-label]::before,
    table.dataTable tbody td.col-money[data-label]::before,
    table.dataTable tbody td.col-kind[data-label]::before,
    table.dataTable tbody td.col-status[data-label]::before,
    table.dataTable tbody td.col-rank[data-label]::before {
        content: attr(data-label) "\00a0";
        font-size: 0.68rem;
        font-weight: 650;
        color: #64748b;
    }
}

.milestone-chart-box,
canvas {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .app-page {
        padding: 1rem 0 2rem;
    }

    .app-card-body,
    .w-100.py-3 {
        padding: 0.9rem 0.75rem;
    }

    .app-nav a {
        padding: 0.75rem 0.7rem;
        font-size: 0.88rem;
    }

    .theme-toggle {
        margin-left: auto;
        padding-right: 0;
    }

    .settings-row {
        padding: 0.75rem 0.7rem;
    }
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 39, 68, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.app-loading[hidden] {
    display: none !important;
}

.app-loading-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.45rem 1.7rem;
    min-width: 16rem;
    max-width: min(22rem, 92vw);
    text-align: center;
    box-shadow: 0 12px 40px rgba(15, 39, 68, 0.22);
}

.app-loading-spinner {
    width: 2.2rem;
    height: 2.2rem;
    margin: 0 auto 0.9rem;
    border: 3px solid #e2e8f0;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: app-spin 0.7s linear infinite;
}

.app-loading-title {
    font-weight: 650;
    color: #0f2744;
    margin: 0 0 0.25rem;
    font-size: 1.02rem;
}

.app-loading-msg {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    min-height: 1.2em;
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

body.is-app-loading {
    cursor: wait;
}

td .activity-tag {
    margin-left: 0;
}

.activity-tag {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
    color: #fff;
    white-space: nowrap;
}

.activity-tag.hot { background-color: #39ff14; color: #111; }
.activity-tag.fresh { background-color: #198754; }
.activity-tag.warn { background-color: #ffc107; color: #212529; }
.activity-tag.stale { background-color: #6d071a; }
.activity-tag.critical { background-color: #dc3545; }
.activity-tag.na { background-color: #cbd5e1; color: #334155; }
.activity-tag.po-actif { background-color: #198754; }
.activity-tag.po-validation { background-color: #ffc107; color: #212529; }
.activity-tag.po-archive { background-color: #6c757d; }
.activity-tag.po-tag-implantation { background-color: #0ea5e9; color: #0c4a6e; }
.activity-tag.po-tag-support { background-color: #14b8a6; color: #134e4a; }
.activity-tag.po-tag-developpement { background-color: #8b5cf6; color: #fff; }

.dash-section {
    margin-bottom: 1.75rem;
}

.dash-section-title {
    font-size: 1.05rem;
    font-weight: 650;
    color: #0f2744;
    margin: 0 0 0.75rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.dash-card {
    position: relative;
    aspect-ratio: 1;
    min-height: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.05);
    overflow: hidden;
}

.dash-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.dash-card.is-project::before { background: #0f2744; }
.dash-card.is-support::before { background: #0284c7; }
.dash-card.is-forfaitaire::before { background: #7c3aed; }

.dash-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 1rem 0.85rem;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.dash-card-link:hover {
    background: #f8fafc;
}

.dash-kind {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.45rem;
    padding-right: 2.4rem;
}

.dash-client {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-title {
    font-size: 1.02rem;
    font-weight: 650;
    color: #0f2744;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dash-sub {
    font-size: 0.82rem;
    color: #475569;
    margin: 0.25rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-meta {
    margin-top: auto;
    padding-top: 0.6rem;
}

.dash-meta .activity-tag {
    margin-bottom: 0.4rem;
}

.dash-fact {
    font-size: 0.8rem;
    color: #475569;
    margin: 0.15rem 0 0;
}

.dash-card .watch-star {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 1;
}

.dash-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    color: #64748b;
}

.dash-card.is-recent {
    width: min(100%, 26rem);
    max-width: 26rem;
    aspect-ratio: 1;
}

.dash-recent-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.dash-recent-row .dash-card.is-recent {
    width: 100%;
    max-width: none;
}

.dash-recent-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 1rem 0.75rem;
    min-width: 0;
}

.dash-week-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.15rem 0 0.55rem;
}

.dash-week-nav .btn {
    flex: 0 0 auto;
    padding: 0.15rem 0.45rem;
    line-height: 1.2;
    min-width: 2rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.dash-week-label {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f2744;
    text-align: center;
}

.dash-recent-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin: 0.35rem -0.25rem 0;
    padding: 0 0.25rem;
}

.dash-recent-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eef2f6;
    font-size: 0.8rem;
}

.dash-recent-item:last-child {
    border-bottom: 0;
}

.dash-recent-task {
    color: #0f2744;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-recent-task:hover {
    text-decoration: underline;
}

.dash-recent-hours {
    font-weight: 650;
    color: #0f2744;
    white-space: nowrap;
}

.dash-recent-meta {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-request-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.05);
    padding: 0.35rem 1rem 0.55rem;
}

.dash-request-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.75rem;
    padding: 0.65rem 0 0.65rem 0.7rem;
    border-bottom: 1px solid #eef2f6;
    border-left: 3px solid #cbd5e1;
}

.dash-request-item.is-wait-hot {
    border-left-color: #39ff14;
}

.dash-request-item.is-wait-fresh {
    border-left-color: #198754;
}

.dash-request-item.is-wait-warn {
    border-left-color: #ffc107;
}

.dash-request-item.is-wait-critical {
    border-left-color: #dc3545;
}

.dash-request-item.is-wait-na {
    border-left-color: #94a3b8;
}

.dash-request-item:last-child {
    border-bottom: 0;
}

.dash-request-title {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: #0f2744;
    font-weight: 650;
    min-width: 0;
    cursor: pointer;
}

.dash-request-title:hover,
.dash-request-item.is-open .dash-request-title {
    text-decoration: underline;
}

.dash-request-id {
    color: #64748b;
    font-weight: 700;
}

.dash-request-flags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.28rem;
}

.dash-request-age {
    font-size: 0.75rem;
}

.dash-request-priority {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #0f2744;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
}

.dash-request-meta {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 0.8rem;
}

.dash-request-due.is-overdue {
    color: #b91c1c;
    font-weight: 650;
}

.dash-request-body {
    grid-column: 1 / -1;
    margin-top: 0.35rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.dash-request-desc {
    margin: 0;
    white-space: pre-wrap;
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 767.98px) {
    .dash-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .dash-card-link {
        padding: 0.8rem 0.75rem 0.7rem;
    }

    .dash-title {
        font-size: 0.92rem;
        -webkit-line-clamp: 2;
    }

    .dash-card.is-recent {
        max-width: none;
        width: 100%;
    }
}

.follow-kind {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    white-space: nowrap;
}

.follow-kind.is-project { background: #0f2744; color: #fff; }
.follow-kind.is-support { background: #0369a1; color: #fff; }
.follow-kind.is-forfaitaire { background: #7c3aed; color: #fff; }

.follow-check-col {
    width: 2.6rem;
    text-align: center;
    vertical-align: middle;
}

#table tbody tr.is-followed {
    background: #f0f9ff;
}

.follow-note {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    font-size: 0.85rem;
}

.follow-note-col {
    min-width: 0;
    max-width: none;
    white-space: normal;
}

.follow-note-slot {
    cursor: pointer;
    display: inline-block;
    min-width: 7rem;
    max-width: 100%;
}

.follow-note-add {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.follow-note-add:hover,
.follow-note-add:focus-visible {
    color: #0f2744;
}

.follow-note-tag {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0.12rem 0.28rem 0.12rem 0.5rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    vertical-align: middle;
}

.follow-note-tag .follow-note-text {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.follow-note-clear,
.hour-adjust-note-clear {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
    opacity: 0.7;
}

.follow-note-clear:hover,
.follow-note-clear:focus-visible,
.hour-adjust-note-clear:hover,
.hour-adjust-note-clear:focus-visible {
    opacity: 1;
}

.follow-note-edit {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.follow-note-edit .follow-note {
    flex: 1 1 auto;
}

.adjust-note-edit {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.adjust-note-edit .hour-adjust-note {
    flex: 1 1 auto;
}

.hour-adjust-block {
    max-width: 64rem;
}

.hour-adjust-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.hour-adjust-box {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hour-adjust-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
}

.hour-adjust-line .hour-adjust-line-date,
.hour-adjust-head .hour-adjust-line-date {
    flex: 0 0 10.5rem;
    width: 10.5rem;
    max-width: 10.5rem;
}

.hour-adjust-line .hour-adjust-line-hours,
.hour-adjust-head .hour-adjust-line-hours {
    flex: 0 0 7.5rem;
    width: 7.5rem;
    max-width: 7.5rem;
}

.hour-adjust-head .hour-adjust-line-note {
    flex: 1 1 auto;
    min-width: 0;
}

.hour-adjust-head-end {
    flex: 0 0 5.5rem;
    width: 5.5rem;
}

.hour-adjust-line .hour-adjust-line-note {
    flex: 1 1 auto;
    min-width: 0;
}

.hour-adjust-line .hour-adjust-line-add {
    flex: 0 0 auto;
}

.hour-adjust-line .hour-adjust-line-del {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe3ee;
    border-radius: 0.375rem;
    background: #f8fafc;
    color: #64748b;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
    opacity: 1;
}

.hour-adjust-line .hour-adjust-line-del:hover,
.hour-adjust-line .hour-adjust-line-del:focus-visible {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
    opacity: 1;
}

.adjust-comment-tag {
    display: inline-block;
    max-width: 36rem;
    margin-left: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
    white-space: normal;
    vertical-align: middle;
}

.follow-note-slot:empty {
    display: none;
}

.dash-recent-item .follow-note-slot,
.dash-recent-item .follow-note-tag {
    grid-column: 1 / -1;
    max-width: 100%;
    margin-top: 0.05rem;
}

.task-id-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.task-follow-wrap {
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.task-follow-check {
    cursor: pointer;
    margin: 0;
}

.dash-recent-item.is-followed {
    background: #f0f9ff;
    margin: 0 -0.35rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    border-radius: 6px;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: #0b1220;
    color: #e2e8f0;
}

html[data-theme="dark"] .app-header {
    background: #07101d;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .app-title,
html[data-theme="dark"] .dash-section-title,
html[data-theme="dark"] .dash-title,
html[data-theme="dark"] .dash-week-label,
html[data-theme="dark"] .dash-recent-task,
html[data-theme="dark"] .dash-request-title,
html[data-theme="dark"] .dash-request-priority,
html[data-theme="dark"] .dash-recent-hours,
html[data-theme="dark"] .app-loading-title,
html[data-theme="dark"] .h6,
html[data-theme="dark"] h2 {
    color: #f1f5f9;
}

html[data-theme="dark"] .app-lead,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .dash-kind,
html[data-theme="dark"] .dash-client,
html[data-theme="dark"] .dash-recent-meta,
html[data-theme="dark"] .dash-request-meta,
html[data-theme="dark"] .dash-request-id,
html[data-theme="dark"] .app-loading-msg {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .form-label,
html[data-theme="dark"] .dash-sub,
html[data-theme="dark"] .dash-fact,
html[data-theme="dark"] table.dataTable tbody td.col-desc {
    color: #cbd5e1;
}

html[data-theme="dark"] a {
    color: #7dd3fc;
}

html[data-theme="dark"] a:hover {
    color: #bae6fd;
}

html[data-theme="dark"] .app-card,
html[data-theme="dark"] .settings-list,
html[data-theme="dark"] .w-100.py-3,
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .dash-request-panel,
html[data-theme="dark"] .dash-empty,
html[data-theme="dark"] .app-loading-card {
    background: #152033;
    border-color: #2a3a52;
    box-shadow: none;
}

html[data-theme="dark"] .dash-empty {
    border-style: dashed;
}

html[data-theme="dark"] .settings-row {
    border-bottom-color: #243247;
}

html[data-theme="dark"] .settings-row:hover,
html[data-theme="dark"] .dash-card-link:hover {
    background: #1b2a40;
}

html[data-theme="dark"] .settings-tabs a {
    background: #152033;
    border-color: #2a3a52;
    color: #e2e8f0;
}

html[data-theme="dark"] .settings-tabs a:hover {
    border-color: #7dd3fc;
    color: #7dd3fc;
}

html[data-theme="dark"] .settings-tabs a.is-active {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #0b1220;
    border-color: #3d4f68;
    color: #e2e8f0;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(125, 211, 252, 0.2);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-primary {
    color: #e2e8f0;
    border-color: #3d4f68;
}

html[data-theme="dark"] .btn-outline-primary {
    color: #7dd3fc;
    border-color: #0284c7;
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-primary:hover {
    color: #fff;
    background: #0284c7;
    border-color: #0284c7;
}

html[data-theme="dark"] .btn-outline-danger {
    color: #fca5a5;
    border-color: #7f1d1d;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] table.dataTable,
html[data-theme="dark"] table.dataTable.table,
html[data-theme="dark"] .table > :not(caption) > * > * {
    color: #e2e8f0;
    background-color: transparent;
    border-color: #243247;
}

html[data-theme="dark"] table.dataTable thead th,
html[data-theme="dark"] .table thead th {
    color: #f1f5f9;
    border-bottom-color: #3d4f68;
}

html[data-theme="dark"] table.dataTable tbody tr.odd,
html[data-theme="dark"] table.dataTable tbody tr.even,
html[data-theme="dark"] table.dataTable.stripe tbody tr.odd > .sorting_1,
html[data-theme="dark"] table.dataTable.stripe tbody tr.even > .sorting_1 {
    background-color: transparent !important;
}

html[data-theme="dark"] table.dataTable.hover tbody tr:hover,
html[data-theme="dark"] table.dataTable tbody tr:hover {
    background-color: #1b2a40 !important;
}

html[data-theme="dark"] table.dataTable tbody tr.is-watched,
html[data-theme="dark"] #table tbody tr.is-followed,
html[data-theme="dark"] .dash-recent-item.is-followed {
    background-color: #16324a !important;
}

html[data-theme="dark"] .dash-recent-item,
html[data-theme="dark"] .dash-request-item {
    border-bottom-color: #243247;
}

html[data-theme="dark"] .dash-request-item.is-wait-na {
    border-left-color: #64748b;
}

html[data-theme="dark"] .activity-tag.na {
    background-color: #243247;
    color: #cbd5e1;
}

html[data-theme="dark"] .activity-tag.po-tag-implantation {
    background-color: #0369a1;
    color: #e0f2fe;
}

html[data-theme="dark"] .activity-tag.po-tag-support {
    background-color: #0f766e;
    color: #ccfbf1;
}

html[data-theme="dark"] .activity-tag.po-tag-developpement {
    background-color: #6d28d9;
    color: #f3e8ff;
}

html[data-theme="dark"] .dash-request-priority {
    background: #243247;
    color: #e2e8f0;
}

html[data-theme="dark"] .dash-request-due.is-overdue {
    color: #fca5a5;
}

html[data-theme="dark"] .dash-request-body {
    background: #1b2a40;
}

html[data-theme="dark"] .dash-request-desc {
    color: #cbd5e1;
}

html[data-theme="dark"] .status-tag.na {
    background-color: #243247;
    color: #cbd5e1;
}

html[data-theme="dark"] .money-tag {
    background-color: #0c4a6e;
    color: #e0f2fe;
}

html[data-theme="dark"] .money-tag.pos {
    background-color: #064e3b;
    color: #a7f3d0;
}

html[data-theme="dark"] .money-tag.neg {
    background-color: #7f1d1d;
    color: #fecaca;
}

html[data-theme="dark"] .money-tag.used {
    background-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .status-tag.ok {
    background-color: #064e3b;
    color: #a7f3d0;
}

html[data-theme="dark"] .status-tag.over {
    background-color: #7f1d1d;
    color: #fecaca;
}

html[data-theme="dark"] .watch-star {
    background: #0b1220;
    border-color: #3d4f68;
    color: #94a3b8;
}

html[data-theme="dark"] .watch-star:hover,
html[data-theme="dark"] .watch-star:focus-visible {
    color: #7dd3fc;
    background: #16324a;
    border-color: #0284c7;
}

html[data-theme="dark"] .follow-kind {
    background: #243247;
    color: #cbd5e1;
}

html[data-theme="dark"] .hour-adjust-head {
    color: #94a3b8;
}

html[data-theme="dark"] .hour-adjust-line .hour-adjust-line-del {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .hour-adjust-line .hour-adjust-line-del:hover,
html[data-theme="dark"] .hour-adjust-line .hour-adjust-line-del:focus-visible {
    color: #fecaca;
    background: #7f1d1d;
    border-color: #991b1b;
}

html[data-theme="dark"] .task-rank-handle {
    color: #cbd5e1;
    background: #243247;
}

html[data-theme="dark"] .task-rank-handle:hover,
html[data-theme="dark"] .task-rank-handle:focus-visible {
    color: #f1f5f9;
    background: #334155;
}

html[data-theme="dark"] table.dataTable tbody tr.is-rank-over {
    box-shadow: inset 0 2px 0 #7dd3fc;
}

html[data-theme="dark"] .follow-note-add {
    color: #94a3b8;
}

html[data-theme="dark"] .follow-note-add:hover,
html[data-theme="dark"] .follow-note-add:focus-visible {
    color: #e2e8f0;
}

html[data-theme="dark"] .follow-note-tag,
html[data-theme="dark"] .adjust-comment-tag {
    background: #3b2410;
    color: #fdba74;
    border-color: #9a3412;
}

html[data-theme="dark"] .app-loading {
    background: rgba(7, 16, 29, 0.72);
}

html[data-theme="dark"] .app-loading-spinner {
    border-color: #334155;
    border-top-color: #7dd3fc;
}

html[data-theme="dark"] .alert-danger {
    background: #3f1d1d;
    border-color: #7f1d1d;
    color: #fecaca;
}

html[data-theme="dark"] .alert-success {
    background: #14532d;
    border-color: #166534;
    color: #bbf7d0;
}

html[data-theme="dark"] .form-control-plaintext {
    color: #e2e8f0;
}

html[data-theme="dark"] div.dt-container .dt-search input,
html[data-theme="dark"] div.dt-container .dt-input {
    background-color: #0b1220;
    border-color: #3d4f68;
    color: #e2e8f0;
}

html[data-theme="dark"] div.dt-container .dt-paging .dt-paging-button {
    background: #152033 !important;
    color: #e2e8f0 !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] div.dt-container .dt-paging .dt-paging-button.current {
    background: #0284c7 !important;
    color: #fff !important;
    border-color: #0284c7 !important;
}

html[data-theme="dark"] .modal-content {
    background: #152033;
    color: #e2e8f0;
    border-color: #2a3a52;
}

@media (max-width: 899.98px) {
    html[data-theme="dark"] table.dataTable tbody tr {
        border-bottom-color: #243247;
    }

    html[data-theme="dark"] table.dataTable tbody tr:nth-child(even),
    html[data-theme="dark"] table.dataTable tbody tr.even {
        background-color: #122033;
    }

    html[data-theme="dark"] table.dataTable tbody tr.is-watched,
    html[data-theme="dark"] table.dataTable tbody tr.is-followed {
        background-color: #16324a;
    }

    html[data-theme="dark"] table.dataTable tbody td.col-date[data-label]::before,
    html[data-theme="dark"] table.dataTable tbody td.col-hours[data-label]::before,
    html[data-theme="dark"] table.dataTable tbody td.col-money[data-label]::before,
    html[data-theme="dark"] table.dataTable tbody td.col-kind[data-label]::before,
    html[data-theme="dark"] table.dataTable tbody td.col-status[data-label]::before,
    html[data-theme="dark"] table.dataTable tbody td.col-rank[data-label]::before {
        color: #94a3b8;
    }
}

.status-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.status-filter {
    cursor: pointer;
    margin: 0 0.5rem 0.5rem 0;
    opacity: 0.4;
}

.status-filter input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.status-filter.is-on {
    opacity: 1;
}

.status-filter.is-on .activity-tag {
    box-shadow: 0 0 0 2px #212529;
}

.status-filters.is-idle .status-filter {
    opacity: 1;
}

.status-filters.is-idle .status-filter .activity-tag {
    box-shadow: none;
}

html[data-theme="dark"] .status-filter.is-on .activity-tag {
    box-shadow: 0 0 0 2px #e2e8f0;
}

html[data-readonly="1"] .js-write {
    display: none !important;
}

html[data-readonly="1"] .hour-adjust-block,
html[data-readonly="1"] .watch-star,
html[data-readonly="1"] .task-follow-check,
html[data-readonly="1"] .follow-note-clear,
html[data-readonly="1"] .hour-adjust-line-add,
html[data-readonly="1"] .hour-adjust-line-del {
    pointer-events: none;
    opacity: 0.55;
}

.po-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.1rem;
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}

.po-totals-item {
    min-width: 7.5rem;
}

.po-totals-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.po-link-label {
    font-weight: 700;
    margin-right: 0.35rem;
}

.po-link-pill {
    margin: 0.15rem 0.25rem 0.15rem 0;
    text-decoration: none;
}

a.po-link-pill:hover {
    filter: brightness(0.95);
}

.po-alert-section .po-alert-group {
    margin: 0 0 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.po-alert-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    padding: 0.42rem 0.7rem 0.42rem 0.55rem;
    border: 0;
    border-left: 4px solid #94a3b8;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.po-alert-toggle:hover,
.po-alert-toggle:focus-visible {
    background: #f8fafc;
}

.po-alert-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.po-alert-count {
    font-weight: 500;
    color: #64748b;
}

.po-alert-chevron {
    flex: 0 0 auto;
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.55;
    transition: transform 0.15s ease;
}

.po-alert-toggle:not(.collapsed) .po-alert-chevron {
    transform: rotate(45deg);
}

.po-alert-body {
    padding: 0 0.7rem 0.5rem 0.95rem;
}

.po-alert-list {
    margin: 0;
    padding-left: 1.15rem;
}

.po-alert-list li {
    margin: 0.15rem 0;
}

.po-alert-over .po-alert-toggle { border-left-color: #e11d48; }
.po-alert-over .po-alert-title { color: #9f1239; }
.po-alert-low .po-alert-toggle { border-left-color: #f59e0b; }
.po-alert-low .po-alert-title { color: #b45309; }
.po-alert-validation .po-alert-toggle { border-left-color: #f59e0b; }
.po-alert-validation .po-alert-title { color: #92400e; }
.po-alert-ending .po-alert-toggle { border-left-color: #0284c7; }
.po-alert-ending .po-alert-title { color: #0369a1; }
.po-alert-healthy .po-alert-toggle { border-left-color: #198754; }
.po-alert-healthy .po-alert-title { color: #146c43; }
.po-alert-invoice .po-alert-toggle { border-left-color: #7c3aed; }
.po-alert-invoice .po-alert-title { color: #5b21b6; }

html[data-theme="dark"] .po-alert-section .po-alert-group {
    background: #132033;
    border-color: #3d4f68;
}

html[data-theme="dark"] .po-alert-toggle:hover,
html[data-theme="dark"] .po-alert-toggle:focus-visible {
    background: #1a2b40;
}

html[data-theme="dark"] .po-alert-count {
    color: #94a3b8;
}

html[data-theme="dark"] .po-alert-over .po-alert-title { color: #fb7185; }
html[data-theme="dark"] .po-alert-low .po-alert-title { color: #fbbf24; }
html[data-theme="dark"] .po-alert-validation .po-alert-title { color: #fbbf24; }
html[data-theme="dark"] .po-alert-ending .po-alert-title { color: #7dd3fc; }
html[data-theme="dark"] .po-alert-healthy .po-alert-title { color: #4ade80; }
html[data-theme="dark"] .po-alert-invoice .po-alert-title { color: #c4b5fd; }

html[data-theme="dark"] .po-totals {
    background: #132033;
    border-color: #3d4f68;
}

html[data-theme="dark"] .po-totals-label {
    color: #94a3b8;
}
