/* Framework CSS Documentation - Le Pacte des Loups */
/* Basé sur framework-unified.css + adaptations spécifiques docs */
/* Compatible Chrome 34+ - Version harmonisée pour documentation */

/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600&display=swap');

/* ===== RESET ET BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    min-height: 100vh;
    font-family: 'Crimson Pro', serif;
    color: #e2e2e2;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== COULEURS SPÉCIFIQUES DOCUMENTATION ===== */
body[data-domain="docs"] {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
}

/* ===== SCROLLBAR UNIVERSELLE ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(244, 162, 97, 0.7);
    border-radius: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(30, 30, 46, 0.2);
    border-radius: 5px;
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 162, 97, 0.7) rgba(30, 30, 46, 0.2);
}

/* ===== HEADER DOCUMENTATION ===== */
.header {
    background: rgba(30, 30, 46, 0.95);
    padding: 10px 20px 2px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    height: 52px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* ===== LAYOUT PRINCIPAL DOCUMENTATION ===== */
.main-layout {
    display: flex;
    height: calc(100vh - 52px);
    margin-top: 52px;
}

/* ===== SIDEBAR DOCUMENTATION ===== */
.sidebar {
    width: 350px;
    background: rgba(30, 30, 46, 0.95);
    border-right: 1px solid rgba(244, 162, 97, 0.08);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    position: relative;
}

.sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

.sidebar-bottom {
    position: sticky;
    bottom: 0;
    background: rgba(30, 30, 46, 0.98);
    padding: 18px;
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* ===== SYSTÈME DE BOUTONS HARMONISÉ ===== */

/* Bouton normal (primary) */
.btn-primary, .btn-secondary, .menu-btn, .btn, .filter-btn {
    background: rgba(244, 162, 97, 0.1);
    color: #f4a261;
    border: 1px solid rgba(244, 162, 97, 0.2);
    padding: 10px 20px;
    min-height: 40px;
    height: 40px !important;
    line-height: 1.4 !important;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1em;
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 10px;
    display: inline-flex;
    text-align: center;
    box-sizing: border-box;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center;
    vertical-align: middle;
    justify-content: center;
    padding-left: 20px;
    padding-right: 20px;
}

.btn-primary:hover, .btn-secondary:hover, .menu-btn:hover, .btn:hover, .filter-btn:hover {
    background: rgba(244, 162, 97, 0.2);
    color: #f4a261;
    transform: translateY(-2px);
}

/* Bouton danger */
.btn-danger, .btn-logout {
    color: #e76f51;
    border: 1px solid #e76f51;
    background: transparent;
    min-height: 40px;
    height: 40px !important;
    line-height: 1.4 !important;
    margin-bottom: 10px;
    padding: 10px 20px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 20px;
    padding-right: 20px;
}

.btn-danger:hover, .btn-logout:hover {
    background: rgba(231, 111, 81, 0.1);
}

/* Bouton crayon (édition) */
.btn-crayon {
    border-radius: 50%;
    padding: 6px 7px;
    font-size: 1em;
    background: rgba(244, 162, 97, 0.1);
    border: 1px solid rgba(244, 162, 97, 0.2);
    color: #f4a261;
    margin: 0 0 0 10px;
    position: static;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-crayon:hover {
    background: rgba(244, 162, 97, 0.2);
}

/* ===== CHAMP DE RECHERCHE ===== */
.search-input {
    flex-grow: 1;
    border: 1px solid rgba(244, 162, 97, 0.2);
    background: rgba(244, 162, 97, 0.1);
    color: #e2e2e2;
    border-radius: 20px;
    font-family: 'Crimson Pro', serif;
    font-size: 1em;
    padding: 10px 20px;
    transition: border 0.3s, background 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #f4a261;
    background: rgba(244, 162, 97, 0.15);
}

/* ===== SWITCHER DE VUE ===== */
/* Utilise le style filter-group du framework principal */
.filter-group {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    gap: 0;
    flex-shrink: 0;
    align-self: flex-start;
}

.filter-btn {
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
    font-weight: 400;
    padding: 10px 20px;
    min-height: 40px;
    height: 40px !important;
    line-height: 1.4 !important;
    border: 1px solid rgba(244, 162, 97, 0.2);
    background: rgba(244, 162, 97, 0.1);
    color: #f4a261;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    text-align: center;
    box-sizing: border-box;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center;
    vertical-align: middle;
    justify-content: center;
    padding-left: 20px;
    padding-right: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: rgba(244, 162, 97, 0.3);
}

.filter-btn:first-child {
    border-radius: 20px 0 0 20px;
}

.filter-btn:last-child {
    border-radius: 0 20px 20px 0;
}

.filter-btn:not(:first-child) {
    border-left: none;
}

.filter-btn:hover {
    background: rgba(244, 162, 97, 0.2);
    transform: translateY(-2px);
    text-decoration: none;
    color: #f4a261;
}

.filter-btn.active {
    background: #f4a261;
    color: #1a1a2e;
    font-weight: 600;
}

/* ===== VUE LISTE ===== */
.doc-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
}

.doc-list-item {
    padding: 7px 16px;
    gap: 0px;
    min-height: 0;
    border-bottom: 1px solid rgba(244, 162, 97, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: none;
    transition: background 0.2s;
    position: relative;
}

.doc-list-item.selected, .doc-list-item:hover {
    background: rgba(244, 162, 97, 0.08);
}

.doc-title {
    font-size: 1.05em;
    color: #f4a261;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-date {
    font-size: 0.85em;
    color: #a0a0a0;
}

.doc-author {
    font-size: 0.85em;
    color: #888;
}

/* ===== VUE ARBORESCENTE ===== */
.doc-tree {
    padding: 10px;
}

.doc-tree ul {
    list-style: none;
    padding-left: 20px;
    margin: 0;
    display: none;
}

.doc-tree > ul {
    display: block;
    padding-left: 0;
}

.doc-tree li {
    position: relative;
}

.doc-tree li.expanded > ul {
    display: block;
}

.doc-tree li.expanded > .tree-item-content .is-folder .toggle-icon {
    transform: rotate(90deg);
}

.tree-item-content {
    display: flex;
    align-items: center;
    position: relative;
}

.tree-item-content:hover {
    background: rgba(244, 162, 97, 0.08);
    border-radius: 5px;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 6px 5px;
    color: #e2e2e2;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.2s;
    flex-grow: 1;
}

.tree-item:hover {
    background: none;
}

.tree-item.is-folder {
    cursor: pointer;
}

.tree-item.selected {
    background: rgba(244, 162, 97, 0.15);
    color: #f4a261;
}

.toggle-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    transition: transform 0.2s ease;
}

.tree-item .icon {
    margin: 0 6px;
    width: 20px;
    text-align: center;
    color: #a0a0a0;
}

.tree-item.is-folder > .icon {
    color: #f4a261;
}

.tree-item .title {
    flex-grow: 1;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(30, 30, 46, 0.8);
    border-bottom: 1px solid rgba(244, 162, 97, 0.1);
    font-size: 0.9em;
}

.breadcrumb-item {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #f4a261;
}

.breadcrumb-separator {
    color: #666;
}

.breadcrumb-current {
    color: #f4a261;
    font-weight: 600;
}

/* ===== CONTENU PRINCIPAL ===== */
.content-pane {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: none;
    min-width: 0;
    position: relative;
}

.doc-title-main {
    font-size: 2em;
    color: #f4a261;
    font-weight: 700;
    margin-bottom: 24px;
    margin-top: 0;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
}

.doc-title-main-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto 0 auto;
}

.village-description-block {
    background: rgba(45, 45, 68, 0.5);
    border-radius: 10px;
    padding: 30px;
    margin: 0 auto;
    line-height: 1.6;
    max-width: 900px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.village-description-block h1,
.village-description-block h2,
.village-description-block h3 {
    color: #f4a261;
    margin: 15px 0;
}

.village-description-block p {
    margin: 10px 0;
}

.village-description-block ul,
.village-description-block ol {
    margin: 10px 0;
    padding-left: 20px;
}

.village-description-block code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

.village-description-block pre {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.village-description-block blockquote {
    border-left: 3px solid #f4a261;
    padding-left: 15px;
    margin: 10px 0;
    color: #a0a0a0;
}

/* ===== SPOILERS ET SUBTEXT ===== */
.spoiler {
    background: #22223b;
    color: #22223b;
    border-radius: 4px;
    padding: 0 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border: 1px solid #444;
}

.spoiler.revealed {
    color: #f4a261;
    background: #2d2d44;
}

.subtext-discord {
    display: block;
    color: #a0a0a0;
    font-size: 0.95em;
    margin: 4px 0 4px 0;
    font-style: italic;
}

/* ===== MENUS CONTEXTUELS ===== */
.doc-menu-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 1.5em;
    padding: 0 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-left: 8px;
}

.doc-menu-btn:hover, .doc-menu-btn:focus {
    background: rgba(244,162,97,0.12);
    color: #f4a261;
}

.doc-menu {
    display: none;
    position: absolute;
    z-index: 10;
    background: #22223b;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0003;
    padding: 8px 0;
    right: 10px;
    top: 36px;
    min-width: 140px;
}

.doc-menu button {
    width: 100%;
    background: none;
    border: none;
    color: #e2e2e2;
    padding: 10px 18px;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Crimson Pro', serif;
    transition: background 0.2s, color 0.2s;
}

.doc-menu button:hover {
    background: rgba(244,162,97,0.10);
    color: #f4a261;
}

.doc-menu button.delete-action:hover {
    background: rgba(231, 111, 81, 0.1);
    color: #e76f51;
}

.doc-menu.opens-up {
    top: auto;
    bottom: 40px;
}

/* ===== ICÔNES ===== */
.pin-icon {
    color: #f4a261;
    font-size: 1em;
    margin-right: 4px;
    vertical-align: baseline;
}

.folder-icon {
    color: #f4a261;
    margin-right: 8px;
}

/* ===== DROPDOWN DE CRÉATION ===== */
.create-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #1e1e2e;
    border: 1px solid rgba(244, 162, 97, 0.2);
    border-radius: 10px;
    padding: 8px 0;
    margin-bottom: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #e2e2e2;
    text-decoration: none;
    transition: background 0.2s;
    font-family: 'Crimson Pro', serif;
}

.dropdown-item:hover {
    background: rgba(244, 162, 97, 0.1);
    color: #f4a261;
}

/* ===== ÉLÉMENTS DE DOSSIER ===== */
/* Appliquer le style visuel des dossiers uniquement dans l'arborescence */
.doc-tree .folder-item {
    background: rgba(244, 162, 97, 0.05);
    border-left: 3px solid #f4a261;
}

.folder-item {
    /* On retire align-items, padding, background, border-left ici */
}

.doc-list-item.folder-item {
    background: rgba(244, 162, 97, 0.05);
    border-left: 3px solid #f4a261;
    /* Pas d'align-items, display, flex-direction, padding ici ! */
}

/* ===== MESSAGES D'ERREUR ===== */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e76f51;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: fadeInOut 3.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -20px); }
    10% { opacity: 1; transform: translate(-50%, 0); }
    90% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* ===== MODALE DE CONFIRMATION ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1e1e2e;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 1.8em;
    color: #f4a261;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ===== MOBILE ===== */
.hamburger {
    display: none;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: none;
    border: none;
    font-size: 2em;
    color: #f4a261;
    cursor: pointer;
    transition: color 0.2s;
}

.hamburger:focus, .hamburger:hover {
    color: #e76f51;
}

.sidebar-mobile-overlay {
    display: none !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30,30,46,0.4);
    z-index: 99;
}

.hide-on-mobile {
    display: block;
}

.show-on-mobile {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hamburger {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 80vw; max-width: 340px;
        background: rgba(30,30,46,0.98);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: 2px 0 12px #0004;
        border-radius: 0 18px 18px 0;
        padding-bottom: 24px;
        overflow-y: auto;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-mobile-overlay {
        display: block;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .content-pane {
        padding: 18px 4vw;
    }
    
    .hide-on-mobile {
        display: none !important;
    }
    
    .show-on-mobile {
        display: block !important;
    }
    
    .sidebar-scroll {
        max-height: calc(100vh - 180px);
    }
    
    .doc-tree .doc-menu-btn {
        visibility: visible;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 8px;
        height: 54px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 6px;
    }
    
    .sidebar-header {
        flex-direction: column;
        gap: 6px;
        padding: 8px 4vw 6px 4vw;
    }
    
    .btn, .btn-primary, .btn-secondary, .btn-logout, .menu-btn {
        width: auto;
        min-width: 120px;
        padding: 10px 18px;
        font-size: 1em;
        border-radius: 14px;
        margin-bottom: 8px;
    }
    
    .btn-primary {
        background: #f4a261;
        color: #1e1e2e;
        border: none;
    }
    
    .btn-logout {
        color: #e76f51;
        border: 1px solid #e76f51;
        background: transparent;
    }
    
    .search-input {
        width: 100%;
        font-size: 0.98em;
        padding: 10px 14px;
        margin-bottom: 10px;
    }
    
    .doc-list-item {
        padding: 10px 6px;
        border-radius: 10px;
        margin-bottom: 6px;
    }
    
    .doc-list-item.selected, .doc-list-item:hover {
        background: rgba(244,162,97,0.10);
    }
    
    .doc-title-main {
        font-size: 1.1em;
        padding: 0 2px;
        margin-bottom: 12px;
    }
    
    .village-description-block {
        padding: 10px 2vw;
        font-size: 0.98em;
        border-radius: 10px;
    }
    
    .doc-date {
        font-size: 0.85em;
        color: #b8b8b8;
        margin-top: 2px;
    }
    
    .btn-crayon {
        font-size: 0.95em;
        padding: 5px 6px;
    }
    
    .doc-title-main-wrap {
        padding: 0 2px;
    }
}

@media (max-width: 400px) {
    .header {
        font-size: 0.93em;
    }
    
    .doc-title-main {
        font-size: 1em;
    }
    
    .village-description-block {
        font-size: 0.95em;
    }
}

/* ===== UTILITAIRES ===== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ===== FOCUS VISIBLE ===== */
*:focus-visible {
    outline: 2px solid #f4a261;
    outline-offset: 2px;
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a.btn-logout, .btn-logout {
    display: inline-block;
    text-align: center;
    text-decoration: none !important;
    color: #e76f51;
    border: 1px solid #e76f51;
    background: transparent;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Crimson Pro', serif;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}
a.btn-logout:hover, .btn-logout:hover {
    background: rgba(231, 111, 81, 0.1);
    color: #e76f51;
    text-decoration: none !important;
    transform: translateY(-2px);
}

/* === FORMULAIRES DOCUMENTATION === */
.main-content {
    max-width: 900px;
    margin: 32px auto 0 auto;
    padding: 20px;
    padding-top: 52px;
}
.document-form {
    background: rgba(45, 45, 68, 0.5);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 32px;
}
.form-group {
    margin-bottom: 22px;
}
.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #f4a261;
    font-weight: 600;
}
.form-control {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(244, 162, 97, 0.2);
    background: rgba(244, 162, 97, 0.1);
    color: #e2e2e2;
    font-family: 'Crimson Pro', serif;
    font-size: 1em;
    margin-bottom: 0;
}
.form-control:focus {
    outline: none;
    border-color: #f4a261;
    background: rgba(244, 162, 97, 0.15);
}
textarea.form-control {
    min-height: 400px;
    resize: vertical;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f4a261;
}
.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
}
.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 18px;
    margin-top: 28px;
    align-items: center;
}
.form-actions > * {
    flex: 0 1 auto;
}
.toggle-switch-group {
    white-space: nowrap;
}
.btn-move {
    background: rgba(255, 255, 255, 0.05);
    color: #a0a0a0;
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-move:hover {
    color: #f4a261;
    background: rgba(244, 162, 97, 0.1);
}
.move-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.current-path {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    line-height: 40px !important;
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(0,0,0,0.2);
    padding: 0 14px;
    border-radius: 15px;
    font-size: 0.98em;
    color: #ccc;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'monospace';
    text-align: left;
}
.preview-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(45, 45, 68, 0.5);
    border-radius: 10px;
}
.preview-title {
    color: #f4a261;
    margin-bottom: 15px;
}

/* === MODALE DE DÉPLACEMENT === */
.modal.show { display: flex; }
.modal-content {
    background: #1e1e2e;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-title {
    font-size: 1.6em;
    color: #f4a261;
    margin: 0;
}
.modal-close {
    background:none;
    border:none;
    font-size:1.5em;
    color:#a0a0a0;
    cursor:pointer;
}
.modal-body {
    overflow-y: auto;
    padding-right: 10px;
}
.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.folder-tree ul { list-style: none; padding-left: 20px; margin: 0; }
.folder-tree > ul { padding-left: 0; }
.folder-tree li { position: relative; }
.folder-tree li > ul { display: none; }
.folder-tree li.expanded > ul { display: block; }
.folder-tree li.expanded > .folder-item .toggle-icon { transform: rotate(90deg); }
.folder-item {
    display: flex;
    padding: 8px 5px;
    border-radius: 5px;
    transition: background 0.2s;
    cursor: pointer;
}
.folder-item:hover, .folder-item.selected { background: rgba(244, 162, 97, 0.1); }
.toggle-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    transition: transform 0.2s ease;
}
.toggle-icon-placeholder { width: 20px; }
.folder-item i { margin: 0 8px; color: #f4a261; }

@media (max-width: 900px) {
    .main-content {
        margin: 10px;
        padding: 0;
    }
    .document-form {
        padding: 20px;
    }
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }
    .form-actions .btn { width: 100%; }
    .current-path {
        width: 100%;
        max-width: 100%;
        margin-top: 6px;
    }
    textarea.form-control { min-height: 300px; }
    .move-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Toggle Switch */
.toggle-switch-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    vertical-align: middle;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #444;
    border-radius: 26px;
    transition: background 0.3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.switch input:checked + .slider {
    background: #f4a261;
}
.switch input:checked + .slider:before {
    transform: translateX(20px);
    background: #fff7ee;
}
.toggle-label {
    color: #e2e2e2;
    font-size: 1em;
    font-weight: 500;
    margin-left: 4px;
    cursor: pointer;
    user-select: none;
} 