:root {
    --bg: #eef1f4;
    --bg-deep: #0f1720;
    --card: #ffffff;
    --text: #15202b;
    --muted: #5b6b78;
    --primary: #1f6feb;
    --primary-dark: #1558c0;
    --accent: #ff6a00;
    --accent-dark: #e55e00;
    --staff-accent: #ff6a00;
    --danger: #dc3d3d;
    --ok: #1f9d6a;
    --ferme: #6b7785;
    --border: #d7dee6;
    --shadow: 0 10px 28px rgba(21, 32, 43, 0.08);
    --shadow-sm: 0 3px 10px rgba(21, 32, 43, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --lock-glow: rgba(255, 106, 0, 0.28);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font: inherit;
}

/* Fond décoratif app */
.office-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, rgba(255, 106, 0, 0.1), transparent 55%),
        radial-gradient(ellipse 55% 40% at 100% 0%, rgba(31, 111, 235, 0.08), transparent 50%),
        linear-gradient(180deg, #f5f7f9 0%, #e8edf2 100%);
    pointer-events: none;
}

.office-app {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 16px 36px;
}

.office-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid rgba(215, 222, 230, 0.9);
}

.office-card--main {
    padding: 20px 20px 22px;
}

/* ——— Connexion style Windows ——— */
.office-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;
}

body.office-body--lock {
    overflow: hidden;
}

body.office-body--lock .office-bg {
    display: none;
}

body.office-body--lock .office-app {
    max-width: none;
    margin: 0;
    padding: 0;
}

.office-login--windows {
    position: fixed;
    inset: 0;
    z-index: 40;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 28px;
    overflow: auto;
}

.office-lock__wallpaper {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 55% at 20% 100%, rgba(255, 106, 0, 0.38), transparent 58%),
        radial-gradient(ellipse 60% 50% at 90% 0%, rgba(31, 111, 235, 0.22), transparent 52%),
        linear-gradient(155deg, #1a2733 0%, #243447 42%, #15202b 100%);
    transform: scale(1.05);
    animation: office-lock-pan 32s ease-in-out infinite alternate;
}

@keyframes office-lock-pan {
    from { transform: scale(1.05) translate3d(0, 0, 0); }
    to { transform: scale(1.08) translate3d(-0.8%, 0.6%, 0); }
}

.office-lock__scrim {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(22px) saturate(1.05);
    -webkit-backdrop-filter: blur(22px) saturate(1.05);
    background: rgba(15, 24, 32, 0.35);
}

.office-lock__clock {
    position: absolute;
    top: clamp(28px, 8vh, 72px);
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
    z-index: 1;
    pointer-events: none;
    animation: office-lock-fade 0.7s ease-out;
}

.office-lock__time {
    font-size: clamp(3.4rem, 10vw, 5.6rem);
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.office-lock__date {
    margin-top: 8px;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    font-weight: 400;
    opacity: 0.92;
    text-transform: capitalize;
}

.office-lock__panel {
    position: relative;
    z-index: 2;
    width: min(400px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: clamp(64px, 14vh, 120px);
    padding: 28px 22px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: office-lock-fade 0.55s ease-out 0.08s both;
}

@keyframes office-lock-fade {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.office-lock__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.office-lock__logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
}

.office-lock__user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.office-lock__avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.9rem;
    font-weight: 750;
    color: #fff;
    background: linear-gradient(145deg, #ff9a3d, #ff6a00 55%, #ff3d00);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.7),
        0 0 24px rgba(255, 106, 0, 0.45),
        0 12px 28px rgba(0, 0, 0, 0.28);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.office-lock__avatar.is-ready {
    transform: scale(1.04);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.85),
        0 0 0 8px var(--lock-glow),
        0 0 32px var(--lock-glow),
        0 14px 30px rgba(0, 0, 0, 0.28);
}

.office-lock__name {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.office-lock__hint {
    margin: 0;
    font-size: 0.92rem;
    opacity: 0.82;
    font-weight: 400;
}

.office-lock__accounts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin-top: 4px;
}

.office-lock__accounts .office-staff-picker__empty {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.office-staff-btn {
    border: 2px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 12px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 88px;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    font: inherit;
    color: #fff;
}

.office-staff-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.office-staff-btn--active {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 106, 0, 0.22);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.28);
}

.office-staff-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.office-staff-btn__avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--staff-color, var(--accent)) 40%, #ffffff),
        var(--staff-color, var(--accent)),
        color-mix(in srgb, var(--staff-color, var(--accent)) 85%, #000000)
    );
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.55),
        0 0 14px color-mix(in srgb, var(--staff-color, var(--accent)) 45%, transparent),
        0 6px 14px rgba(0, 0, 0, 0.28);
}

.office-staff-btn__name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.office-lock__pin-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(320px, 100%);
    margin-top: 8px;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.office-lock__pin-block.is-enabled {
    opacity: 1;
    pointer-events: auto;
}

.office-lock__pin-label {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.office-lock__digits {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.office-lock__digit {
    width: 54px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    caret-color: var(--accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.office-lock__digit:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 106, 0, 0.18);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.22);
    transform: translateY(-1px);
}

.office-lock__digit:disabled {
    opacity: 0.55;
}

.office-lock__go {
    margin-top: 4px;
    min-width: 188px;
    border: 0;
    border-radius: 999px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 0.98rem;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 106, 0, 0.35);
    transition: filter 0.15s ease, transform 0.12s ease;
}

.office-lock__go:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.office-lock__go:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

@media (max-width: 720px) {
    .office-lock__digit {
        width: 46px;
        height: 52px;
        font-size: 1.35rem;
    }
}

/* Ancien pin-row (compat) */
.office-lock__pin-row {
    display: none;
}

.office-lock__error {
    min-height: 1.2em;
    color: #fecaca;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
    font-size: 0.9rem;
}

.office-lock__footer {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 2;
    margin: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .office-lock__avatar {
        width: 96px;
        height: 96px;
        font-size: 2.4rem;
    }

    .office-lock__logo {
        width: 80px;
        height: 80px;
    }

    .office-lock__clock {
        top: 20px;
    }

    .office-lock__panel {
        margin-top: 96px;
    }
}

/* Ancien login card (conservé si réutilisé hors lock) */
.office-login:not(.office-login--windows) {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.office-login__card {
    width: min(420px, 100%);
    text-align: center;
    animation: office-pop-in 0.45s ease-out;
}

@keyframes office-pop-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.office-login__logo-wrap {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transform: rotate(-3deg);
}

.office-logo {
    display: block;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.office-logo--login {
    width: 122px;
    height: 122px;
}

.office-hero__logo-wrap {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.office-logo--hero {
    width: 38px;
    height: 38px;
}

@media (max-width: 720px) {
    .office-login__logo-wrap {
        width: 128px;
        height: 128px;
        padding: 12px;
    }

    .office-logo--login {
        width: 104px;
        height: 104px;
    }
}

.office-field__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.office-field--staff {
    text-align: left;
}

.office-login__title {
    margin: 0 0 6px;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--accent);
}

.office-login__subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ——— Hero accueil ——— */
.office-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid var(--staff-accent, var(--accent));
    position: relative;
    overflow: hidden;
    animation: office-pop-in 0.4s ease-out;
}

.office-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 120px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--staff-accent, var(--accent)) 8%, transparent), transparent);
    pointer-events: none;
}

.office-hero__main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    position: relative;
}

.office-hero__avatar {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--staff-accent) 40%, #ffffff),
        var(--staff-accent),
        color-mix(in srgb, var(--staff-accent) 85%, #000000)
    );
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--staff-accent) 25%, #ffffff),
        0 0 16px color-mix(in srgb, var(--staff-accent) 40%, transparent),
        0 6px 14px color-mix(in srgb, var(--staff-accent) 28%, transparent);
}

.office-hero__eyebrow {
    margin: 0 0 2px;
    font-size: 0.75rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent-dark);
}

.office-hero__greeting {
    margin: 0;
    font-size: clamp(1.25rem, 3.6vw, 1.7rem);
    font-weight: 750;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.02em;
}

.office-hero__sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.office-btn--logout {
    flex-shrink: 0;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ——— Boutons ——— */
.office-btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    cursor: pointer;
    background: #e8eef4;
    color: var(--text);
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

.office-btn:hover { filter: brightness(0.98); transform: translateY(-1px); }
.office-btn:active { transform: translateY(0); }
.office-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.office-btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.28);
}

.office-btn--accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.28);
}

.office-btn--danger {
    background: var(--danger);
    color: #fff;
}

.office-btn--ghost {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
}

.office-btn--ghost:hover {
    color: var(--text);
    border-color: #b8c4d0;
}

.office-btn--wide { width: 100%; padding: 12px 16px; font-size: 1rem; }

.office-btn--round {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ——— Pictos géométriques (marque Cube) ——— */
.office-picto {
    flex-shrink: 0;
    display: inline-block;
    position: relative;
}

.office-picto--week {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background:
        linear-gradient(var(--picto-color, var(--primary)) 0 0) 0 0 / 6px 6px no-repeat,
        linear-gradient(var(--picto-color, var(--primary)) 0 0) 10px 0 / 6px 6px no-repeat,
        linear-gradient(color-mix(in srgb, var(--picto-color, var(--primary)) 45%, white) 0 0) 0 10px / 6px 6px no-repeat,
        linear-gradient(var(--picto-color, var(--primary-dark)) 0 0) 10px 10px / 6px 6px no-repeat;
}

.office-picto--cube {
    width: 15px;
    height: 15px;
    transform: rotate(-8deg);
    background: linear-gradient(145deg, #ff9a3d 0%, var(--accent) 55%, #c24e00 100%);
    clip-path: polygon(50% 0%, 92% 22%, 92% 72%, 50% 94%, 8% 72%, 8% 22%);
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.25);
}

.office-picto--hours {
    width: 16px;
    height: 16px;
    border: 2px solid var(--picto-color, var(--primary));
    border-radius: 50%;
}

.office-picto--hours::before,
.office-picto--hours::after {
    content: "";
    position: absolute;
    background: var(--picto-color, var(--primary));
    border-radius: 1px;
    left: 50%;
    top: 50%;
    transform-origin: left center;
}

.office-picto--hours::before {
    width: 5px;
    height: 2px;
    transform: translate(0, -50%) rotate(-55deg);
}

.office-picto--hours::after {
    width: 4px;
    height: 2px;
    transform: translate(0, -50%) rotate(35deg);
}

.office-picto--chev-left,
.office-picto--chev-right {
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.office-picto--chev-left {
    transform: rotate(-135deg);
    margin-left: 2px;
}

.office-picto--chev-right {
    transform: rotate(45deg);
    margin-right: 2px;
}

.office-picto--exit {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 2px 0 0 2px;
}

.office-picto--exit::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 4px;
    width: 6px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 3px 0 currentColor;
}

.office-picto--off {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.office-picto--off::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 6px;
    width: 12px;
    height: 2px;
    background: currentColor;
    transform: rotate(-38deg);
}

.office-picto--follow {
    width: 14px;
    height: 10px;
    border-bottom: 2px dashed currentColor;
}

.office-picto--follow::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.office-tab .office-picto {
    --picto-color: var(--muted);
}

.office-tab:hover .office-picto,
.office-tab.active .office-picto {
    --picto-color: var(--accent-dark);
}

.office-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.office-mode-btn .office-picto {
    opacity: 0.85;
}

.office-mode-btn.active .office-picto--off,
.office-mode-btn.active .office-picto--follow {
    color: #fff;
    border-color: #fff;
}

.office-mode-btn.active .office-picto--off::after {
    background: #fff;
}

.office-mode-btn.active .office-picto--follow {
    border-bottom-color: #fff;
}

.office-mode-btn.active .office-picto--follow::after {
    border-color: #fff;
}

/* ——— Onglets ——— */
.office-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 5px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.office-tab {
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.office-tab:hover {
    color: var(--text);
    background: #f2f5f8;
}

.office-tab.active {
    background: color-mix(in srgb, var(--accent) 12%, #fff);
    color: var(--accent-dark);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* ——— Légende ——— */
.office-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: -2px 0 14px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--muted);
}

.office-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.office-legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.office-legend__swatch--rdv { background: #e83e8c; }
.office-legend__swatch--ferme { background: var(--ferme); }
.office-legend__swatch--worked { background: var(--ok); }
.office-legend__swatch--pending { background: #f59e0b; border: 1px dashed #d97706; }
.office-legend__swatch--off { background: #94a3b8; }

/* ——— Champs ——— */
.office-field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    text-align: left;
}

.office-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.office-field input,
.office-field select,
.office-field textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.office-field input:focus,
.office-field select:focus,
.office-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.16);
    background: #fff;
}

.office-error {
    color: var(--danger);
    min-height: 1.2em;
    font-size: 0.9rem;
}

.office-google-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #f5c26b;
    background: #fff8ee;
    color: #8a4b00;
}

.office-google-banner__text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
}

.office-google-banner__link {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.9rem;
    color: #9a5300;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.office-google-banner__link:hover {
    color: #7a4100;
}

.office-google-connect {
    max-width: 420px;
    margin: 40px auto;
}

.office-google-connect__go {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    margin-top: 8px;
}

.office-google-connect__uri code {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.78rem;
    word-break: break-all;
}

.office-google-oauth-status {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
}

.office-google-oauth-status--ok {
    background: #e8f8ef;
    color: #1e7e45;
}

.office-google-oauth-status--error {
    background: #fdecea;
    color: #b42318;
}

.office-lock__pin-block .office-toggle-secret {
    display: block;
    margin: 8px auto 0;
}

.office-toggle-secret {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.office-toggle-secret:hover {
    color: #fff;
}

.office-field--secret .office-toggle-secret {
    margin-top: 0;
    color: #9a5300;
}

.office-field--secret .office-toggle-secret:hover {
    color: #7a4100;
}

.office-secret-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.office-secret-input input {
    flex: 1;
    min-width: 0;
}

/* ——— Toolbar semaine ——— */
.office-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.office-week-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.office-week-label {
    font-weight: 700;
    min-width: 200px;
    text-align: center;
    font-size: 0.95rem;
}

/* ——— Chips récap ——— */
.office-hours-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.office-hours-chip {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-height: 72px;
    width: 100%;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.office-hours-chip--clickable:hover {
    transform: translateY(-2px);
}

.office-hours-chip strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.office-hours-chip span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
    margin-top: 2px;
}

.office-hours-chip--pending {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d;
}

.office-hours-chip--pending strong {
    color: #b45309;
}

.office-hours-chip--next {
    background: linear-gradient(135deg, #fff7f0, #ffe8d6);
    border-color: #ffb26b;
}

.office-hours-chip--clickable {
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.office-hours-chip--clickable:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(255, 106, 0, 0.16);
}

.office-hours-chip--clickable:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.office-hours-chip__next-label {
    display: block;
    font-size: 0.72rem !important;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.office-hours-chip--next span {
    color: var(--text);
    font-weight: 600;
    font-size: 0.76rem;
}

@media (max-width: 720px) {
    .office-hours-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .office-hours-chip {
        min-height: 68px;
        padding: 9px 10px;
    }

    .office-hours-chip strong {
        font-size: 1.05rem;
    }

    .office-hours-chip span {
        font-size: 0.72rem;
    }
}

/* ——— Grille semaine ——— */
.office-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.office-day-col {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 190px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.office-day-col:hover {
    box-shadow: var(--shadow-sm);
}

.office-day-col--today {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
    background: linear-gradient(180deg, #fffaf5 0%, #fff 100%);
}

.office-day-col--today .office-day-col__head {
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    color: var(--accent-dark);
    font-weight: 700;
}

.office-day-col--focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
    transform: scale(1.02);
}

.office-day-col--focus .office-day-col__head {
    background: #fff1e6;
    color: var(--accent-dark);
    font-weight: 700;
}

.office-day-col__head {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    background: #fff;
    border-radius: 10px 10px 0 0;
}

.office-day-col__head strong {
    display: block;
    font-size: 1.05rem;
}

.office-day-col__body {
    padding: 8px;
    display: grid;
    gap: 6px;
    flex: 1;
}

.office-event {
    border-radius: 10px;
    padding: 7px 9px;
    font-size: 0.78rem;
    line-height: 1.35;
    cursor: pointer;
    border-left: 4px solid var(--event-color, var(--primary));
    background: color-mix(in srgb, var(--event-color, var(--primary)) 12%, white);
    display: grid;
    gap: 2px;
    transition: transform 0.1s ease;
}

.office-event:hover {
    transform: translateX(2px);
}

.office-event__time {
    font-weight: 700;
    color: var(--text);
}

.office-event__title {
    color: var(--muted);
}

.office-event--readonly {
    cursor: default;
    opacity: 0.95;
}

.office-event--readonly:hover {
    transform: none;
}

.office-event--ferme {
    border-left-color: var(--ferme);
    background: #e2e8f0;
    color: #475569;
    font-weight: 600;
}

.office-event--ferme .office-event__time,
.office-event--ferme .office-event__title {
    color: #475569;
}

.office-event--off {
    border-left-color: #94a3b8;
    background: #f1f5f9;
}

.office-event--pending {
    border-left-style: dashed;
}

.office-add-day {
    margin-top: auto;
    border: 2px dashed var(--border);
    background: transparent;
    border-radius: 10px;
    padding: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--muted);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.office-add-day:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: #fff7f0;
}

/* ——— Modal ——— */
.office-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.office-modal-backdrop.open {
    display: flex;
}

.office-modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 22px 22px 16px 16px;
    padding: 22px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    animation: office-slide-up 0.3s ease-out;
}

@keyframes office-slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

.office-modal h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 800;
}

.office-mode-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.office-mode-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.28);
}

.office-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.office-duration-display {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #86efac;
    color: #15803d;
    font-size: 0.92rem;
    font-weight: 600;
}

.office-duration-display strong {
    font-size: 1.1rem;
}

.office-duration-display--error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fca5a5;
    color: #b91c1c;
}

.office-times-hint {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.office-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
    flex-wrap: wrap;
}

/* ——— Tableau mois ——— */
.office-month-panel {
    margin-top: 8px;
}

.office-hours-detail__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.office-hours-detail__toolbar h3 {
    margin: 0;
    font-size: 1.15rem;
}

.office-hours-detail__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.office-hours-detail__summary-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.office-hours-detail__summary-card strong {
    display: block;
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 2px;
}

.office-hours-detail__summary-card span {
    font-size: 0.78rem;
    color: var(--muted);
}

.office-hours-detail__summary-card--pending {
    border-color: #f59e0b;
    background: #fffbeb;
}

.office-hours-detail__mini-cal {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    --staff-cal-color: var(--staff-accent, #ff8000);
}

.office-hours-detail__mini-cal-title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.office-hours-detail__mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.office-mini-cal__head {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: 4px;
}

.office-mini-cal__day {
    min-height: 52px;
    padding: 4px 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.15;
}

.office-mini-cal__day--worked {
    background: color-mix(in srgb, var(--staff-cal-color) 28%, #fff);
    border-color: var(--staff-cal-color);
    font-weight: 700;
}

.office-mini-cal__day--pending {
    background: #fff8ee;
    border: 2px dashed #e67e22;
    color: #9a5300;
}

.office-mini-cal__day--clickable {
    cursor: pointer;
}

.office-mini-cal__day--clickable:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.office-mini-cal__day--off {
    background: #eceff1;
    color: #566573;
}

.office-mini-cal__day--today {
    background: #fff1e6 !important;
    border-color: var(--accent) !important;
    color: #9a3f00;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #ffb26b;
}

.office-mini-cal__day--today.office-mini-cal__day--pending {
    background: #fff1e6 !important;
    border: 2px dashed var(--accent) !important;
    color: #9a3f00;
}

.office-mini-cal__day--today.office-mini-cal__day--worked {
    background: color-mix(in srgb, #ffb26b 45%, #fff) !important;
    border-color: var(--accent) !important;
}

.office-mini-cal__day--pad {
    border: none;
    background: transparent;
    min-height: 0;
}

.office-mini-cal__num {
    display: block;
    font-weight: 700;
}

.office-mini-cal__hours {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    font-weight: 600;
}

.office-hours-detail__mini-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--muted);
}

.office-mini-cal__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.office-mini-cal__legend-item::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.office-mini-cal__legend-item--worked::before {
    background: color-mix(in srgb, var(--staff-cal-color, #ff8000) 55%, #fff);
    border: 1px solid var(--staff-cal-color, #ff8000);
}

.office-mini-cal__legend-item--pending::before {
    background: #fff8ee;
    border: 2px dashed #e67e22;
}

.office-mini-cal__legend-item--today::before {
    background: #fff1e6;
    border: 1px solid var(--accent);
}

.office-mini-cal__legend-item--off::before {
    background: #eceff1;
    border: 1px solid #94a3b8;
}

.office-hours-detail__section-title {
    margin: 16px 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c0392b;
}

.office-hours-detail__row--pending {
    cursor: pointer;
}

.office-hours-detail__row--pending:hover td {
    background: #fff7ed;
}

.office-hours-detail__hours-pending {
    color: #d35400;
    font-style: italic;
}

.office-hours-detail__empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.office-btn--sm {
    padding: 6px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.office-month-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.office-month-table th,
.office-month-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
    text-align: left;
}

.office-month-table th {
    background: #f3f6f9;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.office-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.office-status--worked { background: #dcfce7; color: #15803d; }
.office-status--pending { background: #fef3c7; color: #b45309; }
.office-status--off { background: #f1f5f9; color: #64748b; }

.office-status-line {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.88rem;
    min-height: 1.2em;
}

.office-hidden { display: none !important; }

@media (max-width: 720px) {
    .office-mini-cal__day {
        min-height: 40px;
        font-size: 0.72rem;
        border-radius: 4px;
        padding: 2px 1px;
        border-width: 1px;
    }

    .office-mini-cal__day--pending {
        border-width: 1px;
        border-style: dashed;
    }

    .office-btn--sm {
        width: 100%;
    }

    .office-hours-detail__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 10px;
    }

    .office-hours-detail__summary-card {
        padding: 8px 10px;
        border-radius: 8px;
    }

    .office-hours-detail__summary-card strong {
        font-size: 1.05rem;
    }

    .office-hours-detail__mini-cal {
        margin: 0 0 10px;
        padding: 10px;
        border: none;
        border-radius: 0;
        background: #f8fafc;
    }

    .office-hours-detail__mini-cal-grid {
        gap: 3px;
    }

    .office-hours-detail__toolbar {
        margin-bottom: 10px;
        gap: 8px;
    }

    .office-hours-detail__toolbar h3 {
        font-size: 1rem;
    }

    .office-month-table th,
    .office-month-table td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }

    .office-hours-detail__section-title {
        margin: 12px 0 6px;
        font-size: 0.75rem;
    }

    .office-hours-detail__empty {
        padding: 12px;
    }
}

@media (max-width: 900px) {
    .office-app {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .office-card,
    .office-card--main {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 10px 8px 16px;
    }

    .office-hero {
        margin: 0;
        padding: 12px 8px;
        border: none;
        border-radius: 0;
        box-shadow: none;
        flex-direction: column;
        align-items: stretch;
    }

    .office-hero::before {
        display: none;
    }

    .office-tabs {
        margin: 0 0 8px;
        padding: 4px;
        border-radius: 0;
        gap: 4px;
    }

    .office-tab {
        flex: 1 1 auto;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    .office-toolbar {
        margin-bottom: 8px;
        gap: 6px;
        padding: 0;
    }

    .office-hours-summary {
        margin-bottom: 8px;
        gap: 6px;
    }

    .office-hours-chip {
        border-radius: 8px;
        min-height: 58px;
        padding: 8px;
    }

    .office-week-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .office-day-col {
        min-height: auto;
        border-width: 1px;
        border-radius: 8px;
    }

    .office-day-col--focus {
        transform: none;
    }

    .office-month-panel {
        margin-top: 0;
        width: 100%;
    }

    .office-hours-detail {
        width: 100%;
        max-width: none;
    }

    .office-btn--logout {
        align-self: flex-end;
    }

    .office-status-line {
        margin-top: 8px;
        padding: 0 2px;
    }

    .office-modal {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
    }

    .office-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .office-login:not(.office-login--windows) {
        padding: 0;
        min-height: 100vh;
        align-items: stretch;
    }

    .office-login__card {
        width: 100%;
        max-width: none;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        border: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px 16px;
    }
}
