/* Surcouche Pilotage au-dessus du thème AdminKit */

:root {
    --pilotage-primary: #3b7ddd;
}

body {
    font-family: "Inter", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.content {
    padding: 1.5rem 1.5rem 0.75rem;
}

.page-header {
    margin-bottom: 1.15rem;
    padding-bottom: 0;
    border-bottom: 0;
}

.page-subtitle,
.text-gray-600 {
    color: #6c757d !important;
}

.content h1.h3 {
    font-weight: 600;
    color: #212529;
}

.card {
    border: 0;
    box-shadow: 0 .1rem .2rem rgba(0,0,0,.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #edf2f9;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: .78rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #6c757d;
}

.table td,
.table th {
    padding: .75rem .9rem;
}

.form-label {
    font-size: .82rem;
    color: #6c757d;
    margin-bottom: .35rem;
}

.btn:focus-visible,
.sidebar-link:focus-visible,
a[title="Ouvrir le lien officiel"]:focus-visible {
    outline: 2px solid var(--pilotage-primary);
    outline-offset: 2px;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 125, 221, 0.25);
}

.pilotage-fieldset {
    border: 1px solid #c6d4ea;
    border-radius: 0.6rem;
    padding: 0.95rem 0.95rem 0.75rem;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pilotage-fieldset__legend {
    float: none;
    width: auto;
    margin-bottom: 0.35rem;
    padding: 0 0.25rem;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #2f4f7f;
    font-weight: 700;
}

.pilotage-fieldset .form-control-plaintext {
    min-height: 2.3rem;
    padding: 0.35rem 0;
    color: #243b63;
    font-weight: 600;
}

.pilotage-required-marker {
    color: #dc3545;
    font-weight: 700;
}

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

.user-form-fieldset-card {
    margin: 0;
    height: 100%;
}

.user-form-fieldset-card .form-label {
    color: #4a5d79;
    font-weight: 600;
}

.user-form-fieldset-card .form-text {
    color: #5a6c86;
}

.user-form-fieldset-card .form-control,
.user-form-fieldset-card .form-select,
.user-form-fieldset-card .pilotage-tags-select {
    border-color: #b9c9e1;
}

@media (min-width: 992px) {
    .user-form-fieldset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.table td,
.table th {
    vertical-align: middle;
}

.table-sb {
    margin-bottom: 0;
}

.table-sb thead th {
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.03em;
    color: #6c757d;
    background: #f9fbfd;
}

.table-sb tbody tr {
    transition: background-color 0.15s ease-in-out;
}

.table-sb.table-hover tbody tr:hover {
    background-color: rgba(59, 125, 221, 0.06);
}

.table-sb .btn {
    min-width: 74px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.status-draft {
    background: #edf1f7;
    color: #6c757d;
}

.status-in-progress {
    background: rgba(59, 125, 221, 0.12);
    color: #2f64b1;
}

.status-on-hold {
    background: rgba(252, 185, 44, 0.18);
    color: #9b6f07;
}

.status-closed {
    background: rgba(28, 187, 140, 0.16);
    color: #118a67;
}

.project-tabs .nav-link {
    font-weight: 600;
    color: #6c757d;
    border-radius: 0.2rem;
}

.project-tabs {
    row-gap: 0.4rem;
}

.project-tabs .nav-link.active {
    color: #fff;
    background-color: var(--pilotage-primary);
}

.pilotage-tags-select {
    position: relative;
    min-height: 2.5rem;
    border: 1px solid #d4deee;
    border-radius: 0.4rem;
    background: #fff;
    padding: 0.38rem 0.45rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.pilotage-tags-select:focus-within {
    border-color: #3b7ddd;
    box-shadow: 0 0 0 0.2rem rgba(59, 125, 221, 0.15);
}

.pilotage-tags-select__tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.pilotage-tags-select__tag {
    border: 1px solid #c6d6f4;
    background: #eef4ff;
    color: #24426e;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pilotage-tags-select__tag i {
    font-size: 0.92rem;
}

.pilotage-tags-select__input {
    border: 0;
    min-width: 12rem;
    flex: 1 1 12rem;
    outline: none;
    padding: 0.15rem;
    font-size: 0.92rem;
    background: transparent;
}

.pilotage-tags-select__menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 40;
    background: #fff;
    border: 1px solid #d4deee;
    border-radius: 0.45rem;
    box-shadow: 0 0.55rem 1.15rem rgba(31, 53, 88, 0.16);
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.3rem;
}

.pilotage-tags-select__menu.is-open {
    display: block;
}

.pilotage-tags-select__option {
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    padding: 0.42rem 0.48rem;
    color: #2a3f62;
    font-size: 0.9rem;
}

.pilotage-tags-select__option:hover,
.pilotage-tags-select__option:focus-visible {
    background: #eef4ff;
    outline: none;
}

.pilotage-tags-select__empty {
    padding: 0.45rem 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.sidebar-toggle.js-sidebar-toggle {
    background: transparent;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0;
    margin-left: 0.15rem;
}

.sidebar-toggle.js-sidebar-toggle:focus-visible {
    outline: 2px solid var(--pilotage-primary);
    outline-offset: 2px;
}

.sidebar .sidebar-link .bi {
    width: 1rem;
    text-align: center;
}

.sidebar-cta {
    padding: 1rem;
}

.sidebar-cta-content {
    background: rgba(59, 125, 221, 0.08);
    border: 1px solid rgba(59, 125, 221, 0.2);
    border-radius: 0.375rem;
    padding: 1rem;
}

.sidebar {
    transition: margin-left .22s ease-in-out;
}

body.sidebar-collapsed .sidebar {
    margin-left: -260px;
}

body.sidebar-collapsed .sidebar-toggle.js-sidebar-toggle {
    margin-left: 0;
}

.navbar .nav-icon {
    color: #6c757d;
    padding: .6rem;
}

.navbar .nav-icon .indicator {
    top: .3rem;
    right: .2rem;
}

.navbar .avatar {
    width: 36px;
    height: 36px;
    object-fit: cover;
}

.stat {
    align-items: center;
    background: rgba(59, 125, 221, 0.12);
    border-radius: 50%;
    color: var(--pilotage-primary);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.chart.chart-sm {
    height: 220px;
}

.dashboard-movement-card .chart.chart-sm {
    min-height: 252px;
}

.map-placeholder {
    position: relative;
    height: 220px;
    border-radius: .35rem;
    background:
        radial-gradient(circle at 50% 50%, rgba(59,125,221,.22) 0, rgba(59,125,221,.08) 18%, rgba(59,125,221,.02) 36%, transparent 38%),
        linear-gradient(180deg, #f8f9fb 0%, #eef2f7 100%);
    border: 1px solid #edf2f9;
    overflow: hidden;
}

.map-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(transparent 95%, rgba(0, 0, 0, 0.04) 95%), linear-gradient(90deg, transparent 95%, rgba(0, 0, 0, 0.04) 95%);
    background-size: 38px 38px;
}

.map-dot {
    position: absolute;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 11px;
    background: #3b7ddd;
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(59,125,221,.18);
}

#ajax-form-feedback .list-group-item,
#ajax-form-feedback .alert {
    border-radius: 0.25rem;
}

.sidebar-brand {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-shell {
    min-height: calc(100vh - 170px);
}

.auth-shell--modern {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0;
}

.auth-panel {
    width: min(880px, calc(100vw - 2rem));
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(360px, 1.05fr);
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1rem 2.6rem rgba(25, 45, 75, 0.18);
    margin: 0 auto;
}

.auth-panel__aside {
    background: linear-gradient(145deg, #2f64b1 0%, #3b7ddd 55%, #5a9fff 100%);
    color: #ffffff;
    padding: 2.35rem 1.9rem;
    display: flex;
    align-items: center;
}

.auth-brand {
    max-width: 30ch;
}

.auth-brand__logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.auth-panel__form {
    background: #fff;
    padding: 2.1rem 1.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-title {
    font-weight: 700;
    color: #1f3558;
    margin-bottom: 1.1rem;
}

.auth-form {
    max-width: 430px;
}

.auth-form .form-control {
    border-color: #c8d5eb;
}

a[title="Ouvrir le lien officiel"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.2rem;
    transition: all 0.15s ease;
}

a[title="Ouvrir le lien officiel"]:hover {
    background: rgba(59, 125, 221, 0.1);
    transform: translateY(-1px);
}

@media (max-width: 991.98px) {
    .content {
        padding: 1rem .9rem .5rem;
    }

    .page-header {
        margin-bottom: 1rem !important;
    }

    .auth-shell {
        min-height: 0;
    }

    .auth-panel {
        grid-template-columns: 1fr;
        width: min(560px, calc(100vw - 1rem));
    }

    .auth-panel__aside {
        padding: 1.35rem 1.2rem;
    }

    .auth-panel__form {
        padding: 1.4rem 1.15rem;
    }

    body.sidebar-collapsed .sidebar {
        margin-left: -14rem;
    }
}

.pilotage-toast-container {
    position: fixed;
    top: 1.1rem;
    right: 1rem;
    z-index: 1095;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(92vw, 380px);
    pointer-events: none;
}

.pilotage-toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid #d7def2;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.65rem 1.3rem rgba(17, 36, 68, 0.14);
    color: #243b63;
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
}

.pilotage-toast.is-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.pilotage-toast__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(59, 125, 221, 0.16);
    color: #2f64b1;
}

.pilotage-toast__content {
    font-size: 0.89rem;
    line-height: 1.3;
}

.pilotage-toast__close {
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pilotage-toast__close:hover,
.pilotage-toast__close:focus-visible {
    background: rgba(108, 117, 125, 0.12);
    color: #344767;
    outline: none;
}

.pilotage-toast-success .pilotage-toast__icon {
    background: rgba(28, 187, 140, 0.18);
    color: #118a67;
}

.pilotage-toast-danger .pilotage-toast__icon {
    background: rgba(220, 53, 69, 0.17);
    color: #b11d2f;
}

.pilotage-toast-warning .pilotage-toast__icon {
    background: rgba(252, 185, 44, 0.24);
    color: #8f6407;
}

.project-detail-actions .btn {
    min-width: 172px;
}

.project-detail-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
}

.project-detail-tabs .nav-item {
    flex: 0 0 auto;
}

.project-detail-tabs .nav-link {
    white-space: nowrap;
}

.project-detail-tab-pane {
    animation: fade-in-soft 0.18s ease-out;
}

@keyframes fade-in-soft {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.project-kpi-card {
    background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
    border: 1px solid #e7eef9;
    border-radius: 0.65rem;
    padding: 0.8rem 0.9rem;
}

.project-kpi-label {
    margin: 0;
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.project-kpi-value {
    margin: 0.2rem 0 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f3558;
}

.project-detail-section-card .card-body {
    padding: 1rem 1.05rem;
}

.project-detail-kv {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.project-detail-kv > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dashed #e8edf7;
    padding-bottom: 0.3rem;
}

.project-detail-kv dt {
    margin: 0;
    color: #6c757d;
    font-size: 0.83rem;
    font-weight: 600;
}

.project-detail-kv dd {
    margin: 0;
    font-weight: 600;
    color: #243b63;
    text-align: right;
}

.project-detail-list {
    margin: 0;
    padding-left: 1.1rem;
}

.project-detail-list li {
    margin-bottom: 0.35rem;
}

.workflow-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workflow-step {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 0.85rem;
}

.workflow-step::before {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.34rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    border: 2px solid #cfd8eb;
    background: #fff;
}

.workflow-step::after {
    content: "";
    position: absolute;
    left: 0.63rem;
    top: 1.15rem;
    width: 2px;
    bottom: 0.1rem;
    background: #e2e8f5;
}

.workflow-step:last-child {
    padding-bottom: 0;
}

.workflow-step:last-child::after {
    display: none;
}

.workflow-step.is-done::before {
    border-color: #118a67;
    background: #1cbb8c;
    box-shadow: inset 0 0 0 2px #fff;
}

.workflow-step.is-done::after {
    background: #9ddac8;
}

.workflow-timeline-readonly .workflow-step span {
    display: inline-block;
    color: #3d4a5f;
}

.workflow-timeline-editable .workflow-step-label {
    display: none;
}

.workflow-timeline-editable .workflow-step-button {
    width: min(420px, 100%);
    border: 1px solid #dbe3f2;
    border-radius: 0.6rem;
    background: #f9fbff;
    padding: 0.48rem 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
}

.workflow-timeline-editable .workflow-step-button:hover,
.workflow-timeline-editable .workflow-step-button:focus-visible {
    border-color: #3b7ddd;
    background: #eef4ff;
    outline: none;
}

.workflow-timeline-editable .workflow-step-title {
    color: #3d4a5f;
    font-weight: 600;
}

.workflow-timeline-editable .workflow-step-state {
    font-size: 0.78rem;
    color: #55627a;
    border: 1px solid #d1d9ea;
    border-radius: 999px;
    background: #fff;
    padding: 0.05rem 0.5rem;
    white-space: nowrap;
}

.workflow-timeline-editable .workflow-step.is-done .workflow-step-button {
    border-color: #98d9c5;
    background: #edf9f4;
}

.workflow-timeline-editable .workflow-step.is-done .workflow-step-title {
    color: #13684f;
}

.workflow-timeline-editable .workflow-step.is-done .workflow-step-state {
    border-color: #98d9c5;
    color: #13684f;
    background: #ffffff;
}

.workflow-timeline-editable .workflow-step-input input[type="checkbox"] {
    position: absolute;
    opacity: 0 !important;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

@media (min-width: 992px) {
    .workflow-timeline.workflow-timeline-split {
        position: relative;
    }

    .workflow-timeline.workflow-timeline-split::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 0.4rem;
        bottom: 0.4rem;
        width: 2px;
        background: #e2e8f5;
        transform: translateX(-50%);
    }

    .workflow-timeline.workflow-timeline-split .workflow-step {
        display: grid;
        grid-template-columns: 1fr 2.4rem 1fr;
        align-items: start;
        min-height: 3.1rem;
        padding-left: 0;
        padding-bottom: 0.75rem;
    }

    .workflow-timeline.workflow-timeline-split .workflow-step::before {
        left: 50%;
        transform: translateX(-50%);
        top: 0.6rem;
        z-index: 2;
    }

    .workflow-timeline.workflow-timeline-split .workflow-step::after {
        display: none;
    }

    .workflow-timeline-readonly.workflow-timeline-split .workflow-step > span {
        display: block;
        width: min(420px, 100%);
        max-width: 100%;
        padding: 0.2rem 0;
    }

    .workflow-timeline-readonly.workflow-timeline-split .workflow-step:nth-child(odd) > span {
        grid-column: 1;
        justify-self: end;
        text-align: right;
    }

    .workflow-timeline-readonly.workflow-timeline-split .workflow-step:nth-child(even) > span {
        grid-column: 3;
        justify-self: start;
        text-align: left;
    }

    .workflow-timeline-readonly.workflow-timeline-split .workflow-step.is-done > span {
        color: #13684f;
        font-weight: 600;
    }

    .workflow-timeline-editable.workflow-timeline-split .workflow-step-button {
        width: min(420px, 100%);
        max-width: 100%;
    }

    .workflow-timeline-editable.workflow-timeline-split .workflow-step:nth-child(odd) .workflow-step-button {
        grid-column: 1;
        justify-self: end;
    }

    .workflow-timeline-editable.workflow-timeline-split .workflow-step:nth-child(even) .workflow-step-button {
        grid-column: 3;
        justify-self: start;
    }
}

@media (max-width: 1199.98px) {
    .project-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .project-detail-actions .btn {
        min-width: auto;
        flex: 1 1 calc(50% - 0.5rem);
    }

    .project-kpi-grid {
        grid-template-columns: 1fr;
    }
}
