/* ══════════════════════════════════════════════
   GED PLATEFORME — Custom Styles
   ══════════════════════════════════════════════ */

:root {
    --sidebar-width: 300px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --topbar-height: 60px;
    --primary: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
}

/* ──────── RESET ──────── */
body {
    font-family: "Inter", "Segoe UI", sans-serif;
    background-color: #f1f5f9;
    overflow-x: hidden;
}

/* ══════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════ */
.topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: left 0.3s ease;
}

.topbar .page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

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

.topbar .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s ease;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header .logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* ──── Navigation Items ──── */
.sidebar-nav {
    padding: 16px 0;
}

.sidebar-section {
    padding: 0 16px;
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 12px 12px 6px;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

/* ──── Tree View (Arborescence) ──── */
.tree-view {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree-view .tree-view {
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: 10px;
}

.tree-item {
    margin-bottom: 1px;
}

.tree-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.82rem;
}

.tree-item-header:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.tree-item-header.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--sidebar-active);
}

.tree-toggle {
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    width: 16px;
    text-align: center;
    color: #64748b;
}

.tree-toggle.open {
    transform: rotate(90deg);
}

.tree-item-icon {
    font-size: 1rem;
}

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

.tree-item-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 10px;
    color: #94a3b8;
}

/* ──── Space Type Badges ──── */
.space-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.space-badge.entreprise {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.space-badge.moe {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.space-badge.diffusion {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

/* ──── Breadcrumb ──── */
.breadcrumb-ged {
    background: white;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb-ged a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.breadcrumb-ged a:hover {
    text-decoration: underline;
}

.breadcrumb-ged .separator {
    color: #94a3b8;
    font-size: 0.75rem;
}

.breadcrumb-ged .current {
    color: #475569;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ──── Stats Cards ──── */
.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 16px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

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

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.stat-card .stat-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.stat-card .stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card .stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card .stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.stat-card .stat-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1;
}

.stat-card .stat-info p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 4px 0 0;
}

/* ──── Content Cards ──── */
.content-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.content-card .card-header-custom {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card .card-header-custom h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-card .card-body-custom {
    padding: 0;
}

/* ──── File/Folder Items in Explorer ──── */
.explorer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
}

.explorer-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.explorer-item:hover {
    background: #eff6ff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    color: inherit;
}

.explorer-item .item-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

.explorer-item .item-icon.folder {
    color: #f59e0b;
}

.explorer-item .item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorer-item .item-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* ──── List View (Table) ──── */
.file-table {
    width: 100%;
    font-size: 0.875rem;
}

.file-table thead th {
    background: #f8fafc;
    padding: 10px 16px;
    font-weight: 600;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.file-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.file-table tbody tr:hover {
    background: #f8fafc;
}

.file-table .file-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #1e293b;
}

.file-table .file-name a {
    color: #1e293b;
    text-decoration: none;
}

.file-table .file-name a:hover {
    color: var(--primary);
}

.file-table .file-name i {
    font-size: 1.3rem;
}

/* ──── Activity Log ──── */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: #f8fafc;
}

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

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.upload {
    background: var(--success);
}
.activity-dot.download {
    background: var(--info);
}
.activity-dot.view {
    background: #94a3b8;
}
.activity-dot.delete {
    background: var(--danger);
}
.activity-dot.comment {
    background: var(--warning);
}
.activity-dot.visa {
    background: #8b5cf6;
}

.activity-content {
    flex: 1;
}

.activity-content .activity-text {
    font-size: 0.82rem;
    color: #334155;
    margin: 0;
}

.activity-content .activity-text strong {
    color: #1e293b;
}

.activity-content .activity-time {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* ──── Empty State ──── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.empty-state h5 {
    color: #64748b;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.875rem;
}

/* ──── Readonly Badge ──── */
.readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ──── Version Badge ──── */
.version-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ══════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
}

.login-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.login-left p {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 400px;
}

.login-right {
    width: 480px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.login-form {
    width: 100%;
    max-width: 360px;
}

.login-form h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.login-form .subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.login-form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.login-form .form-control {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-form .btn-primary {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--primary);
    border: none;
}

.login-form .btn-primary:hover {
    background: #2563eb;
}

/* ══════════════════════════════════════════════
   SIDEBAR TOGGLE (Mobile)
   ══════════════════════════════════════════════ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #1e293b;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 991.98px) {
    .sidebar {
        left: calc(var(--sidebar-width) * -1);
    }

    .sidebar.show {
        left: 0;
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .login-left {
        display: none;
    }

    .login-right {
        width: 100%;
    }
}

/* ──── Scrollbar Sidebar ──── */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

/* ──── Animations ──── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ──── Toast Notifications ──── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
}

/* ══════════════════════════════════════════════
   UPLOAD ZONE — Drag & Drop
   ══════════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.04);
}

.upload-zone.dragover {
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.upload-zone .upload-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 12px;
    display: block;
    transition: color 0.3s ease;
}

.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
    color: var(--primary);
}

.upload-zone h5 {
    color: #475569;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-zone p {
    color: #94a3b8;
    font-size: 0.82rem;
    margin: 0;
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ──── File Preview List (avant upload) ──── */
.file-preview-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 16px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.file-preview-item .file-info {
    flex: 1;
    min-width: 0;
}

.file-preview-item .file-info .file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-item .file-info .file-size {
    font-size: 0.72rem;
    color: #94a3b8;
}

.file-preview-item .remove-file {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.file-preview-item .remove-file:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ──── Upload Progress ──── */
.upload-progress {
    margin-top: 16px;
    display: none;
}

.upload-progress .progress {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.upload-progress .progress-bar {
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ══════════════════════════════════════════════
   DOCUMENT DETAIL PAGE
   ══════════════════════════════════════════════ */
.document-header {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.document-header .doc-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.document-header .doc-icon.pdf {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.document-header .doc-icon.image {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.document-header .doc-icon.word {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.document-header .doc-icon.excel {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.document-header .doc-icon.default {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

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

.document-header .doc-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    word-break: break-word;
}

.document-header .doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.document-header .doc-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #64748b;
}

.document-header .doc-meta .meta-item i {
    font-size: 0.9rem;
}

.document-header .doc-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ──── Preview Container ──── */
.preview-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 20px;
}

.preview-container .preview-header {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-container .preview-header h6 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.preview-container .preview-body {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.preview-container .preview-body iframe {
    width: 100%;
    min-height: 600px;
    border: none;
}

.preview-container .preview-body img {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
}

.no-preview {
    text-align: center;
    padding: 60px;
    color: #94a3b8;
}

.no-preview i {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

/* ──── Version Timeline ──── */
.version-timeline {
    position: relative;
    padding-left: 30px;
}

.version-timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.version-item {
    position: relative;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.version-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.version-item.current {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.02);
}

.version-item::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

.version-item.current::before {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.version-item .version-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.version-item .version-number {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.version-item .version-date {
    font-size: 0.78rem;
    color: #94a3b8;
}

.version-item .version-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: #64748b;
}

.version-item .version-note {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #475569;
    font-style: italic;
}

.version-item .version-actions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
}

/* ══════════════════════════════════════════════
   COMMENTS & VISAS
   ══════════════════════════════════════════════ */
.comment-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.comment-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.comment-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.comment-tab:hover {
    color: var(--primary);
    background: white;
}

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

.comment-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
}

.comment-tab .tab-count.comments-count {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.comment-tab .tab-count.visas-count {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* ──── Comment List ──── */
.comment-list {
    max-height: 500px;
    overflow-y: auto;
}

.comment-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.comment-item:hover {
    background: #fafbfc;
}

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

.comment-item .comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-item .comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-item .comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.comment-item .comment-avatar.moe {
    background: var(--info);
}

.comment-item .comment-avatar.entreprise {
    background: var(--primary);
}

.comment-item .comment-avatar.opc {
    background: var(--warning);
}

.comment-item .comment-avatar.admin {
    background: var(--danger);
}

.comment-item .author-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
}

.comment-item .author-role {
    font-size: 0.7rem;
}

.comment-item .comment-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.comment-item .comment-body {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.6;
    margin-left: 42px;
}

.comment-item .comment-actions {
    margin-left: 42px;
    margin-top: 6px;
}

/* ──── Visa Badge dans le commentaire ──── */
.visa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 8px;
    margin-left: 42px;
}

.visa-badge.approuve {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.visa-badge.rejete {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.visa-badge.a_modifier {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.visa-badge.en_attente {
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ──── Comment Form ──── */
.comment-form {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.comment-form textarea {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.88rem;
    resize: vertical;
    min-height: 80px;
}

.comment-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.visa-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.visa-option {
    display: none;
}

.visa-option + label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.visa-option + label:hover {
    border-color: #94a3b8;
}

.visa-option:checked + label {
    border-width: 2px;
}

.visa-option[value="approuve"]:checked + label {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    color: #16a34a;
}

.visa-option[value="rejete"]:checked + label {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.visa-option[value="a_modifier"]:checked + label {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}

.visa-option[value="en_attente"]:checked + label {
    border-color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
    color: #64748b;
}

/* ──── Visa Summary ──── */
.visa-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.visa-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e2e8f0;
}

.visa-summary-item .count {
    font-size: 1.1rem;
    font-weight: 700;
}

.visa-summary-item .label {
    font-size: 0.78rem;
    color: #64748b;
}

/* ══════════════════════════════════════════════
   NOTIFICATIONS PAGE
   ══════════════════════════════════════════════ */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.03);
    border-left: 3px solid var(--primary);
}

.notification-item .notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notification-item .notif-icon.comment {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.notification-item .notif-icon.visa {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.notification-item .notif-icon.upload {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.notification-item .notif-content {
    flex: 1;
    min-width: 0;
}

.notification-item .notif-text {
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 4px;
}

.notification-item .notif-text strong {
    color: #1e293b;
}

.notification-item .notif-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.notification-item .notif-actions {
    flex-shrink: 0;
}

/* ──── Notification Badge (Topbar) ──── */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ══════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════ */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-header h4 {
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.admin-header .subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 4px 0 0;
}

/* ──── Filter Bar ──── */
.filter-bar {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.filter-bar .form-control,
.filter-bar .form-select {
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #d1d5db;
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ──── Data Table ──── */
.data-table {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.data-table table {
    width: 100%;
    font-size: 0.875rem;
    margin: 0;
}

.data-table thead th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 600;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

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

/* ──── User Avatar in Table ──── */
.user-table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

/* ──── Status Toggle ──── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.active {
    background: #22c55e;
}
.status-dot.inactive {
    background: #ef4444;
}

/* ──── Admin Chart Placeholder ──── */
.chart-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    min-height: 200px;
}

.chart-container h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 16px;
}

/* ──── Mini Bar Chart (CSS only) ──── */
.mini-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 100px;
}

.mini-bar {
    flex: 1;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: background 0.2s;
}

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

.mini-bar .bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #94a3b8;
    white-space: nowrap;
}

.mini-bar .bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

/* ──── Permission Matrix ──── */
.permission-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.permission-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.permission-card .perm-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.permission-card .perm-toggles {
    display: flex;
    gap: 16px;
}

.perm-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #64748b;
}

.perm-toggle .form-check-input {
    width: 16px;
    height: 16px;
}

/* ──── Profile Page ──── */
.profile-header {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-header .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 16px;
}

.profile-header h3 {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.profile-header .profile-email {
    color: #64748b;
    font-size: 0.9rem;
}

/* ══════════════════════════════════════════════
   DELETE CONFIRMATION MODAL
   ══════════════════════════════════════════════ */

/* ──── Icône animée ──── */
.delete-modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.delete-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: deleteIconPulse 0.5s ease;
}

.delete-icon-circle i {
    font-size: 1.8rem;
    color: #ef4444;
}

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

/* ──── Item Badge ──── */
.delete-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin: 8px 0;
    max-width: 100%;
    word-break: break-all;
}

.delete-item-badge i {
    color: #64748b;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ──── Warning ──── */
.delete-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #92400e;
}

.delete-warning i {
    color: #f59e0b;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ──── Modal backdrop ──── */
#deleteConfirmModal .modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ──── Bouton supprimer — loading state ──── */
#deleteConfirmBtn.loading {
    pointer-events: none;
    opacity: 0.7;
}

#deleteConfirmBtn.loading i::before {
    content: "\F130"; /* spinner icon */
}

/* ──── Hover effect sur le bouton supprimer ──── */
#deleteConfirmBtn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ──── Override pour les boutons delete partout ──── */
.btn-delete-modal {
    transition: all 0.2s ease;
}

.btn-delete-modal:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
}
