body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(90deg, #003087 0%, #0055b3 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-logo {
    max-height: 50px;
    width: auto;
}

.header-content {
    flex-grow: 1;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

nav {
    margin-top: 0.5rem;
}

nav a {
    color: white;
    margin: 0 1.5rem;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #ffcc00;
    text-decoration: none;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

main.login-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
    margin: 0;
}

h2 {
    color: #003087;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #003087;
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr.overdue {
    background-color: #fff1f1;
}

tr:hover {
    background-color: #f1f3f5;
    transition: background-color 0.2s ease;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 500px;
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

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

label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: #444;
}

input, select, textarea {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: #003087;
    outline: none;
}

button {
    padding: 0.75rem;
    background-color: #003087;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover {
    background-color: #0055b3;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.error {
    color: #d32f2f;
    font-weight: 600;
    text-align: center;
}

.success {
    color: #2e7d32;
    font-weight: 600;
    text-align: center;
}

.login-logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-height: 150px;
    width: auto;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.action-button.edit {
    background-color: #4caf50;
    color: white;
}

.action-button.delete {
    background-color: #d32f2f;
    color: white;
}

.action-button:hover {
    transform: translateY(-1px);
}

.action-button.edit:hover {
    background-color: #45a049;
}

.action-button.delete:hover {
    background-color: #b71c1c;
}

.action-button .icon {
    font-size: 0.9rem;
}

.loan-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.2rem;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.loan-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.loan-action-btn.marked {
    background-color: #2196f3;
    color: white;
}

.loan-action-btn.delete {
    background-color: #d32f2f;
    color: white;
}

.loan-action-btn:hover {
    transform: translateY(-1px);
}

.loan-action-btn.marked:hover {
    background-color: #1976d2;
}

.loan-action-btn.delete:hover {
    background-color: #b71c1c;
}

.loan-action-btn .icon {
    font-size: 0.8rem;
}

select[name="etat_retour"] {
    padding: 0.2rem;
    font-size: 0.7rem;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.user-forms-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.user-form, .import-form {
    flex: 1;
    min-width: 300px;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.nav-icon, .button-icon {
    margin-right: 0.5rem;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    .header-logo {
        margin-bottom: 1rem;
    }

    nav a {
        margin: 0 0.5rem;
        font-size: 1rem;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    th {
        display: none;
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        width: 50%;
    }

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

    .login-logo {
        max-height: 100px;
    }

    main.login-main {
        min-height: calc(100vh - 200px);
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .loan-actions {
        flex-direction: column;
        gap: 0.3rem;
    }

    .user-forms-container {
        flex-direction: column;
    }
}