/* ==========================================================================
   VisiDog Enterprise — Guide Administrateur (Styles CSS)
   ========================================================================== */

:root {
    --vd-navy: #002858;
    --vd-navy-dark: #001a3a;
    --vd-blue: #4898d8;
    --vd-blue-light: #eaf4fc;
    --vd-blue-hover: #357ebd;
    --vd-slate: #f8fafc;
    --vd-card-bg: #ffffff;
    --vd-border: #e2e8f0;
    --vd-text-dark: #1e293b;
    --vd-text-muted: #64748b;
    --vd-success: #16a34a;
    --vd-success-bg: #f0fdf4;
    --vd-warning: #d97706;
    --vd-warning-bg: #fffbeb;
    --vd-danger: #dc2626;
    --vd-danger-bg: #fef2f2;
    --vd-code-bg: #f1f5f9;
    --vd-sidebar-width: 280px;
    --vd-header-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--vd-text-dark);
    background-color: var(--vd-slate);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
   RÈGLES DE VISIBILITÉ BILINGUE
   ------------------------------------------------------------- */
body.lang-en .lang-fr {
    display: none !important;
}

body.lang-fr .lang-en {
    display: none !important;
}

/* -------------------------------------------------------------
   EN-TÊTE FIXE (TOPBAR)
   ------------------------------------------------------------- */
.doc-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--vd-header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--vd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.doc-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--vd-navy);
}

.doc-brand img,
.doc-brand-logo {
    height: 2rem;
    max-height: 2rem;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.doc-logo-badge {
    background: linear-gradient(135deg, var(--vd-navy), var(--vd-blue));
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.05rem;
}

.doc-brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01rem;
}

.doc-brand-subtitle {
    font-size: 0.75rem;
    color: var(--vd-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin-left: 0.25rem;
}

.doc-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Barre de recherche dans la doc */
.doc-search-box {
    position: relative;
    width: 260px;
}

.doc-search-input {
    width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    font-size: 0.85rem;
    border: 1px solid var(--vd-border);
    border-radius: 6px;
    background: var(--vd-slate);
    outline: none;
    transition: all 0.2s ease;
}

.doc-search-input:focus {
    background: #ffffff;
    border-color: var(--vd-blue);
    box-shadow: 0 0 0 3px rgba(72, 152, 216, 0.15);
}

.doc-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--vd-text-muted);
    pointer-events: none;
}

/* Sélecteur de Langue */
.vd-lang-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--vd-slate);
    border: 1px solid var(--vd-border);
    border-radius: 6px;
    padding: 2px;
}

.vd-lang-btn {
    border: none;
    background: transparent;
    color: var(--vd-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vd-lang-btn:hover {
    color: var(--vd-navy);
}

.vd-lang-btn.active {
    background: #ffffff;
    color: var(--vd-navy);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.doc-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vd-navy);
    background: var(--vd-blue-light);
    border: 1px solid rgba(72, 152, 216, 0.3);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.doc-btn-back:hover {
    background: var(--vd-blue);
    color: #ffffff;
}

/* -------------------------------------------------------------
   DISPOSITION PRINCIPALE (LAYOUT)
   ------------------------------------------------------------- */
.doc-layout {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - var(--vd-header-height));
}

/* Sidebar Navigation */
.doc-sidebar {
    width: var(--vd-sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: var(--vd-header-height);
    height: calc(100vh - var(--vd-header-height));
    overflow-y: auto;
    background: #ffffff;
    border-right: 1px solid var(--vd-border);
    padding: 1.5rem 1rem 3rem 1rem;
}

.doc-nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin: 1.25rem 0 0.5rem 0.75rem;
}

.doc-nav-section-title:first-child {
    margin-top: 0;
}

.doc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--vd-text-dark);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    font-weight: 500;
}

.doc-nav-link:hover {
    background: var(--vd-slate);
    color: var(--vd-blue);
}

.doc-nav-link.active {
    background: var(--vd-blue-light);
    color: var(--vd-navy);
    font-weight: 700;
    border-left: 3px solid var(--vd-blue);
    border-radius: 0 6px 6px 0;
}

.doc-nav-badge {
    font-size: 0.7rem;
    background: var(--vd-code-bg);
    color: var(--vd-text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: auto;
}

/* Zone de contenu principale */
.doc-content {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 3.5rem;
    max-width: 960px;
}

/* -------------------------------------------------------------
   TYPOGRAPHIE & TITRES
   ------------------------------------------------------------- */
.doc-hero {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--vd-border);
}

.doc-tag-pill {
    display: inline-block;
    background: var(--vd-blue-light);
    color: var(--vd-blue);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.doc-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--vd-navy);
    letter-spacing: -0.03rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.doc-subtitle {
    font-size: 1.15rem;
    color: var(--vd-text-muted);
    line-height: 1.5;
}

.doc-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: calc(var(--vd-header-height) + 1.5rem);
}

.doc-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vd-navy);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--vd-blue-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--vd-text-dark);
    margin: 1.75rem 0 0.75rem 0;
}

.doc-section p {
    margin-bottom: 1rem;
    color: #334155;
    line-height: 1.7;
}

.doc-section ul, .doc-section ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    color: #334155;
}

.doc-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* -------------------------------------------------------------
   COMPOSANTS : CALLOUTS (NOTES, TIPS, ALERTES)
   ------------------------------------------------------------- */
.doc-callout {
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--vd-border);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.doc-callout-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.doc-callout-info {
    border-left-color: var(--vd-blue);
    background: var(--vd-blue-light);
}
.doc-callout-info .doc-callout-title {
    color: var(--vd-navy);
}

.doc-callout-tip {
    border-left-color: var(--vd-success);
    background: var(--vd-success-bg);
}
.doc-callout-tip .doc-callout-title {
    color: var(--vd-success);
}

.doc-callout-warning {
    border-left-color: var(--vd-warning);
    background: var(--vd-warning-bg);
}
.doc-callout-warning .doc-callout-title {
    color: var(--vd-warning);
}

.doc-callout-security {
    border-left-color: var(--vd-navy);
    background: linear-gradient(to right, rgba(0, 40, 88, 0.05), rgba(72, 152, 216, 0.08));
    border: 1px solid rgba(0, 40, 88, 0.15);
    border-left: 4px solid var(--vd-navy);
}
.doc-callout-security .doc-callout-title {
    color: var(--vd-navy);
}

/* -------------------------------------------------------------
   COMPOSANTS : ÉTAPES PAS-À-PAS
   ------------------------------------------------------------- */
.doc-steps {
    list-style: none;
    margin: 1.5rem 0 !important;
    padding: 0 !important;
}

.doc-step-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.75rem;
}

.doc-step-item::before {
    content: '';
    position: absolute;
    left: 1.15rem;
    top: 2.2rem;
    bottom: -1.2rem;
    width: 2px;
    background: var(--vd-border);
}

.doc-step-item:last-child::before {
    display: none;
}

.doc-step-num {
    position: absolute;
    left: 0;
    top: 0;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--vd-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 40, 88, 0.2);
}

.doc-step-content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vd-navy);
    margin-bottom: 0.35rem;
}

/* -------------------------------------------------------------
   COMPOSANTS : CARTES DE CONFIGURATION & TABLEAUX
   ------------------------------------------------------------- */
.doc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.doc-feature-card {
    background: #ffffff;
    border: 1px solid var(--vd-border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}

.doc-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.doc-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vd-navy);
    margin-bottom: 0.4rem;
}

.doc-card-desc {
    font-size: 0.88rem;
    color: var(--vd-text-muted);
    line-height: 1.5;
}

/* Tableaux */
.doc-table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--vd-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.doc-table th {
    background: var(--vd-slate);
    color: var(--vd-navy);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--vd-border);
}

.doc-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--vd-border);
    color: #334155;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table tr:hover td {
    background-color: rgba(248, 250, 252, 0.7);
}

/* Badges & Codes */
.doc-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.doc-badge-green { background: #dcfce7; color: #166534; }
.doc-badge-blue  { background: #e0f2fe; color: #0369a1; }
.doc-badge-amber { background: #fef3c7; color: #92400e; }
.doc-badge-purple{ background: #f3e8ff; color: #6b21a8; }

.doc-code-inline {
    background: var(--vd-code-bg);
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.06);
}

.doc-crockford-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 2px dashed var(--vd-blue);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    color: var(--vd-navy);
    letter-spacing: 0.08rem;
}

/* Blocs préformatés */
.doc-code-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 1.25rem 0;
}

/* -------------------------------------------------------------
   RESPONSIVE (MOBILE & TABLETTE)
   ------------------------------------------------------------- */
@media (max-width: 992px) {
    .doc-sidebar {
        display: none;
    }
    .doc-content {
        padding: 2rem 1.5rem;
    }
    .doc-search-box {
        width: 180px;
    }
}

@media (max-width: 600px) {
    .doc-header {
        padding: 0 1rem;
    }
    .doc-search-box {
        display: none;
    }
    .doc-title {
        font-size: 1.7rem;
    }
}
