/* crud-machines.css */
/* ===================== CRUD Machines ===================== */

/* Wrapper principal : flex pour formulaire + liste */
.ldi-crud-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    font-family: Arial, sans-serif;
}

/* ---------------- Formulaire ---------------- */
.ldi-crud-container.ldi-form {
    flex: 1 1 400px;
    background-color: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 300px;
}

/* Labels et champs */
.ldi-crud-container.ldi-form label {
    display: block;
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.ldi-crud-container.ldi-form input[type="text"],
.ldi-crud-container.ldi-form input[type="date"],
.ldi-crud-container.ldi-form select,
.ldi-crud-container.ldi-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ldi-crud-container.ldi-form input:focus,
.ldi-crud-container.ldi-form select:focus,
.ldi-crud-container.ldi-form textarea:focus {
    border-color: #2c7be5;
    box-shadow: 0 0 5px rgba(44, 123, 229, 0.3);
    outline: none;
}

.ldi-crud-container.ldi-form textarea {
    resize: vertical;
    min-height: 60px;
}

/* Checkbox */
.ldi-crud-container.ldi-form input[type="checkbox"] {
    margin-right: 8px;
}

/* Bouton submit */
.ldi-crud-container.ldi-form input[type="submit"] {
    margin-top: 20px;
    padding: 12px 0;
    width: 100%;
    border: none;
    border-radius: 6px;
    background-color: #2c7be5;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.ldi-crud-container.ldi-form input[type="submit"]:hover {
    background-color: #1b5bbf;
    transform: translateY(-1px);
}

/* ---------------- Liste des machines ---------------- */
.ldi-table-container {
    flex: 1 1 500px;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    max-height: 650px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    min-width: 300px;
}

/* Titre */
.ldi-table-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c7be5;
}

/* Tableau */
.ldi-table {
    width: 100%;
    border-collapse: collapse;
}

.ldi-table th,
.ldi-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.ldi-table th {
    background-color: #2c7be5;
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ldi-table tr {
    transition: background-color 0.2s;
}

.ldi-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.ldi-table tr:hover {
    background-color: #e6f0ff;
}

/* Liens actions */
.ldi-table a {
    color: #2c7be5;
    text-decoration: none;
    margin-right: 8px;
    font-weight: 500;
}

.ldi-table a:hover {
    text-decoration: underline;
}

/* ---------------- Messages ---------------- */
.notice-success {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    background-color: #e6ffed;
    border: 1px solid #00a32a;
    color: #006418;
    font-weight: bold;
}

.notice-error {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    background-color: #ffe6e6;
    border: 1px solid #cc0000;
    color: #7a0000;
    font-weight: bold;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .ldi-crud-wrapper {
        flex-direction: column;
    }
    .ldi-crud-container.ldi-form,
    .ldi-table-container {
        flex: 1 1 100%;
    }
}
