:root {
    /*
     * Couleur principale de toute l'application.
     * Modifiez uniquement cette valeur pour changer le thème principal.
     */
    --app-primary: #402a5c;
    --app-primary-hover: color-mix(in srgb, var(--app-primary) 84%, black);
    --app-primary-soft: color-mix(in srgb, var(--app-primary) 10%, white);
    --app-primary-border: color-mix(in srgb, var(--app-primary) 22%, white);
    --app-accent: #ef765f;
    --app-background: #faf7f2;
    --app-surface: #ffffff;
    --app-text: #211c29;
    --app-text-muted: #716a78;
    --app-border: #e7e1e9;
    --app-danger: #c53b3b;
    --app-radius-sm: 0.75rem;
    --app-radius-md: 1rem;
    --app-radius-lg: 1.5rem;
    --app-shadow: 0 1.5rem 4rem rgba(33, 28, 41, 0.14);
}

* {
    box-sizing: border-box;
}

.d-none {
    display: none !important;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--app-background);
    color: var(--app-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-shell {
    display: grid;
    width: min(100%, 66rem);
    min-height: min(40rem, calc(100vh - 2rem));
    overflow: hidden;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
}

.auth-brand {
    position: relative;
    display: none;
    overflow: hidden;
    padding: 3rem;
    align-items: center;
    justify-content: center;
    background: var(--app-primary);
    color: white;
}

.brand-wordmark {
    position: relative;
    z-index: 1;
    width: min(100%, 19rem);
}

.brand-company {
    display: flex;
    margin: 0;
    flex-direction: column;
    color: white;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.brand-rule {
    display: block;
    width: 3.5rem;
    height: 0.2rem;
    margin-block: 1.5rem;
    border-radius: 99px;
    background: var(--app-accent);
}

.brand-product {
    margin: 0;
    color: color-mix(in srgb, var(--app-primary) 10%, white);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-decoration {
    position: absolute;
    right: -5rem;
    bottom: -5rem;
    width: 20rem;
    height: 20rem;
    opacity: 0.28;
}

    .brand-decoration span {
        position: absolute;
        display: block;
        border: 1px solid white;
        border-radius: 50%;
    }

        .brand-decoration span:nth-child(1) {
            inset: 0;
        }

        .brand-decoration span:nth-child(2) {
            inset: 3rem;
        }

        .brand-decoration span:nth-child(3) {
            inset: 6rem;
            background: color-mix(in srgb, var(--app-primary) 75%, white);
        }

.auth-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: clamp(1.5rem, 5vw, 4.5rem);
}

.mobile-brand {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    color: var(--app-primary);
    font-size: 0.92rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.auth-form-wrap {
    width: min(100%, 25rem);
    margin: auto;
}

.eyebrow {
    margin-bottom: 0.45rem;
    color: var(--app-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-title {
    margin-bottom: 0.65rem;
    font-size: clamp(2rem, 7vw, 2.75rem);
    font-weight: 730;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    color: var(--app-text-muted);
    line-height: 1.6;
}

.form-label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 680;
}

.input-shell {
    position: relative;
}

.input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 1rem;
    display: grid;
    color: var(--app-text-muted);
    pointer-events: none;
    transform: translateY(-50%);
}

    .input-icon svg,
    .password-toggle svg,
    .btn-app-primary svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
    }

.form-control {
    min-height: 3.25rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border-color: var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
}

    .form-control::placeholder {
        color: #a59ea9;
    }

    .form-control:hover {
        border-color: var(--app-primary-border);
    }

    .form-control:focus {
        border-color: var(--app-primary);
        box-shadow: 0 0 0 0.25rem var(--app-primary-soft);
    }

.password-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 0.65rem;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-text-muted);
    transform: translateY(-50%);
}

    .password-toggle:hover,
    .password-toggle:focus-visible {
        background: var(--app-primary-soft);
        color: var(--app-primary);
        outline: none;
    }

.btn-app-primary,
.btn-app-outline {
    min-height: 3.25rem;
    border-radius: var(--app-radius-sm);
    font-weight: 700;
}

.btn-app-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border: 1px solid var(--app-primary);
    background: var(--app-primary);
    color: white;
    box-shadow: 0 0.65rem 1.25rem var(--app-primary-soft);
}

    .btn-app-primary:hover,
    .btn-app-primary:focus-visible {
        border-color: var(--app-primary-hover);
        background: var(--app-primary-hover);
        color: white;
    }

    .btn-app-primary:focus-visible,
    .btn-app-outline:focus-visible {
        box-shadow: 0 0 0 0.25rem var(--app-primary-soft);
    }

.btn-app-outline {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--app-primary-border);
    color: var(--app-primary);
}

    .btn-app-outline:hover {
        border-color: var(--app-primary);
        background: var(--app-primary-soft);
        color: var(--app-primary);
    }

.login-status {
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #edb5b5;
    border-radius: var(--app-radius-sm);
    background: #fff3f3;
    color: #9d2020;
    font-size: 0.88rem;
    font-weight: 700;
}

    .login-status:empty {
        display: none;
    }

.auth-footer {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 2.5rem;
    color: var(--app-text-muted);
    font-size: 0.78rem;
}

.invalid-feedback {
    font-size: 0.82rem;
}

.was-validated .input-shell:has(.form-control:invalid) + .invalid-feedback {
    display: block;
}

.was-validated .form-control:invalid {
    border-color: var(--app-danger);
}

    .was-validated .form-control:invalid:focus,
    .form-control.is-invalid:focus,
    .was-validated .form-select:invalid:focus,
    .form-select.is-invalid:focus {
        border-color: var(--app-danger);
        box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--app-danger) 12%, white);
        outline: none;
    }

/* La validation réussie reste visuellement neutre dans tout le prototype. */
.was-validated .form-control:valid,
.form-control.is-valid,
.was-validated .form-select:valid,
.form-select.is-valid,
.was-validated .form-check-input:valid,
.form-check-input.is-valid {
    border-color: var(--app-border);
}

.was-validated .form-control:valid,
.form-control.is-valid {
    background-image: none;
}

.was-validated .form-select:valid,
.form-select.is-valid {
    --bs-form-select-bg-icon: none;
}

    .was-validated .form-control:valid:focus,
    .form-control.is-valid:focus,
    .was-validated .form-select:valid:focus,
    .form-select.is-valid:focus {
        border-color: var(--app-primary);
        box-shadow: 0 0 0 0.2rem var(--app-primary-soft);
    }

.was-validated .form-check-input:valid:checked,
.form-check-input.is-valid:checked {
    border-color: var(--app-primary);
    background-color: var(--app-primary);
}

.was-validated .form-check-input:valid ~ .form-check-label,
.form-check-input.is-valid ~ .form-check-label {
    color: inherit;
}

.valid-feedback,
.valid-tooltip {
    display: none !important;
}

.placeholder-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.placeholder-card {
    max-width: 36rem;
    padding: clamp(2rem, 6vw, 4rem);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
    text-align: center;
}

.placeholder-company {
    margin: 0;
    color: var(--app-primary);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.015em;
}

/* Authentification forte Duo */
.duo-page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: radial-gradient(circle at 50% 0%, var(--app-primary-soft), transparent 30rem), var(--app-background);
}

.duo-site-header {
    padding: 1.35rem clamp(1.25rem, 4vw, 3rem);
}

.company-wordmark {
    color: var(--app-primary);
    font-size: 0.95rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    text-decoration: none;
}

    .company-wordmark:hover {
        color: var(--app-primary-hover);
    }

.duo-main {
    display: grid;
    width: 100%;
    padding: 1rem;
    place-items: center;
}

.duo-card {
    width: min(100%, 29rem);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.duo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--app-border);
}

.duo-wordmark {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.duo-name {
    color: #4f9d37;
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: 0.07em;
}

.duo-security {
    color: var(--app-text-muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.prototype-badge {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.duo-card-body {
    padding: clamp(1.5rem, 5vw, 2.25rem);
}

.security-icon {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1.35rem;
    place-items: center;
    border-radius: 1rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

    .security-icon svg,
    .device-icon svg,
    .duo-card-footer svg,
    .duo-back-button svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
    }

.duo-heading h1 {
    margin-bottom: 1rem;
    font-size: clamp(1.75rem, 7vw, 2.15rem);
    font-weight: 730;
    letter-spacing: -0.035em;
}

.duo-heading > p:last-child {
    margin-bottom: 1.4rem;
    color: var(--app-text-muted);
    line-height: 1.55;
}

.duo-method {
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: #fff;
}

.duo-method-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.duo-method-icon {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.75rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

    .duo-method-icon svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
    }

.duo-method-heading h2 {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    font-weight: 730;
}

.duo-method-heading p {
    margin: 0;
    color: var(--app-text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.duo-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-block: 0.75rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

    .duo-separator::before,
    .duo-separator::after {
        height: 1px;
        flex: 1;
        background: var(--app-border);
        content: "";
    }

.duo-method .passcode-input {
    margin-bottom: 0.75rem;
}

.duo-push-status {
    margin-top: 0.85rem;
    padding: 0.8rem;
    border-radius: var(--app-radius-sm);
    background: var(--app-primary-soft);
    color: var(--app-primary);
    text-align: center;
}

    .duo-push-status .waiting-animation {
        margin: 0 0 0.55rem;
    }

    .duo-push-status p {
        margin: 0;
        font-size: 0.8rem;
        font-weight: 650;
    }

    .duo-push-status.is-approved .waiting-animation {
        display: none;
    }

.duo-user,
.duo-device {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: #fff;
}

.duo-user {
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.duo-user-avatar {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--app-primary);
    color: white;
    font-weight: 750;
}

.duo-user small,
.duo-device small {
    display: block;
    margin-bottom: 0.1rem;
    color: var(--app-text-muted);
    font-size: 0.72rem;
}

.duo-user strong,
.duo-device strong {
    display: block;
    max-width: 16rem;
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duo-device {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
}

.device-icon {
    display: grid;
    color: var(--app-primary);
    place-items: center;
}

.device-status {
    margin-left: auto;
    color: #3d842d;
    font-size: 0.72rem;
    font-weight: 750;
}

.duo-other-option {
    display: block;
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.55rem;
    border: 0;
    background: transparent;
    color: var(--app-primary);
    font-size: 0.85rem;
    font-weight: 680;
    text-align: center;
}

    .duo-other-option:hover,
    .duo-other-option:focus-visible {
        color: var(--app-primary-hover);
        text-decoration: underline;
    }

.duo-waiting {
    text-align: center;
}

    .duo-waiting h2 {
        margin-bottom: 0.45rem;
        font-size: 1.3rem;
        font-weight: 720;
    }

    .duo-waiting > p {
        margin-bottom: 1.25rem;
        color: var(--app-text-muted);
        line-height: 1.55;
    }

.waiting-animation {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.5rem 0 1.2rem;
}

    .waiting-animation span {
        width: 0.65rem;
        height: 0.65rem;
        border-radius: 50%;
        background: var(--app-primary);
        animation: duo-pulse 1.2s ease-in-out infinite;
    }

        .waiting-animation span:nth-child(2) {
            animation-delay: 150ms;
        }

        .waiting-animation span:nth-child(3) {
            animation-delay: 300ms;
        }

.duo-back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: -0.35rem 0 1.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-primary);
    font-size: 0.84rem;
    font-weight: 680;
}

.passcode-input {
    padding-left: 1rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
}

.passcode-help {
    margin: 0.55rem 0 1rem;
    color: var(--app-text-muted);
    font-size: 0.8rem;
}

.duo-status {
    min-height: 1.25rem;
    margin: 0.85rem 0 0;
    color: var(--app-primary);
    font-size: 0.82rem;
    text-align: center;
}

.duo-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--app-border);
    background: #fbfafc;
    color: var(--app-text-muted);
    font-size: 0.75rem;
}

.duo-page-footer {
    margin: 0;
    padding: 1.25rem;
}

@keyframes duo-pulse {

    0%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-0.25rem);
    }
}

@media (max-width: 575.98px) {
    .duo-page {
        min-height: 100dvh;
        grid-template-rows: minmax(0, 1fr);
        background: var(--app-surface);
    }

    .duo-site-header,
    .duo-page-footer {
        display: none;
    }

    .duo-main {
        min-height: 100dvh;
        align-items: start;
        padding: 0;
    }

    .duo-card {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .duo-card-header,
    .duo-card-body {
        padding-inline: 0.9rem;
    }

    .duo-card-header {
        min-height: 3.35rem;
        padding-block: 0.7rem;
    }

    .duo-card-body {
        padding-block: 0.8rem;
    }

    .duo-heading h1 {
        margin-bottom: 0.7rem;
        font-size: 1.35rem;
    }

    .duo-method {
        padding: 0.7rem;
        border-radius: 0.8rem;
    }

    .duo-method-heading {
        align-items: center;
        gap: 0.55rem;
        margin-bottom: 0.55rem;
    }

    .duo-method-icon {
        width: 2.15rem;
        height: 2.15rem;
        border-radius: 0.6rem;
    }

        .duo-method-icon svg {
            width: 1.15rem;
            height: 1.15rem;
        }

    .duo-method-heading h2 {
        margin: 0;
        font-size: 0.88rem;
    }

    .duo-method .btn {
        min-height: 2.7rem;
        padding-block: 0.55rem;
        font-size: 0.82rem;
    }

    .duo-separator {
        margin-block: 0.5rem;
    }

    .duo-method .passcode-input {
        min-height: 2.8rem;
        margin-bottom: 0.55rem;
        padding-block: 0.45rem;
        font-size: 1.1rem;
    }

    .duo-status:empty {
        display: none;
    }

    .duo-push-status {
        margin-top: 0.55rem;
        padding: 0.55rem;
    }
}

/* Ajustements finaux du Timesheet pour téléphone */
@media (max-width: 767.98px) {
    body.timesheet-page {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .timesheet-page,
    .timesheet-page .app-header,
    .timesheet-page .app-header-inner,
    .timesheet-main,
    .timesheet-container,
    .timesheet-topbar,
    .week-toolbar,
    .timesheet-mobile-view,
    .mobile-day-tabs,
    .mobile-entry-list,
    .mobile-entry-card {
        min-width: 0;
        max-width: 100%;
    }

        .timesheet-page .app-header-inner {
            width: 100%;
            padding-inline: 1rem;
            gap: 0.5rem;
        }

        .timesheet-page .app-brand {
            max-width: 52%;
            overflow: hidden;
            font-size: 0.9rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .timesheet-page .app-header-actions {
            min-width: 0;
            margin-left: auto;
            flex: 0 0 auto;
            gap: 0.4rem;
        }

        .timesheet-page .centre-switch {
            min-width: 2.8rem;
            justify-content: center;
        }

    .timesheet-main {
        width: 100%;
        padding: 1.1rem 1rem 1.5rem;
        overflow: hidden;
    }

    .timesheet-topbar {
        width: 100%;
        margin-bottom: 1rem;
        align-items: center;
    }

        .timesheet-topbar > div {
            min-width: 0;
        }

        .timesheet-topbar h1 {
            overflow: hidden;
            font-size: 1.75rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .timesheet-add {
        display: inline-grid;
        width: 3rem;
        height: 3rem;
        min-height: 3rem;
        flex: 0 0 3rem;
        padding: 0;
        place-items: center;
    }

    .week-toolbar {
        width: 100%;
        padding: 0.9rem;
        overflow: hidden;
        border-radius: var(--app-radius-md) var(--app-radius-md) 0 0;
    }

    .week-navigation {
        display: grid;
        width: 100%;
        grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
        gap: 0.5rem;
    }

    .week-label {
        min-width: 0;
        align-items: center;
        text-align: center;
    }

        .week-label strong,
        .week-label span {
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .week-summaries {
        gap: 0.5rem;
        padding-top: 0.7rem;
    }

    .week-summary {
        padding: 0.65rem 0.75rem;
        border-radius: 0.7rem;
        background: var(--app-primary-soft);
    }

        .week-summary:last-child {
            text-align: left;
        }

        .week-summary strong {
            overflow: hidden;
            font-size: 0.92rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .filters-toggle {
        margin-top: 0.8rem;
    }

    .timesheet-filters.is-open {
        grid-template-columns: minmax(0, 1fr);
    }

    .timesheet-mobile-view {
        width: 100%;
        overflow: hidden;
    }

    .mobile-day-tabs {
        width: 100%;
        grid-auto-columns: 4.15rem;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
    }

    .mobile-day-tab {
        min-width: 0;
        scroll-snap-align: start;
    }

    .mobile-day-heading {
        min-width: 0;
        gap: 0.5rem;
    }

        .mobile-day-heading > div {
            min-width: 0;
        }

            .mobile-day-heading > div > strong {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

    .mobile-entry-card {
        width: 100%;
        padding: 0.9rem;
        overflow: hidden;
    }

    .mobile-entry-main {
        width: 100%;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.55rem;
    }

    .mobile-entry-card > p {
        display: -webkit-box;
        overflow: hidden;
        overflow-wrap: anywhere;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .entry-financial {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

        .entry-financial span {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .entry-actions {
        width: 100%;
        justify-content: stretch;
        gap: 0;
    }

    .entry-action {
        flex: 1 1 50%;
        min-width: 0;
        padding: 0.45rem;
        text-align: center;
    }

    .delete-notice {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .timesheet-page .app-brand {
        max-width: 45%;
    }

    .timesheet-main {
        padding-inline: 0.75rem;
    }

    .week-summary {
        padding-inline: 0.55rem;
    }

    .mobile-entry-main {
        grid-template-columns: minmax(0, 1fr) auto;
    }

        .mobile-entry-main > .entry-code {
            display: none;
        }
}

/* Timesheet mobile plein écran : seule la liste des activités défile */
@media (max-width: 767.98px) {
    body.timesheet-page {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
    }

    .timesheet-page .app-header {
        position: relative;
        z-index: 10;
        flex: 0 0 auto;
    }

    .timesheet-page .app-page-footer {
        display: none;
    }

    .timesheet-page .timesheet-main {
        height: 100%;
        min-height: 0;
        padding-bottom: 0.75rem;
        overflow: hidden;
    }

    .timesheet-page .timesheet-container {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    .timesheet-page .timesheet-topbar,
    .timesheet-page .week-toolbar,
    .timesheet-page .week-progress,
    .timesheet-page .filters-toggle,
    .timesheet-page .timesheet-filters {
        flex: 0 0 auto;
    }

    .timesheet-page .timesheet-mobile-view {
        display: flex;
        width: 100%;
        min-height: 0;
        flex: 1 1 auto;
        flex-direction: column;
        overflow: hidden;
    }

    .timesheet-page .mobile-day-tabs,
    .timesheet-page .mobile-day-heading {
        flex: 0 0 auto;
    }

    .timesheet-page .mobile-entry-list {
        min-height: 0;
        padding: 0 0.2rem max(1rem, env(safe-area-inset-bottom)) 0;
        flex: 1 1 auto;
        align-content: start;
        grid-auto-rows: max-content;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-width: thin;
        scrollbar-gutter: stable;
        -webkit-overflow-scrolling: touch;
    }

    .timesheet-page .mobile-entry-card:last-child {
        margin-bottom: 0.25rem;
    }
}

/* Timesheet responsive */
.timesheet-main {
    width: 100%;
    padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem);
}

.timesheet-container {
    width: min(100%, 86rem);
    margin-inline: auto;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.centre-switch {
    display: inline-flex;
    min-height: 2.5rem;
    padding: 0.4rem 0.7rem;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--app-border);
    border-radius: 0.7rem;
    color: var(--app-text-muted);
    font-size: 0.74rem;
    text-decoration: none;
}

    .centre-switch strong {
        color: var(--app-primary);
        font-size: 0.8rem;
    }

    .centre-switch svg,
    .timesheet-add svg,
    .week-arrow svg,
    .icon-action svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.9;
    }

    .centre-switch:hover {
        border-color: var(--app-primary-border);
        background: var(--app-primary-soft);
        color: var(--app-primary);
    }

.timesheet-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .timesheet-topbar h1 {
        margin: 0 0 0.3rem;
        font-size: clamp(1.8rem, 4vw, 2.45rem);
        font-weight: 740;
        letter-spacing: -0.04em;
    }

.timesheet-centre-name {
    margin: 0;
    color: var(--app-text-muted);
    font-size: 0.88rem;
}

.timesheet-add {
    flex: 0 0 auto;
    padding-inline: 1.15rem;
    text-decoration: none;
}

.week-toolbar {
    display: grid;
    padding: 1rem;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md) var(--app-radius-md) 0 0;
    background: var(--app-surface);
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.week-arrow,
.today-button {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
}

.week-arrow {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border-radius: 0.7rem;
}

    .week-arrow:hover,
    .today-button:hover {
        border-color: var(--app-primary-border);
        background: var(--app-primary-soft);
        color: var(--app-primary);
    }

.week-label {
    display: flex;
    min-width: 10.5rem;
    flex-direction: column;
}

    .week-label strong {
        font-size: 0.92rem;
    }

    .week-label span {
        color: var(--app-text-muted);
        font-size: 0.76rem;
    }

.today-button {
    display: inline-flex;
    min-height: 2.5rem;
    padding: 0.42rem 0.9rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 0.7rem;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.15;
}

    .today-button small {
        margin-top: 0.16rem;
        color: var(--app-text-muted);
        font-size: 0.62rem;
        font-weight: 550;
    }

.week-summary {
    display: flex;
    min-width: 8rem;
    flex-direction: column;
    text-align: right;
}

.week-summaries {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.4rem;
}

.week-summary span {
    color: var(--app-text-muted);
    font-size: 0.72rem;
}

.week-summary strong {
    color: var(--app-primary);
    font-size: 1.05rem;
}

    .week-summary strong span {
        color: inherit;
        font-size: inherit;
    }

.week-progress {
    height: 0.3rem;
    overflow: hidden;
    background: var(--app-primary-soft);
}

    .week-progress span {
        display: block;
        width: 0;
        height: 100%;
        border-radius: 99px;
        background: var(--app-primary);
        transition: width 220ms ease;
    }

.filters-toggle {
    display: flex;
    width: 100%;
    min-height: 3rem;
    margin-top: 1rem;
    padding-inline: 1rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.82rem;
    font-weight: 700;
}

    .filters-toggle > span:first-child {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .filters-toggle svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.9;
    }

.filter-count {
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border-radius: 50%;
    background: var(--app-primary);
    color: white;
    font-size: 0.68rem;
}

.timesheet-filters {
    display: none;
    margin-top: 0.65rem;
    padding: 1rem;
    gap: 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
}

    .timesheet-filters.is-open {
        display: grid;
    }

.filter-field {
    min-width: 0;
}

    .filter-field label {
        display: block;
        margin-bottom: 0.35rem;
        color: var(--app-text-muted);
        font-size: 0.7rem;
        font-weight: 700;
    }

    .filter-field select {
        width: 100%;
        min-height: 2.75rem;
        padding: 0.55rem 2.2rem 0.55rem 0.75rem;
        border: 1px solid var(--app-border);
        border-radius: 0.65rem;
        background-color: var(--app-surface);
        color: var(--app-text);
        font-size: 0.78rem;
    }

        .filter-field select:focus {
            border-color: var(--app-primary);
            box-shadow: 0 0 0 0.2rem var(--app-primary-soft);
            outline: none;
        }

.filters-reset {
    min-height: 2.75rem;
    align-self: end;
    border: 1px solid var(--app-primary-border);
    border-radius: 0.65rem;
    background: transparent;
    color: var(--app-primary);
    font-size: 0.76rem;
    font-weight: 700;
}

    .filters-reset:hover {
        background: var(--app-primary-soft);
    }

.timesheet-mobile-view {
    display: block;
    padding-top: 1rem;
}

.timesheet-desktop-view {
    display: none;
}

.mobile-day-tabs {
    display: grid;
    padding-bottom: 0.35rem;
    grid-auto-columns: minmax(4.4rem, 1fr);
    grid-auto-flow: column;
    gap: 0.45rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.mobile-day-tab {
    display: flex;
    min-height: 4.9rem;
    padding: 0.55rem 0.4rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 0.8rem;
    background: var(--app-surface);
    color: var(--app-text-muted);
}

    .mobile-day-tab span,
    .mobile-day-tab small {
        font-size: 0.68rem;
    }

    .mobile-day-tab strong {
        color: var(--app-text);
        font-size: 0.95rem;
    }

    .mobile-day-tab.is-active {
        border-color: var(--app-primary);
        background: var(--app-primary);
        color: white;
    }

        .mobile-day-tab.is-active strong {
            color: white;
        }

.mobile-day-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 0.75rem;
}

    .mobile-day-heading > div {
        display: flex;
        flex-direction: column;
    }

        .mobile-day-heading > div > strong {
            font-size: 0.96rem;
        }

    .mobile-day-heading span {
        color: var(--app-text-muted);
        font-size: 0.75rem;
    }

    .mobile-day-heading > strong {
        color: var(--app-primary);
        font-size: 0.9rem;
    }

.mobile-entry-list {
    display: grid;
    gap: 0.75rem;
}

.mobile-entry-card {
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
}

.mobile-entry-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.7rem;
}

.entry-code {
    display: inline-grid;
    min-width: 2.5rem;
    min-height: 2.1rem;
    padding-inline: 0.45rem;
    place-items: center;
    border-radius: 0.55rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.69rem;
    font-weight: 800;
}

.mobile-entry-main > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

    .mobile-entry-main > div strong {
        overflow: hidden;
        font-size: 0.85rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-entry-main > div span {
        overflow: hidden;
        color: var(--app-text-muted);
        font-size: 0.7rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.entry-hours {
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.75rem;
    font-weight: 750;
    white-space: nowrap;
}

.mobile-entry-card > p {
    margin: 0.75rem 0;
    color: var(--app-text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.entry-financial {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
    color: var(--app-text-muted);
    font-size: 0.7rem;
}

    .entry-financial strong {
        color: var(--app-text);
    }

.entry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--app-border);
}

.entry-action {
    padding: 0.35rem 0.5rem;
    border: 0;
    background: transparent;
    color: var(--app-primary);
    font-size: 0.75rem;
    font-weight: 680;
    text-decoration: none;
}

    .entry-action.is-danger,
    .icon-action.is-danger {
        color: var(--app-danger);
    }

.timesheet-empty,
.table-empty {
    color: var(--app-text-muted);
    text-align: center;
}

.timesheet-empty {
    display: flex;
    min-height: 10rem;
    padding: 2rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
}

    .timesheet-empty span {
        font-size: 0.8rem;
    }

.timesheet-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--app-border);
    border-top: 0;
    border-radius: 0 0 var(--app-radius-md) var(--app-radius-md);
    background: var(--app-surface);
}

.timesheet-table {
    width: 100%;
    min-width: 75rem;
    border-collapse: collapse;
}

    .timesheet-table th,
    .timesheet-table td {
        padding: 0.75rem 0.65rem;
        border-bottom: 1px solid var(--app-border);
        font-size: 0.76rem;
        text-align: center;
        vertical-align: middle;
    }

    .timesheet-table thead th {
        background: color-mix(in srgb, var(--app-primary) 5%, white);
        color: var(--app-primary);
        font-weight: 750;
    }

        .timesheet-table thead th span,
        .timesheet-table thead th small {
            display: block;
        }

        .timesheet-table thead th small {
            color: var(--app-text-muted);
            font-size: 0.66rem;
            font-weight: 600;
        }

    .timesheet-table .task-column {
        width: 28rem;
        text-align: left;
    }

    .timesheet-table .actions-column {
        width: 5rem;
    }

.task-cell {
    text-align: left !important;
}

    .task-cell > .entry-code {
        margin-right: 0.65rem;
        vertical-align: top;
    }

    .task-cell > span:last-child {
        display: inline-flex;
        width: calc(100% - 4rem);
        min-width: 0;
        flex-direction: column;
        vertical-align: top;
    }

    .task-cell strong {
        font-size: 0.76rem;
    }

    .task-cell small {
        max-width: 24rem;
        overflow: hidden;
        color: var(--app-text-muted);
        font-size: 0.65rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.hours-cell {
    color: #aaa4ad;
}

    .hours-cell.has-hours {
        color: var(--app-text);
        font-weight: 680;
    }

.row-total {
    color: var(--app-primary);
    font-weight: 780;
    white-space: nowrap;
}

.expense-cell {
    font-weight: 680;
    white-space: nowrap;
}

.row-actions {
    white-space: nowrap;
}

.icon-action {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--app-primary);
    text-decoration: none;
}

    .icon-action:hover {
        background: var(--app-primary-soft);
    }

.timesheet-table tfoot th,
.timesheet-table tfoot td {
    border-bottom: 0;
    background: #fbfafc;
    font-weight: 750;
}

.timesheet-table tfoot th {
    text-align: left;
}

.table-empty {
    height: 12rem;
}

.delete-notice {
    position: fixed;
    z-index: 20;
    right: 1rem;
    bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: var(--app-text);
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem);
    transition: opacity 180ms ease, transform 180ms ease;
}

    .delete-notice.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

@media (min-width: 768px) {
    .filters-toggle {
        display: none;
    }

    .timesheet-filters {
        display: grid;
        margin-block: 1rem;
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
        align-items: end;
    }

    .filters-reset {
        padding-inline: 1rem;
    }

    .timesheet-mobile-view {
        display: none;
    }

    .timesheet-desktop-view {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .timesheet-main {
        padding: 1.25rem 1rem;
    }

    .timesheet-topbar {
        align-items: center;
    }

    .timesheet-add {
        width: 3rem;
        min-height: 3rem;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

        .timesheet-add span {
            display: none;
        }

    .week-toolbar {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .today-button {
        display: none;
    }

    .week-summaries {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding-top: 0.75rem;
        border-top: 1px solid var(--app-border);
    }

    .week-summary {
        min-width: 0;
        text-align: left;
    }

        .week-summary:last-child {
            text-align: right;
        }
}

@media (max-width: 420px) {

    .centre-switch > span,
    .centre-switch svg,
    .timesheet-centre-name {
        display: none;
    }

    .app-header-actions {
        gap: 0.45rem;
    }

    .week-label {
        min-width: 7.5rem;
    }

        .week-label strong {
            font-size: 0.82rem;
        }

        .week-label span {
            font-size: 0.68rem;
        }
}

@media (min-width: 768px) {
    .auth-shell {
        grid-template-columns: minmax(20rem, 0.9fr) minmax(25rem, 1.1fr);
    }

    .auth-brand {
        display: flex;
    }

    .mobile-brand {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .auth-page {
        display: block;
        padding: 0;
        background: var(--app-surface);
    }

    .auth-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-content {
        min-height: 100vh;
        min-height: 100dvh;
        padding-top: 2rem;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }

    .auth-footer {
        width: 100%;
        margin-top: 2rem;
        padding-inline: 0.5rem;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        font-size: 0.7rem;
        line-height: 1.35;
        text-align: center;
    }

        .auth-footer span {
            max-width: 100%;
        }

            .auth-footer span[aria-hidden="true"] {
                display: none;
            }
}

@media (prefers-reduced-motion: no-preference) {

    .btn-app-primary,
    .btn-app-outline,
    .form-control,
    .password-toggle {
        transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    }

        .btn-app-primary:active {
            transform: translateY(1px);
        }
}

@media (prefers-reduced-motion: reduce) {
    .waiting-animation span {
        animation: none;
    }
}

/* Pages internes et sélection du centre de profit */
.app-page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--app-background);
}

.app-header {
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface);
}

.app-header-inner {
    display: flex;
    width: min(calc(100% - 2rem), 70rem);
    min-height: 4.25rem;
    margin-inline: auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-brand {
    color: var(--app-primary);
    font-size: 0.98rem;
    font-weight: 780;
    letter-spacing: -0.02em;
    text-decoration: none;
}

    .app-brand:hover {
        color: var(--app-primary-hover);
    }

.app-signout {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--app-text-muted);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
}

    .app-signout:hover {
        color: var(--app-primary);
    }

    .app-signout svg,
    .profit-check svg,
    .profit-arrow svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.9;
    }

.profit-centre-main {
    display: grid;
    width: 100%;
    padding: clamp(1.25rem, 4vw, 3.5rem) 1rem;
    place-items: center;
}

.selection-panel {
    width: min(100%, 43rem);
    padding: clamp(1.4rem, 5vw, 2.5rem);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: 0 1.2rem 3rem rgba(33, 28, 41, 0.1);
}

.selection-heading {
    margin-bottom: 1.75rem;
}

    .selection-heading h1,
    .timesheet-placeholder h1 {
        margin-bottom: 0.55rem;
        font-size: clamp(1.75rem, 5vw, 2.25rem);
        font-weight: 730;
        letter-spacing: -0.035em;
    }

    .selection-heading > p:last-child {
        margin: 0;
        color: var(--app-text-muted);
    }

.profit-desktop {
    display: none;
}

.profit-mobile {
    display: block;
}

.profit-list {
    display: grid;
    gap: 0.75rem;
}

.profit-option {
    display: block;
    color: var(--app-text);
    cursor: pointer;
    text-decoration: none;
}

    .profit-option > input {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        opacity: 0;
    }

.profit-option-content {
    display: grid;
    min-height: 4.5rem;
    padding: 0.85rem 1rem;
    grid-template-columns: minmax(5.5rem, auto) 1fr 2rem;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
}

.profit-code {
    display: inline-flex;
    width: fit-content;
    min-width: 4.5rem;
    min-height: 2.25rem;
    padding-inline: 0.7rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.035em;
}

.profit-name {
    font-size: 0.92rem;
    font-weight: 650;
}

.profit-check {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    color: transparent;
}

.profit-option:hover .profit-option-content {
    border-color: var(--app-primary-border);
    background: var(--app-primary-soft);
    transform: translateY(-1px);
}

.profit-option:hover {
    color: var(--app-text);
}

.profit-arrow {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: 50%;
    color: var(--app-primary);
}

.profit-option:focus-visible {
    border-radius: var(--app-radius-md);
    outline: 0.2rem solid var(--app-primary-soft);
    outline-offset: 0.15rem;
}

.profit-option:has(input:checked) .profit-option-content {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--app-primary) 6%, white);
}

.profit-option:has(input:checked) .profit-check {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: white;
}

.profit-option:has(input:focus-visible) .profit-option-content {
    outline: 0.2rem solid var(--app-primary-soft);
    outline-offset: 0.15rem;
}

.profit-select {
    min-height: 3.5rem;
    border-color: var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
}

    .profit-select:focus {
        border-color: var(--app-primary);
        box-shadow: 0 0 0 0.25rem var(--app-primary-soft);
    }

.app-page-footer {
    margin: 0;
    padding: 1.25rem;
}

.timesheet-placeholder {
    text-align: center;
}

@media (min-width: 768px) {
    .profit-desktop {
        display: block;
    }

    .profit-mobile {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .app-header-inner {
        width: min(calc(100% - 1.5rem), 70rem);
    }

    .app-signout span {
        display: none;
    }

    .profit-centre-main {
        align-items: start;
        padding: 1rem 0 0;
    }

    .selection-panel {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .app-page-footer {
        flex-wrap: wrap;
        padding-inline: 1rem;
    }
}

/* Ajustements finaux du Timesheet pour téléphone */
@media (max-width: 767.98px) {
    body.timesheet-page {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .timesheet-page,
    .timesheet-page .app-header,
    .timesheet-page .app-header-inner,
    .timesheet-main,
    .timesheet-container,
    .timesheet-topbar,
    .week-toolbar,
    .timesheet-mobile-view,
    .mobile-day-tabs,
    .mobile-entry-list,
    .mobile-entry-card {
        min-width: 0;
        max-width: 100%;
    }

        .timesheet-page .app-header-inner {
            width: 100%;
            padding-inline: 1rem;
            gap: 0.5rem;
        }

        .timesheet-page .app-brand {
            max-width: 52%;
            overflow: hidden;
            font-size: 0.9rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .timesheet-page .app-header-actions {
            min-width: 0;
            margin-left: auto;
            flex: 0 0 auto;
            gap: 0.4rem;
        }

        .timesheet-page .centre-switch {
            min-width: 2.8rem;
            justify-content: center;
        }

    .timesheet-main {
        width: 100%;
        padding: 1.1rem 1rem 1.5rem;
        overflow: hidden;
    }

    .timesheet-topbar {
        width: 100%;
        margin-bottom: 1rem;
        align-items: center;
    }

        .timesheet-topbar > div {
            min-width: 0;
        }

        .timesheet-topbar h1 {
            overflow: hidden;
            font-size: 1.75rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .timesheet-add {
        display: inline-grid;
        width: 3rem;
        height: 3rem;
        min-height: 3rem;
        flex: 0 0 3rem;
        padding: 0;
        place-items: center;
    }

    .week-toolbar {
        width: 100%;
        padding: 0.9rem;
        overflow: hidden;
        border-radius: var(--app-radius-md) var(--app-radius-md) 0 0;
    }

    .week-navigation {
        display: grid;
        width: 100%;
        grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
        gap: 0.5rem;
    }

    .week-label {
        min-width: 0;
        align-items: center;
        text-align: center;
    }

        .week-label strong,
        .week-label span {
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .week-summaries {
        gap: 0.5rem;
        padding-top: 0.7rem;
    }

    .week-summary {
        padding: 0.65rem 0.75rem;
        border-radius: 0.7rem;
        background: var(--app-primary-soft);
    }

        .week-summary:last-child {
            text-align: left;
        }

        .week-summary strong {
            overflow: hidden;
            font-size: 0.92rem;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .filters-toggle {
        margin-top: 0.8rem;
    }

    .timesheet-filters.is-open {
        grid-template-columns: minmax(0, 1fr);
    }

    .timesheet-mobile-view {
        width: 100%;
        overflow: hidden;
    }

    .mobile-day-tabs {
        width: 100%;
        grid-auto-columns: 4.15rem;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
    }

    .mobile-day-tab {
        min-width: 0;
        scroll-snap-align: start;
    }

    .mobile-day-heading {
        min-width: 0;
        gap: 0.5rem;
    }

        .mobile-day-heading > div {
            min-width: 0;
        }

            .mobile-day-heading > div > strong {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

    .mobile-entry-card {
        width: 100%;
        padding: 0.9rem;
        overflow: hidden;
    }

    .mobile-entry-main {
        width: 100%;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.55rem;
    }

    .mobile-entry-card > p {
        display: -webkit-box;
        overflow: hidden;
        overflow-wrap: anywhere;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .entry-financial {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

        .entry-financial span {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .entry-actions {
        width: 100%;
        justify-content: stretch;
        gap: 0;
    }

    .entry-action {
        flex: 1 1 50%;
        min-width: 0;
        padding: 0.45rem;
        text-align: center;
    }

    .delete-notice {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .timesheet-page .app-brand {
        max-width: 45%;
    }

    .timesheet-main {
        padding-inline: 0.75rem;
    }

    .week-summary {
        padding-inline: 0.55rem;
    }

    .mobile-entry-main {
        grid-template-columns: minmax(0, 1fr) auto;
    }

        .mobile-entry-main > .entry-code {
            display: none;
        }
}

/* Utilitaires locaux : la connexion ne dépend pas du CDN Bootstrap. */
body {
    line-height: 1.5;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.form-label {
    display: inline-block;
    margin-bottom: .5rem;
}

.form-control {
    display: block;
    width: 100%;
    border: 1px solid var(--app-border);
    background: white;
    outline: none;
}

.invalid-feedback {
    display: none;
    margin-top: .25rem;
    color: var(--app-danger);
}

.btn {
    cursor: pointer;
    padding: .75rem 1rem;
}

button:focus-visible {
    outline: 3px solid var(--app-accent);
    outline-offset: 3px;
}


.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
