/**
 * PR4 - Drive Styles (Minimaliste)
 * Design épuré et clair pour la section "Mes Fichiers"
 */

/* Container principal */
.saved-documents-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 5px;
    padding-right: 5px;
    max-width: 800px;
    margin: 0 auto;
}

/* En-tête de session - Minimaliste */
.drive-session-header {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.drive-session-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.drive-session-left {
    flex: 1;
}

.drive-session-email {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-session-stats {
    font-size: 14px;
    color: var(--text-secondary);
}

.drive-logout-btn {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drive-logout-btn svg {
    width: 20px;
    height: 20px;
}

.drive-logout-btn:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: #ff5252;
    color: #ff5252;
}

/* Barre d'utilisation du stockage */
.drive-usage-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.drive-usage-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Grille de documents */
.drive-documents-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Carte de document - Design plat et minimaliste */
.drive-document-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.drive-document-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Alerte expiration */
.drive-document-card.expiring-soon {
    border-left: 3px solid #ff9800;
    background: #fff8f0;
}

/* Section principale */
.drive-doc-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.drive-doc-left {
    flex: 1;
    min-width: 0;
}

.drive-doc-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    word-break: break-word;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-doc-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.drive-doc-right {
    flex-shrink: 0;
}

/* Décompte - Badge simple */
.drive-doc-countdown {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(18, 96, 168, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    white-space: nowrap;
}

.drive-doc-countdown.expiring-soon {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

/* Footer - Code et actions */
.drive-doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.drive-doc-code {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.drive-doc-code strong {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.code-copy-icon {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-copy-icon svg {
    width: 16px;
    height: 16px;
}

.code-copy-icon:hover {
    color: var(--primary-color);
}

/* Actions rapides */
.drive-doc-quick-actions {
    display: flex;
    gap: 8px;
}

.drive-icon-btn {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drive-icon-btn svg {
    width: 18px;
    height: 18px;
}

.drive-icon-btn:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.drive-icon-btn.delete:hover {
    border-color: #ff5252;
    color: #ff5252;
}

/* État vide */
.empty-drive-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-drive-state svg {
    opacity: 0.2;
}

.empty-drive-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Modal Drive */
.drive-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.drive-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.drive-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.drive-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-icon {
    width: 22px;
    height: 22px;
    stroke: var(--primary-color);
}

.drive-modal-body {
    padding: 20px;
}

.drive-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.drive-cancel-btn {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-cancel-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

.drive-save-btn-primary {
    flex: 2;
    padding: 12px 20px;
    border: none;
    background: var(--primary-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-save-btn-primary:hover {
    background: #0E4D87;
}

.drive-save-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Formulaire */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.nft-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: 'Calibri', Arial, sans-serif;
}

.nft-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Animation de succès */
.success-animation {
    width: 64px;
    height: 64px;
    background: #0F8A4F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: scaleIn 0.4s ease-out;
}

.success-animation svg {
    width: 32px;
    height: 32px;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation de sortie */
@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ===== ÉCRANS D'AUTHENTIFICATION ===== */

.drive-auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding-left: 0px;
    padding-right: 0px;
}

.drive-auth-card {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.drive-auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.drive-auth-icon {
    width: 64px;
    height: 64px;
    stroke: var(--primary-color);
    margin: 0 auto 20px;
}

.drive-auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-auth-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

.drive-auth-header p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.drive-primary-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    background: var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Calibri', Arial, sans-serif;
    margin-top: 8px;
}

.drive-primary-btn:hover {
    background: #0E4D87;
}

.drive-primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.drive-auth-info {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.drive-auth-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Code de démo (à retirer en production) */
.drive-demo-code {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

.drive-demo-code strong {
    font-size: 18px;
    font-family: 'Courier New', monospace;
    color: #000;
}

/* Champ de code de vérification */
.code-input {
    text-align: center;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    font-weight: bold;
}

/* Actions d'authentification */
.drive-auth-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.drive-link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-link-btn:hover {
    text-decoration: underline;
}

/* Caractéristiques du plan */
.drive-plan-features {
    background: rgba(18, 96, 168, 0.05);
    border: 1px solid rgba(18, 96, 168, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.drive-plan-features h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drive-plan-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== OCR & SMART ACTIONS ===== */

/* Badge OCR */
.drive-doc-ocr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.drive-doc-ocr-badge.processing {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.drive-doc-ocr-badge.completed {
    background: rgba(15, 138, 79, 0.1);
    color: #0F8A4F;
}

.drive-doc-ocr-badge.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.drive-doc-ocr-badge svg {
    width: 14px;
    height: 14px;
    animation: spin 1s linear infinite;
}

.drive-doc-ocr-badge.completed svg,
.drive-doc-ocr-badge.error svg {
    animation: none;
}

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

/* Section d'actions intelligentes */
.drive-doc-smart-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.drive-doc-smart-actions-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.drive-smart-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.drive-smart-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'Calibri', Arial, sans-serif;
}

.drive-smart-action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: var(--text-secondary);
    transition: stroke 0.2s ease;
}

.drive-smart-action-btn:hover {
    background: rgba(18, 96, 168, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.drive-smart-action-btn:hover svg {
    stroke: var(--primary-color);
}

.drive-smart-action-btn:active {
    transform: translateY(0);
}

/* Type de document détecté */
.drive-doc-type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(18, 96, 168, 0.1);
    color: var(--primary-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.drive-doc-type-indicator svg {
    width: 12px;
    height: 12px;
}

/* Résumé du contenu OCR */
.drive-doc-ocr-summary {
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.drive-doc-ocr-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.drive-doc-keyword {
    padding: 4px 8px;
    background: rgba(18, 96, 168, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Badge "Nouveau" pour nouvelles fonctionnalités */
.new-feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: linear-gradient(135deg, #1260A8 0%, #194B8A 100%);
    color: white;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 600px) {
    .saved-documents-list {
        padding-top: 0px;
        padding-bottom: 0px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .drive-smart-actions-grid {
        grid-template-columns: 1fr;
    }

    .drive-doc-ocr-summary {
        font-size: 12px;
    }

    .drive-session-header {
        padding: 16px 0;
    }

    .drive-session-email {
        font-size: 17px;
    }

    .drive-session-stats {
        font-size: 13px;
    }

    .drive-document-card {
        padding: 14px;
    }

    .drive-doc-main {
        flex-direction: column;
        gap: 12px;
    }

    .drive-doc-right {
        align-self: flex-start;
    }

    .drive-doc-name {
        font-size: 15px;
    }

    .drive-doc-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .drive-modal-content {
        border-radius: 0;
        max-height: 100vh;
    }
}

/* ═══════════════════════════════════════════
   INBOX / DRIVE INTELLIGENT STYLES
   Integrated multi-source document hub
   ═══════════════════════════════════════════ */

/* Sources Bar */
.inbox-sources-bar {
    margin-bottom: 12px;
    overflow: hidden;
}

.inbox-sources-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.inbox-sources-scroll::-webkit-scrollbar {
    display: none;
}

.inbox-sources-chips {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.inbox-source-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Calibri', Arial, sans-serif;
}

.inbox-source-chip:hover {
    border-color: var(--primary-color);
    background: rgba(18, 96, 168, 0.05);
}

.inbox-source-chip.active {
    border-color: var(--primary-color);
    background: rgba(18, 96, 168, 0.1);
    box-shadow: 0 0 0 2px rgba(18, 96, 168, 0.15);
}

.inbox-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.inbox-chip-badge {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
}

.inbox-add-source-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(18, 96, 168, 0.08);
    border: 1px dashed var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Calibri', Arial, sans-serif;
    flex-shrink: 0;
}

.inbox-add-source-chip:hover {
    background: rgba(18, 96, 168, 0.15);
}

/* Filters */
.inbox-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.inbox-filters::-webkit-scrollbar {
    display: none;
}

.inbox-filter-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Calibri', Arial, sans-serif;
}

.inbox-filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.inbox-filter-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.inbox-filter-tab.active svg {
    stroke: white;
}

.inbox-filter-count {
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
    padding: 0 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 16px;
}

.inbox-filter-tab.active .inbox-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* View Toggle - Segmented Control (Mes fichiers / Modeles) — desactive
.inbox-view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
    gap: 2px;
}

.inbox-view-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.inbox-view-btn.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inbox-view-btn svg {
    flex-shrink: 0;
}
*/

/* Sticky Toolbar - reste fixe sous le header au scroll */
.inbox-sticky-toolbar {
    position: sticky;
    top: 90px;
    z-index: 10;
    background: #ffffff;
    padding-bottom: 4px;
}

@media (max-width: 768px) {
    .inbox-sticky-toolbar {
        top: 82px;
    }
}

/* Search Bar */
.inbox-search-bar {
    position: relative;
    margin-bottom: 12px;
}

.inbox-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.inbox-search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    font-size: 16px;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
    font-family: 'Calibri', Arial, sans-serif;
    box-sizing: border-box;
}

.inbox-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(18, 96, 168, 0.1);
}

.inbox-search-input::placeholder {
    color: #9ca3af;
}

.inbox-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.inbox-search-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

/* Sort Bar */
.inbox-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}

.inbox-sort-left {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.inbox-sort-left::-webkit-scrollbar {
    display: none;
}

.inbox-sort-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Calibri', Arial, sans-serif;
}

.inbox-sort-chip:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.inbox-sort-chip.active {
    background: rgba(18, 96, 168, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.inbox-sort-direction {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.inbox-sort-direction:hover {
    background: rgba(0, 0, 0, 0.04);
}

.inbox-sort-direction.asc svg {
    transform: rotate(180deg);
}

/* Doc Cards */
.inbox-docs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
}

.inbox-date-group {
    margin-bottom: 8px;
}

.inbox-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    margin-bottom: 4px;
}

.inbox-group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Calibri', Arial, sans-serif;
}

.inbox-group-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ── Document card (style Imprimer-inspired) ── */
.inbox-doc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.inbox-doc-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.inbox-doc-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.inbox-doc-icon svg {
    width: 24px;
    height: 24px;
}

.inbox-doc-icon.pdf { background: rgba(204, 41, 54, 0.08); color: #CC2936; }
.inbox-doc-icon.word { background: rgba(37, 99, 235, 0.08); color: #2563eb; }
.inbox-doc-icon.excel { background: rgba(22, 163, 74, 0.08); color: #16a34a; }
.inbox-doc-icon.image { background: rgba(124, 58, 237, 0.08); color: #7c3aed; }
.inbox-doc-icon.text { background: rgba(107, 114, 128, 0.08); color: #6b7280; }

.inbox-doc-type-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.inbox-doc-body {
    flex: 1;
    min-width: 0;
}

.inbox-doc-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.inbox-doc-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    line-height: 1.4;
}

.inbox-doc-sep {
    opacity: 0.4;
}

.inbox-doc-ext {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}
.inbox-doc-icon.pdf ~ .inbox-doc-body .inbox-doc-ext { background: #CC2936; }
.inbox-doc-icon.word ~ .inbox-doc-body .inbox-doc-ext { background: #2563eb; }
.inbox-doc-icon.excel ~ .inbox-doc-body .inbox-doc-ext { background: #16a34a; }
.inbox-doc-icon.image ~ .inbox-doc-body .inbox-doc-ext { background: #7c3aed; }
.inbox-doc-icon.text ~ .inbox-doc-body .inbox-doc-ext { background: #6b7280; }

.inbox-doc-from {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.inbox-doc-from svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.5;
}

.inbox-doc-from-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-doc-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.inbox-doc-footer {
    margin-top: 5px;
}

.inbox-doc-smart {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
}

/* Print action button (prominent) */
.inbox-doc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.inbox-print-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 96, 168, 0.08);
    border: 1.5px solid rgba(18, 96, 168, 0.15);
    border-radius: 12px;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
}

.inbox-print-btn svg {
    width: 20px;
    height: 20px;
}

.inbox-print-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(18, 96, 168, 0.3);
}

.inbox-icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.inbox-icon-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(18, 96, 168, 0.05);
}

.inbox-no-results {
    text-align: center;
    padding: 48px 24px 32px;
    min-height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Empty State */
.inbox-empty-state {
    padding: 16px 0;
}

.inbox-empty-hero {
    text-align: center;
    padding: 24px 20px 20px;
}

.inbox-empty-hero svg {
    opacity: 0.7;
}

.inbox-empty-title {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0 6px;
}

.inbox-empty-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.inbox-quick-connect-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 4px;
}

.inbox-quick-connect-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Calibri', Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-height: 44px;
}

.inbox-quick-connect-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(18, 96, 168, 0.15);
    transform: translateY(-2px);
}

.inbox-quick-connect-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.inbox-quick-connect-btn span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
}

.inbox-qc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.03);
}

/* Bottom Sheet Overlay */
.inbox-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inbox-sheet-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.inbox-sheet-overlay.visible {
    opacity: 1;
}

.inbox-bottom-sheet {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    overflow-y: auto;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.inbox-sheet-overlay.visible .inbox-bottom-sheet {
    transform: none;
}

.inbox-sheet-handle {
    display: none;
}

.inbox-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e9ecef;
}

.inbox-sheet-title {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.inbox-sheet-close {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: var(--transition);
}

.inbox-sheet-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.inbox-sheet-body {
    padding: 0 20px 24px;
}

.inbox-sheet-section {
    margin-bottom: 20px;
}

.inbox-sheet-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}

.inbox-sheet-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inbox-sheet-service-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: left;
    position: relative;
}

.inbox-sheet-service-btn:hover {
    border-color: var(--primary-color);
    background: rgba(18, 96, 168, 0.03);
}

.inbox-sheet-service-btn.connected {
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.03);
}

.inbox-sheet-svc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.inbox-sheet-svc-info {
    flex: 1;
}

.inbox-sheet-svc-info span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Calibri', Arial, sans-serif;
}

.inbox-sheet-svc-info small {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.inbox-connected-badge {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Connected Accounts List */
.inbox-connected-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inbox-connected-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(37, 211, 102, 0.04);
    border: 1px solid rgba(37, 211, 102, 0.15);
    border-radius: 10px;
}

.inbox-connected-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inbox-account-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
}

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

.inbox-connected-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.inbox-connected-email {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-disconnect-btn {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.inbox-disconnect-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Connecting Screen */
.inbox-connecting-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inbox-connecting-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 8px;
}

.inbox-connecting-content {
    text-align: center;
    padding: 20px;
}

.inbox-connecting-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(18, 96, 168, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: inboxSpin 0.8s linear infinite;
}

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

.inbox-connecting-content h3 {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.inbox-connecting-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.inbox-connecting-account {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    display: inline-block;
}

/* File Browser */
.inbox-browser-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f9fafb;
    z-index: 2100;
    display: flex;
    flex-direction: column;
}

.inbox-browser-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.inbox-browser-back {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 8px;
}

.inbox-browser-back:hover {
    background: rgba(0, 0, 0, 0.04);
}

.inbox-browser-header h3 {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.inbox-browser-path {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.inbox-path-segment {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
}

.inbox-path-segment.active {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}

.inbox-path-sep {
    color: var(--text-secondary);
    opacity: 0.5;
}

.inbox-browser-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.inbox-browser-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.inbox-browser-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.inbox-browser-item.is-folder {
    background: rgba(18, 96, 168, 0.03);
}

.inbox-browser-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inbox-browser-icon.folder { background: rgba(18, 96, 168, 0.1); color: var(--primary-color); }
.inbox-browser-icon.pdf { background: rgba(204, 41, 54, 0.1); color: #CC2936; }
.inbox-browser-icon.image { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }

.inbox-browser-body {
    flex: 1;
    min-width: 0;
}

.inbox-browser-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-browser-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.inbox-browser-action {
    flex-shrink: 0;
    color: var(--text-secondary);
}

/* Local file button accent */
.inbox-local-btn {
    border-color: rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.03);
}

.inbox-local-btn:hover {
    border-color: #194B8A;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.inbox-doc-icon.local {
    background: rgba(25, 75, 138, 0.08);
    color: #194B8A;
}

/* Preview Overlay */
.inbox-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2200;
    display: flex;
    flex-direction: column;
}

.inbox-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.5);
}

.inbox-preview-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: white;
    border-radius: 8px;
}

.inbox-preview-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.inbox-preview-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Calibri', Arial, sans-serif;
}

.inbox-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 16px;
}

.inbox-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    .inbox-quick-connect-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 0;
    }

    .inbox-quick-connect-btn {
        padding: 12px 6px;
    }

    .inbox-quick-connect-btn span {
        font-size: 11px;
    }

    .inbox-doc-card {
        padding: 12px 14px;
        gap: 12px;
        border-radius: 14px;
    }

    .inbox-doc-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .inbox-doc-icon svg {
        width: 20px;
        height: 20px;
    }

    .inbox-doc-name {
        font-size: 14px;
    }

    .inbox-doc-from {
        font-size: 11px;
    }

    .inbox-print-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .inbox-print-btn svg {
        width: 17px;
        height: 17px;
    }

    .inbox-icon-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        border-radius: 10px;
    }

    .inbox-bottom-sheet {
        width: 95%;
        max-height: 85vh;
    }
}
