:root {
    /* --- COULEURS ENTREPRISE --- */
    --brand-primary: #6b489d;   /* Violet haut du dégradé */
    --brand-secondary: #2e91f7; /* Bleu bas du dégradé */

    --sidebar-width: 300px;
    
    /* Sidebar : On adapte pour un fond coloré vif */
    --sidebar-bg: var(--brand-primary); /* Fallback */
    --sidebar-text: #e8e8e8; /* Blanc cassé conforme WCAG (was rgba(255,255,255,0.75)) */
    --sidebar-text-hover: #ffffff; /* Blanc pur pour le survol */
    --sidebar-active-color: #ffffff; /* Blanc pur pour l'élément actif (contraste max) */
    --sidebar-active-bg: rgba(255, 255, 255, 0.15); /* Fond subtil pour l'actif */
    --sidebar-border: rgba(255, 255, 255, 0.1); /* Bordures discrètes */
    
    --bg-body: #f3f4f6;
    --card-border: #e5e7eb;
    
    /* Method colors - Conservées car standard API, mais harmonisées si besoin */
    --get-bg: #eff6ff; --get-text: #2563eb; --get-border: #bfdbfe;
    --post-bg: #f0fdf4; --post-text: #15803d; --post-border: #bbf7d0;
    --put-bg: #fff7ed; --put-text: #c2410c; --put-border: #fed7aa;
    --delete-bg: #fef2f2; --delete-text: #b91c1c; --delete-border: #fecaca;
    --patch-bg: #f5f3ff; --patch-text: #7c3aed; --patch-border: #ddd6fe;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: #1f2937;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Liens globaux (hors sidebar) aux couleurs de la marque */
a { color: var(--brand-secondary); text-decoration: none; }
a:hover { color: var(--brand-primary); text-decoration: underline; }

/* Sidebar Styling */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar-wrapper {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    /* Application du dégradé entreprise */
    background: linear-gradient(180deg, var(--brand-primary) 29%, var(--brand-secondary) 183%) !important;
    /* Note: J'ai retiré le 'multiply' qui assombrissait trop le rendu sur fond noir */
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: margin 0.25s ease-out;
    padding-bottom: 50px;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand a { color: #fff; text-decoration: none; }

/* --- RECHERCHE (Adaptée pour fond coloré) --- */
.search-wrapper {
    padding: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    /* Fond transparent pour laisser voir le dégradé */
    background-color: transparent; 
    z-index: 10;
    backdrop-filter: blur(5px); /* Petit effet de flou moderne */
}

.search-input {
    /* Fond noir semi-transparent (Glassmorphism) */
    background-color: rgba(0, 0, 0, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    font-weight: 500;
}

.search-input::placeholder {
    color: #d4d4d4 !important; /* Conforme WCAG (was rgba(255,255,255,0.6)) */
    opacity: 1;
}

.search-input:focus {
    background-color: rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
    border-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}
/* ----------------------------------------- */

/* Sidebar Links */
.sidebar-nav { padding: 1rem 0; }
.accordion-item {
    background-color: transparent;
    border: none;
}
.accordion-button {
    background-color: transparent;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
    background-color: rgba(0, 0, 0, 0.1); /* Assombrir légèrement quand ouvert */
    color: var(--sidebar-text-hover);
}
/* Flèche blanche */
.accordion-button::after { filter: brightness(0) invert(1); opacity: 0.7; }

.sidebar-item {
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
    color: var(--sidebar-text);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    color: var(--sidebar-text-hover);
    background-color: rgba(255, 255, 255, 0.1); /* Survol blanc léger */
}

/* État Actif (Navigation) */
.sidebar-item:active,
.sidebar-item.active {
    color: var(--sidebar-active-color) !important;
    background-color: var(--sidebar-active-bg);
    border-left-color: var(--sidebar-active-color);
    font-weight: 600;
}

.sidebar-method-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; margin-right: 10px;
    flex-shrink: 0;
    /* Optionnel : faire ressortir les dots sur le fond violet */
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* Main Content */
#page-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: 100%;
    transition: margin 0.25s ease-out;
}

/* Cards & Endpoints */
.endpoint-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
    scroll-margin-top: 20px;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.highlight-endpoint {
    /* Utilisation de la couleur primaire pour le focus */
    box-shadow: 0 0 0 4px rgba(107, 72, 157, 0.25); 
    border-color: var(--brand-primary);
}

.endpoint-header {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--card-border);
}

.path-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #374151;
    word-break: break-all;
}

.method-badge {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-right: 1rem;
    min-width: 60px;
    text-align: center;
}

/* Method Colors */
.m-GET { background: var(--get-bg); color: var(--get-text); border: 1px solid var(--get-border); }
.m-POST { background: var(--post-bg); color: var(--post-text); border: 1px solid var(--post-border); }
.m-PUT { background: var(--put-bg); color: var(--put-text); border: 1px solid var(--put-border); }
.m-DELETE { background: var(--delete-bg); color: var(--delete-text); border: 1px solid var(--delete-border); }
.m-PATCH { background: var(--patch-bg); color: var(--patch-text); border: 1px solid var(--patch-border); }

/* Endpoint Body */
.endpoint-body { padding: 1.5rem; }
.endpoint-desc { color: #4b5563; font-size: 0.95rem; margin-bottom: 1.5rem; }
.endpoint-desc p { margin-bottom: 0.5rem; }

/* Tables */
.table-custom th { font-weight: 600; color: #374151; background: #f9fafb; font-size: 0.85rem; }
.table-custom td { vertical-align: middle; }
.code-snippet { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; }
.required-mark { color: #dc2626; font-weight: bold; margin-left: 4px; }

/* JSON Viewer & Tabs */
.json-viewer-container {
    background-color: #111827; 
    border-radius: 6px;
    margin-top: 10px;
    overflow: hidden;
    display: none;
}
.json-viewer-container.show { display: block; animation: slideDown 0.3s ease-out; }

.resp-tabs {
    display: flex;
    background-color: #1f2937;
    border-bottom: 1px solid #374151;
}
.resp-tab-btn {
    background: none; border: none;
    color: #9ca3af;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    border-right: 1px solid #374151;
}
.resp-tab-btn:hover { color: #fff; }

/* Tab active aux couleurs de l'entreprise */
.resp-tab-btn.active { 
    background-color: #111827; 
    color: var(--brand-secondary); /* Bleu entreprise */
    font-weight: 600; 
    border-top: 2px solid var(--brand-secondary); 
}

.resp-tab-content { display: none; padding: 1rem; }
.resp-tab-content.active { display: block; }

.json-viewer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #e5e7eb;
    margin: 0;
    white-space: pre-wrap;
    overflow-x: auto;
}
.jv-key { color: #93c5fd; }
.jv-string { color: #a5f3fc; }
.jv-number { color: #fca5a5; }
.jv-boolean { color: #fde047; }
.jv-null { color: #b5bcc7; }

/* Response Rows */
.response-row { cursor: pointer; transition: background 0.1s; border-radius: 4px; }
.response-row:hover { background-color: #f3f4f6; }
.chevron-icon { width: 16px; height: 16px; opacity: 0.5; transition: transform 0.2s; }
.response-row[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); }

/* Schema Table in Response */
.schema-table { width: 100%; font-size: 0.85rem; color: #d1d5db; }
.schema-row td { padding: 4px 0; vertical-align: top; }
.schema-prop { color: #93c5fd; font-family: monospace; font-weight: bold; }
.schema-type { color: #fca5a5; font-family: monospace; margin-right: 8px; }
.schema-desc { color: #9ca3af; }
.schema-enum { 
    display: inline-block; padding: 1px 4px; margin: 2px;
    border: 1px solid #374151; border-radius: 3px;
    color: #a5f3fc; font-family: monospace; font-size: 0.75em;
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile */
@media (max-width: 992px) {
    #sidebar-wrapper { margin-left: calc(-1 * var(--sidebar-width)); }
    #sidebar-wrapper.toggled { margin-left: 0; }
    #page-content-wrapper { margin-left: 0; }
    #wrapper.toggled #page-content-wrapper { margin-left: 0; } 
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
/* Adaptation scrollbar sidebar pour fond coloré */
#sidebar-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
#sidebar-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.7); } /* Conforme WCAG */