/* QSEELy - Styles
   Basé sur la charte graphique Corentin PAUL
*/

/* Variables CSS */
:root {
    --main-color: #54ca95;
    --background-color: #ffffff;
    --text-title: #333333;
    --text-body: #5b616b;
    --text-secondary: #666666;
    --border-color: #e5e5e5;
    --bg-light: #f5f5f5;
    --link-color: #0A1F0D;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
}

/* Reset et base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Poppins', Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75em;
    color: var(--text-body);
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection {
    color: #fff;
    background: var(--main-color);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-title);
    font-weight: 600;
}

h1 {
    font-size: 48px;
    line-height: 56px;
}

h2 {
    font-size: 21px;
}

h3 {
    font-size: 21px;
}

h4 {
    font-size: 18px;
}

p {
    font-size: 18px;
    line-height: 1.75em;
}

small {
    font-size: 14px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #54ca95 0%, #3db57e 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(84, 202, 149, 0.3);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-title);
    letter-spacing: -0.5px;
}

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

.nav-links {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link .lnr {
    font-size: 16px;
}

.nav-link:hover {
    color: var(--text-title);
    background: rgba(255, 255, 255, 0.8);
}

.nav-link.active {
    color: var(--main-color);
    background: var(--background-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nav-link.active .lnr {
    color: var(--main-color);
}

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

.nav-actions .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 10px;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(84, 202, 149, 0.25);
}

.nav-actions .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(84, 202, 149, 0.35);
    transform: translateY(-1px);
}

/* Trial Banner */
.trial-banner {
    background: linear-gradient(135deg, #54ca95 0%, #3db57e 100%);
    color: white;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
}

.trial-banner .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.trial-banner .lnr {
    font-size: 16px;
}

.trial-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.trial-banner a:hover {
    color: #fff;
    text-decoration: none;
}

.trial-banner-expired {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.trial-banner-expired .lnr-warning {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Main */
.main {
    flex: 1;
    padding: 40px 0;
}

/* Footer */
.footer {
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.8em 2.1em;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    background: var(--background-color);
    color: #222;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    text-decoration: none;
    box-shadow: 0px 10px 10px -8px rgba(0, 0, 0, 0.22);
}

.btn:hover {
    background: var(--border-color);
    color: #222;
}

.btn-primary {
    border-color: var(--main-color);
}

.btn-primary:hover {
    background: var(--main-color);
    color: #fff;
}

.btn-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

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

.btn-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-secondary:hover {
    background: #6c757d;
    color: #fff;
}

.btn-sm {
    padding: 0.5em 1.2em;
    font-size: 13px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Cards */
.card {
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 17px rgba(0, 0, 0, 0.12);
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 28px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
    font-weight: 400;
}

/* Filtres */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 0.5em 1.2em;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    background: var(--background-color);
    color: var(--text-body);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--main-color);
    color: var(--main-color);
}

/* Tableau des actions */
.table-wrapper {
    background: var(--background-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

.table th,
.table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-title);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--bg-light);
}

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

/* Statuts */
.status {
    display: inline-block;
    padding: 0.3em 1em;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
}

.status-todo {
    background: #e3f2fd;
    color: #1976d2;
}

.status-progress {
    background: #fff3e0;
    color: #f57c00;
}

.status-done {
    background: #e8f5e9;
    color: #388e3c;
}

.status-abandoned {
    background: #fafafa;
    color: #9e9e9e;
}

/* Actions en retard */
.row-overdue {
    background: #ffebee !important;
}

.row-overdue td {
    color: var(--danger-color);
}

.overdue-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--danger-color);
    font-size: 12px;
    font-weight: 500;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.3s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--main-color);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b616b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #388e3c;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning .lnr {
    font-size: 18px;
}

/* Actions de ligne */
.row-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.action-btn:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.action-btn.delete:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .lnr {
    font-size: 48px;
    color: var(--border-color);
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--background-color);
    border-radius: 10px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 21px;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
}

.modal-close:hover {
    color: var(--text-title);
}

/* Responsive */
@media (max-width: 991px) {
    h1 {
        font-size: 36px;
        line-height: 44px;
    }

    .page-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 0;
    }

    .header .container {
        flex-direction: column;
        gap: 12px;
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }

    .nav {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        padding: 3px;
        border-radius: 10px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        border-radius: 8px;
    }

    .nav-link span:not(.lnr) {
        display: none;
    }

    .nav-link .lnr {
        font-size: 18px;
    }

    .nav-actions {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        gap: 10px;
    }

    .nav-actions .btn-primary {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 10px;
    }

    .nav-actions .btn-primary span:not(.lnr) {
        display: none;
    }

    .user-menu {
        flex-shrink: 0;
    }

    .user-menu-btn {
        padding: 6px 10px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .user-dropdown {
        right: 0;
        min-width: 200px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .table {
        min-width: 600px;
    }

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

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

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 28px;
        line-height: 36px;
    }

    .container {
        padding: 0 15px;
    }

    .main {
        padding: 20px 0;
    }

    .card {
        padding: 20px 15px;
    }

    .modal {
        margin: 15px;
        padding: 20px;
    }

    /* Navbar mobile compact */
    .logo {
        gap: 8px;
    }

    .logo-text {
        font-size: 16px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }

    .nav-link {
        padding: 8px 10px;
    }

    .nav-link .lnr {
        font-size: 16px;
    }

    .nav-actions .btn-primary {
        padding: 8px 14px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .user-menu-btn .lnr-chevron-down {
        display: none;
    }
}

/* ==========================================
   AUTHENTIFICATION
   ========================================== */

/* Page d'authentification */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    background: #f8fdf9;
    position: relative;
    overflow-x: hidden;
    padding: 20px 0;
}

/* Cercles décoratifs en arrière-plan */
.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(84, 202, 149, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(84, 202, 149, 0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--background-color);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 12px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.auth-card:hover {
    transform: none;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 12px 40px rgba(0, 0, 0, 0.08);
}

.auth-card-large {
    max-width: 520px;
}

.auth-container:has(.auth-card-large) {
    max-width: 560px;
}

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

.auth-header .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(84, 202, 149, 0.35);
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-header p strong {
    color: var(--text-title);
}

/* Section titres dans le formulaire */
.auth-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 16px;
    margin-top: 8px;
}

/* Inputs améliorés pour auth */
.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card .form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-body);
    margin-bottom: 8px;
    display: block;
}

.auth-card .form-control {
    padding: 14px 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.auth-card .form-control:hover {
    border-color: #d0d0d0;
    background: #fff;
}

.auth-card .form-control:focus {
    outline: none;
    border-color: var(--main-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(84, 202, 149, 0.1);
}

.auth-card .form-control::placeholder {
    color: #b0b0b0;
}

/* Form row amélioré pour auth */
.auth-card .form-row {
    gap: 16px;
}

/* Bouton submit amélioré */
.auth-card .btn-primary,
.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    border: none;
    background: var(--main-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(84, 202, 149, 0.4);
    transition: all 0.2s ease;
}

.auth-card .btn-primary:hover,
.btn-block:hover {
    background: #47b585;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(84, 202, 149, 0.45);
}

.auth-card .btn-primary:active,
.btn-block:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--main-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    color: #47b585;
    text-decoration: underline;
}

/* Message de vérification en attente */
.verification-pending {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8fffe 0%, #f0faf7 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.verification-pending h3 {
    color: var(--text-color);
    font-size: 18px;
    margin-bottom: 10px;
}

.verification-pending p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Bouton style lien */
.btn-link {
    background: none;
    border: none;
    color: var(--main-color);
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: #47b585;
    text-decoration: underline;
}

/* Section 2FA */
.two-factor-info {
    padding: 10px 0;
}

.two-factor-info p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.two-factor-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 20px;
}

.two-factor-status.enabled {
    background-color: rgba(84, 202, 149, 0.1);
    color: #2d9a64;
}

.two-factor-status.disabled {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.two-factor-status .lnr {
    font-size: 18px;
}

/* Checkbox remember me amélioré */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--main-color);
    border-radius: 4px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 14px;
    color: var(--text-body);
    cursor: pointer;
    user-select: none;
}

/* Infos invitation */
.invite-info {
    background: #f8fdf9;
    border: 1px solid rgba(84, 202, 149, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.invite-info p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 4px 0;
}

.invite-info p strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive auth */
@media (max-width: 768px) {
    .auth-page {
        align-items: flex-start;
        padding: 24px 0;
    }

    .auth-container {
        max-width: 100%;
        padding: 0 16px;
    }

    .auth-container:has(.auth-card-large) {
        max-width: 100%;
    }

    .auth-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .auth-card-large {
        max-width: 100%;
    }

    .auth-card .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-header .logo-icon {
        width: 52px;
        height: 52px;
        font-size: 22px;
        margin-bottom: 16px;
    }

    .auth-header h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .auth-header p {
        font-size: 14px;
    }

    .auth-section-title {
        font-size: 14px;
        margin-bottom: 12px;
        margin-top: 4px;
    }

    .auth-card .form-group {
        margin-bottom: 16px;
    }

    .auth-card .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .auth-card .form-control {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 10px;
    }

    .auth-card .btn-primary,
    .btn-block {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 10px;
        margin-top: 8px;
    }

    .auth-footer {
        margin-top: 20px;
        padding-top: 18px;
    }

    .auth-footer p {
        font-size: 13px;
    }

    .invite-info {
        padding: 14px 16px;
        border-radius: 10px;
        margin-bottom: 20px;
    }

    .invite-info p {
        font-size: 13px;
    }

    .form-checkbox {
        margin-bottom: 20px;
    }

    .form-checkbox label {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .auth-container {
        padding: 0 12px;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .auth-header .logo-icon {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }

    .auth-header h1 {
        font-size: 20px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .auth-section-title {
        font-size: 13px;
    }

    .auth-card .form-label {
        font-size: 12px;
    }

    .auth-card .form-control {
        padding: 11px 12px;
    }

    .auth-card .btn-primary,
    .btn-block {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ==========================================
   MENU UTILISATEUR
   ========================================== */

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    padding-right: 10px;
    border: none;
    background: var(--bg-light);
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: #e8e8e8;
}

.user-menu-btn .lnr {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-menu.active .user-menu-btn .lnr {
    transform: rotate(180deg);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-info {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid var(--border-color);
}

.user-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 2px;
}

.user-info small {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-body);
    font-size: 14px;
    transition: all 0.2s ease-in-out;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--main-color);
}

.dropdown-item-danger {
    color: #dc3545;
}

.dropdown-item-danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

/* ==========================================
   MENU EXPORT
   ========================================== */

.export-menu {
    position: relative;
}

.export-menu .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-menu .btn .lnr-chevron-down {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.export-menu.active .btn .lnr-chevron-down {
    transform: rotate(180deg);
}

.export-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
}

.export-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-body);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

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

.export-item:hover {
    background: linear-gradient(135deg, rgba(84, 202, 149, 0.08) 0%, rgba(84, 202, 149, 0.04) 100%);
    color: var(--main-color);
}

.export-item .lnr {
    font-size: 18px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.export-item:hover .lnr {
    color: var(--main-color);
}

/* ==========================================
   LAYOUT ADDITIONNELS
   ========================================== */

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form row (2 colonnes) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form hint */
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: var(--main-color);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

/* Ligne inactive */
.row-inactive {
    opacity: 0.5;
}

.row-inactive:hover {
    opacity: 0.7;
}

/* ==========================================
   PIÈCES JOINTES
   ========================================== */

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

.attachments-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.attachments-list li:last-child {
    border-bottom: none;
}

.attachments-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--link-color);
    font-size: 14px;
}

.attachments-list a:hover {
    color: var(--main-color);
}

.attachments-list small {
    color: var(--text-secondary);
    font-size: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.attachment-item .lnr {
    color: var(--text-secondary);
}

.attachment-item a {
    color: var(--link-color);
    font-size: 14px;
}

.attachment-item a:hover {
    color: var(--main-color);
}

.attachment-type {
    color: var(--text-secondary);
    font-size: 12px;
}

/* File input styling */
input[type="file"].form-control {
    padding: 10px 15px;
    line-height: 1.5;
}

input[type="file"].form-control::file-selector-button {
    padding: 8px 16px;
    margin-right: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-body);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--border-color);
}

/* ==========================================
   INVITATION SUCCESS
   ========================================== */

.invite-success {
    text-align: center;
    padding: 40px 20px;
}

.invite-success .lnr {
    font-size: 64px;
    color: var(--main-color);
    margin-bottom: 20px;
}

.invite-success h2 {
    margin-bottom: 15px;
}

.invite-success p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ==========================================
   DETAIL ACTION (VIEW MODE)
   ========================================== */

.detail-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.detail-value {
    font-size: 16px;
    color: var(--text-title);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ==========================================
   PAGE COMPTE
   ========================================== */

.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title .lnr {
    color: var(--main-color);
    font-size: 20px;
}

/* Dropdown item danger */
.dropdown-item-danger {
    color: var(--danger-color);
}

.dropdown-item-danger:hover {
    background: #ffebee;
    color: var(--danger-color);
}

/* ==========================================
   DASHBOARD
   ========================================== */

/* Filtres du dashboard */
.dashboard-filters {
    margin-bottom: 24px;
    padding: 20px;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.filter-group select.form-control {
    padding: 10px 14px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

/* Grille des statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--background-color);
    border-radius: 20px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    border-radius: 0 0 4px 4px;
    background: var(--stat-accent, var(--main-color));
    opacity: 0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.stat-card:hover::before {
    opacity: 1;
    width: 80px;
}

.stat-card-warning {
    background: linear-gradient(145deg, #fffcf5 0%, #fff 100%);
    border-color: rgba(243, 156, 18, 0.15);
}

.stat-card-warning::before {
    background: linear-gradient(90deg, #f39c12, #e67e22);
    opacity: 1;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.stat-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    background: inherit;
    opacity: 0.2;
    z-index: -1;
}

.stat-icon .lnr {
    font-size: 28px;
    color: #fff;
}

.stat-icon-primary {
    background: linear-gradient(135deg, #54ca95 0%, #3db57e 100%);
    box-shadow: 0 10px 25px rgba(84, 202, 149, 0.3);
}
.stat-icon-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 10px 25px rgba(238, 90, 90, 0.3);
}
.stat-icon-warning {
    background: linear-gradient(135deg, #feca57 0%, #f39c12 100%);
    box-shadow: 0 10px 25px rgba(243, 156, 18, 0.3);
}
.stat-icon-info {
    background: linear-gradient(135deg, #54a0ff 0%, #2e86de 100%);
    box-shadow: 0 10px 25px rgba(46, 134, 222, 0.3);
}
.stat-icon-success {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
    box-shadow: 0 10px 25px rgba(32, 191, 107, 0.3);
}

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

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.kpi-header .lnr {
    font-size: 18px;
    color: var(--main-color);
}

.kpi-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kpi-progress {
    flex: 1;
    height: 10px;
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
}

.kpi-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #54ca95 0%, #3db57e 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.kpi-percentage {
    font-size: 24px;
    font-weight: 700;
    color: var(--main-color);
}

.kpi-comparison {
    font-size: 20px;
    font-weight: 600;
}

.kpi-estimated { color: var(--text-secondary); }
.kpi-separator { color: var(--text-secondary); margin: 0 5px; }
.kpi-actual.under { color: #27ae60; }
.kpi-actual.over { color: #e74c3c; }

.kpi-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-title);
}

/* Graphiques */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    padding: 24px;
}

.chart-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.donut-chart {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.donut {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: var(--background-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-total {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-title);
}

.donut-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.donut-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    border-radius: 50%;
    color: var(--text-secondary);
}

.donut-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-body);
}

.legend-value {
    font-weight: 600;
    color: var(--text-title);
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 120px;
    font-size: 13px;
    color: var(--text-body);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar {
    height: 24px;
    background: linear-gradient(90deg, #54ca95 0%, #3db57e 100%);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.5s ease;
}

.bar-alt {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
}

.bar-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-title);
    min-width: 30px;
}

/* Evolution Chart */
.evolution-chart {
    padding: 10px 0;
}

.evolution-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 200px;
    gap: 10px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.evolution-month {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.evolution-bar-group {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    flex: 1;
    width: 100%;
    justify-content: center;
}

.evolution-bar {
    width: 24px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: height 0.5s ease;
}

.evolution-bar.created {
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
}

.evolution-bar.completed {
    background: linear-gradient(180deg, #54ca95 0%, #3db57e 100%);
}

.evolution-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.evolution-label {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.evolution-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.evolution-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    font-size: 13px;
}

.evolution-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.evolution-legend .legend-color.created {
    background: #3498db;
}

.evolution-legend .legend-color.completed {
    background: #54ca95;
}

/* Tables grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Mini table */
.mini-table {
    display: flex;
    flex-direction: column;
}

.mini-table-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-body);
    text-decoration: none;
    transition: all 0.2s ease;
}

.mini-table-row:last-child {
    border-bottom: none;
}

.mini-table-row:hover {
    background: var(--bg-light);
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.mini-table-row.overdue {
    background: #fff5f5;
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.mini-table-main {
    flex: 1;
    min-width: 0;
}

.mini-table-title {
    font-weight: 500;
    color: var(--text-title);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-table-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.mini-table-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.mini-table-date.text-danger {
    color: #e74c3c;
}

/* Status small */
.status-small {
    padding: 2px 8px;
    font-size: 11px;
}

/* Empty state small */
.empty-state-small {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

.empty-state-small .lnr {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
    color: var(--main-color);
    opacity: 0.5;
}

.empty-state-small p {
    margin: 0;
    font-size: 14px;
}

/* Card footer */
.card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* Badge danger */
.badge-danger {
    background: #e74c3c;
}

/* Responsive dashboard */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .charts-grid,
    .tables-grid {
        grid-template-columns: 1fr;
    }

    .donut-chart-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .filters-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .stat-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .stat-icon .lnr {
        font-size: 22px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 10px;
    }

    .bar-label {
        width: 80px;
        font-size: 12px;
    }

    .evolution-bar {
        width: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        text-align: left;
        padding: 18px;
    }

    .stat-content {
        align-items: flex-start;
    }

    .stat-card::before {
        left: 0;
        transform: none;
        width: 4px;
        height: 60px;
        top: 50%;
        transform: translateY(-50%);
        border-radius: 0 4px 4px 0;
    }

    .stat-card:hover::before {
        width: 4px;
        height: 80px;
    }
}
