/*
==========================================================
Palabre
Style principal
==========================================================
*/

/*---------------------------------------------------------
    Variables
---------------------------------------------------------*/

:root {

    --mobile-topbar-height:64px;
    --mobile-footer-height:72px;

    /*---------------------------------------------------------
        Couleurs
    ---------------------------------------------------------*/

    --primary-color: #31708E;
    --primary-dark: #0F3447;
    --primary-hover: #5085A5;

    --secondary-color: #5085A5;
    --accent-color: #8FC1E3;
    --green-color: #687864;

    --background-color: #F7F9FB;
    --surface-color: #FFFFFF;

    --text-color: #0F2A3D;
    --text-light: #5F7285;
    --text-secondary: #5F7285;

    --border-color: #E2E8F0;

    --color-success: #687864;
    --color-info: #5085A5;
    --color-warning: #C47A1B;
    --color-danger: #DC2626;

    /*---------------------------------------------------------
        Taille des polices
    ---------------------------------------------------------*/

    --font-h1: 2.4rem;
    --font-h2: 1.5rem;
    --font-h3: 1rem;
    --font-body: .95rem;
    --font-small: .85rem;

    /*---------------------------------------------------------
        Effets
    ---------------------------------------------------------*/

    --shadow: 0 6px 18px rgba(15, 52, 71, .08);
    --radius: 12px;
    --transition: .20s;
    --max-width: 1400px;

    /*---------------------------------------------------------
        Espacements
    ---------------------------------------------------------*/

    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /*---------------------------------------------------------
        Couleurs des icônes
    ---------------------------------------------------------*/
  
    --color-icon-roman: #687864;
    --color-icon-film: #31708E;
    --color-icon-bd: #8FC1E3;
    --color-icon-software: #6B5FA8;
    --color-icon-teaching: #DC2626;
    --color-icon-default: #31708E;
    --color-icon-press: #5085A5;
    --color-icon-culture: #687864;
    --color-icon-event: #C47A1B;
}

/*---------------------------------------------------------
    Reset
---------------------------------------------------------*/

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

/*---------------------------------------------------------
    Base
---------------------------------------------------------*/

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    font-size: var(--font-body);
}

/*---------------------------------------------------------
    Images
---------------------------------------------------------*/

img {
    display: block;
    max-width: 100%;
}

/*---------------------------------------------------------
    Icones
---------------------------------------------------------*/

.color-icon-roman {
    color: var(--color-icon-roman);
}

.color-icon-film {
    color: var(--color-icon-film);
}

.color-icon-bd {
    color: var(--color-icon-comic);
}

.color-icon-software {
    color: var(--color-icon-software);
}

.color-icon-teaching {
    color: var(--color-icon-teaching);
}

.color-icon-default {
    color: var(--color-icon-default);
}

/*---------------------------------------------------------
    Boutons
---------------------------------------------------------*/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);

    border: none;
    border-radius: var(--radius);
    padding: 10px 16px;

    font: inherit;
    font-weight: 600;
    text-decoration: none;

    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: #FFF;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #FFF;
}

.btn-outline {
    background: var(--surface-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-danger {
    background: var(--color-danger);
    color: #FFF;
}

.btn-icon{
    width:36px;
    height:36px;
    padding:0;

    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.btn-edit:hover i{
    color:#6626dc;
}

.btn-delete:hover i{
    color:#DC2626;
}

.btn-send:hover i{
    color:#051b49;
}

.btn-download:hover i{
    color:#09cf90;
}

/*---------------------------------------------------------
    Liens
---------------------------------------------------------*/

a {
    color: inherit;
    text-decoration: none;
}

/*---------------------------------------------------------
    Grille des projets
---------------------------------------------------------*/

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/*---------------------------------------------------------
    Carte projet
---------------------------------------------------------*/

.project-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-card-image {
    aspect-ratio: 16 / 9;
    background: #DDD;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-content {
    padding: 20px;
}

.project-card-content h2 {
    margin-bottom: var(--space-xs);
    font-size: var(--font-h2);
}

.project-card-content p {
    color: var(--text-light);
}

.project-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-xs);
    color: var(--text-light);
    font-size: .95rem;
}

.project-type i {
    font-size: var(--font-h2);
    margin-right: 10px;
}

/*---------------------------------------------------------
    Dashboard projet
---------------------------------------------------------*/

.dashboard-card h2{
    font-size: var(--font-h2);
    font-weight:700;
    margin:0;
}

.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #0F3447 0%, #14506A 100%);
    color: #FFF;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    text-align: center;
}

.sidebar-logo {
    width: 140px;
    height: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 14px;
    border-radius: 10px;
    color: #D8EAF3;
    font-size: var(--font-body);
    font-weight: 500;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(143, 193, 227, .18);
    color: #FFF;
    font-size: var(--font-body);
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-footer-logo {
    width: 80px;
    height: auto;
    opacity: .9;
}

.project-main {
    padding: 36px;
}

.project-header {
    margin-bottom: var(--space-md);
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
}

.project-title-row h1 {
    font-size: var(--font-h1);
    line-height: 1.1;
    margin-bottom: 10px;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.project-summary-card,
.editorial-tracking-card {
    grid-column: 1 / -1;
}

/*---------------------------------------------------------
    Dashboard projet : bloc de présentation
---------------------------------------------------------*/

.project-summary{
    display:grid;
    grid-template-columns:220px 2fr 300px;
    gap:var(--space-xl);
    align-items:flex-start;
    margin-top:var(--space-lg);
}

.project-cover img{
    width:100%;
    display:block;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.project-description{
    line-height:1.7;
    color:var(--text-color);
}

.project-description p{
    margin:0;
}

.project-documents h3{
    margin-bottom:var(--space-md);
    font-size: var(--font-h3);
}

.project-documents ul{
    list-style:none;
    margin:0;
    padding:0;
}

.project-documents li{
    display:flex;
    align-items:center;
    gap:var(--space-sm);
    padding:10px 0;
    border-bottom:1px solid var(--border-color);
}

.project-documents li i{
    width:var(--space-md);
    color:var(--primary-color);
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.card-title h2 {
    margin: 0;
}

.card-title .btn {
    flex: 0 0 auto;
}
.project-timeline{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;

    position:relative;

    margin-top:var(--space-lg);
    padding-top:20px;
}

.project-timeline::before{
    content:"";
    position:absolute;
    top:28px;
    left:0;
    right:0;

    height:3px;
    background:var(--border-color);
    z-index:0;
}

.timeline-step{
    position:relative;
    z-index:1;

    display:flex;
    flex-direction:column;
    align-items:center;

    flex:1;
    text-align:center;
}

.timeline-dot{
    width:14px;
    height:14px;

    border-radius:50%;
    background:var(--border-color);
    border:3px solid var(--surface-color);

    box-shadow:0 0 0 2px var(--border-color);
}

.timeline-step.active .timeline-dot{
    width:24px;
    height:24px;

    margin-top:-5px;

    background:var(--primary-color);
    box-shadow:0 0 0 4px rgba(49,112,142,.20);
}

.timeline-label{
    margin-top:10px;

    font-size:var(--font-small);
    color:var(--text-secondary);
}

.timeline-step.active .timeline-label{
    color:var(--primary-color);
    font-weight:700;
}

.timeline-control-row{
    display:grid;
    grid-template-columns:36px 1fr 36px;
    align-items:center;
    gap:var(--space-md);
}

.timeline-control-row form{
    margin:0;
}

/*---------------------------------------------------------
    Dashboard projet : tableau de suivi
---------------------------------------------------------*/

.editorial-tracking-card{
    padding:0;
    overflow:hidden;
}

.dashboard-card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:var(--space-md) var(--space-lg);
    margin:0;
    border-bottom:1px solid var(--border-color);
    align-items:center;
}

.tracking-table{
    width:100%;
    border-collapse:collapse;
}

.tracking-table thead{
    background:#F8FAFC;
}

.tracking-table th{
    padding:var(--space-sm) var(--space-md);
    text-align:left;
    font-size: var(--font-small);
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:var(--text-light);
    border-bottom:1px solid var(--border-color);
}

.tracking-table td{
    padding:8px var(--space-md);
    border-bottom:1px solid var(--border-color);
    vertical-align:middle;
    font-size: var(--font-small);
}

.tracking-table tbody tr{
    transition:background .15s ease;
}

.tracking-table tbody tr:hover{
    background:#F9FAFB;
}

.tracking-table td:first-child{
    font-weight:600;
}

.tracking-next-action strong{
    display:block;
    font-weight:600;
    white-space:nowrap;
}

.tracking-next-action span{
    display:block;
    margin-top:2px;
    color:var(--text-secondary);
    font-size:var(--font-small);
    line-height:1.3;
}

.status-pill{
    display:inline-flex;
    align-items:center;
    padding:4px 10px;
    border-radius:var(--radius);
    font-size:var(--font-small);
    font-weight:600;
    border:1px solid;
}

.status-in-progress{

    color:#2563EB;
    border-color:#2563EB;
    background:#EFF6FF;
}

.status-success{

    color:#15803D;
    border-color:#15803D;
    background:#F0FDF4;
}

.status-refused{

    color:#DC2626;
    border-color:#DC2626;
    background:#FEF2F2;
}

.status-abandoned{

    color:#6B7280;
    border-color:#6B7280;
    background:#F9FAFB;
}

.dashboard-link{
    color:var(--primary-color);
    font-weight:600;
}

.dashboard-link:hover{
    text-decoration:underline;
}

.tracking-table-wrapper{
    max-height:300px;
    overflow-y:auto;
}

/*---------------------------------------------------------
    Dashboard projet : Historique
---------------------------------------------------------*/

.actions-card {
    padding: 0;
    overflow: hidden;
}

.history-form{
    display:flex;
    gap:var(--space-md);
    align-items:center;
}

.history-form select{
    flex:1;
    padding:10px 12px;
    border:1px solid var(--border-color);
    border-radius:var(--radius);
    font:inherit;
}

.history-list{
    display:flex;
    flex-direction:column;
    gap:var(--space-md);
}

.history-item{
    border-bottom:1px solid var(--border-color);
    padding-bottom:var(--space-sm);
}

.history-item time{
    display:block;
    color:var(--primary-color);
    font-weight:600;
    margin-bottom:2px;
}

.history-item p{
    margin-top:4px;
    color:var(--text-secondary);
}

.history-documents{
    margin-top:4px;
    color:var(--text-color);
    font-size:var(--font-small);
}

/*---------------------------------------------------------
    Dashboard projet : Notes
---------------------------------------------------------*/

.notes-card{
    padding:0;
    overflow:hidden;
}

.notes-content{
    padding:var(--space-lg);
}

.notes-content p{
    margin-bottom:var(--space-md);
    line-height:1.6;
}

.notes-content p:last-child{
    margin-bottom:0;
}

/*---------------------------------------------------------
    Gestion des documents
---------------------------------------------------------*/

.document-upload-form {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.document-upload-form select,
.document-upload-form input {
    font: inherit;
}

.document-upload-form select {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.document-upload-form input[type="text"] {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font: inherit;
}

.documents-explorer{
    display:flex;
    flex-direction:column;
    gap:var(--space-lg);
    margin-top:var(--space-lg);
}

.documents-project-container{
    display:grid;
    grid-template-columns:120px 240px 1fr;
    gap:var(--space-lg);
    background:var(--surface-color);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:var(--space-lg);
    align-items:flex-start;
}

.documents-project-image img{
    width:100%;
    display:block;
    border-radius:var(--radius);
}

.documents-project-info h2{
    margin-bottom:var(--space-xs);
}

.documents-project-info p{
    display:flex;
    align-items:center;
    gap:var(--space-xs);
    color:var(--text-light);
}

.documents-project-files{
    display:flex;
    flex-direction:column;
    gap:var(--space-sm);
}

.document-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.document-name {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.document-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-line a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.document-line a:hover {
    color: var(--primary-color);
}

.document-line time {
    color: var(--text-light);
    font-size: var(--font-small);
    white-space: nowrap;
}

.document-line:last-child{
    border-bottom:none;
}

.document-line i{
    font-size:1.2rem;
    color:var(--primary-color);
}

.document-line strong{
    display:block;
}

.document-line span{
    color:var(--text-light);
    font-size:.9rem;
}
.document-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:var(--space-xs);
    white-space:nowrap;
}

.document-actions .btn,
.document-actions a,
.document-actions button{
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
}

/*---------------------------------------------------------
    MODALE - Suppression document
---------------------------------------------------------*/

.modal-overlay{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    background:rgba(0,0,0,.45);
    z-index:1000;
}

.modal-overlay[hidden]{
    display:none;
}

.modal-box{
    width:420px;
    max-width:90%;
    background:var(--surface-color);
    border-radius:var(--radius);
    box-shadow:0 20px 40px rgba(0,0,0,.20);
    padding:var(--space-xl);
}

.modal-box h2{
    margin-bottom:var(--space-md);
}

.modal-box p{
    margin-bottom:var(--space-md);
    line-height:1.6;
}

.modal-document-title{
    font-weight:600;
    color:var(--primary-color);
    padding:var(--space-sm);
    background:#F8F9FA;
    border-radius:var(--radius);
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:var(--space-md);
    margin-top:var(--space-lg);
}


/*---------------------------------------------------------
    Menu des Boutons secteurs d'activité
---------------------------------------------------------*/

.sector-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:var(--space-md);
    margin-top:var(--space-lg);
    margin-bottom:var(--space-xl);
}

.sector-button.active {
    background: var(--primary-color);
    color: #FFF;
    border-color: var(--primary-color);
}

.sector-button.active i {
    color: #FFF !important;
}


/*---------------------------------------------------------
    CONTACTS
---------------------------------------------------------*/

.companies-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.company-row {
    display: grid;
    grid-template-columns: 220px 280px 260px 1fr;
    gap: var(--space-lg);

    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    padding: var(--space-lg);
    align-items: flex-start;
}

.company-name h2 {
    margin: 0;
    font-size: var(--font-h3);
}

.company-contact p,
.company-people p {
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.company-contact i {
    width: 18px;
    margin-right: var(--space-xs);
    color: var(--primary-color);
}

.company-people strong {
    display: block;
}

.company-people span {
    color: var(--text-light);
    font-size: var(--font-small);
}

.company-notes {
    color: var(--text-color);
    line-height: 1.5;
}

.muted {
    color: var(--text-light);
    font-size: var(--font-small);
}

/*---------------------------------------------------------
    Modale formulaire
---------------------------------------------------------*/

.modal-form{
    width:700px;
    max-width:90vw;
    max-height:85vh;
    overflow-y:auto;
}

.form-group{
    display:flex;
    flex-direction:column;
    margin-bottom:var(--space-md);
}

.form-group label{
    margin-bottom:6px;
    font-weight:600;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea{
    width:100%;
    padding:10px 12px;
    border:1px solid var(--border-color);
    border-radius:var(--radius);
    font:inherit;
    box-sizing:border-box;
}

.form-group textarea{
    resize:vertical;
    min-height:90px;
}

.modal-form h2{
    margin-bottom:var(--space-lg);
}

/*---------------------------------------------------------
    Dashboard : Actions à faire
---------------------------------------------------------*/

.action-list{
    list-style:none;
    margin:0;
    padding:0;
}

.action-list li{
    display:grid;
    grid-template-columns:130px minmax(0,1fr) 100px;
    align-items:center;
    gap:10px;
    padding:4px 0;
    min-width: 0;
}

.action-list time {
    text-align: right;
    white-space: nowrap;
}
    
.action-type{
    font-weight:600;
}

.action-list time{
    text-align:right;
    font-size:.9rem;
    color:var(--primary-color);
    white-space:nowrap;
}

/*---------------------------------------------------------
    Dashboard : Notes liste
---------------------------------------------------------*/

.notes-list{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.note-item{
    padding:6px 0;
    border-bottom:1px solid var(--border-color);
    line-height:1.4;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

.note-item:last-child{
    border-bottom:none;
}

.notes-count{
    margin-top:8px;
    text-align:right;
    font-size:.9rem;
    color:var(--text-secondary);
}

/*---------------------------------------------------------
    Page Notes 
---------------------------------------------------------*/

.notes-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    color: var(--text-light);
}

.notes-page-header time {
    display: block;
    margin-top: 4px;
    font-size: var(--font-small);
}

.note-actions {
    display: flex;
    gap: var(--space-xs);
}

.note-info{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.note-project-type{
    display:flex;
    align-items:center;
    gap:6px;

    font-size:.9rem;
    color:var(--text-light);
}

.note-info strong{
    margin:0;
}

.note-info time{
    color:var(--text-secondary);
    font-size:var(--font-small);
    white-space:nowrap;
}

.notes-card-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(300px, 1fr));
    gap:var(--space-lg);
}

.note-project-card{
    background:var(--surface-color);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    overflow:hidden;
}

.note-project-card-content{
    padding:var(--space-lg);
}

.idea-card{
    background:#FFF7ED;
}
/*---------------------------------------------------------
    Page Actions 
---------------------------------------------------------*/
.actions-page-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.actions-section {
    margin-bottom: var(--space-lg);
}

.actions-section h2 {
    margin-bottom: var(--space-md);
}

.actions-scroll-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: var(--space-xs);
}

.actions-page-row {
    display: grid;
    grid-template-columns: 110px 1fr 90px;
    gap: var(--space-lg);
    align-items: center;

    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-md) var(--space-lg);
}

.actions-page-date {
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.actions-page-main strong {
    display: block;
}

.actions-page-main span {
   
    color: var(--text-secondary);
    font-size: var(--font-small);
}

.actions-page-main p {
    margin-top: var(--space-xs);
}

.actions-page-buttons {
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}

/*---------------------------------------------------------
    Writing list
---------------------------------------------------------*/

.document-path{
    margin-top:2px;
    color:var(--text-secondary);
    font-size:.85rem;
    font-family:monospace;
}

/*---------------------------------------------------------
    Editeur - Roman
---------------------------------------------------------*/

.manuscript-editor-textarea{
    width:100%;
    min-height:calc(100vh - 140px);
    padding:50px 60px;
    border:1px solid var(--border-color);
    border-radius:var(--radius);
    background:#FFF;
    font-family:"EB Garamond", Garamond, Georgia, serif;
    font-size:16pt;
    line-height:1.8;
    color:#222;
    resize:none;
    outline:none;
}

.manuscript-layout{
    display:grid;
    grid-template-columns:1fr 320px;
    gap:var(--space-lg);
    padding:var(--space-xl);
}

.manuscript-workspace{
    min-width:0;
}

.manuscript-save-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.manuscript-sidebar{
    display:flex;
    flex-direction:column;
    gap:var(--space-md);
}

.manuscript-panel{
    background:var(--surface-color);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:var(--space-md);
}

.manuscript-panel h2{
    margin-bottom:var(--space-md);
    font-size:var(--font-h3);
}

.manuscript-panel p{
    margin-bottom:var(--space-sm);
}

.manuscript-panel .btn{
    width:100%;
    margin-bottom:var(--space-sm);
}

.manuscript-current-info {
    display: flex;
    align-items: baseline;
    gap: var(--space-lg);
}

.manuscript-current-info strong {
    font-size: var(--font-h2);
}

.manuscript-current-info span {
    color: var(--text-secondary);
    font-weight: 600;
}

.chapter-list{
    display:flex;
    flex-direction:column;
    gap:var(--space-xs);
    max-height:220px;
    overflow-y:auto;
    padding-right:6px;
}

.chapter-list a{
    padding:var(--space-sm);
    border-radius:var(--radius);
    background:#F8FAFC;
}

.chapter-list a.active {
    background: var(--primary-color);
    color: #FFF;
    font-weight: 600;
}

.manuscript-stats p{
    display:flex;
    justify-content:space-between;
    gap:var(--space-md);
    margin-bottom:var(--space-sm);
}

.manuscript-stats p:last-child{
    margin-bottom:0;
}

.manuscript-stats span{
    font-weight:600;
    color:var(--primary-color);
    white-space:nowrap;
}

.panel-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:var(--space-md);
}

.panel-title h2{
    margin:0;
}

.btn-refresh{
    background:none;
    border:none;
    padding:4px;
    color:var(--text-secondary);
    cursor:pointer;
    font-size:1rem;
    transition:color .2s ease, transform .2s ease;
}

.btn-refresh:hover{
    color:var(--primary-color);
    transform:rotate(90deg);
}

.btn-refresh:active{
    transform:rotate(180deg);
}

.annotation-list{
    margin-top:var(--space-md);
}

.annotation-item{
    padding:6px 0;
    border-bottom:1px solid var(--border-color);
    font-size:.9rem;
    line-height:1.4;
    display:flex;
    justify-content:space-between;
    gap:8px;
}

.annotation-item .btn-icon{
    width:36px;
    height:36px;
    padding:0;
    flex:0 0 36px;
    margin-bottom:0;
}
.annotation-form #annotation_content{
    min-height:48px;
    height:48px;
    resize:none;
}

.manuscript-save-actions{
    display:flex;
    align-items:center;
    gap:var(--space-md);
}

.save-status{
    font-size:.9rem;
    color:var(--text-secondary);
}

.save-status.dirty{
    color:#B45309;
}

.save-status.saved{
    color:#15803D;
}

/*---------------------------------------------------------
    Editeur - Roman - Manager
---------------------------------------------------------*/

.manuscript-manager-list{
    display:flex;
    flex-direction:column;
    gap:var(--space-md);
}

.manuscript-manager-row{
    display:flex;
    justify-content:space-between;
    align-items:center;

    background:var(--surface-color);
    border-radius:var(--radius);
    box-shadow:var(--shadow);

    padding:var(--space-md) var(--space-lg);
}

.manuscript-manager-title strong{
    display:block;
}

.manuscript-manager-title span{
    color:var(--text-secondary);
    font-size:var(--font-small);
}

.manuscript-manager-actions{
    display:flex;
    gap:var(--space-xs);
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.manuscript-manager-layout{
    display:grid;
    grid-template-columns:1fr 300px;
    gap:var(--space-lg);
    padding:var(--space-xl);
}

.manuscript-manager-main{
    min-width:0;
}

.manuscript-manager-sidebar{
    display:flex;
    flex-direction:column;
    gap:var(--space-md);
}

.manuscript-manager-sidebar .btn{
    width:100%;
    margin-bottom:var(--space-sm);
}
/*---------------------------------------------------------
    Flash
---------------------------------------------------------*/

.toast{
    position:fixed;
    top:20px;
    right:20px;

    display:flex;
    align-items:center;
    gap:8px;

    padding:12px 18px;

    border-radius:var(--radius);
    box-shadow:var(--shadow);

    color:#fff;
    z-index:10000;
}

.toast-success{
    background:#15803D;
}

.toast-error{
    background:#DC2626;
}

.toast-info{
    background:#2563EB;
}

/*---------------------------------------------------------
    Flash
---------------------------------------------------------*/

.archives-actions{
    display:flex;
    gap:var(--space-xl);
    align-items:flex-end;
    margin-bottom:var(--space-lg);
}

.archive-form{
    display:flex;
    align-items:center;
    gap:var(--space-md);
    flex:1;
}

.archive-form select{
    flex:1;
    max-width:250px;
}

/*---------------------------------------------------------
    Flash
---------------------------------------------------------*/

.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--background-color);
}

.login-card{
    width:360px;
    background:var(--surface-color);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:var(--space-xl);
    text-align:center;
}

.login-logo{
    width:90px;
    margin:0 auto var(--space-md);
}

.login-card h1{
    margin-bottom:var(--space-lg);
}

.login-error{
    margin-bottom:var(--space-md);
    color:var(--color-danger);
    font-weight:600;
}

/*---------------------------------------------------------------------------------------------------------
    Adaptation smartphone
-----------------------------------------------------------------------------------------------------------*/
.mobile-topbar{
    display:none;
}

.mobile-footer{
    display:none;
}

.project-mobile-hero{
    display:none;
}

.timeline-mobile-current{
    display:none;
}

.tracking-mobile-list{
    display:none;
}

@media (max-width:768px){

    .sidebar-brand,
    .sidebar-footer{
        display:none;
    }

    .sidebar-nav{
        margin-top:0;
    }

    .app-layout{
        display:block;
    }

    .mobile-topbar{
        display:flex;
        align-items:center;
        justify-content:space-between;

        position:sticky;
        top:0;
        z-index:1000;

        height:64px;
        padding:0 var(--space-md);

        background:#111827;
        box-shadow:var(--shadow);
    }

    .mobile-logo img{
        height:38px;
        display:block;
    }

    .mobile-menu-button{
        border:none;
        background:transparent;
        color:#fff;
        font-size:1.5rem;
        cursor:pointer;
    }

    .sidebar{
        display:none;
        position:fixed;
        top:64px;
        left:0;
        right:0;
        z-index:999;

        height:auto;
        max-height:calc(100vh - 64px);
        overflow-y:auto;

        border-radius:0;
    }

    .sidebar.is-open{
        display:flex;
    }

    .sidebar-nav{
        display:flex;
        flex-direction:column;
    }

    .sidebar-footer{
        display:none;
    }

    .project-main,
    .project-main-noscroll{
        padding:var(--space-md);
        height:auto;
        overflow:visible;
    }

    .mobile-footer{
        display:flex;
        justify-content:center;
        align-items:center;

        margin-top:var(--space-xl);
        padding:var(--space-lg);

        background:#111827;
    }

    .mobile-footer img{
        height:48px;
        display:block;
    }

    .header-actions{
        width:100%;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:var(--space-sm);
    }

    .header-actions .btn{
        width:100%;
        justify-content:center;
        padding:0.75rem 0.5rem;
        font-size:0.9rem;
    }

    .header-actions .btn i{
        margin-right:0.35rem;
    }

    .sector-buttons{
        display:flex;
        overflow-x:auto;
        gap:var(--space-sm);
        padding-bottom:var(--space-sm);
    }

    .sector-buttons .btn{
        flex:0 0 auto;
        white-space:nowrap;
    }

    .companies-list{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .company-row{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
        padding:var(--space-md);
    }

    .company-name{
        display:flex;
        align-items:flex-start;
        justify-content:space-between;
        gap:var(--space-sm);
    }

    .company-name h2{
        font-size:1.15rem;
        word-break:break-word;
    }

    .company-contact,
    .company-people,
    .company-notes{
        width:100%;
        min-width:0;
    }

    .company-contact p,
    .company-people p,
    .company-notes{
        overflow-wrap:anywhere;
    }

    .document-upload-form{
        flex-direction:column;
        align-items:stretch;
        gap:var(--space-sm);
    }

    .document-upload-form h2{
        margin-bottom:var(--space-sm);
    }

    .document-upload-form select,
    .document-upload-form input,
    .document-upload-form button{
        width:100%;
    }

    .documents-project-container{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .documents-project-image{
        display:none;
    }

    .documents-project-info{
        width:100%;
    }

    .documents-project-files{
        width:100%;
        min-width:0;
    }

    .document-line{
        display:flex;
        flex-direction:column;
        gap:var(--space-sm);
        align-items:flex-start;
    }

    .document-name{
        min-width:0;
    }

    .document-name strong{
        white-space:normal;
        overflow-wrap:anywhere;
    }

   .document-line{
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        gap:var(--space-sm);
    }

    .document-actions{
        justify-content:flex-start;
    }

    /* ------------------------------------------------------------------
    ACTIONS - SMARTPHONE
    ------------------------------------------------------------------ */

    .actions-page-row{
        display:flex;
        flex-direction:column;
        align-items:flex-start;
        gap:var(--space-sm);
        padding:var(--space-md);
    }

    .actions-page-date{
        font-weight:700;
        color:var(--primary-color);
    }

    .actions-page-main{
        width:100%;
        min-width:0;
    }

    .actions-page-main strong{
        display:block;
        margin-bottom:var(--space-xs);
    }

    .actions-page-main span{
        display:block;
        line-height:1.4;
        overflow-wrap:anywhere;
    }

    .actions-page-buttons{
        display:flex;
        align-items:center;
        gap:var(--space-sm);
        margin-top:var(--space-xs);
    }

    .actions-page-buttons .btn{
        width:36px;
        height:36px;
    }

    /* ---------- Organisation de la page ---------- */

    .actions-main{
        display:flex;
        flex-direction:column;
        height:calc(
            100vh
            - var(--mobile-topbar-height)
            - var(--mobile-footer-height)
        );
        overflow:hidden;
    }

    .project-main,
    .project-main-noscroll{
        height:auto;
        overflow:visible;
    }

    .project-header{
        flex:0 0 auto;
    }

    .actions-section{
        flex:1;
        display:flex;
        flex-direction:column;
        min-height:0;
    }

    .actions-section h2{
        flex:0 0 auto;
        margin-bottom:var(--space-sm);
    }

    .actions-scroll-container{
        flex:1;
        min-height:0;
        overflow-y:auto;
    }
    .archives-actions{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .archive-form{
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:var(--space-sm);
    }

    .archive-form label{
        white-space:normal;
        font-weight:600;
    }

    .archive-form select{
        width:100%;
        min-width:0;
    }

    .archive-form .btn{
        width:100%;
    }

/* -------------------------------------------------------
   PAGE PROJET - MOBILE
------------------------------------------------------- */

    .project-mobile-hero{
        display:block;
        position:relative;
        margin:calc(var(--space-md) * -1) calc(var(--space-md) * -1) var(--space-md);
        height:220px;
        overflow:hidden;
    }

    .project-mobile-hero img{
        width:100%;
        height:100%;
        object-fit:cover;
        display:block;
    }

    .project-mobile-hero::after{
        content:"";
        position:absolute;
        inset:0;
        background:linear-gradient(
            180deg,
            rgba(0,0,0,.15),
            rgba(0,0,0,.75)
        );
    }

    .project-mobile-hero-content{
        position:absolute;
        left:var(--space-md);
        right:var(--space-md);
        bottom:var(--space-md);
        z-index:1;
        color:white;
    }

    .project-mobile-hero-content h1{
        font-size:1.7rem;
        line-height:1.15;
        margin-bottom:var(--space-xs);
    }

    .project-mobile-hero-content .project-meta{
        color:white;
    }

    .project-header .project-title-row > div:first-child{
        display:none;
    }

    .project-title-row{
        flex-direction:column;
        align-items:stretch;
        gap:var(--space-sm);
    }

    /* Bloc résumé */
    .dashboard-grid{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .project-summary{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .project-cover{
        display:none;
    }

    .project-description{
        width:100%;
    }

    .project-description .card-title{
        align-items:flex-start;
        gap:var(--space-sm);
    }

    .project-description p{
        overflow-wrap:anywhere;
    }

    /* Documents du projet */
    .project-documents{
        width:100%;
    }

    .project-documents ul{
        padding-left:0;
        list-style:none;
    }

    /* Suivi éditorial */
     .tracking-table-wrapper{
        display:none;
    }

    .tracking-mobile-list{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .tracking-mobile-card{
        padding:var(--space-md);
        border:1px solid var(--border-color);
        border-radius:var(--radius);
        background:var(--surface-color);
    }

    .tracking-mobile-card h3{
        margin-bottom:var(--space-sm);
    }

    .tracking-mobile-card p{
        margin:0 0 var(--space-xs);
        overflow-wrap:anywhere;
    }

    /* Historique + notes empilés */
    .actions-card,
    .notes-card{
        width:100%;
    }

    .history-form{
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:var(--space-sm);
    }

    .history-form select,
    .history-form button{
        width:100%;
    }
 
    /* Timeline mobile */
    .project-timeline{
        display:none;
    }

    .timeline-control-row{
        display:grid;
        grid-template-columns:42px 1fr 42px;
        align-items:center;
        gap:var(--space-md);
        margin-top:var(--space-md);
    }

    .timeline-mobile-current{
        display:flex;
        justify-content:center;
        align-items:center;

        min-height:42px;
        padding:0 var(--space-md);

        font-weight:700;
        font-size:1rem;
        text-align:center;
    }

/* -------------------------------------------------------
   EDITEUR - MOBILE
------------------------------------------------------- */

    .writing-card-actions{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:var(--space-sm);
    margin-top:var(--space-sm);
    }

    .writing-card-actions .btn,
    .writing-card-actions a,
    .writing-card-actions button{
        width:36px;
        height:36px;

        display:flex;
        align-items:center;
        justify-content:center;
    }

    .manuscript-layout{
        display:flex;
        flex-direction:column;
        gap:var(--space-md);
    }

    .manuscript-workspace{
        width:100%;
    }

    .manuscript-sidebar{
        width:100%;
    }

    .manuscript-save-bar{
        flex-direction:column;
        align-items:stretch;
        gap:var(--space-sm);
    }

    .manuscript-save-bar .header-actions{
        display:grid;
        grid-template-columns:repeat(4, 1fr);
        align-items:center;
        gap:var(--space-sm);
    }

    .manuscript-save-actions{
        grid-column:1 / -1;
    }

    .manuscript-editor-textarea{
        width:100%;
        min-height:60vh;
    }

    .manuscript-manager-layout{
    display:flex;
    flex-direction:column;
    gap:var(--space-md);
    }

    .manuscript-manager-main{
        order:1;
        width:100%;
    }

    .manuscript-manager-sidebar{
        order:2;
        width:100%;
    }
}