body {
    margin: 0;
    padding: 0;
    font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ef 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 32px 24px;
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-container h1 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: #222;
    letter-spacing: 1px;
}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

input[type="text"],
input[type="password"] {
    padding: 14px 16px;
    border: 1px solid #e0e7ef;
    border-radius: 12px;
    font-size: 1rem;
    background: #f4f6fa;
    transition: border 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border: 1.5px solid #007aff;
    outline: none;
    background: #fff;
}

button[type="submit"] {
    padding: 14px 0;
    background: linear-gradient(90deg, #007aff 0%, #0051a8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,122,255,0.08);
    transition: background 0.2s;
}

button[type="submit"]:active {
    background: #0051a8;
}

.error-msg {
    color: #d90429;
    background: #ffeaea;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    margin-top: 8px;
    text-align: center;
}

@media (max-width: 480px) {
    .login-container {
        padding: 24px 8px;
        max-width: 98vw;
    }
    h1 {
        font-size: 1.5rem;
    }
}

/* Responsive pour tous les conteneurs principaux et éléments */
@media (max-width: 900px) {
  .admin-container,
  .client-container,
  .form-container,
  .dashboard-container {
    max-width: 98vw;
    padding: 16px 4vw;
    border-radius: 12px;
  }
  .piece-list, .user-list, .chariot-list, .poste-list, .cmd-list {
    margin: 16px 0 0 0;
    padding: 0 2vw;
  }
  .piece-item, .user-item, .chariot-item, .poste-item, .cmd-item {
    padding: 12px 6px;
    margin-bottom: 16px;
    border-radius: 10px;
    font-size: 0.98rem;
  }
  .piece-item img, .chariot-item img, .user-item img {
    width: 44px;
    height: 44px;
  }
  .piece-info strong, .user-info strong, .chariot-info strong, .poste-info strong {
    font-size: 1.1rem;
  }
  .form-section label, .form-section input, .form-section select, .form-section button {
    font-size: 1rem;
  }
  .filtre-form {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .filtre-form select {
    min-width: 0;
    width: 100%;
  }
  .commande-form input[type='number'],
  .commande-form input[type='text'] {
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
  }
  .commande-form textarea {
    width: 100%;
  }
  .menu a, .menu button {
    font-size: 1rem;
    padding: 10px 0;
  }
}

@media (max-width: 600px) {
  body {
    align-items: flex-start;
    justify-content: flex-start;
  }
  .admin-container,
  .client-container,
  .form-container,
  .dashboard-container {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    min-height: 100vh;
  }
  .piece-list, .user-list, .chariot-list, .poste-list, .cmd-list {
    padding: 0 1vw;
  }
}

@media (max-width: 400px) {
  .admin-container,
  .client-container,
  .form-container,
  .dashboard-container {
    padding: 4px 0;
  }
  .piece-info strong, .user-info strong, .chariot-info strong, .poste-info strong {
    font-size: 1rem;
  }
}

/* Largeur max par défaut sur desktop */
.admin-container { max-width: 600px; }
.client-container { max-width: 700px; }
.form-container { max-width: 600px; }
.dashboard-container {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 32px 16px;
  width: 100%;
  max-width: 420px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  align-items: center;
  justify-content: center;
}
.menu a, .menu button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  background: #f4f6fa;
  border: none;
  border-radius: 14px;
  color: #222;
  font-size: 1.08rem;
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 8px #e0e7ef;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  cursor: pointer;
  padding: 0 0;
  width: 100%;
  max-width: 340px;
}
.menu a:hover, .menu button:hover {
  background: #e0e7ef;
  color: #007aff;
}
.logout-btn {
  background: linear-gradient(90deg, #007aff 0%, #0051a8 100%);
  color: #fff;
  font-weight: 600;
  margin-top: 12px;
  box-shadow: 0 2px 8px #e0e7ef;
  border-radius: 14px;
  min-height: 54px;
  font-size: 1.08rem;
  width: 100%;
  max-width: 340px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}
.logout-btn:hover {
  background: #0051a8;
  color: #fff;
}
@media (max-width: 700px) {
  .dashboard-container {
    max-width: 98vw;
    padding: 12px 2vw;
    border-radius: 12px;
    margin: 8px auto;
    min-height: 90vh;
  }
  .menu a, .menu button, .logout-btn {
    min-height: 44px;
    font-size: 1rem;
    max-width: 98vw;
  }
}

/* Grille de cartes pour les listes de pièces et similaires */
.piece-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 18px 0 0 0;
    padding: 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.piece-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e7ef;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.piece-main {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.piece-img-col {
    flex-shrink: 0;
}

.piece-img-row {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid #e0e7ef;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}

.piece-info-row {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.piece-info-row strong {
    color: #007aff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.piece-info-row div {
    font-size: 1rem;
    color: #444;
}

.piece-info-row .info-row {
    display: flex;
    gap: 24px;
}

.piece-info-row .info-row div {
    flex: 1;
}

.piece-info-row div span {
    color: #666;
    font-weight: 500;
}

.piece-actions-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.commande-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.commande-form input[type="number"],
.commande-form input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #e0e7ef;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
}

.commande-form .form-row {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.commande-form .form-row input {
    flex: 1;
    max-width: 180px;
}

.commande-form .button-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.commande-form button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.commande-form button[type="submit"] {
    background: #007aff;
    color: #fff;
}

.commande-form .annuler-btn {
    background: #e0e7ef;
    color: #222;
}

.commande-form button:hover {
    opacity: 0.9;
}

@media (max-width: 700px) {
    .piece-img-row {
        width: 80px;
        height: 80px;
    }
    
    .piece-info-row strong {
        font-size: 1.1rem;
    }
    
    .piece-info-row div {
        font-size: 0.95rem;
    }
    
    .commande-form {
        padding: 8px;
    }
    
    .commande-form input[type="number"],
    .commande-form input[type="text"] {
        font-size: 0.9rem;
    }
    
    .commande-form button {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

.main-btn {
    background: linear-gradient(90deg, #007aff 0%, #0051a8 100%);
    color: #fff !important;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 28px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,122,255,0.08);
    transition: background 0.2s, color 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
.main-btn:hover {
    background: #0051a8;
    color: #fff;
}

.user-list {
    list-style: none;
    margin: 18px 0 0 0;
    padding: 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.user-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e0e7ef;
    padding: 8px 0;
    min-height: 54px;
}
.user-item:last-child {
    border-bottom: none;
}
.user-avatar {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border: 1px solid #e0e7ef;
    background: #fff;
    margin: 0 18px 0 12px;
    flex-shrink: 0;
    display: block;
}
.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
    min-width: 0;
}
.user-info strong {
    color: #007aff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-info div {
    font-size: 0.93rem;
    color: #444;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-info div span {
    color: #666;
    font-weight: 500;
}
.user-actions {
    flex-basis: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-left: 18px;
    min-width: 100px;
}
.user-actions button {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #e0e7ef;
    color: #222;
    transition: background 0.2s, opacity 0.2s;
    width: 100%;
    margin: 0;
}
.user-actions button[type="submit"] {
    background: #007aff;
    color: #fff;
}
.user-actions button[onclick] {
    background: #ff3b30;
    color: #fff;
}
.user-actions button:hover {
    opacity: 0.9;
}
@media (max-width: 700px) {
    .user-avatar {
        width: 32px;
        height: 32px;
        margin: 0 8px 0 4px;
    }
    .user-actions {
        min-width: 60px;
        margin-left: 6px;
    }
    .user-info strong, .user-info div {
        font-size: 0.89rem;
    }
    .user-actions button {
        padding: 2px 5px;
        font-size: 0.82rem;
    }
}

.chariot-list {
    list-style: none;
    margin: 18px 0 0 0;
    padding: 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.chariot-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e0e7ef;
    margin-bottom: 18px;
    padding: 14px 18px 10px 18px;
    min-height: 44px;
    box-shadow: 0 2px 8px #e0e7ef;
}
.chariot-item:last-child {
    margin-bottom: 0;
}
.chariot-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    min-width: 0;
    justify-content: center;
}
.chariot-number {
    color: #007aff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.chariot-row {
    display: flex;
    flex-direction: row;
    gap: 0;
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 0;
}
.chariot-row span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #444;
}
.chariot-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 6px;
    margin-left: 18px;
    min-width: 90px;
}
.chariot-actions button {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #e0e7ef;
    color: #222;
    transition: background 0.2s, opacity 0.2s;
    width: 90px;
    margin: 0;
}
.chariot-actions button[type="submit"] {
    background: #007aff;
    color: #fff;
}
.chariot-actions button[onclick] {
    background: #ff3b30;
    color: #fff;
}
.chariot-actions button:hover {
    opacity: 0.9;
}
@media (max-width: 700px) {
    .chariot-item {
        padding: 8px 4px 6px 4px;
    }
    .chariot-number {
        font-size: 1.05rem;
    }
    .chariot-row {
        font-size: 0.93rem;
    }
    .chariot-actions {
        min-width: 60px;
        margin-left: 6px;
    }
    .chariot-actions button {
        padding: 2px 5px;
        font-size: 0.82rem;
        width: 60px;
    }
}

.poste-list {
    list-style: none;
    margin: 18px 0 0 0;
    padding: 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.poste-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e0e7ef;
    padding: 8px 0;
    min-height: 54px;
}
.poste-item:last-child {
    border-bottom: none;
}
.poste-avatar {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border: 1px solid #e0e7ef;
    background: #fff;
    margin: 0 18px 0 12px;
    flex-shrink: 0;
    display: block;
}
.poste-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
    min-width: 0;
}
.poste-info strong {
    color: #007aff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.poste-info div {
    font-size: 0.93rem;
    color: #444;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.poste-info div span {
    color: #666;
    font-weight: 500;
}
.poste-actions {
    flex-basis: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-left: 18px;
    min-width: 100px;
}
.poste-actions button {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #e0e7ef;
    color: #222;
    transition: background 0.2s, opacity 0.2s;
    width: 100%;
    margin: 0;
}
.poste-actions button[type="submit"] {
    background: #007aff;
    color: #fff;
}
.poste-actions button[onclick] {
    background: #ff3b30;
    color: #fff;
}
.poste-actions button:hover {
    opacity: 0.9;
}
@media (max-width: 700px) {
    .poste-avatar {
        width: 32px;
        height: 32px;
        margin: 0 8px 0 4px;
    }
    .poste-actions {
        min-width: 60px;
        margin-left: 6px;
    }
    .poste-info strong, .poste-info div {
        font-size: 0.89rem;
    }
    .poste-actions button {
        padding: 2px 5px;
        font-size: 0.82rem;
    }
}

.cmd-list {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cmd-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    background: none;
    border-bottom: 1px solid #e0e7ef;
    padding: 8px 0 4px 0;
    min-height: 44px;
}
.cmd-item:last-child {
    border-bottom: none;
}
.cmd-photo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid #e0e7ef;
    background: #fff;
    margin: 0 14px 0 0;
    flex-shrink: 0;
    display: block;
    align-self: flex-start;
}
.cmd-mainblock {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}
.cmd-row {
    display: flex;
    flex-direction: row;
    gap: 0;
    font-size: 0.93rem;
    margin-bottom: 0;
}
.cmd-row span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmd-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    min-width: 0;
    font-size: 0.93rem;
    color: #444;
}
.cmd-info div {
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmd-info strong {
    color: #007aff;
    font-size: 0.97rem;
    font-weight: 600;
    margin-right: 4px;
}
.cmd-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 6px;
    align-items: center;
}
.cmd-actions button {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #e0e7ef;
    color: #222;
    transition: background 0.2s, opacity 0.2s;
    margin: 0;
}
.cmd-actions button[type="submit"] {
    background: #007aff;
    color: #fff;
}
.cmd-actions button[onclick] {
    background: #ff3b30;
    color: #fff;
}
.cmd-actions button:hover {
    opacity: 0.9;
}
@media (max-width: 700px) {
    .cmd-photo {
        width: 28px;
        height: 28px;
        margin: 0 6px 0 0;
    }
    .cmd-info strong, .cmd-info {
        font-size: 0.89rem;
    }
    .cmd-actions button {
        padding: 2px 5px;
        font-size: 0.82rem;
    }
}

.dashboard-welcome {
  background: none;
  color: #111;
  border-radius: 0;
  padding: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  width: 100%;
  max-width: 100%;
  box-shadow: none;
  letter-spacing: 1px;
}
@media (max-width: 700px) {
  .dashboard-welcome {
    font-size: 1.1rem;
    padding: 0;
    max-width: 98vw;
  }
}

/* --- Styles ADMIN pour la grille de cartes de pièces --- */
.piece-list-admin {
    list-style: none;
    margin: 18px 0 0 0;
    padding: 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.piece-item-admin {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e0e7ef;
    padding: 8px 0;
    min-height: 54px;
}
.piece-item-admin:last-child {
    border-bottom: none;
}
.piece-avatar-admin {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 1px solid #e0e7ef;
    background: #fff;
    margin: 0 18px 0 12px;
    flex-shrink: 0;
    display: block;
}
.piece-info-admin {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
    min-width: 0;
}
.piece-info-admin strong {
    color: #007aff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.piece-info-admin div {
    font-size: 0.93rem;
    color: #444;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.piece-info-admin div span {
    color: #666;
    font-weight: 500;
}
.piece-actions-admin {
    flex-basis: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-left: 18px;
    min-width: 100px;
}
.piece-actions-admin button {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #e0e7ef;
    color: #222;
    transition: background 0.2s, opacity 0.2s;
    width: 100%;
    margin: 0;
}
.piece-actions-admin button[type="submit"] {
    background: #007aff;
    color: #fff;
}
.piece-actions-admin button[onclick] {
    background: #ff3b30;
    color: #fff;
}
.piece-actions-admin button:hover {
    opacity: 0.9;
}
@media (max-width: 700px) {
    .piece-avatar-admin {
        width: 50px;
        height: 50px;
        margin: 0 8px 0 4px;
    }
    .piece-actions-admin {
        min-width: 60px;
        margin-left: 6px;
    }
    .piece-info-admin strong, .piece-info-admin div {
        font-size: 0.89rem;
    }
    .piece-actions-admin button {
        padding: 2px 5px;
        font-size: 0.82rem;
    }
}