html, body {
    min-height: 100%;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-body {
    background:
        radial-gradient(circle at top right, rgba(122, 162, 255, 0.18), transparent 28%),
        radial-gradient(circle at bottom left, rgba(98, 232, 191, 0.16), transparent 24%),
        linear-gradient(135deg, #f5f7fb 0%, #eef2f8 100%);
    color: #1c2340;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(80, 110, 255, 0.28), transparent 22%),
        radial-gradient(circle at bottom right, rgba(18, 186, 149, 0.22), transparent 20%),
        linear-gradient(135deg, #09112a 0%, #1f325f 52%, #162042 100%);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 460px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.app-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    color: white;
    background:
        linear-gradient(180deg, rgba(16, 22, 48, 0.96), rgba(19, 31, 68, 0.95)),
        linear-gradient(145deg, #11182f, #24396b);
    box-shadow: 0 12px 30px rgba(9, 17, 42, 0.24);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: white;
    background: linear-gradient(135deg, #6a8cff 0%, #00c6a7 100%);
    box-shadow: 0 16px 30px rgba(63, 113, 255, 0.35);
}

.brand-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-subtitle {
    color: rgba(255,255,255,0.68);
    font-size: 0.9rem;
}

.sidebar .nav-link {
    border-radius: 16px;
    padding: 0.85rem 1rem;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.02);
    transition: all 0.25s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.content {
    padding: 2rem;
}

.topbar {
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pill-status {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(16, 22, 48, 0.06);
    box-shadow: 0 16px 40px rgba(15, 24, 44, 0.08);
    color: #1c2340;
    font-weight: 600;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #19c37d;
    box-shadow: 0 0 0 8px rgba(25, 195, 125, 0.12);
}

.glass-card,
.table-card,
.metric-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(18, 33, 71, 0.09);
}

.metric-card {
    padding: 1.35rem;
    height: 100%;
}

.brand-badge i {
    font-size: 1.25rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-icon {
    font-size: 1rem;
    opacity: 0.92;
}

.pill-status i {
    font-size: 1rem;
    color: #19c37d;
}

.metric-icon,
.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(77, 115, 255, 0.12), rgba(0, 191, 165, 0.12));
    color: #335fdd;
}

.metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.metric-icon i,
.section-icon i {
    font-size: 1.15rem;
}

.metric-label {
    color: #5d6785;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-trend {
    display: inline-flex;
    margin-top: 0.65rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #eef6ff;
    color: #2456d3;
    font-size: 0.85rem;
    font-weight: 600;
}

.glass-card {
    padding: 1.35rem;
}

.table-card {
    padding: 1rem;
}

.table thead th {
    color: #56627d;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom-width: 1px;
}

.table tbody td {
    vertical-align: middle;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge-soft.status-potentiel,
.badge-soft.status-phase_1,
.badge-soft.status-phase_2,
.badge-soft.status-phase_3,
.badge-soft.status-phase_4,
.badge-soft.status-phase_5 {
    background: #e9f1ff;
    color: #2b5fd9;
}

.badge-soft.status-frigo,
.badge-soft.status-frigo_j90,
.badge-soft.status-frigo_j92,
.badge-soft.status-frigo_j95,
.badge-soft.status-frigo_j100 {
    background: #eef0f7;
    color: #46506d;
}

.badge-soft.status-encours_commercial {
    background: #fff3d9;
    color: #8a5a00;
}

.badge-soft.status-refus_commercial,
.badge-soft.status-cancelled,
.badge-soft.status-failed {
    background: #ffe6e6;
    color: #b12d2d;
}

.badge-soft.status-encaisse,
.badge-soft.status-sent,
.badge-soft.status-Excellent {
    background: #e5fff3;
    color: #007a53;
}

.badge-soft.status-Bon {
    background: #ecf5ff;
    color: #1f6fd0;
}

.badge-soft.status-Moyen {
    background: #fff5df;
    color: #936513;
}

.badge-soft.status-Faible,
.badge-soft.status-skipped {
    background: #f0f0f0;
    color: #666;
}

.form-control,
.form-select {
    border-radius: 14px;
    min-height: 48px;
    border-color: rgba(17, 24, 39, 0.08);
    box-shadow: none !important;
}

.btn {
    border-radius: 14px;
    min-height: 46px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #4d73ff, #00bfa5);
    border: 0;
    box-shadow: 0 14px 32px rgba(71, 113, 255, 0.26);
}

.btn-outline-secondary,
.btn-outline-light {
    border-width: 1px;
}

.progress-soft {
    height: 10px;
    border-radius: 999px;
    background: #ecf0f8;
    overflow: hidden;
}

.progress-soft > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4d73ff 0%, #00bfa5 100%);
}

.kbd-box {
    display: inline-block;
    background: #f5f7fc;
    border: 1px solid #dfe5f2;
    border-radius: 10px;
    padding: 0.25rem 0.55rem;
    font-size: 0.88rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 1rem;
    }
}


.login-shell {
    width: 100%;
    max-width: 1160px;
    display: grid;
    grid-template-columns: 1.22fr 0.78fr;
    gap: 1.5rem;
    align-items: stretch;
}

.login-hero-panel,
.login-card-panel {
    position: relative;
}

.login-hero-panel {
    overflow: hidden;
    border-radius: 34px;
    min-height: 720px;
    padding: 3rem;
    color: white;
    background:
        radial-gradient(circle at 18% 20%, rgba(82, 182, 255, 0.26), transparent 20%),
        radial-gradient(circle at 84% 18%, rgba(7, 214, 172, 0.20), transparent 18%),
        linear-gradient(145deg, rgba(7, 17, 46, 0.96), rgba(14, 30, 72, 0.92));
    box-shadow: 0 30px 80px rgba(5, 10, 31, 0.35);
}

.login-hero-glow {
    position: absolute;
    inset: auto -80px -80px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 198, 167, 0.28), transparent 65%);
    pointer-events: none;
}

.login-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.1rem;
}

.login-display-title {
    max-width: 640px;
    font-size: clamp(2.2rem, 4.8vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    font-weight: 800;
    margin-bottom: 1rem;
}

.login-display-copy {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.login-feature-grid {
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.login-feature-card {
    padding: 1.25rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.login-feature-value {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.35rem;
}

.login-feature-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.login-card-panel {
    display: grid;
    place-items: center;
}

.login-card {
    width: 100%;
    max-width: 410px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(24px);
    padding: 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.login-form-shell {
    max-width: 340px;
    margin: 0 auto;
}

.login-form-heading h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-form-heading p {
    line-height: 1.6;
    font-size: 0.96rem;
}

.login-input-group {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.06);
}

.login-input-group .input-group-text,
.login-input-group .form-control,
.login-input-group .btn {
    border-color: #e5e9f3;
}

.login-input-group .input-group-text {
    background: #f7f9fd;
    color: #64708b;
    min-width: 58px;
    justify-content: center;
    font-weight: 700;
}

.login-input-group .form-control {
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
}

.login-input-group .form-control:focus {
    box-shadow: none;
}

.login-input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(64, 99, 255, 0.12), 0 16px 30px rgba(17, 24, 39, 0.08);
}

.login-submit-btn {
    border-radius: 18px;
    padding-top: 0.88rem;
    padding-bottom: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 30px rgba(63, 113, 255, 0.25);
}

.login-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.login-meta-pill {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #f3f6fb;
    color: #53617b;
    font-size: 0.82rem;
    font-weight: 600;
}

.kbd-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0.18rem 0.5rem;
    border-radius: 0.55rem;
    background: #edf2ff;
    color: #3450b9;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero-panel {
        min-height: auto;
        padding: 2rem;
    }

    .login-feature-grid {
        margin-top: 2rem;
        grid-template-columns: 1fr;
    }

    .login-card,
    .login-form-shell {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .login-body {
        padding: 1rem;
    }

    .login-hero-panel,
    .login-card {
        border-radius: 26px;
    }

    .login-hero-panel,
    .login-card {
        padding: 1.4rem;
    }
}

.login-feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.08);
}

.login-feature-icon i {
    font-size: 1.15rem;
}

.login-input-group .input-group-text i {
    font-size: 1rem;
}

.phase-card {
    border: 0;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1rem 3rem rgba(15, 23, 42, .08);
}
.phase-toggle {
    width: 100%;
    border: 0;
    padding: 1rem 1.25rem;
    color: #fff;
    text-align: left;
    cursor: pointer;
}
.phase-toggle:hover,
.phase-toggle:focus {
    filter: brightness(1.03);
    outline: none;
}
.phase-head-danger { background: linear-gradient(135deg, #dc3545, #b42332); }
.phase-head-warning { background: linear-gradient(135deg, #fd7e14, #f59f00); }
.phase-head-orange-soft { background: linear-gradient(135deg, #f6ad55, #ed8936); }
.phase-head-success { background: linear-gradient(135deg, #198754, #157347); }
.phase-head-primary { background: linear-gradient(135deg, #0d6efd, #0b5ed7); }
.phase-head-purple { background: linear-gradient(135deg, #6f42c1, #59359c); }
.phase-chevron {
    transition: transform .2s ease;
    font-size: 1.15rem;
}
.phase-toggle[aria-expanded="true"] .phase-chevron {
    transform: rotate(180deg);
}
.phase-body {
    background: #ffffff;
    border-top: 1px solid rgba(15, 23, 42, .06);
}
.message-card {
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.message-card .form-label,
.message-card .fw-semibold,
.message-card code {
    color: #0f172a;
}
.message-card .text-muted {
    color: #475569 !important;
}
/* STOP / Import AJAX */
.stop-page .stop-alert:empty {
    display: none;
}

.stop-page .stop-drop-hint {
    background: rgba(255, 255, 255, 0.62);
    border: 1px dashed rgba(17, 24, 39, 0.16);
}

.stop-page code {
    color: #26375f;
}

.stop-page #stop-import-button .spinner-border {
    width: 1rem;
    height: 1rem;
}
