/* Police Inter hébergée sur le site (licence SIL OFL, voir ../fonts/Inter-OFL.txt) : plus aucune requête vers
   Google Fonts, l'adresse IP des visiteurs ne leur est plus transmise. Une seule police variable couvre les graisses 100 à 900. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations'), url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations'), url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Identité visuelle (adoptée le 4 novembre 2026, d'après l'aperçu /apercu) : Sora pour les titres, JetBrains Mono pour les
   petites étiquettes, Inter pour le texte. Mêmes licences SIL OFL (../fonts/). */
@font-face { font-family: 'Sora'; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url('../fonts/sora-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url('../fonts/sora-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url('../fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
    src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --bs-body-bg: #0A0E17;
    --bs-body-color: #E5E7EB;
    --bs-tertiary-bg: #111827;
    --bg-color: #0A0E17;
    --card-bg: #111827;
    --card-bg-2: #1F2937;
    --primary: #FF5C39;
    --on-primary: #1A0B05; /* texte sur orange : 6,1:1 */
    --accent: #FFA500;
    --accent-text: #FFB84D;
    --text-main: #FFFFFF;
    --text-body: #E5E7EB;
    --text-muted: #A3ACBA;
    --primary-text: #FF7A5C; /* orange lisible en texte (AA sur fond sombre) */
    --primary-soft: rgba(255, 92, 57, 0.14);
    --primary-line: rgba(255, 122, 92, 0.6);
    --font-main: 'Inter', sans-serif;
    --font-title: 'Sora', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --star: rgba(255, 255, 255, 0.45);
}

[data-bs-theme="light"] {
    --bs-body-bg: #F5F6F8;
    --bs-body-color: #1F2937;
    --bs-tertiary-bg: #FFFFFF;
    --bg-color: #F5F6F8;
    --card-bg: #FFFFFF;
    --card-bg-2: #F3F4F6;
    --primary: #FF5C39;
    --on-primary: #1A0B05;
    --accent: #FFA500;
    --accent-text: #B45309;
    --text-main: #111827;
    --text-body: #1F2937;
    --text-muted: #4B5563; /* AA sur #F5F6F8 */
    --primary-text: #C2410C; /* orange foncé : AA sur fond clair (4,5:1 mini) */
    --primary-soft: rgba(255, 92, 57, 0.12);
    --primary-line: rgba(194, 65, 12, 0.55);
    --border-subtle: rgba(17, 24, 39, 0.10);
    --border-strong: rgba(17, 24, 39, 0.18);
    --star: rgba(17, 24, 39, 0.14);
}

/* Accessibilité : le focus clavier reste toujours visible (prime sur les "outline: none" locaux) */
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
input:focus-visible, textarea:not(.editor-textarea):focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px;
}

/* Typography */
body { font-family: var(--font-main); }
h1, h2, h3, h4, h5, h6 { font-weight: 600; margin-bottom: 1rem; color: var(--text-main); }
h1, h2, h3 { font-family: var(--font-title); letter-spacing: -0.2px; }
h1 { font-weight: 700; }
.mars-eyebrow { margin: 0 0 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent-text); }
.mars-mono { font-family: var(--font-mono); }

/* Fond étoilé discret (pages avec la barre latérale) */
.app-wrapper {
    background-image:
        radial-gradient(1px 1px at 12% 18%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 72% 12%, var(--star) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 38% 64%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 48%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 22% 82%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 56% 34%, var(--star) 50%, transparent 51%);
    background-size: 420px 420px;
}
p { color: var(--text-main); }
.text-muted { color: var(--text-muted) !important; }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; background-color: var(--bg-color); color: var(--text-main); }
.main-content { flex-grow: 1; padding: 2rem; overflow-y: auto; }

/* Sidebar */
.sidebar { width: 260px; min-width: 260px; background: color-mix(in srgb, var(--bg-color) 82%, var(--card-bg)); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; transition: all 0.3s; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 2rem 1.5rem; display: flex; align-items: center; gap: 12px; }
.sidebar-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.sidebar-nav { flex-grow: 1; display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1rem; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 0.7rem 0.9rem; color: var(--text-muted); text-decoration: none; border-radius: 12px; font-weight: 500; transition: all 0.2s; }
.sidebar-nav a:hover { background: var(--card-bg); color: var(--text-main); }
.sidebar-nav a.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.sidebar-nav a i { font-size: 1.1rem; width: 20px; text-align: center; }

/* Cards & Widgets */
.mars-card { background: var(--card-bg); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 1.5rem; transition: all 0.3s; color: var(--text-main); }
.mars-card.glow:hover { border-color: rgba(255, 92, 57, 0.65); box-shadow: 0 0 0 1px rgba(255, 92, 57, 0.35), 0 12px 32px -12px rgba(255, 92, 57, 0.55); }

/* Forms & Inputs */
.mars-input { background: rgba(0,0,0,0.2); border: 1px solid var(--border-subtle); color: var(--text-main); padding: 0.75rem 1rem; border-radius: 8px; width: 100%; transition: all 0.2s; }
[data-bs-theme="light"] .mars-input { background: #FFFFFF; }
.mars-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 92, 57, 0.1); }

/* Buttons */
/* Boutons en pilule : orange et texte sombre (6,1:1) dans les deux thèmes */
.btn-mars { background: var(--primary); color: var(--on-primary) !important; border: none; padding: 0.75rem 1.4rem; border-radius: 999px; font-weight: 700; letter-spacing: 0.3px; cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-block; text-align: center; }
.btn-mars:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-mars-outline { background: transparent; color: var(--text-main) !important; border: 1px solid var(--primary-line); padding: 0.75rem 1.4rem; border-radius: 999px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-block; text-align: center; }
.btn-mars-outline:hover { border-color: var(--primary-text); background: var(--primary-soft); }
.btn-primary {
    --bs-btn-bg: #FF5C39; --bs-btn-border-color: #FF5C39; --bs-btn-color: #1A0B05;
    --bs-btn-hover-bg: #FF7350; --bs-btn-hover-border-color: #FF7350; --bs-btn-hover-color: #1A0B05;
    --bs-btn-active-bg: #E04A2C; --bs-btn-active-border-color: #E04A2C; --bs-btn-active-color: #1A0B05;
    --bs-btn-disabled-bg: #FF5C39; --bs-btn-disabled-border-color: #FF5C39; --bs-btn-disabled-color: #1A0B05;
    font-weight: 700;
}
.btn-outline-primary {
    --bs-btn-color: var(--primary-text); --bs-btn-border-color: var(--primary-line);
    --bs-btn-hover-bg: var(--primary-soft); --bs-btn-hover-border-color: var(--primary-text); --bs-btn-hover-color: var(--text-main);
    --bs-btn-active-bg: var(--primary-soft); --bs-btn-active-border-color: var(--primary-text); --bs-btn-active-color: var(--text-main);
}

/* App Launcher Grid */
.app-launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 1rem; }
.app-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; aspect-ratio: 1; background: rgba(255,255,255,0.02); border: 1px solid var(--border-subtle); border-radius: 12px; color: var(--text-muted); text-decoration: none; transition: all 0.2s; }
.app-icon:hover { background: rgba(255, 92, 57, 0.05); color: var(--primary-text); border-color: rgba(255, 92, 57, 0.2); transform: translateY(-2px); }
.app-icon i { font-size: 1.8rem; }
.app-icon span { font-size: 0.75rem; font-weight: 500; text-align: center; }

.sidebar::-webkit-scrollbar { width: 4px; } .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.main-content { flex: 1; min-width: 0; width: 100%; overflow-x: hidden; box-sizing: border-box; }

html, body { margin: 0 !important; padding: 0 !important; width: 100%; min-height: 100%;  }

.mobile-menu-toggle {
    display: none;
}
.nav-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.nav-group-title:hover {
    color: var(--text-main);
}
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 0.75rem 1rem; color: var(--text-muted); text-decoration: none; border-radius: 8px; font-weight: 500; transition: all 0.2s;
}
.nav-item { border-radius: 12px; }
.nav-item:hover { background: var(--card-bg); color: var(--text-main); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.nav-group-title { font-family: var(--font-mono); font-size: 0.72rem !important; letter-spacing: 1.6px; text-transform: uppercase; }
.nav-item i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer {
    padding: 1rem; margin-top: auto; border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center;
}

@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        z-index: 1000;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .sidebar-header {
        flex: 1;
        padding: 1rem;
        min-width: 200px;
    }
    .sidebar-footer {
        display: flex !important;
        border-top: none;
        margin-top: 0;
        padding: 1rem;
        gap: 15px;
        width: auto;
    }
    .sidebar-nav {
        width: 100%;
        display: none;
    }
    .sidebar.expanded .sidebar-nav {
        display: flex;
    }
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 1.5rem;
        cursor: pointer;
    }
    .main-content {
        padding: 1rem;
    }
}