/* ============================================================================
   Hermes for Outlook — Taskpane styles
   ============================================================================ */

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #323130;
    background: #ffffff;
    overflow: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================================================
   LAYOUT ECRANS
   ============================================================================ */

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.screen-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 12px 16px 16px;
}

.screen-footer {
    padding: 10px 16px;
    border-top: 1px solid #edebe9;
    background: #faf9f8;
    flex-shrink: 0;
}

/* ============================================================================
   LOGO HERMES (tuile bleue)
   ============================================================================ */

.brand-logo-tile {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0078d4 0%, #004e8c 100%);
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Petit "H" stylisé blanc au centre de la tuile */
.brand-logo-tile::before {
    content: "H";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
}

.brand-logo-tile-sm {
    width: 28px;
    height: 28px;
    border-radius: 5px;
}

.brand-logo-tile-sm::before {
    font-size: 16px;
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
    color: #323130;
}

.brand-name-sm {
    font-size: 13px;
    font-weight: 600;
    color: #323130;
}

/* ============================================================================
   ECRAN LOGIN
   ============================================================================ */

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px 16px;
}

.brand-logo-large {
    margin-bottom: 4px;
}

.login-body {
    flex: 1;
    padding: 8px 24px 24px;
    overflow-y: auto;
    text-align: center;
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    color: #323130;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 13px;
    color: #605e5c;
    margin-bottom: 24px;
    line-height: 1.45;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
    margin: 0 auto;
    max-width: 320px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    color: #0078d4;
}

.feature-text {
    font-size: 13px;
    color: #323130;
    line-height: 1.45;
}

.login-footer {
    padding: 12px 20px 20px;
    flex-shrink: 0;
}

/* ============================================================================
   HEADER COMMUN (post-login)
   ============================================================================ */

.app-header {
    flex-shrink: 0;
    border-bottom: 1px solid #edebe9;
    background: white;
}

.header-top {
    padding: 10px 16px 6px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px 10px;
}

.screen-title {
    font-size: 18px;
    font-weight: 700;
    color: #323130;
}

.tree-icon-btn {
    background: #f3f2f1;
    border: 1px solid #edebe9;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #605e5c;
    transition: background 0.15s, color 0.15s;
}

.tree-icon-btn:hover {
    background: #e1dfdd;
    color: #0078d4;
}

/* ============================================================================
   BOUTONS ACTION (full-width en footer)
   ============================================================================ */

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-action-primary {
    background: #0078d4;
    color: white;
}

.btn-action-primary:hover:not(:disabled) {
    background: #106ebe;
}

.btn-outline {
    width: 100%;
    padding: 10px 14px;
    background: white;
    color: #0078d4;
    border: 1px solid #0078d4;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin: 10px 0 14px;
    transition: background 0.15s;
}

.btn-outline:hover {
    background: #eff6fc;
}

/* ============================================================================
   BARRE DE RECHERCHE
   ============================================================================ */

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    background: white;
    margin-bottom: 12px;
}

.search-bar:focus-within {
    border-color: #0078d4;
}

.search-bar-small {
    padding: 6px 10px;
    margin: 8px 0;
}

.search-icon {
    font-size: 14px;
    color: #605e5c;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    color: #323130;
    background: transparent;
}

.search-input::placeholder {
    color: #a19f9d;
}

/* ============================================================================
   LIBELLE DE SECTION
   ============================================================================ */

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: #605e5c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0 6px;
}

/* ============================================================================
   LISTE DES DOSSIERS (écran recherche)
   ============================================================================ */

.folder-list {
    display: flex;
    flex-direction: column;
}

.folder-list-item {
    display: flex;
    align-items: center;
    padding: 8px 8px;
    cursor: pointer;
    border-bottom: 1px solid #f3f2f1;
    gap: 10px;
    transition: background 0.15s;
}

.folder-list-item:hover {
    background: #f3f2f1;
}

.folder-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #8a8886;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.folder-list-item:hover .folder-radio {
    border-color: #0078d4;
}

.folder-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-ref {
    font-size: 12px;
    font-weight: 600;
    color: #0078d4;
    flex-shrink: 0;
}

.folder-name {
    font-size: 13px;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
   NAVIGATION RETOUR
   ============================================================================ */

.back-nav {
    margin: -12px -16px 8px;
    border-bottom: 1px solid #edebe9;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #0078d4;
    text-align: left;
}

.back-btn:hover {
    background: #f3f2f1;
}

.back-arrow {
    font-size: 14px;
}

/* ============================================================================
   CARTE DOSSIER (détail)
   ============================================================================ */

.folder-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f3f2f1;
    border-radius: 6px;
    margin-bottom: 14px;
}

.folder-card-info {
    flex: 1;
    min-width: 0;
}

.folder-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-card-path {
    font-size: 11px;
    color: #605e5c;
    margin-top: 2px;
}

.folder-card-icon {
    font-size: 22px;
    color: #0078d4;
    margin-left: 10px;
}

/* ============================================================================
   TOGGLE SWITCH (Enregistrer dans Hermès)
   ============================================================================ */

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 14px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #c8c6c4;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #0078d4;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 13px;
    color: #323130;
    font-weight: 500;
}

/* ============================================================================
   FORMULAIRE
   ============================================================================ */

.form-section {
    margin-bottom: 14px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #605e5c;
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    font-size: 13px;
    color: #323130;
    background: white;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: #0078d4;
}

/* ============================================================================
   ONGLETS (Détails / Documents)
   ============================================================================ */

.tabs {
    display: flex;
    border-bottom: 1px solid #edebe9;
    margin-bottom: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #605e5c;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
    color: #323130;
}

.tab-btn.tab-active {
    color: #0078d4;
    border-bottom-color: #0078d4;
    font-weight: 600;
}

.tab-content {
    padding: 4px 0 8px;
}

/* ============================================================================
   DETAILS DU DOSSIER
   ============================================================================ */

.details-section {
    margin-bottom: 16px;
}

.details-title {
    font-size: 13px;
    font-weight: 700;
    color: #323130;
    margin-bottom: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f3f2f1;
    gap: 10px;
}

.detail-label {
    font-size: 12px;
    color: #605e5c;
    flex-shrink: 0;
    min-width: 110px;
}

.detail-value {
    font-size: 13px;
    color: #323130;
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.detail-link {
    color: #0078d4;
    cursor: pointer;
    text-decoration: none;
}

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

/* ============================================================================
   DESTINATAIRES (avec boutons CC / CCI)
   ============================================================================ */

.recipients-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recipient-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f2f1;
    gap: 10px;
}

.recipient-name {
    font-size: 13px;
    color: #323130;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipient-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.recipient-btn {
    padding: 4px 10px;
    background: white;
    border: 1px solid #0078d4;
    border-radius: 4px;
    color: #0078d4;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.recipient-btn:hover {
    background: #eff6fc;
}

/* ============================================================================
   FILTRES DOCUMENTS
   ============================================================================ */

.filters-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    position: relative;
    z-index: 10;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #323130;
}

.btn-filter:hover {
    background: #f3f2f1;
}

.filter-arrow {
    font-size: 10px;
    color: #605e5c;
    transition: transform 0.2s;
}

.filters-panel {
    padding: 6px 0;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 4px;
    margin-top: 2px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.filter-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #323130;
    text-align: left;
    transition: background 0.1s;
}

.filter-menu-item:hover {
    background: #f3f2f1;
}

.filter-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.filter-menu-arrow {
    margin-left: auto;
    font-size: 16px;
    color: #a19f9d;
}

/* Sous-panneaux filtres */
.filter-subpanel {
    background: #fff;
    border: 1px solid #edebe9;
    border-radius: 4px;
    margin-top: 2px;
    padding: 8px 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.filter-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #0078d4;
    font-weight: 600;
}

.filter-back-btn:hover {
    text-decoration: underline;
}

.filter-subpanel-title {
    padding: 6px 14px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #323130;
}

/* Recherche répertoire dans filtre */
.filter-dir-search {
    padding: 4px 10px 2px;
}

.filter-dir-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.filter-dir-search-input:focus {
    border-color: #0078d4;
}

/* Filtre répertoires : arborescence */
.filter-dir-tree {
    padding: 4px 8px;
    max-height: 300px;
    overflow-y: auto;
}

.filter-dir-node {
    padding: 2px 0;
}

.filter-dir-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    color: #323130;
    transition: background 0.1s;
}

.filter-dir-row:hover {
    background: #f3f2f1;
}

.filter-dir-row.active {
    background: #e1f0fa;
    color: #0078d4;
    font-weight: 600;
}

.filter-dir-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #605e5c;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 3px;
    transition: background 0.1s;
}

.filter-dir-toggle:hover {
    background: #e1dfdd;
}

.filter-dir-toggle svg {
    display: block;
}

.filter-dir-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.filter-dir-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-dir-children {
    padding-left: 16px;
}

/* Filtre formats : checkboxes */
.filter-format-list {
    padding: 4px 14px;
    max-height: 320px;
    overflow-y: auto;
}

.filter-format-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 13px;
    color: #323130;
    border-radius: 3px;
    transition: background 0.1s;
}

.filter-format-row:hover {
    background: #f3f2f1;
}

.filter-format-row input[type="checkbox"] {
    accent-color: #0078d4;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: none;
}

.filter-format-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-format-icon svg,
.filter-format-icon img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.filter-format-label {
    flex: 1;
    font-weight: 500;
}

.filter-format-actions {
    display: flex;
    gap: 8px;
    padding: 8px 14px 4px;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 6px 16px;
    background: white;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    color: #323130;
}

.btn-secondary:hover {
    background: #f3f2f1;
}

.btn-sm {
    padding: 6px 20px;
    font-size: 12px;
}

/* ============================================================================
   LISTE DES DOCUMENTS
   ============================================================================ */

.documents-list {
    display: flex;
    flex-direction: column;
}

.document-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    border-bottom: 1px solid #f3f2f1;
}

.document-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.document-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.document-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-info.clickable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background 0.1s;
}

.document-info.clickable:hover {
    background: #eff6fc;
}

.document-info.clickable:hover .document-name {
    color: #0078d4;
    text-decoration: underline;
}

.document-name {
    font-size: 12px;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 10px;
    color: #a19f9d;
    margin-top: 1px;
}

.document-action {
    background: #fff;
    border: 1px solid #0078d4;
    border-radius: 4px;
    padding: 3px 8px;
    color: #0078d4;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.document-action:hover {
    background: #e1f0fa;
    color: #106ebe;
    border-color: #106ebe;
}

.document-action .pdf-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.documents-count {
    font-size: 11px;
    color: #605e5c;
    padding: 8px 4px 4px;
}

/* ============================================================================
   LISTE CHECKBOX (PJ en mode lecture)
   ============================================================================ */

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f2f1;
    font-size: 13px;
    color: #323130;
    cursor: pointer;
}

.checkbox-row:hover {
    background: #faf9f8;
}

.checkbox-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #0078d4;
    cursor: pointer;
}

.att-checkbox {
    margin: 0;
}

/* ============================================================================
   BOUTON ARBORESCENCE DANS LA FOLDER-CARD
   ============================================================================ */

.folder-tree-btn {
    background: #eff6fc;
    border: 1px solid #0078d4;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #0078d4;
    transition: background 0.15s;
    flex-shrink: 0;
    margin-left: 8px;
    opacity: 0.85;
}

.folder-tree-btn:hover {
    background: #cce4f6;
    opacity: 1;
}

/* Nœud actif dans l'arborescence (répertoire sélectionné) */
.tree-row-active {
    background: #e8f4fd;
    border-radius: 4px;
    color: #0078d4;
    font-weight: 600;
}

/* ============================================================================
   ARBORESCENCE
   ============================================================================ */

.tree-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tree-node {
    display: flex;
    flex-direction: column;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #323130;
    cursor: default;
    min-height: 32px;
}

.tree-row-selectable {
    cursor: pointer;
}

.tree-row-selectable:hover {
    background: #f3f2f1;
}

.tree-row-category {
    font-weight: 600;
    color: #605e5c;
}

.tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #605e5c;
    flex-shrink: 0;
    padding: 0;
    border-radius: 3px;
    transition: background 0.1s, transform 0.15s;
}

.tree-toggle:hover {
    background: #e1dfdd;
}

.tree-toggle svg {
    display: block;
}

.tree-toggle-spacer {
    width: 20px;
    flex-shrink: 0;
}

.tree-icon {
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.tree-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-dots {
    background: none;
    border: none;
    cursor: pointer;
    color: #0078d4;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}

.tree-row:hover .tree-dots {
    opacity: 1;
}

.tree-dots:hover {
    background: #e1f0fa;
}

.tree-children {
    margin-left: 10px;
    padding-left: 10px;
}

/* Barre inline de création de répertoire */
.tree-create-bar {
    padding: 10px 12px 8px;
    border-top: 1px solid #e1dfdd;
    background: #faf9f8;
}

.tree-create-bar .tree-create-label {
    font-size: 11px;
    color: #605e5c;
    margin-bottom: 6px;
}

.tree-create-row {
    margin-bottom: 6px;
}

.tree-create-input {
    width: 100%;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
}

.tree-create-input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
}

.tree-create-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 500;
}

.btn-small-primary {
    background: #0078d4;
    color: #fff;
    border-color: #0078d4;
}

.btn-small-primary:hover {
    background: #106ebe;
}

.btn-small-primary:disabled {
    background: #c8c6c4;
    border-color: #c8c6c4;
    cursor: not-allowed;
}

.btn-small-ghost {
    background: transparent;
    color: #323130;
    border-color: #c8c6c4;
}

.btn-small-ghost:hover {
    background: #f3f2f1;
}

/* Barre de confirmation (au-dessus du bouton Confirmer) */
.tree-selection-bar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #dff6dd;
    border: 1px solid #107c10;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.tree-selection-label {
    font-size: 11px;
    color: #107c10;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tree-selection-path {
    font-size: 13px;
    font-weight: 600;
    color: #0b5a08;
    word-break: break-all;
}

/* ============================================================================
   LIGNES DE PIECES JOINTES (read detail)
   ============================================================================ */

.att-list {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}

/* Conteneur d'une PJ */
.att-row {
    border-bottom: 1px solid #f3f2f1;
    padding: 6px 0 8px;
}

/* Ligne principale : checkbox + nom + actions */
.att-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.att-row-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.att-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Boutons icône dans la ligne PJ */
.att-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    color: #605e5c;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.att-icon-btn:hover {
    background: #e1dfdd;
    color: #323130;
}

/* Bouton dossier : couleur bleue pour se distinguer du rename */
.att-icon-btn.att-icon-folder {
    color: #0078d4;
}

.att-icon-btn.att-icon-folder:hover {
    background: #eff6fc;
    border-color: #0078d4;
}

/* Zone de renommage (masquée par défaut, affichée via toggle) */
.att-rename-section {
    margin-top: 6px;
}

.att-rename-input {
    font-size: 12px;
    padding: 5px 8px;
}

/* Indicateur : répertoire spécifique différent du répertoire principal */
.att-subfolder-indicator {
    font-size: 11px;
    color: #0078d4;
    padding: 3px 0 0 26px;
    font-style: italic;
}

/* Description par PJ (mode PJ seules) */
.att-desc-section {
    margin-top: 6px;
    padding-left: 26px; /* aligné avec le nom, après la checkbox */
}

.att-desc-section .form-label {
    font-size: 11px;
    margin-bottom: 3px;
}

.att-desc-section .form-input {
    font-size: 12px;
    padding: 5px 8px;
}

/* ============================================================================
   LISTE DES MODELES D'EMAILS
   ============================================================================ */

.templates-list {
    display: flex;
    flex-direction: column;
}

.template-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid #f3f2f1;
    cursor: pointer;
    transition: background 0.15s;
}

.template-row:hover {
    background: #f3f2f1;
}

.template-icon {
    font-size: 18px;
    color: #0078d4;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.template-info {
    flex: 1;
    min-width: 0;
}

.template-name {
    font-size: 13px;
    font-weight: 600;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-preview {
    font-size: 11px;
    color: #a19f9d;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-arrow {
    font-size: 20px;
    color: #c8c6c4;
    flex-shrink: 0;
}

/* ============================================================================
   FOOTER USER BAR
   ============================================================================ */

.footer-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0078d4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
}

.footer-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.footer-user-name {
    font-size: 12px;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-user-mode {
    font-size: 10px;
    color: #a19f9d;
}

.footer-user-mode.mode-mock {
    color: #ca5010;
    font-weight: 600;
}

.footer-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #605e5c;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-btn:hover {
    background: #e1dfdd;
}

/* ============================================================================
   TOASTS / STATUS MESSAGES
   ============================================================================ */

.status-message {
    position: fixed;
    bottom: 72px;
    left: 12px;
    right: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-message.success {
    background: #dff6dd;
    color: #107c10;
    border: 1px solid #107c10;
}

.status-message.error {
    background: #fde7e9;
    color: #a4262c;
    border: 1px solid #a4262c;
}

.status-message.info {
    background: #cce4f6;
    color: #004578;
    border: 1px solid #004578;
}

/* Toast custom "Email enregistré dans Hermès" */
.status-message.success-hermes {
    background: white;
    border: 1px solid #107c10;
    color: #323130;
    align-items: center;
}

.success-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #107c10;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.success-icon::before {
    content: "\2713"; /* checkmark */
}

.success-content {
    flex: 1;
    min-width: 0;
}

.success-title {
    font-size: 13px;
    font-weight: 700;
    color: #107c10;
    margin-bottom: 2px;
}

.success-body {
    font-size: 12px;
    color: #605e5c;
    line-height: 1.35;
}

.dismiss-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    color: inherit;
    opacity: 0.6;
    flex-shrink: 0;
}

.dismiss-btn:hover {
    opacity: 1;
}

/* ============================================================================
   LOADING / SPINNER / EMPTY
   ============================================================================ */

.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
    color: #605e5c;
    font-size: 13px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e1dfdd;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.btn-action-primary .spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: white;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 28px 16px;
    color: #a19f9d;
    font-size: 13px;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a19f9d;
}
