/* ═══════════════════════════════════════════════════════
   FCIL Membres — v2 Design System (Light FCIL Branding)
   ═══════════════════════════════════════════════════════ */

/* ─── Reset & Variables ─────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --fcil-blue: #2c5aa0;
    --fcil-blue-dark: #1e3f73;
    --fcil-blue-light: #e8f0fe;
    --fcil-green: #8cc63f;
    --fcil-green-dark: #6aa22d;
    --fcil-green-light: #f0f9e8;

    --bg-body: #f5f7fa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafe;
    --bg-sidebar: #fafbfd;
    --border: #e2e8f0;
    --border-hover: #c5d1e0;
    --text-primary: #1a2332;
    --text-secondary: #5a6b7f;
    --text-muted: #94a3b8;
    --accent: var(--fcil-blue);
    --accent-hover: var(--fcil-blue-dark);
    --accent-light: var(--fcil-blue-light);
    --success: #22c55e;
    --success-bg: #f0fdf4;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ─── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    white-space: nowrap;
    background: var(--bg-white);
}

.btn:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--fcil-blue);
    border-color: var(--fcil-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--fcil-blue-dark);
    border-color: var(--fcil-blue-dark);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
}

.btn-sync {
    background: var(--fcil-green-light);
    border-color: var(--fcil-green);
    color: var(--fcil-green-dark);
}

.btn-sync:hover {
    background: #e4f5d4;
}

.btn-sync:disabled {
    opacity: 0.5;
    cursor: wait;
}

.btn-admin {
    background: var(--fcil-blue-light);
    border-color: var(--fcil-blue);
    color: var(--fcil-blue);
}

.btn-admin:hover {
    background: #d6e4f8;
}

.btn-logout {
    background: var(--error-bg);
    border-color: #fecaca;
    color: var(--error);
    padding: 8px 12px;
}

.btn-logout:hover {
    background: #fee2e2;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

.btn-danger {
    background: var(--error-bg);
    border-color: #fecaca;
    color: var(--error);
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-success {
    background: var(--success-bg);
    border-color: #bbf7d0;
    color: #16a34a;
}

.btn-success:hover {
    background: #dcfce7;
}

.btn-icon {
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.btn-icon:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
}

/* ─── Alerts ────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    color: var(--error);
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--fcil-blue-light) 0%, #f5f7fa 40%, var(--fcil-green-light) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.login-logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--fcil-blue);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--fcil-blue);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15);
    background: #fff;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.toggle-password:hover {
    opacity: 1;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    height: 32px;
    width: auto;
}

.nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fcil-blue);
    letter-spacing: -0.3px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── Sync status bar ───────────────────────────────── */
.sync-status {
    text-align: center;
    padding: 5px 16px;
    background: var(--accent-light);
    color: var(--text-secondary);
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
}

.sync-feedback {
    margin: 16px 24px 0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-white);
    animation: slideDown 0.3s ease;
}

.sync-feedback-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
}

.sync-success {
    border-color: #bbf7d0;
    background: var(--success-bg);
}

.sync-error {
    border-color: #fecaca;
    background: var(--error-bg);
}

.spinning {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════
   CONTENT
   ═══════════════════════════════════════════════════════ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
}

/* ─── Breadcrumb ────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 10px 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.btn-zip {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-zip:hover {
    background: var(--accent);
    color: #fff;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.breadcrumb-item:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ─── Search & Filters ─────────────────────────────── */
.search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}

.search-bar:focus-within {
    border-color: var(--fcil-blue);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.search-icon {
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-spinner {
    display: none;
    font-size: 0.9rem;
}

.search-bar.loading .search-spinner {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

.search-clear {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0 4px;
}

.search-clear.visible {
    display: block;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* Filters bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-chip:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.filter-chip.active {
    background: var(--fcil-blue);
    border-color: var(--fcil-blue);
    color: #fff;
}

.filter-chip .chip-icon {
    font-size: 0.85rem;
}

.filter-chip .chip-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.filter-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.25);
}

.filter-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.sort-select {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    margin-left: auto;
}

.sort-select:focus {
    border-color: var(--accent);
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    max-height: 420px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-results.visible {
    display: block;
    animation: slideDown 0.2s ease;
}

.search-results-header {
    padding: 8px 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-body);
    position: sticky;
    top: 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: var(--text-primary);
}

.search-result-item:hover {
    background: var(--accent-light);
}

.search-result-item .result-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.search-result-item .result-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .result-name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .result-name mark {
    background: #fef08a;
    border-radius: 2px;
    padding: 0 1px;
    color: inherit;
}

.search-result-item .result-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.search-result-item .result-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    text-align: right;
}

.search-no-results {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── File Grid ─────────────────────────────────────── */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.file-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    overflow: hidden;
}

.file-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
}

.file-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.file-icon-folder {
    background: #fef3c7;
}

.file-icon-pdf {
    background: #fee2e2;
}

.file-icon-word {
    background: var(--fcil-blue-light);
}

.file-icon-excel {
    background: var(--fcil-green-light);
}

.file-icon-image {
    background: #f3e8ff;
}

.file-icon-default {
    background: var(--bg-body);
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 500;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: translateX(-6px);
    transition: all var(--transition);
}

.file-card:hover .file-actions {
    opacity: 1;
    transform: translateX(0);
}

.file-action-btn {
    padding: 6px 8px;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 1rem;
    background: transparent;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.file-action-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.file-action-btn.download-btn:hover {
    background: var(--fcil-green-light);
    color: var(--fcil-green-dark);
}

/* ─── View Toggle ───────────────────────────────────── */
.view-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-body);
    border-radius: var(--radius-xs);
    padding: 2px;
}

.view-toggle-btn {
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all var(--transition);
}

.view-toggle-btn.active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* List view */
.file-grid.list-view {
    grid-template-columns: 1fr;
    gap: 2px;
}

.file-grid.list-view .file-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.file-grid.list-view .file-card:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.file-grid.list-view .file-card:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.file-grid.list-view .file-icon {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
}

.file-grid.list-view .file-link {
    padding: 8px 16px;
}

/* ─── Empty State ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ─── Footer ────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-logo {
    height: 18px;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════
   PREVIEW PAGE
   ═══════════════════════════════════════════════════════ */
.preview-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    z-index: 10;
}

.preview-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-toolbar-left .btn-back {
    font-size: 1.2rem;
}

.preview-file-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.preview-file-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.preview-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-frame {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    overflow: hidden;
}

.preview-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: var(--shadow-xl);
    background: #fff;
}

.preview-unsupported {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    max-width: 400px;
}

.preview-unsupported .preview-big-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.preview-unsupported h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.preview-unsupported p {
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Excel preview table */
.excel-preview {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background: var(--bg-body);
}

.excel-preview table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    font-size: 0.85rem;
    box-shadow: var(--shadow);
}

.excel-preview th,
.excel-preview td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.excel-preview th {
    background: var(--fcil-blue);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.excel-preview tr:nth-child(even) {
    background: var(--bg-body);
}

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

.admin-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--fcil-blue);
}

.admin-header a {
    text-decoration: none;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    text-align: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fcil-blue);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ─── Tables ────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin {
    background: rgba(44, 90, 160, 0.12);
    color: var(--fcil-blue);
}

.badge-member {
    background: var(--success-bg);
    color: #16a34a;
}

.badge-active {
    background: var(--success-bg);
    color: #16a34a;
}

.badge-inactive {
    background: var(--error-bg);
    color: var(--error);
}

.badge-login {
    background: rgba(44, 90, 160, 0.1);
    color: var(--fcil-blue);
}

.badge-download {
    background: var(--warning-bg);
    color: #d97706;
}

.badge-sync {
    background: var(--success-bg);
    color: #16a34a;
}

.badge-search {
    background: #f3e8ff;
    color: #7c3aed;
}

.badge-preview {
    background: #ecfdf5;
    color: #059669;
}

.badge-click {
    background: #eff6ff;
    color: #2563eb;
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.ip-tag {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    padding: 2px 8px;
    background: var(--bg-body);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
}

/* ─── Admin Forms ───────────────────────────────────── */
.admin-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.admin-form .form-group {
    flex: 1;
    min-width: 180px;
}

.admin-form .form-group input {
    width: 100%;
}

.admin-form .btn {
    align-self: flex-end;
    height: 42px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    max-width: 480px;
    width: 100%;
    padding: 28px;
    box-shadow: var(--shadow-xl);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.modal h3 {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-title {
        font-size: 0.9rem;
    }

    .btn-text {
        display: none;
    }

    .user-email {
        display: none;
    }

    .user-info {
        margin-left: 0;
        padding-left: 0;
        border: none;
    }

    .container {
        padding: 14px 16px;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }

    .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-form {
        flex-direction: column;
    }

    .admin-form .form-group {
        min-width: 100%;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-table {
        font-size: 0.78rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .filters-bar {
        gap: 6px;
    }

    .filter-chip {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .preview-toolbar {
        padding: 8px 12px;
    }

    .preview-file-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }

    .login-logo {
        max-width: 180px;
    }

    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ─── Word Document Viewer ───────────────────────── */
.word-preview,
.excel-preview {
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    background: #f0f0f0;
}

.word-document {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 50px 60px;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    min-height: 600px;
    font-family: 'Calibri', 'Segoe UI', 'Inter', sans-serif;
    font-size: 11pt;
    line-height: 1.6;
    color: #333;
}

.word-document h1 {
    font-size: 20pt;
    color: var(--fcil-blue);
    margin: 24px 0 12px;
    border-bottom: 2px solid var(--fcil-blue);
    padding-bottom: 6px;
}

.word-document h1.doc-title {
    font-size: 24pt;
    text-align: center;
    border-bottom: none;
    margin-bottom: 8px;
}

.word-document h2 {
    font-size: 16pt;
    color: #2c5aa0;
    margin: 20px 0 10px;
}

.word-document h2.doc-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 14pt;
    margin-top: 0;
}

.word-document h3 {
    font-size: 13pt;
    color: #3a6db5;
    margin: 16px 0 8px;
}

.word-document h4 {
    font-size: 11pt;
    color: #555;
    margin: 12px 0 6px;
}

.word-document p {
    margin: 6px 0;
    text-align: justify;
}

.word-document table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 10pt;
}

.word-document table th,
.word-document table td {
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: left;
}

.word-document table th {
    background: #f5f7fa;
    font-weight: 600;
}

.word-document img {
    max-width: 100%;
    height: auto;
    margin: 8px 0;
}

.word-document ul,
.word-document ol {
    margin: 8px 0;
    padding-left: 28px;
}

.word-document li {
    margin: 3px 0;
}

.word-document a {
    color: var(--fcil-blue);
    text-decoration: underline;
}

/* ─── Excel Tabs ─────────────────────────────────── */
.excel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.excel-preview table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.82rem;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.excel-preview table th,
.excel-preview table td {
    border: 1px solid #dde3ea;
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
}

.excel-preview table th {
    background: #eef2f7;
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.excel-preview table tr:nth-child(even) {
    background: #fafbfc;
}

.excel-preview table tr:hover {
    background: #e8f0fe;
}

/* ─── Loading Spinner ────────────────────────────── */
.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--fcil-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* ─── Responsive: Word viewer ────────────────────── */
@media (max-width: 768px) {
    .word-document {
        padding: 24px 20px;
        font-size: 10pt;
    }

    .word-document h1 {
        font-size: 16pt;
    }

    .word-document h1.doc-title {
        font-size: 18pt;
    }

    .word-document h2 {
        font-size: 14pt;
    }

    .word-preview,
    .excel-preview {
        padding: 10px;
    }
}

/* ─── Upload Button ──────────────────────────────── */
.btn-upload {
    background: var(--fcil-green);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-upload:hover {
    background: #2d8a4e;
    transform: translateY(-1px);
}

/* ─── Upload Dropzone (in Partage folder) ────────── */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 20px;
    transition: all var(--transition);
    background: var(--bg-card);
    cursor: pointer;
}

.upload-dropzone.dragover {
    border-color: var(--fcil-blue);
    background: rgba(42, 101, 177, 0.05);
    transform: scale(1.01);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.dropzone-text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropzone-browse {
    background: none;
    border: none;
    color: var(--fcil-blue);
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
}

.dropzone-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ─── Upload Modal ───────────────────────────────── */
.upload-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.upload-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.upload-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.upload-modal-body {
    padding: 24px;
}

.upload-modal-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-modal-dropzone.dragover {
    border-color: var(--fcil-blue);
    background: rgba(42, 101, 177, 0.05);
}

.upload-modal-dropzone .dropzone-icon {
    font-size: 3rem;
}

.upload-modal-dropzone p {
    margin: 0;
    color: var(--text-secondary);
}

.upload-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 16px 0 0;
    padding: 10px 14px;
    background: #f0f4f9;
    border-radius: 8px;
    line-height: 1.5;
}

/* ─── Upload Queue ───────────────────────────────── */
.upload-queue {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-item {
    background: var(--bg-body);
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
}

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

.upload-item-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 65%;
}

.upload-item-size {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.upload-progress {
    height: 6px;
    background: #e5e9ef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-progress-bar {
    height: 100%;
    background: var(--fcil-blue);
    border-radius: 3px;
    width: 0;
    transition: width 0.3s ease;
}

.upload-progress-done {
    background: var(--fcil-green);
}

.upload-progress-error {
    background: #e74c3c;
}

.upload-item-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.upload-success {
    color: var(--fcil-green) !important;
    font-weight: 500;
}

.upload-error {
    color: #e74c3c !important;
    font-weight: 500;
}

/* ─── Audio Player ───────────────────────────────── */
.audio-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f0f4f9 0%, #e8eef5 100%);
}

.audio-player-container {
    text-align: center;
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    width: 100%;
}

.audio-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.audio-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
    word-break: break-word;
}

.audio-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.audio-player {
    width: 100%;
    border-radius: 12px;
    outline: none;
}

/* ─── Password Reset ─────────────────────────────── */
.forgot-password {
    text-align: center;
    margin-top: 12px;
}

.forgot-password a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color var(--transition);
}

.forgot-password a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.reset-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    text-align: center;
}

.alert-success {
    background: #e8f5e9;
    border: 1px solid #81c784;
    color: #2e7d32;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.reset-back {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.reset-back a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}

.reset-back a:hover {
    color: var(--accent);
}