/* =========================================================
   ALPHÉA SUITE — LANCEUR + NOUVEAU PREMIUM
   ========================================================= */

.alphea-quick-launcher-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px !important;
    border-radius: 13px !important;
    letter-spacing: -.01em;
    box-shadow:
        0 8px 18px rgba(37, 99, 235, .18),
        inset 0 1px 0 rgba(255, 255, 255, .18);
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        background 140ms ease !important;
}

.alphea-quick-launcher-trigger:hover {
    transform: translateY(-1px);
    box-shadow:
        0 12px 24px rgba(37, 99, 235, .24),
        inset 0 1px 0 rgba(255, 255, 255, .2);
}

.alphea-quick-launcher-trigger:active {
    transform: translateY(0);
}

.alphea-quick-launcher-trigger-icon {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    font-size: 21px;
    font-weight: 500;
    line-height: 1;
}

.alphea-quick-launcher {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: grid;
    padding: 72px 20px 30px;
    place-items: start center;
    overflow: hidden;
}

.alphea-quick-launcher[hidden] {
    display: none !important;
}

.alphea-quick-launcher-backdrop {
    position: absolute;
    inset: 0;
    background:
        rgba(7, 18, 38, .48);
    opacity: 0;
    backdrop-filter: blur(9px);
    transition: opacity 180ms ease;
}

.alphea-quick-launcher-dialog {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(780px, calc(100vw - 32px));
    max-height: calc(100dvh - 104px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, .92);
    border-radius: 26px;
    background:
        linear-gradient(
            180deg,
            rgba(251, 253, 255, .995),
            rgba(255, 255, 255, .995)
        );
    box-shadow:
        0 45px 130px rgba(2, 13, 32, .35),
        0 15px 45px rgba(15, 23, 42, .18),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    opacity: 0;
    transform: translateY(-12px) scale(.975);
    transform-origin: top center;
    transition:
        opacity 180ms ease,
        transform 180ms cubic-bezier(.2, .85, .3, 1);
}

.alphea-quick-launcher.is-visible
.alphea-quick-launcher-backdrop {
    opacity: 1;
}

.alphea-quick-launcher.is-visible
.alphea-quick-launcher-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

html.alphea-quick-launcher-open,
body.alphea-quick-launcher-open {
    overflow: hidden !important;
}

.alphea-quick-launcher-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 27px 20px;
}

.alphea-quick-launcher-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.alphea-quick-launcher-header h2 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 25px !important;
    font-weight: 900 !important;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.alphea-quick-launcher-header p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.alphea-quick-launcher-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    color: #64748b;
    cursor: pointer;
    transition:
        background 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.alphea-quick-launcher-close:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    transform: rotate(3deg);
}

.alphea-quick-launcher-command {
    display: grid;
    min-height: 54px;
    flex: 0 0 auto;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    margin: 0 27px;
    padding: 0 14px;
    border: 1px solid #d8e1ec;
    border-radius: 15px;
    background: #fff;
    color: #8391a5;
    box-shadow:
        0 7px 20px rgba(15, 23, 42, .045),
        inset 0 1px 0 #fff;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.alphea-quick-launcher-command:focus-within {
    border-color: #93c5fd;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, .08),
        0 8px 24px rgba(15, 23, 42, .06);
}

.alphea-quick-launcher-command input {
    width: 100%;
    height: 50px;
    padding: 0;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    box-shadow: none !important;
}

.alphea-quick-launcher-command input::placeholder {
    color: #94a3b8;
}

.alphea-quick-launcher-command kbd,
.alphea-quick-launcher-footer kbd {
    display: inline-grid;
    min-width: 23px;
    height: 22px;
    padding: 0 6px;
    place-items: center;
    border: 1px solid #d9e1ea;
    border-bottom-color: #c5d0dc;
    border-radius: 6px;
    background: #f8fafc;
    color: #718096;
    font-family: inherit;
    font-size: 9px;
    font-weight: 850;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .05);
}

.alphea-quick-launcher-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 27px 24px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.alphea-quick-launcher-content::-webkit-scrollbar {
    width: 7px;
}

.alphea-quick-launcher-content::-webkit-scrollbar-track {
    background: transparent;
}

.alphea-quick-launcher-content::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

.alphea-quick-launcher-section + 
.alphea-quick-launcher-section {
    margin-top: 24px;
}

.alphea-quick-launcher-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.alphea-quick-launcher-section-title > span {
    color: #334155;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.alphea-quick-launcher-section-title small {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
}

.alphea-quick-launcher-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.alphea-quick-launcher-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 88px;
    grid-template-columns: 46px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 12px;
    padding: 13px;
    overflow: hidden;
    border: 1px solid #e0e7ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, .84);
    color: #172033;
    text-decoration: none;
    box-shadow:
        0 7px 18px rgba(15, 23, 42, .025);
    transition:
        border-color 140ms ease,
        background 140ms ease,
        transform 140ms ease,
        box-shadow 140ms ease;
}

.alphea-quick-launcher-card:hover,
.alphea-quick-launcher-card:focus,
.alphea-quick-launcher-card.is-active {
    z-index: 2;
    outline: none;
    border-color: #bfdbfe;
    background: #f8fbff;
    transform: translateY(-2px);
    box-shadow:
        0 13px 28px rgba(30, 64, 175, .095);
}

.alphea-quick-launcher-card.is-featured {
    border-color: #c7dafe;
    background:
        linear-gradient(
            135deg,
            rgba(239, 246, 255, .95),
            rgba(255, 255, 255, .96)
        );
}

.alphea-quick-launcher-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    background: #eff6ff;
    color: #2563eb;
}

.alphea-quick-launcher-icon svg {
    width: 23px;
    height: 23px;
}

.alphea-quick-launcher-icon.is-intervention {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.alphea-quick-launcher-icon.is-claim {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.alphea-quick-launcher-icon.is-task {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #16a34a;
}

.alphea-quick-launcher-icon.is-deadline {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.alphea-quick-launcher-icon.is-owner {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #7c3aed;
}

.alphea-quick-launcher-icon.is-building {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0284c7;
}

.alphea-quick-launcher-icon.is-unit {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #059669;
}

.alphea-quick-launcher-icon.is-more {
    border-color: #d8dee8;
    background: #f8fafc;
    color: #475569;
}

.alphea-quick-launcher-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.alphea-quick-launcher-copy strong {
    overflow: hidden;
    color: #172033 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alphea-quick-launcher-copy small {
    overflow: hidden;
    color: #748196;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alphea-quick-launcher-arrow {
    color: #b1bdcb;
    font-size: 16px;
    font-weight: 700;
    transition:
        color 140ms ease,
        transform 140ms ease;
}

.alphea-quick-launcher-card:hover
.alphea-quick-launcher-arrow,
.alphea-quick-launcher-card.is-active
.alphea-quick-launcher-arrow {
    color: #2563eb;
    transform: translateX(2px);
}

.alphea-quick-launcher-card[hidden],
.alphea-quick-launcher-section[hidden] {
    display: none !important;
}

.alphea-quick-launcher-empty {
    display: flex;
    min-height: 270px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.alphea-quick-launcher-empty[hidden] {
    display: none !important;
}

.alphea-quick-launcher-empty > span {
    display: grid;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    place-items: center;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    background: #f8fafc;
    color: #64748b;
    font-size: 25px;
}

.alphea-quick-launcher-empty strong {
    color: #172033;
    font-size: 14px;
}

.alphea-quick-launcher-empty p {
    max-width: 320px;
    margin: 7px 0 15px;
    color: #718096;
    font-size: 11px;
    line-height: 1.55;
}

.alphea-quick-launcher-empty a {
    display: inline-flex;
    padding: 10px 13px;
    border: 1px solid #dbeafe;
    border-radius: 11px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
}

.alphea-quick-launcher-footer {
    display: flex;
    min-height: 48px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 19px;
    padding: 0 27px;
    border-top: 1px solid #e7edf4;
    background: rgba(248, 250, 252, .86);
    color: #8190a4;
    font-size: 9px;
    font-weight: 750;
}

.alphea-quick-launcher-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* MODE SOMBRE */

html[data-alphea-theme="dark"]
.alphea-quick-launcher-dialog {
    border-color: #2b3b52;
    background:
        linear-gradient(
            180deg,
            rgba(20, 32, 52, .995),
            rgba(14, 24, 40, .995)
        );
}

html[data-alphea-theme="dark"]
.alphea-quick-launcher-header h2,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-command input,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-copy strong,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-empty strong {
    color: #f1f5f9 !important;
}

html[data-alphea-theme="dark"]
.alphea-quick-launcher-header p,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-copy small {
    color: #94a3b8;
}

html[data-alphea-theme="dark"]
.alphea-quick-launcher-command,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-card,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-close {
    border-color: #2e4059;
    background: #152238;
}

html[data-alphea-theme="dark"]
.alphea-quick-launcher-card:hover,
html[data-alphea-theme="dark"]
.alphea-quick-launcher-card.is-active {
    border-color: #3b6093;
    background: #192b47;
}

html[data-alphea-theme="dark"]
.alphea-quick-launcher-footer {
    border-color: #28394f;
    background: #101c2e;
}

/* RESPONSIVE */

@media (max-width: 720px) {
    .alphea-quick-launcher {
        padding: 10px;
        place-items: center;
    }

    .alphea-quick-launcher-dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 22px;
    }

    .alphea-quick-launcher-header {
        padding: 21px 19px 16px;
    }

    .alphea-quick-launcher-header h2 {
        font-size: 21px !important;
    }

    .alphea-quick-launcher-command {
        margin: 0 19px;
    }

    .alphea-quick-launcher-content {
        padding: 17px 19px 20px;
    }

    .alphea-quick-launcher-grid {
        grid-template-columns: 1fr;
    }

    .alphea-quick-launcher-footer {
        justify-content: center;
        padding: 0 15px;
    }

    .alphea-quick-launcher-footer > span:first-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .alphea-quick-launcher-trigger {
        min-width: 42px;
        width: 42px;
        padding: 0 !important;
    }

    .alphea-quick-launcher-trigger > span:last-child {
        display: none;
    }

    .alphea-quick-launcher-section-title small {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alphea-quick-launcher *,
    .alphea-quick-launcher-trigger {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   CORRECTION STRUCTURELLE — LANCEUR HORS DE LA TOPBAR
   ========================================================= */

body > .alphea-quick-launcher {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100vh !important;

    display: grid;
    padding: 74px 22px 28px !important;
    place-items: start center !important;

    overflow: hidden !important;
    isolation: isolate;
    transform: none !important;

    z-index: 2147483000 !important;
}

body > .alphea-quick-launcher[hidden] {
    display: none !important;
}

body > .alphea-quick-launcher
.alphea-quick-launcher-backdrop {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

body > .alphea-quick-launcher
.alphea-quick-launcher-dialog {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: min(780px, calc(100vw - 44px)) !important;
    max-width: 780px !important;
    max-height: calc(100dvh - 102px) !important;

    margin: 0 auto !important;

    overflow: hidden !important;
    transform-origin: top center !important;
}

/*
 * Le contenu central défile sans agrandir la fenêtre.
 */
body > .alphea-quick-launcher
.alphea-quick-launcher-content {
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/*
 * Empêche les styles ou transformations de la topbar
 * d'affecter le lanceur.
 */
.alphea-topbar
.alphea-quick-launcher {
    contain: none !important;
}

/* Tablettes et petits écrans */

@media (max-width: 720px) {
    body > .alphea-quick-launcher {
        padding: 12px !important;
        place-items: center !important;
    }

    body > .alphea-quick-launcher
    .alphea-quick-launcher-dialog {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100dvh - 24px) !important;
        border-radius: 22px !important;
    }
}

/*
 * Compatibilité pour les navigateurs ne prenant pas encore
 * totalement en charge l'unité dvh.
 */
@supports not (height: 100dvh) {
    body > .alphea-quick-launcher {
        height: 100vh !important;
    }

    body > .alphea-quick-launcher
    .alphea-quick-launcher-dialog {
        max-height: calc(100vh - 102px) !important;
    }

    @media (max-width: 720px) {
        body > .alphea-quick-launcher
        .alphea-quick-launcher-dialog {
            max-height: calc(100vh - 24px) !important;
        }
    }
}
