* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b1020;
    color: #f5f5f7;
    overflow: hidden;
    /* On garde pour empêcher le scroll global */
    height: 100vh;
    /* IMPORTANT */
    display: flex;
    flex-direction: column;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 0.75rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(5, 8, 20, 0.9);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 75px;          
    width: auto;
    display: block;
    margin-left: -30px;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}


header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

header h1 span {
    color: #4ade80;
}

header small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.btn.loading {
    opacity: 0.8;
    cursor: wait;
    pointer-events: none;
}

.btn.loading i {
    animation: spin 1.2s linear infinite;
}

/* si tu veux un spinner dédié */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.badge {
    font-size: 0.75rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    opacity: 0.85;
    white-space: nowrap;
}

.nav-btn {
    border: none;
    background: transparent;
    color: #e5e7eb;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s ease, transform 0.05s ease, color 0.15s ease;
}

.nav-btn span.icon {
    font-size: 0.9rem;
    opacity: 0.8;
    width: 16px;
    display: inline-flex;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(148, 163, 184, 0.15);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #020617;
    font-weight: 600;
}

.nav-btn.active span.icon {
    opacity: 1;
}

.layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 1.5rem 2rem 2.5rem;
    overflow-y: auto;
    min-height: 0;
}

/* Scrollbar custom */
.content {
    scrollbar-width: thin;
    scrollbar-color: #4ade80 rgba(15, 23, 42, 0.9);
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
}

.content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4ade80, #22c55e);
    border-radius: 999px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.section {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.section>p.section-subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.card {
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.25), rgba(15, 23, 42, 0.85));
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.card-soft {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 1rem;
    padding: 1.2rem 1.4rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.8);
}

.card-soft,
.card {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

.card-soft:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.7);
}

.modal-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

/* classe intermédiaire pour la fermeture */
.modal-backdrop.closing {
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-panel {
    transform: translateY(10px) scale(0.97);
    opacity: 0;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.modal-backdrop.active .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.15rem;
    display: block;
}

input,
select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.8);
    color: #f5f5f7;
    font-size: 0.9rem;
    outline: none;
}

input:focus,
select:focus {
    border-color: #4ade80;
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.4);
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: transform 0.05s ease, box-shadow 0.1s ease, background 0.15s ease;
    white-space: nowrap;
}

.btn i {
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #020617 !important;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
        background: linear-gradient(135deg, #4ade80, #22c55e) !important;

    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(34, 197, 94, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.btn-outline:hover {
    background: rgba(148, 163, 184, 0.1);
}

.btn-danger {
    border-color: rgba(248, 113, 113, 0.8);
    color: #ff0000;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.16);
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.stat-value {
    font-size: 1.4rem;
    margin-top: 0.3rem;
    font-weight: 600;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.18);
    color: #00ff59;
    margin-top: 0.45rem;
}

.stat-chip.loss {
    background: rgba(248, 113, 113, 0.15);
    color: #ff0000;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.87rem;
}

thead {
    background: rgba(15, 23, 42, 0.95);
}

th,
td {
    padding: 0.55rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

th {
    font-weight: 500;
    opacity: 0.8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

tbody tr:hover {
    background: rgba(15, 23, 42, 0.8);
}

.pill {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pill-long {
    background: rgba(22, 163, 74, 0.18);
    color: #00ff59;
}

.pill-short {
    background: rgba(248, 113, 113, 0.15);
    color: #ff0000;
}

.pill-win {
    background: rgba(22, 163, 74, 0.18);
    color: #00ff59;
}

.pill-loss {
    background: rgba(248, 113, 113, 0.15);
    color: #ff0000;
}

.flex {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.text-muted {
    font-size: 0.8rem;
    opacity: 0.75;
}

.text-right {
    text-align: right;
}

.text-success {
    color: #4ade80;
}

.text-danger {
    color: #ff0000;
}

footer {
    padding: 0.7rem 2rem;
    font-size: 0.75rem;
    opacity: 0.8;
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    background: #020617;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

canvas {
    width: 100% !important;
    max-height: 260px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.modal-backdrop.active {
    display: flex;
}

.modal-panel {
    background: #020617;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 480px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
}

.modal-close-btn:hover {
    color: #e5e7eb;
}

.account-type-options {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.account-type-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    cursor: pointer;
}

.account-type-option input {
    accent-color: #22c55e;
    cursor: pointer;
}

/* Filtres dashboard (menu déroulant) */
/* Filtres dashboard (menu déroulant) */
.filters-bar {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 130px;
}

/* Version animée (slide down) */
.filters-panel {
    overflow: hidden;
    max-height: 400px;              /* hauteur max quand ouvert */
    opacity: 1;
    transition:
        max-height 0.25s ease-out,
        opacity 0.25s ease-out,
        padding-top 0.25s ease-out,
        padding-bottom 0.25s ease-out;
}

/* Quand on "ferme" avec la classe collapsed */
.filters-panel.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}


/* Loading screen */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #111827, #020617);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.25s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-box {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
}

/* logo dans l'écran de chargement */
.logo-loading {
    height: 46px;
    width: auto;
    display: block;
}

/* tu peux garder ces règles existantes pour le container */
.loading-box-title {
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.8;
    text-align: center;
    margin-bottom: 0.25rem;
}



.loading-box-title span {
    color: #4ade80;
}

.spinner {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.35);
    border-top-color: #4ade80;
    animation: spin 0.9s linear infinite;
}

.loading-text {
    font-size: 0.85rem;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.35rem;
    }

    .header-right {
        margin-left: auto;
    }
}

@media (max-width: 900px) {
    .content {
        padding-inline: 1.3rem;
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
    }

    .flex-between>div:last-child {
        align-self: stretch;
        display: flex;
        justify-content: flex-start;
    }

    .header-right {
        align-self: flex-start;
    }
}

.install-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.install-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: width 0.25s ease-out;
}
